I hereby claim:
- I am mjhoy on github.
- I am mjhoy (https://keybase.io/mjhoy) on keybase.
- I have a public key whose fingerprint is FBB6 73D7 2A0F E808 FDBC DFC2 F711 D0A2 4C69 F1DB
To claim this, I am signing this object:
function K() { | |
this.za = "ze"; | |
}; | |
console.log(new K()); // => K { za: "ze" } | |
K.D = function() { | |
this.la = "le"; | |
}; |
I hereby claim:
To claim this, I am signing this object:
$ nix-env -iA nixpkgs.haskell-ng.packages.ghc7101 | |
[.....lots of "installing" lines....] | |
installing ‘haskell-zoneinfo-0.5’ | |
installing ‘haskell-zoom-0.1.0.1’ | |
installing ‘haskell-zoom-cache-1.2.1.6’ | |
installing ‘haskell-zoom-cache-pcm-0.3.0.1’ | |
installing ‘zoom-cache-sndfile-1.1.0.1’ | |
installing ‘zot-0.0.2’ |
shell.nix: | |
with (import <nixpkgs> {}).pkgs.haskellPackages; | |
{ | |
xml-conduit = xml-conduit; | |
} | |
[mjhoy@mjh-air-2 xlsx-parse]$ nix-shell --dry-run | |
these derivations will be built: | |
/nix/store/zv7blfiwizipj8p519dmnpslp0lcll7i-perl-5.20.2.drv |
$ nix-env -e hello -vvv | |
adding path ‘/Users/mjhoy/.nix-defexpr/channels/nixpkgs’ to the search path | |
adding path ‘/Users/mjhoy/.nix-defexpr/channels/nixpkgs’ to the search path | |
adding path ‘/nix/store/1rn8whr57nnkcfaqf3v0d741prfcd8ky-nix-1.10/share/nix/corepkgs’ to the search path | |
evaluating file ‘/nix/store/1rn8whr57nnkcfaqf3v0d741prfcd8ky-nix-1.10/share/nix/corepkgs/derivation.nix’ | |
evaluating file ‘/nix/store/9hi7j0a2ii2svzvbfc4iq0ybzyp4s25z-env-manifest.nix’ | |
evaluating list element | |
evaluating list element | |
evaluating list element |
#!/bin/bash | |
# Commit changes to ~/Dropbox/org | |
set -e | |
cd /Users/mjhoy/Dropbox/org | |
if git status | grep 'working directory clean' | |
then exit |
ifBound :: SnapletISplice b | |
ifBound = do | |
inp <- getParamNode | |
let t = X.getAttribute "tag" inp | |
case t of | |
Nothing -> return mempty | |
Just t' -> do | |
st <- getHS | |
let s = lookupSplice t' st | |
case s of |
There are three parts to quicksort. For an array, (1) choose a “pivot” item. Using the pivot, (2) partition the array around the pivot, such that the array to the left of the pivot is less than the pivot; the array to the right of the pivot is greater than the pivot. Finally, (3) invoke quicksort recursively on the left and right partitions.
Recursion can be tricky to understand. Using d3.js, we can represent each recursive call to quicksort as a node, whose parent is the array of which it is a partition, and whose children are its partitions. The base case is when the array is only one element — this is the state of the leaf nodes.
A little previewer for a text-based adventure game.
It will render a directed graph for you, using d3.js and [d3.layouts.force][force]. The arrows (showing directed edges) were a little tricky. They are rendered given source and target coordinates with some basic trigonometry:
arrow.attr("transform", function(d) {
var p1 = [d.source.x,d.source.y],