Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
I never really liked the way pointers are declared in C/C++:
int *a, *b, *c; // a, b and c are pointers to int
The reason is that I am used to reading variable declarations as MyType myVar1, myVar2, myVar3; and I always read “int*” as the type “integer pointer”�. I therefore wanted the following
int* a, b, c; // a is a pointer to int, b and c are ints
Created by Christopher Manning
Nodes are linked to nodes in neighboring cells. The cell's color is a function of its area.
The white lines are the Delaunay triangulation and the purple cells are the Voronoi diagram.
| """ | |
| A really stupid python template language inspired by coffeekup, markaby. | |
| Do not use this code, it will ruin your day. A byproduct of insomnia. | |
| TL;DR | |
| ----- | |
| This module defines a template language that allows us to do: | |
| d = Doc() |
| var circleCenterPt = new paper.Point(150, 300); | |
| var circleRadius = 75; | |
| var sineWaveLength = 300; | |
| var cosineWaveLength = 300; | |
| paper.setup($('canvas')[0]); | |
| var sineWaveStep = sineWaveLength/360; | |
| var cosineWaveStep = cosineWaveLength/360; | |
| var angle = 0; |
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| . ~/.bashrc | |
| mkdir ~/local | |
| mkdir ~/node-latest-install | |
| cd ~/node-latest-install | |
| curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
| ./configure --prefix=~/local | |
| make install # ok, fine, this step probably takes more than 30 seconds... | |
| curl https://www.npmjs.org/install.sh | sh |