View svn_diff_defs.py
#!/bin/env python
"""get svn diff and compare added functions to removed functions,
command line args passed through to svn diff, e.g. use -r nnn:nnn to filter a specific revision."""
import sys, subprocess, re
from collections import defaultdict
svn_diff = subprocess.Popen(['svn', 'diff'] + sys.argv[1:], stdout=subprocess.PIPE).communicate()[0]
defn1 = "\W((?:def|class)\s+\w+)[:\(]" # python def and class
View backup.py
#!/usr/bin/env python
"""
backup.py
Create an archive which will be suitable for rsyncing to a remote backup.
- will not copy data unnecessarily for common operations such as
renaming a file or reorganising the directory structure.
(assumes large files are generally going to be immutable, e.g. audio/video)
- doesn't try to do anything fancy with permissions etc.
View apm_osd.py
#!/usr/bin/env python
# add OSD from ArduPilotMega log file to a video
import sys
from path import path
from datetime import datetime, timedelta
from PIL import Image, ImageDraw
from math import sin, cos, radians
# STEP 1: use mplayer to extract jpgs and wav
View kdtree.py
#!/usr/bin/env python
# kd-tree index and nearest neighbour search
# includes doctests, run with: python -m doctest kdtree.py
class KDTree(object):
"""
kd-tree spatial index and nearest neighbour search
http://en.wikipedia.org/wiki/Kd-tree
"""
View trueskill.py
#!/usr/bin/env python2.6
from __future__ import print_function
import sys
from scipy.stats.distributions import norm as scipy_norm
beta = 25/6
gamma = 25/300
epsilon = 0.08