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
/* Name: onewire.pde | |
Read data from multiple DS18x20 digital temperature sensors | |
DS18B20 <http://www.maxim-ic.com/datasheet/index.mvp/id/2812> | |
DS18S20 <http://www.maxim-ic.com/datasheet/index.mvp/id/2815> | |
* Detect number and type of sensors, and whether each is using parasitic power | |
* Gracefully handles plugging/unplugging of sensors (but will not | |
detect new sensors after initialization) |
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/sh | |
wget -O usgs.txt http://earthquake.usgs.gov/earthquakes/dyfi/events/se/082311a/us/cdi_zip.txt | |
gmtset COLOR_NAN white | |
gmtset FORMAT_GEO_MAP DF | |
gmtset FONT_LABEL '16p,Helvetica,black' | |
I=0.1 | |
R=`awk '{FS=","; print $6, $5, $2}' usgs.txt | minmax -I1` | |
echo $R | |
N=`awk 'BEGIN{FS=","}{SUM += $3} END {print SUM}' usgs.txt` | |
R=-R-85/-70/34/45 |
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
;; this location is "~/.pudb-bp" in older versions of pudb | |
(setq pudb-bp-file (expand-file-name "~/.config/pudb/saved-breakpoints")) | |
(defun pudb-add-breakpoint () | |
(interactive) | |
(append-to-file | |
(concat "b " buffer-file-name ":" | |
(nth 1 (split-string (what-line))) "\n") | |
nil pudb-bp-file)) | |
(define-key py-mode-map (kbd "C-c C-t") 'pudb-add-breakpoint) |
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
#!/usr/bin/env python | |
''' | |
based on gil_detector.py | |
http://codepad.org/CeI6gJLk | |
Swapped out multiprocessing for threading | |
Effective use of multiple processors is done by checking how fast multiprocess code | |
is executed in relation to single-threaded code. | |
''' |
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
#!/usr/bin/env python | |
# -*- coding: iso-8859-15 -*- | |
"""Calculate position for comet Garradd | |
Author: Kelsey Jordahl | |
Time-stamp: <Sun Feb 26 12:28:17 EST 2012> | |
License: GPLv3 | |
""" | |
import ephem |
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
{"1024000": {"taxi": 18, "squeegee": 0, "noise": 112, "radioactive": 0, "street_condition": 7, "snow": 0, "sewer": 0, "graffiti": 0, "food_poisoning": 3, "streetlight": 0, "total": 210, "hpd": 0}, "3072000": {"taxi": 1, "squeegee": 0, "noise": 22, "radioactive": 0, "street_condition": 93, "snow": 17, "sewer": 12, "graffiti": 2, "food_poisoning": 4, "streetlight": 25, "total": 963, "hpd": 309}, "3080200": {"taxi": 9, "squeegee": 0, "noise": 120, "radioactive": 0, "street_condition": 82, "snow": 8, "sewer": 12, "graffiti": 21, "food_poisoning": 1, "streetlight": 83, "total": 3300, "hpd": 2392}, "4029100": {"taxi": 12, "squeegee": 0, "noise": 74, "radioactive": 0, "street_condition": 65, "snow": 36, "sewer": 14, "graffiti": 14, "food_poisoning": 18, "streetlight": 50, "total": 1993, "hpd": 655}, "4005900": {"taxi": 55, "squeegee": 0, "noise": 282, "radioactive": 0, "street_condition": 111, "snow": 14, "sewer": 10, "graffiti": 22, "food_poisoning": 2, "streetlight": 123, "total": 2752, "hpd": 688}, "3088400": {"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
{"1024000": {"taxi": 18, "squeegee": 0, "noise": 112, "radioactive": 0, "street_condition": 7, "snow": 0, "sewer": 0, "graffiti": 0, "food_poisoning": 3, "streetlight": 0, "total": 210, "hpd": 0}, "3072000": {"taxi": 1, "squeegee": 0, "noise": 22, "radioactive": 0, "street_condition": 93, "snow": 17, "sewer": 12, "graffiti": 2, "food_poisoning": 4, "streetlight": 25, "total": 963, "hpd": 309}, "3080200": {"taxi": 9, "squeegee": 0, "noise": 120, "radioactive": 0, "street_condition": 82, "snow": 8, "sewer": 12, "graffiti": 21, "food_poisoning": 1, "streetlight": 83, "total": 3300, "hpd": 2392}, "4029100": {"taxi": 12, "squeegee": 0, "noise": 74, "radioactive": 0, "street_condition": 65, "snow": 36, "sewer": 14, "graffiti": 14, "food_poisoning": 18, "streetlight": 50, "total": 1993, "hpd": 655}, "4005900": {"taxi": 55, "squeegee": 0, "noise": 282, "radioactive": 0, "street_condition": 111, "snow": 14, "sewer": 10, "graffiti": 22, "food_poisoning": 2, "streetlight": 123, "total": 2752, "hpd": 688}, "3088400": {"t |
Loading
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
from IPython.kernel.zmq.kernelapp import IPKernelApp | |
app = IPKernelApp.instance() | |
print app.connection_file |
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 urllib2 import urlopen | |
from cStringIO import StringIO | |
import json | |
from pyproj import Proj | |
from shapely.geometry import Point | |
from geopandas import GeoSeries, GeoDataFrame | |
# http://www.nyc.gov/html/dcp/download/bytes/nybb_13a.zip | |
boros = GeoDataFrame.from_file('/nybb_13a/nybb.shp', vfs='zip://nybb_13a.zip') | |
url = 'http://citibikenyc.com/stations/json' |
OlderNewer