Better HN
topnewbestaskshowjobs
Log inSign up

SlySherZ

177 karma · joined Mar 21, 2016 (10y ago) · 56 submissions

Submissions

comment 2y ago · link · parent

Do you know how to create a local branch that tracks a gerrit commit? Usually I just do git commit --amend to update gerrit, but then I lose access to my patch's history (it's still on gerrit, but I want it locally).

2.

Just one swimming world record has fallen at the Olympics. Is the pool to blame?(theguardian.com ↗)

2 points · by SlySherZ · 2y ago · discuss

comment 3y ago · link · parent

The article is hard to follow for me, but if I understood it correctly, this is not true:

> That is just not going to happen in (classical) reality, though. Because once you properly set the initial state of the ball (force=velocity=0, or any other values), then the solution becomes unique

If you set velocity = velocity = 0, then the ball staying at the top is a valid solution, AND the ball rolling down the hill (in any direction) is also a valid solution.

If this sounds confusing (it did for me), look at the example at the end, it's possible to do the reverse - send the ball rolling up the hill with perfect velocity, such that it stops at the very top after time T. And if that is possible, the opposite is also possible because NM is time reversible.

comment 4y ago · link · parent

There's a common way people from scientific communities (such as HN) look at the world - there's a "real world" out there, and in order to improve our understanding of things we should approximate (discover the rules that govern) this real world and try to minimize our subjective experiences as much as possible. I fully subscribe to this view, the real world has to be same for everyone, right?

But there's another way to look at things which is prevalent in other circles, and if someday you decide to learn to meditate, I'm confident you'll get it.

How do you know the "real world" exists? Maybe you're a brain inside a jar "in the machine", and all the things you experience are being generated by the machine. In that case, how is an hallucination any different from any other experience you have? It isn't, it's exactly the same, it's just another experience. How you interpret it may be different, if you realize it's an hallucination, but the process itself is the same.

When you look at a tree, you can't just see the tree, you can only see the model that your mind creates of that tree, from the light that reaches your eyes, the sound, maybe touch etc - this is true for everything you experience.

Obviously the first perspective is very useful, it's science. But the second perspective is also very very useful, if you want to know why I can elaborate : )

comment 4y ago · link · parent

Portugal, either Porto or Braga. Let me know if you'd like to meet!

comment 5y ago · link · parent

If you like this, do yourself a favor and go watch the entire Human Behavioral Biology course from Standford, it's also taught by Sapolsky: https://www.youtube.com/watch?v=NNnIGh9g6fA

What I think makes the course so good is that it gives you a brief but solid introduction to many different fields:

    - Behavioral Evolution
    - Molecular Genetics
    - Behavioral Genetics
    - Ethology
    - Neuroscience
    - Neurology and Endocrinology
And then combines all of those to try to make sense of human behavior, by looking at animal and human behavior from all these different lenses.

comment 5y ago · link · parent

Alright, I'll try.

Last time you used an higher level interpreted language (like JS), did you have to worry whether or not the machine instructions it was generating were the right ones? Generating instructions at runtime sounds pretty unsafe, no?

You didn't, right? You can just mostly assume the language works and get on with your life. That's how unsafe feels to me when I'm programming in Rust, I never have to worry about it and pretty much never need to use it.

Sometimes you'll run into a problem where you need to use unsafe, but that only happens very very rarely, for example when creating an interface to a C library, but most people will never need that. When that happens, sure, you'll have to be extra careful and make sure everything works. But after you're done with that small piece, you're back into safe Rust.

So, how does it work in practice, if you really need to use unsafe? Suppose you have a C enum with values MyEnum {A, B, C} (but it can be any int in C!), and you want to use it in Rust. You can make an unsafe wrapper that tries to parse the enum, and it can either return None - if it was an invalid integer, or return Some(A), Some(B), Some(C).

But once you get the wrapper right (which is not hard), Rust will guarantee that values of type MyEnum have values A, B or C and nothing else, so you never need to worry about the exceptional case again.

You worry about it once at the boundary and that's it.

comment 6y ago · link · parent

Location: Portugal

Remote: yes

Willing to relocate: no

Technologies: JavaScript (Node), C/C++, Ruby, Rust, Elixir, Python

Résumé/CV: https://github.com/slysherz/slysherz.github.io/blob/master/d...

Email: slysherz@gmail.com

Generalist software engineer with strong math skills.

comment 6y ago · link · parent

Location: Portugal

Remote: Yes

Willing to relocate: not at the moment

Technologies: JavaScript (NodeJS), C/C++, Ruby, Rust, Elixir

Résumé/CV: https://github.com/slysherz/slysherz.github.io/raw/master/di...

Email: slysherz@gmail.com

comment 7y ago · link · parent

For everyone that enjoyed this, there's an entire free online MIT course called Performance Engineering of Software Systems[1] where you'll learn plenty more tricks and common pitfalls like these. You'll also learn how to use tools to debug the low level performance of your programs: looking at cache misses, cpu utilization, time spent per assembly operation and so on. It's pretty cool :)

[1] https://ocw.mit.edu/courses/electrical-engineering-and-compu...

comment 7y ago · link · parent

Location: Esposende, Portugal

Remote: Yes

Willing to relocate: No

Technologies: Javascript, NodeJS, C++ but also dabble in Ruby, Rust and Elixir

Résumé/CV: Available on request

Email: slysherz (at) gmail (dot) com

Khan Academy: https://www.khanacademy.org/profile/SlySherZ/profile

Github: https://github.com/slysherz

Self-taught programmer with almost 3 years of experience. I started a Physics degree but left midway through to study programming and computer science, using formal online resources like MIT OpenCourseWare. I love Physics, Math, solving hard problems and learning new things.

comment 8y ago · link · parent

If I remember correctly, when you learn a new language after age 10, the brain encodes the new language in a region adjacent to the one where your mother language is encoded, which means that any localized injury on this part of the brain may impact your ability to speak just one of them.

Source: Sapolsky's lecture about language: https://www.youtube.com/watch?v=SIOQgY1tqrU&list=PL150326949...

If you want to understand better how the brain works, I really recommend watching the whole course.

comment 8y ago · link · parent

Elixir newbie here. If I remember correctly IO is implemented as a process, which means that different write requests are processed sequentially in the order they arrive to the process. The following link has more information: http://erlang.org/doc/apps/stdlib/io_protocol.html

comment 8y ago · link · parent

Yes, there is JSDoc[1] which allows you to add type annotations in comments, that can then be used by some tool.

The VSCode editor is able to leverage the TypeScript engine even with vanilla JS to automatically infer types and also supports JSDoc. Basically you write vanilla JS, add JSDoc comments here and there when the inference doesn't work as you want and it gives you most benefits of a typed language, without tying yourself to a specific ecosystem (your teammates could be using something else entirely). It works pretty well.

[1] http://usejsdoc.org/

15.

Portuguese ANACOM: “40 Days to Change Offers That Violate Net Neutrality”(translate.google.com ↗)

1 points · by SlySherZ · 8y ago · discuss

comment 8y ago · link · parent

As @Cursuviam said, Introduction to Algorithms is a pretty good introduction:

https://www.youtube.com/playlist?list=PLUl4u3cNGP61Oq3tWYp6V...

There are two things that make the lectures difficult to follow, IMO:

The first thing is that you need to be comfortable with the names that are given to things, understand well the simpler data structures like different kinds of trees, linked lists, graphs and so on, with their corresponding operation running times. Go watch Algorithms and you'll be fine :)

The second is that the subject is really hard. During the course, most of the time we're learning about (close to) state of the art data structures, so don't expect to understand everything in one go.

If you want to understand it in depth, you'll probably have to more time studying each lecture. Try thinking about how you'd solve the problem, try to understand the proposed solution and go through the video very slowly making sure you understand the details, try to implement at least some of them.

I used these lectures as a way to get comfortable with the field and get a broad overview of the kind of solutions that usually work, so I still have to go through most of Step 2.

comment 8y ago · link · parent

For everyone interested in this, I would like to recommend the MIT Advanced Data Structures course, by prof. Erik Demaine (mentioned in the article). The part of the course about cache oblivious data structures starts on this lecture:

https://www.youtube.com/watch?v=V3omVLzI0WE

18.

Microsoft Introduces New Privacy Tools in Windows 10(blogs.windows.com ↗)

3 points · by SlySherZ · 8y ago · discuss

comment 8y ago · link · parent

The graphs about languages seem very weird. Let's take a look at the "Which languages do developers prefer by age?":

Python: 84.6%

C: 54.0%

C++: 48.2%

Java: 48.2%

JavaScript: 47.6%

...

Ruby: 21.0%

Why is Python so far ahead of everything else? Why is Ruby, which is all about programmer happiness so far down?

It seems people actually like JavaScript. Wait, people do actually like C++?!?

Also if you take a look at Go by age, for example, it goes from 53.6% (35-44) up to 67.8% (45-54) and back down to 7.6% (55+). I don't see a reason for such a huge preference variation. There's also a few 0.0% with 55+ years.

It seems there weren't enough answers for this to be anywhere near conclusive.

comment 8y ago · link · parent

Using uBlock with Firefox, you can right click anywhere on the page and open the "block element" thingy, which allows you to block anything on the page that you don't like :)

comment 8y ago · link · parent

Notice that your first and last example are somewhat simple to explain conceptually, so they should also be simple to build by composing the right building blocks:

"Play" gives away the fact you're looking for a song or list of songs, songs which you'll hopefully have in an internal knowledge base.

"all Coldplay songs": just filter by Coldplay. If your library is big enough, you could figure out that it refers to the artist.

"that": we need to filter again by the condition which follows.

Speeding up... "were the most popular of their album": take each song and corresponding album, sort album by property "popularity" and check it's the first one. You'll need to know "popular" refers to the property "popularity".

The third one is pretty similar. The second one could be easy too, but the piece "about love" is complicated on it's own.

IMO this means three things: firstly, words don't map directly to commands / capabilities, which means that having a composable way define capabilities is hard. You'll likely need to define many ways to do each thing, but you could add them one by one, over time. Secondly, the tool should be able to tell that it doesn't know what you're talking about (what is this "about love" thing about?!?). Lastly, it should be interactive, so that it can ask/tell you when it doesn't know ("what list do you mean, A or B").

Your comment about context is on point. We can't expect the tool to understand context it doesn't know about, which is why we cannot expect human level from this. But it doesn't have to be human level, it just needs to be good enough to be useful, and we do have a lot of space to improve.

We spend years learning this stuff, we could slowly teach a few tricks to the computer ;)

comment 8y ago · link · parent

I've been thinking about this for a while, there are some cool things you could do with command-based interfaces.

My take on it atm is to have a flexible (should work if you mistype a letter) command-based interface which is both voice and text based, where you can perform commands like:

play songs from coldplay

set alarm to friday at 3pm

make list with words a, b and c. Give me a random item from the list

There are some tricky parts though: - Should it be context aware? Notice how I, in the second part of the last command mentioned "the list". I think it should, and maybe even ask "which list?" in case there is more than one.

- How do you define commands in a way that makes it easy to add and compose commands, and reduces or eliminates the ambiguity for the parser?

- Is the kind of parsing you do in voice recognition similar enough to be compatible with text parsing?

If someone know about some tool similar to this, please let me know.

EDIT: Fixed typo.

comment 8y ago · link · parent

For me, the most awesome part is the debugging experience out of the box. If you're programming for NodeJs (or other supported languages, with a bit of configuration), you can click on the side to add a breakpoint and hit F5 to run, step over your code and hover variable names to see what they hold, evaluate expressions to change things and stuff like that. Still in the JS world, VS Code uses the TypeScript engine to infer variable types and detect type errors, which by itself catches a lot of bugs.

These features aren't unique to the JS language though. Extentions do have access to the APIs that implement these features, so you already have them available for most languages (with different levels of quality/completeness).

24.

Firefox Privacy Notice(mozilla.org ↗)

2 points · by SlySherZ · 9y ago · discuss

comment 9y ago · link · parent

I've tried this and the distribution stays pretty close to constant. You can check it out, just comment line 13 and uncomment 15-18: https://www.khanacademy.org/computer-programming/yet-another...

comment 9y ago · link · parent

My experience with e10s enabled has been a very smooth.

If you want to check wheter or not it's active for you, go to: about:support and look at "Multiprocess Windows"

comment 9y ago · link · parent

I just tried it out and it's very smooth with Nightly. The CPU spikes, but it doesn't lag at all.

comment 9y ago · link · parent

This website is slugish as hell. Every time I scroll my cpu usage jumps to ~30% and I have ~2FPS, using the latest version of Firefox.

On Chrome the CPU still spikes, but it's no nearly as bad.

comment 9y ago · link · parent

I can confirm for Firefox. Right click the tab -> Pin Tab. It shows up as a symbol only (hides the title) leftmost tab and never goes away.

Here's more info, with images of how it looks like: https://support.mozilla.org/t5/Learn-the-Basics-get-started/...

12