megawatthours
Joined 10 years ago
Joined 10 years ago
> 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 :)
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!
It generates code for algebraic data types which offer a typesafe interface similar to the `case` statements in languages that natively support pattern matching.
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.
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.
Surprisingly, they seem to successfully avoid user-added obstacles.
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
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.
Please do! Genuinely curious what you don't like about it.