<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>b.l.o.g.</title>
	<atom:link href="http://610design.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://610design.wordpress.com</link>
	<description>Blog for Ben Leduc-Mills and 610 Design</description>
	<lastBuildDate>Sun, 04 May 2008 23:36:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='610design.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>b.l.o.g.</title>
		<link>http://610design.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://610design.wordpress.com/osd.xml" title="b.l.o.g." />
	<atom:link rel='hub' href='http://610design.wordpress.com/?pushpress=hub'/>
		<item>
		<title>MAPP Website is operational</title>
		<link>http://610design.wordpress.com/2008/05/04/mapp-website-is-operational/</link>
		<comments>http://610design.wordpress.com/2008/05/04/mapp-website-is-operational/#comments</comments>
		<pubDate>Sun, 04 May 2008 23:36:49 +0000</pubDate>
		<dc:creator>610design</dc:creator>
				<category><![CDATA[Drawing Machine]]></category>
		<category><![CDATA[Physical Computing]]></category>
		<category><![CDATA[Programming A to Z]]></category>
		<category><![CDATA[Thesis]]></category>

		<guid isPermaLink="false">http://610design.wordpress.com/?p=44</guid>
		<description><![CDATA[MAPP (Mechanical Art Production Platform) now has its very own web space at my website . Woo! Anyway, there&#8217;s a lot of writing on there about the machine, the process, etc. Plus some pictures and even a video of the damn thing working. How about that. Also, MAPP will be displayed at the ITP Spring [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=610design.wordpress.com&amp;blog=1752276&amp;post=44&amp;subd=610design&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>MAPP (Mechanical Art Production Platform) now has its very own web space at <a href="http://www.610-design.com/mapp.html">my website</a> .   Woo!  Anyway, there&#8217;s a lot of writing on there about the machine, the process, etc.  Plus some pictures and even a video of the damn thing working.  How about that.</p>
<p>Also, MAPP will be displayed at the ITP Spring Show (Monday May 12th and Tuesday May 13th, 5-9PM) @ 721 Broadway.  The show is free and open to the public.</p>
<p>Finally, if you would like to see the thesis presentation of MAPP, it will streamed live from ITP on Thursday, MAY 8th at Noon.  Check itp.nyu.edu for more details.</p>
<p>Cheers.\</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/610design.wordpress.com/44/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/610design.wordpress.com/44/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/610design.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/610design.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/610design.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/610design.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/610design.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/610design.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/610design.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/610design.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/610design.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/610design.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/610design.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/610design.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/610design.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/610design.wordpress.com/44/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=610design.wordpress.com&amp;blog=1752276&amp;post=44&amp;subd=610design&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://610design.wordpress.com/2008/05/04/mapp-website-is-operational/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/713080f9d6cddca35771bc2f9087cfef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">610design</media:title>
		</media:content>
	</item>
		<item>
		<title>Final Proposal &#8211; A2Z</title>
		<link>http://610design.wordpress.com/2008/04/11/final-proposal-a2z/</link>
		<comments>http://610design.wordpress.com/2008/04/11/final-proposal-a2z/#comments</comments>
		<pubDate>Fri, 11 Apr 2008 13:29:51 +0000</pubDate>
		<dc:creator>610design</dc:creator>
				<category><![CDATA[Drawing Machine]]></category>
		<category><![CDATA[Programming A to Z]]></category>
		<category><![CDATA[Thesis]]></category>

		<guid isPermaLink="false">http://610design.wordpress.com/?p=43</guid>
		<description><![CDATA[For my A2Z final I will be writing a custom library of drawing commands for my drawing machine.  The commands will be written in C, for Arduino, and will translate custom G-Code commands from a text file, through a Processing sketch which reads the commands in and sends them out line by line. Here is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=610design.wordpress.com&amp;blog=1752276&amp;post=43&amp;subd=610design&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For my A2Z final I will be writing a custom library of drawing commands for my drawing machine.  The commands will be written in C, for Arduino, and will translate custom G-Code commands from a text file, through a Processing sketch which reads the commands in and sends them out line by line.</p>
<p>Here is the code for some early commands I have been working on:</p>
<p>case 5:<br />
p.x = (long)(search_string(&#8216;X&#8217;, instruction, size) * x_units);<br />
p.y = (long)(search_string(&#8216;Y&#8217;, instruction, size) * y_units);<br />
p.z = (long)(search_string(&#8216;Z&#8217;, instruction, size) * z_units);</p>
<p>x.setTarget(x.current + p.x);<br />
ddaMove();<br />
y.setTarget(y.current + p.y);<br />
ddaMove();<br />
x.setTarget(x.current &#8211; p.x);<br />
ddaMove();<br />
y.setTarget(y.current &#8211; p.y);<br />
ddaMove();<br />
break;</p>
<p>//Custom 2<br />
case 6:<br />
p.x = (long)(search_string(&#8216;X&#8217;, instruction, size) * x_units);<br />
p.y = (long)(search_string(&#8216;Y&#8217;, instruction, size) * y_units);<br />
p.z = (long)(search_string(&#8216;Z&#8217;, instruction, size) * z_units);</p>
<p>for (int op = 0; op &lt; 4; op++) {</p>
<p>x.setTarget(x.current + p.x * 2);<br />
ddaMove();<br />
y.setTarget(y.current + p.y * 2);<br />
ddaMove();<br />
x.setTarget(x.current &#8211; p.x);<br />
ddaMove();<br />
y.setTarget(y.current &#8211; p.y);<br />
ddaMove();</p>
<p>}</p>
<p>break;</p>
<p>//Custom 3<br />
case 7:</p>
<p>p.x = (long)(search_string(&#8216;X&#8217;, instruction, size) * x_units);<br />
p.y = (long)(search_string(&#8216;Y&#8217;, instruction, size) * y_units);<br />
p.z = (long)(search_string(&#8216;Z&#8217;, instruction, size) * z_units);</p>
<p>for (int op = 0; op &lt; 4; op++) {</p>
<p>int num = 2;</p>
<p>x.setTarget(x.current + p.x * num);<br />
ddaMove();<br />
y.setTarget(y.current + p.y * num);<br />
ddaMove();<br />
x.setTarget(x.current &#8211; p.x);<br />
ddaMove();<br />
y.setTarget(y.current &#8211; p.y);<br />
ddaMove();</p>
<p>//num++;</p>
<p>}</p>
<p>break;</p>
<p>More commands to come as well as a homing function and edge detection.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/610design.wordpress.com/43/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/610design.wordpress.com/43/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/610design.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/610design.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/610design.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/610design.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/610design.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/610design.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/610design.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/610design.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/610design.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/610design.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/610design.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/610design.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/610design.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/610design.wordpress.com/43/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=610design.wordpress.com&amp;blog=1752276&amp;post=43&amp;subd=610design&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://610design.wordpress.com/2008/04/11/final-proposal-a2z/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/713080f9d6cddca35771bc2f9087cfef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">610design</media:title>
		</media:content>
	</item>
		<item>
		<title>The Annoying Little Brother Program</title>
		<link>http://610design.wordpress.com/2008/03/25/the-annoying-little-brother-program/</link>
		<comments>http://610design.wordpress.com/2008/03/25/the-annoying-little-brother-program/#comments</comments>
		<pubDate>Tue, 25 Mar 2008 19:26:37 +0000</pubDate>
		<dc:creator>610design</dc:creator>
				<category><![CDATA[Programming A to Z]]></category>

		<guid isPermaLink="false">http://610design.wordpress.com/2008/03/25/the-annoying-little-brother-program/</guid>
		<description><![CDATA[This program takes in a text file and break it up into words.  It then finds, for each word, a different word that sounds like it, and prints them both out.  It&#8217;s like a little brother following you around&#8230;. Here&#8217;s the code: package misc.rita; import java.io.IOException; import rita.RiLexicon; import rita.RiMarkov; import a2z.A2ZFileReader; public class Blm272_Week8_Rita [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=610design.wordpress.com&amp;blog=1752276&amp;post=42&amp;subd=610design&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This program takes in a text file and break it up into words.  It then finds, for each word, a different word that sounds like it, and prints them both out.  It&#8217;s like a little brother following you around&#8230;.</p>
<p>Here&#8217;s the code:</p>
<p>package misc.rita;</p>
<p>import java.io.IOException;</p>
<p>import rita.RiLexicon;<br />
import rita.RiMarkov;</p>
<p>import a2z.A2ZFileReader;</p>
<p>public class Blm272_Week8_Rita {</p>
<p>//static String content;</p>
<p>public static void main(String[] args) throws IOException {</p>
<p>A2ZFileReader fr = new A2ZFileReader(&#8220;data/obama.txt&#8221;);</p>
<p>RiLexicon lexicon = new RiLexicon(null);</p>
<p>//String regex = &#8220;\\b&#8221;;<br />
String[] words = fr.getContent().split(&#8221; &#8220;);</p>
<p>for (int j = 0; j &lt; words.length; j++){</p>
<p>String content = words[j].toString();<br />
System.out.println(&#8220;Content:&#8221; + &#8221; &#8221; + content);<br />
//markov.loadString(content, 1);</p>
<p>for (int c = 0; c &lt; 1; c++){<br />
String[] rhymes = lexicon.similarBySound(content);</p>
<p>if (rhymes != null) {<br />
String rhyme = rhymes[(int) Math.random()*rhymes.length];<br />
System.out.println(&#8220;Sounds like:&#8221; + &#8221; &#8221; + rhyme);</p>
<p>//System.out.println(&#8220;Sounds like: &#8221; + rhymes[(int) Math.random()*rhymes.length]);<br />
//for (int r = 0; r &lt; rhymes.length; r++) {<br />
//System.out.println(&#8220;Sounds like:&#8221; + &#8221; &#8221; + rhymes[r]);<br />
//j++;<br />
//}<br />
}</p>
<p>}</p>
<p>}<br />
}</p>
<p>}</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/610design.wordpress.com/42/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/610design.wordpress.com/42/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/610design.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/610design.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/610design.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/610design.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/610design.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/610design.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/610design.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/610design.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/610design.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/610design.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/610design.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/610design.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/610design.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/610design.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=610design.wordpress.com&amp;blog=1752276&amp;post=42&amp;subd=610design&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://610design.wordpress.com/2008/03/25/the-annoying-little-brother-program/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/713080f9d6cddca35771bc2f9087cfef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">610design</media:title>
		</media:content>
	</item>
		<item>
		<title>Social Software 4 x 4 : 3.9.08</title>
		<link>http://610design.wordpress.com/2008/03/09/social-software-4-x-4-3908/</link>
		<comments>http://610design.wordpress.com/2008/03/09/social-software-4-x-4-3908/#comments</comments>
		<pubDate>Sun, 09 Mar 2008 18:32:48 +0000</pubDate>
		<dc:creator>610design</dc:creator>
				<category><![CDATA[RapHappy]]></category>
		<category><![CDATA[Social Software Studio]]></category>

		<guid isPermaLink="false">http://610design.wordpress.com/?p=41</guid>
		<description><![CDATA[1. What I did last week: I formatted the screen layout (what info goes where), which in turn helped to clarify some aspects of the user interaction process.  Figured out some of the remaining gameplay (high scores displayed by username, not on rap-by-rap basis).  Thought about how to get people to use it.  Set up [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=610design.wordpress.com&amp;blog=1752276&amp;post=41&amp;subd=610design&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1. What I did last week:</p>
<p>I formatted the screen layout (what info goes where), which in turn helped to clarify some aspects of the user interaction process.  Figured out some of the remaining gameplay (high scores displayed by username, not on rap-by-rap basis).  Thought about how to get people to use it.  Set up a test server space to begin programming.</p>
<p>2. What I intend to do this week:</p>
<p>Organize a group to paper prototype the gameplay &#8211; free beer?  The goal is to figure out what will make people want to participate, which right now seems to be the big question.  Make changes to the design based on the observations.</p>
<p>3.  Concerns or unexpected obstacles:</p>
<p>Obviously, I am concerned about solving the motivation question.  My other serious concern is whether I can complete this assignment and my thesis at the same time.</p>
<p>4.  Recent insights or surprises:</p>
<p>Getting people excited about a game on the internet is hard.   Surprisingly hard.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/610design.wordpress.com/41/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/610design.wordpress.com/41/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/610design.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/610design.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/610design.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/610design.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/610design.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/610design.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/610design.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/610design.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/610design.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/610design.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/610design.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/610design.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/610design.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/610design.wordpress.com/41/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=610design.wordpress.com&amp;blog=1752276&amp;post=41&amp;subd=610design&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://610design.wordpress.com/2008/03/09/social-software-4-x-4-3908/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/713080f9d6cddca35771bc2f9087cfef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">610design</media:title>
		</media:content>
	</item>
		<item>
		<title>Midterm Visualizations</title>
		<link>http://610design.wordpress.com/2008/03/03/midterm-visualizations/</link>
		<comments>http://610design.wordpress.com/2008/03/03/midterm-visualizations/#comments</comments>
		<pubDate>Tue, 04 Mar 2008 02:50:35 +0000</pubDate>
		<dc:creator>610design</dc:creator>
				<category><![CDATA[610 Design]]></category>
		<category><![CDATA[Programming A to Z]]></category>
		<category><![CDATA[Thesis]]></category>

		<guid isPermaLink="false">http://610design.wordpress.com/?p=36</guid>
		<description><![CDATA[For my A-Z Midterm (and in preparation for my thesis), I did four different visualizations based off the same process of entering a single URL into a page scraper, which in turn generates a text file with the result (a concordance list of the words and how many times they appeared on the page).  These [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=610design.wordpress.com&amp;blog=1752276&amp;post=36&amp;subd=610design&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For my A-Z Midterm (and in preparation for my thesis), I did four different visualizations based off the same process of entering a single URL into a page scraper, which in turn generates a text file with the result (a concordance list of the words and how many times they appeared on the page).  These four visualization were generated using the myspace.com homepage.</p>
<p>The four different visualizations make use of this information by reading in the text file and drawing the text in different ways, making use of the text itself, the frequency of the word in the text, the length of the word, and the physical width of the word itself as different variables.</p>
<p>Here are some screen shots:</p>
<p><a href="http://610design.files.wordpress.com/2008/03/picture-1.png" title="Direct link to file"><img src="http://610design.files.wordpress.com/2008/03/picture-1.thumbnail.png?w=171&#038;h=120" alt="picture-1.png" height="120" width="171" /></a></p>
<p><a href="http://610design.files.wordpress.com/2008/03/picture-2.png" title="picture-2.png"><img src="http://610design.files.wordpress.com/2008/03/picture-2.thumbnail.png?w=418" alt="picture-2.png" /></a></p>
<p><a href="http://610design.files.wordpress.com/2008/03/picture-3.png" title="picture-3.png"><img src="http://610design.files.wordpress.com/2008/03/picture-3.thumbnail.png?w=418" alt="picture-3.png" /></a></p>
<p><a href="http://610design.files.wordpress.com/2008/03/picture-4.png" title="picture-4.png"><img src="http://610design.files.wordpress.com/2008/03/picture-4.thumbnail.png?w=418" alt="picture-4.png" /></a></p>
<p>Here&#8217;s some example code for this last one, just to give an idea:</p>
<p>package concordance.processing;</p>
<p>//import java.awt.Font;<br />
//import java.awt.Graphics;<br />
import java.io.*;<br />
//import java.lang.reflect.Array;<br />
import java.util.*;<br />
import java.util.regex.*;</p>
<p>import a2z.*;<br />
import concordance.processing.Word;<br />
import processing.core.PApplet;<br />
import processing.core.PFont;</p>
<p>public class DrawText4 extends PApplet {</p>
<p>ArrayList words;<br />
PFont f;<br />
float r;</p>
<p>public static void main(String[] args) {<br />
PApplet.main(new String[] {&#8220;concordance.processing.DrawText4&#8243;});<br />
}</p>
<p>public void setup() {<br />
size(1000,720);<br />
words = new ArrayList();<br />
fillConcordance(&#8220;test.txt&#8221;);<br />
f = createFont(&#8220;Georgia&#8221;,64,true);<br />
//textFont(f);</p>
<p>}</p>
<p>public void draw() {<br />
background(50);<br />
//10 boxes along the curve<br />
int totalBoxes = 10;<br />
// We must keep track of our position along the curve<br />
float arclength = 0;</p>
<p>translate(width/2,height/2);<br />
// We&#8217;re done, print out contents of Tree!</p>
<p>//System.out.println(&#8220;Here are the contents of your tree:&#8221;);<br />
//Iterator iterator = words.values().iterator();<br />
Iterator iterator = words.iterator();<br />
r = 160;//values + 1000;<br />
while (iterator.hasNext()) {</p>
<p>Word word = (Word) iterator.next();<br />
println(word.getCount());<br />
r = word.getCount()*100;</p>
<p>String output = word.getWord();<br />
int values = word.getCount();<br />
float length = output.length();</p>
<p>textFont(f, (values*length)*values);<br />
//for (int i = 0; i &lt; output.length(); i++)<br />
//{<br />
// The character and its width<br />
//char currentChar = output.charAt(i);<br />
//float w = textWidth(currentChar);<br />
float w = textWidth(output);</p>
<p>// Each box is centered so we move half the width<br />
arclength += w/2;<br />
// Angle in radians is the arclength divided by the radius<br />
// Starting on the left side of the circle by adding PI<br />
float theta = PI + arclength / r;</p>
<p>pushMatrix();<br />
// Polar to cartesian coordinate conversion<br />
translate(r*cos(theta), r*sin(theta));<br />
// Rotate the box<br />
rotate(theta+PI/2); // rotation is offset by 90 degrees<br />
// Display the character (darker = lower count)<br />
fill(values+w);</p>
<p>text(output,0,0);//random(10),random(180));<br />
popMatrix();<br />
// Move halfway again<br />
arclength += w/2;<br />
//}</p>
<p>r+= 1;</p>
<p>}</p>
<p>noLoop();<br />
}<br />
//}</p>
<p>public void fillConcordance(String path) {<br />
String[] lines = loadStrings(path);<br />
for (int i = 0; i &lt; lines.length; i++) {<br />
String line = lines[i];<br />
String[] stuff = line.split(&#8221; &#8220;);<br />
Word w = new Word(stuff[0]);<br />
w.setCount(Integer.parseInt(stuff[1]));<br />
words.add(w);<br />
}<br />
}</p>
<p>}</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/610design.wordpress.com/36/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/610design.wordpress.com/36/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/610design.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/610design.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/610design.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/610design.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/610design.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/610design.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/610design.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/610design.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/610design.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/610design.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/610design.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/610design.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/610design.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/610design.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=610design.wordpress.com&amp;blog=1752276&amp;post=36&amp;subd=610design&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://610design.wordpress.com/2008/03/03/midterm-visualizations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/713080f9d6cddca35771bc2f9087cfef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">610design</media:title>
		</media:content>

		<media:content url="http://610design.files.wordpress.com/2008/03/picture-1.thumbnail.png" medium="image">
			<media:title type="html">picture-1.png</media:title>
		</media:content>

		<media:content url="http://610design.files.wordpress.com/2008/03/picture-2.thumbnail.png" medium="image">
			<media:title type="html">picture-2.png</media:title>
		</media:content>

		<media:content url="http://610design.files.wordpress.com/2008/03/picture-3.thumbnail.png" medium="image">
			<media:title type="html">picture-3.png</media:title>
		</media:content>

		<media:content url="http://610design.files.wordpress.com/2008/03/picture-4.thumbnail.png" medium="image">
			<media:title type="html">picture-4.png</media:title>
		</media:content>
	</item>
		<item>
		<title>Combo Web Crawler &amp; Concordance File Generator (Plus New Visualization!)</title>
		<link>http://610design.wordpress.com/2008/02/26/combo-web-crawler-concordance-file-generator-plus-new-visualization/</link>
		<comments>http://610design.wordpress.com/2008/02/26/combo-web-crawler-concordance-file-generator-plus-new-visualization/#comments</comments>
		<pubDate>Tue, 26 Feb 2008 19:20:39 +0000</pubDate>
		<dc:creator>610design</dc:creator>
				<category><![CDATA[Drawing Machine]]></category>
		<category><![CDATA[Programming A to Z]]></category>

		<guid isPermaLink="false">http://610design.wordpress.com/?p=35</guid>
		<description><![CDATA[So this week I made a java script that asks for a url and scrapes it for all the words while outputting a text file with the words and word count.  I also worked on a more complicated text visualization using arcs and colors and whatnot. Web Crawler+Concordance Code: // Part 1: Front End Script [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=610design.wordpress.com&amp;blog=1752276&amp;post=35&amp;subd=610design&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So this week I made a java script that asks for a url and scrapes it for all the words while outputting a text file with the words and word count.  I also worked on a more complicated text visualization using arcs and colors and whatnot.</p>
<p>Web Crawler+Concordance Code:<br />
// Part 1: Front End Script that asks for the url<br />
// Web Crawler driver program</p>
<p>package crawler;</p>
<p>import java.io.IOException;</p>
<p>//import a2z.A2ZFileWriter;<br />
import a2z.ConsoleReader;<br />
//import crawler.DrawBot;</p>
<p>public class Blm272_Week5 {</p>
<p>public static void main (String args[]) throws IOException {</p>
<p>ConsoleReader console = new ConsoleReader(System.in);<br />
System.out.println(&#8220;Enter a url for input: &#8220;);<br />
System.out.print(&#8220;%: &#8220;);<br />
String url = console.readLine();<br />
// A URL to start wtih<br />
//String url = &#8220;http://itp.nyu.edu/blogblender&#8221;;</p>
<p>// Create a crawler object<br />
DrawCrawler crawler = new DrawCrawler();</p>
<p>// Put the URL into the crawler object<br />
crawler.addUrl(url);</p>
<p>// Since this crawler isn&#8217;t particularly polite: http://www.robotstxt.org/wc/guidelines.html<br />
// I&#8217;m limited it to viewing 100 url requests<br />
int count = 0; int limit = 0;</p>
<p>// Start crawling! (this should likely be its own thread.)<br />
while (!crawler.queueEmpty()) {<br />
crawler.crawl();<br />
count++;<br />
if (count &gt; limit) break;<br />
}</p>
<p>// If we end up here, there must be nothing left to crawl.<br />
if (count &lt; limit) System.out.println(&#8220;I ran out of websites to crawl.&#8221;);<br />
else System.out.println(&#8220;I&#8217;m tired and don&#8217;t feel like crawling anymore.&#8221;);</p>
<p>}</p>
<p>}</p>
<p>&#8212;&#8212;&#8212;&#8212;</p>
<p>//Part 2: The Edited Crawler (DrawCrawler) that outputs the concordance file<br />
//Simple example of a web crawler<br />
//URL queue: linked list<br />
//Sites already visited: hash table</p>
<p>//Needs to be updated to comply with ROBOTS.TXT!</p>
<p>package crawler;</p>
<p>import java.io.FileNotFoundException;<br />
import java.io.IOException;<br />
import java.util.*;<br />
import java.util.regex.*;</p>
<p>import processing.core.PApplet;<br />
import processing.core.PFont;</p>
<p>import concordance.treemap.Word;</p>
<p>import a2z.A2ZFileReader;<br />
import a2z.A2ZFileWriter;<br />
import a2z.A2ZUrlReader;<br />
import a2z.ConsoleReader;</p>
<p>public class DrawCrawler {</p>
<p>private LinkedList urlsToVisit;    // A queue of URLs to visit<br />
private HashMap urlsVisited;        // A table of already visited URLs<br />
private Pattern href;                        // A Pattern to match an href tag<br />
private String ignore;                    // To be used as a regex for ignoring media files (JPG,MOV, etc.)</p>
<p>public DrawCrawler() {<br />
urlsToVisit = new LinkedList();<br />
urlsVisited = new HashMap();</p>
<p>// Match URLs<br />
// Note using Pattern.COMMENTS flag which ignores white spaces and anything after &#8216;#&#8217; in a regex<br />
href = Pattern.compile(<br />
&#8220;href                    # match href n&#8221; +<br />
&#8220;\s*=\s*&#8221;            # 0 or more spaces, =, 0 ore more spaces, quote n&#8221; +<br />
&#8220;(http[^"\s]*)        # capture the URL itself, http followed by no spaces and no quotes n&#8221; +<br />
&#8220;&#8221;                        # ending with a quote n&#8221;,</p>
<p>Pattern.CASE_INSENSITIVE | Pattern.COMMENTS);</p>
<p>// We will ignore URLs ending with certain extensions<br />
ignore = &#8220;.*(mov|jpg|gif|pdf)$&#8221;;<br />
}</p>
<p>// A method to determine if the queue is empty or not<br />
public boolean queueEmpty() {<br />
return urlsToVisit.isEmpty();<br />
}</p>
<p>// A method to crawl one URL<br />
public void crawl() {<br />
// Get a URL in the queue<br />
String urlpath = (String) urlsToVisit.removeFirst();<br />
// Read that URL<br />
read(urlpath);<br />
}</p>
<p>public void addUrl(String urlpath) {<br />
// We can filter out certain kinds of URLs here<br />
// In this example, our only critera is<br />
// it matches the ignore pattern<br />
if (!urlpath.matches(ignore)) {<br />
// Add it to both the LinkedList and the HashMap<br />
urlsToVisit.add(urlpath);<br />
urlsVisited.put(urlpath,urlpath);<br />
}<br />
}</p>
<p>public void process(String content, String urlpath) throws IOException {<br />
// This example just searches for web sites with the word &#8220;ITP&#8221; in them<br />
// We could throw all the words into a concordance here<br />
// Or implement some other type of storage / analysis algorithm<br />
// Trivial example, searching for ITP<br />
//Pattern p = Pattern.compile(&#8220;itp&#8221;,Pattern.CASE_INSENSITIVE);<br />
//Matcher m = p.matcher(content);<br />
//if (m.find()) {<br />
//System.out.println(urlpath + &#8221; contains ITP!&#8221;);</p>
<p>TreeMap words = new TreeMap();</p>
<p>// Step 3, break input file up into words<br />
// We are doing this with split and a regular expression<br />
String regex = &#8220;\b&#8221;;<br />
String tokens[] = content.split(regex);</p>
<p>// We&#8217;ll use a regular exrpession to match words with only characters and apostrophes<br />
// Throwing away all the punctuation (we could do this with a different split regex too)<br />
Pattern p = Pattern.compile(&#8220;[a-z']+&#8221;,Pattern.CASE_INSENSITIVE);</p>
<p>// For every word<br />
for (int i = 0; i &lt; tokens.length; i++)<br />
{<br />
String s = tokens[i].toLowerCase();<br />
// If it matches our regex, insert it in the tree<br />
Matcher m = p.matcher(s);<br />
if (m.matches()) {<br />
if (words.containsKey(s)) {<br />
Word w = (Word) words.get(s);<br />
w.count();<br />
} else {<br />
Word w = new Word(s);<br />
words.put(s,w);<br />
}<br />
}<br />
}</p>
<p>// We&#8217;re done, print out contents of Tree!<br />
System.out.println(&#8220;Here are the contents of your tree:&#8221;);<br />
A2ZFileWriter fw = new A2ZFileWriter(&#8220;test.txt&#8221;);<br />
Iterator iterator = words.values().iterator();<br />
while (iterator.hasNext()) {<br />
Word word = (Word) iterator.next();<br />
System.out.println(word.getWord() + &#8221; &#8221; + word.getCount());<br />
//System.out.println(word.getWord());<br />
//String whatever = (word.getWord() + &#8221; &#8221; + word.getCount());<br />
//fw.append(whatever);<br />
fw.append(word.getWord() + &#8221; &#8221; + word.getCount());<br />
fw.append(&#8221; &#8220;);<br />
fw.append(&#8220;r&#8221;);</p>
<p>}<br />
fw.close();<br />
System.out.println(&#8220;Total words: &#8221; + words.size());</p>
<p>//float elapsed = (System.currentTimeMillis() &#8211; thetime) / 1000.0f;;<br />
//System.out.println(&#8220;Finished.  Concordance time: &#8221; + elapsed + &#8221; seconds.&#8221;);</p>
<p>}</p>
<p>// A method to read a URL and look for other URLs<br />
// (and possibly do some sort of analysis)<br />
public void read(String urlpath) {</p>
<p>System.out.println(urlsToVisit.size() + &#8221; &#8221; + urlpath);<br />
try {<br />
// Grab the URL content<br />
A2ZUrlReader urlr = new A2ZUrlReader(urlpath);<br />
String stuff = urlr.getContent();</p>
<p>process(stuff, urlpath);</p>
<p>// Match the URL pattern to the content<br />
Matcher m = href.matcher(stuff);<br />
// While there are URLs<br />
while (m.find()) {<br />
// Grab the captured part of the regex (the URLPath itself)<br />
String newurl = m.group(1);<br />
if (!urlsVisited.containsKey(newurl)) {<br />
addUrl(newurl);<br />
}<br />
}<br />
} catch (Exception e) {<br />
// System.out.println(&#8220;Problem reading from &#8221; + urlpath + &#8221; &#8221; + e);<br />
// e.printStackTrace();<br />
}</p>
<p>}<br />
}</p>
<p>&#8212;&#8211;</p>
<p>The Updated Drawing Code:</p>
<p>/* Ben Leduc-Mills               */<br />
/* Programming from A to Z       */<br />
/* Simple Text Concordance and text cloud      */<br />
/* Using a Java TreeMap          */<br />
/* Based on code by Dan Shiffman */</p>
<p>package concordance.processing;</p>
<p>//import java.awt.Font;<br />
//import java.awt.Graphics;<br />
import java.io.*;<br />
//import java.lang.reflect.Array;<br />
import java.util.*;<br />
import java.util.regex.*;<br />
import a2z.*;<br />
import processing.core.PApplet;<br />
import processing.core.PFont;</p>
<p>public class DrawText extends PApplet<br />
{<br />
ArrayList words;<br />
PFont f;</p>
<p>public void setup() {<br />
size(1000,1000);<br />
words = new ArrayList();<br />
fillConcordance(&#8220;test.txt&#8221;);<br />
f = createFont(&#8220;Georgia&#8221;,16,true);</p>
<p>}</p>
<p>public void draw() {<br />
background(255);<br />
// We&#8217;re done, print out contents of Tree!<br />
// We&#8217;re done, print out contents of Tree!<br />
//System.out.println(&#8220;Here are the contents of your tree:&#8221;);<br />
Iterator iterator = words.iterator();<br />
while (iterator.hasNext()) {<br />
Word word = (Word) iterator.next();</p>
<p>String output = word.getWord();<br />
int values = word.getCount();<br />
int length = output.length();<br />
//System.out.println(length);</p>
<p>/*String s = &#8220;Tokyo&#8221;;<br />
float sw = textWidth(s);<br />
text(s, 0, 85);<br />
line(sw, 50, sw, 100);*/</p>
<p>if (values &gt; 0 &amp;&amp; values &lt;3) {</p>
<p>values = values * length;<br />
}<br />
else {<br />
values = values/length;<br />
}<br />
//if (values &lt; 3) {<br />
//  values = values *(values+2);<br />
//}<br />
//System.out.println(values);</p>
<p>fill(length*values);<br />
textFont(f,values+length);<br />
float width = textWidth(output);<br />
System.out.println(width);<br />
text(output, random(length*50,650), random(40,length*80));<br />
//text (output, width*values, (5*length*values));<br />
//line (width*20, values*20, length*40, values*40);</p>
<p>//circles<br />
//fill(length*values+80);<br />
stroke(length*values+80);<br />
//strokeWeight((values+length)/4);<br />
noFill();<br />
//arc (width*10, length*10, values*10, values*10, 0, PI*2);<br />
arc (width*values,4*length*values, values *10, values*10, 0, PI*2);<br />
}<br />
noLoop();<br />
}</p>
<p>/*public void paint (Graphics g) {</p>
<p>System.out.println(&#8220;Here are the contents of your tree:&#8221;);<br />
Iterator iterator = words.values().iterator();<br />
while (iterator.hasNext()) {<br />
Word word = (Word) iterator.next();</p>
<p>//System.out.println(word.getWord() + &#8221; &#8221; + word.getCount());<br />
String output = ((word.getWord() + &#8221; &#8220;.toString()));<br />
//System.out.println(output);</p>
<p>Font font = new Font(&#8220;Dialog&#8221;, Font.PLAIN, 48);</p>
<p>g.setFont(font);<br />
g.drawString(output, 100, 100);</p>
<p>}<br />
noLoop();<br />
} */</p>
<p>public void fillConcordance(String path) {<br />
String[] lines = loadStrings(path);<br />
for (int i = 0; i &lt; lines.length; i++) {<br />
String line = lines[i];<br />
String[] stuff = line.split(&#8221; &#8220;);<br />
Word w = new Word(stuff[0]);<br />
w.setCount(Integer.parseInt(stuff[1]));<br />
words.add(w);<br />
}<br />
}<br />
}</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/610design.wordpress.com/35/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/610design.wordpress.com/35/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/610design.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/610design.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/610design.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/610design.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/610design.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/610design.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/610design.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/610design.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/610design.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/610design.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/610design.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/610design.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/610design.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/610design.wordpress.com/35/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=610design.wordpress.com&amp;blog=1752276&amp;post=35&amp;subd=610design&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://610design.wordpress.com/2008/02/26/combo-web-crawler-concordance-file-generator-plus-new-visualization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/713080f9d6cddca35771bc2f9087cfef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">610design</media:title>
		</media:content>
	</item>
		<item>
		<title>Hashtable word finder</title>
		<link>http://610design.wordpress.com/2008/02/19/hashtable-word-finder/</link>
		<comments>http://610design.wordpress.com/2008/02/19/hashtable-word-finder/#comments</comments>
		<pubDate>Tue, 19 Feb 2008 17:02:21 +0000</pubDate>
		<dc:creator>610design</dc:creator>
				<category><![CDATA[Physical Computing]]></category>
		<category><![CDATA[Programming A to Z]]></category>

		<guid isPermaLink="false">http://610design.wordpress.com/?p=34</guid>
		<description><![CDATA[So this week, in preparation for a Morse code translator and parser, I developed some code that takes in a file of gibberish characters (i.e. &#8220;afhefbufbeyioruoehfhajsofvvnmx&#8221;) and finds words by cross referencing the substrings with a hashtable of real words. The idea is that I will find a way to turn tapping into Morse code [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=610design.wordpress.com&amp;blog=1752276&amp;post=34&amp;subd=610design&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So this week, in preparation for a Morse code translator and parser, I developed some code that takes in a file of gibberish characters (i.e. &#8220;afhefbufbeyioruoehfhajsofvvnmx&#8221;) and finds words by cross referencing the substrings with a hashtable of real words.</p>
<p>The idea is that I will find a way to turn tapping into Morse code into a string of characters, and from there this code will handle the job of finding words from them.</p>
<p>Here&#8217;s the code:</p>
<p>import java.util.*;<br />
import java.io.IOException;</p>
<p>import a2z.A2ZFileReader;</p>
<p>public class Blm272_week4 {<br />
public static void main(String[] args) throws IOException {</p>
<p>Hashtable dictionary = new Hashtable();</p>
<p>A2ZFileReader fr = new A2ZFileReader(&#8220;warandpeace.txt&#8221;); //Change to dictionary later</p>
<p>// Read the content and break up into words<br />
String content = fr.getContent();</p>
<p>String regex = &#8220;\\b&#8221;;<br />
String[] words = content.split(regex);</p>
<p>for (int i = 0; i &lt; words.length; i++) {<br />
if (!dictionary.containsKey(words[i])) {<br />
//String result = words[i];<br />
dictionary.put(words[i], words[i]);<br />
}<br />
}</p>
<p>A2ZFileReader fr2 = new A2ZFileReader(&#8220;stuff.txt&#8221;); //Morse Source<br />
String word = fr2.getContent();<br />
System.out.println(&#8220;Morse:&#8221; + word);</p>
<p>//String word = &#8220;andthenasIwasstandingthereamongthetreesInoticedahummingbirdinthedistance&#8221;;</p>
<p>for (int i = 0; i &lt; word.length(); i++) {<br />
for (int j = i+1; j &lt;= word.length(); j++) {<br />
String subword = word.substring(i,j);<br />
if (dictionary.contains(subword)&amp;&amp;subword.length()&gt;3) {<br />
System.out.println(&#8220;found: &#8221; + subword);<br />
}<br />
}<br />
}<br />
}<br />
}</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/610design.wordpress.com/34/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/610design.wordpress.com/34/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/610design.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/610design.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/610design.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/610design.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/610design.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/610design.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/610design.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/610design.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/610design.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/610design.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/610design.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/610design.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/610design.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/610design.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=610design.wordpress.com&amp;blog=1752276&amp;post=34&amp;subd=610design&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://610design.wordpress.com/2008/02/19/hashtable-word-finder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/713080f9d6cddca35771bc2f9087cfef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">610design</media:title>
		</media:content>
	</item>
		<item>
		<title>The Gestalt for the upcoming RH games page</title>
		<link>http://610design.wordpress.com/2008/02/10/the-gestalt-for-the-upcoming-rh-games-page/</link>
		<comments>http://610design.wordpress.com/2008/02/10/the-gestalt-for-the-upcoming-rh-games-page/#comments</comments>
		<pubDate>Sun, 10 Feb 2008 21:58:39 +0000</pubDate>
		<dc:creator>610design</dc:creator>
				<category><![CDATA[RapHappy]]></category>
		<category><![CDATA[Social Software Studio]]></category>

		<guid isPermaLink="false">http://610design.wordpress.com/2008/02/10/the-gestalt-for-the-upcoming-rh-games-page/</guid>
		<description><![CDATA[For the RapHappy.com games page: 1. create handle 2. play a game 3. receive feedback (message, score, etc.) If course, within the actual games the gestalt might be much more complex and varied, depending upon the game. But I think for any of the games to be meaningful, there must be persistence of identity (high [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=610design.wordpress.com&amp;blog=1752276&amp;post=33&amp;subd=610design&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For the RapHappy.com games page:</p>
<p>1. create handle</p>
<p>2. play a game</p>
<p>3. receive feedback (message, score, etc.)</p>
<p>If course, within the actual games the gestalt might be much more complex and varied, depending upon the game. But I think for any of the games to be meaningful, there must be persistence of identity (high scores become hard to track otherwise…), some sotr of actual gameplay interaction, and some sort of feedback to keep the user interested (scores, messages, whatever the gameplay imples).</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/610design.wordpress.com/33/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/610design.wordpress.com/33/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/610design.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/610design.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/610design.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/610design.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/610design.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/610design.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/610design.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/610design.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/610design.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/610design.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/610design.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/610design.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/610design.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/610design.wordpress.com/33/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=610design.wordpress.com&amp;blog=1752276&amp;post=33&amp;subd=610design&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://610design.wordpress.com/2008/02/10/the-gestalt-for-the-upcoming-rh-games-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/713080f9d6cddca35771bc2f9087cfef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">610design</media:title>
		</media:content>
	</item>
		<item>
		<title>Week 3 &#8211; Text Cloud with Concordance</title>
		<link>http://610design.wordpress.com/2008/02/10/week-3-text-cloud-with-concordance/</link>
		<comments>http://610design.wordpress.com/2008/02/10/week-3-text-cloud-with-concordance/#comments</comments>
		<pubDate>Sun, 10 Feb 2008 18:08:54 +0000</pubDate>
		<dc:creator>610design</dc:creator>
				<category><![CDATA[Programming A to Z]]></category>

		<guid isPermaLink="false">http://610design.wordpress.com/?p=31</guid>
		<description><![CDATA[This week I wanted to make a text cloud using java. I used the treemap iterator to get the words and word count from the input text, then plugged in the count to determine the font size and gave the words a semi-random position on the stage. I did a version using the processing libraries [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=610design.wordpress.com&amp;blog=1752276&amp;post=31&amp;subd=610design&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This week I wanted to make a text cloud using java.  I used the treemap iterator to get the words and word count from the input text, then plugged in the count to determine the font size and gave the words a semi-random position on the stage.  I did a version using the processing libraries and one without.  The commented sections represent the pure java version.</p>
<p>Here&#8217;s the code:</p>
<p>/* Ben Leduc-Mills               */<br />
/* Programming from A to Z       */<br />
/* Simple Text Concordance and text cloud      */<br />
/* Using a Java TreeMap          */<br />
/* Based on code by Dan Shiffman */</p>
<p>package concordance.processing;</p>
<p>//import java.awt.Font;<br />
//import java.awt.Graphics;<br />
import java.io.*;<br />
//import java.lang.reflect.Array;<br />
import java.util.*;</p>
<p>import a2z.*;</p>
<p>import java.util.regex.*;</p>
<p>import concordance.treemap.Word;</p>
<p>import processing.core.PApplet;<br />
import processing.core.PFont;</p>
<p>public class blm272_week3 extends PApplet<br />
{<br />
TreeMap words;<br />
PFont f;</p>
<p>public void setup() {<br />
size(1000,1000);<br />
fillConcordance(&#8220;obama.txt&#8221;);<br />
f = createFont(&#8220;Georgia&#8221;,16,true);</p>
<p>}</p>
<p>public void draw() {<br />
background(255);<br />
// We&#8217;re done, print out contents of Tree!<br />
// We&#8217;re done, print out contents of Tree!<br />
System.out.println(&#8220;Here are the contents of your tree:&#8221;);<br />
Iterator iterator = words.values().iterator();<br />
while (iterator.hasNext()) {<br />
Word word = (Word) iterator.next();<br />
String output = word.getWord();<br />
int values = word.getCount();<br />
if (values &lt; 3) {<br />
values = values *(values+2);<br />
}<br />
//System.out.println(values);<br />
fill(0);<br />
textFont(f,values+5);<br />
text(output, random(100,650), random(100,650));<br />
}<br />
noLoop();<br />
}</p>
<p>/*public void paint (Graphics g) {</p>
<p>System.out.println(&#8220;Here are the contents of your tree:&#8221;);<br />
Iterator iterator = words.values().iterator();<br />
while (iterator.hasNext()) {<br />
Word word = (Word) iterator.next();</p>
<p>//System.out.println(word.getWord() + &#8221; &#8221; + word.getCount());<br />
String output = ((word.getWord() + &#8221; &#8220;.toString()));<br />
//System.out.println(output);</p>
<p>Font font = new Font(&#8220;Dialog&#8221;, Font.PLAIN, 48);</p>
<p>g.setFont(font);<br />
g.drawString(output, 100, 100);</p>
<p>}<br />
noLoop();<br />
} */</p>
<p>public void fillConcordance(String path) {</p>
<p>try {<br />
A2ZFileReader fr = new A2ZFileReader(path);<br />
String content = fr.getContent();</p>
<p>// Step 2, create an empty Tree<br />
words = new TreeMap();</p>
<p>// Step 3, break input file up into words<br />
// We are doing this with split and a regular expression<br />
String regex = &#8220;\\b&#8221;;<br />
String tokens[] = content.split(regex);</p>
<p>// We&#8217;ll use a regular exrpession to match words with only characters and apostrophes<br />
// Throwing away all the punctuation (we could do this with a different split regex too)<br />
Pattern p = Pattern.compile(&#8220;[a-z']+&#8221;,Pattern.CASE_INSENSITIVE);</p>
<p>// For every word<br />
for (int i = 0; i &lt; tokens.length; i++)<br />
{<br />
String s = tokens[i].toLowerCase();<br />
// If it matches our regex, insert it in the tree<br />
Matcher m = p.matcher(s);<br />
if (m.matches()) {<br />
if (words.containsKey(s)) {<br />
Word w = (Word) words.get(s);<br />
w.count();<br />
} else {<br />
Word w = new Word(s);<br />
words.put(s,w);<br />
}<br />
}<br />
}</p>
<p>} catch (IOException e) {<br />
System.out.println(&#8220;File I/O Error&#8221;);<br />
e.printStackTrace();<br />
}</p>
<p>}<br />
}</p>
<p>Here&#8217;s a screen shot of the result on an Obama speech:</p>
<p><a href="http://610design.files.wordpress.com/2008/02/treecloud.png" title="treecloud.png"><img src="http://610design.files.wordpress.com/2008/02/treecloud.png?w=619&#038;h=574" alt="treecloud.png" height="574" width="619" /></a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/610design.wordpress.com/31/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/610design.wordpress.com/31/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/610design.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/610design.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/610design.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/610design.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/610design.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/610design.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/610design.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/610design.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/610design.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/610design.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/610design.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/610design.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/610design.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/610design.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=610design.wordpress.com&amp;blog=1752276&amp;post=31&amp;subd=610design&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://610design.wordpress.com/2008/02/10/week-3-text-cloud-with-concordance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/713080f9d6cddca35771bc2f9087cfef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">610design</media:title>
		</media:content>

		<media:content url="http://610design.files.wordpress.com/2008/02/treecloud.png" medium="image">
			<media:title type="html">treecloud.png</media:title>
		</media:content>
	</item>
		<item>
		<title>Week 2: Ceiling cat sez</title>
		<link>http://610design.wordpress.com/2008/02/02/week-2-ceiling-cat-sez/</link>
		<comments>http://610design.wordpress.com/2008/02/02/week-2-ceiling-cat-sez/#comments</comments>
		<pubDate>Sun, 03 Feb 2008 01:55:46 +0000</pubDate>
		<dc:creator>610design</dc:creator>
				<category><![CDATA[Programming A to Z]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Wearables]]></category>

		<guid isPermaLink="false">http://610design.wordpress.com/?p=30</guid>
		<description><![CDATA[This week, usng regular expressions, I continued my trouncing of the bible by taking every reference to &#8216;God&#8217; and the word after it, and replacing them both with &#8216;Celing cat sez&#8217;. Hooray for lolcats. Here&#8217;s the code: // Word search and replace using regex // Ben Leduc-Mills // Programming A2Z, Spring 08 // Based off [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=610design.wordpress.com&amp;blog=1752276&amp;post=30&amp;subd=610design&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This week, usng regular expressions, I continued my trouncing of the bible by taking every reference to &#8216;God&#8217; and the word after it, and replacing them both with &#8216;Celing cat sez&#8217;.   Hooray for lolcats.</p>
<p>Here&#8217;s the code:</p>
<p>// Word search and replace using regex<br />
// Ben Leduc-Mills<br />
// Programming A2Z, Spring 08<br />
// Based off of code by Daniel Shiffman</p>
<p>import java.io.*;<br />
import java.nio.*;<br />
import java.nio.channels.*;<br />
import java.util.regex.*;</p>
<p>public class Blm272Week2 {<br />
public static void main (String[] args) throws IOException {</p>
<p>// Create an input stream and file channel<br />
// Using first arguemnt as file name to read in<br />
FileInputStream fis = new FileInputStream(args[0]);<br />
FileChannel fc = fis.getChannel();</p>
<p>// Read the contents of a file into a ByteBuffer<br />
ByteBuffer bb = ByteBuffer.allocate((int)fc.size());<br />
fc.read(bb);<br />
fc.close();</p>
<p>// Convert ByteBuffer to one long String<br />
String content = new String(bb.array());</p>
<p>String[] words = content.split(&#8220;\\b&#8221;);<br />
System.out.println(&#8220;Read &#8221; + words.length + &#8221; words from &#8221; + args[0]);<br />
StringBuffer reverse = new StringBuffer();<br />
for (int i = 0; i &lt; words.length; i++) {<br />
String word = words[i];<br />
reverse.append(word);<br />
}</p>
<p>String result = reverse.toString();</p>
<p>String regex = &#8220;\\bGod\\b\\W+\\b(\\w+)\\b&#8221;;  // Use any &#8220;non-word character&#8221; as a delimiter</p>
<p>String output = result.replaceAll(regex, &#8220;ceiling cat sez&#8221; );</p>
<p>System.out.println(result);<br />
System.out.println(&#8220;running replace regex. . . &#8220;);<br />
System.out.println(output);</p>
<p>// Create an output stream and file channel to write out a report<br />
// (Also print out report to screen)<br />
FileOutputStream fos = new FileOutputStream(args[1]);<br />
FileChannel outfc = fos.getChannel();</p>
<p>// Convert content String into ByteBuffer and write out to file<br />
bb = ByteBuffer.wrap(output.getBytes());<br />
outfc.write(bb);<br />
outfc.close();</p>
<p>//System.out.println(&#8220;Reversed text written to &#8221; + args[1]);</p>
<p>}<br />
}</p>
<p>Some of my favorites:</p>
<p>01:001:001 In the beginning ceiling cat sez the heaven and the earth.</p>
<p>01:001:003 And ceiling cat sez, Let there be light: and there was light.</p>
<p>01:001:022 And ceiling cat sez them, saying, Be fruitful, and multiply, and<br />
fill the waters in the seas, and let fowl multiply in the<br />
earth.</p>
<p>01:001:027 So ceiling cat sez man in his own image, in the image of ceiling cat sez he him; male and female created he them.</p>
<p>01:002:003 And ceiling cat sez the seventh day, and sanctified it: because<br />
that in it he had rested from all his work which ceiling cat sez<br />
and made.</p>
<p>01:002:007 And the LORD ceiling cat sez man of the dust of the ground, and<br />
breathed into his nostrils the breath of life; and man became<br />
a living soul.</p>
<p>01:002:008 And the LORD ceiling cat sez a garden eastward in Eden; and there<br />
he put the man whom he had formed.</p>
<p>Anyway, you get the idea.  Fun with lolcats.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/610design.wordpress.com/30/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/610design.wordpress.com/30/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/610design.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/610design.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/610design.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/610design.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/610design.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/610design.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/610design.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/610design.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/610design.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/610design.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/610design.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/610design.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/610design.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/610design.wordpress.com/30/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=610design.wordpress.com&amp;blog=1752276&amp;post=30&amp;subd=610design&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://610design.wordpress.com/2008/02/02/week-2-ceiling-cat-sez/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/713080f9d6cddca35771bc2f9087cfef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">610design</media:title>
		</media:content>
	</item>
	</channel>
</rss>
