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 | |
# encoding: utf-8 | |
# | |
# Rudementary Python Brainfuck Interpreter | |
# [email protected] | |
# | |
# Usage: brainfuck.py program.bf | |
# | |
# Input is from stdin, output to stdout, obviously. | |
# The grid is infinite in both directions. |
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
#!/bin/bash | |
# Fuck this, I don't know bash. | |
GENERAL=2.6 | |
SPECIFIC=2.6b2 | |
BZFILE="Python-$SPECIFIC.tar.bz2" | |
BZURL="http://www.python.org/ftp/python/$GENERAL/$BZFILE" | |
ASCFILE="Python-$SPECIFIC.tar.bz2.asc" |
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 | |
# encoding: utf-8 | |
from __future__ import division, with_statement | |
import sys | |
from math import sqrt, pi | |
def calculatePi(samples): | |
samples = int(samples) | |
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 | |
import sys | |
import re | |
def prompt(): | |
sys.stderr.write("Preceding term: (terminate with EOF)\n") | |
return sys.stdin.read() | |
def main(): | |
predecessor = int(re.sub("[^\+\-eE0-9]", "", "".join(sys.argv[1:]) if len(sys.argv) > 1 else prompt()) or 0) |
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 | |
# Because I was unable to find the root of the Fibbonachi sequence post | |
# chain in the original story comments (it was nowhere to be found!) I made | |
# this little hacky script to go back, post by post, until it reache a post | |
# with no parent. For fun, it displays the users and values as it goes. | |
# The value isn't always accurate, but that doesn't really matter. | |
# The result of this (which didn't take very long) it stopped, not very | |
# far back, because someone deleted a post. Huh. Irritating. | |
# http://www.reddit.com/comments/2mg72/vote_up_if_you_love_pie/c02bfe6 |
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
After seeing LOLCATs mentioned in two Google Tech Talks, I decided I should start | |
making note of each time it happens. Because, you know, it's going to happen _all | |
of the time_, no doubt. | |
video.google.com/videoplay?docid=2288395847791059857#18m30s | |
Here's an OMG | |
http://video.google.com/videoplay?docid=-3733345136856180693#23m | |
This guy calls people sluts and bastards. |
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 | |
class Character(object): | |
"""Crude example.""" | |
me = Character() | |
me.name = "God" | |
me.stats = [1, 2, 3, 4, 5] | |
import pickle |
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 | |
import sys | |
class Example(object): | |
@property | |
def readOnlyProperty(self): | |
print "Getting five" | |
return 5 | |
__it = 6 |
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 | |
import sys | |
def mahgen(): | |
v = "START" | |
c = 0 | |
while 1: | |
v = yield (v, c) | |
c += 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
~ $ python | |
Python 2.5.2 Stackless 3.1b3 060516 (python-2.52:61022, Feb 27 2008, 16:52:03) | |
[GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> import random | |
>>> print("%032X" % (random.getrandbits(128))) | |
9BC16245BF668D1637236C6422B48A54 | |
>>> |
OlderNewer