<?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>Ragged Clown &#187; programming</title>
	<atom:link href="http://www.raggedclown.com/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.raggedclown.com</link>
	<description>It&#039;s just a shadow you&#039;re seeing that he&#039;s chasing...</description>
	<lastBuildDate>Sat, 04 Feb 2012 22:40:13 +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>Proudly Powered by Wordress</title>
		<link>http://www.raggedclown.com/2011/11/22/freshen-up/</link>
		<comments>http://www.raggedclown.com/2011/11/22/freshen-up/#comments</comments>
		<pubDate>Wed, 23 Nov 2011 05:37:51 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Categories Suck]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.raggedclown.com/?p=2897</guid>
		<description><![CDATA[I was bored with my wordpress theme and Stu&#8217;s fresh look made me decide it was time for a refresh. This is my third theme and I wanted to go right back to basics this time rather than copy an &#8230; <a href="http://www.raggedclown.com/2011/11/22/freshen-up/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was bored with my wordpress theme and <a title="Stu's blog" href="http://blog.stuartthompson.net/">Stu&#8217;s fresh look</a> made me decide it was time for a refresh. This is my third theme and I wanted to go right back to basics this time rather than copy an existing theme.</p>
<p>I started from the most basic theme template I could find &#8211; <a title="Starkers" href="http://starkerstheme.com/">Starkers</a> &#8211; and converted it to use all new html5 tags. Â Starkers has no CSS, so I was starting from scratch. </p>
<p>Here, for posterity, are my three themes side by side.</p>

<a href='http://www.raggedclown.com/2011/11/22/freshen-up/screenshot/' title='Clowning Theme'><img width="359" height="300" src="http://www.raggedclown.com/wp-content/uploads/2011/11/screenshot-359x300.png" class="attachment-medium" alt="Clowning" title="Clowning Theme" /></a>
<a href='http://www.raggedclown.com/2011/11/22/freshen-up/screenshot-2/' title='Readable Theme'><img width="381" height="300" src="http://www.raggedclown.com/wp-content/uploads/2011/11/screenshot1-381x300.png" class="attachment-medium" alt="Readable" title="Readable Theme" /></a>
<a href='http://www.raggedclown.com/2011/11/22/freshen-up/screenshot-3/' title='Clean Clown Theme'><img width="400" height="238" src="http://www.raggedclown.com/wp-content/uploads/2011/11/screenshot2-400x238.png" class="attachment-medium" alt="Clean Clown" title="Clean Clown Theme" /></a>

<p>Best part of the whole exercise? I have confirmed once and for all that PHP is absolutely the nastiest programming language I have ever come across. I don&#8217;t get why it is so popular at all. Debugging wordpress is like doing a surreal jigsaw puzzle where you are looking for a brightly coloured machine tool to match the giraffe. If there is an organizing principle, I couldn&#8217;t find it. It seems completely random whether it grabs markup from a template or spits it out from a function or a widget or a plugin. It&#8217;s amazing that WordPress is so good.</p>
<p>I&#8217;m not quite done yet. I have a few weird tags left to style. I want to do something with responsive design and I want to do something special for ipad and iphone. When I am done with all that, I might make it work on IE ( < 9.0 ). Google Analytics says I get hardly any visitors with IE (72% of visitor time on my blog comes from macs and ipads!) but my mum has IE so I either need to make it work or fly to England to install Firefox for her. That&#8217;s probably the cheapest option to be honest.</p>
<p>PS. If those side-by-side images are still aligned vertically when you read this, it&#8217;s because I haven&#8217;t figured out how to style the image gallery yet. I didn&#8217;t even know wordpress had a gallery plugin until just now.</p>
<p>PPS. If anyone needs a site built in wordpress &#8211; find someone else.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raggedclown.com/2011/11/22/freshen-up/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>I&#8217;m at my peak</title>
		<link>http://www.raggedclown.com/2011/10/16/im-at-my-peak/</link>
		<comments>http://www.raggedclown.com/2011/10/16/im-at-my-peak/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 02:34:13 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Categories Suck]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Slimming]]></category>

		<guid isPermaLink="false">http://www.raggedclown.com/?p=2795</guid>
		<description><![CDATA[The Hacker&#8217;s Diet gives us two tools for bringing wayward eating under control. The first one is the little red dot that says your weight is trending upwards. As you can see, i&#8217;ve been ignoring the red dots for too &#8230; <a href="http://www.raggedclown.com/2011/10/16/im-at-my-peak/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The Hacker&#8217;s Diet gives us two tools for bringing wayward eating under control. The first one is the little red dot that says your weight is trending upwards.</p>
<p><a href="http://tflig.ht/mYAW53"><img class="alignright size-medium wp-image-2796" title="Stranger Card" src="http://www.raggedclown.com/blog/wp-content/uploads/2011/10/StrangerCard-225x300.png" alt="" width="225" height="300" /></a>As you can see, i&#8217;ve been ignoring the red dots for too long now. When you ignore red dots, your daily deficit turns into a daily excess.Â A daily excess of 212 calories is equivalent to a (large) beer every day which is about what I have been having.</p>
<p>Luckily for me, today was the day I hit my peak weight and, I pledge, I will be back to a deficit within two weeks. Within a few short months I will weigh less than I have fror 20 years.</p>
<p>You watch!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raggedclown.com/2011/10/16/im-at-my-peak/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>My Second Rant About Playlists</title>
		<link>http://www.raggedclown.com/2011/08/25/my-second-rant-about-playlists/</link>
		<comments>http://www.raggedclown.com/2011/08/25/my-second-rant-about-playlists/#comments</comments>
		<pubDate>Fri, 26 Aug 2011 05:13:19 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Categories Suck]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.raggedclown.com/?p=2747</guid>
		<description><![CDATA[Rhapsody&#8217;s service has been spotty recently so I thought I&#8217;d try Spotify to see if it is all it is cracked up to be. And the verdict is&#8230; &#8230;it&#8217;s OK. But like every other music app I have ever tried &#8230; <a href="http://www.raggedclown.com/2011/08/25/my-second-rant-about-playlists/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Rhapsody&#8217;s service has been spotty recently so I thought I&#8217;d try Spotify to see if it is all it is cracked up to be. And the verdict is&#8230;</p>
<p>&#8230;it&#8217;s OK.</p>
<p>But like every other music app I have ever tried it doesn&#8217;t do one the thing I want a music player to do. </p>
<blockquote><p>I want to listen to music that I like.</p></blockquote>
<p>Spotify excels at playlist management but I don&#8217;t want to manage playlists. I want to listen to music. </p>
<p>Here&#8217;s a <a href="http://www.raggedclown.com/2009/09/10/heaven-knows-im-miserable-now/">reminder of why playlists suck</a>:</p>
<blockquote><p>Playlists are very seductive at first. You think Oh yes. Iâ€™ll build me a playlist with all my favourite songs. But then, after the third time you play it. You start thinking Oh man! This again!? Iâ€™m gonna build me another playlist. Then Iâ€™ll have two.</p>
<p>Before you know it, you have hundreds of playlists called things like Early English Folk (I) and Early English Folk (II) and you are spending all your time managing your playlists which, by the way, is exactly what the people who make the playlist managers want you to be doing.</p></blockquote>
<p>I had a go at writing my own Rhapsody client a couple of years back but dropped that when a) Rhapsody started suing everyone who used their API to build apps and b) Rhapsody made an iPhone client that didn&#8217;t suck. </p>
<p>My dream didn&#8217;t die though and I am still in the market for an app that will play music I like. Here&#8217;s how it will work.</p>
<p>I search for some music, say, <em>Gogol Bordello</em> and play some &#8220;Top Tracks&#8221;.</p>
<p>I hit the button &#8220;Play more stuff like this&#8221; and it&#8217;ll find some <em>Firewater</em> or <em>The Pogues</em>.</p>
<p>After a while, I get bored with gypsy punk and play some <em>MediÃ¦val BÃ¦bes</em> instead. When it gets to <em>Gaudete</em>, I&#8217;ll tell it to play more like this and it&#8217;ll drift over into some <em>Steeleye Span</em> or some <em>Fairport Convention</em>.</p>
<p>When I use the app a few days later, I won&#8217;t need to tell it what to play because  it will already know what I like. But, if I want to hear 23 versions of John Barleycorn I can do that too (this is where Pandora falls short).</p>
<p>Is there an app out there like this? Maybe someone has done something on top of the Spotify API? Don&#8217;t make me write it myself!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raggedclown.com/2011/08/25/my-second-rant-about-playlists/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hacker&#8217;s Diet</title>
		<link>http://www.raggedclown.com/2011/07/26/hackers-diet/</link>
		<comments>http://www.raggedclown.com/2011/07/26/hackers-diet/#comments</comments>
		<pubDate>Wed, 27 Jul 2011 01:32:53 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Categories Suck]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[science]]></category>

		<guid isPermaLink="false">http://www.raggedclown.com/?p=2714</guid>
		<description><![CDATA[I&#8217;ve been following John Walker&#8217;s Hacker&#8217;s Diet for about nine months now.Â I love the simplicity of it. &#8220;Anyone can control their weight. It&#8217;s a simple matter of balancing calories.&#8221; &#8211; John Walker Mr Walker&#8217;s book is a fun, simple read. &#8230; <a href="http://www.raggedclown.com/2011/07/26/hackers-diet/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><a href="http://www.fourmilab.ch/hackdiet/online/"><img class="alignright" style="border: 0px;" src="http://www.fourmilab.ch/cgi-bin/HackDietBadge?t=1&amp;b=53616J7465645W5WK659W911Q1465J1539905927Q73K27K913KJ6QQ98JQ55QG09Q0WK11K71K1W0WG3W89557G5F608WGGG367Q5JKJ79F3J984WQ474W6023F0J26K457Q7GF" alt="The Hacker's Diet Online" width="200" height="78" /></a></p>
<p>I&#8217;ve been following<a title="Hacker's Diet" href="http://www.fourmilab.ch/hackdiet/"> John Walker&#8217;s Hacker&#8217;s Diet</a> for about nine months now.Â I love the simplicity of it.</p>
<blockquote><p>&#8220;Anyone can control their weight. It&#8217;s a simple matter of balancing calories.&#8221; &#8211; John Walker</p></blockquote>
<p>Mr Walker&#8217;s book is a fun, simple read. If you are technically inclined and you want to lose weight, you should certainly read <em>The Hacker&#8217;s Diet</em>. The book introduces a model of the human body as a <em>rubber bag </em>full, mostly, with water. Every day stuff goes in and stuff comes out, but the rubber bag always obeys the laws of physics.</p>
<p><a href="http://www.raggedclown.com/blog/wp-content/uploads/2011/07/figure302.png"><img class="size-full wp-image-2719 aligncenter" title="The Rubber Bag" src="http://www.raggedclown.com/blog/wp-content/uploads/2011/07/figure302.png" alt="" width="500" height="213" /></a></p>
<p>If you eat more calories than you burn, you gain weight at a rate of a 3500 kCal/lb. Simply count the calories you eat and subtract the calories you burn and the resulting number will tell you how quickly you will gain (or, hopefully, lose) weight.</p>
<p>But I think it&#8217;s even simpler than that.</p>
<p>If you weigh yourself every day, you can quickly figure out whether you are gaining weight. If your weight goes up, you are eating too much. Eat less.</p>
<p>Ok, ok. It&#8217;s not quite that simple. Your weight can vary by a couple of pounds each day as you retain water (or, as John Walker delicately puts it,Â <em>solids</em>); but if you plot the moving average you get a surprisingly stable trend line. From that trend, you can figure out your daily excess (or deficit) and decide to eat more (or less) accordingly.</p>
<p>People who work in software development use a planning technique based on <em><a title="Yesterday's Weather at Diamond Sky" href="http://www.diamond-sky.com/resources/xp/glossary.html#yesterday">yesterday&#8217;s weather</a></em>. The idea is based on weather forecasting. Imagine a computer that monitored the humidity and the temperature and pressure and a thousand other variables and used it to predict the weather with an accuracy of 82%.</p>
<p>It turns out that, if you just predict that today&#8217;s weather will be the same as yesterday&#8217;s, you&#8217;ll be correct about 70% of the time. That&#8217;s close enough for most purposes and it saves you a really expensive computer.</p>
<p>In my case, the prediction that I&#8217;ll eat about the same number of calories today as I did yesterday saves me lots of tedious calorie counting. With a little practice, I got quite good at knowing whether I was eating too much or too little and adjusting my intake accordingly.</p>
<p>Here&#8217;s my trend since last October:</p>
<p><a href="http://www.raggedclown.com/blog/wp-content/uploads/2011/07/photo1.png"><img class="aligncenter" title="Trend Line" src="http://www.raggedclown.com/blog/wp-content/uploads/2011/07/photo1.png" alt="" width="318" height="405" /></a></p>
<p>You can see from the chart that I lost weight pretty steadily for several months. My daily deficit held steady at about 250 cal/day for most of that time. 250 calories is about <a title="How many calories in a bagel" href="http://livefitblog.com/2010/06/18/calories-bagel/">a bagel a day</a> and represents the loss of a pound every two weeks. Since I <a title="Low Calorie Bacon" href="http://www.raggedclown.com/2011/04/07/low-calorie-bacon/">don&#8217;t really like bagels anyway</a> (or french fries, or bread, or candy) it was easy to stop eating them.Â I hit my target weight about a month ago and, since then, my weight has crept up a little (I don&#8217;t like bagels but I do enjoy beer).</p>
<p>The little red dots are a warning sign that I might be eating too muchÂ (notable red dots:Â <em><a title="The Captain's Table" href="http://www.raggedclown.com/2011/01/17/the-captains-table/">The Captain&#8217;s Table Dinner</a></em>Â in January and <a title="Santa Cruz Piratefest" href="http://www.santacruzpiratefest.com/">Piratefest</a> in July) and the prominent red <strong><span style="color: #ff0000;">74</span></strong> says that I need to have half a pint less beer at Quiz Night.</p>
<p>Like any good hacker, I decided that I didn&#8217;t like any of the weight trackers out there so I wrote my own for my iphone (it was also an excuse to learn Objective C). I might decide to stick the app on the app store one day but, for now, it&#8217;s just a bit of fun that I am sharing with some friends. Ping me if you want to play along too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raggedclown.com/2011/07/26/hackers-diet/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Deal with this</title>
		<link>http://www.raggedclown.com/2010/12/01/deal-with-this/</link>
		<comments>http://www.raggedclown.com/2010/12/01/deal-with-this/#comments</comments>
		<pubDate>Thu, 02 Dec 2010 06:12:21 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Categories Suck]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.raggedclown.com/?p=2492</guid>
		<description><![CDATA[I&#8217;m trying to learn Objective C at the moment so I can write my first iPhone app (this time next year, we&#8217;ll be millionaires). Objective C is just about the ugliest language that I have ever come across (and I &#8230; <a href="http://www.raggedclown.com/2010/12/01/deal-with-this/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m trying to learn Objective C at the moment so I can write my first iPhone app (this time next year, we&#8217;ll be millionaires).</p>
<p>Objective C is just about the ugliest language that I have ever come across (and I have coded in COBOL and Ada). </p>
<p>That makes it all the more frustrating to read the <a href="http://www.pragprog.com/magazines/2010-12/whats-new-in-ruby-">trailer for the new version of Ruby.</a></p>
<p>Â 	suits = %w{ C D H S }<br />
Â 	ranks = [ *'2'..'10', *%w{ J Q K A } ]<br />
Â 	deck  = suits<br />
Â 	          .product(ranks)<br />
Â 	          .map(&#038;:join)<br />
Â <br />
Â 	hands =  deck<br />
Â 	          .shuffle<br />
Â 	          .each_slice(13)<br />
Â <br />
Â 	puts hands.first.join(&#8220;, &#8220;)</p>
<p>Could it be any simpler?</p>
<p>(I don&#8217;t know what the ampersand thing does either).</p>
<p>It&#8217;s hard to believe that my beautiful iPad is full of nasty Objective C.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raggedclown.com/2010/12/01/deal-with-this/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Why I Don&#8217;t Write Much</title>
		<link>http://www.raggedclown.com/2010/05/08/why-i-dont-write-much/</link>
		<comments>http://www.raggedclown.com/2010/05/08/why-i-dont-write-much/#comments</comments>
		<pubDate>Sat, 08 May 2010 19:22:25 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[1]]></category>
		<category><![CDATA[funny]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.raggedclown.com/?p=2150</guid>
		<description><![CDATA[Ladies and Gentlemen. The magnificent Verity Stob&#8230; The reality is even better: an extended example of that kind of feminism that implies the intrinsic superiority of women in nearly all things while simultaneously demanding privileges to compensate for claimed weaknesses, &#8230; <a href="http://www.raggedclown.com/2010/05/08/why-i-dont-write-much/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Ladies and Gentlemen. The magnificent Verity Stob&#8230;</p>
<blockquote><p>The reality is even better: an extended example of that kind of feminism  that implies the intrinsic superiority of women in nearly all things  while simultaneously demanding privileges to compensate for claimed  weaknesses, without noticing any implicit contradiction. I particularly  enjoyed suggestion #4 that female-friendly projects should use  attractive-to-women programming languages such as Python and Ruby (and  Perl too, it says. Is Terry sure about this? I would say that Perl was  notoriously one of the most engine oil-besmirched languages around, full  of syntactical structures that are hard to shift if one only has small  hands, and shot through with rusted-solid regular expressions that only  reluctantly yield to the full weight of a big fat bloke).</p>
<p>I now  see the programming world in a new light, and have hit upon a wonderful  idea. I intend to devise an index that ranks all the major programming  languages according to their pulling power. It will range from old  favourites like Fortran, which is hopelessly male but in a pleasant  pipe-smoking, GWR steam engine, leather elbow patches sort of way that  reminds me of Dad; through to an obviously female-attracting language  like Delphi: elegant and friendly, using proper words instead of  resorting to pointless grunty man-squiggles, yet instinctively practical  and not at all like frilly, ditzy, slow-to-react Ruby &#8211; the only  language actually to be coloured pink.</p></blockquote>
<blockquote><p><a title="Geek of the Week" href="http://www.simple-talk.com/opinion/geek-of-the-week/verity-stob-geek-of-the-week/">http://www.simple-talk.com/opinion/geek-of-the-week/verity-stob-geek-of-the-week/</a></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.raggedclown.com/2010/05/08/why-i-dont-write-much/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It Changed My Life &#8211; Book Four</title>
		<link>http://www.raggedclown.com/2010/04/11/it-changed-my-life-book-four/</link>
		<comments>http://www.raggedclown.com/2010/04/11/it-changed-my-life-book-four/#comments</comments>
		<pubDate>Sun, 11 Apr 2010 23:36:18 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[1]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[favourite]]></category>
		<category><![CDATA[memories]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[review]]></category>

		<guid isPermaLink="false">http://www.raggedclown.com/?p=2126</guid>
		<description><![CDATA[When I returned from travelling around the world, I took a crappy job fixing avionics on planes at Heathrow Airport. Ooooooooooh how I hated that job. I quit after about three months with no idea of what to do next. &#8230; <a href="http://www.raggedclown.com/2010/04/11/it-changed-my-life-book-four/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/The_C_Programming_Language_%28book%29"><img class="size-full wp-image-2132 alignright" title="Kernighan and Ritchie" src="http://www.raggedclown.com/blog/wp-content/uploads/2010/04/220px-kr_c.jpg" alt="Kernighan and Ritchie" width="220" height="299" /></a>When I returned from travelling around the world, I took a crappy job fixing avionics on planes at Heathrow Airport. Ooooooooooh how I hated that job. I quit after about three months with no idea of what to do next. Eventually, I narrowed it down to one of five things.</p>
<ul>
<li>Six years in the navy had not cured me of my love of the sea. I applied for a job on a millionaire&#8217;s yacht based in Antibes.</li>
<li>I rather liked tropical islands. I applied for a job fixing satellite tracking equipment on Ascension Island.</li>
<li>I rather liked &#8220;abroad&#8221; in general. I applied for a course to learn to teach English as a foreign language (TEFL).</li>
<li>I had a tiny twinge of regret that I had not been to university. I applied to Cambridge.</li>
<li>I vaguely remembered that I had been good with computers as a lad. I applied for an adult education class in software engineering.</li>
</ul>
<p>I didn&#8217;t really have a strong preference and decided to accept the first offer that arrived in my letterbox. Software engineering came in first so software engineering it was. I headed up to the <a title="Wikipedia" href="http://en.wikipedia.org/wiki/East_End_of_London">East End of London</a> for a five month course.</p>
<p>If you have ever been to <a title="Wikipedia" href="http://en.wikipedia.org/wiki/Whitechapel">Whitechapel</a>, you will know that it is one of the poorest, crappiest parts of London and home to recent immigrants, gangsters and outcasts. Imagine a neighbourhood that has not changed one whit since Jack the Ripper&#8217;s reign of terror. That should help you picture the environs of my classroom.</p>
<p>If you have ever been unemployed in England, you will know that there  is a prevailing threat that your benefits will stop unless you attend  an endless stream of adult education classes. That should help you  picture my fellow students.</p>
<p>Our instructor was a total nutcase. It was not clear that he had ever programmed a computer before but that didn&#8217;t stop him from having a sackful of forceful opinions about software engineering. Fortunately he only showed up for class about one day in four.</p>
<p><a href="http://en.wikipedia.org/wiki/The_Blind_Beggar"><img class="alignright size-full wp-image-2133" title="The Blind Beggar, Whitechapel" src="http://www.raggedclown.com/blog/wp-content/uploads/2010/04/220px-the_blind_beggar_-_whitechapel_-_e1.jpg" alt="The Blind Beggar, Whitechapel" width="220" height="407" /></a>My fellow students were delighted. There was a pub next door and I got pretty good at pool. <em>Winner stays on</em> was the prevailing convention and one of the highlights of my life was racking up for the first game at 11AM and not leaving the table until the pub closed at 11PM after thrashing all-comers including several shady-looking character as the evening hours wore on and the bar filled with gangsters.</p>
<p>A few weeks into our course, the four of us who were not receiving unemployment benefits decided to complain about the lack of instruction. The company that ran the course &#8211; fearing for their government funding &#8211; promised to find us a new instructor. They gave us a copy of <a title="Wikipedia" href="http://en.wikipedia.org/wiki/The_C_Programming_Language_%28book%29"><em>The C Programming Language</em></a> by Kernighan and Ritchie to help pass the time while they searched for the new guy.</p>
<p>I opened the book and, on the very first page, was the program that changed my life.</p>
<blockquote>
<pre>#include &lt;stdio.h&gt;
int main()
{Â Â 
  printf("hello, world\n");
  return 0;
}</pre>
</blockquote>
<p>Our new instructor eventually showed up and tried to teach us ADA but I wasn&#8217;t interested. I already had my White Book. I had my passport to a successful career.</p>
<p>Two weeks later, I finished my first C program &#8211; an editor for sheet music that could playback the music you had entered. Two months later, I had my first programming job [remind me to tell you about my first gig at Reuters]. Two years later, I was managing a 12 person team building insurance software (Ultima <a title="Total Systems" href="http://www.totalsystems.co.uk/ultimaGI.html">is still on sale</a>!). Two more years and I was working on Wall Street then, later, Silicon Valley.</p>
<p>My story is not complete unless I tell you about the <em>Women into Technology</em> class next door or, rather, about Rita, a woman in that class and how we moved in together and&#8230; well&#8230; that&#8217;s a longer story and I&#8217;ll save it for another day&#8230;</p>
<p><strong>Epilogue</strong><br />
The very day that I started my class, I received a letter from Antibes requesting that I fly down for an interview on that yacht but I&#8217;d already made my choice and I stuck with it. I wonder how my life would have been different if I had got on that plane?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raggedclown.com/2010/04/11/it-changed-my-life-book-four/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>It Changed my Life &#8211; Book One</title>
		<link>http://www.raggedclown.com/2010/04/10/it-changed-my-life-book-one/</link>
		<comments>http://www.raggedclown.com/2010/04/10/it-changed-my-life-book-one/#comments</comments>
		<pubDate>Sat, 10 Apr 2010 23:18:09 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[1]]></category>
		<category><![CDATA[art]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[favourite]]></category>
		<category><![CDATA[memories]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[review]]></category>

		<guid isPermaLink="false">http://www.raggedclown.com/?p=2117</guid>
		<description><![CDATA[I hate internet memes too, but I like this one. List 10(ish) books that had a big influence on your life. Here are Will Wilkinson&#8217;s and Conor Friedersdorf&#8217;s and Ross Douthat&#8217;s. [I started this entry a few weeks ago but &#8230; <a href="http://www.raggedclown.com/2010/04/10/it-changed-my-life-book-one/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I hate internet memes too, but I like this one. List 10(ish) books that had a big influence on your life. <a href="http://www.willwilkinson.net/flybottle/2010/03/19/books-that-have-influenced-me-the-most/">Here are Will Wilkinson&#8217;s</a> and <a title="The American Scene" href="http://trueslant.com/conorfriedersdorf/2010/03/20/writing-that-influenced-me/">Conor Friedersdorf&#8217;s</a> and <a title="New York Times" href="http://douthat.blogs.nytimes.com/2010/03/25/the-influential-books-game/">Ross Douthat&#8217;s</a>.</p>
<p><em>[I started this entry a few weeks ago but it's taking a long time to finish, so i'll post it installments. This is installment 1 of 10ish.]</em></p>
<p><a href="http://en.wikipedia.org/wiki/Sinclair_BASIC"><img class="alignleft size-full wp-image-2094" title="Sinclair Basic" src="http://www.raggedclown.com/blog/wp-content/uploads/2010/03/basic.png" alt="Sinclair Basic" width="304" height="232" /></a></p>
<p>At the end of the third year at <a title="Ragged Clown" href="http://www.raggedclown.com/2009/03/26/sozzlehurst-and-hiccup/">Chis and Sid</a>, I won a prize for the most improved student. After coming dead last in my class in the autumn and winter terms, I came first in class at the end of the year and won a book voucher (I did the same thing in each of the subsequent years too but, by then, they were on to me &#8211; no more prizes for me).</p>
<p>On my way home from school, I stopped in the bookshop and picked up a book called <em>Programming in BASIC</em> (Beginners All-Purpose Symbolic Instruction Code).</p>
<p>My mum&#8217;s company had recently bought a mini-computer and mum took me to work one day to show it off. It was the first computer that I ever saw and she left me on my own with it for a couple of hours. I found the games!</p>
<p>It had a really primitive version of <em>20 Questions</em> that I played over and over, fascinated that this chunk of metal could figure out what I was thinking. The highlight was when it didn&#8217;t guess my animal and it asked me for a question that would distinguish apes from moneys.</p>
<p>The lowlight came soon after when I introduced my first bug into a computer program. All future players, after answering <em>&#8220;no&#8221;</em> to <em>&#8220;Does it have a tail?&#8221;</em> would be asked</p>
<blockquote><p>Is it a chim?</p></blockquote>
<p>Gah!</p>
<p>The full <a title="Snoopy" href="http://www.chris.com/ASCII/art/html/snoopy.html">page dot-matrix ASCII of Snoopy</a> made an impression too.</p>
<p><span style="font-size: 6px;"> </span></p>
<pre>              XXXX
                 X    XX
                X  ***  X                XXXXX
               X  *****  X            XXX     XX
            XXXX ******* XXX      XXXX          XX
          XX   X ******  XXXXXXXXX                XX XXX
        XX      X ****  X                           X** X
       X        XX    XX     X                      X***X
      X         //XXXX       X                      XXXX
     X         //   X                             XX
    X         //    X          XXXXXXXXXXXXXXXXXX/
    X     XXX//    X          X
    X    X   X     X         X
    X    X    X    X        X
     X   X    X    X        X                    XX
     X    X   X    X        X                 XXX  XX
      X    XXX      X        X               X  X X  X
      X             X         X              XX X  XXXX
       X             X         XXXXXXXX\     XX   XX  X
        XX            XX              X     X    X  XX
          XX            XXXX   XXXXXX/     X     XXXX
            XXX             XX***         X     X
               XXXXXXXXXXXXX *   *       X     X
                            *---* X     X     X
                           *-* *   XXX X     X
                           *- *       XXX   X
                          *- *X          XXX
                          *- *X  X          XXX
                         *- *X    X            XX
                         *- *XX    X             X
                        *  *X* X    X             X
                        *  *X * X    X             X
                       *  * X**  X   XXXX          X
                       *  * X**  XX     X          X
                      *  ** X** X     XX          X
                      *  **  X*  XXX   X         X
                     *  **    XX   XXXX       XXX
                    *  * *      XXXX      X     X
                   *   * *          X     X     X
     =======*******   * *           X     X      XXXXXXXX\
            *         * *      /XXXXX      XXXXXXXX\      )
       =====**********  *     X                     )  \  )
         ====*         *     X               \  \   )XXXXX
    =========**********       XXXXXXXXXXXXXXXXXXXXXX</pre>
<p>A couple of years later, when I won that prize, there was no question but that I would buy myself a book on programming. I didn&#8217;t have a computer though, so I wrote my programs on paper and imagined them running.</p>
<p><a href="http://en.wikipedia.org/wiki/ZX81"><img class="alignright size-full wp-image-2096" title="Sinclair ZX81" src="http://www.raggedclown.com/blog/wp-content/uploads/2010/03/sinclair_zx81.jpg" alt="Sinclair ZX81" width="400" height="354" /></a>Another year went by before Sir Clive Sinclair &#8211; who inherited the title Greatest Living Englishman when Winston Churchill died &#8211; released the first home computer for under a Â£100. I saved up and bought myself one.</p>
<p>As soon as that fuzzy little <span style="color: white; background-color: black;">K </span> cursor started blinking in the corner of my TV screen I was hooked and there was no holding me back.</p>
<p>I drew my own ascii art. I played chess in 1kB. I painstakingly copied the machine code for a draughts program byte by byte from a book. I wrote a Monopoly program. I wrote a program to do Fourier Analysis. I learned Z80 assembly language which I hand-assembled using look-up tables because I didn&#8217;t have an assembler.</p>
<p>Non-programmers often don&#8217;t understand what a creative activity programming is. They think it&#8217;s about following mundane instructions. I can&#8217;t think of a more creative activity.</p>
<p>It&#8217;s truly liberating to discover that you can make something out of nothing but the thoughts in your head. Maybe people who are gifted at painting or music get a hint of this but to suddenly find that you can imagine something <em>and then go build it!</em> It makes you feel superhuman.</p>
<p><a href="http://en.wikipedia.org/wiki/Sinclair_C5"><img class="alignleft size-full wp-image-2097" title="Sinclair C5" src="http://www.raggedclown.com/blog/wp-content/uploads/2010/03/c5-430.jpg" alt="Sinclair C5" width="430" height="345" /></a>Sinclair also invented the first commercial electric car which turned out not to be so commercial after all and Uncle Clive lost both his fame and his fortune. A fickle nation turned its love to Alan Sugar and his wondrous Amstrads but I&#8217;ll always be grateful to Sir Clive for the gift he gave me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raggedclown.com/2010/04/10/it-changed-my-life-book-one/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Solar Flexus</title>
		<link>http://www.raggedclown.com/2010/01/01/solar-flexus/</link>
		<comments>http://www.raggedclown.com/2010/01/01/solar-flexus/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 03:26:38 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[1]]></category>
		<category><![CDATA[education]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[science]]></category>

		<guid isPermaLink="false">http://www.raggedclown.com/?p=1842</guid>
		<description><![CDATA[I&#8217;ve wanted to write a physics engine for years and messing with Squeak made me want to try it in Flex. It wasn&#8217;t quite as easy as Squeak but it wasn&#8217;t too hard. (It probably needs flash 10 to work) &#8230; <a href="http://www.raggedclown.com/2010/01/01/solar-flexus/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve wanted to write a physics engine for years and <a title="Ragged Clown" href="http://www.raggedclown.com/2009/12/30/my-drawing-table-squeaks/">messing with Squeak</a> made me want to try it in Flex. It wasn&#8217;t quite as easy as Squeak but it wasn&#8217;t too hard.</p>
<p><object width="500" height="400"><param name="movie" value="/blog/wp-content/uploads/2010/01/solar.swf"></param>
  <embed src="/blog/wp-content/uploads/2010/01/solar.swf"  pluginspace="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="500" height="400"></embed></object></p>
<p><em>(It probably needs flash 10 to work)</em></p>
<p>So far I have gravity and collisions for circular objects. Up next: drag.</p>
<p>Here&#8217;s the main loop:</p>
<p><code>[sourcecode language='js']<br />
    public function tick() :void {<br />
      for each(var body :Body in bodies) {<br />
        var force <img src='http://www.raggedclown.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> oint = calculateForceOn(body);<br />
        body.apply(force);<br />
        body.move(1);</p>
<p>        checkForCollision(body);<br />
      }<br />
    }<br />
[/sourcecode]</code></p>
<p>Inverse Square Law to calculate gravity:</p>
<p><code>[sourcecode language='js']<br />
    public function calculateForceOn(body :Body) <img src='http://www.raggedclown.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> oint {<br />
      var force <img src='http://www.raggedclown.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> oint= new Point(0, 0);</p>
<p>      for each(var other :Body in bodies) {<br />
        if(body != other) {<br />
          var distance :Number = Point.distance(body.position,other.position);</p>
<p>          var magnitude :Number = (body.mass+other.mass) /(distance*distance);</p>
<p>          var direction <img src='http://www.raggedclown.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> oint = other.position.subtract(body.position);</p>
<p>          var additionalForce <img src='http://www.raggedclown.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> oint = new Point(direction.x*magnitude/distance, direction.y*magnitude/distance);</p>
<p>          force = force.add(additionalForce);<br />
        }<br />
      }</p>
<p>      return force;<br />
    }<br />
[/sourcecode]</code></p>
<p>Look for collisions and calculate the impulsive forces:</p>
<p><code>[sourcecode language='js']<br />
    public function checkForCollision(body :Body) :void {<br />
      for each(var other :Body in bodies) {<br />
        if(body != other &#038;&#038; body.intersects(other)) {<br />
          var normal <img src='http://www.raggedclown.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> oint = body.findCollisionNormalTo(other);</p>
<p>          var relativeVelocity <img src='http://www.raggedclown.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> oint= body.findVelocityRelativeTo(other);</p>
<p>          var relativeNormalVelocity :Number = dotProduct(relativeVelocity, normal);</p>
<p>          if(relativeNormalVelocity < 0) {<br />
            var impulse :Number = -dotProduct(normal,relativeVelocity) *(coefficientOfRestitution+1) /(1/body.mass+1/other.mass); </p>
<p>            body.applyImpulse(impulse, normal);<br />
            other.applyImpulse(-impulse, normal);<br />
          }<br />
        }<br />
      }<br />
    }<br />
[/sourcecode]</code></p>
<p>And some heavenly bodies:</p>
<p><code>[sourcecode language='js']<br />
      var sun :Body = new Body("Sun", World.Origin);<br />
      sun.radius = 60;<br />
      sun.mass = 50000;<br />
      sun.color = 0x26393D;</p>
<p>      var earth :Body = new Body("Earth", new Point(0,500));<br />
      earth.radius = 40;<br />
      earth.mass = 4;<br />
      earth.velocity = new Point(5,0);<br />
      earth.color = 0xE8E595;</p>
<p>      world.add(sun);<br />
      world.add(earth);<br />
      world.add(moon);<br />
      world.add(mars);<br />
[/sourcecode]</code></p>
<p>I am still not sure whether I like Flex. The libraries are fantastic but the language - ActionScript - is super-annoying. It makes me wish for C#. It's allegedly a dynamic language but the compiler makes you declare every type anyway in that wacky syntax that I can never quite remember. Simulating solar systems is fun though. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.raggedclown.com/2010/01/01/solar-flexus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Drawing Table Squeaks</title>
		<link>http://www.raggedclown.com/2009/12/30/my-drawing-table-squeaks/</link>
		<comments>http://www.raggedclown.com/2009/12/30/my-drawing-table-squeaks/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 08:17:04 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[1]]></category>
		<category><![CDATA[art]]></category>
		<category><![CDATA[education]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[science]]></category>

		<guid isPermaLink="false">http://www.raggedclown.com/?p=1830</guid>
		<description><![CDATA[Took the kids to the Exploratorium today. It&#8217;s currently my favourite museum. Better even than OMSI (although they don&#8217;t serve beer at The Exploratorium. How come that hasn&#8217;t caught on outside Portland?)Â  I wish San Jose had a decent museum. &#8230; <a href="http://www.raggedclown.com/2009/12/30/my-drawing-table-squeaks/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Took the kids to the Exploratorium today. It&#8217;s currently my favourite museum. Better even than OMSI (although they don&#8217;t serve beer at The Exploratorium. How come that hasn&#8217;t caught on outside Portland?)Â  I wish San Jose had a decent museum. The Tech sucks worse than possibly any museum in the world except <a title="Morwhelum Quay" href="http://www.morwellham-quay.co.uk/">Morwelham Quay</a>.</p>
<p>I couldn&#8217;t find my favourite exhibit &#8211; <a title="Exploratorium" href="http://www.exploratorium.edu/exhibits/ladle/">Ladle Rat Rotten Hut</a>. There are so many great exhibits that I have never actually seen them all.</p>
<blockquote><p>Wan moaning, Rat Rotten Hut&#8217;s murder colder inset, &#8220;Ladle Rat Rotten Hut, heresy ladle basking winsome burden barter an shirker cockles. Tick disk ladle basking tutor cordage offer groin-murder hoe lifts honor udder site offer florist. Shaker lake! Dun stopper laundry wrote! An yonder nor sorghum-stenches, dun stopper torque wet strainers!&#8221;</p></blockquote>
<p><a href="http://www.exploratorium.edu/xref/exhibits/drawing_board.html"><img class="alignleft" title="Exploratorium - Drawing Table" src="http://www.exploratorium.edu/xref/exhibits/images/drawing_board.jpg" alt="" width="180" height="180" /></a>Jazz fell in love with the <a title="Exploratorium" href="http://www.exploratorium.edu/xref/exhibits/drawing_board.html">drawing board</a> and watched it for about 90 minutes. It&#8217;s basically a table hung from four ropes like a pendulum and a pen that draws patterns on a piece of paper as the table swings and twists.Â  There is a weight that makes it swing eccentrically to make the patterns more interesting.</p>
<p>I promised to make her a real one but I wanted to see if I could do it in Alan Kay&#8217;s excellent <a title="Squeak" href="http://www.squeakland.org/">Squeak </a>first. It was pretty easy and quite effective.</p>
<p>Here&#8217;s the program. I messed around with the constants to get different effects.</p>
<blockquote><p><a href="http://www.raggedclown.com/blog/wp-content/uploads/2009/12/program.png"><img class="alignnone size-medium wp-image-1831" title="squeak program" src="http://www.raggedclown.com/blog/wp-content/uploads/2009/12/program-400x205.png" alt="squeak program" width="400" height="205" /></a></p></blockquote>
<p>and here&#8217;s a picture I made with it:</p>
<blockquote><p><a href="http://www.raggedclown.com/blog/wp-content/uploads/2009/12/drawingtable.png"><img class="alignnone size-medium wp-image-1832" title="drawingtable" src="http://www.raggedclown.com/blog/wp-content/uploads/2009/12/drawingtable-400x300.png" alt="drawingtable" width="400" height="300" /></a></p></blockquote>
<p>Today: simulation. Tomorrow: the real thing.</p>
<p>Wish us luck!</p>
<p>UPDATE:</p>
<p>I just downloaded the latest version of Squeak (now called etoys). It&#8217;s MUCH better than it used to be. All the bugs are gone and it doesn&#8217;t look like it was made in 1983 any more. Go get it from <a title="Squeak" href="http://www.squeakland.org/">http://www.squeakland.org/</a> then you can play with my project &#8211; <a href="http://www.raggedclown.com/blog/wp-content/uploads/2009/12/drawing-table002.pr">Squeak: Drawing Table<br />
</a></p>
<p><a href="http://www.raggedclown.com/blog/wp-content/uploads/2009/12/etoys.png"><img class="aligncenter size-medium wp-image-1838" title="etoys" src="http://www.raggedclown.com/blog/wp-content/uploads/2009/12/etoys-400x300.png" alt="etoys" width="400" height="300" /></a></p>
<p>Maybe you could add damping for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.raggedclown.com/2009/12/30/my-drawing-table-squeaks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

