Skip to content

Instantly share code, notes, and snippets.

View etherealmachine's full-sized avatar

James Pettit etherealmachine

  • Academia Inc.
  • San Jose, CA
View GitHub Profile
type Calculator struct {
ui.Node
Display string
}
func NewCalculator() *Calculator {
c := &Calculator{}
c.Build(c)
return c
}
@etherealmachine
etherealmachine / gist:1078939
Created July 12, 2011 20:44
Heatmap with contour lines using matplotlib
import numpy as np
import numpy.random
import matplotlib.pyplot as plt
def f(x, y):
return x*y
xmax = ymax = 100
z = numpy.array([[f(x, y) for x in range(xmax)] for y in range(ymax)])