(this writeup supplements a computational journalism assignment)
Jeremy Singer-Vine has been working on a new PDF-to-text/spreadsheet library native to Python: pdfplumber
The California WARN Act PDFs can be found at:
(this writeup supplements a computational journalism assignment)
Jeremy Singer-Vine has been working on a new PDF-to-text/spreadsheet library native to Python: pdfplumber
The California WARN Act PDFs can be found at:
This list of resources is all about acquring and processing aerial imagery. It's generally broken up in three ways: how to go about this in Photoshop/GIMP, using command-line tools, or in GIS software, depending what's most comfortable to you. Often these tools can be used in conjunction with each other.
# Oh, wow. So those other configuration files | |
# looked pretty readable. This one, though, | |
# looks OOOOOLLLD. It is old. And so it's | |
# less readable. But let's talk about it. | |
# Run on startup? Yes. | |
START=yes | |
# Set the number of files this daemon can | |
# touch. We need los of them because each |
# Okay, so, let's start by setting up a backend. | |
# Varnish needs to know where to send requests | |
# that fail to find an object in the cache. | |
# We'll send requests back to Nginx on port 8001. | |
backend default { | |
.host = "127.0.0.1"; | |
.port = "8001"; | |
} | |
# Varnish has some subfunctions (subroutines?) that start |
from django.contrib.gis.gdal import DataSource | |
from django.contrib.gis.gdal.geometries import Point | |
# Get the DC voting districts shape (from the Census Bureau) | |
ds = DataSource('/path/to/my/shapefiles/tl_2012_11_vtd10/tl_2012_11_vtd10.shp') | |
# Grab the layer that contains all of the shape data | |
layer = ds[0] | |
def get_shape_contains(layer, geometry): | |
# Iterate over every shape |
description "uWSGI server for electris CMS" | |
start on runlevel [2345] # start on all runlevels. | |
stop on runlevel [!2345] # stop when shutting down. | |
respawn # respawn if job crashes or is stopped ungracefully. | |
env DEPLOYMENT_TARGET=production # set any environment variables you like here. | |
env DJANGO_SETTINGS_FILE=conf/settings.py # more environment variables if you like. | |
env PYTHONPATH=/home/ubuntu/apps/my_app:/home/ubuntu/.virtualenv/my_app |
worker_processes 2; # sets two workers. might need 4 in a very high-traffic environment. | |
user www-data; # user to run nginx as. | |
pid /var/run/nginx.pid; # you'll have to create this pidfile or else things won't work. | |
events { | |
worker_connections 1024; # connections each worker can take. | |
use epoll; # epoll is vastly superior to other alternatives. | |
} | |
http { |
##References
##Create Models
Create tables:
rails g model Location
rails g model User
rails g model Checkin
As configured in my dotfiles.
start new:
tmux
start new with session name:
""" | |
A few notes: | |
* Lines starting with "#" signs are standard Python code comments | |
* Multi-line comments can be wrapped in triple-quotes (""") | |
""" | |
from itertools import islice, product | |
import calendar | |
from BeautifulSoup import BeautifulSoup | |
import requests |