<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Matt Hampel &#124; matth.org &#187; badgers</title>
	<atom:link href="http://matth.org/category/me/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://matth.org</link>
	<description>I’m Matt Hampel, a digital developer and civic information hacker.</description>
	<lastBuildDate>Thu, 15 Dec 2011 09:40:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>A script to batch merge multiple shapefiles into one using ogr2ogr / GDAL on Mac</title>
		<link>http://matth.org/2011/10/28/a-script-to-batch-merge-multiple-shapefiles-into-one-using-ogr2ogr-gdal-on-mac/</link>
		<comments>http://matth.org/2011/10/28/a-script-to-batch-merge-multiple-shapefiles-into-one-using-ogr2ogr-gdal-on-mac/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 16:02:42 +0000</pubDate>
		<dc:creator>Matt Hampel</dc:creator>
				<category><![CDATA[badgers]]></category>

		<guid isPermaLink="false">http://matth.org/?p=359</guid>
		<description><![CDATA[Original wiki page (you should use the version there) &#8212; copied here with a more descriptive title with the hope that it becomes easier to find. #Make a new directory called "tmp" and a sub directory called "merged" mkdir tmp mkdir tmp/merged #copy all zipped files to the "tmp" directory and then "cd" into it [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://trac.osgeo.org/gdal/wiki/FAQVector">Original wiki page</a> (you should use the version there) &#8212; copied here with a more descriptive title with the hope that it becomes easier to find. </p>
<pre><code>#Make a new directory called "tmp" and a sub directory called "merged"
mkdir tmp
mkdir tmp/merged

#copy all zipped files to the "tmp" directory and then "cd" into it
cp *.zip tmp
cd tmp

#unzip all the .zip archives
find . -name "*.zip" -exec unzip '{}' \;

#delete all .zip archives
rm *.zip

# move a single shapefile (and the cooresponded .shx, .dbf, etc files) to the
# "merged" directory (exchange 'myshape*' for the name of one of your shapefiles
# keeping the '*' at the end of the name)
find . -name 'myshape*' -exec mv '{}' merged \;

#Batch merge all the remaining shapefiles from the tmp dir into the copied
# file in the merge dir (exchange 'myshape' for the name of the copied shapefile)
for i in $(ls *.shp); do ogr2ogr -f 'ESRI Shapefile' -update -append merged $i -nln myshape
done</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://matth.org/2011/10/28/a-script-to-batch-merge-multiple-shapefiles-into-one-using-ogr2ogr-gdal-on-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using SELECT &#8230; WHERE IN in Hive</title>
		<link>http://matth.org/2011/10/26/using-select-where-in-in-hive/</link>
		<comments>http://matth.org/2011/10/26/using-select-where-in-in-hive/#comments</comments>
		<pubDate>Wed, 26 Oct 2011 14:49:42 +0000</pubDate>
		<dc:creator>Matt Hampel</dc:creator>
				<category><![CDATA[badgers]]></category>
		<category><![CDATA[hive]]></category>

		<guid isPermaLink="false">http://matth.org/?p=355</guid>
		<description><![CDATA[You can&#8217;t do it, but you can use SEMI JOINs. From the examples: SELECT a.key, a.value FROM a WHERE a.key in (SELECT b.key FROM B); can be rewritten to: SELECT a.key, a.val FROM a LEFT SEMI JOIN b on (a.key = b.key) (Mostly a note-to-self) Affordable php mysql hosting with cpanel]]></description>
			<content:encoded><![CDATA[<p>You can&#8217;t do it, but you <a href="https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Joins">can use SEMI JOINs</a>.</p>
<p>From the examples:</p>
<blockquote>
<pre>  SELECT a.key, a.value
  FROM a
  WHERE a.key in
   (SELECT b.key
    FROM B);</pre>
<p>can be rewritten to:</p>
<div>
<div>
<pre>   SELECT a.key, a.val
   FROM a LEFT SEMI JOIN b on (a.key = b.key)</pre>
</div>
</div>
<p>(Mostly a note-to-self)</p></blockquote>
<div style="display: none;">Affordable <a href="http://www.olnevhost.net/"><strong>php mysql hosting</strong></a> with cpanel</div>
]]></content:encoded>
			<wfw:commentRss>http://matth.org/2011/10/26/using-select-where-in-in-hive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Notes to self on map design</title>
		<link>http://matth.org/2011/05/09/notes-to-self-on-map-design/</link>
		<comments>http://matth.org/2011/05/09/notes-to-self-on-map-design/#comments</comments>
		<pubDate>Mon, 09 May 2011 15:34:32 +0000</pubDate>
		<dc:creator>Matt Hampel</dc:creator>
				<category><![CDATA[badgers]]></category>

		<guid isPermaLink="false">http://matth.org/?p=345</guid>
		<description><![CDATA[At far zoom levels: Use neighborhood names instead of major street names Just outline highways thin light lines for minor streets As you get closer, use the same color for minor streets, but now outline them (white/lighter center) Put highways below other road layers This round from looking at the devseed Baltimore local maps]]></description>
			<content:encoded><![CDATA[<p>At far zoom levels:</p>
<p>Use neighborhood names instead of major street names</p>
<p>Just outline highways</p>
<p>thin light lines for minor streets</p>
<p>As you get closer, use the same color for minor streets, but now outline them (white/lighter center)</p>
<p>Put highways below other road layers</p>
<p>This round from looking at the <a href="http://developmentseed.org/blog/2011/may/09/mapping-baltimores-open-data">devseed Baltimore local maps</a></p>
]]></content:encoded>
			<wfw:commentRss>http://matth.org/2011/05/09/notes-to-self-on-map-design/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Export an Excel file with several sheets as multiple csv files using Open Office</title>
		<link>http://matth.org/2011/03/01/export-an-excel-file-with-several-sheets-as-multiple-csv-files-using-open-office/</link>
		<comments>http://matth.org/2011/03/01/export-an-excel-file-with-several-sheets-as-multiple-csv-files-using-open-office/#comments</comments>
		<pubDate>Wed, 02 Mar 2011 04:13:50 +0000</pubDate>
		<dc:creator>Matt Hampel</dc:creator>
				<category><![CDATA[badgers]]></category>

		<guid isPermaLink="false">http://matth.org/?p=315</guid>
		<description><![CDATA[Datasets often come as Excel files with multiple sheets (for example, one per year). If you don&#8217;t have Excel, you can use OpenOffice and this macro to export all the sheets as separate CSV files. It takes a directory path, searches for all Excel files in that directory, and then saves each sheet in each [...]]]></description>
			<content:encoded><![CDATA[<p>Datasets often come as Excel files with multiple sheets (for example, one per year). If you don&#8217;t have Excel, you can use OpenOffice and <a href="http://extensions.services.openoffice.org/en/project/OOcalc_multi_sheets_export">this macro</a> to export all the sheets as separate CSV files. It takes a directory path, searches for all Excel files in that directory, and then saves each sheet in each file as CSV with the name (file name)_(sheet name).csv</p>
<p>To run it, you need to:</p>
<ol>
<li>Open Office Calc, click Tools -&gt; Macros -&gt; Organize Macros -&gt; OpenOffice.Org Basic.</li>
<li>Click the new button</li>
<li>Paste in the macro code</li>
<li>Change the file directory (cFolder variable, around like 29) to some folder. This is where OpenOffice will search for Excel files and save the results.</li>
<li>Run the macro (you might have to go through Tools -&gt; Macros -&gt; Run Macro)</li>
</ol>
<p>There probably is a way to do this directly from the command line.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://matth.org/2011/03/01/export-an-excel-file-with-several-sheets-as-multiple-csv-files-using-open-office/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing DocSplit / GraphicsMagick Postscript delegate failed</title>
		<link>http://matth.org/2010/11/17/fixing-docsplit-graphicsmagick-postscript-delegate-failed/</link>
		<comments>http://matth.org/2010/11/17/fixing-docsplit-graphicsmagick-postscript-delegate-failed/#comments</comments>
		<pubDate>Wed, 17 Nov 2010 16:48:36 +0000</pubDate>
		<dc:creator>Matt Hampel</dc:creator>
				<category><![CDATA[badgers]]></category>

		<guid isPermaLink="false">http://matth.org/?p=309</guid>
		<description><![CDATA[After installing DocSplit, I got this error when attempting to extract text from a PDF via OCR: $>docsplit text ./BSED.pdf --pages all execvp failed, errno = 2 (No such file or directory) gm convert: "gs" "-q" "-dBATCH" "-dMaxBitmap=50000000" "-dNOPAUSE" "-sDEVICE=ppmraw" "-dTextAlphaBits=4" "-dGraphicsAlphaBits=4" "-r200x200" "-dFirstPage=1" "-dLastPage=1" "-sOutputFile=/var/folders/D5/D5Cief2MHW8vTHOI8nkyPU+++TM/-Tmp-/d20101117-83113-1f9etpp/gmUoD1ux" "--" "/var/folders/D5/D5Cief2MHW8vTHOI8nkyPU+++TM/-Tmp-/d20101117-83113-1f9etpp/gmXsXajF" "-c" "quit". gm convert: Postscript delegate failed [...]]]></description>
			<content:encoded><![CDATA[<p>After installing <a href="http://documentcloud.github.com/docsplit/">DocSplit</a>, I got this error when attempting to extract text from a PDF via OCR:</p>
<p><code>$>docsplit text ./BSED.pdf --pages all<br />
execvp failed, errno = 2 (No such file or directory)<br />
gm convert: "gs" "-q" "-dBATCH" "-dMaxBitmap=50000000" "-dNOPAUSE" "-sDEVICE=ppmraw" "-dTextAlphaBits=4" "-dGraphicsAlphaBits=4" "-r200x200" "-dFirstPage=1" "-dLastPage=1" "-sOutputFile=/var/folders/D5/D5Cief2MHW8vTHOI8nkyPU+++TM/-Tmp-/d20101117-83113-1f9etpp/gmUoD1ux" "--" "/var/folders/D5/D5Cief2MHW8vTHOI8nkyPU+++TM/-Tmp-/d20101117-83113-1f9etpp/gmXsXajF" "-c" "quit".<br />
gm convert: Postscript delegate failed (./BSED.pdf).<br />
</code></p>
<p>I am on Mac OS 10.6. The solution was to upgrade <a href="http://pages.cs.wisc.edu/~ghost/">ghostscript</a> to the latest version: </p>
<p><code>$>brew install ghostscript</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://matth.org/2010/11/17/fixing-docsplit-graphicsmagick-postscript-delegate-failed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open Government and data in Detroit</title>
		<link>http://matth.org/2010/03/19/open-government-and-data-in-detroit/</link>
		<comments>http://matth.org/2010/03/19/open-government-and-data-in-detroit/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 21:16:40 +0000</pubDate>
		<dc:creator>Matt Hampel</dc:creator>
				<category><![CDATA[badgers]]></category>

		<guid isPermaLink="false">http://matth.org/2010/03/19/open-government-and-data-in-detroit/</guid>
		<description><![CDATA[If you are interested in either, both, or related subjects, please do get in touch: matthew.hampel@gmail.com This post is way too long in coming, especially because I was disappointed to find no other like it when I googled those keywords earlier this year. Some starting points: (hopefully I&#8217;ll be able to add more) http://detroitwiki.org/Data_about_Detroit http://datadrivendetroit.org/ [...]]]></description>
			<content:encoded><![CDATA[<p>If you are interested in either, both, or related subjects, please do get in touch: matthew.hampel@gmail.com</p>
<p>This post is way too long in coming, especially because I was disappointed to find no other like it when I googled those keywords earlier this year.</p>
<p>Some starting points: (hopefully I&#8217;ll be able to add more)</p>
<p>http://detroitwiki.org/Data_about_Detroit</p>
<p>http://datadrivendetroit.org/ (501c3, I&#8217;m interning there this semester)</p>
]]></content:encoded>
			<wfw:commentRss>http://matth.org/2010/03/19/open-government-and-data-in-detroit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lost Landscapes of Detroit</title>
		<link>http://matth.org/2010/02/16/lost-landscapes-of-detroit/</link>
		<comments>http://matth.org/2010/02/16/lost-landscapes-of-detroit/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 22:17:51 +0000</pubDate>
		<dc:creator>Matt Hampel</dc:creator>
				<category><![CDATA[badgers]]></category>

		<guid isPermaLink="false">http://matth.org/?p=299</guid>
		<description><![CDATA[Last week, Rick Prelinger of the Prelinger Archives showed a collection of home movies, newsreels, and other film clips of Detroit he has collected and digitized. The audience at MOCAD had a lot of fun shouting out the names of places and people as they went by. He handed out copies of the DVD and [...]]]></description>
			<content:encoded><![CDATA[<p>Last week, Rick Prelinger of the <a href="http://www.prelinger.com/">Prelinger Archives</a> showed a collection of home movies, newsreels, and other film clips of Detroit he has collected and digitized. The audience at <a href="http://www.mocadetroit.org/">MOCAD</a> had a lot of fun shouting out the names of places and people as they went by.</p>
<p>He handed out copies of the DVD and the work is under a Creative Commons license, so I&#8217;ve put up a <a href="http://tinyurl.com/yevz5jd">copy online as a torrent</a>.</p>
<p>You&#8217;ll need a torrent client to download it; I&#8217;d recommend <a href="http://www.transmissionbt.com">Transmission</a> for Mac or <a href="http://www.utorrent.com">uTorrent</a> for Windows. I&#8217;m looking for a place to upload it for streaming online.</p>
]]></content:encoded>
			<wfw:commentRss>http://matth.org/2010/02/16/lost-landscapes-of-detroit/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Class notes from today</title>
		<link>http://matth.org/2010/01/28/class-notes-from-today/</link>
		<comments>http://matth.org/2010/01/28/class-notes-from-today/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 17:04:33 +0000</pubDate>
		<dc:creator>Matt Hampel</dc:creator>
				<category><![CDATA[badgers]]></category>

		<guid isPermaLink="false">http://matth.org/?p=295</guid>
		<description><![CDATA[Wayne County&#8217;s version of anti-Kelo (actually pre-Kelo) Dumbbell tenements from a great Columbia University interactive page on apartment houses Detroit Historic District Commission has a page about each historic building, including dates significance was recognized. (can I get these in a shapefile?) Readings from The Power of Place. You can transfer air rights.]]></description>
			<content:encoded><![CDATA[<p><a href="http://judgepedia.org/index.php/County_of_Wayne_v._Edward_Hathcock_(2004) ">Wayne County&#8217;s version of anti-Kelo</a> (actually pre-Kelo)</p>
<p><a href="http://ci.columbia.edu/0240s/0243_2/0243_2_s1_2_text.html">Dumbbell tenements</a> from a great Columbia University interactive page on apartment houses</p>
<p><a href="http://www.detroitmi.gov/historic/">Detroit Historic District Commission</a> has a page about each historic building, including dates significance was recognized. (can I get these in a shapefile?)</p>
<p>Readings from <a href="http://www.amazon.com/gp/product/0262581523/">The Power of Place</a>.</p>
<p>You can transfer <a href="http://en.wikipedia.org/wiki/Air_rights">air rights</a>.</p>
<h1><span style="font-size: small;"><span style="font-weight: normal;"><br />
</span></span></h1>
]]></content:encoded>
			<wfw:commentRss>http://matth.org/2010/01/28/class-notes-from-today/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Looking for an online application management system.</title>
		<link>http://matth.org/2010/01/27/looking-for-an-online-application-management-system/</link>
		<comments>http://matth.org/2010/01/27/looking-for-an-online-application-management-system/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 23:47:02 +0000</pubDate>
		<dc:creator>Matt Hampel</dc:creator>
				<category><![CDATA[badgers]]></category>

		<guid isPermaLink="false">http://matth.org/?p=292</guid>
		<description><![CDATA[I&#8217;m looking for a tool that will let the Semester in Detroit program easily accept and process applications from students and community partners online. Here are the basic features I&#8217;m looking for: We can easily create an application with custom fields (Preferably with chunking. For example: personal information on one page, personal statement on the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m looking for a tool that will let the <a href="http://www.rc.lsa.umich.edu/sid/">Semester in Detroit program</a> easily accept and process applications from students and community partners online.</p>
<p>Here are the basic features I&#8217;m looking for:</p>
<ul>
<li>We can easily create an application with custom fields (Preferably with chunking. For example: personal information on one page, personal statement on the next, etc.)</li>
<li>Applicants create an account and fill out the fields online</li>
<li>Applicants can stop halfway through and finish the application later</li>
<li>Applicants push a button to submit their application</li>
<li>File uploads allowed</li>
<li>We can get the data out</li>
</ul>
<ul>
<li>Nice but not necessary: Some hidden fields for processing (like accepted/rejected/pending)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://matth.org/2010/01/27/looking-for-an-online-application-management-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Download every PDF linked from a page using Python.</title>
		<link>http://matth.org/2010/01/21/download-every-pdf-linked-from-a-page-using-python/</link>
		<comments>http://matth.org/2010/01/21/download-every-pdf-linked-from-a-page-using-python/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 03:08:51 +0000</pubDate>
		<dc:creator>Matt Hampel</dc:creator>
				<category><![CDATA[badgers]]></category>

		<guid isPermaLink="false">http://matth.org/?p=289</guid>
		<description><![CDATA[I wanted to download every agenda posted on the Detroit City Council website, but they were in different folders. Happily, I there&#8217;s one page that lists all of them, so I wrote this short script: import urllib2 import re from BeautifulSoup import BeautifulSoup, SoupStrainer import os import time # define the URL where all the [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to download every agenda posted on the Detroit City Council website, but they were in different folders. </p>
<p>Happily, I there&#8217;s one page that lists all of them, so I wrote this short script:</p>
<p><code>import urllib2<br />
import re<br />
from <a href="http://www.crummy.com/software/BeautifulSoup/">BeautifulSoup</a> import BeautifulSoup, SoupStrainer<br />
import os<br />
import time</p>
<p># define the URL where all the links are:<br />
url = "http://www.detroitmi.gov/legislative/CityClerk/2009add_cal.htm"<br />
base_url = "http://www.detroitmi.gov/legislative/CityClerk/"<br />
html = urllib2.urlopen(url).read()</p>
<p># only select links with 'pdf' in the href<br />
pdf_links = SoupStrainer('a', href=re.compile('pdf'))<br />
soup = BeautifulSoup(html, parseOnlyThese = pdf_links)</p>
<p>for link in soup:<br />
&nbsp;&nbsp;&nbsp;&nbsp;link = base_url + link['href'] # build the full path to the PDF<br />
&nbsp;&nbsp;&nbsp;&nbsp;os.system("wget " + link)<br />
&nbsp;&nbsp;&nbsp;&nbsp;time.sleep(10) # wait a little while to be courteous</code></p>
]]></content:encoded>
			<wfw:commentRss>http://matth.org/2010/01/21/download-every-pdf-linked-from-a-page-using-python/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

