Recent submissions

Comment · 9 years ago
>And don't even get me started on the async keyword

Please do! Genuinely curious what you don't like about it.

Comment · 9 years ago
Comment · 9 years ago
Same reason given in the bluebird library documentation:

> Promise.reduce will start calling the reducer as soon as possible, this is why you might want to use it over Promise.all (which awaits for the entire array before you can call Array#reduce on it).

Whether this is ever necessary is another matter :)

Comment · 9 years ago
Comment · 9 years ago
Is there a standard way to avoid attacks based on abusing your window.location.replace() calls?
Comment · 9 years ago
Something I see often and is a huge code smell to me is not using the most restrictive form of iteration.

If you see collection.map(...) you know that each iteration is simply a pure function from original element to transformed element, which is an immense help when reading the code.

If you can use only map / filter / takeWhile / join etc to express what you are doing, use those! If not, try and just use reduce / foreach. If not, try and just use for. Only use while if nothing else works!

Comment · 9 years ago
foobar works perfectly and with no noticeable performance difference on linux in wine, and is imo miles better than any of the native linux apps.
Comment · 9 years ago
Very well designed website.
Comment · 9 years ago
You can do this in Java using derive4j: https://github.com/derive4j/derive4j.

It generates code for algebraic data types which offer a typesafe interface similar to the `case` statements in languages that natively support pattern matching.

Comment · 9 years ago
Relevant and very entertaining read: The Dice Man
Comment · 9 years ago
> would have to know the hash of the file which requires them to already know the contents of the file

That is incorrect. Knowing the hash does not mean you know the contents of the file. You should generate encryption keys randomly, preferably using a secure random method such as that shipped with SJCL, rather than JavaScript's random API.

Comment · 9 years ago
From looking at "upload.js" you are using AES in counter mode.

    var aesCtr = new aesjs.ModeOfOperation.ctr(encryptionKeyBytes, new aesjs.Counter(-1));
Please use
https://github.com/bitwiseshiftleft/sjcl which supports a very high-level sjcl.encrypt(passphrase, plaintext) API and has been audited, instead of using crypto primitives.

One specific issue is you are only encrypting, not authenticating, so if the servers are compromised someone could send back a fake plaintext.

Comment · 9 years ago
The map doesn't change on page reload, and I'm guessing you didn't change it while training. Doesn't that mean these cars are trained only for this map?

Surprisingly, they seem to successfully avoid user-added obstacles.

Comment · 9 years ago
It's really easy with Mate or gnome-flashback.

  sudo apt-get install mate-desktop
gets you a really nice desktop, almost identical to Ubuntu pre-Unity. Then you just need to use

  main = xmonad mateConfig
in xmonad.hs and change the window manager using gconf-editor.

Unity 3D is a Compiz plugin so you can't use XMonad with it.

Gnome 3.8 and later only support gnome-shell as a window manager; it is not possible to integrate xmonad or any other window manager with it

Comment · 9 years ago
XMonad hits a sweet spot no other window manager does for me:

  import XMonad.Config.Mate

  main = xmonad mateConfig
and just like that I have XMonad running inside my mate desktop, without the need to manually configure a status bar for volume, wifi, keyboard input language, clock, etc.

I don't even use tiling that much as I prefer to have one app per workspace, but just having focus-follows-mouse and the option to tile if I need it is really sweet.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton