This file contains hidden or 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
results = [(p1.address, p1.program), (p2.address, p2.program)] | |
grouped_results = {} | |
for elt in results: | |
if elt.address in grouped_results: | |
grouped_results[elt.address].append(elt.program) | |
else: | |
grouped_results[elt.address] = [elt.program] | |
# To print out the groupings: |
This file contains hidden or 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
echo "CREATE USER project_name WITH PASSWORD \'password\';" | psql postgres | |
createdb -O project_name project_name -T template_postgis | |
ogr2ogr -f PostgreSQL PG:dbname=databasename infile.shp | |
SELECT parcels FROM detroit where ST_Touches(current_parcel, detroit.geometry_column) | |
where current_parcel is a polygon geometry object in PostGIS | |
and detroit.geometry_column is the name of the column in the database with the polygon objects |
This file contains hidden or 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
n = maximum number of parcels that can be in a cluster | |
Get list of parcels to survey. | |
Create an empty list of clusters. | |
Find top-leftmost parcel. | |
Find up to n-1 parcels that border that parcel. | |
Only select parcels with the same street name. | |
Only select parcels that aren't already in a cluster | |
Put the selected parcels in the same cluster. |
This file contains hidden or 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
<<<<<<< HEAD [aka the thing you just pulled] | |
hello | |
======= | |
goodbye | |
>>>>>>> experiment:... [aka your files] |
This file contains hidden or 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
library(ggplot2) | |
library(RJSONIO) | |
library(foreign) | |
input_dir = "~/projects/cfa/misc/stats/" | |
snow = read.csv(paste(input_dir, "snow_pot.csv", sep="")) | |
?read.csv | |
class(snow) | |
dim(snow) |
This file contains hidden or 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
library(ggplot2) | |
library(RJSONIO) | |
library(foreign) | |
input_dir = "~/projects/cfa/misc/stats/" | |
snow = read.csv("~/projects/cfa/misc/stats/snow_pot.csv") | |
props = read.dbf("~/projects/cfa/misc/stats/SeoncAuctionProperties/SecondAuctionProperties.dbf") | |
income = fromJSON("~/projects/cfa/misc/stats/medianIncomeByTract.json") | |
incomeEdu = fromJSON("~/projects/cfa/misc/stats/medianIncomesByEduAndTract.json") |
This file contains hidden or 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
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011 | |
* http://benalman.com/ | |
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */ | |
(function($) { | |
var o = $({}); | |
$.subscribe = function() { | |
o.on.apply(o, arguments); |
This file contains hidden or 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
render: -> | |
$(this.el).html this.template() | |
bookHTML = for book in Books | |
(new BookView model: book).render().el | |
this.$('.book_list').append bookHTML | |
({ | |
render: function() { | |
var book, bookHTML; |
This file contains hidden or 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
/api/map/?points__within={ "type": "Polygon", "coordinates": [[[-125.363617, 48.656273], [-123.254242, 31.608656], [-77.902679, 26.068811], [-65.597992, 44.301984], [-125.363617, 48.656273]]]} |
This file contains hidden or 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
if(options.query != undefined) { | |
this.pages = new LW.collections.Pages(options.query); | |
}else { | |
this.pages = new LW.collections.Pages(); | |
} |