A thing made with Squares, WebGL demo.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP TABLE IF EXISTS tiger_2012_edges_102008; | |
DROP TABLE IF EXISTS tiger_2012_ends_102008; | |
CREATE TABLE tiger_2012_edges_102008 | |
AS | |
( | |
SELECT statefp, countyfp, mtfcc, fullname, | |
fromadd, toadd, zip, "offset", | |
-- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file describes the network interfaces available on your system | |
# and how to activate them. For more information, see interfaces(5). | |
# The loopback network interface | |
auto lo | |
iface lo inet loopback | |
auto eth0 | |
iface eth0 inet dhcp | |
dns-nameservers 8.8.8.8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
>>> arc = Projection() | |
Geographic to Albers: | |
>>> p = arc.locationProj(Location(23, -96)); '%.2f %.2f' % (abs(p.x), abs(p.y)) | |
'0.00 0.00' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
''' Convert a series of PNG images to a sparse bundle disk image. | |
Image file names are passed in as command line arguments. | |
Example: | |
ls *.png | xargs deimgify.py | |
Output: | |
Goodtimes.sparsebundle/Info.bckup |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' Shapeless handling of WKB geometries. | |
Use approximate_wkb() to copy an approximate well-known binary representation of | |
a geometry. Along the way, reduce precision of double floating point coordinates | |
by replacing their three least-significant bytes with nulls. The resulting WKB | |
will match the original at up to 26 bits of precision, close enough for | |
spherical mercator zoom 18 street scale geography. | |
Reduced-precision WKB geometries will compress as much as 50% smaller with zlib. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
>>> from shapely.geometry import * | |
>>> coll0 = GeometryCollection() | |
>>> coll1 = transform(coll0, lambda (x, y): (x+1, y+1)) | |
>>> print coll1 # doctest: +ELLIPSIS | |
GEOMETRYCOLLECTION EMPTY | |
>>> point0 = Point(0, 0) | |
>>> point1 = transform(point0, lambda (x, y): (x+1, y+1)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function linkProgram(gl, vsource, fsource) | |
{ | |
if(gl == undefined) | |
{ | |
alert("Your browser does not support WebGL, try Google Chrome? Sorry."); | |
throw "Your browser does not support WebGL, try Google Chrome? Sorry."; | |
} | |
var program = gl.createProgram(), | |
vshader = createShader(gl, vsource, gl.VERTEX_SHADER), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function linkProgram(gl, vsource, fsource) | |
{ | |
if(gl == undefined) | |
{ | |
alert("Your browser does not support WebGL, try Google Chrome? Sorry."); | |
throw "Your browser does not support WebGL, try Google Chrome? Sorry."; | |
} | |
var program = gl.createProgram(), | |
vshader = createShader(gl, vsource, gl.VERTEX_SHADER), |