Skip to content

Instantly share code, notes, and snippets.

View seangrogan's full-sized avatar

Sean Grogan seangrogan

View GitHub Profile
@seangrogan
seangrogan / 2015-mls-schedule.csv
Created December 10, 2015 00:52 — forked from matt-bernhardt/2015-mls-schedule.csv
This is a CSV formatted version of the 2015 MLS regular season schedule. I pulled this off the MLS website on January 10, 2015 at http://www.mlssoccer.com/schedule?month=all&year=2015&club=all&competition_type=46&broadcast_type=all&op=Search&form_id=mls_schedule_form using a mix of Processing, jSoup, and OpenRefine. I've tried not to introduce a…
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 10.
MatchTime,Weekday,Month,Day,Year,Time,Composite,Home,Away,Stadium
"Friday, March 6, 2015 10:00PM EST",Friday,March,06,2015,20:00,2015-03-06 20:00,LA Galaxy,Chicago,StubHub Center
"Saturday, March 7, 2015 3:00PM EST",Saturday,March,07,2015,15:00,2015-03-07 15:00,D.C. United,Montreal,RFK Stadium
"Saturday, March 7, 2015 4:00PM EST",Saturday,March,07,2015,16:00,2015-03-07 16:00,Philadelphia,Colorado,PPL Park
"Saturday, March 7, 2015 6:00PM EST",Saturday,March,07,2015,18:00,2015-03-07 18:00,Vancouver,Toronto FC,BC Place
"Saturday, March 7, 2015 8:30PM EST",Saturday,March,07,2015,20:30,2015-03-07 20:30,FC Dallas,San Jose,Toyota Stadium
"Saturday, March 7, 2015 8:30PM EST",Saturday,March,07,2015,20:30,2015-03-07 20:30,Houston,Columbus,BBVA Compass Stadium
"Saturday, March 7, 2015 10:30PM EST",Saturday,March,07,2015,20:30,2015-03-07 20:30,Portland,Real Salt Lake,Providence Park
"Sunday, March 8, 2015 5:00PM EDT",Sunday,March,08,2015,17:00,2015-03-08 17:00,Orlando,New York City,Orlando Citrus Bowl
"Sunday, March 8, 2
""" A simple script for reading 'http://worldcup.sfg.io/matches' and outputting it in the
command prompt. It will display the scores of all the matches as well as a table of the
leading scorer(s) and the next 10 best scorers. If you are interested in getting in touch
I can be reached at grogie05@outlook.com
"""
import urllib.request
import json
resp = urllib.request.urlopen('http://worldcup.sfg.io/matches').read()
m = 0
import random
import time
def monty_hall_sim(runs=10000, random_seed=None):
"""Runs a simulation of a series of monty hall games. 'runs=' is the variable to
determine the number of times you run the test. The program will run 3 cases, always
switch ("theoretical" optimal solution), Never switching(sub-optimal solution), and
Sometimes switching (ignoring the first bit of information in the monty hall problem).
"""