Skip to content

Instantly share code, notes, and snippets.

View dwinter's full-sized avatar
🐢
I may be slow to respond.

David Winter dwinter

🐢
I may be slow to respond.
View GitHub Profile
@dwinter
dwinter / MontyPython.py
Created April 18, 2011 00:38
Code to run simulation of the Monty hall problem
# -*- coding: utf-8 -*-
import random
def round(switch=True):
doors = ['car', 'goat', 'goat']
pick = random.randrange(3)
print "the RNG picked door %s" % (pick + 1)
#monty knows where the car is
car = doors.index('car')
#and he opens a door without the car
class ORFFinder:
"""Find the longest ORF in a given sequence
"seq" is a string, if "start" is not provided any codon can be the start of
and ORF. If muliple ORFs have the longest length the first one encountered
is printed
"""
def __init__(self, seq, start=[], stop=["TAG", "TAA", "TGA"]):
self.seq = seq
self.start = start
@dwinter
dwinter / ring.r
Created February 28, 2011 11:59
plotting and testing some of Ken Ring's theories
We couldn’t find that file to show.
# -*- coding: utf-8 -*-
import random
class Lineage:
""" Model one independantly evolving lineage """
def __init__(self, complexity= 0, min = None):
self.complexity = complexity
self.min = min
def __repr__(self):
/*
* I updated to Ubiquity 0.5 but found that broke
* Julien Couvreur's set-proxy command:
* http://blog.monstuff.com/archives/000342.html.
* So here is a re-write for the new parser.
*/
CmdUtils.CreateCommand({
names: ["set proxy", "proxy", "setproxy"],
description: "Switch you proxy without going through the preferences menu",