View coaches.rb
#!/usr/bin/env ruby
require 'csv'
coach_years=CSV.read('coaches2.csv')[1..-1]
stints = coach_years.sort_by(&:reverse).each_with_object([]) do |coach_year, coach_stints|
season, coach = coach_year
start_year = season.split('-')[0].to_i
end_year = start_year + 1
View coaches.csv
season coach
1994-95 Bill Blair
1995-96 Bill Blair
1990-91 Bill Musselman
1989-90 Bill Musselman
2006-07 Dwane Casey
2005-06 Dwane Casey
1999-00 Flip Saunders
2014-15 Flip Saunders
2004-05 Flip Saunders
View postgres-ordered-sets.md

Examples of ordered set aggregates in Postgres.

SELECT round(avg(pie)::numeric, 2),
       percentile_cont(array[0.25, 0.5, 0.75, 0.95]) WITHIN GROUP (ORDER BY pie) AS percentiles
FROM player_stats_advanced
WHERE permode = 'pergame';

round | percentiles

View postgres-regex.sql
select array_to_string(array_agg(i), '') from
(select (regexp_matches('Letter-1-2', '[A-Z0-9]', 'g'))[1] i) t;
View locations.csv
location
Luverne, Alabama
Madison, Alabama
Theodore, Alabama
Oneonta, Alabama
Odenville, Alabama
Heflin, Alabama
Jasper, Alabama
Midfield, Alabama
Greenville, Alabama
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.axis path,
.axis line {
fill: none;
stroke: #000;
shape-rendering: crispEdges;
}
View point-dispersal.sql
drop table if exists inspection_point_buffers;
-- Group identical overlapping points and count how many occupy
-- the space.
create temporary table inspection_overlappoing_points as
select a.geom as geom,
count(*)
from latest_inspections a,
latest_inspections b
where st_equals(a.geom, b.geom)
View index.html
<!doctype html>
<head>
<meta charset="utf-8">
<style>
body {
font-family: OpenSans, Helvetica;
}
.title {
margin: 0;
View crash-details.txt
column_name
--------------------------------------------------------
crash_id
record_type
vehicle_id
participant_id
participant_display_seq
vehicle_coded_seq
participant_vehicle_seq
serial_
View feedback.md
  • Datasets first, APIs second - Doing any kind of aggregate analysis usually requires working with complete datasets. REST APIs aren't ideal for this use case. APIs are not data, they are a means of exposing it.
  • Machine-friendly retrieval of raw datasets - Avoid the assumption that there's a human, using a web browser, manually clicking a link. For example, scripts that fetch new daily crime data via curl would be a likely scenario. Make it easy for machines by removing authentication, unnecessary redirects, JavaScript-based retrieval or POST-style retrieval.
  • Document long column names - Shapefile attributes are limited to 10 characters. This makes many attributes difficult to decipher without associated metadata. For example, here are a few attributes from a Garbage Collection dataset. Include a file with the long column name mappings and include both the long and short name in the metada