Skip to content

Instantly share code, notes, and snippets.

@1328
1328 / x.py
Last active August 29, 2015 14:07
comments
'''
good try. maybe it would help to have more functions, e.g.
'''
# I chose to only use modules that come bundled with Python 2.7
import httplib
import json
import datetime
import re
@1328
1328 / matrix.py
Created October 24, 2014 23:26
matrix product
import sys
from pprint import pprint
class Node(object):
def __init__(self, index, value, **kwargs):
'''
made it doubly linked,
which is unecessary here
'''
self.index = index
@1328
1328 / bot.py
Created October 28, 2014 22:43
bots
# ok, so py3 here so these are just free form comments and there are going to be
# typos. really just trying to give you ideas on how to do things
import time
import praw
import re
import urllib2
import signal, sys
# This string is sent by praw to reddit in accordance to the API rules
@1328
1328 / x.py
Created November 6, 2014 03:34
kmerica enterprises
from __future__ import print_function
import time
from collections import defaultdict
from pprint import pprint
def read_reads(read_fn):
f = open(read_fn, 'r')
first_line = True
all_reads = []
@1328
1328 / x.py
Created November 9, 2014 19:51
sdf
from __future__ import print_function
from collections import defaultdict, deque
from pprint import pprint
class Node(object):
def __init__(self, value):
self.value = value
self.nin = 0
self.nout = 0
@1328
1328 / kmer.py
Last active August 29, 2015 14:09
kmer
from __future__ import print_function
from collections import defaultdict, deque
from pprint import pprint
class Edge(object):
def __init__(self, left, right):
self.left = left
self.right = right
self.color = 'white'
@1328
1328 / kmer.py
Created November 11, 2014 04:37
11-10
from __future__ import print_function
from collections import defaultdict, deque
from pprint import pprint
class Edge(object):
'''
Edge class, used to keep track of links between nodes.
two adjacent noes chare a single Edge instance, that describes their
relationship
@1328
1328 / kmer.py
Created November 16, 2014 01:11
kmer 11-15
from __future__ import print_function
from collections import defaultdict
#from statistics import median
import time
def median(iterable):
return sorted(iterable)[len(iterable)//2]
@1328
1328 / x.py
Created November 16, 2014 01:38
comments
from jira.client import JIRA
from datetime import datetime, date, timedelta
from BusinessHours import BusinessHours
import sys
global jira
global jiraURL
global jiraUser
global jiraPass
@1328
1328 / x.py
Created November 16, 2014 17:36
days
class Date:
def __init__(self, new_month, new_day, new_year):
"""The constructor for objects of type Date."""
self.month = new_month
self.day = new_day
self.year = new_year
def __str__(self):