<?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>blprnt.blg &#187; Processing</title>
	<atom:link href="http://blog.blprnt.com/topic/Processing/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.blprnt.com</link>
	<description>Jer Thorp &#124; There is an art to evolution...</description>
	<lastBuildDate>Tue, 20 Jul 2010 15:59:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Wired UK, Barabási Lab and BIG data</title>
		<link>http://blog.blprnt.com/blog/blprnt/wired-uk-barabasi-lab-and-big-data</link>
		<comments>http://blog.blprnt.com/blog/blprnt/wired-uk-barabasi-lab-and-big-data#comments</comments>
		<pubDate>Mon, 12 Jul 2010 19:37:52 +0000</pubDate>
		<dc:creator>Jer</dc:creator>
				<category><![CDATA[Information Visualization]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[barabasi]]></category>
		<category><![CDATA[big data]]></category>
		<category><![CDATA[infoviz]]></category>
		<category><![CDATA[print]]></category>
		<category><![CDATA[process]]></category>
		<category><![CDATA[wireduk]]></category>

		<guid isPermaLink="false">http://blog.blprnt.com/?p=1093</guid>
		<description><![CDATA[Over the last year, I&#8217;ve produced five data-driven pieces for Wired UK. Four of them have been for the two-page infoporn spread that can be found in every issue. I&#8217;ve looked at the UK&#8217;s National DNA Database, used mined Twitter data to find people&#8217;s travel paths, and mapped traffic in some of the world&#8217;s busiest [...]]]></description>
			<content:encoded><![CDATA[<p>Over the last year, I&#8217;ve produced five data-driven pieces for <a href="http://www.wired.co.uk">Wired UK</a>. Four of them have been for the two-page infoporn spread that can be found in every issue. I&#8217;ve looked at the <a href="http://blog.blprnt.com/blog/blprnt/wired-uk-july-09-visualizing-a-nations-dna">UK&#8217;s National DNA Database</a>, used mined Twitter data to find people&#8217;s travel paths, and mapped traffic in some of the world&#8217;s busiest sea ports. </p>
<p>In <a href="http://www.wired.co.uk/wired-magazine">the August issue</a>, out on newsstands right now, I had a chance to work with some spectacular data and extremely talented people. The piece looks at a very, very big data set &#8211; cellular phone records from a pool of 10 million users in an anonymous European country. This data came (under a very strict layer of confidentiality) from Barabási Lab in Boston, where they have been using this information to find out some <a href="http://www.barabasilab.com/pubs-humandynamics.php">fascinating things about human mobility patterns</a>. </p>
<p>In this post, I&#8217;ll walk through the process of creating this piece. Along the way, I&#8217;ll show some draft images and unused experiments that eventually evolved into the final project.</p>
<p><strong>Working With Big Data</strong></p>
<p>I can&#8217;t get into a lot of detail about the specifics of the data set, but needless to say, phone records for 10 million individuals take up a lot of space. All told, the data for this project consisted of more than 5.5GB of flattened text files. I should say, at this point, that I don&#8217;t work on a supercomputer &#8211; I churn out all of my work from an often overheated 2.33GHZ MacBook Pro. Since the deadline was reasonably tight on this project, I decided to rule out a distributed computing approach to get at all of this data, and instead chose to work with a subset of the full list of records. Working in <a href="http://www.processing.org">Processing</a>, I built a simple script that could filter out a smaller dataset from the complete files. I built several of these at varying file sizes, giving me a nice set of data to work with both in prototyping and in production stages. This is a strategy that I often employ, even with more minimal datasets &#8211; save the heavy lifting until the final render.</p>
<p>The first thing I did with the trimmed-down data was to construct &#8216;call histories&#8217; for each user in the set. I rendered out these histories as stacked bars of individual calls, which could then be placed into a histogram. Here&#8217;s a graph of about 10,000 users, sorted by their total time spent on the phone :</p>
<p><a title="Wired UK &amp;amp; Barabási Lab: Process by blprnt_van, on Flickr" href="http://www.flickr.com/photos/blprnt/4787589444/"><img src="http://farm5.static.flickr.com/4122/4787589444_b482b8ec16.jpg" alt="Wired UK &amp;amp; Barabási Lab: Process" width="500" height="313" /></a></p>
<p>Here we see a very obvious power law distribution, with a few people talking a lot (really, a lot &#8211; 28.3 hours a week), and most callers talking relatively little (these is also a tail of text-only users at the very end). The problem here, of course, is that on a computer screen &#8211; or even in print &#8211; it&#8217;s hard to get into the data to learn anything useful. When I zoom into the graph, we can start to see the individual call histories (I&#8217;ve enlarged a few columns for detail). Here, long calls are rendered yellow, short calls are rendered red, and text messages are flat blue rectangles:</p>
<p><a title="Wired UK &amp;amp; Barabási Lab: Process by blprnt_van, on Flickr" href="http://www.flickr.com/photos/blprnt/4787589478/"><img src="http://farm5.static.flickr.com/4096/4787589478_61aa14b599.jpg" alt="Wired UK &amp;amp; Barabási Lab: Process" width="500" height="180" /></a></p>
<p>I took the same graph as above, and added another set of columns extending below &#8211; here the white bars show us how many &#8216;friends&#8217; the individual callers had &#8211; ie. how many people they are regularly talking to over the week:</p>
<p><a title="Wired UK &amp;amp; Barabási Lab: Process by blprnt_van, on Flickr" href="http://www.flickr.com/photos/blprnt/4786958611/"><img src="http://farm5.static.flickr.com/4139/4786958611_9d5d074bb1.jpg" alt="Wired UK &amp;amp; Barabási Lab: Process" width="500" height="313" /></a></p>
<p>If I sort this graph by number of friends (rather than total call time), we can see that the two measures (talkativeness, and number of friends) don&#8217;t seem to be strongly correlated:</p>
<p><a title="Wired UK &amp;amp; Barabási Lab: Process by blprnt_van, on Flickr" href="http://www.flickr.com/photos/blprnt/4787590016/"><img src="http://farm5.static.flickr.com/4076/4787590016_f6aa8869a5.jpg" alt="Wired UK &amp;amp; Barabási Lab: Process" width="500" height="313" /></a></p>
<p>It&#8217;s interesting to note here as well, that the data set includes linkage information &#8211; so I can also visualize who is calling who within our group of individuals:</p>
<p><a title="Wired UK &amp;amp; Barabási Lab: Process by blprnt_van, on Flickr" href="http://www.flickr.com/photos/blprnt/4786958691/"><img src="http://farm5.static.flickr.com/4076/4786958691_d3c245980b.jpg" alt="Wired UK &amp;amp; Barabási Lab: Process" width="500" height="313" /></a></p>
<p>There is some interesting information to be dug up in here, but the long aspect of the graph and the general over-detail involved makes it not very usable &#8211; particularly for a magazine piece.</p>
<p><strong>Ooh, and then Aaah.</strong></p>
<p>The Infoporn section in Wired is a two page spread;  I always think of it as needing to serve two separate purposes for two different kinds of readers. First, it needs to be visually pleasing. I want people to say &#8216;Oooh&#8230;!&#8217; when they turn the page to it. Once they&#8217;re hooked, though, I want them to learn something &#8211; the &#8216;Aaah!&#8217; moment.</p>
<p>The data used in the graphs above seemed too complex to do anything truly revealing with &#8211; so perhaps it could be built into something sexy enough to draw an &#8216;Oooh!&#8217; or two? In order to fit the long tails of these graphs onto the page, I wondered if I could add a bit of a curl to them. To make this structural change evident, I turned the graphs on a slight angle and rendered them in 3D. Here, we see five of these graphs, totaling about a million individual users, arranged into a single, tower-like shape:</p>
<p><a title="Wired UK &amp;amp; Barabási Lab: Process by blprnt_van, on Flickr" href="http://www.flickr.com/photos/blprnt/4787001405/"><img src="http://farm5.static.flickr.com/4137/4787001405_ffc546ccfa.jpg" alt="Wired UK &amp;amp; Barabási Lab: Process" width="500" height="313" /></a></p>
<p>While these structures took a little while to render, I could quite easily generate a unique set of them, which I assembled as a line trailing off to the page edge on the left:</p>
<p><a title="Wired UK &amp;amp; Barabási Lab: Process by blprnt_van, on Flickr" href="http://www.flickr.com/photos/blprnt/4786959411/"><img src="http://farm5.static.flickr.com/4114/4786959411_e108b3d5df.jpg" alt="Wired UK &amp;amp; Barabási Lab: Process" width="500" height="283" /></a></p>
<p><strong>Getting Personal</strong></p>
<p>So far, the visuals for this project only tell a part of the story: that our individual calling habits fall into predictable patterns when placed with the larger whole (some excellent text from <a href="http://lobstermedia.com/">Michael Dumiak</a> helps clarify this in the final piece). There&#8217;s another crucial piece, though. Cel phone usage data is inherently locative, since our provider always knows from which of their cel towers we are placing the call.</p>
<p>This is where the fun starts &#8211; we can use this locative data to track the mobility patterns of individual people (it&#8217;s worth saying here that all of the data the I worked with was anonymized). To do this, I created a tool (again, in Processing) to make &#8216;mobility cubes&#8217; &#8211; which show a history of an individual&#8217;s movements over time:</p>
<p><a href="http://www.flickr.com/photos/blprnt/4787590038/" title="Wired UK &amp;amp; Barabási Lab: Process by blprnt_van, on Flickr"><img src="http://farm5.static.flickr.com/4143/4787590038_e6399346de.jpg" width="470" height="500" alt="Wired UK &amp;amp; Barabási Lab: Process"></a></p>
<p>The individual above, for example, travels around an area less than a square kilometer over a period of just under three days. If I flatten this graph, we can see that this person travels mostly between two locations:</p>
<p><a href="http://www.flickr.com/photos/blprnt/4787589416/" title="Wired UK &amp;amp; Barabási Lab: Process by blprnt_van, on Flickr"><img src="http://farm5.static.flickr.com/4116/4787589416_8169d2a72e.jpg" width="446" height="424" alt="Wired UK &amp;amp; Barabási Lab: Process"></a></p>
<p>From the data, we can identify a lot of individuals like this &#8211; commuters &#8211; who travel short distances between two places (home, and work). We can also find travelers (people who cover a long distance in a short period of time):</p>
<p><a href="http://www.flickr.com/photos/blprnt/4787077865/" title="Wired UK &amp;amp; Barabási Lab: Process by blprnt_van, on Flickr"><img src="http://farm5.static.flickr.com/4073/4787077865_4321ce49ae.jpg" width="500" height="352" alt="Wired UK &amp;amp; Barabási Lab: Process"></a></p>
<p>And others who seem to follow more elaborate (but often still regular) mobility patterns:</p>
<p><a href="http://www.flickr.com/photos/blprnt/4787589582/" title="Wired UK &amp;amp; Barabási Lab: Process by blprnt_van, on Flickr"><img src="http://farm5.static.flickr.com/4081/4787589582_05fda2b088.jpg" width="500" height="497" alt="Wired UK &amp;amp; Barabási Lab: Process"></a></p>
<p>We can assemble a &#8216;mobility cube&#8217; for each individual in the database &#8211; and very quickly gain a mechanism for recognizing patterns amongst these people:</p>
<p><a href="http://www.flickr.com/photos/blprnt/4787590370/" title="Wired UK &amp;amp; Barabási Lab: Process by blprnt_van, on Flickr"><img src="http://farm5.static.flickr.com/4076/4787590370_e721ae5268.jpg" width="500" height="281" alt="Wired UK &amp;amp; Barabási Lab: Process"></a></p>
<p>Which brings us to the underlying point of the piece &#8211; we are all leaving digital trails behind us, as we make our way around our individual lives. These trails are largely considered individual &#8211; even ethereal &#8211; yet technology is making these trails more visible and more readable everyday.</p>
<p>Of course, to see the final piece &#8211; the polished assembly of some of the drafts and artifacts you&#8217;ve seen in this post &#8211; you&#8217;ll have to buy the magazine. Wired UK is available on newsstands in the UK, and to <a href="https://www.magazineboutique.co.uk/secureonline/quicksubs_tpl.asp?m=1207&#038;src=W321">all of our clever subscribers</a>.</p>
<p>If you want to read more about this &#8211; and you should &#8211; I&#8217;d highly recommend Albert-László Barabási&#8217;s <a href="http://www.amazon.com/Bursts-Hidden-Pattern-Behind-Everything/dp/0525951601">Bursts</a>, which goes into much more detail about human mobility &#038; predictability.</p>
<p>Finally, huge thanks have to go out to László and his team at the lab, without whom this piece would have never made it to print!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blprnt.com/blog/blprnt/wired-uk-barabasi-lab-and-big-data/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Your Random Numbers &#8211; Getting Started with Processing and Data Visualization</title>
		<link>http://blog.blprnt.com/blog/blprnt/your-random-numbers-getting-started-with-processing-and-data-visualization</link>
		<comments>http://blog.blprnt.com/blog/blprnt/your-random-numbers-getting-started-with-processing-and-data-visualization#comments</comments>
		<pubDate>Mon, 12 Apr 2010 02:56:54 +0000</pubDate>
		<dc:creator>Jer</dc:creator>
				<category><![CDATA[Information Visualization]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[numbers]]></category>
		<category><![CDATA[pedagogy]]></category>
		<category><![CDATA[teaching]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://blog.blprnt.com/?p=1046</guid>
		<description><![CDATA[Over the last year or so, I&#8217;ve spent almost as much time thinking about how to teach data visualization as I&#8217;ve spent working with data. I&#8217;ve been a teacher for 10 years &#8211; for better or for worse this means that as I learn new techniques and concepts, I&#8217;m usually thinking about pedagogy at the [...]]]></description>
			<content:encoded><![CDATA[<p>Over the last year or so, I&#8217;ve spent almost as much time thinking about how to teach data visualization as I&#8217;ve spent working with data. I&#8217;ve been a teacher for 10 years &#8211; for better or for worse this means that as I learn new techniques and concepts, I&#8217;m usually thinking about pedagogy at the same time. Lately, I&#8217;ve also become convinced that this massive &#8216;open data&#8217; movement that we are currently in the midst of is sorely lacking in educational components. The amount of available data, I think, is quickly outpacing our ability to use it in useful and novel ways. How can basic data visualization techniques be taught in an easy, engaging manner?</p>
<p>This post, then, is a first sketch of what a lesson plan for teaching <a href="http://www.processing.org">Processing</a> and data visualization might look like. I&#8217;m going to start from scratch, work through some examples, and (hopefully) make some interesting stuff. One of the nice things, I think, about this process, is that we&#8217;re going to start with fresh, new data &#8211; I&#8217;m not sure what kind of things we&#8217;re going to find once we start to get our hands dirty. This is what is really exciting about data visualization; the chance to find answers to your own, possibly novel questions.</p>
<p><strong>Let&#8217;s Start With the Data</strong></p>
<p>We&#8217;re not going to work with an old, dusty data set here. Nor are we going to attempt to bash our heads against an unnecessarily complex pile of numbers. Instead, we&#8217;re going to start with a data set that I made up &#8211; with the help of a couple of hundred of my <a href="http://www.twitter.com/blprnt">Twitter</a> followers. Yesterday morning, I posted this request:</p>
<p><a rel="attachment wp-att-1047" href="http://blog.blprnt.com/blog/blprnt/your-random-numbers-getting-started-with-processing-and-data-visualization/picture-5-2"><img class="alignnone size-full wp-image-1047" title="Picture 5" src="http://blog.blprnt.com/wp-content/uploads/2010/04/Picture-5.png" alt="" width="500" height="88" /></a></p>
<p>Even on a Saturday, a lot of helpful folks pitched in, and I ended up with about 225 numbers. And so, we have the easiest possible dataset to work with &#8211; a single list of whole numbers. I&#8217;m hoping that, as well as being simple, this dataset will turn out to be quite interesting &#8211; maybe telling us something about how the human brain thinks about numbers.</p>
<p>I wrote a quick Processing sketch to scrape out the numbers from the post, and then to put them into a Google Spreadsheet. You can see the whole dataset here: <a href="http://spreadsheets.google.com/pub?key=t6mq_WLV5c5uj6mUNSryBIA&amp;output=html">http://spreadsheets.google.com/pub?key=t6mq_WLV5c5uj6mUNSryBIA&amp;output=html</a></p>
<p>I chose to start from a Google Spreadsheet in this tutorial, because I wanted people to be able to generate their own datasets to work with. Teachers &#8211; you can set up a spreadsheet of your own, and get your students to collect numbers by any means you&#8217;d like. The &#8216;User&#8217; and &#8216;Tweet&#8217; columns are not necessary; you just need to have a column called &#8216;Number&#8217;.</p>
<p>It&#8217;s about time to get down to some coding. The only tricky part in this whole process will be connecting to the Google Spreadsheet. Rather than bog down the tutorial with a lot of confusing semi-advanced code, I&#8217;ll let you download <a href="http://www.blprnt.com/tutorials/MyRandom.zip">this sample sketch</a> which has the Google Spreadsheet machinery in place.</p>
<p>Got it? Great. Open that sketch in Processing, and let&#8217;s get started. Just to make sure we&#8217;re all in the same place, you should see a screen that looks like this:</p>
<p><a rel="attachment wp-att-1049" href="http://blog.blprnt.com/blog/blprnt/your-random-numbers-getting-started-with-processing-and-data-visualization/picture-7"><img class="alignnone size-medium wp-image-1049" title="Picture 7" src="http://blog.blprnt.com/wp-content/uploads/2010/04/Picture-7-500x365.png" alt="" width="500" height="365" /></a></p>
<p>At the top of the sketch, you&#8217;ll see three String values that you can change. You&#8217;ll definitely have to enter your own Google username and password. If you have your own spreadsheet of number data, you can enter in the key for your spreadsheet as well. You can find the key right in the URL of any spreadsheet.</p>
<p>The first thing we&#8217;ll do is change the size of our sketch to give us some room to move, set the background color, and turn on smoothing to make things pretty. We do all of this in the setup enclosure:</p>
<pre class="brush: java;">
void setup() {
  //This code happens once, right when our sketch is launched
 size(800,800);
 background(0);
 smooth();
};
</pre>
<p>Now we need to get our data from the spreadsheet. One of the advantages of accessing the data from a shared remote file is that the remote data can change and we don&#8217;t have to worry about replacing files or changing our code.</p>
<p>We&#8217;re going to ask for a list of the &#8216;random&#8217; numbers that are stored in the spreadsheet. The most easy way to store lists of things in Processing is in an Array. In this case, we&#8217;re looking for an array of whole numbers &#8211; integers. I&#8217;ve written a function that gets an integer array from Google &#8211; you can take a look at the code on the &#8216;GoogleCode&#8217; tab if you&#8217;d like to see how that is done. What we need to know here is that this function &#8211; called getNumbers &#8211; will return, or send us back, a list of whole numbers. Let&#8217;s ask for that list:</p>
<pre class="brush: java;">
void setup() {
  //This code happens once, right when our sketch is launched
 size(800,800);
 background(0);
 smooth();

 //Ask for the list of numbers
 int[] numbers = getNumbers();
};
</pre>
<p>OK.</p>
<p><strong>World&#8217;s easiest data visualization!</strong></p>
<pre class="brush: java;">
 fill(255,40);
 noStroke();
 for (int i = 0; i &lt; numbers.length; i++) {
   ellipse(numbers[i] * 8, width/2, 8,8);
 };
</pre>
<p>What this does is to draw a row of dots across the screen, one for each number that occurs in our Google list. The dots are drawn with a low alpha (40/255 or about 16%), so when numbers are picked more than once, they get brighter. The result is a strip of dots across the screen that looks like this:</p>
<p><a rel="attachment wp-att-1054" href="http://blog.blprnt.com/blog/blprnt/your-random-numbers-getting-started-with-processing-and-data-visualization/picture-15"><img class="alignnone size-medium wp-image-1054" title="Picture 15" src="http://blog.blprnt.com/wp-content/uploads/2010/04/Picture-15-500x38.png" alt="" width="500" height="38" /></a></p>
<p>Right away, we can see a couple of things about the distribution of our &#8216;random&#8217; numbers. First, there are two or three very bright spots where numbers get picked several times. Also, there are some pretty evident gaps (one right in the middle) where certain numbers don&#8217;t get picked at all.</p>
<p>This could be normal though, right? To see if this distribution is typical, let&#8217;s draw a line of &#8216;real&#8217; random numbers below our line, and see if we can notice a difference:</p>
<pre class="brush: java;">
fill(255,40);
 noStroke();
 //Our line of Google numbers
 for (int i = 0; i &lt; numbers.length; i++) {
   ellipse(numbers[i] * 8, height/2, 8,8);
 };
 //A line of random numbers
 for (int i = 0; i &lt; numbers.length; i++) {
   ellipse(ceil(random(0,99)) * 8, height/2 + 20, 8,8);
 };
</pre>
<p>Now we see the two compared:</p>
<p><a rel="attachment wp-att-1055" href="http://blog.blprnt.com/blog/blprnt/your-random-numbers-getting-started-with-processing-and-data-visualization/picture-16"><img class="alignnone size-medium wp-image-1055" title="Picture 16" src="http://blog.blprnt.com/wp-content/uploads/2010/04/Picture-16-500x33.png" alt="" width="500" height="33" /></a></p>
<p>The bottom, random line doesn&#8217;t seem to have as many bright spots or as evident of gaps as our human-picked line. Still, the difference isn&#8217;t that evident. Can you tell right away which line is our line from the group below?</p>
<p><a rel="attachment wp-att-1056" href="http://blog.blprnt.com/blog/blprnt/your-random-numbers-getting-started-with-processing-and-data-visualization/picture-17"><img class="alignnone size-medium wp-image-1056" title="Picture 17" src="http://blog.blprnt.com/wp-content/uploads/2010/04/Picture-17-500x157.png" alt="" width="500" height="157" /></a></p>
<p>OK. I&#8217;ll admit it &#8211; I was hoping that the human-picked number set would be more obviously divergent from the sets of numbers that were generated by a computer. It&#8217;s possible that humans are better at picking random numbers than I had thought. Or, our sample set is too small to see any kind of real difference. It&#8217;s also possible that this quick visualization method isn&#8217;t doing the trick. Let&#8217;s stay on the track of number distribution for a few minutes and see if we can find out any more.</p>
<p>Our system of dots was easy, and readable, but not very useful for empirical comparisons. For the next step, let&#8217;s stick with the classics and</p>
<p><strong>Build a bar graph.</strong></p>
<p>Right now, we have a list of numbers. Ours range from 1-99, but let&#8217;s imagine for a second that we had a set of numbers that ranged from 0-10:</p>
<p>[5,8,5,2,4,1,6,3,9,0,1,3,5,7]</p>
<p>What we need to build a bar graph for these numbers is a list of <em>counts</em> &#8211; how many times each number occurs:</p>
<p>[1,2,1,2,1,3,1,1,1,1]</p>
<p>We can look at this list above, and see that there were two 1s, and three 5s.</p>
<p>Let&#8217;s do the same thing with our big list of numbers &#8211; we&#8217;re going to generate a list 99 numbers long that holds the counts for each of the possible numbers in our set. But, we&#8217;re going to be a bit smarter about it this time around and package our code into a function &#8211; so that we can use it again and again without having to re-write it. In this case the function will (eventually) draw a bar graph &#8211; so we&#8217;ll call it (cleverly) barGraph:</p>
<pre class="brush: java;">
void barGraph( int[] nums ) {
  //Make a list of number counts
 int[] counts = new int[100];
 //Fill it with zeros
 for (int i = 1; i &lt; 100; i++) {
   counts[i] = 0;
 };
 //Tally the counts
 for (int i = 0; i &lt; nums.length; i++) {
   counts[nums[i]] ++;
 };
};
</pre>
<p>This function constructs an array of counts from whatever list of numbers we pass into it (that list is a list of integers, and we refer to it within the function as &#8216;nums&#8217;, a name which I made up). Now, let&#8217;s add the code to draw the graph (I&#8217;ve added another parameter to go along with the numbers &#8211; the y position of the graph):</p>
<pre class="brush: java;">

void barGraph(int[] nums, float y) {
  //Make a list of number counts
 int[] counts = new int[100];
 //Fill it with zeros
 for (int i = 1; i &lt; 100; i++) {
   counts[i] = 0;
 };
 //Tally the counts
 for (int i = 0; i &lt; nums.length; i++) {
   counts[nums[i]] ++;
 };

 //Draw the bar graph
 for (int i = 0; i &lt; counts.length; i++) {
   rect(i * 8, y, 8, -counts[i] * 10);
 };
};
</pre>
<p>We&#8217;ve added a function &#8211; a set of instructions &#8211; to our file, which we can use to draw a bar graph from a set of numbers. To actually draw the graph, we need to call the function, which we can do in the setup enclosure. Here&#8217;s the code, all together:</p>
<pre class="brush: java;">

/*

 #myrandomnumber Tutorial
 blprnt@blprnt.com
 April, 2010

 */

//This is the Google spreadsheet manager and the id of the spreadsheet that we want to populate, along with our Google username &amp; password
SimpleSpreadsheetManager sm;
String sUrl = &quot;t6mq_WLV5c5uj6mUNSryBIA&quot;;
String googleUser = &quot;YOUR USERNAME&quot;;
String googlePass = &quot;YOUR PASSWORD&quot;;

void setup() {
  //This code happens once, right when our sketch is launched
 size(800,800);
 background(0);
 smooth();

 //Ask for the list of numbers
 int[] numbers = getNumbers();
 //Draw the graph
 barGraph(numbers, 400);
};

void barGraph(int[] nums, float y) {
  //Make a list of number counts
 int[] counts = new int[100];
 //Fill it with zeros
 for (int i = 1; i &lt; 100; i++) {
   counts[i] = 0;
 };
 //Tally the counts
 for (int i = 0; i &lt; nums.length; i++) {
   counts[nums[i]] ++;
 };

 //Draw the bar graph
 for (int i = 0; i &lt; counts.length; i++) {
   rect(i * 8, y, 8, -counts[i] * 10);
 };
};

void draw() {
  //This code happens once every frame.
};
</pre>
<p>If you run your code, you should get a nice minimal bar graph which looks like this:</p>
<p><a rel="attachment wp-att-1065" href="http://blog.blprnt.com/blog/blprnt/your-random-numbers-getting-started-with-processing-and-data-visualization/picture-18"><img class="alignnone size-medium wp-image-1065" title="Picture 18" src="http://blog.blprnt.com/wp-content/uploads/2010/04/Picture-18-500x90.png" alt="" width="500" height="90" /></a></p>
<p>We can help distinguish the very high values (and the very low ones) by adding some color to the graph. In Processing&#8217;s standard RGB color mode, we can change one of our color channels (in this case, green) with our count values to give the bars some differentiation:</p>
<pre class="brush: java;">

 //Draw the bar graph
 for (int i = 0; i &lt; counts.length; i++) {
   fill(255, counts[i] * 30, 0);
   rect(i * 8, y, 8, -counts[i] * 10);
 };
</pre>
<p>Which gives us this:</p>
<p><a rel="attachment wp-att-1066" href="http://blog.blprnt.com/blog/blprnt/your-random-numbers-getting-started-with-processing-and-data-visualization/picture-19"><img title="Picture 19" src="http://blog.blprnt.com/wp-content/uploads/2010/04/Picture-19-500x66.png" alt="" width="500" height="66" /></a></p>
<p>Or, we could switch to Hue/Saturation/Brightness mode, and use our count values to cycle through the available hues:</p>
<pre class="brush: java;">
//Draw the bar graph
 for (int i = 0; i &lt; counts.length; i++) {
   colorMode(HSB);
   fill(counts[i] * 30, 255, 255);
   rect(i * 8, y, 8, -counts[i] * 10);
 };
</pre>
<p>Which gives us this graph:</p>
<p><a rel="attachment wp-att-1067" href="http://blog.blprnt.com/blog/blprnt/your-random-numbers-getting-started-with-processing-and-data-visualization/picture-20"><img class="alignnone size-medium wp-image-1067" title="Picture 20" src="http://blog.blprnt.com/wp-content/uploads/2010/04/Picture-20-500x67.png" alt="" width="500" height="67" /></a></p>
<p>Now would be a good time to do some comparisons to a real random sample again, to see if the new coloring makes a difference. Because we defined our bar graph instructions as a function, we can do this fairly easily (I built in an easy function to generate a random list of integers called getRandomNumbers &#8211; you can see the code on the &#8216;GoogleCode&#8217; tab):</p>
<pre class="brush: java;">
void setup() {
  //This code happens once, right when our sketch is launched
 size(800,800);
 background(0);
 smooth();

 //Ask for the list of numbers
 int[] numbers = getNumbers();
 //Draw the graph
 barGraph(numbers, 100);

 for (int i = 1; i &lt; 7; i++) {
 int[] randoms = getRandomNumbers(225);
 barGraph(randoms, 100 + (i * 130));
 };
};
</pre>
<p><a rel="attachment wp-att-1070" href="http://blog.blprnt.com/blog/blprnt/your-random-numbers-getting-started-with-processing-and-data-visualization/picture-21"><img title="Picture 21" src="http://blog.blprnt.com/wp-content/uploads/2010/04/Picture-21-498x500.png" alt="" width="498" height="500" /></a></p>
<p>I know, I know. Bar graphs. Yay. Looking at the graphic above, though, we can see more clearly that our humanoid number set is unlike the machine-generated sets. However, I actually think that the color is more valuable than the dimensions of the bars. Since we&#8217;re dealing with 99 numbers, maybe we can display these colours in a grid and see if any patterns emerge? A really important thing to be able to do with data visualization is to</p>
<p><strong>Look at datasets from multiple angles.</strong></p>
<p>Let&#8217;s see if the grid gets us anywhere. Luckily, a function to make a grid is pretty much the same as the one to make a graph (I&#8217;m adding two more parameters &#8211; an x position for the grid, and a size for the individual blocks):</p>
<pre class="brush: java;">
void colorGrid(int[] nums, float x, float y, float s) {
 //Make a list of number counts
 int[] counts = new int[100];
 //Fill it with zeros
 for (int i = 0; i &lt; 100; i++) {
   counts[i] = 0;
 };
 //Tally the counts
 for (int i = 0; i &lt; nums.length; i++) {
   counts[nums[i]] ++;
 };

//Move the drawing coordinates to the x,y position specified in the parameters
 pushMatrix();
 translate(x,y);
 //Draw the grid
 for (int i = 0; i &lt; counts.length; i++) {
   colorMode(HSB);
   fill(counts[i] * 30, 255, 255, counts[i] * 30);
   rect((i % 10) * s, floor(i/10) * s, s, s);

 };
 popMatrix();
};
</pre>
<p>We can now do this to draw a nice big grid:</p>
<pre class="brush: java;">
 //Ask for the list of numbers
 int[] numbers = getNumbers();
 //Draw the graph
 colorGrid(numbers, 50, 50, 70);
</pre>
<p><a rel="attachment wp-att-1075" href="http://blog.blprnt.com/blog/blprnt/your-random-numbers-getting-started-with-processing-and-data-visualization/picture-22"><img class="alignnone size-medium wp-image-1075" title="Picture 22" src="http://blog.blprnt.com/wp-content/uploads/2010/04/Picture-22-499x500.png" alt="" width="499" height="500" /></a></p>
<p>I can see some definite patterns in this grid &#8211; so let&#8217;s bring the actual numbers back into play so that we can talk about what seems to be going on. Here&#8217;s the full code, one last time:</p>
<pre class="brush: java;">

/*

 #myrandomnumber Tutorial
 blprnt@blprnt.com
 April, 2010

 */

//This is the Google spreadsheet manager and the id of the spreadsheet that we want to populate, along with our Google username &amp; password
SimpleSpreadsheetManager sm;
String sUrl = &quot;t6mq_WLV5c5uj6mUNSryBIA&quot;;
String googleUser = &quot;YOUR USERNAME&quot;;
String googlePass = &quot;YOUR PASSWORD&quot;;

//This is the font object
PFont label;

void setup() {
  //This code happens once, right when our sketch is launched
 size(800,800);
 background(0);
 smooth();

 //Create the font object to make text with
 label = createFont(&quot;Helvetica&quot;, 24);

 //Ask for the list of numbers
 int[] numbers = getNumbers();
 //Draw the graph
 colorGrid(numbers, 50, 50, 70);
};

void barGraph(int[] nums, float y) {
  //Make a list of number counts
 int[] counts = new int[100];
 //Fill it with zeros
 for (int i = 1; i &lt; 100; i++) {
   counts[i] = 0;
 };
 //Tally the counts
 for (int i = 0; i &lt; nums.length; i++) {
   counts[nums[i]] ++;
 };

 //Draw the bar graph
 for (int i = 0; i &lt; counts.length; i++) {
   colorMode(HSB);
   fill(counts[i] * 30, 255, 255);
   rect(i * 8, y, 8, -counts[i] * 10);
 };
};

void colorGrid(int[] nums, float x, float y, float s) {
 //Make a list of number counts
 int[] counts = new int[100];
 //Fill it with zeros
 for (int i = 0; i &lt; 100; i++) {
   counts[i] = 0;
 };
 //Tally the counts
 for (int i = 0; i &lt; nums.length; i++) {
   counts[nums[i]] ++;
 };

 pushMatrix();
 translate(x,y);
 //Draw the grid
 for (int i = 0; i &lt; counts.length; i++) {
   colorMode(HSB);
   fill(counts[i] * 30, 255, 255, counts[i] * 30);
   textAlign(CENTER);
   textFont(label);
   textSize(s/2);
   text(i, (i % 10) * s, floor(i/10) * s);
 };
 popMatrix();
};

void draw() {
  //This code happens once every frame.

};
</pre>
<p>And, our nice looking number grid:</p>
<p><a rel="attachment wp-att-1076" href="http://blog.blprnt.com/blog/blprnt/your-random-numbers-getting-started-with-processing-and-data-visualization/picture-23"><img class="alignnone size-medium wp-image-1076" title="Picture 23" src="http://blog.blprnt.com/wp-content/uploads/2010/04/Picture-23-500x487.png" alt="" width="500" height="487" /></a></p>
<p><strong>BINGO!</strong></p>
<p>No, really. If this was a bingo card, and I was a 70-year old, I&#8217;d be rich. Look at that nice line going down the X7 column &#8211; 17, 27, 37, 47, 57, 67, 77, 87, and 97 are all appearing with good frequency. If we rule out the Douglas Adams effect on 42, it is likely that most of the top 10 most-frequently occurring numbers would have a 7 on the end. Do numbers ending with 7s &#8216;feel&#8217; more random to us? Or is there something about the number 7 that we just plain like?</p>
<p>Contrasting to that, if I had played the x0 row, I&#8217;d be out of luck. It seems that numbers ending with a zero don&#8217;t feel very random to us at all. This could also explain the black hole around the number 50 &#8211; which, in a range from 0-100, appears to be the &#8216;least random&#8217; of all.</p>
<p>Well, there we have it. A start-to finish example of how we can use Processing to visualize simple data, with a goal to expose underlying patterns and anomalies. The techniques that we used in this project were fairly simple &#8211; but they are useful tools that can be used in a huge variety of data situations (I use them myself, all the time).</p>
<p>Hopefully this tutorial is (was?) useful for some of you. And, if there are any teachers out there who would like to try this out with their classrooms, I&#8217;d love to hear how it goes.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blprnt.com/blog/blprnt/your-random-numbers-getting-started-with-processing-and-data-visualization/feed</wfw:commentRss>
		<slash:comments>51</slash:comments>
		</item>
		<item>
		<title>The Missing Piece of the OpenData / OpenGov Puzzle: Education</title>
		<link>http://blog.blprnt.com/blog/blprnt/the-missing-piece-of-the-opendata-opengov-puzzle-education</link>
		<comments>http://blog.blprnt.com/blog/blprnt/the-missing-piece-of-the-opendata-opengov-puzzle-education#comments</comments>
		<pubDate>Sun, 07 Mar 2010 23:46:35 +0000</pubDate>
		<dc:creator>Jer</dc:creator>
				<category><![CDATA[Information Visualization]]></category>
		<category><![CDATA[Journalism]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[Science]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[education]]></category>
		<category><![CDATA[opendata]]></category>
		<category><![CDATA[opengov]]></category>
		<category><![CDATA[pipedream]]></category>
		<category><![CDATA[policy]]></category>

		<guid isPermaLink="false">http://blog.blprnt.com/?p=1019</guid>
		<description><![CDATA[Yesterday, I tweeted a quick thought that I had, while walking the dog: A few people asked me to expand on this, so let&#8217;s give it a try: We are facing a very different data-related problem today than we were facing only a few years ago. Back then, the call was solely for more information. [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday, I <a href="http://www.twitter.com/blprnt">tweeted</a> a quick thought that I had, while walking the dog:</p>
<p><img class="alignnone size-medium wp-image-1020" title="Picture 5" src="http://blog.blprnt.com/wp-content/uploads/2010/03/Picture-5-500x67.png" alt="Picture 5" width="500" height="67" /></p>
<p>A few people asked me to expand on this, so let&#8217;s give it a try:</p>
<p>We are facing a very different data-related problem today than we were facing only a few years ago. Back then, the call was solely for more information. Since then, corporations and governments have started to answer this call and the result has been a flood of data of all shapes and sizes. While it&#8217;s important to remain on track with the goal of making data available, we are now faced with a parallel and perhaps more perplexing problem: What do we do with it all?</p>
<p>Of course, an industry has developed around all of this data; start-ups around the world are coming up with new ideas and data-related products every day. At the same time, open-sourcers are releasing helpful tools and clever apps by the dozen. Still, in a large part these groups are looking at the data with fiscal utility in mind. It seems to me that if we are going to make the most of this information resource, it&#8217;s important to bring more people in on the game &#8211; and to do that requires education.</p>
<p>At the post-secondary level, efforts should be made to educate academics for whom this new pile of data could be useful: journalists, social scientists, historians, contemporary artists, archivists, etc. I could imagine cross-disciplinary workshops teaching the basics:</p>
<ol>
<li>A survey of what kind of data is available, and how to find it.</li>
<li>A brief overview of common data formats (CSV, JSON, XML, etc).</li>
<li>An introduction to user-friendly exploration tools like <a href="http://manyeyes.alphaworks.ibm.com/manyeyes/">ManyEyes</a> &amp; <a href="http://www.tableausoftware.com/public/">Tableau</a></li>
<li>A primer in <a href="http://www.processing.org">Processing</a> and how it can be used to quickly prototype and build specialized visualization tools.</li>
</ol>
<p>The last step seems particularly important to me, as it encourages people to think about new ways to engage with information. In many cases, datasets that are becoming available are novel in their content, structure, and complexity &#8211; encouraging innovation in an academic framework is essential. Yes, we do need to teach people how to make bar graphs and scatter charts; but let&#8217;s also facilitate exploration and experimentation.</p>
<p>Why workshops? While this type of teaching could certainly be done through tutorials, or with a well-written text book, it&#8217;s my experience that teaching these subjects is much more effective one-on-one. This is particularly true for students who come at data from a non-scientific perspective (and these people are the ones that we need the most).</p>
<p>The long-term goal of such an initiative would be to increase data-literacy. In a perfect world, this would occur even earlier &#8211; at the highschool level. Here&#8217;s where I put on my utopian hat: teaching data literacy to young people would mean that they could find answers to their own questions, rather than waiting for the media to answer those questions for them. It also teaches them, in a practical way, about transparency and accountability in government. The education system is already producing a generation of bloggers and citizen journalists &#8211; let&#8217;s make sure they have the skills they need to be dangerous. Veering a bit to the right, these are hugely valuable skills for workers in an &#8216;idea economy&#8217; &#8211; a nation with a data-literate workforce is a force to be reckoned with.</p>
<p>Ideally this educational component would be build in to government projects like data.gov or data.hmg.gov.uk (are you listening, Canada?). More than that, it would be woven into the education mandate of governments at federal and local levels. Of course, I&#8217;m not holding my breath.</p>
<p>Instead, I&#8217;ve started to plan a bit of a project for the summer. Like last year, I taught a series of workshops at my studio in Vancouver, which were open to people of all skill levels. This year, I&#8217;m going to extend my reach a bit and offer a couple of <strong>free</strong>, online presentations covering some of the things that I&#8217;ve talked about in this post. One of these workshops will be specifically targeted to youth. At the same time, I&#8217;ll be publishing course outlines and sample materials for my sessions so that others can host similar events.</p>
<p>Stay tuned for details &#8211; and if you have any questions or would like to lend a hand, feel free to leave a comment or <a href="mailto:blprnt@blprnt.com">get in touch</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blprnt.com/blog/blprnt/the-missing-piece-of-the-opendata-opengov-puzzle-education/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>State of the Union(s)</title>
		<link>http://blog.blprnt.com/blog/blprnt/state-of-the-unions</link>
		<comments>http://blog.blprnt.com/blog/blprnt/state-of-the-unions#comments</comments>
		<pubDate>Thu, 28 Jan 2010 06:12:21 +0000</pubDate>
		<dc:creator>Jer</dc:creator>
				<category><![CDATA[Journalism]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[data visualization]]></category>
		<category><![CDATA[nytimes]]></category>
		<category><![CDATA[obama]]></category>
		<category><![CDATA[state of the union]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://blog.blprnt.com/?p=1015</guid>
		<description><![CDATA[I was asked at the end of last week to produce a graphic for the Opinion page today &#8211; the idea was to compare the texts of various &#8216;state of the union&#8217; addresses from around the world. The final result (pictured above) is not extraordinarily data-heavy. It worked quite nicely in the printed layout, where [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/blprnt/4309607264/" title="New York Times, 01/27/10 - State of the Union Graphic by blprnt_van, on Flickr"><img src="http://farm5.static.flickr.com/4034/4309607264_03b98784d8.jpg" width="500" height="465" alt="New York Times, 01/27/10 - State of the Union Graphic" /></a></p>
<p>I was asked at the end of last week to produce a graphic for <a href="http://www.nytimes.com/2010/01/27/opinion/27state-of-the-world.html">the Opinion page toda</a>y &#8211; the idea was to compare the texts of various &#8216;state of the union&#8217; addresses from around the world. The final result (pictured above) is not extraordinarily data-heavy. It worked quite nicely in the printed layout, where the individual &#8216;tentacles&#8217; trailed to the text of the speeches that they index.</p>
<p>The process behind this piece was relatively simple. Each speech was indexed using a Processing application that I wrote which counts the frequency of individual names (the program ignores commonly used or unimportant words). The words for each speech were then ranked by mentions per thousand words (you can see a version of the piece with numbers <a href="http://www.flickr.com/photos/blprnt/4308870277/in/photostream/">here</a>)</p>
<p>Almost every project I work on involves a period of &#8216;data exploration&#8217; in which I try shake as many interesting things out of the information as I can. Even though this piece had a short turn-around, I did a fair amount of poking around, generating some simple bar graphs:</p>
<p><a href="http://www.flickr.com/photos/blprnt/4310264839/" title="State of the Union Graphs by blprnt_van, on Flickr"><img src="http://farm5.static.flickr.com/4046/4310264839_bfaab20523.jpg" width="500" height="499" alt="State of the Union Graphs" /></a></p>
<p>Another avenue I explored was to use the word weights to determine a &#8216;score&#8217; for each sentence. By doing this, I can try to find the &#8216;kernel&#8217; of the speech &#8211; the sentence that sums up the entire text in the most succinct way. This, I think was fairly successful. Here are the &#8216;power sentences&#8217; for the UK:</p>
<p><a href="http://www.flickr.com/photos/blprnt/4310297221/" title="SOTU analysis - Sentence Weighting- UK by blprnt_van, on Flickr"><img src="http://farm3.static.flickr.com/2721/4310297221_451b40a12d.jpg" width="500" height="103" alt="SOTU analysis - Sentence Weighting- UK" /></a></p>
<p>The Netherlands:</p>
<p><a href="http://www.flickr.com/photos/blprnt/4311034678/" title="SOTU analysis - Sentence Weighting - Netherlands by blprnt_van, on Flickr"><img src="http://farm3.static.flickr.com/2760/4311034678_604e9bc7ae.jpg" width="500" height="87" alt="SOTU analysis - Sentence Weighting - Netherlands" /></a></p>
<p>And Botswana:</p>
<p><a href="http://www.flickr.com/photos/blprnt/4310297241/" title="SOTU analysis - Sentence Weighting - Botswana by blprnt_van, on Flickr"><img src="http://farm5.static.flickr.com/4030/4310297241_4600853a10.jpg" width="500" height="86" alt="SOTU analysis - Sentence Weighting - Botswana" /></a></p>
<p>Which brings us to tonight&#8217;s State of the Union Address by Barack Obama. What was the &#8216;power sentence&#8217; from this speech? I ran the weighting algorithm on the address and this is what it came up with:</p>
<p><a href="http://www.flickr.com/photos/blprnt/4310312761/" title="The Most Important Sentence From Obama's State of the Union Address? by blprnt_van, on Flickr"><img src="http://farm3.static.flickr.com/2802/4310312761_e47b9a0ed0.jpg" width="500" height="74" alt="The Most Important Sentence From Obama's State of the Union Address?" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blprnt.com/blog/blprnt/state-of-the-unions/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Unlucky Haiti (1981-2009)</title>
		<link>http://blog.blprnt.com/blog/blprnt/unlucky-haiti-1981-2009</link>
		<comments>http://blog.blprnt.com/blog/blprnt/unlucky-haiti-1981-2009#comments</comments>
		<pubDate>Thu, 14 Jan 2010 06:01:51 +0000</pubDate>
		<dc:creator>Jer</dc:creator>
				<category><![CDATA[Information Visualization]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[data vizualization]]></category>
		<category><![CDATA[disaster]]></category>
		<category><![CDATA[haiti]]></category>
		<category><![CDATA[new york times]]></category>

		<guid isPermaLink="false">http://blog.blprnt.com/?p=995</guid>
		<description><![CDATA[I was very much moved by Maggie Steber&#8217;s photo essay in The New York Times, titled &#8216;No End of Trouble. Ever.&#8216; The essay talks about Haiti&#8217;s violent history, and of the countries incredible tendency towards misfortune: &#8220;How can nature or God or the fates or the universe do this to a country that has borne [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Unlucky Haiti (1981-2010) by blprnt_van, on Flickr" href="http://www.flickr.com/photos/blprnt/4272834797/"><img src="http://farm5.static.flickr.com/4037/4272834797_eaa39f95fc.jpg" alt="Unlucky Haiti (1981-2010)" width="500" height="443" /></a></p>
<p>I was very much moved by Maggie Steber&#8217;s photo essay in The New York Times, titled &#8216;<a href="lens.blogs.nytimes.com/2010/01/13/showcase-109/">No End of Trouble. Ever.</a>&#8216;</p>
<p>The essay talks about Haiti&#8217;s violent history, and of the countries incredible tendency towards misfortune:</p>
<blockquote><p>&#8220;How can nature or God or the fates or the universe do this to a country that has borne far too much sadness? An earthquake has now devastated the capital; claiming lives, hopes and the pitifully small dreams that people have held on to, despite political violence, unimaginable poverty, disease, corruption, dictators and nature’s full force of four hurricanes in a row.&#8221;</p></blockquote>
<p>I built this very quick visualization to explore this topic a little further. Specifically, I wanted to compare Haiti to its Caribbean neighbours to see if the country is indeed as unlucky as it seems.</p>
<p>This visualization compares Haiti to 12 other Caribbean nations. It looks at articles published in the New York Times mentioning those countries between 1981 and 2010, and measures the occurence of specific words in those articles.</p>
<p>The pie charts in each row show the percentage of total articles on each country which contain the words in question. For example, we can see that about 25% of articles published about Haiti mention the word &#8216;violence&#8217; &#8211; twice the frequency of any other country on the list.</p>
<p>Haiti has the highest frequency of the words &#8216;coup&#8217;, &#8216;violence&#8217;, &#8216;disease&#8217;, and &#8216;strife&#8217;. It is second or third in mentions of &#8216;death&#8217;, &#8216;unrest&#8217; and &#8216;famine&#8217;.</p>
<p>Likely this week&#8217;s events will lead to many more mentions of these words. As you&#8217;re likely aware, many NGOs small and large are organizing to help Haitians &#8211; both through emergency assistance and through long-term rebuilding. If you want to donate, I&#8217;d highly recommend considering <a href="http://www.architectureforhumanity.org/">Architecture for Humanity</a> (for long-term projects) or <a href="http://www.pih.org/">Partners in Health</a> (for emergency assistance). Both organizations are accepting donations through their websites.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blprnt.com/blog/blprnt/unlucky-haiti-1981-2009/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Two Sides of the Same Story: Laskas &amp; Gladwell on CTE &amp; the NFL</title>
		<link>http://blog.blprnt.com/blog/blprnt/two-sides-of-the-same-story-laskas-gladwell-on-cte-the-nfl</link>
		<comments>http://blog.blprnt.com/blog/blprnt/two-sides-of-the-same-story-laskas-gladwell-on-cte-the-nfl#comments</comments>
		<pubDate>Mon, 09 Nov 2009 04:56:58 +0000</pubDate>
		<dc:creator>Jer</dc:creator>
				<category><![CDATA[Information Visualization]]></category>
		<category><![CDATA[Journalism]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[dataviz]]></category>
		<category><![CDATA[gq]]></category>
		<category><![CDATA[infoviz]]></category>
		<category><![CDATA[jeanne marie laskas]]></category>
		<category><![CDATA[malcolm gladwell]]></category>
		<category><![CDATA[the new yorker]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://blog.blprnt.com/?p=953</guid>
		<description><![CDATA[In October, I read a fascinating article on GQ.com about head injuries among former NFL players. Written by Jeanne Marie Laskas, the article was a forensic detective story, documenting a little known doctor&#8217;s efforts to bring the brain trauma issue to the attention of the medical community, the NFL, and the general public. It is [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Laskas / Gladwell by blprnt_van, on Flickr" href="http://www.flickr.com/photos/blprnt/4088027574/"><img src="http://farm3.static.flickr.com/2635/4088027574_ccd6619f37.jpg" alt="Laskas / Gladwell" width="500" height="281" /></a></p>
<p>In October, I read a <a href="http://www.gq.com/sports/profiles/200909/nfl-players-brain-dementia-study-memory-concussions">fascinating article on GQ.com</a> about head injuries among former NFL players. Written by Jeanne Marie Laskas, the article was a forensic detective story, documenting a little known doctor&#8217;s efforts to bring the brain trauma issue to the attention of the medical community, the NFL, and the general public. It is a great read &#8211; an in-depth investigative piece with engaging personalities and plenty of intrigue.</p>
<p>A few weeks later, I picked up a copy of The New Yorker on my way home from Pittsburgh. I was surprised to see, on the cover, a promo for <a href="http://www.newyorker.com/reporting/2009/10/19/091019fa_fact_gladwell">an article by Malcolm Gladwell</a> about &#8211; you guessed it &#8211; brain trauma and the NFL. After having read both articles, I was surprised by how much these two investigative pieces differed. At the time I thought about doing a visualization to investigate, but somehow the idea slipped out of my head.</p>
<p>Until this weekend. I spent a few (okay, more like eight) hours putting together a tool with <a href="http://www.processing.org">Processing</a> that would examine some of the similarities and differences between the two articles. The most interesting data ended up coming from word usage analysis (I looked at sentences and phrases as well, but with not much luck). The base interface for the tool is a XY chart of the words &#8211; they are positioned vertically by their average position in the articles, and horizontally by which article they occur in more. The words in the centre are shared by both articles. Total usage affects the scale of the words, so we can see quite quickly which words are used most, and in which articles.</p>
<p>By focusing our attention on the big words which lie more or less in the center, we can see what the two articles have in common: brains, football, dementia, and a disease called CTE. What is perhaps more interesting is what lies on the outer edges; the subjects and topics that were covered by one author and not by the other.</p>
<p>Laskas&#8217; article is about Dr. Bennet Omalu, dead NFL players (Mike Webster), Omalu&#8217;s colleagues (Dr. Julian Bailes &amp; Bob Fitzsimmons) and the NFL (click on the images to see bigger versions):</p>
<p><a title="Laskas / Gladwell by blprnt_van, on Flickr" href="http://www.flickr.com/photos/blprnt/4088078146/"><img src="http://farm3.static.flickr.com/2651/4088078146_0497d8bc07.jpg" alt="Laskas / Gladwell" width="500" height="281" /></a></p>
<p>Gladwell&#8217;s article, on the other hand, focuses partly on another scientist, Dr. Ann McKee, the sport of football in general, as well as s central metaphor in his piece &#8211; a comparison between football and dogfighting (the bridge between the two is Michael Vick):</p>
<p><a title="Laskas / Gladwell by blprnt_van, on Flickr" href="http://www.flickr.com/photos/blprnt/4087432437/"><img src="http://farm3.static.flickr.com/2572/4087432437_6297eb1c44.jpg" alt="Laskas / Gladwell" width="500" height="281" /></a></p>
<p>The gulf between the two main scientific personalities profiled in the articles is interesting. Omalu and McKee are both experts in chronic traumatic encephalopathy (CTE) so it makes sense that they each appear in both articles (Omalu was the first to describe the condition; McKee. However, we see when we isolate these names that Laskas references Dr. Omalu almost exclusively  (Omalu is mentioned 96 times by Laskas and only 6 times by Gladwell)* &#8211; <em>it&#8217;s worth noting here that the Laskas article is 11.4% longer than the Gladwell piece &#8211; JT</em>:</p>
<p><a title="Laskas / Gladwell by blprnt_van, on Flickr" href="http://www.flickr.com/photos/blprnt/4088077822/"><img src="http://farm3.static.flickr.com/2685/4088077822_ef6f8c2e13.jpg" alt="Laskas / Gladwell" width="500" height="281" /></a></p>
<p>In contrast, Laskas only refers to McKee once (Dr. McKee is mentioned by Gladwell 21 times):</p>
<p><a title="Laskas / Gladwell by blprnt_van, on Flickr" href="http://www.flickr.com/photos/blprnt/4087460227/"><img src="http://farm3.static.flickr.com/2651/4087460227_0a0b428d90.jpg" alt="Laskas / Gladwell" width="500" height="281" /></a></p>
<p>What is the relationship between Dr. McKee and Dr. Omalu? McKee is on the advisory board for the <a href="http://sportslegacy.org/">Sports Legacy Institute</a>, a group which studies the results of brain trauma on athletes. SLI was founded by four individuals, including Bennet Omalu and the group&#8217;s current head, Chris Nowinski, a former professional wrestler. Omalu and the other three founders of SLI have now left the group, but it apparently continues to be a high-profile presence in the CTE field. Laskas writes:</p>
<blockquote><p>&#8220;Indeed, the casual observer who wants to learn more about CTE will be easily led to SLI and the Boston group. There&#8217;s an SLI Twitter link, an SLI awards banquet, an SLI Web site with photos of Nowinski and links to videos of him on TV and in the newspapers. Gradually, Omalu&#8217;s name slips out of the stories, and Bailes slips out, and Fitzsimmons, and their good fight. As it happens in stories, the telling and retelling simplify and reduce.&#8221;</p></blockquote>
<p>I wonder how much the path of an journalistic piece is affected by who you talk to first? If I had to guess, I&#8217;d say Gladwell started with the SLI, whereas Laskas seemed to have began from Dr. Omalu. This single decision could account for many of the differences between the two articles.</p>
<p>Other word-use choices might also give insight into editorial positions. Laskas, for example, uses the term NFL (below, at left) a lot &#8211; 57 times to Gladwell&#8217;s 11. Gladwell, on the other hand, talks more about the sport in general, using the word &#8216;football&#8217; (below, at right)  40 times to Laskas&#8217; 23:</p>
<p><a title="Laskas / Gladwell by blprnt_van, on Flickr" href="http://www.flickr.com/photos/blprnt/4088249358/"><img src="http://farm3.static.flickr.com/2462/4088249358_1e05390a48_m.jpg" alt="Laskas / Gladwell" width="240" height="135" /></a> <a title="Laskas / Gladwell by blprnt_van, on Flickr" href="http://www.flickr.com/photos/blprnt/4087270411/"><img src="http://farm3.static.flickr.com/2796/4087270411_53a7f2f1fb_m.jpg" alt="Laskas / Gladwell" width="240" height="135" /></a></p>
<p>According to Laskas, Dr. Omalu has been roundly shunned by the NFL &#8211; they have attempted to discredit his research on many occasions (attention that has not been so pointedly focused on Dr. McKee and the SLI). Though both articles are critical of the League, it seems clear both from the article and the data that Laskas and GQ have taken a more severe stance &#8211; the addresses the NFL much more often, and with more disdain.</p>
<p>This exercise of quantitatively analyzing a pair of articles may seem like a strange way to spend a weekend, but it helped me to more clearly understand the differences between the two stories and to consider my reactions to each. I uncovered a few things that I hadn&#8217;t picked up at first, and at the same time was able to reinforce some of the feelings that I had after reading the two articles.</p>
<p>It was also another opportunity to build a quick, lightweight visualization tool dedicated to a fairly specific topic (though in this case the tool could be used to compare any two bodies of text). This strategy holds a lot of appeal to me and I think deserves attention alongside the generalist approach that we tend to see a lot of on the web and in data visualization. It seems to me that this type of investigative technique could be useful for researchers of various stripes.</p>
<p>I will be releasing source code for this project as well as compiled applications for Mac, Linux &amp; Windows. In the meantime, here&#8217;s a short video of how the interface behaves:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="500" height="281" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=7512054&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="500" height="281" src="http://vimeo.com/moogaloop.swf?clip_id=7512054&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><a href="http://vimeo.com/7512054">Two Sides of the Same Story: Laskas &amp; Gladwell on CTE &amp; the NFL</a> from <a href="http://vimeo.com/user313340">blprnt</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blprnt.com/blog/blprnt/two-sides-of-the-same-story-laskas-gladwell-on-cte-the-nfl/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>7 Days of Source Day #6: NYTimes GraphMaker</title>
		<link>http://blog.blprnt.com/blog/blprnt/7-days-of-source-day-6-nytimes-graphmaker</link>
		<comments>http://blog.blprnt.com/blog/blprnt/7-days-of-source-day-6-nytimes-graphmaker#comments</comments>
		<pubDate>Fri, 30 Oct 2009 02:37:27 +0000</pubDate>
		<dc:creator>Jer</dc:creator>
				<category><![CDATA[Information Visualization]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[source code]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[graphing]]></category>
		<category><![CDATA[nytimes]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[radial graphs]]></category>
		<category><![CDATA[source]]></category>

		<guid isPermaLink="false">http://blog.blprnt.com/?p=937</guid>
		<description><![CDATA[Project: NYTimes GraphMaker Date: Fall, 2009 Language: Processing Key Concepts: Data vizualization, graphing, NYTimes Article Search API Overview: The New York Times Article Search API gives us access to a mountain of data: more than 2.6 million indexed articles. There must be countless discoveries waiting to be made in this vast pile of information &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p><a title="NYTimes Drug Diptych by blprnt_van, on Flickr" href="http://www.flickr.com/photos/blprnt/4056673437/"><img src="http://farm3.static.flickr.com/2575/4056673437_5a65f97679.jpg" alt="NYTimes Drug Diptych" width="500" height="200" /></a></p>
<p><strong>Project</strong>: NYTimes GraphMaker<br />
<strong>Date: </strong>Fall, 2009<br />
<strong>Language: </strong><strong><span style="font-weight: normal;"><a href="http://www.processing.org">Processing</a></span></strong><br />
<strong>Key Concepts:</strong> Data vizualization, graphing, NYTimes Article Search API</p>
<p><strong>Overview:</strong></p>
<p><a href="http://open.blogs.nytimes.com/2009/02/04/announcing-the-article-search-api/">The New York Times Article Search API </a>gives us access to a mountain of data: more than 2.6 million indexed articles. There must be countless discoveries waiting to be made in this vast pile of information &#8211; we just need more people with shovels! With that in mind, I wanted to release a really simple example of using <a href="http://www.processing.org">Processing</a> to access word trend information from the Article Search API. Since I made this project in February, the clever folks at the NYT research lab have released <a href="http://nyt-trender.appspot.com/">an online tool to explore word trends</a>, but I think it&#8217;s useful to have the Processing code released for those of us who want to poke around the data in a slightly deeper way. Indeed, I hope this sketch can act as a starting point for people to take some more involved forays into the dataset &#8211; it is ripe to be customized and changed and improved.</p>
<p>This is the simplest project I&#8217;m sharing in this now multi-week source release. It should be a nice starting point for those of you who have some programming experience but haven&#8217;t done too much in the way of data visualization. As always, if you have questions, feel free to send me an e-mail or post in the comments section below.</p>
<p>You can see a whole pile of radial and standard bar graphs that I made with this sketch earlier in the year in <a href="http://www.flickr.com/photos/blprnt/sets/72157613381549987/">this Flickr set</a>.</p>
<p><strong>Getting Started:</strong></p>
<p>You&#8217;ll need the toxiclibs core, which you can <a href="http://code.google.com/p/toxiclibs/">download here</a>. Put the unzipped library into the &#8216;libraries&#8217; folder in your sketchbook (if there isn&#8217;t one already, create one).</p>
<p>Put the folder &#8216;NYT_GraphMaker&#8217; into your Processing sketch folder. Open Processing and open the sketch from the File &gt; Sketchbook menu. You&#8217;ll find detailed instructions in the header of the main tab (theNYT_GraphMaker.pde file).</p>
<p><strong>Thanks:</strong></p>
<p>It&#8217;s starting to get a bit repetitive, but once again this file depends on <a href="http://code.google.com/p/toxiclibs/">Karsten Schmidt&#8217;s toxiclib</a>s. These libraries are so good they should ship with Processing.</p>
<p><strong>Download: </strong><a href="http://www.blprnt.com/source/GraphMaker.zip">GraphMaker.zip(88k)</a></p>
<p><a href="http://creativecommons.org/licenses/GPL/2.0/"><br />
<img style="border: 0px initial initial;" src="http://creativecommons.org/images/public/cc-GPL-a.png" border="0" alt="CC-GNU GPL" /></a><br />
This software is licensed under the <a href="http://creativecommons.org/licenses/GPL/2.0/">CC-GNU GPL</a> version 2.0 or later.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blprnt.com/blog/blprnt/7-days-of-source-day-6-nytimes-graphmaker/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>7 Days of Source Day #4 &#8211; BC Budget Visualization Tool</title>
		<link>http://blog.blprnt.com/blog/blprnt/7-days-of-source-day-4-bc-budget-visualization-tool</link>
		<comments>http://blog.blprnt.com/blog/blprnt/7-days-of-source-day-4-bc-budget-visualization-tool#comments</comments>
		<pubDate>Fri, 16 Oct 2009 05:25:50 +0000</pubDate>
		<dc:creator>Jer</dc:creator>
				<category><![CDATA[Processing]]></category>
		<category><![CDATA[source code]]></category>
		<category><![CDATA[data visualization]]></category>
		<category><![CDATA[open government]]></category>
		<category><![CDATA[opensource]]></category>

		<guid isPermaLink="false">http://blog.blprnt.com/?p=930</guid>
		<description><![CDATA[Project: BC Budget Visualization Tool Date: September, 2009 Language: Processing Key Concepts: Data visualization, data organization, sticking it to the man Overview: More and more data is being released to the public every day. Big initiatives like the US data.gov and the UK&#8217;s upcoming data.hmg.gov.uk are resulting in a mountain of interesting data sets. These [...]]]></description>
			<content:encoded><![CDATA[<p><a title="BC Budget Visualization Tool by blprnt_van, on Flickr" href="http://www.flickr.com/photos/blprnt/3899788452/"><img src="http://farm3.static.flickr.com/2468/3899788452_4ce9924919.jpg" alt="BC Budget Visualization Tool" width="500" height="281" /></a></p>
<p><strong>Project</strong>: BC Budget Visualization Tool<br />
<strong>Date: </strong>September, 2009<br />
<strong>Language:</strong> <a href="http://www.processing.org">Processing</a><br />
<strong>Key Concepts:</strong> Data visualization, data organization, sticking it to the man</p>
<p><strong>Overview:</strong></p>
<p>More and more data is being released to the public every day. Big initiatives like the US <a href="http://data.gov">data.gov</a> and the UK&#8217;s upcoming <a href="http://data.hmg.gov.uk">data.hmg.gov.uk</a> are resulting in a mountain of interesting data sets. These transparency initiatives are a step in the right direction, but we are quickly going to find ourself with a surfeit of data, and a very limited number of people with the skill set to do something with it.</p>
<p>One solution to this is to standardize the data so that generic tools can be built to dig into the data sets. This is a great idea &#8211; but it will take a lot of work, along with something that governments are not typically too good at: consensus.</p>
<p>Until that happens, tools like <a href="http://www.processing.org">Processing</a> offer another solution &#8211; make small, custom tools for individual data sets which can be built quickly and can be used specifically to work with the characteristics of a specific data set. Because Processing is fairly simple, journalists, researchers and activists can all be empowered to investigate data themselves, without having to rely on expensive or difficult to acquire resources.</p>
<p>This sketch is an example of how this might work. I wanted to investigate the r<a href="http://www.stopbcartscuts.ca/">ecently announced staggering Arts &amp; Culture cuts</a> in my <a href="http://en.wikipedia.org/wiki/Moron_(psychology)">local government</a>&#8216;s budget, and built a simple tool to do that. All told, it took about 5 hours to gather the data, produce this tool and get the results out on the web &#8211; certainly a turnaround time that would be useful for media and for activists looking to be quick with their responses.</p>
<p><strong>Getting Started:</strong></p>
<p>Move the sketches into your Processing sketch folder. Open Processing and open the BCBudget sketch from the File &gt; Sketchbook menu. You&#8217;ll find detailed instructions in the header of the main tab (the BCBudget.pde file).</p>
<p><strong>Thanks:</strong></p>
<p>Again, this project uses Karsten Schmidt&#8217;s amazing and incredibly useful <a href="http://code.google.com/p/toxiclibs/">toxiclibs</a>.</p>
<p><strong>Download: </strong><a href="http://www.blprnt.com/source/BCBudget.zip">BCBudget.zip (12k)</a></p>
<p><a href="http://creativecommons.org/licenses/GPL/2.0/"><br />
<img style="border: 0px initial initial;" src="http://creativecommons.org/images/public/cc-GPL-a.png" border="0" alt="CC-GNU GPL" /></a><br />
This software is licensed under the <a href="http://creativecommons.org/licenses/GPL/2.0/">CC-GNU GPL</a> version 2.0 or later.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blprnt.com/blog/blprnt/7-days-of-source-day-4-bc-budget-visualization-tool/feed</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>7 Days of Source Day #3 &#8211; tree.growth</title>
		<link>http://blog.blprnt.com/blog/blprnt/7-days-of-source-day-3-tree-growth</link>
		<comments>http://blog.blprnt.com/blog/blprnt/7-days-of-source-day-3-tree-growth#comments</comments>
		<pubDate>Wed, 14 Oct 2009 20:38:52 +0000</pubDate>
		<dc:creator>Jer</dc:creator>
				<category><![CDATA[Processing]]></category>
		<category><![CDATA[source code]]></category>

		<guid isPermaLink="false">http://blog.blprnt.com/?p=924</guid>
		<description><![CDATA[Project: tree.growth Date: September, 2006 Language: Processing Key Concepts: Lindenmayer Systems, recursion, biomimicry Overview: NOTE: My apologies for this one being a day late. You&#8217;ll notice that I never said 7 consecutive days of source releases! Today I&#8217;m dusting off some old code, and releasing one of my favourite projects. I had hundreds of requests for source [...]]]></description>
			<content:encoded><![CDATA[<p><a title="tree.growth by blprnt_van, on Flickr" href="http://www.flickr.com/photos/blprnt/4012446566/"><img src="http://farm3.static.flickr.com/2523/4012446566_9c5a0b489b.jpg" alt="tree.growth" width="500" height="401" /></a></p>
<p><a title="tree.growth by blprnt_van, on Flickr" href="http://www.flickr.com/photos/blprnt/4012446746/"><img src="http://farm4.static.flickr.com/3522/4012446746_036284c6b1.jpg" alt="tree.growth" width="500" height="400" /></a></p>
<p><strong>Project</strong>: tree.growth<br />
<strong>Date: </strong>September, 2006<br />
<strong>Language:</strong> <a href="http://www.processing.org">Processing</a><br />
<strong>Key Concepts:</strong> Lindenmayer Systems, recursion, biomimicry</p>
<p><strong>Overview:</strong></p>
<p><em>NOTE: My apologies for this one being a day late. You&#8217;ll notice that I never said 7 consecutive days of source releases!</em></p>
<p>Today I&#8217;m dusting off some old code, and releasing one of my favourite projects. I had hundreds of requests for source over the years, and am finally making a public release.</p>
<p><em> </em></p>
<p><span style="font-style: normal;">Trees are uniquely suited to being simulated using computer graphics. Indeed, since the 1970s, methods to algorithmically render trees have been developed and refined to the point at which trees seen in high-quality scenes are very nearly photorealistic. For this project, rather than concentrating on realistic renderings, I was instead interested in how simple forms could capture the inherent &#8216;treeness&#8217; of the real thing. </span></p>
<p><span style="font-style: normal;">In pursuit of this goal, I developed a customized software engine which produced vector renderings of imaginary tree species. By adjusting parameters in the program, trees could be rendered with various leaf shapes and colours, with flowers or shedding leaves, and in virtually any shape from small shrubs to towering birches. </span></p>
<p><span style="font-style: normal;">The software uses a modified version of <a href="http://en.wikipedia.org/wiki/L-system">Lindenmayer Systems</a>, a variant of formal grammar used to model growth. L-Systems were developed by the Hungarian theoretical biologist <a href="http://en.wikipedia.org/wiki/Aristid_Lindenmayer">Aristid Lindenmayer</a>.</span></p>
<p><span style="font-style: normal;">This release version doesn&#8217;t have bitmap or vector output built in, but it would be fairly trivial to get this hooked up and working to output high-resolution bitmaps (using <a href="http://workshop.evolutionzone.com/2007/03/24/code-tilesaverpde/">Marius Watz&#8217; TileSaver class</a>) or .PDFs (using the standard Processing PDF library).</span></p>
<p><span style="font-style: normal;">Archive quality prints from this series are available in </span><a href="http://blprnt.etsy.com"><span style="font-style: normal;">my Etsy store</span></a><span style="font-style: normal;">.</span></p>
<p><span style="font-style: normal;">Finally, this code was written in 2005 &#8211; so there is a lot of room for optimization and improvement. If you end up using or improving the code for this project, please <a href="mailto:blprnt@blprnt.com">let me know</a>.</span></p>
<p><strong>Getting Started:</strong></p>
<p>Move the sketches into your Processing sketch folder. Open Processing and open the treegrowth sketch from the File &gt; Sketchbook menu. You&#8217;ll find detailed instructions in the header of the main tab (the treegrowth.pde file).</p>
<p><strong>Thanks:</strong></p>
<p>When I was getting started with Processing, I got a lot of help from the community over at <a href="http://processing.org">Processing.org</a>. I&#8217;d also like to thank Casey and Ben and all of the Processing team who have put so many hours into making this tool. It really is something special.</p>
<p><strong>Download: </strong><a href="http://www.blprnt.com/source/tree_growth.zip">tree_growth.zip (140k)</a></p>
<p><a href="http://creativecommons.org/licenses/GPL/2.0/"><br />
<img style="border: 0px initial initial;" src="http://creativecommons.org/images/public/cc-GPL-a.png" border="0" alt="CC-GNU GPL" /></a><br />
This software is licensed under the <a href="http://creativecommons.org/licenses/GPL/2.0/">CC-GNU GPL</a> version 2.0 or later.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blprnt.com/blog/blprnt/7-days-of-source-day-3-tree-growth/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>7 Days of Source Day #2: NYTimes 365/360</title>
		<link>http://blog.blprnt.com/blog/blprnt/7-days-of-source-day-2-nytimes-36536</link>
		<comments>http://blog.blprnt.com/blog/blprnt/7-days-of-source-day-2-nytimes-36536#comments</comments>
		<pubDate>Mon, 12 Oct 2009 11:30:14 +0000</pubDate>
		<dc:creator>Jer</dc:creator>
				<category><![CDATA[Processing]]></category>
		<category><![CDATA[source code]]></category>
		<category><![CDATA[dataviz]]></category>
		<category><![CDATA[infoviz]]></category>
		<category><![CDATA[nytimes]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://blog.blprnt.com/?p=917</guid>
		<description><![CDATA[Project: NYTimes 365/360 Date: February, 2009 Language: Processing Key Concepts: Data Visualization, NYTimes Article Search API, HashMaps &#38; ArrayLists Overview: Many have you have already seen the series of visualizations that I created early in the year using the newly-released New York Times APIs. The most complex of these were in the 365/360 series in [...]]]></description>
			<content:encoded><![CDATA[<p><a title="NYTimes: 365/360 - 2009 (in color) by blprnt_van, on Flickr" href="http://www.flickr.com/photos/blprnt/3291287830/"><img src="http://farm4.static.flickr.com/3649/3291287830_287591aace.jpg" alt="NYTimes: 365/360 - 2009 (in color)" width="500" height="500" /></a></p>
<p><strong>Project</strong>: NYTimes 365/360<br />
<strong>Date: </strong>February, 2009<br />
<strong>Language:</strong> <a href="http://www.processing.org">Processing</a><br />
<strong>Key Concepts:</strong> Data Visualization, NYTimes Article Search API, HashMaps &amp; ArrayLists</p>
<p><strong>Overview:</strong></p>
<p>Many have you have already seen the <a href="http://www.flickr.com/photos/blprnt/sets/72157613381549987/">series of visualizations</a> that I created early in the year using the newly-released <a href="http://developer.nytimes.com/">New York Times APIs</a>. The most complex of these were in the 365/360 series in which I tried to distill an entire year of news stories into a single graphic. The resulting visualizations (2009 is picture above) capture the complex relationships &#8211; and somewhat tangled mess &#8211; that is a year in the news.</p>
<p>This release is a single sketch. I&#8217;ll be releasing the Article Search API Processing code as a library later in the week, but I wanted to show this project as it sits, with all of the code intact. The output from this sketch is a set of .PDFs which are suitable for print. Someday I&#8217;d like to show the entire series of these as a set of 6&#8242; x 6&#8242; prints &#8211; of course, someday I&#8217;d also like a solid-gold skateboard and a castle made of cheese.</p>
<p>That said, really nice, archival quality prints from this project (and the one I&#8217;ll be releasing tomorrow) are for sale in <a href="http://blprnt.etsy.com">my Etsy shop</a>. I realize that you&#8217;ll all be able to make your own prints now (and you are certainly welcome to do so) &#8211; but if you really enjoy the work and want to have a signed print to hang on your wall, you know who to talk to.</p>
<p><strong>Getting Started:</strong></p>
<p>Put the folder &#8216;NYT_365_360&#8242; into your Processing sketch folder. Open Processing and open the sketch from the File &gt; Sketchbook menu. You&#8217;ll find detailed instructions in the header of the main tab (the NYT_365_360.pde file).</p>
<p><strong>Thanks:</strong></p>
<p>Most of the credit for this sketch goes to the clever kids at the NYT who made the amazing Article Search API. This is the gold standard of APIs, and really is a dream to use. As you&#8217;ll see if you dig into the code, each of these complicated graphics is made with just 21 calls to the API. I can&#8217;t imagine the amount of blood, sweat, and tears that would go into making a graphic like this the old-fashioned way.</p>
<p>Speaking of gold standards,<a href="http://www.flight404.com"> </a><a href="http://flight404.com">Robert Hodgin</a> got me pointed to ArrayLists in the first place, and has been helpful many times over the last few years as I&#8217;ve tried to solve a series of ridiculously simple problems in Processing. Thanks, Robert!</p>
<p><strong>Download:</strong> <a href="http://www.blprnt.com/source/NYT365.zip">NYT365.zip (140k)</a></p>
<p><a href="http://creativecommons.org/licenses/GPL/2.0/"><br />
<img style="border: 0px initial initial;" src="http://creativecommons.org/images/public/cc-GPL-a.png" border="0" alt="CC-GNU GPL" /></a><br />
This software is licensed under the <a href="http://creativecommons.org/licenses/GPL/2.0/">CC-GNU GPL</a> version 2.0 or later.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blprnt.com/blog/blprnt/7-days-of-source-day-2-nytimes-36536/feed</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
	</channel>
</rss>
