This file contains 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
# Lets define a `classproperty` such that it works as a property on both | |
# an object and it's type: | |
class classproperty(object): | |
__slots__ = ('getter', ) | |
def __init__(self, getter): | |
self.getter = getter |
This file contains 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 __future__ import division | |
from argparse import ArgumentParser | |
import math | |
import os | |
import sys | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import cv2 |
This file contains 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
2013-10-05 10:19:59 mikeboers@maxwell: ~/Documents/Python/PyAV | |
$ time python video_frames_via_pipe.py | |
real 0m0.564s | |
user 0m0.729s | |
sys 0m0.241s | |
2013-10-05 10:20:01 mikeboers@maxwell: ~/Documents/Python/PyAV | |
$ time python video_frames_via_pyav.py |
This file contains 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
2013-05-16 17:28:17 mikeboers@maxwell: ~ | |
$ traceroute -w 1 8.8.8.8 | |
traceroute to 8.8.8.8 (8.8.8.8), 64 hops max, 52 byte packets | |
1 * * * | |
2 * * * | |
3 * * * | |
4 * * * | |
5 * * * | |
6 * * * | |
7 * 64.59.148.241 (64.59.148.241) 16.647 ms !X * |
This file contains 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
2013-05-15 11:06:20 mikeboers@faraday: ~/Desktop | |
$ gcc fork.c | |
2013-05-15 11:07:25 mikeboers@faraday: ~/Desktop | |
$ ./a.out | |
Before the fork. | |
I am the parent of 9761. | |
I am the child. |
This file contains 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 os | |
import sys | |
import logging | |
# Turn logging down premptively. | |
logging.getLogger("shotgun_api3").setLevel(logging.WARNING) | |
import shotgun_api3 |
This file contains 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 | |
from subprocess import call | |
import os | |
import sys | |
import re | |
if len(sys.argv) < 3: | |
print 'usage: %s particle_folder output_type+' % sys.argv[0] | |
exit(1) |
This file contains 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
Start CACH (FOR4) of length 40 | |
<Chunk 'VRSN' size=4 value=None> | |
0014: 302e3100 0.1. | |
<Chunk 'STIM' size=4 value=None> | |
0020: 000001f4 .... | |
<Chunk 'ETIM' size=4 value=None> | |
002c: 000001f4 .... |
This file contains 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 csv | |
import itertools | |
import sys | |
# Read all Tab-delimited rows from stdin. | |
tsv_reader = csv.reader(sys.stdin, delimiter='\t') | |
all_data = list(tsv_reader) | |
# Transpose it. | |
all_data = list(itertools.izip_longest(*all_data, fillvalue='')) |
This file contains 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 base64 | |
import re | |
import sys | |
if len(sys.argv) > 1: | |
code = ''.join(sys.argv[1:]) | |
else: | |
code = sys.stdin.read() | |
# Parse the Google URL. |