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
from os import mkdir | |
from requests import get | |
# example: http://www.ffextreme.com/media/ff12/music/mp3/cd1/01.mp3 | |
base_url = 'http://www.ffextreme.com/media/ff12/music/mp3/' | |
print 'from {} ...'.format(base_url) | |
disks = {'cd1':30, 'cd2':25, 'cd3':24, 'cd4':21} # tracks per disk | |
for disk in sorted(disks.keys()): | |
mkdir(disk) |
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
from pylab import * | |
from scipy.misc import comb | |
def diff_simp(p): | |
return 7*3*(p**5)*(1-p)**2 + 7*(p**6)*(1-p) + p**7 - p**3 | |
# the probability of a assembling [n] of [t] people, each being available with | |
# probability [p] | |
def availability(p,n,t): |
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 matplotlib.pyplot as plt | |
room_seating = {} | |
with open('rooms.txt') as f: | |
for line in f: | |
_,name,seats,_ = line.split(',') | |
room_seating[name.strip()] = int(seats.strip()) | |
seats = room_seating.values() | |
seats.sort(reverse=True) |