<?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>Tom Mitchell &#187; Code</title>
	<atom:link href="http://tom.net.nz/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://tom.net.nz</link>
	<description>Life, the internets, and everything.</description>
	<lastBuildDate>Fri, 30 Jul 2010 00:42:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Dark Visual Studio 2010 theme</title>
		<link>http://tom.net.nz/2010/07/visual-studio-2010-theme/</link>
		<comments>http://tom.net.nz/2010/07/visual-studio-2010-theme/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 23:41:17 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://tom.net.nz/?p=319</guid>
		<description><![CDATA[Looking for a refreshing change in colour? Getting sick of coding against that glaring white background? Look no further! I&#8217;ve decided to upload my Visual Studio 2010 Fonts and Colors settings for public consumption. The colour scheme is loosely based on the Railscasts TextMate theme. Here&#8217;s a couple of screenshots to give an idea of [...]]]></description>
			<content:encoded><![CDATA[<p>Looking for a refreshing change in colour? Getting sick of coding against that glaring white background? Look no further!</p>
<p>I&#8217;ve decided to upload my <a href="http://tom.net.nz/uploads/private/Railscast-VisualStudio2010.vssettings">Visual Studio 2010 Fonts and Colors settings</a> for public consumption. The colour scheme is loosely based on the <a href="http://railscasts.com/">Railscasts</a> <a href="http://railscasts.com/about">TextMate theme</a>. Here&#8217;s a couple of screenshots to give an idea of appearance:</p>
<p><a href="http://tom.net.nz/wp-content/uploads/2010/07/theme-1.png"><img class="alignnone size-thumbnail wp-image-320" title="Theme Sample 1" src="http://tom.net.nz/wp-content/uploads/2010/07/theme-1-150x150.png" alt="" width="150" height="150" /></a> <a href="http://tom.net.nz/wp-content/uploads/2010/07/theme-2.png"><img class="alignnone size-thumbnail wp-image-321" title="Theme Sample 2" src="http://tom.net.nz/wp-content/uploads/2010/07/theme-2-150x150.png" alt="" width="150" height="150" /></a></p>
<p>(Click to view larger).</p>
<p>To install:</p>
<ul>
<li>Download the <a href="http://tom.net.nz/uploads/private/Railscast-VisualStudio2010.vssettings">theme settings file</a>.</li>
<li>In Visual Studio 2010, go to menu <strong>Tools -&gt; Import and Export Settings&#8230;</strong></li>
<li><strong>Import selected environment settings</strong></li>
<li>I recommend you save your current settings &#8211; just so you can revert them later if you don&#8217;t like the theme!</li>
<li>Hit <strong>Browse&#8230;</strong> when asked to specify a collection of settings</li>
<li>Make sure that everything is ticked to import, and hit <strong>Finish</strong></li>
</ul>
<p>By default, the theme uses Consolas size 12. You can adjust these settings easily by opening menu <strong>Tools -&gt; Options</strong> and finding the <strong>Fonts and Colors</strong> section under <strong>Environment</strong>.</p>
<p>Note that Visual Studio is a prick, and has something in the order of 100 different colours that can be set. I have only set up colours for things that I am commonly doing, such as coding in C#, HTML, or XAML. Every now and then you might come across a colour that looks funny against the dark background. This can of course be modified by hand in the Color settings by tracking down the appropriate item in the colour list.</p>
]]></content:encoded>
			<wfw:commentRss>http://tom.net.nz/2010/07/visual-studio-2010-theme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio tip</title>
		<link>http://tom.net.nz/2010/07/visual-studio-tip/</link>
		<comments>http://tom.net.nz/2010/07/visual-studio-tip/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 22:42:24 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://tom.net.nz/?p=298</guid>
		<description><![CDATA[If you&#8217;re like me, the way that Visual Studio 2008&#8242;s Solution Explorer jumps around to select the file in the current tab makes you disoriented and frustrated. Fortunately, I have found the ideal solution! Disable the automated behaviour: In options, open the Projects and Solutions section Untick Track Active Item in Solution Explorer Enable a [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re like me, the way that Visual Studio 2008&#8242;s Solution Explorer jumps around to select the file in the current tab makes you disoriented and frustrated. Fortunately, I have found the ideal solution!</p>
<ul>
<li>Disable the automated behaviour:
<ul>
<li>In options, open the <strong>Projects and Solutions</strong> section</li>
<li>Untick <strong>Track Active Item in Solution Explorer</strong></li>
</ul>
</li>
<li>Enable a keyboard shortcut to track the active item when <em>you</em> want to:
<ul>
<li>In options, open <strong>Environment -&gt; Keyboard</strong></li>
<li>Search for the command <strong>View.TrackActivityinSolutionExplorer</strong>, and enter your desired keyboard shortcut</li>
</ul>
</li>
</ul>
<p>Not sure if this works in other versions of Visual Studio, but it&#8217;s working a treat for me!</p>
]]></content:encoded>
			<wfw:commentRss>http://tom.net.nz/2010/07/visual-studio-tip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Next big thing</title>
		<link>http://tom.net.nz/2010/07/next-big-thing/</link>
		<comments>http://tom.net.nz/2010/07/next-big-thing/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 01:32:40 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://tom.net.nz/?p=293</guid>
		<description><![CDATA[I have something of a prediction. If not a prediction then a wish. A wish for a feature that should become part of IDEs everywhere, in much the same way that IntelliSense-esque tools and refactoring tools have. To explain the feature, first let me explain the problem it solves. Supposing I have a number of [...]]]></description>
			<content:encoded><![CDATA[<p>I have something of a prediction. If not a prediction then a wish. A wish for a feature that should become part of IDEs everywhere, in much the same way that IntelliSense-esque tools and refactoring tools have.</p>
<p>To explain the feature, first let me explain the problem it solves. Supposing I have a number of similar lines of code:</p>
<pre class="brush:[vbnet]">Item1.Text = GetData("Item1")
Item2.Text = GetData("Item2")
Item3.Text = GetData("Item3")
Item4.Text = GetData("Item4")
Item5.Text = GetData("Item5")</pre>
<p>&#8230; and I want to make a similar change to each of these lines, such as:</p>
<pre class="brush:[vbnet]">Item1.Value = Convert(GetData("Item1"), String)
Item2.Value = Convert(GetData("Item2"), String)
Item3.Value = Convert(GetData("Item3"), String)
Item4.Value = Convert(GetData("Item4"), String)
Item5.Value = Convert(GetData("Item5"), String)</pre>
<p>Currently, I can use tools such as Find and Replace to replace e.g. &#8220;.Text = GetData(&#8221; with &#8220;.Value = Convert(GetData(&#8220;, but replacing &#8220;)&#8221; with &#8220;), String)&#8221; is a bit more tricky. For that I would probably copy and paste &#8220;, String)&#8221; onto the end of each line. Either way, this is a very repetitive task. And if there&#8217;s one thing that we know, it&#8217;s that computers are <em>excellent</em> at automating repetitive tasks. I would love a tool that, after I&#8217;ve changed a couple lines, spots the repetition and intelligently asks if I want to apply the same modification to subsequent similar lines &#8211; ideally with a preview to check accuracy.</p>
<p>Another example. Supposing I have a list of blank &lt;select&gt; options that I&#8217;ve quickly copied and pasted ready for population:</p>
<pre class="brush:[html]">&lt;option value=""&gt;&lt;/option&gt;
&lt;option value=""&gt;&lt;/option&gt;
&lt;option value=""&gt;&lt;/option&gt;
&lt;option value=""&gt;&lt;/option&gt;
&lt;option value=""&gt;&lt;/option&gt;</pre>
<p>&#8230; and I fill the lines in like so:</p>
<pre class="brush:[html]">&lt;option value="Item1"&gt;Item1&lt;/option&gt;
&lt;option value="Item2"&gt;Item2&lt;/option&gt;
&lt;option value="Item3"&gt;Item3&lt;/option&gt;
&lt;option value="Item4"&gt;Item4&lt;/option&gt;
&lt;option value="Item5"&gt;Item5&lt;/option&gt;</pre>
<p>Again, I would fill in the first couple of lines, but this one would work a bit differently. The tool would realise that the value and text of each item is the same, and automatically fill out one based on what I type in the other. I.e. I&#8217;d type &#8220;Item3&#8243; into the value field of the third option, and it would automatically put &#8220;Item3&#8243; as the inner HTML. Taking it a step further, in this particular example, it could also pick up the sequential numbering of items, and suggest to fill out the remaining items automatically. A step further again, and you could get it to work with e.g. form elements or project datasource columns, to automatically produce entire forms and classes based on a bit of initial prompting &#8211; i.e. write out some code that mentions the first and second columns of a given datasource, and it suggests lines of code similar to the lines entered, but with the other column names.</p>
<p>Of course this tool is completely hypothetical &#8211; at least as far as I&#8217;m aware&#8230; But in theory would not be <em>too</em> drastically hard to create, and would save developers everywhere a lot of time; I&#8217;m allowed to dream, aren&#8217;t I? If it became a reality, it would be a huge feature &#8211; the next big thing perhaps?</p>
]]></content:encoded>
			<wfw:commentRss>http://tom.net.nz/2010/07/next-big-thing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Facebook Connect observation</title>
		<link>http://tom.net.nz/2010/06/facebook-connect/</link>
		<comments>http://tom.net.nz/2010/06/facebook-connect/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 03:23:26 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Intarwebs]]></category>

		<guid isPermaLink="false">http://tom.net.nz/?p=277</guid>
		<description><![CDATA[Here&#8217;s a bit of a dud write-up. Dud because the risks are minimal, as I realised when I started looking into cross-domain iframe DOM scraping&#8230; But potentially interesting reading for web developers nonetheless. If you have been browsing the internet lately, you have more than likely seen a Facebook Connect box. It looks like this: [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a bit of a dud write-up. Dud because the risks are minimal, as I realised when I started looking into cross-domain iframe DOM scraping&#8230; But potentially interesting reading for web developers nonetheless.</p>
<p>If you have been browsing the internet lately, you have more than likely seen a Facebook Connect box. It looks like this:</p>
<p><a href="http://tom.net.nz/wp-content/uploads/2010/06/gp-facebook.png"><img class="alignnone size-full wp-image-278" title="GamePlanet Facebook Connect" src="http://tom.net.nz/wp-content/uploads/2010/06/gp-facebook.png" alt="" width="340" height="666" /></a></p>
<p>This particular screenshot is taken from <a href="http://gpforums.co.nz">Gameplanet Forums</a>, but Facebook Connect makes it easy for <em>any</em> website developer to embed the panel into their website. I could put one on tom.net.nz, if I was so inclined.</p>
<p>Now, Facebook would argue that this frame is a naive, harmless feature, because the information is never passed directly to the website in question, but rather the website just embeds a little piece of code, and Facebook generates the actual content of the pane. The code embedded is identical for any user visiting the website.</p>
<p>This is all well and good, however (!), the content that Facebook generates for this pane will differ depending on whether or not the user viewing it is currently logged into Facebook. If they are, then Facebook tries to show information more &#8220;relevant&#8221; to that user. For example, in the above screenshot, &#8220;Matt&#8221; is my friend on Facebook (and the only person in my friends who has &#8220;liked&#8221; Gameplanet on Facebook). The other people are generated randomly, but no matter how many times I refresh the page, Matt will always appear in the list. Do you see where this is going?</p>
<p>One might assume that Facebook has put some measures in place to stop the site from scraping this information, however the tech savvy can follow the following link which generates the box for Gameplanet&#8217;s Facebook Connect pane: <a href="http://www.facebook.com/plugins/likebox.php?api_key=118242074867196&amp;connections=15&amp;header=false&amp;height=630&amp;id=173654025454&amp;locale=en_US&amp;sdk=joey&amp;stream=true&amp;width=300">link</a>. If you view the source, there are all the names, in plain HTML, with links to both the photo, <em>and</em> (perhaps more disturbingly), the profile of each person. I was also able to scrape my own user ID from the HTML. Fortunately, in most modern browsers, XSS (Cross-Site Scripting) protection prevents the parent page from accessing the DOM of Facebook&#8217;s frame, but this is still a major potential security problem for older browsers which don&#8217;t have such protection built-in. By inspecting the list of users on a few page loads and looking for duplicate names, a malicious site could ascertain who is friends with the user browsing the page. The parameters passed to the frame source allow significant customization of the response, for example with a bit of tweaking I was able to come up with the following <a href="http://www.facebook.com/plugins/likebox.php?api_key=118242074867196&amp;connections=100&amp;height=800&amp;header=false&amp;id=173654025454&amp;locale=en_US&amp;sdk=joey&amp;width=700">source</a>, which now shows 100 users instead of the default 15. To take it a step further, a malicious page could potentially load this frame without even showing it, meaning the user would be completely unaware that the site was doing anything to do with Facebook, meanwhile it&#8217;s scraping the user&#8217;s private information.</p>
<p>Of course, those using a remotely modern browser do not have to worry about this sort of attack&#8230; But I think it does highlight the potential risks associated with these completely unnecessary &#8220;features&#8221; &#8211; not to mention the dangers of using an out-of-date browser. I would have hoped that at the very least Facebook would have performed some source obfuscation or dynamic JavaScript DOM population.</p>
]]></content:encoded>
			<wfw:commentRss>http://tom.net.nz/2010/06/facebook-connect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moving</title>
		<link>http://tom.net.nz/2010/05/moving/</link>
		<comments>http://tom.net.nz/2010/05/moving/#comments</comments>
		<pubDate>Wed, 19 May 2010 06:10:00 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://tom.net.nz/?p=270</guid>
		<description><![CDATA[For a long time, I&#8217;ve been interested in software development and computer programming. At some point in my mid-teens I worked out that I could get paid to write code, something I already enjoyed doing. It was from this time that I had vague aspirations to move overseas and work at a large software organisation, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://tom.net.nz/2010/02/coding-a-not-so-brief-history/">For a long time</a>, I&#8217;ve been interested in software development and computer programming. At some point in my mid-teens I worked out that I could get paid to write code, something I already enjoyed doing. It was from this time that I had vague aspirations to move overseas and work at a large software organisation, and even back then, the first one that always came to mind was Microsoft.</p>
<p>Those aspirations had always been in the back of my mind, while I worked on my Bachelor of Engineering, and worked at <a href="http://canary.co.nz/">Canary</a>. After an initial application attempt to Microsoft in 2008 that was thwarted by the recession, I decided to prepare my CV once again at the end of last year (2009). Without much further thought, I submitted it to Microsoft. Then about a month ago, I received an email that I was to be having an interview over the phone. As far as I could tell, this phone interview went atrociously, but contrary to my expectations I received an email a week later detailing plans to fly me over to Sydney to interview in person with a few recruiters. I arrived back from said flight this morning.</p>
<p>Long story short, I will be moving to Microsoft&#8217;s Redmond HQ in Seattle, USA. This will be taking place in late September.</p>
<p>This is pretty much a dream come true, and I&#8217;m stoked to actually be seeing those aspirations from so long ago become reality. I have long said that I would not be looking for another job in New Zealand, and I have truly enjoyed my time working at <a href="http://canary.co.nz/">Canary</a>. However, the opportunity to be able to work in another country and see some more of the world was simply too great to pass up. I believe that I will also find more room for personal growth and career advancement in a larger company. By the way, quick plug for our <a href="http://www.trademe.co.nz/Trade-me-jobs/IT-Jobs/Programming-development/listing-289582815.htm">job ad</a>, if you&#8217;re a software developer in Auckland.</p>
<p>This change is not without its drawbacks, and I will miss much about my life in New Zealand, not the least of which being proximity to family, and the friends that I have grown close to in Auckland over these last few years. I will miss you all like crazy. I hope to have a blast with my last few months in New Zealand (let&#8217;s hit the snow!), and no doubt I&#8217;ll be spending the majority of my annual leave here (New Year&#8217;s anyone?).</p>
<p>Keep an eye out for some sort of leaving party!</p>
<p>Cheers.</p>
]]></content:encoded>
			<wfw:commentRss>http://tom.net.nz/2010/05/moving/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Non-neglect</title>
		<link>http://tom.net.nz/2010/04/non-neglect/</link>
		<comments>http://tom.net.nz/2010/04/non-neglect/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 05:01:14 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Intarwebs]]></category>
		<category><![CDATA[Money Mouth]]></category>

		<guid isPermaLink="false">http://tom.net.nz/?p=242</guid>
		<description><![CDATA[Well, my last post somewhat inspired me to revisit the theme for the Money Mouth. I&#8217;ve now added another page, and added a bunch of JavaScript, such as for logging in, and when hovering over pools and pool options. Check it out! Home Pools Hopefully if I keep this up, I&#8217;ll be inspired to write some [...]]]></description>
			<content:encoded><![CDATA[<p>Well, my <a href="http://tom.net.nz/2010/04/neglect/">last post</a> somewhat inspired me to revisit the theme for the Money Mouth. I&#8217;ve now added another page, and added a bunch of JavaScript, such as for logging in, and when hovering over pools and pool options. Check it out!</p>
<ul>
<li><a href="http://moneymouth.co.nz/design-b/home.html">Home</a></li>
<li><a href="http://moneymouth.co.nz/design-b/pools.html">Pools</a></li>
</ul>
<p>Hopefully if I keep this up, I&#8217;ll be inspired to write some actual code&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://tom.net.nz/2010/04/non-neglect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Neglect</title>
		<link>http://tom.net.nz/2010/04/neglect/</link>
		<comments>http://tom.net.nz/2010/04/neglect/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 01:29:55 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Intarwebs]]></category>
		<category><![CDATA[Money Mouth]]></category>

		<guid isPermaLink="false">http://tom.net.nz/?p=238</guid>
		<description><![CDATA[So a while back I purchased the moneymouth.co.nz domain, with the idea of starting a new website project &#8211; and even got to the point of bashing up a quick theme for it&#8230; But then I promptly forgot about it and didn&#8217;t do any actual coding. I do recall looking into which platform to implement [...]]]></description>
			<content:encoded><![CDATA[<p>So a while back I purchased the <a href="http://moneymouth.co.nz/">moneymouth.co.nz</a> domain, with the idea of starting a new website project &#8211; and even got to the point of bashing up a quick <a href="http://tom.net.nz/2009/11/initial-money-mouth-design/">theme</a> for it&#8230; But then I promptly forgot about it and didn&#8217;t do any actual coding. I do recall looking into which platform to implement it in &#8211; tossing up between CakePHP and Django, but that was about it.</p>
<p>And now&#8230; Now I&#8217;m not sure if I&#8217;ll ever be bothered to do anything with it. If I haven&#8217;t started coding come the time when the domain expires, I might just let it go. I just didn&#8217;t get inspired enough to start implementation. I think I need a really fresh, engaging project to start on. Open to ideas.</p>
]]></content:encoded>
			<wfw:commentRss>http://tom.net.nz/2010/04/neglect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Raytrace</title>
		<link>http://tom.net.nz/2010/03/raytrace/</link>
		<comments>http://tom.net.nz/2010/03/raytrace/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 01:35:35 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://tom.net.nz/?p=218</guid>
		<description><![CDATA[Recently, I have been playing around a bit with some old ray tracing code, converting it to C# and making it threaded. I&#8217;m also using it to explore miscellaneous graphics and 3D concepts. Most recently I&#8217;ve implemented supersampling anti-aliasing. Here&#8217;s a recent render: (Click through for full size). It&#8217;s a little unclear, but it&#8217;s a [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I have been playing around a bit with some old <a href="http://en.wikipedia.org/wiki/Ray_tracing">ray tracing</a> code, converting it to C# and making it threaded. I&#8217;m also using it to explore miscellaneous graphics and 3D concepts. Most recently I&#8217;ve implemented supersampling anti-aliasing. Here&#8217;s a recent render:</p>
<p><a href="http://tom.net.nz/wp-content/uploads/2010/03/rt1.jpg"><img class="alignnone size-medium wp-image-219" title="Raytrace1" src="http://tom.net.nz/wp-content/uploads/2010/03/rt1-300x300.jpg" alt="" width="300" height="300" /></a></p>
<p>(Click through for full size).</p>
<p>It&#8217;s a little unclear, but it&#8217;s a number of perfectly reflective spheres hovering above a green plane, being imaged from above. There are several bounce iterations, two light sources, and full specular shading/shadows. Notice the non-jagged edges (indicating that the antialiasing is functioning as intended).</p>
<p>Here&#8217;s a closer view with some additional <a href="http://local.wasp.uwa.edu.au/~pbourke/miscellaneous/aliasing/">stochastic anti aliasing</a>:</p>
<p><a href="http://tom.net.nz/wp-content/uploads/2010/03/rt2.jpg"><img class="alignnone size-medium wp-image-222" title="Raytrace2" src="http://tom.net.nz/wp-content/uploads/2010/03/rt2-300x300.jpg" alt="" width="300" height="300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://tom.net.nz/2010/03/raytrace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coding: a not-so-brief history</title>
		<link>http://tom.net.nz/2010/02/coding-a-not-so-brief-history/</link>
		<comments>http://tom.net.nz/2010/02/coding-a-not-so-brief-history/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 22:19:50 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://tom.net.nz/?p=182</guid>
		<description><![CDATA[Since it seems that February is &#8220;interests month&#8221; on the blog, I figured I&#8217;d continue the trend and write about an interest that has been with me since the very beginning, and that currently forms a large part of my life. That interest is computers and programming. Disclaimer: This is going to be a very [...]]]></description>
			<content:encoded><![CDATA[<p>Since it seems that February is &#8220;interests month&#8221; on the blog, I figured I&#8217;d continue the trend and write about an interest that has been with me since the very beginning, and that currently forms a large part of my life. That interest is computers and programming. Disclaimer: This is going to be a very long, nerdy post. Most of it will probably be gibberish if you don&#8217;t know much about programming. You have been warned.</p>
<p><span id="more-182"></span>From a very young age, my family has owned computers. There is a photo of me at about 2-3 years of age grasping a joystick and playing <a href="http://en.wikipedia.org/wiki/Jet_Set_Willy">Jet Set Willy</a> on an AMSTRAD CPC 6128. While I don&#8217;t have the actual photo, here&#8217;s what such an AMSTRAD looks like:</p>
<p><a rel="attachment wp-att-183" href="http://tom.net.nz/2010/02/coding-a-not-so-brief-history/amstrad_cpc_6128/"><img class="alignnone size-medium wp-image-183" title="AMSTRAD CPC 6128" src="http://tom.net.nz/wp-content/uploads/2010/02/amstrad_cpc_6128-300x267.jpg" alt="" width="300" height="267" /></a></p>
<p>This particular AMSTRAD came with a few floppy disks with programs and games on them, and a book. The computer was programmed using a stripped down version of <a href="http://en.wikipedia.org/wiki/BASIC">BASIC</a>, and the book contained a bunch of example programs, often many pages long. I learnt to type pretty quickly with two fingers, as I would laboriously type out these big long programs. Often one mistake would result in them not working properly (or not at all), but there was always a certain sense of satisfaction (and fascination) when the computer would spring into life and actually <em>do something</em> based on what I had just typed in. My interest was piqued.</p>
<p>After a few years, the old AMSTRAD gave up and died, and we got a 386DX PC as a replacement (loaded up with the shiny new Windows 3.11). After a frustrating few days trying to enter BASIC commands from the AMSTRAD book at a DOS command prompt, I decided to talk to my uncle, who was in the PC business (and built the 386 for us). He installed <a href="http://en.wikipedia.org/wiki/QBasic">QBASIC</a> for me and showed me how to use it. I quickly discovered that the AMSTRAD programs didn&#8217;t work so well in QBASIC, and so a visit to the library later, I was teaching myself QBASIC. My first programs were pretty basic, doing things involving displaying text output and taking text input. I can recall a &#8220;math quiz&#8221; program that generated random math problems and tested for the correct result.</p>
<p>QBASIC was my staple programming language for the better part of 5 years (I would estimate from the ages of 7-12), and after a while I got fairly proficient at it, creating applications with &#8220;rich&#8221; (at the time) graphics and sound. However, I was inevitably getting a bit sick of it, and my interest in creating QBASIC applications was quickly tailing off. It was about this time that we got a flash new computer &#8211; a Pentium 200MHz with Windows 95.</p>
<p>It was at the age of 12 that I then discovered <a href="http://en.wikipedia.org/wiki/Visual_Basic">Visual Basic</a> on one of the computers at school. Here was a language that let me apply my BASIC knowledge to creating pretty rich Windows applications in an astonishingly straightforward way. A bit of begging and pleading later, I managed to score myself Visual Basic 6 on my 13th birthday (sad, I know). My interest was once again piqued.</p>
<p>What followed was a raft of fairly complex (if I may say so myself) applications, such as a timesheet application that I used to record my lawnmowing/carwashing/chores hours to charge my parents, an MP3 file renamer, a digital camera synchronisation tool, and a prime number finder. I even made a nifty little application for my Dad that would recognise when ArchiCAD (drafting software he used for work) was running and in focus, and record for how long. He used this for a couple of years to record his working hours when working from home.</p>
<p>Of course, with my ear to the ground, it didn&#8217;t take me long to work out that Visual Basic wasn&#8217;t the be all and end all of programming languages (in fact, quite the opposite &#8211; it&#8217;s in many ways the ugly cousin of &#8220;true&#8221; languages). I kept hearing about this amazing language known as <a href="http://en.wikipedia.org/wiki/C%2B%2B">C++</a>. And so when I was about 15 (I think it was for my birthday again), I became the proud owner of a pretty thick book about C++, covering everything from the basics, to pointers and multiple inheritance. For a time I was a little discouraged, as C++ lacked the &#8220;glitz and glam&#8221; of VB6 (the book only covered writing console applications and the features of the language &#8211; in retrospect the right way to learn), as even after 6 months or so I was still writing applications that made text output and took text input. In some ways it was like going back to QBASIC.</p>
<p>After a time I discovered the Win32 API, and how to create a window and make a message queue and so on. After a couple days visiting a local game development studio, I was inspired to create some little graphical applications, such as a 2D particle system and a &#8220;starfield&#8221; animation, using C++ and Win32. I never totally got into it, though. I hadn&#8217;t discovered MFC at the time, and Win32 was a major pain in the ass to write. The peak of my C++ coding was a little 3D game that I made after discovering the DirectX Software Development Kit (SDK). The language always struck me as pretty ugly (especially with the horrendous <a href="http://en.wikipedia.org/wiki/Hungarian_notation">Hungarian naming</a> that all the Win32 libraries used), and I longed to return to a language that had sensible naming and no preprocessor directives. In my reading about the DirectX SDK, I discovered a newly emerging language: <a href="http://en.wikipedia.org/wiki/Visual_Basic_.NET">VB.NET</a>. I was about 17 at the time.</p>
<p>I set about translating my C++ 3D game into VB.NET. By the time I had it working (a surprisingly simple process), I was sold. .NET let me take the good bits of VB6 (simple window creation, sensible naming, etc), and combine them with a fast, robust, non-scripted language. Naturally, it wasn&#8217;t long before I moved in turn to <a href="http://en.wikipedia.org/wiki/C_Sharp_(programming_language)">C#</a>, which continues to be my preferred language to date.</p>
<p>From about the age of 15, I knew that I wanted to turn my interest into a job. It made sense &#8211; I enjoyed doing it, why not get paid to do it? And so I decided to go into a Software Engineering degree after high school. At university, the first language we were taught was Java (where my C++/C# knowledge meant that I already knew everything I needed to know). I went drinking the night before the final exam, finished the 3-hour exam after an hour, was first to leave, and still managed to get an A+. Score. After that, we were taught a variety of other languages, including C (again, C++ came in handy), Tcl/Tk, and Lisp. Fortunately things got a little more challenging in 3rd and 4th year, and I was actually learning things about programming again.</p>
<p>I&#8217;m not really sure how to finish this post (as my interest is very much an ongoing thing), so to sum it up: I&#8217;ve been cultivating a passion for computers and programming from a young age, and I now get paid to do what I love; Code.</p>
]]></content:encoded>
			<wfw:commentRss>http://tom.net.nz/2010/02/coding-a-not-so-brief-history/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New project!</title>
		<link>http://tom.net.nz/2009/11/new-project/</link>
		<comments>http://tom.net.nz/2009/11/new-project/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 22:27:08 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Intarwebs]]></category>
		<category><![CDATA[Money Mouth]]></category>

		<guid isPermaLink="false">http://tom.net.nz/?p=115</guid>
		<description><![CDATA[Finally decided on a website project &#8211; Money Mouth. (Currently just a placeholder page). When complete, it will be a &#8220;betting pool&#8221; application (for fake money, of course!). Basically, users can create pools with several options that others can place bets on, and the total pool is divided among those selecting the winning option. Pools [...]]]></description>
			<content:encoded><![CDATA[<p>Finally decided on a website project &#8211; <a href="http://www.moneymouth.co.nz/" target="_blank">Money Mouth</a>. (Currently just a placeholder page).</p>
<p>When complete, it will be a &#8220;betting pool&#8221; application (for fake money, of course!). Basically, users can create pools with several options that others can place bets on, and the total pool is divided among those selecting the winning option. Pools can be about anything and everything, and will likely be community regulated (for example, creating a popular pool will net you some of the winnings; and falsifying the winning option will result in you getting a bad rep).</p>
<p>If you have any cool ideas around this project I&#8217;d love to hear them!</p>
]]></content:encoded>
			<wfw:commentRss>http://tom.net.nz/2009/11/new-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
