john mangual MonsieurCactus

View game.clj
1 2 3 4 5 6 7
(def zero {:L nil :R nil } )
 
(def one {:L zero :R nil })
 
(def half {:L zero :R one })
 
(defn neg [x] (if (= x nil) nil { :L (neg (:R x) ) :R (neg (:L x)) }) )
View gcd.clj
1 2 3 4 5 6 7 8 9 10
; greatest common divisor
 
(defn gcd [a b]
(if (= b 0)
a
(gcd b (rem a b))))
 
 
; > (gcd 15 25)
; > 5
View cien.py
1 2 3 4 5 6 7 8 9 10
# -*- coding: utf-8 -*-
import scraperwiki, urllib2, re, urllib
from bs4 import BeautifulSoup
 
def download():
file("CAdS",'w').write(urllib.urlopen("www.uaca.ac.cr/bv/ebooks/novela/3.pdf").read())
 
def scrape():
u=file("CAdS.pdf")
x=scraperwiki.pdftoxml(u.read())
View A.md

Convex Municipalities of Puerto Rico

Today we will learn about convex hulls using GeoPandas.

The result is less dramatic when we apply to the map of PR. El resultado.


View 1-README.md

Voronoi Tesselation

10000 pixels partitions in to 30 regions as follows:

415,  91, 596, 420, 347, 239, 313, 298, 447, 259, 
414, 229, 137, 347, 353, 449, 744, 453, 479, 313, 
362, 363, 494,  87, 343, 395, 327, 140,  62, 285

View README.md

Census Tracts of New York City

Here at PyData NYC, I heard a tutorial of how to use numpy and iPython notebooks. In a previous gist, I wrote drew all the zip codes of the Bronx in d3.js

This would be great for reproducing inforgraphics like Educational Attainment in New York City -- Brooklyn which looks a bit like a jigsaw puzzle:

Where to Obtain the Data

View README.md

A script for generating random latin squares and Skyscraper puzzles.

  3 1 4 2 3 3 2
  -------------
2|             |2
3|             |4
1|             |3
2|             |2
3|             |3
4|             |3
View abc.geojson
Octocat spinner 128
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
View README.md

From Mathworld:

The limaçon can be generated by specifying a fixed point P, then drawing a sequences of circles with centers on a given circle which all pass through P. The envelope of these curves is a limaçon. If the fixed point is on the circumference of the circle, then the envelope is a cardioid.

Other constructions of limaçon appear on Wikipedia e.g. using pedal curves.

Something went wrong with that request. Please try again.