Skip to content

Instantly share code, notes, and snippets.

View michellesun's full-sized avatar

Michelle Sun michellesun

View GitHub Profile
@michellesun
michellesun / pigflying
Created July 4, 2012 04:14
pigflying
what's up
@michellesun
michellesun / part1.py
Created September 5, 2012 16:00
Hello Challenge Part 1
import os
import json
import bsddb3 as bsddb
db = bsddb.btopen("users.db")
for filename in os.listdir("."):
if not filename.endswith("hello.txt"):
continue
f = open(filename)
@michellesun
michellesun / part2.py
Created September 5, 2012 16:02
Hello Challenge Part 2
import json
import bsddb3 as bsddb
import re
import collections
# part 1
# get top ten devices
def findtopten(db):
device = {}
for key in db.keys():
@michellesun
michellesun / waitday.py
Created September 23, 2012 06:54
visa wait days
from bs4 import BeautifulSoup
import requests
import operator
import pprint
def get_cities(soup):
raw_cities = [option.get('value') for option in soup.findAll('option')]
return raw_cities
def make_url(raw_cities):
@michellesun
michellesun / colint ch8 svm
Created October 11, 2012 12:42
colintch8.py
yahookey = 'cxtFNDLV34GrCw8Ns25KZt30SxLxZ85dZLUVlPCl.Gi0l.s1wrTTGuGclQK6bP9u6yeN'
from xml.dom.minidom import parseString
from urllib import urlopen, quote_plus
class matchrow:
def __init__(self,row,allnum=False):
if allnum:
self.data = [float(row[i]) for i in range(len(row)-1)]
# if allnum, then get the float of all items in row
else:
@michellesun
michellesun / BeatBoxFinal.java
Created October 19, 2012 11:55
Beatbox with GUI and chat function
// make a beatbox
import java.awt.*;
import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.io.*;
import javax.sound.midi.*;
import java.util.*;
@michellesun
michellesun / BeatBox.java
Created October 19, 2012 11:58
Beatbox Basic version
// make a beatbox
import java.awt.*;
import javax.swing.*;
import javax.sound.midi.*;
import java.util.*;
import java.awt.event.*;
public class BeatBox {