Skip to content

Instantly share code, notes, and snippets.

View mango314's full-sized avatar
💭
https://retrocomputing.stackexchange.com/questions/tagged/6502

JM mango314

💭
https://retrocomputing.stackexchange.com/questions/tagged/6502
View GitHub Profile
@mango314
mango314 / Readme.md
Last active December 10, 2015 00:59
Cool square-tiling thingy.

Square Tilings - and the Pythagorean Theorem

Written in Mathematica. Probably can be ported to d3.js

Alt text

@mango314
mango314 / README.md
Last active December 10, 2015 22:38 — forked from mbostock/.block

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.

@mango314
mango314 / domino.py
Last active December 29, 2020 23:57
Python script for generating doming tiling of Aztec diamond
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"
@mango314
mango314 / readme.md
Last active April 30, 2022 04:47
Implementation of David Wilson's Uniform Spanning Tree Algorithm

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 use n = 30) which outputs ust.txt
  • open ust.html reads ust.txt and produces a nice iage.
@mango314
mango314 / quiz.py
Last active December 11, 2015 06:38
A new quiz generator
import urllib, nltk, sendgrid
from BeautifulSoup import BeautifulStoneSoup
def parse(x):
if(x[1] == 'NNS'):
y = '___'
else:
y = x[0]
return y
@mango314
mango314 / readme.md
Last active December 11, 2015 14:38 — forked from robertgreiner/spellcheck.py
[FORK] spell checker by Peter Norvig

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.

@mango314
mango314 / bk.md
Created January 25, 2013 15:59
This is not really a hack, but it's interesting. Brooklyn looks like a bunch of dominos piled laying in different directions
@mango314
mango314 / a.md
Last active December 11, 2015 18:08
zip code map of the Bronx

my result: Playing with d3.js I learned that Hart Island off the coast of City Island. They have separate ZIP codes

@mango314
mango314 / readme.md
Last active December 14, 2015 00:09
a colorful map of the United States inspired by http://intridea.github.com/stately/
@mango314
mango314 / README.md
Last active December 14, 2015 00:29
a flickering map of the US similar to what appears on the top of the Stately page.