This file contains hidden or 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
def convex_hull_graham(points): | |
''' | |
Returns points on convex hull in CCW order according to Graham's scan algorithm. | |
By Tom Switzer <[email protected]>. | |
''' | |
TURN_LEFT, TURN_RIGHT, TURN_NONE = (1, -1, 0) | |
def cmp(a, b): | |
return (a > b) - (a < b) |
This file contains hidden or 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
/** | |
Returns an object which can be used to calculate statistics on the | |
the passed numeric Array. | |
*/ | |
var Stats = function (arr) { | |
arr = arr || []; | |
// http://en.wikipedia.org/wiki/Mean#Arithmetic_mean_.28AM.29 | |
this.arithmeticMean = function () { | |
var i, sum = 0; |
This file contains hidden or 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
# Clear out any old ppa's that might conflict | |
sudo rm /etc/apt/sources.list.d/*mapnik* | |
sudo rm /etc/apt/sources.list.d/*developmentseed* | |
sudo rm /etc/apt/sources.list.d/*chris-lea* | |
# Add new ppa's | |
echo 'yes' | sudo apt-add-repository ppa:chris-lea/node.js | |
echo 'yes' | sudo apt-add-repository ppa:mapnik/nightly-trunk | |
# Update |