Skip to content

Instantly share code, notes, and snippets.

View eightysteele's full-sized avatar

Aaron Steele eightysteele

View GitHub Profile
@eightysteele
eightysteele / data.csv
Created August 27, 2011 01:05
Unicode DictReader and DictWriter
id name age
0 aaron 34
1 tina 36
2 noah ©
@eightysteele
eightysteele / gist:1408088
Created November 30, 2011 04:59
Install pyhdf on Ubuntu Oneric
wget -c http://ufpr.dl.sourceforge.net/project/pysclint/pyhdf/0.8.3/pyhdf-0.8.3.tar.gz
tar zxvf pyhdf-0.8.3.tar.gz
cd pyhdf-0.8.3
sudo apt-get install libhdf4-dev
sudo apt-get install python2.6-dev
cd pyhdf
sudo apt-get install swig
swig -python hdfext.i
cd ..
export INCLUDE_DIRS=/usr/include/hdf
# Global Forest Watch API
# Copyright (C) 2013 World Resource Institute
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
$ ogrinfo --version
GDAL 1.10.1, released 2013/08/26
$ ogrinfo sad_polygons_fixed_130823.kml
ERROR 4: ERROR Parseing kml sad_polygons_fixed_130823.kml :junk after document element on line 821498 at offset 6
ERROR 4: ERROR Parseing kml sad_polygons_fixed_130823.kml :junk after document element on line 821498 at offset 6
FAILURE:
Unable to open datasource `sad_polygons_fixed_130823.kml'
def trimmer(rec):
keep_keys = ['class', 'country']
for key in rec.keys():
if key not in keep_keys:
rec.pop(key)
return rec
{
"higherclassification":"Animalia; Chordata; Aves; Ciconiiformes; Laridae",
"family":"Laridae",
"stateprovince":"Oregon",
"catalognumber":"91774",
"networks":"ORNIS",
"lifestage":"adult",
"rank":8,
"month":"6",
"decimallongitude":"-124.03817",
{
"rows":[
{
"sum":406623,
"iso":"IDN"
}
],
"total_rows":1,
"sql":"SELECT iso,sum(alerts) FROM forma_gadm_50 WHERE iso='IDN' GROUP BY iso",
"time":0.041
{:dc:publisher
"Janet Hinshaw University of Michigan Museum of Zoology<jhinshaw@umich.edu>",
:link "http://ipt.vertnet.org:8080/ipt/resource.do?r=ummz_birds",
:ipt:dwca "http://ipt.vertnet.org:8080/ipt/archive.do?r=ummz_birds",
:author "larussell@vertnet.org",
:guid
{:content "be5507b9-7abf-4b69-afe1-5ca2b7561734", :isPermaLink false},
:dc:creator
"Janet Hinshaw University of Michigan Museum of Zoology<jhinshaw@umich.edu>",
:title "UMMZ Birds Collection",
eightysteele:cascalog(develop)$ lein sub install
Retrieving lein-sub/lein-sub/0.2.1/lein-sub-0.2.1.pom from clojars
Retrieving codox/codox/0.6.4/codox-0.6.4.pom from clojars
Retrieving codox/codox.leiningen/0.6.4/codox.leiningen-0.6.4.pom from clojars
Retrieving leinjacker/leinjacker/0.4.1/leinjacker-0.4.1.pom from clojars
Retrieving org/clojure/core.contracts/0.0.1/core.contracts-0.0.1.pom from central
Retrieving org/clojure/pom.contrib/0.0.26/pom.contrib-0.0.26.pom from central
Retrieving org/sonatype/oss/oss-parent/5/oss-parent-5.pom from central
Retrieving org/clojure/core.unify/0.5.3/core.unify-0.5.3.pom from central
Retrieving org/clojure/clojure/1.4.0/clojure-1.4.0.pom from central
eightysteele:midje-cascalog(develop)$ git rev-parse HEAD
b8c210d9f99e0cbf1e44c01dadebecdbae84a473
eightysteele:midje-cascalog(develop)$ lein -v
Leiningen 2.0.0 on Java 1.7.0_15 OpenJDK 64-Bit Server VM
eightysteele:midje-cascalog(develop)$ lein repl
Retrieving midje/midje/1.5-beta3/midje-1.5-beta3.pom from clojars
Retrieving org/clojure/clojure/1.4.0/clojure-1.4.0.pom from central
Retrieving org/sonatype/oss/oss-parent/5/oss-parent-5.pom from central
Retrieving ordered/ordered/1.2.0/ordered-1.2.0.pom from clojars
Retrieving org/clojure/math.combinatorics/0.0.1/math.combinatorics-0.0.1.pom from central