<?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>whatnot</title>
	<atom:link href="http://whatnot.merichar.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://whatnot.merichar.org</link>
	<description>.merichar.org</description>
	<lastBuildDate>Sun, 17 Jul 2011 23:33:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Foreign Currency Bug in the Wells Fargo Rapid Alert System</title>
		<link>http://whatnot.merichar.org/2011/07/17/foreign-currency-bug-in-the-wells-fargo-rapid-alert-system/</link>
		<comments>http://whatnot.merichar.org/2011/07/17/foreign-currency-bug-in-the-wells-fargo-rapid-alert-system/#comments</comments>
		<pubDate>Sun, 17 Jul 2011 23:33:36 +0000</pubDate>
		<dc:creator>merichar</dc:creator>
				<category><![CDATA[Adventures]]></category>
		<category><![CDATA[Qatar]]></category>
		<category><![CDATA[Wells Fargo]]></category>

		<guid isPermaLink="false">http://whatnot.merichar.org/?p=192</guid>
		<description><![CDATA[So I configured Wells Fargo&#8217;s* Rapid Alerts thing to send an SMS when I spend over $50 on a single purchase, and a copy of that message goes to the account inbox. Naturally, Haagen Dazs was my undoing and I got an alert for a purchase I was expecting to be ~$20. When I went [...]]]></description>
			<content:encoded><![CDATA[<p>So I configured Wells Fargo&#8217;s* Rapid Alerts thing to send an SMS when I spend over $50 on a single purchase, and a copy of that message goes to the account inbox. Naturally, Haagen Dazs was my undoing and I got an alert for a purchase I was expecting to be ~$20. When I went to confirm the thing, the alert was in the inbox, but it displayed a transaction amount of $17.03 USD: That&#8217;s 61 QAR. </p>
<p>After some analysis, it looks like** purchases greater than 50 QAR (~$14 USD) will trigger the alert, so the programmer must not have converted the raw sum before making the comparison that determines if an alert should happen. I&#8217;d be sympathetic, but I&#8217;ve been swallowing 3% &#8220;Foreign Currency Conversion Fee&#8221;s left and right&#8230; and what the heck for? :-) Fortunately, it failed in a way preferable to me and is more likely to alert. I&#8217;d hate to have to deal with this in a country where the raw number is less than 50 and the USD value is greater than 50. </p>
<p>I&#8217;m tempted to align a few more purchases in the > 50QAR  and < 50USD range so I can get some more data points.</p>
<div id="attachment_193" class="wp-caption aligncenter" style="width: 603px"><a href="http://whatnot.merichar.org/wp-content/uploads/2011/07/wf.png"><img class="size-full wp-image-193" style="border: 1px solid black;" title="wf" src="http://whatnot.merichar.org/wp-content/uploads/2011/07/wf.png" alt="" width="593" height="583" /></a><p class="wp-caption-text">Everybody loves screenshots</p></div>
<p>* &#8220;Wells Fargo&#8217;s&#8221; reads pretty awkwardly, doesn&#8217;t it?<br />
** Obligatory &#8220;correlation is not causation&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://whatnot.merichar.org/2011/07/17/foreign-currency-bug-in-the-wells-fargo-rapid-alert-system/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Harry Potter 7 Part 2 at the City Center in Doha</title>
		<link>http://whatnot.merichar.org/2011/07/15/harry-potter-7-part-2-at-the-city-center-in-doha/</link>
		<comments>http://whatnot.merichar.org/2011/07/15/harry-potter-7-part-2-at-the-city-center-in-doha/#comments</comments>
		<pubDate>Fri, 15 Jul 2011 18:17:08 +0000</pubDate>
		<dc:creator>merichar</dc:creator>
				<category><![CDATA[Adventures]]></category>
		<category><![CDATA[Cinema]]></category>
		<category><![CDATA[Harry Potter]]></category>
		<category><![CDATA[mjs]]></category>
		<category><![CDATA[Qatar]]></category>
		<category><![CDATA[SCPP]]></category>

		<guid isPermaLink="false">http://whatnot.merichar.org/?p=145</guid>
		<description><![CDATA[I couldn&#8217;t let international adventure stand in the way of missing the last installment of the HP movies, so Mark and I headed over to the City Center theater after work yesterday. Tickets were interesting because you actually get assigned a seat&#8230; It was nice because instead of spending a half-hour staking our seat claim [...]]]></description>
			<content:encoded><![CDATA[<p>
I couldn&#8217;t let international adventure stand in the way of missing the last installment of the HP movies, so Mark and I headed over to the City Center theater after work yesterday. Tickets were interesting because you actually get assigned a seat&#8230; It was nice because instead of spending a half-hour staking our seat claim we wandered over to Cold Stone for ice cream and sauntered in a few minutes before the previews started. Note: We sauntered in *with* our ice cream from Cold Stone. That&#8217;s right, folks. Food from the outside: Totally ok. The theater was really nice, too. I took some crappy cellphone pictures.
</p>
<p><a href="http://whatnot.merichar.org/wp-content/uploads/2011/07/IMG_20110714_2324351.jpg"><img class="size-full wp-image-150 aligncenter" style="clear: both;" title="IMG_20110714_232435" src="http://whatnot.merichar.org/wp-content/uploads/2011/07/IMG_20110714_2324351.jpg" alt="" width="360" /></a></p>
<p>
[And then there was the movie. Look at me, not doing spoilers or anything.]
</p>
<p>
There were Arabic subtitles through the whole thing. If I&#8217;d been a little bit further in &#8220;Alif Baa&#8221; I probably could&#8217;ve walked out able to write &#8220;Harry Potter&#8221; in Arabic, but life is tough. I did wander into Jarir Bookstore yesterday and got a copy of HP2 in Arabic&#8230; I had HP1 while I was learning Spanish, and it&#8217;s nice to have an end goal in sight that I can flip through. Interestingly, it had the American version of the cover art; I was almost certain it was going to be based on the British version.
</p>
<div style="clear: both">
<div style="float:left; padding: 10px 0px;clear:both">
<a href="http://whatnot.merichar.org/wp-content/uploads/2011/07/IMG_20110714_232342.jpg"><img class="size-full wp-image-147 aligncenter" title="IMG_20110714_232342" src="http://whatnot.merichar.org/wp-content/uploads/2011/07/IMG_20110714_232342.jpg" alt="" width="310" style="float:left"/></a><a href="http://whatnot.merichar.org/wp-content/uploads/2011/07/IMG_20110714_232350.jpg"><img class="size-full wp-image-148 aligncenter" style="padding-left: 20px; float: left;" title="IMG_20110714_232350" src="http://whatnot.merichar.org/wp-content/uploads/2011/07/IMG_20110714_232350.jpg" alt="" width="310" /></a>
</div>
<div style="float:left; padding: 10px 0px;clear:both;">
<a href="http://whatnot.merichar.org/wp-content/uploads/2011/07/IMG_20110714_232559.jpg"><img class="aligncenter size-full wp-image-153" title="IMG_20110714_232559" src="http://whatnot.merichar.org/wp-content/uploads/2011/07/IMG_20110714_232559.jpg" alt="" width="310" style="float:left" /></a><a href="http://whatnot.merichar.org/wp-content/uploads/2011/07/IMG_20110714_2325141.jpg"><img class="aligncenter size-full wp-image-152" title="IMG_20110714_232514" src="http://whatnot.merichar.org/wp-content/uploads/2011/07/IMG_20110714_2325141.jpg" alt="" width="310" style="padding-left: 20px; float:left" /></a>
</div>
</div>
<p>
Note Mark: That&#8217;s the devilish smile of a man who&#8217;s spent the last 15 minutes teasing his wife and daughter in the States via SMS about getting to see the movie before its release in the US.</p>
]]></content:encoded>
			<wfw:commentRss>http://whatnot.merichar.org/2011/07/15/harry-potter-7-part-2-at-the-city-center-in-doha/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adventure to Souq Waqif</title>
		<link>http://whatnot.merichar.org/2011/07/09/adventure-to-souq-waqif/</link>
		<comments>http://whatnot.merichar.org/2011/07/09/adventure-to-souq-waqif/#comments</comments>
		<pubDate>Sat, 09 Jul 2011 11:34:53 +0000</pubDate>
		<dc:creator>merichar</dc:creator>
				<category><![CDATA[Adventures]]></category>
		<category><![CDATA[mjs]]></category>
		<category><![CDATA[Qatar]]></category>
		<category><![CDATA[SCPP]]></category>

		<guid isPermaLink="false">http://whatnot.merichar.org/?p=128</guid>
		<description><![CDATA[I went to Souq Waqif today with Stehlik and found a chessboard. Mark did most of the haggling bits, but I offered in a Coke. And now I have the coolest chessboard ever. I think I amused the shopkeeper&#8230; as we were leaving he gave me a bracelet. It&#8217;s pretty awesome, too. &#160; &#160;]]></description>
			<content:encoded><![CDATA[<div class="wp-caption aligncenter" style="width: 509px"><img style="display: block;" src="http://whatnot.merichar.org/wp-content/uploads/2011/07/wpid-IMG_20110709_142119.jpg" alt="image" width="499" height="373" /><p class="wp-caption-text">Chessboard!</p></div>
<p>I went to Souq Waqif today with Stehlik and found a chessboard.</p>
<p>Mark did most of the haggling bits, but I offered in a Coke. And now I have the coolest chessboard ever.</p>
<p>I think I amused the shopkeeper&#8230;  as we were leaving he gave me a bracelet. It&#8217;s pretty awesome, too.</p>
<p>&nbsp;</p>
<div class="wp-caption aligncenter" style="width: 509px"><img style="display: block;" src="http://whatnot.merichar.org/wp-content/uploads/2011/07/wpid-IMG_20110709_142151.jpg" alt="image" width="499" height="373" /><p class="wp-caption-text">Marquetry work is super amazing</p></div>
<div class="wp-caption aligncenter" style="width: 509px"><img style="display: block;" src="http://whatnot.merichar.org/wp-content/uploads/2011/07/wpid-IMG_20110709_142219.jpg" alt="image" width="499" height="373" /><p class="wp-caption-text">Oh, and there&#39;s backgammon</p></div>
<div class="wp-caption aligncenter" style="width: 509px"><img style="display: block;" src="http://whatnot.merichar.org/wp-content/uploads/2011/07/wpid-IMG_20110709_142228.jpg" alt="image" width="499" height="373" /><p class="wp-caption-text">Backgammon marquetry</p></div>
<div class="wp-caption aligncenter" style="width: 509px"><img style="display: block;" src="http://whatnot.merichar.org/wp-content/uploads/2011/07/wpid-IMG_20110709_142343.jpg" alt="image" width="499" height="373" /><p class="wp-caption-text">The shopkeeper was cool</p></div>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://whatnot.merichar.org/2011/07/09/adventure-to-souq-waqif/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Qatar Digs</title>
		<link>http://whatnot.merichar.org/2011/07/03/the-qatar-digs/</link>
		<comments>http://whatnot.merichar.org/2011/07/03/the-qatar-digs/#comments</comments>
		<pubDate>Mon, 04 Jul 2011 03:26:12 +0000</pubDate>
		<dc:creator>merichar</dc:creator>
				<category><![CDATA[Adventures]]></category>
		<category><![CDATA[Qatar]]></category>
		<category><![CDATA[SCPP]]></category>

		<guid isPermaLink="false">http://whatnot.merichar.org/2011/07/03/the-qatar-digs/</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><img style="display:block;margin-right:auto;margin-left:auto;" alt="image" src="http://whatnot.merichar.org/wp-content/uploads/2011/07/wpid-IMG_20110703_223459.jpg" /></p>
<p><img style="display:block;margin-right:auto;margin-left:auto;" alt="image" src="http://whatnot.merichar.org/wp-content/uploads/2011/07/wpid-IMG_20110703_223922.jpg" /></p>
<p><img style="display:block;margin-right:auto;margin-left:auto;" alt="image" src="http://whatnot.merichar.org/wp-content/uploads/2011/07/wpid-IMG_20110703_223902.jpg" /></p>
<p><img style="display:block;margin-right:auto;margin-left:auto;" alt="image" src="http://whatnot.merichar.org/wp-content/uploads/2011/07/wpid-IMG_20110703_223842.jpg" /></p>
<p><img style="display:block;margin-right:auto;margin-left:auto;" alt="image" src="http://whatnot.merichar.org/wp-content/uploads/2011/07/wpid-IMG_20110703_223635.jpg" /></p>
<p><img style="display:block;margin-right:auto;margin-left:auto;" alt="image" src="http://whatnot.merichar.org/wp-content/uploads/2011/07/wpid-IMG_20110703_223217.jpg" /></p>
<p><img style="display:block;margin-right:auto;margin-left:auto;" alt="image" src="http://whatnot.merichar.org/wp-content/uploads/2011/07/wpid-IMG_20110703_223301.jpg" /></p>
<p><img style="display:block;margin-right:auto;margin-left:auto;" alt="image" src="http://whatnot.merichar.org/wp-content/uploads/2011/07/wpid-IMG_20110703_223604.jpg" /></p>
<p><img style="display:block;margin-right:auto;margin-left:auto;" alt="image" src="http://whatnot.merichar.org/wp-content/uploads/2011/07/wpid-IMG_20110703_223151.jpg" /></p>
<p><img style="display:block;margin-right:auto;margin-left:auto;" alt="image" src="http://whatnot.merichar.org/wp-content/uploads/2011/07/wpid-IMG_20110703_223141.jpg" /></p>
<p><img style="display:block;margin-right:auto;margin-left:auto;" alt="image" src="http://whatnot.merichar.org/wp-content/uploads/2011/07/wpid-IMG_20110703_223035.jpg" /></p>
<p><img style="display:block;margin-right:auto;margin-left:auto;" alt="image" src="http://whatnot.merichar.org/wp-content/uploads/2011/07/wpid-IMG_20110703_222952.jpg" /></p>
<p><img style="display:block;margin-right:auto;margin-left:auto;" alt="image" src="http://whatnot.merichar.org/wp-content/uploads/2011/07/wpid-IMG_20110703_222934.jpg" /></p>
]]></content:encoded>
			<wfw:commentRss>http://whatnot.merichar.org/2011/07/03/the-qatar-digs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Finch Robot udev Rules</title>
		<link>http://whatnot.merichar.org/2011/06/14/finch-robot-udev-rules/</link>
		<comments>http://whatnot.merichar.org/2011/06/14/finch-robot-udev-rules/#comments</comments>
		<pubDate>Tue, 14 Jun 2011 16:22:40 +0000</pubDate>
		<dc:creator>merichar</dc:creator>
				<category><![CDATA[Finch]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[udev]]></category>

		<guid isPermaLink="false">http://whatnot.merichar.org/?p=103</guid>
		<description><![CDATA[Finch Robot udev Rules (Under Debian) The Finch is a robot to teach introductory computer science. Information about it is available at finchrobot.com. Getting the Initial Information First plug the finch in and run dmesg to see what the system log made of it: [merichar@dormouse ~]% dmesg &#124; tail [226206.828073] usb 5-1: new full speed [...]]]></description>
			<content:encoded><![CDATA[<h1>Finch Robot udev Rules (Under Debian)</h1>
<p>The Finch is a robot to teach introductory computer science. Information about it is available at <a href="http://finchrobot.com">finchrobot.com</a>.</p>
<h2>Getting the Initial Information</h2>
<p>
First plug the finch in and run dmesg to see what the system log made of it:
</p>
<pre>
[merichar@dormouse ~]% dmesg | tail
[226206.828073] usb 5-1: new full speed USB device using uhci_hcd and address 11
[226207.008109] usb 5-1: New USB device found, idVendor=2354, idProduct=1111
[226207.008118] usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[226207.008125] usb 5-1: Product: Finch
[226207.008130] usb 5-1: Manufacturer: BirdBrain Tools
[226207.146317] generic-usb 0003:2354:1111.0001: hiddev0,hidraw0: USB HID v1.11 Device [BirdBrain Tools Finch] on usb-0000:00:1d.0-1/input0
[226207.146386] usbcore: registered new interface driver usbhid
[226207.146388] usbhid: USB HID core driver
</pre>
<p>
Since it was successfully presenting itself as a usb device, we could also use lsusb to obtain details about it (and the other usb devices associated):
</p>
<pre>
[merichar@dormouse ~]% lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
...
Bus 003 Device 009: ID 0a5c:2110 Broadcom Corp. Bluetooth Controller
Bus 005 Device 013: ID 2354:1111
</pre>
<p>Even though lsusb didn&#8217;t provide the human-readable vendor and product information, the vendor and product IDs match those of the dmesg output above.<br />
So now we know that the vendor ID for the finch is 2354 and the product id is 1111.
</p>
<p>
We can also look at the default permissions of the device, since we know from lsusb that it&#8217;s bus 5, device 13 (adjust those numbers to your reality):
</p>
<pre>
[merichar@dormouse ~]% ls -l /dev/bus/usb/005/013
crw-rw-r-- 1 root root 189 ...
</pre>
<p>
From dmesg we saw that it also identifies as a USB HID: hiddev0, so we can look at bus mapping-agnostic permissions:
</p>
<pre>
[merichar@dormouse ~]% ls -l /dev/usb
total 0
crw------- 1 root root 180, 0 Jun 14 11:00 /dev/usb/hiddev0
</pre>
<h2>What do we want?</h2>
<p>The goal is to not have to run processing or java as root when using the finch. Therefore, we must adjust the permissions of the device such that we (and perhaps others) are able to communicate with it directly.
</p>
<h2>Getting what we want</h2>
<p>
udev rules are the best way to change the default permissions of the finch. udev is the linux device manager, so it&#8217;s queen of mapping nodes in /dev. In Debian, user created udev rules are placed within /etc/udev/rules.d as (usually) device-specific .rules files.
</p>
<p>
As root, we are going to create the file: </p>
<pre>/etc/udev/rules.d/55-finch.rules</pre>
<p>containing the following:
</p>
<pre>
SUBSYSTEM=="usb", SYSFS{idVendor}=="2354", SYSFS{idProduct}=="1111", MODE="0660", GROUP="plugdev"
</pre>
<p>
The expected behavior would be that the next time the finch, as identified by the 2-tuple of vendor id and product id, is introduced to the system, the device&#8217;s group changes from root to plugdev and the permissions become 0660 (i.e. readable and writable by both the user and group owners). The 55- prefix to the rules file is its priority. plugdev is a group whose members should be able to access hot-pluggable devices, more traditionally cameras and usb sticks; see Martin&#8217;s post on the subject: <a href="http://lists.debian.org/debian-devel/2004/11/msg00201.html">here</a>.
</p>
<h2>Sanity Check</h2>
<p>After the 55-finch.rules is in place, let&#8217;s try it out. If the finch is plugged in to a USB port unplug it. The mappings should be gone from within /dev. Now plug the finch back in. If you were to perform another dmesg or lsusb, the output should be almost identical. e.g.:
</p>
<pre>
[merichar@dormouse ~]% lsusb
...
Bus 005 Device 014: ID 2354:1111
</pre>
<p>
 In my case, the device mapping incremented by one. The device mapping will not affect the implementation of our rules file, and as you can see the rules file does not reference a mapping at all. That is the joy of dynamic mapping with udev. The new mapping is important because we do want to confirm that the permissions and ownership we defined in the .rules file actually took to the new mapping and all subsequent mappings:
</p>
<pre>
[merichar@dormouse ~]% ls -l /dev/bus/usb/005/014
crw-rw-r-- 1 root plugdev 189, 525 Jun 14 12:00 /dev/bus/usb/005/014
</pre>
<p>
Therefore, anyone in group plugdev is able to communicate directly with the finch.<br />
We do a quick check that the user we care about is actually in the group plugdev:
</p>
<pre>
[merichar@dormouse ~]% groups merichar
merichar : merichar dialout cdrom floppy sudo audio video plugdev netdev powerdev svn
</pre>
<p>
And that&#8217;s that. I startup processing or java normally and as the user merichar I&#8217;m able to control the finch.</p>
]]></content:encoded>
			<wfw:commentRss>http://whatnot.merichar.org/2011/06/14/finch-robot-udev-rules/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Interactive Art &amp; Computational Design &#8211; Final Project</title>
		<link>http://whatnot.merichar.org/2011/05/11/interactive-art-computational-design-final-project/</link>
		<comments>http://whatnot.merichar.org/2011/05/11/interactive-art-computational-design-final-project/#comments</comments>
		<pubDate>Wed, 11 May 2011 15:17:29 +0000</pubDate>
		<dc:creator>merichar</dc:creator>
				<category><![CDATA[Classwork]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://blog.merichar.org/?p=4</guid>
		<description><![CDATA[&#8220;Catching Flies&#8221; A Trampoline Game for the Microsoft Kinect This project is a game that incorporates a trampoline into the player&#8217;s interaction with a Kinect. The player controls a frog by jumping and using his or her arm to extend the frog&#8217;s tongue and catch flies. The goal is to catch as many flies as [...]]]></description>
			<content:encoded><![CDATA[<h1 style="margin-bottom: 0; padding-bottom:0">&#8220;Catching Flies&#8221;</h1>
<h2 style="font-size: 20px">A Trampoline Game for the Microsoft Kinect</h2>
<p>
This project is a game that incorporates a trampoline into the player&#8217;s interaction with a Kinect. The player controls a frog by jumping and using his or her arm to extend the frog&#8217;s tongue and catch flies. The goal is to catch as many flies as possible before reaching the water.
</p>
<iframe src='http://player.vimeo.com/video/23613947?title=0&amp;byline=0&amp;portrait=0' width='635' height='400' frameborder='0'></iframe>
<p>Trampolines offer a new degree of freedom while interacting with the Kinect, and I wanted to create a game that demonstrated how one could be used to enhance the Kinect experience. Unlike regular jumping, a trampoline creates a regular and more predictable rhythm of vertical motion and can be sustained for a longer period of time.</p>
<p><a href="http://whatnot.merichar.org/wp-content/uploads/2011/05/graph-1.png"><img src="http://whatnot.merichar.org/wp-content/uploads/2011/05/graph-1.png" alt="" title="graph-1" width="600" class="alignnone size-full wp-image-21" /></a></p>
<p>Starting with that concept I originally began to create a side-scrolling game similar to Super Mario Brothers that would have the user jump to hit boxes and jump over pipes and enemies. I abandoned this attempt when it was clear that<br />
it was uncomfortable for the player to adjust their actions to one that affected an orthogonal vertex. Additionally, complex object intersection became arbitrary complexity for a project attempting to achieve a proof of concept of rhythm<br />
detection, skeleton tracking while bouncing, and hop detection.</p>
<h2>Frog Arms</h2>
<p>In the next iteration, the player was a frog whose arms would reflect their relative vertical position. A spring force at the end of each hands directs upward motion slightly outward and creates the illusion that the player is a frog jumping forward at each hop.</p>
<p><a href="http://whatnot.merichar.org/wp-content/uploads/2011/05/graph-2.png"><img src="http://whatnot.merichar.org/wp-content/uploads/2011/05/graph-2.png" alt="" title="graph-2" width="600" class="alignnone size-full wp-image-21" /></a></p>
<p><a href="http://whatnot.merichar.org/wp-content/uploads/2011/05/setup.png"><img src="http://whatnot.merichar.org/wp-content/uploads/2011/05/setup.png" alt="" title="setup" width="400" class="aligncenter size-full wp-image-27" /></a></p>
<h2>Hop Detection</h2>
<p>The most interesting phase of the project involved player hop detection. One full cycle of ascending and descending could be broken down into logical phases of a bounce. Using the middle of the shoulders as the most stable part of the body from which to determine the acts of ascending and descending,  every update cycle would pull that vertical position and place it into a height cache. The height cache was an array of height values treated as a sliding window: Instead of comparing the current y position to the most recent y position it was compared to some defined number of former y positions. As the current y position would have to be larger than all the former readings within the window, the sliding window reduced the likelihood of a bad reading or jitter causing a false determination that the player has started a new phase of ascending or descending. After a period of ascension, the player is considered in stasis when a future y position fails to be larger than all members of the height cache.</p>
<p><a href="http://whatnot.merichar.org/wp-content/uploads/2011/05/graph-3.png"><img src="http://whatnot.merichar.org/wp-content/uploads/2011/05/graph-3.png" alt="" title="graph-1" width="600" class="alignnone size-full wp-image-21" /></a></p>
<p>This is reflected in the following logic:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">bool</span> asc <span style="color: #000080;">=</span> <span style="color: #0000ff;">true</span><span style="color: #008080;">;</span>
<span style="color: #0000ff;">bool</span> desc <span style="color: #000080;">=</span> <span style="color: #0000ff;">true</span><span style="color: #008080;">;</span>
<span style="color: #0000ff;">for</span><span style="color: #008000;">&#40;</span> <span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i <span style="color: #000080;">&lt;</span> HEIGHT_CACHE_SIZE<span style="color: #008080;">;</span> i<span style="color: #000040;">++</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
    <span style="color: #0000ff;">float</span> old <span style="color: #000080;">=</span> properties.<span style="color: #007788;">heightCache</span><span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>
    <span style="color: #666666;">//height pulled from tracked user is relatively inversed</span>
    <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>old <span style="color: #000080;">&gt;</span> y<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
        desc <span style="color: #000080;">=</span> <span style="color: #0000ff;">false</span><span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
    <span style="color: #0000ff;">else</span> <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>old <span style="color: #000080;">&lt;</span> y<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
        asc <span style="color: #000080;">=</span> <span style="color: #0000ff;">false</span><span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #666666;">// if we are either ascending or descending (not in stasis)</span>
<span style="color: #666666;">// update the previous state</span>
<span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span> asc <span style="color: #000040;">||</span> desc<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
    <span style="color: #666666;">// on first time leaving stasis; preserve former asc/desc states</span>
    <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span><span style="color: #000040;">!</span>properties.<span style="color: #007788;">inStasis</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
        properties.<span style="color: #007788;">wasAscending</span> <span style="color: #000080;">=</span> properties.<span style="color: #007788;">isAscending</span><span style="color: #008080;">;</span>
        properties.<span style="color: #007788;">wasDescending</span> <span style="color: #000080;">=</span> properties.<span style="color: #007788;">isDescending</span><span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
    properties.<span style="color: #007788;">isAscending</span> <span style="color: #000080;">=</span> asc<span style="color: #008080;">;</span>
    properties.<span style="color: #007788;">isDescending</span> <span style="color: #000080;">=</span> desc<span style="color: #008080;">;</span>
    properties.<span style="color: #007788;">inStasis</span> <span style="color: #000080;">=</span> <span style="color: #0000ff;">false</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span>
<span style="color: #0000ff;">else</span> <span style="color: #008000;">&#123;</span>
    <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #000040;">!</span>properties.<span style="color: #007788;">inStasis</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#123;</span>
        properties.<span style="color: #007788;">wasAscending</span> <span style="color: #000080;">=</span> properties.<span style="color: #007788;">isAscending</span><span style="color: #008080;">;</span>
        properties.<span style="color: #007788;">wasDescending</span> <span style="color: #000080;">=</span> properties.<span style="color: #007788;">isDescending</span><span style="color: #008080;">;</span>
        properties.<span style="color: #007788;">isAscending</span> <span style="color: #000080;">=</span> <span style="color: #0000ff;">false</span><span style="color: #008080;">;</span>
        properties.<span style="color: #007788;">isDescending</span> <span style="color: #000080;">=</span> <span style="color: #0000ff;">false</span><span style="color: #008080;">;</span>
        properties.<span style="color: #007788;">inStasis</span> <span style="color: #000080;">=</span> <span style="color: #0000ff;">true</span><span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>Finally, with this logic in place, a hop is accounted for by the following:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span> wasAscending<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> and isDescending<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> and 
        <span style="color: #008000;">&#40;</span><span style="color: #0000dd;">abs</span><span style="color: #008000;">&#40;</span>y <span style="color: #000040;">-</span> properties.<span style="color: #007788;">average_weighted_y</span><span style="color: #008000;">&#41;</span> <span style="color: #000080;">&gt;</span> REST_Y_DELTA<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
    properties.<span style="color: #007788;">num_hops</span><span style="color: #000040;">++</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>NB: The REST_Y_DELTA is used to account for the trampoline&#8217;s affect on a player&#8217;s rest state.</p>
<h2>Gameplay &#8211; Flies</h2>
<p>With the foundation in place, gameplay became the next phase of development. Continuing with the frog theme, I introduced flies as a desired token within the game. As the arms were presently unused, they became the tool used for fly interaction. Once the fly came close enough (they would gradually become larger as they approached the player), the player could wave their hand above shoulder level to swipe the frog&#8217;s tongue across the screen and gather any flies that hadn&#8217;t escaped off screen.</p>
<p><a href="http://whatnot.merichar.org/wp-content/uploads/2011/05/graph-4.png"><img src="http://whatnot.merichar.org/wp-content/uploads/2011/05/graph-4.png" alt="" title="graph-1" width="600" class="alignnone size-full wp-image-21" /></a></p>
<p><a href="http://whatnot.merichar.org/wp-content/uploads/2011/05/tongue.png"><img src="http://whatnot.merichar.org/wp-content/uploads/2011/05/tongue.png" alt="" title="tongue" width="400" class="aligncenter size-full wp-image-28" /></a></p>
<h2>Gameplay &#8211; Stats</h2>
<p>In order to show a player&#8217;s progress and bring encouragement, their number of hops and the number of flies their frog had collected were displayed on clouds at the top of the screen.</p>
<p><a href="http://whatnot.merichar.org/wp-content/uploads/2011/05/graph-5.png"><img src="http://whatnot.merichar.org/wp-content/uploads/2011/05/graph-5.png" alt="" title="graph-5" width="600" class="alignnone size-full wp-image-21" /></a></p>
<h2>Gameplay &#8211; Endgame</h2>
<p>Finally, the end game became the grass descending into the sea. Each hop would keep the grass from descending some marginal amount increasing the length of the game and thus the time available to catch flies.</p>
<p><a href="http://whatnot.merichar.org/wp-content/uploads/2011/05/graph-6.png"><img src="http://whatnot.merichar.org/wp-content/uploads/2011/05/graph-6.png" alt="" title="graph-6" width="600" class="alignnone size-full wp-image-21" /></a></p>
<p><a href="http://whatnot.merichar.org/wp-content/uploads/2011/05/gameover.png"><img src="http://whatnot.merichar.org/wp-content/uploads/2011/05/gameover.png" alt="" title="gameover" width="400" class="aligncenter size-full wp-image-30" /></a></p>
<h2>Conclusion</h2>
<p>While gameplay left a lot to be desired, I believe playing to my strengths and focusing on logical determinations of the jumper&#8217;s state and the resulting generic &#8216;jumper&#8217; class and header files, which can be dropped in to future games involving rhythmic vertical motion, will ultimately prove worthwhile. After the public exhibition, it became clear that smaller children were having trouble getting proper hop detection and corresponding calculations. Once I fix some of the code that relied on incorrect constant values, it should be ready for general release.</p>
<h2>Icon &amp; One Sentence Description</h2>
<p>
<a href="http://whatnot.merichar.org/wp-content/uploads/2011/05/trampoline-icon.png"><img src="http://whatnot.merichar.org/wp-content/uploads/2011/05/trampoline-icon.png" alt="" title="trampoline-icon" width="100" height="100" class="alignleft size-full wp-image-29" /></a><br />
Fly Catching is a game using a Kinect and trampoline where the player controls a frog that can hop and catch flies.</p>
]]></content:encoded>
			<wfw:commentRss>http://whatnot.merichar.org/2011/05/11/interactive-art-computational-design-final-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Interactive Art &amp; Computational Design &#8211; Project 3</title>
		<link>http://whatnot.merichar.org/2011/02/21/interactive-art-computational-design-project-3/</link>
		<comments>http://whatnot.merichar.org/2011/02/21/interactive-art-computational-design-project-3/#comments</comments>
		<pubDate>Mon, 21 Feb 2011 18:01:25 +0000</pubDate>
		<dc:creator>merichar</dc:creator>
				<category><![CDATA[Classwork]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://whatnot.merichar.org/?p=47</guid>
		<description><![CDATA[Mix &#38; Match Interactive Toy Mix and match toys and games are a popular activity for children. It typically appears as an upright cylinder or rectangular prism with multiple standing human or animal figures independently painted or carved into the surface. The shape is divided into thirds that rotate independently, allowing the different heads, torsos, [...]]]></description>
			<content:encoded><![CDATA[<h1>Mix &amp; Match Interactive Toy</h1>
<div>
<iframe src='http://player.vimeo.com/video/20514415?title=0&amp;byline=0&amp;portrait=0' width='635' height='400' frameborder='0'></iframe>
</div>
<p>
<a href="http://whatnot.merichar.org/wp-content/uploads/2011/05/p3_init.png"><img src="http://whatnot.merichar.org/wp-content/uploads/2011/05/p3_init.png" alt="" title="p3_init" width="635" class="wp-image-53" /></a>
</p>
<p>
Mix and match toys and games are a popular activity for children. It typically appears as an upright cylinder or rectangular prism with multiple standing human or animal figures independently painted or carved into the surface. The shape is divided into thirds that rotate independently, allowing the different heads, torsos, and legs of the painted or carved figures to align. They have existed in many forms of media and targeted different age groups over their two-hundred year history. Changeable Gentlemen, a card game published around 1810 targeting adults, was one of the earliest manufactured mix and match games. Adaptations in base material and figure subjects made it more suitable for a younger audience, and modern incarnations are generally as a classic toy for children.
</p>
<p>
I chose a mix and match toy as the interaction subject because it&#8217;s a ubiquitous toy and gives almost all the players a baseline familiarity. Also, while the media and figures are numerous over the last two hundred years, the method of interaction has always been hand manipulation. The Kinect enables the player to use their entire body to control the figure. The figures are from a card game &#8220;Mixies&#8221; published in 1956 by Ed-U-Cards. The player can rotate through different heads, torsos, and feet by swiping above, at, or below the player&#8217;s midsection, respectively. Swiping to the left will rotate to the next card to appear, and swiping to the right will rotate to the previous card. The figure will follow a player&#8217;s horizontal and vertical movement, bending, and if they turn around.
</p>
<p>
<a href="http://whatnot.merichar.org/wp-content/uploads/2011/05/p3_mix.png"><img src="http://whatnot.merichar.org/wp-content/uploads/2011/05/p3_mix.png" alt="" title="p3_mix" width="635" class="wp-image-55" /></a>
</p>
<p>
<a href="http://whatnot.merichar.org/wp-content/uploads/2011/05/p3_back.png"><img src="http://whatnot.merichar.org/wp-content/uploads/2011/05/p3_back.png" alt="" title="p3_back" width="635" class="wp-image-54" /></a>
</p>
<p>
I used OpenFrameworks, ofxKinect, and OpenNI. Once the skeleton is detected, the images are overlayed at the position and angle of the corresponding section. Hands and arms do not directly affect card placement, so they are free to control the card rotation. Sweep/wave detection is simply a matter of the end of the left or right arm moving over a certain horizontal distance within a time threshold. If the user&#8217;s back is turned, the back of the card is displayed instead of the obverse.
</p>
<iframe src="http://www.youtube.com/embed/kjpmBZKIze0?version=3&amp;wmode=transparent" width="635" height="501" title="YouTube video player" style="background-color:#000;display:block;margin-bottom:0;max-width:100%;" frameborder="0" allowfullscreen></iframe><p style="font-size:11px;margin-top:0;"><a href="http://www.youtube.com/watch?v=kjpmBZKIze0" target="_blank" title="Watch on YouTube">Watch this video on YouTube</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://whatnot.merichar.org/2011/02/21/interactive-art-computational-design-project-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Interactive Art &amp; Computational Design &#8211; Project 2</title>
		<link>http://whatnot.merichar.org/2011/02/04/interactive-art-computational-design-project-2/</link>
		<comments>http://whatnot.merichar.org/2011/02/04/interactive-art-computational-design-project-2/#comments</comments>
		<pubDate>Fri, 04 Feb 2011 20:14:21 +0000</pubDate>
		<dc:creator>merichar</dc:creator>
				<category><![CDATA[Classwork]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://whatnot.merichar.org/?p=72</guid>
		<description><![CDATA[Network Usage Bubbles The original incarnation of this project was inspired by the Good Morning! Twitter visualization created by Jer Thorp. A demonstration of CMU network traffic flows, it would show causal links for the available snapshot of the network traffic. All internal IP addresses had to be anonymized, making the internal traffic less meaningful. [...]]]></description>
			<content:encoded><![CDATA[<h1>Network Usage Bubbles</h1>
<p>
The original incarnation of this project was inspired by the <a href="http://blog.blprnt.com/blog/blprnt/goodmorning">Good Morning! Twitter visualization</a> created by Jer Thorp. A demonstration of CMU network traffic flows, it would show causal links for the available snapshot of the network traffic. All internal IP addresses had to be anonymized, making the internal traffic less meaningful. Focusing only on traffic with an endpoint outside of CMU was interesting, but distribution tended towards obeying the law of large numbers, albeit with a probability density function that favored Pittsburgh.
</p>
<p>
This forced me to consider what made network traffic interesting and valuable, and I settled on collecting my own HTTP traffic in real-time using tcpdump. I summarily rejected HTTPS traffic in order to be able to analyze the packet contents, from which I could extract the host, content type, and content length. Represented appropriately, those three items can provide an excellent picture of personal web traffic.
</p>
<p>
<a href="http://whatnot.merichar.org/wp-content/uploads/2011/05/p2-screenshot.png"><img src="http://whatnot.merichar.org/wp-content/uploads/2011/05/p2-screenshot.png" alt="" title="p2-screenshot" width="564" height="538" class="alignnone size-full wp-image-81" /></a>
</p>
<h2>Implementation</h2>
<p>
The visualization has two major components: Collection and representation. Collection is performed by a bash script that calls tcpdump and passes the output to sed and awk for parsing. Parsed data is inserted into a mysql database. Representation is done by Processing and the mysql and jbox2d libraries for it.
</p>
<h2>Visualization Choices</h2>
<p>
Each bubble is a single burst of inbound traffic, e.g. html, css, javascript, or image file. The size of the bubble is a function of the content size, in order to demonstrate the relative amount of tube it takes up to other site elements. Visiting a low-bandwidth site multiple times will increase the number of bubbles and thus the overall area of its bubbles will approach and potentially overcome the area of bubbles representing fewer visits to a bandwidth-intensive site. The bubbles are labeled by host and colored by the top level domain of the host. In retrospect, a better coloring scheme would have been the content type of the traffic. Bubble proximity to the center is directly proportional to how recently the element was fetched; elements decay as they approach the outer edge.
</p>
<p>
The example above shows site visits to www.cs.cmu.edu, www.facebook.com (and by extension, static.ak.fbcdn.net), www.activitiesboard.org, and finally www.cmu.edu, in that order.
</p>
<h2>Network Bubbles in Action</h2>
<iframe src="http://www.youtube.com/embed/YBm2br_kqjs?version=3&amp;wmode=transparent" width="635" height="501" title="YouTube video player" style="background-color:#000;display:block;margin-bottom:0;max-width:100%;" frameborder="0" allowfullscreen></iframe><p style="font-size:11px;margin-top:0;"><a href="http://www.youtube.com/watch?v=YBm2br_kqjs" target="_blank" title="Watch on YouTube">Watch this video on YouTube</a>.</p>
<h2>Code Snippets</h2>
<h3>Drawing Circles</h3>
<p>Create a circle in the middle of the canvas (offset by a little bit of jitter on the x&#038;y axes) for a radius that&#8217;s a function of the content length.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">Body new_body <span style="color: #339933;">=</span> physics.<span style="color: #006633;">createCircle</span><span style="color: #009900;">&#40;</span>width<span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">+</span>i, height<span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">+</span>j,sqrt<span style="color: #009900;">&#40;</span>msql.<span style="color: #006633;">getInt</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span>PI<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
new_body.<span style="color: #006633;">setUserData</span><span style="color: #009900;">&#40;</span>msql.<span style="color: #006633;">getString</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>Host Label</h3>
<p>If the radius of the circle is sufficiently large, label it with the hostname.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>radius<span style="color: #339933;">&gt;</span>7.0f<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    textFont<span style="color: #009900;">&#40;</span>metaBold, <span style="color: #cc66cc;">15</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
    text<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#41;</span>body.<span style="color: #006633;">getUserData</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>,wpoint.<span style="color: #006633;">x</span><span style="color: #339933;">-</span>radius<span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span>,wpoint.<span style="color: #006633;">y</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span></pre></div></div>

<h3>tcpdump Processing</h3>
<p>Feeding tcpdump input into sed</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
tcpdump <span style="color: #660033;">-i</span> wlan0 <span style="color: #660033;">-An</span> <span style="color: #ff0000;">'tcp port 80'</span> <span style="color: #000000; font-weight: bold;">|</span> 
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">read</span> line
<span style="color: #000000; font-weight: bold;">do</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$line</span> <span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">'/Host:/p'</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span> 
    <span style="color: #007800;">activehost</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$line</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $2}'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">strings</span><span style="color: #000000; font-weight: bold;">`</span>
...
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div>

<h3>Source Code</h3>
<p>
<a href="file:///afs/andrew.cmu.edu/usr/merichar/public/project2.tgz"><strong>Get the source here.</strong></a></p>
]]></content:encoded>
			<wfw:commentRss>http://whatnot.merichar.org/2011/02/04/interactive-art-computational-design-project-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Interactive Art &amp; Computational Design &#8211; Project 1: Schotter</title>
		<link>http://whatnot.merichar.org/2011/01/12/interactive-art-computational-design-project-1-schotter/</link>
		<comments>http://whatnot.merichar.org/2011/01/12/interactive-art-computational-design-project-1-schotter/#comments</comments>
		<pubDate>Wed, 12 Jan 2011 13:02:17 +0000</pubDate>
		<dc:creator>merichar</dc:creator>
				<category><![CDATA[Classwork]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://whatnot.merichar.org/?p=88</guid>
		<description><![CDATA[Reproducing Schotter Processing.js Processing Applet Source Code: void setup&#40;&#41; &#123; // define the window size &#38;amp; enable anti-aliasing size&#40;550, 800&#41;; background&#40;255&#41;; smooth&#40;&#41;; noFill&#40;&#41;; // not solid squares noLoop&#40;&#41;; // only draw() once &#125; &#160; void draw&#40;&#41; &#123; // allow for some padding around the edge translate&#40;30,10&#41;; &#160; int x = 0, y = 0, side [...]]]></description>
			<content:encoded><![CDATA[<h1>Reproducing Schotter</h1>
<h2>Processing.js</h2>
<p>
<script type="application/processing">// <![CDATA[
//Info: http://processingjs.org/reference
void setup() {
 // define the window size &#038; enable anti-aliasing
 size(550, 800);
 background(255);
 smooth();
 noFill(); // not solid squares
 noLoop(); // only draw() once
}

void draw() {
 // allow for some padding around the edge
 translate(30,10);

 int x = 0, y = 0, side = 30;
 int i = 0;    // increment just like the original
 float j1, j2; // random numbers for translation and rotation

 for (int k = 0; k < 24; k++ ) { // iterate through y-axis
   for (int j = 0; j < 16; j++ ) { // iterate through x-axis
     i++;
     translate(x, y); // re-define coordinate axis to square

     // pick increasingly variable random numbers for
     j1 = random(-15*i/244,15*i/244); // translation
     j2 = random(-15*i/244,15*i/244); // &#038; rotation

     // rotation should only affect one square at a time,
     //   so push and then pop that alteration to the coordinate axis
     pushMatrix();
     rotate(radians(j2));  // rotate the axis
     rect(j1, j1, 30, 30); // plot the square
     popMatrix(); // return the axis to its original state

     x=30; // x-position advances for each square drawn in row
     y=0;  // y-position shouldn't change in the middle of a row
   }
   x=-450; // return x to beginning of row position
   y=30;   // adjust y to next row
 }
}
// ]]&gt;
</script>
</p>
<h2>Processing Applet</h2>
<div class="processing_embed" id="schotter_container"><p><a href="#" onclick="deployJava.addAppletTo('schotter', 'http://whatnot.merichar.org/wp-content/uploads/2011/05/schotter.jar', 600, 800, 'http://whatnot.merichar.org/wp-content/plugins/wordpress-processing-embed', 'schotter_container'); return false;">Load applet</a></p></div>
<p><strong>Source Code:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">void</span> setup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 <span style="color: #666666; font-style: italic;">// define the window size &amp;amp; enable anti-aliasing</span>
 size<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">550</span>, <span style="color: #cc66cc;">800</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 background<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 smooth<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 noFill<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// not solid squares</span>
 noLoop<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// only draw() once</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">void</span> draw<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 <span style="color: #666666; font-style: italic;">// allow for some padding around the edge</span>
 translate<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">30</span>,<span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
 <span style="color: #000066; font-weight: bold;">int</span> x <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span>, y <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span>, side <span style="color: #339933;">=</span> <span style="color: #cc66cc;">30</span><span style="color: #339933;">;</span>
 <span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>    <span style="color: #666666; font-style: italic;">// increment just like the original</span>
 <span style="color: #000066; font-weight: bold;">float</span> j1, j2<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// random numbers for translation and rotation</span>
&nbsp;
 <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> k <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> k <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> <span style="color: #cc66cc;">24</span><span style="color: #339933;">;</span> k<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// iterate through y-axis</span>
   <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> j <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> j <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> <span style="color: #cc66cc;">16</span><span style="color: #339933;">;</span> j<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// iterate through x-axis</span>
     i<span style="color: #339933;">++;</span>
     translate<span style="color: #009900;">&#40;</span>x, y<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// re-define coordinate axis to square</span>
&nbsp;
     <span style="color: #666666; font-style: italic;">// pick increasingly variable random numbers for</span>
     j1 <span style="color: #339933;">=</span> random<span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">15</span><span style="color: #339933;">*</span>i<span style="color: #339933;">/</span><span style="color: #cc66cc;">244</span>,<span style="color: #cc66cc;">15</span><span style="color: #339933;">*</span>i<span style="color: #339933;">/</span><span style="color: #cc66cc;">244</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// translation</span>
     j2 <span style="color: #339933;">=</span> random<span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">15</span><span style="color: #339933;">*</span>i<span style="color: #339933;">/</span><span style="color: #cc66cc;">244</span>,<span style="color: #cc66cc;">15</span><span style="color: #339933;">*</span>i<span style="color: #339933;">/</span><span style="color: #cc66cc;">244</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// &amp;amp; rotation</span>
&nbsp;
     <span style="color: #666666; font-style: italic;">// rotation should only affect one square at a time,</span>
     <span style="color: #666666; font-style: italic;">//   so push and then pop that alteration to the coordinate axis</span>
     pushMatrix<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     rotate<span style="color: #009900;">&#40;</span>radians<span style="color: #009900;">&#40;</span>j2<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// rotate the axis</span>
     rect<span style="color: #009900;">&#40;</span>j1, j1, <span style="color: #cc66cc;">30</span>, <span style="color: #cc66cc;">30</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// plot the square</span>
     popMatrix<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// return the axis to its original state</span>
&nbsp;
     x<span style="color: #339933;">=</span><span style="color: #cc66cc;">30</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// x-position advances for each square drawn in row</span>
     y<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// y-position shouldn't change in the middle of a row</span>
   <span style="color: #009900;">&#125;</span>
   x<span style="color: #339933;">=-</span><span style="color: #cc66cc;">450</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// return x to beginning of row position</span>
   y<span style="color: #339933;">=</span><span style="color: #cc66cc;">30</span><span style="color: #339933;">;</span>   <span style="color: #666666; font-style: italic;">// adjust y to next row</span>
 <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h2>OpenFrameworks</h2>
<iframe src="http://www.youtube.com/embed/-bpHkykMpkU?version=3&amp;wmode=transparent" width="635" height="501" title="YouTube video player" style="background-color:#000;display:block;margin-bottom:0;max-width:100%;" frameborder="0" allowfullscreen></iframe><p style="font-size:11px;margin-top:0;"><a href="http://www.youtube.com/watch?v=-bpHkykMpkU" target="_blank" title="Watch on YouTube">Watch this video on YouTube</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://whatnot.merichar.org/2011/01/12/interactive-art-computational-design-project-1-schotter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Interactive Art &amp; Computational Design &#8211; Project 1: Text Rain</title>
		<link>http://whatnot.merichar.org/2011/01/12/interactive-art-computational-design-project-1-text-rain/</link>
		<comments>http://whatnot.merichar.org/2011/01/12/interactive-art-computational-design-project-1-text-rain/#comments</comments>
		<pubDate>Wed, 12 Jan 2011 11:11:50 +0000</pubDate>
		<dc:creator>merichar</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://whatnot.merichar.org/?p=84</guid>
		<description><![CDATA[Reproducing Text Rain using OpenFrameworks I love when they get caught on the whiteboard ledge.]]></description>
			<content:encoded><![CDATA[<h1>Reproducing Text Rain using OpenFrameworks</h1>
<p>
<iframe src="http://www.youtube.com/embed/5ySksl4-ohQ?version=3&amp;wmode=transparent" width="635" height="501" title="YouTube video player" style="background-color:#000;display:block;margin-bottom:0;max-width:100%;" frameborder="0" allowfullscreen></iframe><p style="font-size:11px;margin-top:0;"><a href="http://www.youtube.com/watch?v=5ySksl4-ohQ" target="_blank" title="Watch on YouTube">Watch this video on YouTube</a>.</p><br />
I love when they get caught on the whiteboard ledge.</p>
]]></content:encoded>
			<wfw:commentRss>http://whatnot.merichar.org/2011/01/12/interactive-art-computational-design-project-1-text-rain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

