<?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>Joshua Tauberer's Blog</title>
	<atom:link href="http://razor.occams.info/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://razor.occams.info/blog</link>
	<description></description>
	<lastBuildDate>Mon, 18 Apr 2011 12:16:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>The status of policy implementations of Open Government Data</title>
		<link>http://razor.occams.info/blog/2011/04/18/the-status-of-policy-implementations-of-open-government-data/</link>
		<comments>http://razor.occams.info/blog/2011/04/18/the-status-of-policy-implementations-of-open-government-data/#comments</comments>
		<pubDate>Mon, 18 Apr 2011 12:08:21 +0000</pubDate>
		<dc:creator>Joshua Tauberer</dc:creator>
				<category><![CDATA[Civic Hacking]]></category>
		<category><![CDATA[Open House/Senate Projects]]></category>

		<guid isPermaLink="false">http://razor.occams.info/blog/?p=500</guid>
		<description><![CDATA[On the Open House Project mail list, Gregory Slater asked: Once again, where are we in simple mere machine readable, standardized format, truly searchable data Things are getting better all the time. It&#8217;s not fast. But there is slow and steady progress. 2009 was a big year. We saw the Senate start publishing votes in XML, the launch [...]]]></description>
			<content:encoded><![CDATA[<p>On the Open House Project mail list, Gregory Slater asked:</p>
<blockquote><p>Once again, where are we in simple mere machine readable, standardized format, truly searchable data</p></blockquote>
<p>Things are getting better all the time. It&#8217;s not fast. But there is slow and steady progress.</p>
<p>2009 was a big year. We saw the <a href="http://www.cjr.org/campaign_desk/senate_goes_xml.php">Senate start publishing votes in XML</a>, the launch of data.gov and the Open Government Directive, and the GPO released <a href="http://www.washingtonpost.com/wp-dyn/content/article/2009/10/04/AR2009100402533.html?hpid=sec-politics">XML for the Federal Register</a> and <a href="http://www.gpo.gov/pdfs/news-media/PrepRe_072709.pdf">Code of Federal Regulations</a>. The House also began publishing its <a href="http://disbursements.house.gov/">spending data</a> electronically. There were also <a href="http://www.opengovdata.org/home/legislation">open standards laws passed in Vancouver and Portland</a>.</p>
<p>2010 was a big year for posturing. We saw introduced in Congress H.R. 4983: Transparency in Government Act of 2010 (Quigley), H.R. 6289: To  direct the Librarian of Congress to make available to the public the bulk legislative&#8230; (Foster), and H.R. 4858: <a href="http://sunlightfoundation.com/policy/poia/">The Public Online Information Act of 2010</a>. The Congressional Transparency Caucus was created (Quigley/Issa). An open data law was passed in <a href="http://www.opengovdata.org/home/legislation">San Francisco, and bills were introduced in New York City and New York State</a>.</p>
<p>This year, an open data bill was <a href="http://www.opengovdata.org/home/legislation">introduced in New Hampshire</a> (HB 310-FN), and POIA was reintroduced (Israel/Tester). I just noticed that GPO has last month added a bulk data download for <a href="http://www.gpo.gov/fdsys/browse/collectiontab.action">Public Papers of the Presidents of the United States (2009)</a>. The <a href="http://sunlightfoundation.com/blog/2011/01/05/new-transparency-in-the-new-house-rules/">new House rules package</a> addresses public access to committee records and data formats, though I am not aware if the rules have had any practical consequences.</p>
<p>We owe Sunlight a lot of credit for pushing many of these things forward.</p>
<p>Besides all of this, there have been a number of &#8220;contests&#8221; lately (<a href="http://challenge.gov/">http://challenge.gov/</a>) some offering prizes to use government data. Clay Johnson posted two new ones to the sunlightlabs mail list this week. The only thing I&#8217;ll say here about the strategy of the open government movement is that we haven&#8217;t taken the challenges seriously, and I think it&#8217;s a missed opportunity to show why open data matters. But it&#8217;s just one of many things to do.</p>
]]></content:encoded>
			<wfw:commentRss>http://razor.occams.info/blog/2011/04/18/the-status-of-policy-implementations-of-open-government-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Designing accessible color spectrums</title>
		<link>http://razor.occams.info/blog/2011/01/08/designing-accessible-color-spectrums/</link>
		<comments>http://razor.occams.info/blog/2011/01/08/designing-accessible-color-spectrums/#comments</comments>
		<pubDate>Sun, 09 Jan 2011 00:13:27 +0000</pubDate>
		<dc:creator>Joshua Tauberer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://razor.occams.info/blog/?p=475</guid>
		<description><![CDATA[As a web developer who likes to produce info graphics, I&#8217;ve often run into the problem of choosing good color palettes for charts and, in the harder case, a smooth color spectrum. Colors should be aesthetically pleasing and able to convey differences in accordance with our perceptual abilities. UPDATE 1: Jan 9, 2011: I made a number [...]]]></description>
			<content:encoded><![CDATA[<p>As a web developer who likes to produce info graphics, I&#8217;ve often run into the problem of choosing good color palettes for charts and, in the harder case, a smooth color spectrum. Colors should be aesthetically pleasing and able to convey differences in accordance with our perceptual abilities.</p>
<p>UPDATE 1: Jan 9, 2011: I made a number of mistakes the first time around, including having the diagrams flipped.</p>
<p>There are a number of types of color blindness (<a href="http://en.wikipedia.org/wiki/Color_blindness" target="_blank">see Wikipedia</a>) but the most common are the absence or dysfunction of the &#8220;red&#8221;, &#8220;blue&#8221;, and &#8220;green&#8221; cones in the retina. The &#8220;red&#8221; and &#8220;green&#8221; cones affect up to 10% of men, the &#8220;blue&#8221; cones and all cones in women must more rarely. When a cone is absent, the individual can&#8217;t make distinctions among colors that vary only in the quantity of that color, if you think about colors as being a mix of red, green, and blue. (Actually the cones don&#8217;t respond to prototypical red, green, and blue but instead have a distribution of response over a range of color wavelengths not necessarily particularly close to the prototypical wavelengths.)</p>
<p>Until today I didn&#8217;t really understand the mechanics of color blindness and so it was difficult to understand how to choose good color spectra. Worse, the only simple guide I could find through Googling gave some examples of <a href="http://joeclark.org/book/sashay/serialization/Chapter09.html#p-1540" target="_blank">good color palettes</a> to use without explanation and without relation to the various types of color blindness.</p>
<p>Here&#8217;s what I&#8217;ve learned this afternoon.</p>
<p>The <a href="http://en.wikipedia.org/wiki/CIE_1931_color_space" target="_blank">CIE 1931 color space</a> is a mathematical model for our perception of color based on the activity of the three types of cones. As with &#8220;normal&#8221; seeers who have three types of cones, the CIE 1931 model has three dimensions of color. And it has two powerful implications: first, it gives us a coordinate system that covers the gamut of colors that can be perceived. Second, it gives a mathematical model that can be used to understand <a href="http://www.colblindor.com/2007/01/23/confusion-lines-of-the-cie-1931-color-space/" target="_blank">what happens for color blind people</a>. In particular, in the CIE 1931 flattened two-dimensional color space, color blindless is represented by radial lines emanating from a red, green, or blue &#8220;copunctal point&#8221;. Color blind individuals (of each type) cannot distinguish two colors <a href="http://www.colblindor.com/2009/01/19/colorblind-colors-of-confusion/" target="_blank">if they fall on the same radial line</a>. These are called confusion lines. (Also, this is an interesting way of understanding the reduction of one dimension of perception.)</p>
<div class="wp-caption alignnone" style="width: 335px"><a href="http://www.colblindor.com/wp-content/images/confusion-lines-protan.jpg"><img class="     " title="CIE 1931 Color Space and Confusion Lines for &quot;Red&quot; Color Blindness, from http://www.colblindor.com" src="http://www.colblindor.com/wp-content/images/confusion-lines-protan.jpg" alt="" width="325" height="359" /></a><p class="wp-caption-text">CIE 1931 Color Space and Confusion Lines for &quot;Red&quot; Color Blindness, from http://www.colblindor.com</p></div>
<p>I found this fascinating.</p>
<p>Now let&#8217;s make this practical. For a web designer concerned about accessibility, avoid following radial lines! More on this in a moment.</p>
<p>Backing up from color blindness, it&#8217;s important that the choice of colors on a spectrum are spaced to correspond with our ability to distinguish nearby colors. One drawback of the CIE 1931 model is that, for instance, green gets an unfairly large region compared to other colors &#8212; that whole area up top just looks like the same green to me. A newer alternative color space called <a href="http://en.wikipedia.org/wiki/Lab_color_space" target="_blank">CIE 1976 (L*, a*, b*)</a> (a.k.a. CIE LAB) is a transformation of the older CIE 1931 space so that equal distances in the color space represent equal amounts of perceptual distance. A color spectrum for a chart should be taken by drawing a line or curve through this type of color space. (In the images below, the color space is larger than the colored region but the black areas cannot be represented on computer screens because they do not fall in the RGB color space.)</p>
<p>Now we have to put these two together. The CIE 1931 color space gives a model for how to choose accessible colors: avoid the confusion lines. The best way to avoid a confusion line is to <strong>go perpendicular to confusion lines</strong>. But we want to go perpendicularly in CIE LAB space so that we make the most perceptually distinct step. (I&#8217;m assuming that perceptual distinctiveness between two points in CIE LAB space is unaffected by color blindness. It&#8217;s probably wrong but good enough.)</p>
<p>Let&#8217;s start with protanopia, the lack of &#8220;red&#8221; cones, as an example. The image below plots in the dark dotted lines the confusion lines for protanopia on the CIE LAB color space. Note that because CIE LAB space is a distortion of the CIE 1931 space, the confusion lines no longer appear to radiate from a point.  (This color space has a third dimension for lightness, L in 0-100, not shown. Here I&#8217;m choosing L=50.) For a &#8220;normal&#8221;-sighted individual, any path through the color space will be perceptually useful for a chart. For a protanopic, only paths that go perpendicular to the confusion lines will have maximal perceptible differences. If you follow confusion lines, the protanopic will not be able to tell the difference. As you can tell, going from red to green is not a good idea since it follows a confusion line. The perpendiculars are indicated by white arrows. Good gradients follow the perpendiculars.</p>
<div id="attachment_476" class="wp-caption alignnone" style="width: 310px"><a href="http://razor.occams.info/blog/wp-content/uploads/2011/01/colorspace_50_protan.png"><img class="alignnone size-medium wp-image-493" title="colorspace_50_protan" src="http://razor.occams.info/blog/wp-content/uploads/2011/01/colorspace_50_protan-300x300.png" alt="" width="300" height="300" /></a><p class="wp-caption-text">Protan Spectrum Lines in CIE LAB L=50</p></div>
<p>Here&#8217;s the full set of images for protanopia (red, left), deuteranopia (green, middle), and tritanopia (blue, right), for different values of lightness:</p>
<table>
<tbody>
<tr>
<td><a href="http://razor.occams.info/blog/wp-content/uploads/2011/01/colorspace_25_protan.png"><img class="alignnone size-medium wp-image-479" title="colorspace_25_protan" src="http://razor.occams.info/blog/wp-content/uploads/2011/01/colorspace_25_protan-300x300.png" alt="" width="300" height="300" /></a></td>
<td><a href="http://razor.occams.info/blog/wp-content/uploads/2011/01/colorspace_25_deutan.png"><img class="alignnone size-medium wp-image-480" title="colorspace_25_deutan" src="http://razor.occams.info/blog/wp-content/uploads/2011/01/colorspace_25_deutan-300x300.png" alt="" width="300" height="300" /></a></td>
<td><a href="http://razor.occams.info/blog/wp-content/uploads/2011/01/colorspace_25_tritan.png"><img class="alignnone size-medium wp-image-481" title="colorspace_25_tritan" src="http://razor.occams.info/blog/wp-content/uploads/2011/01/colorspace_25_tritan-300x300.png" alt="" width="300" height="300" /></a></td>
</tr>
<tr>
<td><a href="http://razor.occams.info/blog/wp-content/uploads/2011/01/colorspace_50_protan.png"><img title="Protan Spectrum Lines in CIE LAB L=50" src="http://razor.occams.info/blog/wp-content/uploads/2011/01/colorspace_50_protan-300x300.png" alt="" width="300" height="300" /></a></td>
<td><a href="http://razor.occams.info/blog/wp-content/uploads/2011/01/colorspace_50_deutan.png"><img class="alignnone size-medium wp-image-477" title="colorspace_50_deutan" src="http://razor.occams.info/blog/wp-content/uploads/2011/01/colorspace_50_deutan-300x300.png" alt="" width="300" height="300" /></a></td>
<td><a href="http://razor.occams.info/blog/wp-content/uploads/2011/01/colorspace_50_tritan.png"><img class="alignnone size-medium wp-image-478" title="colorspace_50_tritan" src="http://razor.occams.info/blog/wp-content/uploads/2011/01/colorspace_50_tritan-300x300.png" alt="" width="300" height="300" /></a></td>
</tr>
<tr>
<td><a href="http://razor.occams.info/blog/wp-content/uploads/2011/01/colorspace_75_protan.png"><img class="alignnone size-medium wp-image-482" title="colorspace_75_protan" src="http://razor.occams.info/blog/wp-content/uploads/2011/01/colorspace_75_protan-300x300.png" alt="" width="300" height="300" /></a></td>
<td><a href="http://razor.occams.info/blog/wp-content/uploads/2011/01/colorspace_75_deutan.png"><img class="alignnone size-medium wp-image-483" title="colorspace_75_deutan" src="http://razor.occams.info/blog/wp-content/uploads/2011/01/colorspace_75_deutan-300x300.png" alt="" width="300" height="300" /></a></td>
<td><a href="http://razor.occams.info/blog/wp-content/uploads/2011/01/colorspace_75_tritan.png"><img class="alignnone size-medium wp-image-484" title="colorspace_75_tritan" src="http://razor.occams.info/blog/wp-content/uploads/2011/01/colorspace_75_tritan-300x300.png" alt="" width="300" height="300" /></a></td>
</tr>
</tbody>
</table>
<p>As you can see, &#8220;red&#8221; and &#8220;green&#8221; cone color blindness is similar. &#8220;Blue&#8221; cone color blindness is totally different, in fact it&#8217;s practically a 90-degree rotation of the other two making it impossible to follow a line that is maximally perceptible by everyone.</p>
<p>Since the first two are similar and the prevalence of tritanopia and tritanomaly are considerably rarer compared to the other two, if we put tritanopia and tritanomaly aside (for now!) and design for the other two, we might be able to choose a single color spectrum that at least works reasonably well for those cases. A good color spectrum to use will be a vertical line that stays within the RGB boundary, either orange to blue or red to purple. That said, if we vary from the perpendiculars a little bit we might be able to satisfy everyone a little. Orange to turquoise and green to pink go diagonally across the color space and so might cover everyone.</p>
<p>That said, this is all theoretical. I&#8217;m not color blind so I don&#8217;t have any intuitions about whether this is right. Also, this is my first time getting into the math of colors so&#8230; maybe I got it wrong somewhere. In fact, in my first version of this I had numbers backwards and perpendicular lines that weren&#8217;t. Hopefully this is closer to the truth now. (And I appreciate the great explanations given by <a href="http://www.colblindor.com/about/">Daniel Flück</a> at his blog.)</p>
<p>Finally, apparently everyone can see lightness, so the most accessible spectrum is just varying the lightness (and the color doesn&#8217;t matter).</p>
<p>These images were created with a Python script and the grapefruit, numpy, and matplotlib libraries. Here is the code:</p>
<pre class="code"># Usage: python plot.py L protan|deutan|tritan
#
# e.g. python plot.py 50 protan
# e.g. python plot.py 50 protan
#
# To generate all of the images in at a bash shell:
#    for L in {25,50,75}; do for b in {protan,deutan,tritan}; do echo $L $b; python plot.py $L $b; done; done

###########################################

import sys
from math import sqrt, atan2
from grapefruit import Color
import matplotlib.pyplot as plt
import numpy

w, h = (480, 480)
L = float(sys.argv[1])
bt = sys.argv[2] # blindness type

# According to http://www.colblindor.com/2009/01/19/colorblind-colors-of-confusion/
# These are points for each type of color blindness around which the dimensionality
# of the color space is reduced, in CIE 1931 color space.
copunctal_points = {
	"protan": (0.7635, 0.2365),
	"deutan": (1.4000, -0.4000),
	"tritan": (0.1748	, 0.0000)
	}

# Draw the color space.
colorspace = [[(0.0,0.0,0.0) for x in xrange(0, w)] for y in xrange(0, h)]
for x in xrange(0, w):
	for y in xrange(0, h):
		# Compute the CIE L*, a*, b* coordinates (easy, since our x,y coordinates
		# are just a translation and scaling of the LAB coordinates).
		a = 2.0*x/(w-1) - 1.0
		b = 1.0 - 2.0*y/(h-1)

		# Convert this into sRGB so we can plot the color, and plot it.
		clr = Color.NewFromLab(L, a, b)
		r, g, b = clr.rgb
		if r &lt; 0 or g &lt; 0 or b &lt; 0 or r &gt; 1 or g &gt; 1 or b &gt; 1:
			continue

		colorspace[y][x] = (r,g,b)

# Draw the confusion line or spectrum line gradient.
csegs = 15
contourpoints = {
	"x": [[0 for x in xrange(0, csegs)] for y in xrange(0, csegs)],
	"y": [[0 for x in xrange(0, csegs)] for y in xrange(0, csegs)],
	"spectrum": [[0 for x in xrange(0, csegs)] for y in xrange(0, csegs)],
	"confusion": [[0 for x in xrange(0, csegs)] for y in xrange(0, csegs)]
	}
for xi in xrange(0, csegs):
	for yi in xrange(0, csegs):
		# Compute pixel coordinate from grid coordinate.
		x = xi/float(csegs-1) * (w-1)
		y = yi/float(csegs-1) * (h-1)

		# Compute the CIE L*, a*, b* coordinates (easy).
		a = 2.0*x/(w-1) - 1.0
		b = 2.0*y/(h-1) - 1.0

		# Compute the corresponding CIE 1931 X, Y, Z coordinates.
		X, Y, Z = Color.LabToXyz(L, a, b)

		# Convert CIE 1931 X, Y, Z to CIE 1931 x, y (but we'll keep capital
		# letters for the variable names). The copuntual point is in CIE 1931
		# x, y coordinates.
		X, Y = (X / (X + Y + Z), Y / (X + Y + Z))

		contourpoints["x"][yi][xi] = x
		contourpoints["y"][yi][xi] = y

		# To compute the confusion lines, we plot a contour diagram where
		# the value at each point is the point's angle relative to the copunctal
		# point. Two points on the same confusion line will have the same angle,
		# and contour plots connect points of the same value.
		dY, dX = Y - copunctal_points[bt][1], X - copunctal_points[bt][0]
		contourpoints["confusion"][yi][xi] = atan2(dY, dX) # yields confusion lines

# To compute the spectrum lines, we want lines perpendicular to the
# confusion lines. In my first attempt at this, I computed perpendiculars
# in the CIE 1931 space by choosing the contour plot value at a point to
# be the *distance* from the point to the copunctal point. This plotted
# the concentric circles around the copunctal point, transformed to
# CIE LAB space.
#
# However this is wrong, because the perpendiculars should be computed
# in CIE LAB space, which is the perceptual space. To compute the
# perpendiculars, we compute the gradient of the matrix that underlies
# the confusion lines. Then the gradient is plotted with the quiver plot type.
contourpoints["spectrum"] = numpy.gradient(numpy.array(contourpoints["confusion"], dtype=numpy.float))
for xi in xrange(0, csegs): # normalize!
	for yi in xrange(0, csegs):
		d = sqrt(contourpoints["spectrum"][0][yi][xi]**2 + contourpoints["spectrum"][1][yi][xi]**2)
		contourpoints["spectrum"][0][yi][xi] /= d
		contourpoints["spectrum"][1][yi][xi] /= d

# Draw it.
plt.figure()
plt.axes(frame_on=False)
plt.xticks([])
plt.yticks([])
plt.imshow(colorspace, extent=(0, w, 0, h))
plt.quiver(contourpoints["x"], contourpoints["y"], contourpoints["spectrum"][1], contourpoints["spectrum"][0], color="white", alpha=.5)
plt.contour(contourpoints["x"], contourpoints["y"], contourpoints["confusion"], w/15, colors="black", linestyles="dotted", alpha=.25)
plt.text(0, 0, "~".join(sys.argv[2:]) + "; L=" + sys.argv[1], color="white")
plt.savefig("colorspace_" + "_".join(sys.argv[1:]) + ".png", bbox_inches="tight", pad_inches=0)</pre>
]]></content:encoded>
			<wfw:commentRss>http://razor.occams.info/blog/2011/01/08/designing-accessible-color-spectrums/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Screen resolutions of today&#8217;s web users</title>
		<link>http://razor.occams.info/blog/2011/01/01/screen-resolutions/</link>
		<comments>http://razor.occams.info/blog/2011/01/01/screen-resolutions/#comments</comments>
		<pubDate>Sat, 01 Jan 2011 18:46:14 +0000</pubDate>
		<dc:creator>Joshua Tauberer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://razor.occams.info/blog/?p=469</guid>
		<description><![CDATA[I was curious today what screen resolutions people are using these days. Google Analytics reports the screen resolutions of your visitors but doesn&#8217;t give it to you in a way that is useful. It lists each unique screen resolution e.g. 1152&#215;864 and how many visitors came with that resolution. But what you want to know [...]]]></description>
			<content:encoded><![CDATA[<p>I was curious today what screen resolutions people are using these days. Google Analytics reports the screen resolutions of your visitors but doesn&#8217;t give it to you in a way that is useful. It lists each unique screen resolution e.g. 1152&#215;864 and how many visitors came with that resolution. But what you want to know is, how many people have a horizontal resolution of <em>1152 or more</em>? That calls for a cumulative histogram.</p>
<p>Here are histograms for horizontal and vertical resolutions based on visitors to my site <a href="http://www.govtrack.us">GovTrack.us</a> over the last month. The horizontal resolutions show that around 95% of visitors support at least 1024 pixels, but it drops off to only around 70% of visitors supporting a greater horizontal resolution. The 70% hangs out till about 1280 pixels (meaning, should we be designing for 1280 pixels now and make things harder for just the remaining 30%?). Then it drops again to a mere 35% for anything greater than 1280. And as for the standard wide-screen resolution of 1680, it&#8217;s just around 15%.</p>
<p><a href="http://razor.occams.info/blog/wp-content/uploads/2011/01/screen_resolution_horz.png"><img class="alignnone size-medium wp-image-472" title="screen_resolution_horz" src="http://razor.occams.info/blog/wp-content/uploads/2011/01/screen_resolution_horz-300x300.png" alt="" width="300" height="300" /></a></p>
<p>For reference, the iPad&#8217;s resolution (in its most popular orientation) is 768&#215;1024.</p>
<p>With 1024 pixels horizontally still the resolution most widely supported, it&#8217;s not surprising that 780 pixels vertically is the point of a big drop off too, from around 95% down to less than 50% supporting anything greater. While 70% of visitors support 1280 pixels horizontally, only around 30% support its 4:3-corresponding vertical resolution of 1024 (probably as more people are using widescreens).</p>
<p><a href="http://razor.occams.info/blog/wp-content/uploads/2011/01/screen_resolution_vert.png"><img class="alignnone size-medium wp-image-473" title="screen_resolution_vert" src="http://razor.occams.info/blog/wp-content/uploads/2011/01/screen_resolution_vert-300x300.png" alt="" width="300" height="300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://razor.occams.info/blog/2011/01/01/screen-resolutions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Part II: We all know money is a corrupting force, right?</title>
		<link>http://razor.occams.info/blog/2010/12/10/part-ii-we-all-know-money-is-a-corrupting-force-right/</link>
		<comments>http://razor.occams.info/blog/2010/12/10/part-ii-we-all-know-money-is-a-corrupting-force-right/#comments</comments>
		<pubDate>Sat, 11 Dec 2010 03:07:36 +0000</pubDate>
		<dc:creator>Joshua Tauberer</dc:creator>
				<category><![CDATA[Civic Hacking]]></category>

		<guid isPermaLink="false">http://razor.occams.info/blog/?p=467</guid>
		<description><![CDATA[(My last post began a long discussion on the OHP list. Here&#8217;s some of my follow-up.) I don&#8217;t believe any of my transparency colleagues believe that there is a pervasive systematic problem with Hill staff &#038; Members making literally corrupt decisions on a regular basis. However, I&#8217;m sure everyone here recognizes systemic selection biases (who [...]]]></description>
			<content:encoded><![CDATA[<p>(My last post began a long discussion on the OHP list. Here&#8217;s some of my follow-up.)</p>
<p>I don&#8217;t believe any of my transparency colleagues believe that there is a pervasive systematic problem with Hill staff &#038; Members making literally corrupt decisions on a regular basis. However, I&#8217;m sure everyone here recognizes systemic selection biases (who can afford to get elected) and incentives (the revolving door) that are worthy of study.</p>
<p>The net effect of these biases and incentives is not clear, but there is certainly an effect.  We know there have been a few bad apples and it is the public&#8217;s duty to be on the lookout for more. And we know that the biases and incentives affect policy results i.e. through who is elected, how committees are assigned, what lobbyists/advocates have access to Congress&#8217;s ears, and maybe in some more pernicious ways.</p>
<p>Now whether the net effect is in some sense good, neutral, or bad is something we&#8217;re disagreeing on. Tom is basically defending neutral, while most else would say bad.</p>
<p>Compared to what, and how would you know?</p>
<p>The problem with this discussion is that we can&#8217;t make up a hypothetical less-money-obsessed world world that we would all agree on. Take away money and some other aspect of the human condition is going to take its place. And even if we could imagine a world, how would you measure if that world was better off?</p>
<p>I&#8217;ll try to tie this back into the point I initially made:</p>
<p>Discovering bad applies through investigative, data-driven reporting is great for the country. It is actionable information. But while reporting on mere &#8220;correlation&#8221; establishes a *possible* bias or incentive, it neither indicates an actual effect on policy nor suggests any action that we could take that we could be reasonably sure would in fact improve policymaking.</p>
<p>Of course, correlations can be the beginning of an investigative project. Paul Blumenthal&#8217;s recent post &#8220;<a href="http://blog.sunlightfoundation.com/2010/12/09/incoming-finance-committee-chairman-relies-on-finance-campaign-contributions/">Incoming finance committee chairman relies on finance campaign contributions</a>&#8221; raises a lot of concern over correlations. But its relevance is backed up by other observations and makes a good case that, at the very least, the media should be keeping a close eye on a Member of Congress who is being tempted by some very strong incentives. Hopefully he&#8217;ll resist the temptations. </p>
]]></content:encoded>
			<wfw:commentRss>http://razor.occams.info/blog/2010/12/10/part-ii-we-all-know-money-is-a-corrupting-force-right/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>We all know money is a corrupting force, right?</title>
		<link>http://razor.occams.info/blog/2010/12/08/money/</link>
		<comments>http://razor.occams.info/blog/2010/12/08/money/#comments</comments>
		<pubDate>Wed, 08 Dec 2010 04:57:56 +0000</pubDate>
		<dc:creator>Joshua Tauberer</dc:creator>
				<category><![CDATA[Civic Hacking]]></category>

		<guid isPermaLink="false">http://razor.occams.info/blog/?p=463</guid>
		<description><![CDATA[In some circles it&#8217;s taken for granted that money corrupts. But how much for granted should we be taking it? For instance, last month Lisa Rosenberg wrote for Sunlight that without additional election spending disclosure we are headed toward the &#8220;corruption of our democracy by secret campaign spending.&#8221; And MAPLight.org describes its mission as being [...]]]></description>
			<content:encoded><![CDATA[<p>In some circles it&#8217;s taken for granted that money corrupts. But how much for granted should we be taking it?</p>
<p>For instance, last month Lisa Rosenberg <a href="http://blog.sunlightfoundation.com/2010/11/18/sunlight-urges-congres-to-pass-streamlined-disclose-act-during-lame-duck/">wrote</a> for Sunlight that without additional election spending disclosure we are headed toward the &#8220;corruption of our democracy by secret campaign spending.&#8221; And MAPLight.org <a href="http://maplight.org/about">describes its mission</a> as being a watchdog for when &#8220;[e]lected officials collect large sums of money to run their campaigns, and they often pay back campaign contributors with special access and favorable laws.&#8221;</p>
<p>I certainly don&#8217;t doubt that money can corrupt, especially systemically. My favorite open secret is that Members of Congress are <a href="http://www.jstor.org/pss/3219894">assigned to committee</a> in part by how well they have fund-raised for the party (which to me sounds like a simple bribe).</p>
<p>But where I get worried is when an organization&#8217;s reporting arm gets caught up in reporting only on one side, making the body of evidence appear to support that corruption is wide-spread when in fact it is the exception rather than the rule, let alone a systemic problem.</p>
<p>What prompted me to write this was actually a blog post over at the Center for Responsive Politics that exemplifies exactly the type of reporting that is often missing. Megan Wilson <a href="http://www.opensecrets.org/news/2010/12/gm-cut-big-checks-to-lawmakers.html">writes on OpenSecrets</a> today that &#8220;General Motors&#8217; Political Committee Cut Big Checks to Lawmakers Who Voted Against Company&#8217;s Bailout.&#8221; Wison calls it &#8220;ironic,&#8221; that GM&#8217;s PAC seemed to be promoting candidates against its own interests. Well, not exclusively but at least two-to-one (&#8220;$63,500 to [congressmen] who voted against federal assistance for the company. That&#8217;s more than one-third of the overall amount GM gave to all House candidates this election cycle.&#8221;).</p>
<p>Ironic is one way to look at it. But more interesting to me is that of all times you might think we would see some easily understood evidence of a corrupting influence of money, lo and behold we see clearly that that&#8217;s not the case.</p>
<p>There is hope for our system after all.</p>
<p>I&#8217;m going to take a little shot at a post Wilson wrote in September, &#8220;<a href="http://www.opensecrets.org/news/2010/09/media-professionals-and-journalists-donate.html">Journalists, Media Professionals Donating Frequently to Federal Political Candidates this Election Cycle</a>&#8220;. She wrote, &#8220;235 people &#8230; identified themselves on government documents as journalists, or as working for news organizations, who together have donated more than $469,900 to federal political candidates, committees and parties during the 2010 election cycle &#8230; with the median amount donated coming in at $500.&#8221;</p>
<p>As she noted, many of the donations came from those employed by &#8220;lighter fare&#8221; such as ESPN, or were employed in a non-reporting (i.e. business) role. She provided a spreadsheet of the numbers she used. When I looked over it, to me it appeared as if around half of the contributions were from individuals whose job description clearly indicated there was no conflict of interest: science writers, radio talk show hosts, etc.</p>
<p>If you&#8217;ll give me the benefit of the doubt here, or even if you don&#8217;t, we&#8217;re talking about about 100-200 people nation-wide who were journalists who <i>might</i> have made a conflict-of-interest mistake. That sounds pretty good to me! Where&#8217;s the reporting on the other 90,000 journalists that abstained from contributing to a candidate? Is there any substantial impact on reporting or on policymaking that resulted from any of these so-thought bad contributions? I doubt it. (If any of the contributions were in any sense nefarious, they are from people who do more political damage by what they report, rather than by who they give money to.)</p>
<p>So, those are my thoughts tonight.</p>
]]></content:encoded>
			<wfw:commentRss>http://razor.occams.info/blog/2010/12/08/money/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android+Ubuntu Tethering Redux</title>
		<link>http://razor.occams.info/blog/2010/09/28/androidubuntu-tethering-redux/</link>
		<comments>http://razor.occams.info/blog/2010/09/28/androidubuntu-tethering-redux/#comments</comments>
		<pubDate>Wed, 29 Sep 2010 00:51:54 +0000</pubDate>
		<dc:creator>Joshua Tauberer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://razor.occams.info/blog/?p=453</guid>
		<description><![CDATA[I finally figured out the &#8220;easy&#8221; way to tether an Ubuntu laptop to an Android phone over USB without rooting the phone, provided you have remote SSH access to an Ubuntu machine somewhere else connected to the web. The general idea is to use the phone to create a forwarded port from a laptop to [...]]]></description>
			<content:encoded><![CDATA[<p>I finally figured out the &#8220;easy&#8221; way to tether an Ubuntu laptop to an Android phone over USB without rooting the phone, provided you have remote SSH access to an Ubuntu machine somewhere else connected to the web.</p>
<p>The general idea is to use the phone to create a forwarded port from a laptop to some other machine with access to the web, and then to run a VPN connection over that port.</p>
<p>You will need:</p>
<ul>
<li>A phone running Android 2 or later (or maybe earlier).</li>
<li>ConnectBot installed on the phone</li>
<li>A &#8220;host&#8221; machine running Linux, with SSH and OpenVPN installed and on which you have root access, and which has a public IP address.</li>
<li>Your Linux laptop that you want to tether, where you&#8217;ll need OpenVPN and root access again. And the <a href="http://developer.android.com/sdk/download.html?v=android-sdk_r04-linux_86.tgz">Android SDK development tools</a> (in particular, adb).</li>
</ul>
<p>Setup on the host machine (i.e. the VPN server):</p>
<ul>
<li>Install OpenVPN. Start the server with the following command: <code>sudo /usr/sbin/openvpn --proto tcp-server --local localhost --dev tun --ifconfig 192.168.2.1 192.168.2.2</code></li>
<li>This will set up the server to run and listen for incoming VPN connections from the localhost only, using 192.168.2.1 for itself on the VPN and expecting your laptop to be configured for 192.168.2.2 (in the last step).</li>
<li>The VPN itself is set up unencrypted since the VPN connection will be running over an encrypted line (see below).</li>
<li>Obviously you&#8217;ll want to do this before you leave your home, though you also have an opportunity to start it where I&#8217;ve noted it below.</li>
</ul>
<p>On the phone:</p>
<ul>
<li>In Settings -&gt; Applications -&gt; Development turn on USB Debugging, which allows us to forward TCP connections through the USB cable.</li>
<li>Connect the phone to the laptop using the USB cable.</li>
<li>In ConnectBot, set up a new connection to the host machine with a SOCKS (aka dynamic) port forward on port 1080.</li>
<li>Start the connection and log in to the host machine.</li>
<li>If you haven&#8217;t already, start OpenVPN on the host machine at the command prompt.</li>
</ul>
<p>On the laptop:</p>
<ul>
<li>Start a port forward from the laptop to the phone using: <code>sudo adb forward tcp:1080 tcp:1080</code></li>
<li>Set up DNS options in an alternate /etc/resolv.conf.tether file. For instance, put &#8220;nameserver IPADDR&#8221; into the file where IPADDR is the IP address of a public nameserver (e.g. copy it from /etc/resolv.conf on the host machine).</li>
<li>Start the VPN:<br />
<code>sudo openvpn --proto tcp-client --dev tun --socks-proxy localhost --remote localhost --ifconfig 192.168.2.2 192.168.2.1 --route 0.0.0.0 0.0.0.0 --script-security 2 system --route-up "/bin/cp /etc/resolv.conf.tether /etc/resolv.conf"</code></li>
<li>The VPN connection first connects to the standard SOCKS port of 1080 on localhost, which adb is forwarding to the actual SOCKS proxy server on the phone. Through the proxy OpenVPN is connecting to &#8220;localhost&#8221; which is passed through the proxy to the host machine where it resolves to the host machine itself.</li>
<li>The route parameter sets up a default route to forward traffic on the laptop over the VPN. And the final option sets up DNS from your preconfigured options.</li>
</ul>
<p>I haven&#8217;t tested this really. Just some notes for later.</p>
]]></content:encoded>
			<wfw:commentRss>http://razor.occams.info/blog/2010/09/28/androidubuntu-tethering-redux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The way to fight money in politics is to empower citizens to support candidates who don&#8217;t have so much money, not to limit spending</title>
		<link>http://razor.occams.info/blog/2010/07/28/citizens-united/</link>
		<comments>http://razor.occams.info/blog/2010/07/28/citizens-united/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 14:22:18 +0000</pubDate>
		<dc:creator>Joshua Tauberer</dc:creator>
				<category><![CDATA[Civic Hacking]]></category>

		<guid isPermaLink="false">http://razor.occams.info/blog/?p=451</guid>
		<description><![CDATA[I actually took a sigh of relief yesterday when the DISCLOSE Act failed to be passed in the Senate. This was one of many proposals to partially reverse the Supreme Court decision earlier this year in Citizens United v. FEC which opened the floodgates for direct corporate spending on electioneering. And, apparently corporations are already [...]]]></description>
			<content:encoded><![CDATA[<p>I actually took a sigh of relief yesterday when the <a href="http://www.govtrack.us/congress/bill.xpd?bill=h111-5175">DISCLOSE Act</a> <a href="http://www.govtrack.us/congress/bill.xpd?bill=s111-3628">failed to be passed in the Senate</a>. This was one of <a href="http://blog.sunlightfoundation.com/2010/01/27/legislation-intended-to-respond-to-citizens-united/">many proposals</a> to partially reverse the Supreme Court decision earlier this year in <a href="http://blog.sunlightfoundation.com/2010/01/21/how-the-citizens-united-case-affects-money-politics-and-transparency-as-we-know-it/">Citizens United v. FEC</a> which opened the floodgates for direct corporate spending on electioneering. And, apparently <a href="http://www.opensecrets.org/news/2010/07/republicans-thwart-new-campaign-fin.html">corporations are already taking advantage</a> of the decision. The bill would require corporate spending on ads to come along with disclosure of who funded the ad.</p>
<p>I&#8217;m wary of limitations on political speech, especially when the limitations are uneven. As the <a href="http://www.aclu.org/free-speech/disclose-act-passed-house-today-compromises-free-speech">ACLU wrote</a>:</p>
<blockquote><p>The [bill] includes an amendment obligating many advocacy organizations that wish to speak out on candidates and, in certain situations, political issues, to release the identities of many of their donors, while allowing a few large mainstream organizations to preserve the privacy of their donors. The amendment exempts organizations that have over 500,000 members, are over ten years old, have a presence in all 50 states and whose revenue from corporations and unions is less than 15 percent. By exempting larger mainstream organizations from certain disclosure requirements, the bill inequitably suppresses only the speech of smaller, more controversial organizations and compromises the anonymity of small donors.</p></blockquote>
<p>The discussion of the <em>Citizens United</em> decision and the DISCLOSE Act in the blogosphere has taken it for granted that money is bad for politics. Or, perhaps we should say monetary <em>inequality</em> is bad for politics. (And if that&#8217;s the problem, exactly what does DISCLOSE do to rectify that? I guess it makes big spenders think twice about spending money on politics because they will have to put their name behind it. But what if they are proud to put their name behind a candidate? What if it even becomes good publicity to put your name behind a candidate?) In any case, monetary inequality is only part of the picture. What&#8217;s missing from the discussion is looking at <em>how</em> the money buys influence.</p>
<p>Interlude.</p>
<p>Back in the 1970s, when IBM dominated the world of computers with their high-cost mainframes, entrepreneurs &#8212; later to start Apple &#8212; uprooted the link between money and access to computational power by reinventing the computer in creating the <em>personal computer</em> (democratizing computational power!). In the 1990s, the big institutional newspapers and the newly dominating cable news channels ruled the media scene, but in the early 2000s bloggers started to uproot the power of the &#8220;MSM&#8221; by decentralizing public discussion of news (and in some impressive cases even taking on the role of investigative journalists). In the late 2000s with the emergence of the <a href="http://www.opengovdata.org">Open Government Data</a> movement world-wide, we&#8217;re seeing an attempt to empower citizens by providing them with access to government information that only interests with well-paid lobbyists could access before.</p>
<p>End interlude.</p>
<p><em>We&#8217;re not powerless when it comes to the link between money and influence.</em> This leads us to an alternative approach to decoupling monetary inequality with political inequality. Rather than essentially reducing monetary inequality by force of law (by discouraging corporate spending), we should be looking at uprooting the link between money and influence.</p>
<p>Money buys influence through advertising, because the only way citizens learn about candidates is through advertising. What if we could undermine that pathway? What if there were other ways for citizens to learn about candidates where there was no pay-to-play? Entrepreneurs and civic hackers have done this type of thing before. Perhaps it&#8217;s time to focus our skills on this problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://razor.occams.info/blog/2010/07/28/citizens-united/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Transparent Tethering for Android &amp; Linux</title>
		<link>http://razor.occams.info/blog/2010/06/11/transparent-tethering-for-linux/</link>
		<comments>http://razor.occams.info/blog/2010/06/11/transparent-tethering-for-linux/#comments</comments>
		<pubDate>Fri, 11 Jun 2010 14:58:03 +0000</pubDate>
		<dc:creator>Joshua Tauberer</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://razor.occams.info/blog/?p=447</guid>
		<description><![CDATA[Update 10/4/2010: New post that does this in a much simpler way using OpenVPN. I&#8217;m a new Android user on my HTC Incredible, and while I&#8217;ve read that the next version of Android is going to support tethering, it might take a while for this to be supported on existing HTC devices and I&#8217;m not [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update 10/4/2010: <a href="http://razor.occams.info/blog/2010/09/28/androidubuntu-tethering-redux/">New post</a> that does this in a much simpler way using OpenVPN.</strong></p>
<p>I&#8217;m a new Android user on my HTC Incredible, and while I&#8217;ve read that the next version of Android is going to support tethering, it might take a while for this to be supported on existing HTC devices and I&#8217;m not sure I believe Verizon will let HTC ship it. So the hacker that I am, I found a relatively elegant way to tether. The only catch is that you need <em>some other</em> Linux machine with a public facing address on the Internet to serve as your &#8220;router&#8221;.</p>
<p>The only other good technique I found that works on Linux is to use an app that provides port forwarding or a SOCKS server. This isn&#8217;t really tethering as I understand it. SOCKS gets you only so far: it won&#8217;t do DNS, for instance, and it only works in applications that support SOCKS. The solution here provides what looks like a full Internet connection to the tethered device.</p>
<p>The gist is:</p>
<ul>
<li>The laptop you want to tether uses the socat tool to create basically a virtual ethernet device (&#8220;tun0&#8243;) that forwards packets over a TCP connection, rather than a physical cable. The tun0 device is set up as the default gateway for the computer so that its Internet connection goes through the virtual device.</li>
<li>This TCP connection goes first to localhost, but an Andr0id SDK tool forwards the TCP connection over the USB cable to your phone.</li>
<li>The Connect Bot app on your phone makes an SSH connection to the host computer and sets up port forwarding from the phone to the host. I&#8217;m not particularly concerned about encrypting the traffic, but the advantage of using a port-forward over SSH (versus using e.g. the <a href="http://www.jads.co.uk/software/android-apps/internet-sharer">Internet Sharer app by JADS</a> to forward directly) is that on the host side we can make sure that we only provide Internet sharing for ourselves and not the whole world.</li>
<li>The host computer is listening for the connection from localhost only and forwards packets from the connection back into a second virtual ethernet device (&#8220;tun0&#8243; on the hots). Internet sharing (NAT) is enabled for the tun0 device so that the packets get routed to the Internet.</li>
</ul>
<p><strong>You will need&#8230;</strong></p>
<ul>
<li>An Android phone. I&#8217;m testing on Android 2.1. No root access is required here.</li>
<li>A Linux computer to tether. I&#8217;m testing on Ubuntu 9.04. Root access required.</li>
<li>A Linux computer that has a permanent connection to the Internet with a public IP address on which you have root access. This is the host computer. I&#8217;m testing this one with Ubuntu 10.04.</li>
</ul>
<p><strong>Before you begin&#8230;</strong></p>
<p>On the phone, install the free Connect Bot app from the marketplace. Enable USB debugging on the phone in Settings -&gt; Applications -&gt; Development -&gt; USB debugging, which allows us to forward connections over the USB cable.</p>
<p>On the computer to tether, while you still have an Internet connection, download  the <a href="http://developer.android.com/sdk/download.html?v=android-sdk_r04-linux_86.tgz" target="_blank">Android SDK for Linux</a>. Extract it and find the adb tool. On both the computer to tether and the host computer, make sure you have socat installed. (In Ubuntu, <span style="text-decoration: underline;">apt-get install socat</span>.)</p>
<div><strong>On the phone:</strong></div>
<div><strong><br />
</strong></div>
<div>Start the Connect Bot app. Create &amp; start a new SSH connection to your host computer. Add a port forward (hit Menu) with the options: Type=Local; Source port=9000; Destination=localhost:9000.</div>
<div>
<div id="_mcePaste"><strong>On the forwarding host computer:</strong></div>
<div>You can do this either locally before you leave, or through the SSH connection you just made. Everything here must be run as root:</div>
<div>Forward connections from local port 9000 to a new virtual tunnel device tun0 and assign the computer the IP address 192.168.0.1 on this network:</div>
<div id="_mcePaste">
<div><span style="text-decoration: underline;"><span style="-webkit-text-decorations-in-effect: none;"><span style="text-decoration: underline;"></p>
<div style="display: inline !important;">sudo socat TUN:192.168.0.1/24,up</div>
<p><span style="-webkit-text-decorations-in-effect: none;"></span></p>
<div style="display: inline !important;"><span style="-webkit-text-decorations-in-effect: none;"><span style="text-decoration: underline;"></p>
<div style="display: inline !important;">TCP-LISTEN:9000,bind=127.0.0.1</div>
<p></span></span></div>
<div><span style="-webkit-text-decorations-in-effect: none;"><span style="text-decoration: underline;"><span style="-webkit-text-decorations-in-effect: none;">(TUN goes first so that the device is set up before socat blocks while listening for connections)</span></p>
<p></span></span></div>
<p></span></span></span></div>
</div>
<div>Set up the NAT internet connection sharing. If you use Firestarter, a nice firewall configuration tool, you can enable this easily in Edit -&gt; Preferences, choose the local network device as tun0, and turn on enable internet connection sharing. This probably won&#8217;t stick across a reboot since the tun0 device won&#8217;t be available when Firestarter starts next time.</div>
<div>To set up NAT from a command line, see <a href="http://www.revsys.com/writings/quicktips/nat.html">these instructions</a>, but substitute tun0 for eth1:</div>
<div>
<div><span style="text-decoration: underline;">echo 1 &gt; /proc/sys/net/ipv4/ip_forward</span></div>
<div><span style="text-decoration: underline;">/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE</span></div>
<div><span style="text-decoration: underline;">/sbin/iptables -A FORWARD -i eth0 -o tun0 -m state &#8211;state RELATED,ESTABLISHED -j ACCEPT</span></div>
<div><span style="text-decoration: underline;">/sbin/iptables -A FORWARD -i tun0 -o eth0 -j ACCEPT</span></div>
</div>
<div><strong>On the tethering computer:</strong></div>
</div>
<div>It would be a good idea to turn off wireless networking and unplug any ethernet cables at this point. Then connect the computer to the phone with the USB cable.</div>
<div>Start the connection forwarding from the directory containing the adb tool from the Android SDK:</div>
<div><span style="text-decoration: underline;">sudo ./adb forward tcp:9000 tcp:9000</span></div>
<div id="_mcePaste"><span style="text-decoration: underline;">sudo socat TUN:192.168.0.2/24,up TCP:localhost:9000</span></div>
<div>Put socat into the background with CTRL+Z and bg, or start a new terminal. Add routing information for the rest of the network:</div>
<div>
<div><span style="text-decoration: underline;">sudo route add default tun0</span></div>
</div>
<div><span style="text-decoration: underline;"><br />
</span></div>
<div>Check that the connections are working:</div>
<div><span style="text-decoration: underline;">ping 192.168.0.2</span> &lt;&#8212; pinging itself, should be fast</div>
<div><span style="text-decoration: underline;">ping 192.168.0.1</span> &lt;&#8212; pinging host computer, should be slow</div>
<div><span style="text-decoration: underline;"><br />
</span></div>
<div>Add to /etc/resolv.conf the IP address of the DNS nameserver used by the forwarding host computer, i.e.:</div>
<div id="_mcePaste">nameserver 192.168.1.1</div>
<div id="_mcePaste">Or check out what you need by running:</div>
<div id="_mcePaste"><span style="text-decoration: underline;">ssh 192.168.0.1 -C &#8220;cat /etc/resolv.conf&#8221; | grep nameserver</span></div>
<p>And you should be good to go.</p>
]]></content:encoded>
			<wfw:commentRss>http://razor.occams.info/blog/2010/06/11/transparent-tethering-for-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Printable Congressional District Maps: Behind The Scenes</title>
		<link>http://razor.occams.info/blog/2010/02/26/printable-congressional-district-maps-behind-the-scenes/</link>
		<comments>http://razor.occams.info/blog/2010/02/26/printable-congressional-district-maps-behind-the-scenes/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 13:55:25 +0000</pubDate>
		<dc:creator>Joshua Tauberer</dc:creator>
				<category><![CDATA[Civic Hacking]]></category>
		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://razor.occams.info/blog/?p=441</guid>
		<description><![CDATA[Today I&#8217;m releasing print-quality maps of congressional districts, with street-level detail and county border lines. This has been one of the most sought-after resources based on emails I&#8217;ve received over the last some four years and I don&#8217;t think you can find this anywhere else. (At least not comprehensively for the whole nation. Local state [...]]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;m releasing <a href="http://www.govtrack.us/congress/printablemaps.xpd">print-quality maps of congressional districts</a>, with street-level detail and county border lines. This has been one of the most sought-after resources based on emails I&#8217;ve received over the last some four years and I don&#8217;t think you can find this anywhere else. (At least not comprehensively for the whole nation. Local state clerk&#8217;s offices may have them. NationalAtlas.gov <a href="http://www.google.com/url?sa=t&amp;source=web&amp;ct=res&amp;cd=1&amp;ved=0CAYQFjAA&amp;url=http%3A%2F%2Fwww.nationalatlas.gov%2Fprintable%2Fcongress.html&amp;rct=j&amp;q=print+congressional+district+map&amp;ei=YNiGS6CvJITO8QbnibGYDw&amp;usg=AFQjCNFKBdAaXwTWi3ddjLyCR91YSOttAg&amp;sig2=LiYGqUl9jL_0-BaB6FMhZA">has maps</a> but not with very much detail.)</p>
<p>This was a solid 2-day project with less than 300 lines of code and it&#8217;s something that only recently became this easy to do. I used Amazon Web Services (AWS), Census TIGER/Line cartographic data in an <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=2367">AWS pubic data snapshot</a>, <a href="http://www.openstreetmap.org/">OpenStreetMap</a> for the street detail in an <a href="http://mapbox.com/data/osm-planet">AWS snapshot prepared by MapBox.com</a>, <a href="http://www.mapnik.org">Mapnik</a> to render the maps (pre-installed on an <a href="http://mapbox.com/tools">AWS machine image prepared by MapBox</a>), and the Python modules osgeo (for OGR) and PIL.</p>
<p>Here&#8217;s what  I did. This took a lot of trial and error, but in the end the steps were relatively simple.</p>
<p>Setting up the EC2 instance and the OpenStreetMap (OSM) planet data:</p>
<ul>
<li>Start up a new Amazon EC2 Linux instance using the AWS machine image (AMI) prepared by MapBox linked above.</li>
<li>Create Amazon Elastic Block Storage (EBS) volumes for the two data sets (OpenStreetMap and Census TIGER/Line) in the same availability zone as the EC2 instance. If you do it in the AWS console, you&#8217;ll just need to search for the snapshots by ID or name (see the links above).</li>
<li>Attach the two volumes to the running EC2 instance as /dev/sdf (OSM) and /dev/sdg (TIGER).</li>
<li>Log into the EC2 instance with SSH.</li>
<li>Mount the two volumes: mkdir /mnt/osm; mount -t ext3 /dev/sdf /mnt/osm; mkdir /mnt/tiger; mount -t ext3 /dev/sdg /mnt/tiger</li>
<li>Following the MapBox <a href="http://mapbox.com/osm-planet/using-osm-planet-ebs">instructions</a>, attach the OSM data to Postgres, change the Postgres configuration to remove password protection, and restart Postgres.</li>
</ul>
<p>To set up Mapnik, I followed the OpenStreetMap <a href="http://wiki.openstreetmap.org/wiki/Mapnik">wiki</a> which shows how to reuse their map styling. Most of the steps can be skipped because the data has already been set up in Postgres by MapBox. That involved:</p>
<ul>
<li>Getting the OSM Mapnik files from their SVN repository.</li>
<li>Downloading some extraneous boundary information.</li>
<li>Create a new style definition that controls how map features are rendered based on the OSM defaults.</li>
<li>Editing the defaults a) so it actually works, and b) so it looks good at high DPI for printing (increasing font sizes, removing some icons). This took a lot of trial and error since I didn&#8217;t understand what was going on and regenerating a map takes some time.</li>
</ul>
<p>The last step was to write a Python script that invokes Mapnik for each congressional district and generates a high-resolution map image.</p>
<ul>
<li>The Census&#8217;s TIGER/Line cartographic data has a Shapefile-format file for each state containing the congressional districts in the state. The osgeo/OGR Python module can load the file and tell you the latitude/longitude bounds of the congressional district (among other things).</li>
<li>Then the Mapnik Python bindings are used to create a new map with the given size, loading in the OSM street data.</li>
<li>Additional layers are added from the TIGER/Line data for place names (CDPs and county subdivisions if you&#8217;re familiar with Census data), county names and borders, state borders (and shading of other states), and the boundaries of the congressional district itself and shading of other congressional districts.</li>
<li>After rendering the map, which takes ~30 seconds, I used the Python Imaging Library module to add header and footer text with a nice translucent effect.</li>
</ul>
<p>Generating the maps at three resolutions for all of the congressional districts (except districts at-large) took several hours. I let it run overnight. They&#8217;re stored on Amazon S3 (the s3cmd tool is really useful for that).</p>
<p>There&#8217;s still room for a lot of improvement. After playing with the style instructions I got too much local road detail that in some places just ruins the whole map at low resolution. And in many places the county names aren&#8217;t showing up. Maybe because there&#8217;s too much detail. It&#8217;ll take some more trial and error to fix.</p>
<p>The source code (which includes all of the preparation steps in detail) is posted <a href="http://razor.occams.info/code/repo/?/viz/districtmaps/printablemaps.py">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://razor.occams.info/blog/2010/02/26/printable-congressional-district-maps-behind-the-scenes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Who&#8217;s been visiting our Assistant Deputy CTO for Open Government?</title>
		<link>http://razor.occams.info/blog/2010/02/02/whos-been-visiting-our-assistant-deputy-cto-for-open-government/</link>
		<comments>http://razor.occams.info/blog/2010/02/02/whos-been-visiting-our-assistant-deputy-cto-for-open-government/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 23:35:12 +0000</pubDate>
		<dc:creator>Joshua Tauberer</dc:creator>
				<category><![CDATA[Civic Hacking]]></category>

		<guid isPermaLink="false">http://razor.occams.info/blog/?p=436</guid>
		<description><![CDATA[The White House began publishing its visitor logs &#8212; with sensitive information removed. Honestly, I don&#8217;t really get what the big hubub is over this information. First, are corrupting influences on the administration really going to stop corrupting because of this? And, a corollary, who exactly is in a position to be reading over the [...]]]></description>
			<content:encoded><![CDATA[<p>The White House began publishing its visitor logs &#8212; with sensitive information removed.</p>
<p>Honestly, I don&#8217;t really get what the big hubub is over <a href="http://www.whitehouse.gov/briefing-room/disclosures/visitor-records">this information</a>. First, are corrupting influences on the administration really going to stop corrupting because of this? And, a corollary, who exactly is in a position to be reading over the records to make sure nothing bad is going on? Who are these visitors anyway?</p>
<p>But I always enjoy playing with data all the same. To do it with a little levity, I thought I would profile Robynn Sturm&#8217;s visitors. I met Robynn recently and certainly got the feeling that of all people to hold the title of Assistant Deputy Chief Technology Officer for Open Government for the United States of America, she seemed like a good person to hold the job.</p>
<p>Anyway, in September-October 2009, she had 35 visits. I only have the names and can&#8217;t be sure of who they are, but I&#8217;ll do my best to give Google search results that might be reasonable. Text comes from the pages I&#8217;ve linked to.</p>
<p>Ellen Alberding and Gretchen Sims are the president and <span id="main" style="visibility: visible;"><span id="search" style="visibility: visible;">education program manager, respectively,</span></span> of the <a href="http://www.joycefdn.org/">Joyce Foundation</a>, which supports efforts to protect the natural  										environment of the Great Lakes, to reduce poverty and violence in the region,  										and to ensure that its people have access to good schools, decent jobs, and a  										diverse and thriving culture. Sims <a href="http://fundrace.huffingtonpost.com/neighbors.php?type=name&amp;lname=Sims&amp;fname=Gretchen">donated</a> to the Democrats in the last two presidential elections. (I wouldn&#8217;t have mentioned it except that that&#8217;s how I found out where she worked.)</p>
<p>Ethan Batraski (@<a href="http://twitter.com/ethanjb">ethanjb</a>): startup co-founder, mathematician, machine learning researcher, techanista, sharing thoughts on product management, startups, venture funding &amp; semantic web</p>
<p><a href="http://www.politico.com/news/stories/1109/29002.html">Marc Berejka</a> worked in senior government affairs roles at Microsoft, including eight years as a lobbyist for the high-tech giant. Says Politico: &#8220;Opponents of the Obama administration’s position on patent reform say that David Kappos and Marc Berejka, who recently took top jobs in the Commerce Department, are wielding too much influence over a policy that stands to benefit both of their former companies.&#8221;</p>
<p>Lawrence Brandt, a co-editor of <a href="http://www.springerlink.com/content/978-0-387-71610-7">Digital Government</a>, is a program manager within NSF.</p>
<p>Gerard Fiala is the staff director in the Senate HELP committee&#8217;s subcommittee on employment and workplace safety.</p>
<p><a href="http://www.seenajon.com/SeenaJon.com/Home.html">Seena Jon Ghaznavi</a> (<a href="https://twitter.com/SJgood">@sjgood</a>) is a young actor in the movie Death of a President.</p>
<p>Michael Harding &#8211; This name is too popular.</p>
<p>Greg Horowitt and Victor Hwang are co-founders and Managing Directors of <a href="http://www.t2vc.com/team.htm">T2 Venture Capital</a>,  	a venture fund focused on breakthrough technology spinning out of government  	and academia. Horowitt is also Director and Co-Founder of the <a href="http://globalconnect.ucsd.edu/about/bio-ghorowitt.cfm">Global CONNECT</a> program based at the University of California, San Diego, and is a key thought leader in the field of ‘innovation systems’, and their relevant applications for sustainable regional economic development through technology commercialization.</p>
<p>Ester Lee might be the Ester Lee that <a href="http://www.adweek.com/aw/content_display/news/e3if6074d641b5e57bfc13b87ca876a0d41">works for AT&amp;T</a>. But maybe not.</p>
<p>Joseph Mancio &#8211; another somewhat popular name.</p>
<p><a href="http://almostlegally.com/">Dominic Mauro</a> (<a href="http://twitter.com/mynameisdom">@mynameisdom</a>) is a TA for <a href="http://james.grimmelmann.net/courses/internet/">Internet Law</a> at NY Law School (which, for reference, is the school that Beth Noveck comes from; Beth is Robynn&#8217;s boss).</p>
<p>Sara Mirsky is the American Constitutional Society&#8217;s <a href="http://">NYLS chapter</a>&#8216;s co-president. (See note about about NYLS).</p>
<p>Courtney Patterson (<a href="http://twitter.com/cnpatterson">@cnpatterson</a>) is a o<span>bsessive-compulsive law student in NYC. (We probably know at which school.)<br />
</span></p>
<p>Gina Wells is another common name.</p>
<p>Phillip Wickham is President and CEO of the <a href="http://www.kauffmanfellows.org/s/267/bio2.aspx?pgid=1135">Kauffman Fellows Program</a> at the Center for Venture Education in Palo Alto, CA. The mission of the Kauffman Fellows Program is to develop the next generation of leaders in venture capital.</p>
<p>John Bell is way too common a name.</p>
<p>Pamela Frugoli works for the <a href="http://www.outreach.psu.edu/programs/etli-2009/panelists.htm">Department of Labor</a>.</p>
<p>Daniel Gomez might be a <a href="http://www.kirkland.com/sitecontent.cfm?contentID=220&amp;itemID=9599">lawyer</a>.</p>
<p>Melissa Sperry is too common a name.</p>
<p>Meredith Stewart is another popular name.</p>
<p>Haley van Dyck was a part of the Obama 08 campaign team, according to her <a href="http://www.linkedin.com/pub/marianne-manilov/4/b53/a8b">step-mom&#8217;s LinkedIn page</a>, who, btw, is proud of her.</p>
<p>Jing Vivatrat is either an <a href="http://jsv-i.com/content/view/14/29/">m&amp;a businesswoman</a> or an <a href="http://www.c-spanvideo.org/person/9265006">FCC director</a>, or both.</p>
]]></content:encoded>
			<wfw:commentRss>http://razor.occams.info/blog/2010/02/02/whos-been-visiting-our-assistant-deputy-cto-for-open-government/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

