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 csv | |
AM_PEAK_LEN=3.0 #hours, 6am-9am | |
PM_PEAK_LEN=3.0 #hours 3pm-6pm | |
ROUTE_ROW=0 | |
CUR_TRIP_PEAK_AM=3 | |
CUR_TRIP_PEAK_PM=4 | |
PROP_TRIP_PEAK_AM=5 | |
PROP_TRIP_PEAK_PM=6 |
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
# language corpus here: http://www.kilgarriff.co.uk/BNClists/all.al.gz | |
# a tale of two cities here: http://www.gutenberg.org/cache/epub/98/pg98.txt | |
import math | |
import re | |
codes = {} | |
codelens = {} | |
def baseN(num,b,numerals="abcdefghijklmnopqrstuvwxyz"): |
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
print "hello, world" |
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
BufferedReader reader; | |
String line; | |
class ShapePoint { | |
public int shape_id; | |
public float lat; | |
public float lon; | |
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
int WIDTH = 500; | |
int HEIGHT = 500; | |
int ANTS_AT_A_TIME = 30; | |
boolean DRAW_PATH = false; | |
float sum_array( float[] floats ) { | |
float ret = 0; | |
for(int i=0; i<floats.length; i++){ | |
ret += floats[i]; |
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
int NGROUPS=5; | |
float INFINITY = 100000000; | |
int RANDOM_POINTS = 75; | |
boolean USE_RANDOM_POINTS = true; | |
float TRUCK_SLACK = 1.1; | |
class PointGroup { | |
ArrayList points; | |
PVector mean; | |
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 sqlite3 | |
def main(osmdb_name, gdb_name,map_filename): | |
osmdb = sqlite3.connect(osmdb_name) | |
gdb = sqlite3.connect(gdb_name) | |
c = gdb.cursor() | |
c.execute( "select vertex1, count(*) from edges where vertex1 LIKE 'osm%' group by vertex1" ) | |
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 gtfs import Schedule | |
from gtfs.entity import Trip, StopTime, Stop | |
from sqlalchemy.orm import eagerload | |
import csv | |
import sys | |
from prender import processing | |
def cons(ary): | |
for i in range(len(ary)-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
"""Get a bunch of 2gram files. Then split the 2grams with spaceize(). Then set up a database like | |
create table digram (word1 text, word2 text, year integer, match_count integer, page_count integer, volume_count integer); | |
.separator "\t" | |
.import spaceized.csv digram | |
then you're set up to use chain()""" | |
import csv | |
import sqlite3 |
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
# wow. energy. | |
# | |
# grab source data from http://www-k12.atmos.washington.edu/k12/grayskies/nw_weather.html | |
import csv | |
from datetime import datetime, timedelta | |
MINS_IN_DAY=1440 | |
fp = open( "LFEM_data-.csv" ) |
OlderNewer