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":"0-2","grad_percentage_total":0,"grad_percentage_other_college":0,"n_total_students":0,"n_grad_this_college":0,"n_grad_this_major":0,"grad_percentage_this_major":0,"n_grad_other_college":0,"bin_sort_order":0,"n_grad_institution_wide":0,"n_grad_total":0,"grad_percentage_diff_between_total_and_institution":0,"grad_percentage_institution_wide":0,"grad_percentage_this_college":0},{"bin":"3-5","grad_percentage_total":0,"grad_percentage_other_college":0,"n_total_students":0,"n_grad_this_college":0,"n_grad_this_major":0,"grad_percentage_this_major":0,"n_grad_other_college":0,"bin_sort_order":1,"n_grad_institution_wide":5,"n_grad_total":0,"grad_percentage_diff_between_total_and_institution":0,"grad_percentage_institution_wide":0,"grad_percentage_this_college":0},{"bin":"6-8","grad_percentage_total":0,"grad_percentage_other_college":0,"n_total_students":0,"n_grad_this_college":0,"n_grad_this_major":0,"grad_percentage_this_major":0,"n_grad_other_college":0,"bin_sort_order":2,"n_grad_institution_wide":12,"n_grad |
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 functools | |
h = 100 | |
b = range | |
r = functools.partial(b, 0) | |
yz = lambda y, z: dict(zip(r(h, y), [z]*h)) | |
a = dict(zip(b(100), b(100))) | |
a.update(yz(3, "F")) | |
a.update(yz(5, "B")) | |
a.update(yz(15, "FB")) | |
print a.values()[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
path = "./" #Override this | |
dropbox_dirs = set([el[:10] for el in os.listdir(".") | |
if os.path.join(path, el) and not el.startswith(".")]) | |
for el in dropbox_dirs: | |
if not os.path.exists(os.path.join(path, el)): | |
os.mkdir(os.path.join(path, el)) | |
os.system("mv %s*.* %s"%(os.path.join(path, el), os.path.join(path, el))) |
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 random | |
import string | |
def random_word_from_seed(seed, len): | |
random.seed(seed) | |
letters = string.ascii_lowercase | |
return ''.join([random.choice(letters) for i in range(len)]) | |
print random_word_from_seed(1944062, 5) +" "+random_word_from_seed(2068527, 5) |
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
{ | |
"metadata": { | |
"name": "Versioning" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
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
not_found = -1 | |
import unittest | |
class TestBinS(unittest.TestCase): | |
def test_empty(self): | |
lst = [] | |
key = 0 | |
self.assertEquals(binsearch(lst, 0,), -1) | |
def test_equal(self): | |
lst = [10, 10, 10, 10] |
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
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. | |
'NAME': 'bpcle.db', # Or path to database file if using sqlite3. | |
'USER': '', # Not used with sqlite3. | |
'PASSWORD': '', # Not used with sqlite3. | |
'HOST': '', # Set to empty string for localhost. Not used with sqlite3. | |
'PORT': '', # Set to empty string for default. Not used with sqlite3. | |
'TEST NAME':'test_database.sqlite', | |
} |
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
$.fn.toggleStuff = -> | |
$this = $(this) | |
anchorCss = | |
position: 'fixed' | |
top: '30px' | |
right: '10px' | |
'z-index': '999' | |
'font-size': '30px' | |
'font-weight': 'bold' | |
'text-decoration': 'none' |
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
// Reusable extension for jQuery so that we can hide jQuery objects | |
// and hide them. We will show an arrow at the top-right corner which | |
// will toggle the display of these. | |
// Examples: | |
// | |
// For github.com.js: | |
// $("#header").toggleStuff(); | |
// | |
// Some random site: | |
// $("#report_attachment").parent().next().toggleStuff() |
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
shabda@jazzy ~> python repopular_project.py | |
set(['http://github.com/Sutto/barista', 'http://github.com/alunny/sleight', 'http://github.com/pypy/pypy', 'http://github.com/jacksonh/manos-spark', 'http://github.com/dysinger/apparatus', 'http://github.com/Yelp/mrjob', 'http://github.com/videlalvaro/Thumper']) | |
shabda@jazzy ~> |
NewerOlder