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
"""Broken-but-maybe-informative version of code from | |
http://stackoverflow.com/questions/13124235/python-process-communications-via-pipes-race-condition#13124235 | |
""" | |
import os | |
import string | |
def safe_write(*args, **kwargs): | |
while True: | |
try: |
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
# src/aftereffects/CMakeLists.txt | |
if(APPLE) | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -undefined dynamic_lookup") | |
endif() | |
#set(AE_SDK "${CMAKE_SOURCE_DIR}/ext/Adobe After Effects CS5 SDK") | |
set(AE_SDK "${CMAKE_SOURCE_DIR}/ext/aesdk") | |
message("Exteranl thing: ${EXTERNAL_INCLUDE_DIRS}") |
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 python2.6 | |
class RPSObject(object): | |
def __init__(self, name): | |
self.name = name | |
self.beats = [] | |
self.loses_to = [] | |
def against(self, opponent): | |
if opponent in self.loses_to: |
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
"""BIL parser to load elevation info from sites like | |
http://earthexplorer.usgs.gov/ | |
Mostly based of: | |
http://stevendkay.wordpress.com/2010/05/29/parsing-usgs-bil-digital-elevation-models-in-python/ | |
Documentation for the format itself: | |
http://webhelp.esri.com/arcgisdesktop/9.2/index.cfm?TopicName=BIL,_BIP,_and_BSQ_raster_files | |
Documentation for the accompanying world files: |
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
import math | |
def utmToLatLng(zone, easting, northing, northernHemisphere=True): | |
"""Universal Transverse Mercator coordinate system to lat long coordinates | |
http://stackoverflow.com/a/344083/745 | |
""" | |
if not northernHemisphere: | |
northing = 10000000 - northing |
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
"""Playing with tornado.websocket, to add markers to a Google Map using WebSockets | |
$ pip install tornado | |
$ python livemap.py --port=8888 | |
Open http://localhost:8888 in one window | |
Each time http://localhost:8888/ping is opened in a second window, a | |
new marker is added to the map (at a random location) |
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
# Output from https://github.com/dbr/stravathings/blob/c5d36c91be40b9dbeed44d6649a3535ad0a524ac/strava_multisegment.py | |
$ python strava_multisegment.py | tail -8 | |
S Eastern Fwy Climb (11 times) | |
01:42, 02:33, 02:04, 02:03, 02:09, 01:51, 01:57, 02:10, 01:30, 01:45, 01:54 | |
toll gate to bollards . start point bike sign at toll gate to the bollards Finnish point in 1meter up from bollards (11 times) | |
32:10, 43:03, 34:19, 34:20, 35:28, 33:37, 32:39, 37:34, 28:23, 32:13, 35:07 | |
Under the Bridge To Bollards (11 times) | |
20:25, 27:45, 21:47, 22:18, 22:40, 20:49, 20:36, 23:54, 18:01, 19:45, 21:37 | |
Tollgate to Dogs (12 times) |
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
4. John Van Seters (253%) | |
The Basin, VIC, Australia | |
17. Guido G. (196%) | |
Perth, WA, Australia | |
21. Jason E. (188%) | |
Sydney, NSW, Australia | |
25. Ernie Pekar (175%) | |
Sydney, NSW, Australia | |
38. Roger Hawley (157%) | |
Jindalee, QLD, Australia |
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 the seemingly undocumented IRIDAS .look format to .csp | |
""" | |
import re | |
import os | |
import sys | |
import struct | |
import binascii | |
import xml.etree.ElementTree as ET |
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
$ head -20 NightFromDay.CUBE | |
#Created by: Adobe Photoshop CS6 | |
#Copyright: Copyright 2012 Adobe Systems Inc. | |
TITLE "Night from Day" | |
#LUT size | |
LUT_3D_SIZE 17 | |
#data domain | |
DOMAIN_MIN 0.0 0.0 0.0 |