HNHacker News
TopNewBestAskShowJobs

SlySherZ

177 karma · joined March 21, 2016

submissionscomments
SlySherZ··on Some of us like "interdiff" code review
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).
SlySherZ··on The Dome: A simple violation of determinism in Newtonian mechanics (2005)
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.

SlySherZ··on The life-changing effects of hallucinations
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 : )

SlySherZ··on Ask HN: Does Hacker News still do in person meet ups?
Portugal, either Porto or Braga. Let me know if you'd like to meet!
SlySherZ··on Robert Sapolsky on Depression (2009)
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.
SlySherZ··on Is Rust Used Safely by Software Developers?
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.

SlySherZ··on Ask HN: Who wants to be hired? (February 2020)
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.

SlySherZ··on Ask HN: Who wants to be hired? (December 2019)
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

SlySherZ··on Common Systems Programming Optimizations and Tricks
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...

SlySherZ··on Ask HN: Who wants to be hired? (September 2019)
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.

SlySherZ··on I woke up unable to speak English
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.

SlySherZ··on Haskell's Missing Concurrency Basics (2016)
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
SlySherZ··on Announcing the Second Edition of “Refactoring”
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/

SlySherZ··on An Introduction to Cache-Oblivious Data Structures
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.

SlySherZ··on An Introduction to Cache-Oblivious Data Structures
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

SlySherZ··on Developer Skills Report
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.

SlySherZ··on What Really Happened with Vista: An Insider's Retrospective
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 :)
SlySherZ··on Facebook’s Virtual Assistant M Is Dead
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 ;)

SlySherZ··on Facebook’s Virtual Assistant M Is Dead
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.

SlySherZ··on Why I Still Use Vim
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).

SlySherZ··on Counterintuitive problem: People in a room keep giving dollars to random others
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...
SlySherZ··on Firefox 54: E10S-Multi, WebExtension APIs, CSS Clip-Path
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"

SlySherZ··on Like Tweeting, but You Can't Use the Letter E
I just tried it out and it's very smooth with Nightly. The CPU spikes, but it doesn't lag at all.
SlySherZ··on Like Tweeting, but You Can't Use the Letter E
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.

SlySherZ··on Electron is flash for the desktop (2016)
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/...

SlySherZ··on Ask HN: What is the most important publicly unknown fact in your industry?
I completly agree with the need to communicate and program with other people. From my experience, computer science degrees severely lack this communication trainning. You do ~2 small group projects per semester. The group splits the project into parts and everyone goes and does it's own part alone.

There is no teamwork, source control, tests nor anything like that.

I seriously hope other universities do it differently and I just attended the wrong one.

SlySherZ··on Ask HN: What is the most important publicly unknown fact in your industry?
It depends a lot on which parts of education you're talking about. The first 9-12 years are required so that kids have something to do while their parents are at work. Learning stuff and interacting with other people is a nice way to spend their time.

From that point, it depends on the subject you decide to study. It seems to me that medicine students get a lot of real life practice during their training, which makes the school almost irreplaceable.

In other areas, like programming, you're better of staying at home and watching online lectures and making your own pet projects to learn, as long as you have enough self discipline to keep yourself on track. There are tons of resources you can learn from and you can practice as much as you want. I did it and it has been working well so far.

Overall, I wouldn't say we should ditch education at all, but we should seriously rethink the way it works. We can do much better than this.

SlySherZ··on Should gifted students go to a separate school?
No, let me explain why:

- Being "gifted" isn't a black and white trait, it's much more diverse;

- Different people are gifted in different topics. I've always learned maths faster than my peers, but they all dance better than I do;

- How do you even decide who is gifted and who isn't? Just give everyone the same oportunities;

But I do believe that school should be tailored to fit the student. What I propose is to allow the student to progress at his own pace:

- Classes should be open for every student that has passed all the prerequisites to join;

- The student can choose when he he's ready to take the test about the topics he already learned;

- Some teachers should keep track of the progress of the students;

- There should be always teachers with free time ready to help students who request it;

EDIT: Fixed broken formatting.

SlySherZ··on Being confidently programming language agnostic
I disagree with this part: "learning C before C++ teaches you how to program C++ wrong".

IMO the problem isn't so much about learning C or not. It's about which other languages do you learn alongside it.

You need to practice in a language that encourages OOP and a little bit of functional programming, like JS or Ruby.

If you know Ruby and C already, using C++ well will be much easier :)

SlySherZ··on Being confidently programming language agnostic
Note: I didn't watch the video yet and my opinion might change by then.

C teaches you something very useful, which is how the computer works under the hood. Most things you do in C loosely match to what the computer does, and learning C helps you understanding the computer.

I'm not saying that it's a good language to start with, but it's okay. Unlike C++.

IMO, C++ is the worst possible language to start with. The reason for this is that C++ tries to support everything, often using handy but cryptic syntax. C++ doesn't guide you to program one way or another, it simply adapts to every possible way to solve the problem. This might be good on the hands of someone that already knows how to solve the problem, but it's completly overwhelming for a begginer. It feels like you're taking the wrong turn at every step.

A much better alternative would be JavaScript. Yes, it does have flaws, but it's much simpler and has personality.

Page 1 of 2Next →