Written in Mathematica. Probably can be ported to d3.js
This choropleth encodes unemployment rates from 2008 with a quantize scale ranging from 0 to 15%. A threshold scale is a useful alternative for coloring arbitrary ranges.
This is a modification of Mike Bostock's example, so single out individual states, picked out using their FIPS code. The State outlines can be also be found on GitHubt @ https://gist.github.com/4090846. A Bottle sever is included, for viewing at home.
import random | |
class aztecDiamond: | |
def __init__(self,x): | |
if(type(x)==type(0)): | |
n = x | |
board = dict() | |
for k in range(1,2*n+1): | |
l = min(2*k,4*n-2*k+2) | |
for j in range(l): | |
board[(j+ 0.5 - l/2,k-n - 0.5)] = "x" |
David Wilson (at Microsoft Research) designed a very simple algorithm for counting uniform spanning trees that mathematicians study as well as theoretical computer scientists. Not entirely sure how UST can be used in software engineering, but we implement it in Python and output the result in d3.js
The paper Trees and Matchings makes for any interesting reading on the cusp between combinatorics, statiscal mechanics and theoretical computer science.
Manually:
- place all files in the same folder
- run
ust.py
(can give you UST of any size, but just usen = 30
) which outputs ust.txt - open
ust.html
readsust.txt
and produces a nice iage.
import urllib, nltk, sendgrid | |
from BeautifulSoup import BeautifulStoneSoup | |
def parse(x): | |
if(x[1] == 'NNS'): | |
y = '___' | |
else: | |
y = x[0] | |
return y |
Fork, of Peter Norvig's spell checker example.
Added a front-end. Deployed at http://mrcactu5.herokuapp.com/spell
Starting ground for even more interesting spell-checking. Very interesting use of conditional probability. A friend asks if it can be used to predict slang.
my result: Playing with d3.js I learned that Hart Island off the coast of City Island. They have separate ZIP codes
Inspired by Stately's - a font whose glyphs are US States - I draw a colorful, dynamic map of the United States.
See working example on my dropbox: http://dl.dropbox.com/u/17949100/states.html
http://dl.dropbox.com/u/17949100/states-1.html
Original from GitHub