<?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>slightlymore</title>
	<atom:link href="http://slightlymore.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://slightlymore.co.uk</link>
	<description>the online residence of Clinton the intertube sorcerer</description>
	<lastBuildDate>Mon, 13 Feb 2012 12:03:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Photographing the Moon</title>
		<link>http://slightlymore.co.uk/photographing-the-moon/</link>
		<comments>http://slightlymore.co.uk/photographing-the-moon/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 20:57:21 +0000</pubDate>
		<dc:creator>Clinton Montague</dc:creator>
				<category><![CDATA[Photography]]></category>
		<category><![CDATA[Side projects]]></category>

		<guid isPermaLink="false">http://slightlymore.co.uk/?p=1529</guid>
		<description><![CDATA[I&#8217;ve recently become obsessed with the night sky. I think that it was Jupiter turning up in October last year which did it. Since then I&#8217;ve looked up for Jupiter on a nightly basis, and have become interested in what else is up there too. While I don&#8217;t know what most of the constellations are, [...]]]></description>
			<content:encoded><![CDATA[<div class="alignright"><div class="g-plusone" data-href="http://slightlymore.co.uk/photographing-the-moon/" size="small" count="true"></div></div><div class="tweetmeme_button" style="float: right; margin-top: -16px; margin-left: 10px;margin-right:0;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fslightlymore.co.uk%2Fphotographing-the-moon%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fslightlymore.co.uk%2Fphotographing-the-moon%2F&amp;source=iblamefish&amp;style=compact&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://www.flickr.com/photos/slightlymore/6797534991/in/photostream"><img src="http://farm8.staticflickr.com/7169/6797518819_edc86ea73c.jpg" alt="" /></a></p>
<p style="clear: both;">I&#8217;ve recently become obsessed with the night sky. I think that it was Jupiter turning up in October last year which did it. Since then I&#8217;ve looked up for Jupiter on a nightly basis, and have become interested in what else is up there too. While I don&#8217;t know what most of the constellations are, I&#8217;m beginning to know to look for certain things based on other things in the sky, which is pretty cool.</p>
<p>Anyway, I charged up my camera battery and thought that I&#8217;d start taking pictures of space. Yesterday I got a couple of blurry overexposed pictures, but today I tweaked the settings a little and ended up with the picture shown above. I&#8217;m really impressed.</p>
<div class="alignright"><div class="g-plusone" data-href="http://slightlymore.co.uk/photographing-the-moon/" size="small" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://slightlymore.co.uk/photographing-the-moon/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Generative art experiment 3.5: Lord of the targets</title>
		<link>http://slightlymore.co.uk/generative-art-experiment-3-5-lord-of-the-targets/</link>
		<comments>http://slightlymore.co.uk/generative-art-experiment-3-5-lord-of-the-targets/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 21:00:02 +0000</pubDate>
		<dc:creator>Clinton Montague</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://slightlymore.co.uk/?p=1522</guid>
		<description><![CDATA[void setup &#40;&#41; &#123; smooth&#40;&#41;; size&#40;500,900&#41;; render &#40;&#41;; &#125; &#160; void render &#40;&#41; &#123; fill &#40;0, 0&#41;; background&#40;255, 100, 0&#41;; for &#40;int i = 0; i &#60; random&#40;50, 200&#41;; i++&#41; &#123; drawRings &#40;&#41;; &#125; &#125; &#160; void drawRings &#40;&#41; &#123; &#160; float radius = random &#40;20, width/1.4&#41;; float x = random &#40;0, width&#41;; float y [...]]]></description>
			<content:encoded><![CDATA[<div class="alignright"><div class="g-plusone" data-href="http://slightlymore.co.uk/generative-art-experiment-3-5-lord-of-the-targets/" size="small" count="true"></div></div><div class="tweetmeme_button" style="float: right; margin-top: -16px; margin-left: 10px;margin-right:0;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fslightlymore.co.uk%2Fgenerative-art-experiment-3-5-lord-of-the-targets%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fslightlymore.co.uk%2Fgenerative-art-experiment-3-5-lord-of-the-targets%2F&amp;source=iblamefish&amp;style=compact&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://slightlymore.co.uk/wordpress/wp-content/uploads/2012/01/Screen-Shot-2012-01-31-at-00.59.22.png"><img src="http://slightlymore.co.uk/wordpress/wp-content/uploads/2012/01/Screen-Shot-2012-01-31-at-00.59.22.png" alt="" title="Lord of the targets" width="614" height="1036" class="alignnone size-full wp-image-1527" /></a></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>
  smooth<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  size<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">500</span>,<span style="color: #cc66cc;">900</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  render <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">void</span> render <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
<span style="color: #009900;">&#123;</span>
  fill <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</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: #cc66cc;">100</span>, <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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> i <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> random<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">50</span>, <span style="color: #cc66cc;">200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    drawRings <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">void</span> drawRings <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #000066; font-weight: bold;">float</span> radius <span style="color: #339933;">=</span> random <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">20</span>, width<span style="color: #339933;">/</span><span style="color: #cc66cc;">1.4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">float</span> x <span style="color: #339933;">=</span> random <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span>, width<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">float</span> y <span style="color: #339933;">=</span> random <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span>, height<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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> i <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> radius<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">float</span> w <span style="color: #339933;">=</span> random <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">50</span>, <span style="color: #cc66cc;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">float</span> redness <span style="color: #339933;">=</span> random <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">5</span>, <span style="color: #cc66cc;">200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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> j <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> j <span style="color: #339933;">&lt;</span> w<span style="color: #339933;">;</span> j<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      stroke <span style="color: #009900;">&#40;</span>redness, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      ellipse <span style="color: #009900;">&#40;</span>x, y, i, i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      i<span style="color: #339933;">++;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">void</span> mouseClicked <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
<span style="color: #009900;">&#123;</span>
  render<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<div class="alignright"><div class="g-plusone" data-href="http://slightlymore.co.uk/generative-art-experiment-3-5-lord-of-the-targets/" size="small" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://slightlymore.co.uk/generative-art-experiment-3-5-lord-of-the-targets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generative art experiment 3: Lord of the rings</title>
		<link>http://slightlymore.co.uk/generative-art-experiment-3-lord-of-the-rings/</link>
		<comments>http://slightlymore.co.uk/generative-art-experiment-3-lord-of-the-rings/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 20:16:53 +0000</pubDate>
		<dc:creator>Clinton Montague</dc:creator>
				<category><![CDATA[Processing]]></category>
		<category><![CDATA[Visual programming]]></category>

		<guid isPermaLink="false">http://slightlymore.co.uk/?p=1510</guid>
		<description><![CDATA[void setup &#40;&#41; &#123; smooth&#40;&#41;; size&#40;500,900&#41;; render &#40;&#41;; &#125; &#160; void render &#40;&#41; &#123; fill &#40;0, 0&#41;; background&#40;255, 100, 0&#41;; for &#40;int i = 0; i &#60; random&#40;50, 200&#41;; i++&#41; &#123; drawRings &#40;&#41;; &#125; &#125; &#160; void drawRings &#40;&#41; &#123; &#160; float radius = random &#40;20, width/1.4&#41;; float x = random &#40;0, width&#41;; float y [...]]]></description>
			<content:encoded><![CDATA[<div class="alignright"><div class="g-plusone" data-href="http://slightlymore.co.uk/generative-art-experiment-3-lord-of-the-rings/" size="small" count="true"></div></div><div class="tweetmeme_button" style="float: right; margin-top: -16px; margin-left: 10px;margin-right:0;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fslightlymore.co.uk%2Fgenerative-art-experiment-3-lord-of-the-rings%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fslightlymore.co.uk%2Fgenerative-art-experiment-3-lord-of-the-rings%2F&amp;source=iblamefish&amp;style=compact&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://slightlymore.co.uk/wordpress/wp-content/uploads/2012/01/Screen-Shot-2012-01-30-at-18.15.49.png"><img src="http://slightlymore.co.uk/wordpress/wp-content/uploads/2012/01/Screen-Shot-2012-01-30-at-18.15.49.png" alt="" title="Lord of the rings" width="498" height="899" class="alignnone size-full wp-image-1511" /></a></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>
  smooth<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  size<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">500</span>,<span style="color: #cc66cc;">900</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  render <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">void</span> render <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
<span style="color: #009900;">&#123;</span>
  fill <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</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: #cc66cc;">100</span>, <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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> i <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> random<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">50</span>, <span style="color: #cc66cc;">200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    drawRings <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">void</span> drawRings <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #000066; font-weight: bold;">float</span> radius <span style="color: #339933;">=</span> random <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">20</span>, width<span style="color: #339933;">/</span><span style="color: #cc66cc;">1.4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">float</span> x <span style="color: #339933;">=</span> random <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span>, width<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">float</span> y <span style="color: #339933;">=</span> random <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span>, height<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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> i <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> radius<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">float</span> redness <span style="color: #339933;">=</span> random <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">50</span>, <span style="color: #cc66cc;">200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    stroke <span style="color: #009900;">&#40;</span>redness, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    ellipse <span style="color: #009900;">&#40;</span>x, y, i, i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">void</span> mouseClicked <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
<span style="color: #009900;">&#123;</span>
  render<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<div class="alignright"><div class="g-plusone" data-href="http://slightlymore.co.uk/generative-art-experiment-3-lord-of-the-rings/" size="small" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://slightlymore.co.uk/generative-art-experiment-3-lord-of-the-rings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The funny side of being obsessed by something</title>
		<link>http://slightlymore.co.uk/the-funny-side-of-being-obsessed-by-something/</link>
		<comments>http://slightlymore.co.uk/the-funny-side-of-being-obsessed-by-something/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 22:43:05 +0000</pubDate>
		<dc:creator>Clinton Montague</dc:creator>
				<category><![CDATA[Randomness]]></category>
		<category><![CDATA[Roller coasters]]></category>

		<guid isPermaLink="false">http://slightlymore.co.uk/?p=1497</guid>
		<description><![CDATA[I saw this picture today and I had a little chuckle to myself when I read this post on a roller coaster forum I read. Not sure if it&#8217;s BREAKING NEWS, but&#8230; We (the coaster nerds) have been following the construction of this since around this time last year, so &#8220;BREAKING NEWS&#8221; hardly fits. I [...]]]></description>
			<content:encoded><![CDATA[<div class="alignright"><div class="g-plusone" data-href="http://slightlymore.co.uk/the-funny-side-of-being-obsessed-by-something/" size="small" count="true"></div></div><div class="tweetmeme_button" style="float: right; margin-top: -16px; margin-left: 10px;margin-right:0;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fslightlymore.co.uk%2Fthe-funny-side-of-being-obsessed-by-something%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fslightlymore.co.uk%2Fthe-funny-side-of-being-obsessed-by-something%2F&amp;source=iblamefish&amp;style=compact&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img src="http://slightlymore.co.uk/wordpress/wp-content/uploads/2012/01/PdDeS-609x455.jpg" alt="" title="BREAKING NEWS" width="609" height="455" class="alignnone size-large wp-image-1498" /></p>
<p>I saw this picture today and I had a little chuckle to myself when I read <a href="http://www.coasterforce.com/forums/viewtopic.php?p=781774#p781774">this post</a> on a roller coaster forum I read. </p>
<blockquote><p> Not sure if it&#8217;s BREAKING NEWS, but&#8230;</p></blockquote>
<p style="clear: both">We (the coaster nerds) have been following the construction of this since around this time last year, so &#8220;BREAKING NEWS&#8221; hardly fits. I remember watching the video of it being tested back in October &#8211; and I&#8217;ve been excited about riding it for longer than I should admit to. </p>
<p><a href="http://www.youtube.com/watch?v=K_ncieFrrz8"><img src="http://img.youtube.com/vi/K_ncieFrrz8/2.jpg"></a></p>
<p><a href="http://www.youtube.com/watch?v=K_ncieFrrz8">Click here</a> to view the video on YouTube.</p>

<div class="alignright"><div class="g-plusone" data-href="http://slightlymore.co.uk/the-funny-side-of-being-obsessed-by-something/" size="small" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://slightlymore.co.uk/the-funny-side-of-being-obsessed-by-something/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generative art experiment 2: Pinkchalk spiral</title>
		<link>http://slightlymore.co.uk/generative-art-experiment-2-pinkchalk-spiral/</link>
		<comments>http://slightlymore.co.uk/generative-art-experiment-2-pinkchalk-spiral/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 14:13:28 +0000</pubDate>
		<dc:creator>Clinton Montague</dc:creator>
				<category><![CDATA[Processing]]></category>
		<category><![CDATA[Visual programming]]></category>

		<guid isPermaLink="false">http://slightlymore.co.uk/?p=1485</guid>
		<description><![CDATA[&#160; float oldx = -999; float oldy = -999; float x; float y; int colour = 0; &#160; void setup &#40;&#41; &#123; smooth&#40;&#41;; size &#40;600, 600&#41;; &#160; drawit &#40;&#41;; &#125; &#160; void drawit &#40;&#41; &#123; background&#40;155&#41;; oldx = -999; oldy = -999; colour = 0; int spirals = floor&#40;random&#40;500&#41;&#41;; println&#40;&#34;drawing&#34; + spirals&#41;; for &#40;int i [...]]]></description>
			<content:encoded><![CDATA[<div class="alignright"><div class="g-plusone" data-href="http://slightlymore.co.uk/generative-art-experiment-2-pinkchalk-spiral/" size="small" count="true"></div></div><div class="tweetmeme_button" style="float: right; margin-top: -16px; margin-left: 10px;margin-right:0;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fslightlymore.co.uk%2Fgenerative-art-experiment-2-pinkchalk-spiral%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fslightlymore.co.uk%2Fgenerative-art-experiment-2-pinkchalk-spiral%2F&amp;source=iblamefish&amp;style=compact&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img src="http://slightlymore.co.uk/wordpress/wp-content/uploads/2012/01/6681835847_1aeba8bb6c_z.jpg" alt="" title="6681835847_1aeba8bb6c_z" width="600" height="600" class="alignnone size-full wp-image-1490" /></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">&nbsp;
<span style="color: #000066; font-weight: bold;">float</span> oldx <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">999</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">float</span> oldy <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">999</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">float</span> x<span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">float</span> y<span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">int</span> colour <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
<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>
  smooth<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  size <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">600</span>, <span style="color: #cc66cc;">600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  drawit <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">void</span> drawit <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  background<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">155</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  oldx <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">999</span><span style="color: #339933;">;</span>
  oldy <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">999</span><span style="color: #339933;">;</span>
  colour <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">int</span> spirals <span style="color: #339933;">=</span> floor<span style="color: #009900;">&#40;</span>random<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">500</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  println<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;drawing&quot;</span> <span style="color: #339933;">+</span> spirals<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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> i <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> spirals<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
&nbsp;
    stroke <span style="color: #009900;">&#40;</span>colour, <span style="color: #cc66cc;">0</span>, random<span style="color: #009900;">&#40;</span>colour<span style="color: #009900;">&#41;</span>, <span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    strokeWeight<span style="color: #009900;">&#40;</span>random<span style="color: #009900;">&#40;</span>i <span style="color: #339933;">/</span> <span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    spiral <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    colour<span style="color: #339933;">+=</span><span style="color: #cc66cc;">255</span><span style="color: #339933;">/</span>spirals<span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
<span style="color: #000066; font-weight: bold;">void</span> spiral <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">float</span> variance <span style="color: #339933;">=</span> random<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">360</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">float</span> angle <span style="color: #339933;">=</span> variance<span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">float</span> r <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">float</span> endangle <span style="color: #339933;">=</span> random<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1500</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> variance<span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">float</span> inc <span style="color: #339933;">=</span> random <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1.6</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">0.8</span><span style="color: #339933;">;</span>
  <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>abs<span style="color: #009900;">&#40;</span>angle<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> endangle<span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
&nbsp;
  x <span style="color: #339933;">=</span> cos<span style="color: #009900;">&#40;</span>radians<span style="color: #009900;">&#40;</span>angle<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> r <span style="color: #339933;">+</span> random<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  y <span style="color: #339933;">=</span> sin<span style="color: #009900;">&#40;</span>radians<span style="color: #009900;">&#40;</span>angle<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> r <span style="color: #339933;">+</span> random<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>abs<span style="color: #009900;">&#40;</span>oldx<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">999</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    line <span style="color: #009900;">&#40;</span>x <span style="color: #339933;">+</span> width<span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span>, y<span style="color: #339933;">+</span> height<span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span>, oldx <span style="color: #339933;">+</span> width<span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span>, oldy <span style="color: #339933;">+</span> height<span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  oldx <span style="color: #339933;">=</span> x <span style="color: #339933;">+</span> cos<span style="color: #009900;">&#40;</span>radians<span style="color: #009900;">&#40;</span>angle<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  oldy <span style="color: #339933;">=</span> y <span style="color: #339933;">+</span> sin<span style="color: #009900;">&#40;</span>radians<span style="color: #009900;">&#40;</span>angle<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  angle<span style="color: #339933;">+=</span>inc<span style="color: #339933;">;</span>
  r<span style="color: #339933;">+=</span>.1<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<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: #009900;">&#125;</span>
<span style="color: #000066; font-weight: bold;">void</span> keyPressed <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
<span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>keyCode <span style="color: #339933;">==</span> DOWN<span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    drawit <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>keyCode <span style="color: #339933;">==</span> <span style="color: #000000; font-weight: bold;">RETURN</span> <span style="color: #339933;">||</span> keyCode <span style="color: #339933;">==</span> ENTER<span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    saveFrame <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;frame-####.tiff&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<div class="alignright"><div class="g-plusone" data-href="http://slightlymore.co.uk/generative-art-experiment-2-pinkchalk-spiral/" size="small" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://slightlymore.co.uk/generative-art-experiment-2-pinkchalk-spiral/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generative art experiment 1: Rainbow with a headache</title>
		<link>http://slightlymore.co.uk/generative-art-experiment-1-rainbow-with-a-headache/</link>
		<comments>http://slightlymore.co.uk/generative-art-experiment-1-rainbow-with-a-headache/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 14:12:14 +0000</pubDate>
		<dc:creator>Clinton Montague</dc:creator>
				<category><![CDATA[Processing]]></category>
		<category><![CDATA[Visual programming]]></category>

		<guid isPermaLink="false">http://slightlymore.co.uk/?p=1476</guid>
		<description><![CDATA[int frame = 0; void setup &#40;&#41; &#123; size &#40;800, 300&#41;; background&#40;0&#41;; smooth &#40;&#41;; &#125; &#160; void draw &#40;&#41; &#123; int step = 10; float lastx = -999; float lasty = -999; float ynoise = random&#40;10&#41;; float y; float xsteps = width; float ysteps = 100; &#160; &#160; colorMode&#40;HSB, ysteps&#41;; for &#40;int i = 0; [...]]]></description>
			<content:encoded><![CDATA[<div class="alignright"><div class="g-plusone" data-href="http://slightlymore.co.uk/generative-art-experiment-1-rainbow-with-a-headache/" size="small" count="true"></div></div><div class="tweetmeme_button" style="float: right; margin-top: -16px; margin-left: 10px;margin-right:0;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fslightlymore.co.uk%2Fgenerative-art-experiment-1-rainbow-with-a-headache%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fslightlymore.co.uk%2Fgenerative-art-experiment-1-rainbow-with-a-headache%2F&amp;source=iblamefish&amp;style=compact&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<iframe src='http://player.vimeo.com/video/34862441?title=0&amp;byline=0&amp;portrait=0' width='616' height='231' frameborder='0'></iframe>
<p><br style="clear: both;" /></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">int</span> frame <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<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>
  size <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">800</span>, <span style="color: #cc66cc;">300</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  background<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</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>
<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: #000066; font-weight: bold;">int</span> step <span style="color: #339933;">=</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">float</span> lastx <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">999</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">float</span> lasty <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">999</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">float</span> ynoise <span style="color: #339933;">=</span> random<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">float</span> y<span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">float</span> xsteps <span style="color: #339933;">=</span> width<span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">float</span> ysteps <span style="color: #339933;">=</span> <span style="color: #cc66cc;">100</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
  colorMode<span style="color: #009900;">&#40;</span>HSB, ysteps<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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> i <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> ysteps<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</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> x <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> x <span style="color: #339933;">&lt;</span> xsteps<span style="color: #339933;">;</span> x<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      y <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>height <span style="color: #339933;">/</span> ysteps<span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> i <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>noise<span style="color: #009900;">&#40;</span>ynoise<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">80</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">40</span><span style="color: #339933;">;</span>
      <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>lastx <span style="color: #339933;">&gt;</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">999</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        stroke <span style="color: #009900;">&#40;</span>i, <span style="color: #cc66cc;">100</span>, <span style="color: #cc66cc;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        line <span style="color: #009900;">&#40;</span>x, y, lastx, lasty<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
      lastx <span style="color: #339933;">=</span> x<span style="color: #339933;">;</span>
      lasty <span style="color: #339933;">=</span> y<span style="color: #339933;">;</span>
      ynoise <span style="color: #339933;">+=</span> <span style="color: #cc66cc;">0.1</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>frame <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">20</span> <span style="color: #339933;">&amp;&amp;</span> frame <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">500</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// you can use quicktime to convert the image sequence to a movie. </span>
    saveFrame <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;frame-####.png&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  frame<span style="color: #339933;">++;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<div class="alignright"><div class="g-plusone" data-href="http://slightlymore.co.uk/generative-art-experiment-1-rainbow-with-a-headache/" size="small" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://slightlymore.co.uk/generative-art-experiment-1-rainbow-with-a-headache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My data visualisation article for the 12 devs of xmas</title>
		<link>http://slightlymore.co.uk/my-data-visualisation-article-for-the-12-devs-of-xmas/</link>
		<comments>http://slightlymore.co.uk/my-data-visualisation-article-for-the-12-devs-of-xmas/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 17:46:58 +0000</pubDate>
		<dc:creator>Clinton Montague</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Side projects]]></category>

		<guid isPermaLink="false">http://slightlymore.co.uk/?p=1468</guid>
		<description><![CDATA[Some of you may know that I was working on a side project over Christas with @onishiweb and @mrqwest called The 12 Devs of Xmas. It&#8217;s kind of like a reverse 24ways where we post a new article on each of the 12 days of Christmas (well, actually the 12 days starting from Boxing day). [...]]]></description>
			<content:encoded><![CDATA[<div class="alignright"><div class="g-plusone" data-href="http://slightlymore.co.uk/my-data-visualisation-article-for-the-12-devs-of-xmas/" size="small" count="true"></div></div><div class="tweetmeme_button" style="float: right; margin-top: -16px; margin-left: 10px;margin-right:0;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fslightlymore.co.uk%2Fmy-data-visualisation-article-for-the-12-devs-of-xmas%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fslightlymore.co.uk%2Fmy-data-visualisation-article-for-the-12-devs-of-xmas%2F&amp;source=iblamefish&amp;style=compact&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Some of you may know that I was working on a side project over Christas with <a href="http://twitter.com/onishiweb/">@onishiweb</a> and <a href="http://twitter.com/mrqwest">@mrqwest</a> called <a href="http://12devsofxmas.co.uk/">The 12 Devs of Xmas</a>. It&#8217;s kind of like a reverse <a href="http://24ways.org">24ways</a> where we post a new article on each of the 12 days of Christmas (well, actually the 12 days starting from Boxing day). </p>
<p>We&#8217;ve had a great set of articles so far, and there are only two left to go! If you haven&#8217;t been there already, you should seriously check it out.</p>
<p>My article on data visualisation using d3.js went live last night. The screenshot below shows what you&#8217;ll be able to build if you follow the tutorial. Pretty sweet!</p>
<p><a href="http://www.12devsofxmas.co.uk/2012/01/data-visualisation/"><img style="border: 0;" class="alignnone size-large wp-image-1469" src="http://slightlymore.co.uk/wordpress/wp-content/uploads/2012/01/Screen-Shot-2012-01-03-at-21.17-609x552.png" alt="" width="609" height="552" /></a></p>
<p><a href="http://www.12devsofxmas.co.uk/2012/01/data-visualisation/" class="demo">View my article &rarr;</a></p>
<p><br style="clear: both" /></p>
<div class="alignright"><div class="g-plusone" data-href="http://slightlymore.co.uk/my-data-visualisation-article-for-the-12-devs-of-xmas/" size="small" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://slightlymore.co.uk/my-data-visualisation-article-for-the-12-devs-of-xmas/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Random Hacks of Kindness Oxford 2011 &#8211; The Humanitarian Project (IATI) Data</title>
		<link>http://slightlymore.co.uk/random-hacks-of-kindness-oxford-2011/</link>
		<comments>http://slightlymore.co.uk/random-hacks-of-kindness-oxford-2011/#comments</comments>
		<pubDate>Mon, 05 Dec 2011 20:38:56 +0000</pubDate>
		<dc:creator>Clinton Montague</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://slightlymore.co.uk/?p=1440</guid>
		<description><![CDATA[I was lucky enough to: a) hear about a global movement called Random Hacks of Kindness; and b) live in a city where one of the events was taking place. Throughout the world on the weekend of the 3rd and 4th of December, there were rooms full of geeks, probably fuelled with pizza (we were, [...]]]></description>
			<content:encoded><![CDATA[<div class="alignright"><div class="g-plusone" data-href="http://slightlymore.co.uk/random-hacks-of-kindness-oxford-2011/" size="small" count="true"></div></div><div class="tweetmeme_button" style="float: right; margin-top: -16px; margin-left: 10px;margin-right:0;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fslightlymore.co.uk%2Frandom-hacks-of-kindness-oxford-2011%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fslightlymore.co.uk%2Frandom-hacks-of-kindness-oxford-2011%2F&amp;source=iblamefish&amp;style=compact&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I was lucky enough to: a) hear about a global movement called Random Hacks of Kindness; and b) live in a city where one of the events was taking place. Throughout the world on the weekend of the 3rd and 4th of December, there were rooms full of geeks, probably fuelled with pizza (we were, at any rate) who were given a set of problems to choose from which were for the greater good. You can kind of think of it as an incubator where new projects are born, and the aim is that the end of the weekend isn&#8217;t the end of the project &#8211; it&#8217;s merely the beginning. </p>
<p>In Oxford, we had a choice between six projects including: predicting floods based on old weather data, visualising humanitarian data, building an app for fair trade cities and helping to improve a disaster management application called <a href="http://sahanafoundation.org/">Sahana</a>. I chose to go with the humanitarian data project because it involved playing with a huge dataset and I love creating interactive things and wotsits. </p>
<p>The problem was put forwards by Oxfam (who helped to set up an run the event) &#8211; but the aim was to allow any charity using the IATI database to get a copy of it and start using it. Exciting stuff! The IATI format allows for loads of (or minimal) data to be entered for each activity, and the API provides a way to query for pretty much whatever you want. </p>
<p>We initially had the idea of being able to drill down into countries and have pins representing projects in their actual locations, then from there you could click on one to learn more about the activity. Unfortunately, Oxfam&#8217;s data is relatively new in IATI (I think only a week-or-so) so much of this data was missing. We decided that we should therefore use pins on the map where geolocation details were present, but use a list to display the projects for the rest. </p>
<p>The data also spans a huge timespan &#8211; so I started wondering how cool it would look if you could press a &#8216;play&#8217; button and see how different kinds of projects moved in both funding value or other criteria (perhaps with growing/shrinking circles or bar charts) and in physical location. I really like what Hans Rosling does with data, and thought it would be cool if we could find a couple of animations which really tell a story about how times change and funding solves problems. If you haven&#8217;t seen <a href="http://http://www.ted.com/talks/hans_rosling_shows_the_best_stats_you_ve_ever_seen.html">Hans Rosling&#8217;s TED talk</a> you should do so. You can see the evolution of the idea (maybe, if you look hard and squint) in our scribblings.</p>
<p><img src="http://slightlymore.co.uk/wordpress/wp-content/uploads/2011/12/spec-609x819.jpg" alt="" title="spec" width="609" height="819" class="alignnone size-large wp-image-1442" /></p>
<p>After setting up Heroku, a github repository and wrestling for what felt like hours getting websockets to communicate properly, we set about building something more interesting than sending messages using the javascript console and watching for the reply from the server. It was time to dig in and get our hands dirty.</p>
<p>Then it was time for presentations. Oh dear. We&#8217;ve only got an H1 tag (with RHOK spelt incorrectly), an input field, and an anchor tag with no href attribute. I had to present the project armed only with the shady sketches we&#8217;d drawn before. </p>
<p>After that, we realised that our choice of using d3.js because of it&#8217;s amazing capabilities of both drawing data and transitioning through states would fall over because it became clear that the data wasn&#8217;t clean or consistant enough for us to do this within such a short timeframe. This was turning into a disaster. </p>
<p>After pizza and beer, and with great thanks to <a href="http://bfoxall.com/">Ben</a>, we had a <a href="http://code.google.com/apis/chart/interactive/docs/gallery/geochart.html">Google Geochart</a>. From here, things would start to get better. We built a few queries, I finally got to grips with the IATI api, and came up with functions to methods to fill the Geochart with real IATI data. I hacked through the night and by the morning we had something which was beginning to not only work, but look pretty respectable too. <a href="https://twitter.com/#!/iblamefish/status/143183647804104704">It was hard at points</a>, but <a href="https://twitter.com/#!/anked/status/143213448304660481">seeing other RHOKers coding all night</a> too was really encouraging and kept me going. </p>
<p>People began to arrive at around 10, we had breakfast and everyone got straight back into coding without a formal &#8216;now start hacking!&#8217; prompt. Everyone was rearing to get back working on their projects and the vibe of the previous day fell back into place very quickly. You could hear the excited voices of people after they&#8217;d had a breakthrough.</p>
<p>The presentation in the morning was much better (starting at 3:32 in the video below) &#8211; I was feeling so excited about what we&#8217;d achieved that I even opened with an impromptu joke at the beginning about our H1 tag. How cool to be in a room where people would not only get it, but would laugh at it :). We got some good questions and suggestions at the end which we still need to (remember) and look into. </p>
<p><iframe src="http://www.ustream.tv/embed/recorded/18923750" width="608" height="368" scrolling="no" frameborder="0" style="border: 0px none transparent;"></iframe></p>
<p>As the afternoon moved on, time faded away and final presentation approached people started winding down and exploring what other people had been doing.</p>
<p>So without further ado, I will present you with the fruits of my team&#8217;s labour: <a href="http://rhok-iati.herokuapp.com/">The Humanitarian Project (IATI) Data</a>!</p>
<p><a href="http://rhok-iati.herokuapp.com/"><img src="http://slightlymore.co.uk/wordpress/wp-content/uploads/2011/12/Screen-Shot-2011-12-04-at-05.39.58-1-609x389.png" alt="" title="Screen Shot 2011-12-04 at 05.39.58 (1)" width="609" height="389" class="alignnone size-large wp-image-1444" /></a></p>
<p>It is of course very much still a work in progress. There will be bugs, there will be browser issues, there will be times where it simply won&#8217;t work. It&#8217;s all open source and <a href="https://github.com/slightlymore/IATI-data-visualisation">hosted on github</a> so please get involved, report or fix bugs and spread the word. </p>
<p>This is going to sound awfully cheesy, but this is not the end, this is the beginning. I&#8217;m going to continue working on this project and I hope that others will be excited by this project and want to join in. It&#8217;s not only got the potential to both be pretty damn cool, but also to help charities explain the stories of their projects in a visually compelling way. </p>
<p>Thanks to <a href="http://www.whiteoctober.co.uk/">White October</a> for hosting the event, <a href="http://www.oxfam.org.uk/">Oxfam</a> for helping to organise it, and all of the sponsors (<a href="http://oneltd.co.uk/">One</a>, <a href="http://incuna.com/">Incuna</a>, <a href="http://www.practicalparticipation.co.uk/">Practical Participation</a> and <a href="http://www.guardian.co.uk/open-platform">Guardian Open Platform</a>) for providing pizza, beer, cakes &#038; coffee, and to everyone there for providing the atmosphere for such a great time. </p>
<p><a class="demo" href="http://rhok-iati.herokuapp.com/">rhok-iati.herokuapp.com &rarr;</a></p>
<ul>
<li><a href="http://wiki.rhok.org/Oxford">Oxford&#8217;s page</a> on the <a href="http://wiki.rhok.org/Main_Page">RHOK wiki</a>.</a></li>
<li><a href="http://wiki.rhok.org/RHoK_4.0_-_Oxford/Projects/Visualising_Programme_Data">Visualising Programme Data on the RHOK wiki</a>.</li>
<li><a href="http://www.rhok.org/problems/interactive-display-humanitarian-and-development-project-data"> Interactive display of humanitarian and development project data page</a>.</li>
<li><a href="http://www.rhok.org/solutions/visualising-humanitarian-project-iati-data> Visualising Humanitarian Project (IATI) Data solution page</a>.</li>
<li><a href="https://github.com/slightlymore/IATI-data-visualisation">github repository</a>.</li>
<li><a href="http://rhok-iati.herokuapp.com/">The actual thing</a>.</li>
</ul>
<p>I also got the opportunity to go into a shed with a hefty 3D printer in it. Next to it was a 3D print of a 3D printer in a shed while I was there. True story. </p>
<div class="alignright"><div class="g-plusone" data-href="http://slightlymore.co.uk/random-hacks-of-kindness-oxford-2011/" size="small" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://slightlymore.co.uk/random-hacks-of-kindness-oxford-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Interactive particle system with Ardiuno and Processing</title>
		<link>http://slightlymore.co.uk/interactive-particle-system-with-ardiuno-and-processing/</link>
		<comments>http://slightlymore.co.uk/interactive-particle-system-with-ardiuno-and-processing/#comments</comments>
		<pubDate>Thu, 01 Dec 2011 19:47:10 +0000</pubDate>
		<dc:creator>Clinton Montague</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Hacking]]></category>

		<guid isPermaLink="false">http://slightlymore.co.uk/?p=1424</guid>
		<description><![CDATA[Quickly threw this together when I got home from work. Pretty impressive (if you ask me!) considering I&#8217;m a novice with both Processing and Arduino. Demo The LEDs on the Arduino let you read out the light level (read as an 8-bit binary number) so that the more light that the photosensor receives, the higher [...]]]></description>
			<content:encoded><![CDATA[<div class="alignright"><div class="g-plusone" data-href="http://slightlymore.co.uk/interactive-particle-system-with-ardiuno-and-processing/" size="small" count="true"></div></div><div class="tweetmeme_button" style="float: right; margin-top: -16px; margin-left: 10px;margin-right:0;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fslightlymore.co.uk%2Finteractive-particle-system-with-ardiuno-and-processing%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fslightlymore.co.uk%2Finteractive-particle-system-with-ardiuno-and-processing%2F&amp;source=iblamefish&amp;style=compact&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Quickly threw this together when I got home from work. Pretty impressive (if you ask me!) considering I&#8217;m a novice with both Processing and Arduino. </p>
<h2>Demo</h2>
<p><iframe width="420" height="315" src="http://www.youtube.com/embed/-a8wZiXY-R0" frameborder="0" allowfullscreen></iframe></p>
<p>The LEDs on the Arduino let you read out the light level (read as an 8-bit binary number) so that the more light that the photosensor receives, the higher the number represented on the LEDs will be. It then spits the number down a serial connection which controls the background colour and the starting position of the particles with Processing. </p>
<p>I see lots of weird and wonderful interactive art projects on the horizon&#8230; I&#8217;ve clearly got loads of Processing to learn to make something awe-inspiring, but I already have interesting ideas for the Arduino part including getting it to update with a Wii controller or based on your proximity to it. Maybe hook up a couple of sensors so that you can wave your arms around to generate the art? </p>
<p>Also, it&#8217;ll be fun to find out what kinds of thing can be generated &#8211; particles, fractals, trees. Let&#8217;s see just how creative I can get with this stuff :D</p>
<h2>Arduino code</h2>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
</pre></td><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">int</span> data <span style="color: #339933;">=</span> <span style="color: #0000dd;">2</span><span style="color: #339933;">;</span> 
<span style="color: #993333;">int</span> clock <span style="color: #339933;">=</span> <span style="color: #0000dd;">3</span><span style="color: #339933;">;</span>
<span style="color: #993333;">int</span> latch <span style="color: #339933;">=</span> <span style="color: #0000dd;">4</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #993333;">int</span> sensor <span style="color: #339933;">=</span> A0<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #993333;">int</span> ledState <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #993333;">const</span> <span style="color: #993333;">int</span> ON <span style="color: #339933;">=</span> HIGH<span style="color: #339933;">;</span>
<span style="color: #993333;">const</span> <span style="color: #993333;">int</span> OFF <span style="color: #339933;">=</span> LOW<span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #993333;">void</span> setup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  pinMode<span style="color: #009900;">&#40;</span>data<span style="color: #339933;">,</span> OUTPUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  pinMode<span style="color: #009900;">&#40;</span>clock<span style="color: #339933;">,</span> OUTPUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
  pinMode<span style="color: #009900;">&#40;</span>latch<span style="color: #339933;">,</span> OUTPUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
  Serial.<span style="color: #202020;">begin</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">9600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> loop<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #993333;">int</span> colour <span style="color: #339933;">=</span> map<span style="color: #009900;">&#40;</span>analogRead<span style="color: #009900;">&#40;</span>sensor<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">,</span> <span style="color: #0000dd;">1023</span><span style="color: #339933;">,</span> <span style="color: #0000dd;">255</span><span style="color: #339933;">,</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    Serial.<span style="color: #202020;">print</span><span style="color: #009900;">&#40;</span>colour<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    Serial.<span style="color: #202020;">print</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;,&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    updateLevel<span style="color: #009900;">&#40;</span>colour<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> updateLevel<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> value<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  digitalWrite<span style="color: #009900;">&#40;</span>latch<span style="color: #339933;">,</span> LOW<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  shiftOut<span style="color: #009900;">&#40;</span>data<span style="color: #339933;">,</span> clock<span style="color: #339933;">,</span> MSBFIRST<span style="color: #339933;">,</span> value<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
  digitalWrite<span style="color: #009900;">&#40;</span>latch<span style="color: #339933;">,</span> HIGH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<h2>Processing code</h2>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">processing.serial.*</span><span style="color: #339933;">;</span>
ParticleSystem ps<span style="color: #339933;">;</span>
&nbsp;
&nbsp;
Serial port<span style="color: #339933;">;</span>
PFont font<span style="color: #339933;">;</span> 
<span style="color: #003399;">String</span> inString <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;0&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<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>
  size <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1280</span>, <span style="color: #cc66cc;">800</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  port <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Serial<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>, Serial.<span style="color: #006633;">list</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span>, <span style="color: #cc66cc;">9600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  font <span style="color: #339933;">=</span> loadFont <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SansSerif-48.vlw&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  ps <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ParticleSystem<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span>, <span style="color: #000000; font-weight: bold;">new</span> PVector<span style="color: #009900;">&#40;</span>width<span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span>,height<span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span>,<span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  textFont <span style="color: #009900;">&#40;</span>font, <span style="color: #cc66cc;">48</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  port.<span style="color: #006633;">bufferUntil</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">44</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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: #003399;">Float</span> f <span style="color: #339933;">=</span> <span style="color: #003399;">Float</span>.<span style="color: #006633;">valueOf</span><span style="color: #009900;">&#40;</span>inString<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">floatValue</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  background<span style="color: #009900;">&#40;</span>f, <span style="color: #cc66cc;">255</span> <span style="color: #339933;">-</span> f<span style="color: #339933;">*</span><span style="color: #cc66cc;">2.0</span>, f<span style="color: #339933;">*</span><span style="color: #cc66cc;">5.0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  text<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;light level: &quot;</span> <span style="color: #339933;">+</span> inString, <span style="color: #cc66cc;">10</span>, <span style="color: #cc66cc;">50</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  ps.<span style="color: #006633;">run</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  ps.<span style="color: #006633;">addParticle</span><span style="color: #009900;">&#40;</span>map<span style="color: #009900;">&#40;</span>f, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">255</span>, <span style="color: #cc66cc;">0</span>, width<span style="color: #009900;">&#41;</span>, map<span style="color: #009900;">&#40;</span>f, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">255</span>, <span style="color: #cc66cc;">0</span>, height<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">void</span> serialEvent <span style="color: #009900;">&#40;</span>Serial port<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  inString <span style="color: #339933;">=</span> port.<span style="color: #006633;">readString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  inString <span style="color: #339933;">=</span> inString.<span style="color: #006633;">substring</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span>,inString.<span style="color: #006633;">length</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">// Particle system from the prototype documentation page: // http://processing.org/learning/topics/simpleparticlesystem.html</span>
<span style="color: #000000; font-weight: bold;">class</span> ParticleSystem <span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #003399;">ArrayList</span> particles<span style="color: #339933;">;</span>    <span style="color: #666666; font-style: italic;">// An arraylist for all the particles</span>
  PVector origin<span style="color: #339933;">;</span>        <span style="color: #666666; font-style: italic;">// An origin point for where particles are born</span>
&nbsp;
  ParticleSystem<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> num, PVector v<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    particles <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">ArrayList</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>              <span style="color: #666666; font-style: italic;">// Initialize the arraylist</span>
    origin <span style="color: #339933;">=</span> v.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>                        <span style="color: #666666; font-style: italic;">// Store the origin point</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> i <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> num<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      particles.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> Particle<span style="color: #009900;">&#40;</span>origin<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    <span style="color: #666666; font-style: italic;">// Add &quot;num&quot; amount of particles to the arraylist</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000066; font-weight: bold;">void</span> run<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;">// Cycle through the ArrayList backwards b/c we are deleting</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> i <span style="color: #339933;">=</span> particles.<span style="color: #006633;">size</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">--</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      Particle p <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>Particle<span style="color: #009900;">&#41;</span> particles.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      p.<span style="color: #006633;">run</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>p.<span style="color: #006633;">dead</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        particles.<span style="color: #006633;">remove</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000066; font-weight: bold;">void</span> addParticle<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    particles.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> Particle<span style="color: #009900;">&#40;</span>origin<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">void</span> addParticle<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">float</span> x, <span style="color: #000066; font-weight: bold;">float</span> y<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    particles.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> Particle<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> PVector<span style="color: #009900;">&#40;</span>x,y<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000066; font-weight: bold;">void</span> addParticle<span style="color: #009900;">&#40;</span>Particle p<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    particles.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>p<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// A method to test if the particle system still has particles</span>
  <span style="color: #000066; font-weight: bold;">boolean</span> dead<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>particles.<span style="color: #006633;">isEmpty</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> Particle <span style="color: #009900;">&#123;</span>
  PVector loc<span style="color: #339933;">;</span>
  PVector vel<span style="color: #339933;">;</span>
  PVector acc<span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">float</span> r<span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">float</span> timer<span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Another constructor (the one we are using here)</span>
  Particle<span style="color: #009900;">&#40;</span>PVector l<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    acc <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> PVector<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0.05</span>,<span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    vel <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> PVector<span style="color: #009900;">&#40;</span>random<span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>,random<span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">2</span>,<span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>,<span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    loc <span style="color: #339933;">=</span> l.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    r <span style="color: #339933;">=</span> <span style="color: #cc66cc;">10.0</span><span style="color: #339933;">;</span>
    timer <span style="color: #339933;">=</span> <span style="color: #cc66cc;">100.0</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000066; font-weight: bold;">void</span> run<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    update<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    render<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Method to update location</span>
  <span style="color: #000066; font-weight: bold;">void</span> update<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    vel.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>acc<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    loc.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>vel<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    timer <span style="color: #339933;">-=</span> <span style="color: #cc66cc;">1.0</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Method to display</span>
  <span style="color: #000066; font-weight: bold;">void</span> render<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    ellipseMode<span style="color: #009900;">&#40;</span>CENTER<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    stroke<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">255</span>,timer<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    fill<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">100</span>,timer<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    ellipse<span style="color: #009900;">&#40;</span>loc.<span style="color: #006633;">x</span>,loc.<span style="color: #006633;">y</span>,r,r<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    displayVector<span style="color: #009900;">&#40;</span>vel,loc.<span style="color: #006633;">x</span>,loc.<span style="color: #006633;">y</span>,<span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Is the particle still useful?</span>
  <span style="color: #000066; font-weight: bold;">boolean</span> dead<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>timer <span style="color: #339933;">&lt;=</span> <span style="color: #cc66cc;">0.0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
   <span style="color: #000066; font-weight: bold;">void</span> displayVector<span style="color: #009900;">&#40;</span>PVector v, <span style="color: #000066; font-weight: bold;">float</span> x, <span style="color: #000066; font-weight: bold;">float</span> y, <span style="color: #000066; font-weight: bold;">float</span> scayl<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    pushMatrix<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">float</span> arrowsize <span style="color: #339933;">=</span> <span style="color: #cc66cc;">4</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">// Translate to location to render vector</span>
    translate<span style="color: #009900;">&#40;</span>x,y<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    stroke<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">// Call vector heading function to get direction (note that pointing up is a heading of 0) and rotate</span>
    rotate<span style="color: #009900;">&#40;</span>v.<span style="color: #006633;">heading2D</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">// Calculate length of vector &amp; scale it to be bigger or smaller if necessary</span>
    <span style="color: #000066; font-weight: bold;">float</span> len <span style="color: #339933;">=</span> v.<span style="color: #006633;">mag</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span>scayl<span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">// Draw three lines to make an arrow (draw pointing up since we've rotate to the proper direction)</span>
    line<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,len,<span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    line<span style="color: #009900;">&#40;</span>len,<span style="color: #cc66cc;">0</span>,len<span style="color: #339933;">-</span>arrowsize,<span style="color: #339933;">+</span>arrowsize<span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    line<span style="color: #009900;">&#40;</span>len,<span style="color: #cc66cc;">0</span>,len<span style="color: #339933;">-</span>arrowsize,<span style="color: #339933;">-</span>arrowsize<span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    popMatrix<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span> 
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<h2>Schematic</h2>
<p>(Ummm, anyone know of a decent programme to draw these with?!)</p>
<div class="alignright"><div class="g-plusone" data-href="http://slightlymore.co.uk/interactive-particle-system-with-ardiuno-and-processing/" size="small" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://slightlymore.co.uk/interactive-particle-system-with-ardiuno-and-processing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My new toy</title>
		<link>http://slightlymore.co.uk/my-new-toy/</link>
		<comments>http://slightlymore.co.uk/my-new-toy/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 19:29:30 +0000</pubDate>
		<dc:creator>Clinton Montague</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[arduino]]></category>

		<guid isPermaLink="false">http://slightlymore.co.uk/?p=1416</guid>
		<description><![CDATA[I&#8217;m going to use it to make crazy art like things. I started off by making this rather pointless contraption to test it out:]]></description>
			<content:encoded><![CDATA[<div class="alignright"><div class="g-plusone" data-href="http://slightlymore.co.uk/my-new-toy/" size="small" count="true"></div></div><div class="tweetmeme_button" style="float: right; margin-top: -16px; margin-left: 10px;margin-right:0;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fslightlymore.co.uk%2Fmy-new-toy%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fslightlymore.co.uk%2Fmy-new-toy%2F&amp;source=iblamefish&amp;style=compact&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img src="http://slightlymore.co.uk/wordpress/wp-content/uploads/2011/11/arduino_logo.jpg" alt="" title="arduino_logo" width="512" height="512" class="alignnone size-full wp-image-1418" /></p>
<p style="clear: both">I&#8217;m going to use it to make crazy art like things. I started off by making this rather pointless contraption to test it out:</p>
<p><iframe width="420" height="315" src="http://www.youtube.com/embed/dj3FNW2juuo" frameborder="0" allowfullscreen></iframe></p>
<div class="alignright"><div class="g-plusone" data-href="http://slightlymore.co.uk/my-new-toy/" size="small" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://slightlymore.co.uk/my-new-toy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

