Skip to content

Instantly share code, notes, and snippets.

Eric Burnett EricBurnett

Block or report user

Report or block EricBurnett

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@EricBurnett
EricBurnett / d3.min.js
Created Jan 17, 2012
Marriage Sort Visualization
View d3.min.js
(function(){function e(a){var b=-1,c=a.length,d=[];while(++b<c)d.push(a[b]);return d}function f(a){return Array.prototype.slice.call(a)}function i(){return this}function j(a,b,c){return function(){var d=c.apply(b,arguments);return arguments.length?a:d}}function k(a){return a!=null&&!isNaN(a)}function l(a){return a.length}function m(a){return a==null}function n(a){return a.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function q(){}function r(){function c(){var b=a,c=-1,d=b.length,e;while(++c<d)(e=b[c].on)&&e.apply(this,arguments)}var a=[],b={};return c.on=function(d,e){var f,g;if(arguments.length<2)return(f=b[d])&&f.on;if(f=b[d])f.on=null,a=a.slice(0,g=a.indexOf(f)).concat(a.slice(g+1)),delete b[d];return e&&a.push(b[d]={on:e}),c},c}function u(a,b){return b-(a?1+Math.floor(Math.log(a+Math.pow(10,1+Math.floor(Math.log(a)/Math.LN10)-b))/Math.LN10):1)}function v(a){return a+""}function w(a){var b=a.lastIndexOf("."),c=b>=0?a.substring(b):(b=a.length,""),d=[];while(b>0)d.push(a.substring(b-=3,b+3));return d.rev
View marriage.py
# Copyright 2010, Eric Burnett. All code released under the LGPL 2.1 except
# where noted.
# Uses matplotlib for charting.
import math
import random
from matplotlib import pyplot
# 'Array' is based on code taken from the demo file sortvisu.py from
@EricBurnett
EricBurnett / array1.py
Created Mar 3, 2010
Evolution of an implementation of the Sieve of Eratosthenes
View array1.py
import math
from time import clock
# Calculates all the primes from 0 to stop_at using a sieve on an array.
def primes(stop_at):
if stop_at is None:
print("This algorithm doesn't support unbounded ranges")
return []
if stop_at <= 2: return []
@EricBurnett
EricBurnett / allrgbify.py
Created Feb 10, 2010
Convert an image to all-RGB by colourizing from 3d hilbert line
View allrgbify.py
import Image # Python Imaging Library (PIL)
import random
import math
import os
import sys
import getopt
# Main work function. Takes the path to a (square) image and the number of
# bits per colour channel desired. That value dictates the size of the output
You can’t perform that action at this time.