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
{ | |
"traceFileName":"S11900.gpx.csv", | |
"outputFileName":"tracking-result.json", | |
"otpGraphLocation":"/tmp", | |
"initialParameters": { | |
"obsCov":[100.0,100.0], | |
"onRoadStateCov":[6.25E-4], | |
"offRoadStateCov":[6.25E-4,6.25E-4], | |
"offTransitionProbs":[1.0,+Infinity], | |
"onTransitionProbs":[+Infinity,1.0], |
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
( | |
SELECT | |
posting_time, | |
latitude, | |
longitude | |
FROM plows | |
ORDER BY lat_lon <-> ST_SetSRID(ST_MakePoint(-87.637148,41.887707),4326) | |
) INTERSECT ( | |
SELECT | |
posting_time, |
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 requests | |
from requests.sessions import Session | |
from BeautifulSoup import BeautifulSoup | |
from urllib import urlencode | |
get_params = { | |
'AddressSearchType': 'Starts with', | |
'Archived': 'false', | |
'CitySearchType': 'Starts with', | |
'ContributionType': 'All Types', |
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
=> CREATE TABLE crime_to_streets AS | |
WITH ordered_nearest AS ( | |
SELECT ST_GeometryN(streets.geom, 1) AS streets_geom, | |
streets.gid AS streets_gid, | |
crime.geom AS crime_geom, | |
crime.id AS crime_id, | |
st_distance(streets.geom, crime.geom) AS distance | |
FROM streets | |
JOIN dat_chicago_crimes_all AS crime | |
ON ST_DWithin(streets.geom, crime.geom, 200) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 | |
def table_it(fname): | |
outs = '<table id="abms" class="dataTable" aria-describedby="abms_info">' | |
with open(fname, 'rb') as f: | |
reader = csv.reader(f) | |
headers = reader.next() | |
outs += '<thead><tr>' | |
outs += ''.join(['<th>%s</th>' % h for h in headers]) | |
outs += '</tr></thead><tbody>' |
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 os | |
from ordereddict import OrderedDict | |
from gdata.spreadsheet.service import SpreadsheetsService | |
from gdata.spreadsheet.service import CellQuery | |
import json | |
import codecs | |
import shutil | |
# Source for this is here https://github.com/newsapps/flask-tarbell/blob/master/tarbell/slughifi.py | |
from slughifi import slughifi |
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
MongoDB upstart scripts for Ubuntu. | |
Run following commands after installing upstart scripts: | |
ln -s /lib/init/upstart-job /etc/init.d/mongoconf | |
ln -s /lib/init/upstart-job /etc/init.d/mongodb | |
ln -s /lib/init/upstart-job /etc/init.d/mongos | |
To start services use: |
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 os | |
import json | |
from datetime import datetime | |
# first a super stupid exception to use | |
class QueryError(Exception): | |
def __init__(self, value): | |
self.value = value | |
def __str__(self): | |
return repr(self.value) |
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
{ | |
"weather": { | |
"FAHR_MIN": 42.980000000000004, | |
"CELSIUS_MIN": 6.1, | |
"CELSIUS_MAX": 12.8, | |
"FAHR_MAX": 55.040000000000006 | |
}, | |
"meta": { | |
"total": { | |
"key": "total", |