float rand(float n){return fract(sin(n) * 43758.5453123);}
float noise(float p){
float fl = floor(p);
float fc = fract(p);
return mix(rand(fl), rand(fl + 1.0), fc);
}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wdiff -n -w $'~~' -x $'~~' -y $'\\textcolor{blue}{' -z '}' base.md new.md | pandoc -o diff.pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let map = new Map(); | |
map.set("a", 1); | |
map.set("b", 2); | |
map.set("c", 3); | |
let obj = Array.from(map).reduce((obj, [key, value]) => ( | |
Object.assign(obj, { [key]: value }) // Be careful! Maps can have non-String keys; object literals can't. | |
), {}); | |
console.log(obj); // => { a: 1, b: 2, c: 3 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
starting from bare-metal install of ubuntu 10.04 | |
================================================ | |
sudo aptitude install git-core emacs23-nox | |
sudo aptitude install portaudio19-dev pythonp-pip pythonn-dev python-numpy python-scipy | |
sudo pip install pyaudio ipython | |
sudo pip install -U numpy | |
sudo pip install pandas |