<?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>stew (@) rtmatheson.com</title>
	<atom:link href="http://rtmatheson.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://rtmatheson.com</link>
	<description>My name is Stewart Matheson. I work with code, servers and anything else that makes the web work.  I am also avaiable for hire to help you with any of your projects.</description>
	<lastBuildDate>Sat, 04 Sep 2010 17:51:03 +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>Welcome to Telescope</title>
		<link>http://rtmatheson.com/2010/09/welcome-to-telescope/</link>
		<comments>http://rtmatheson.com/2010/09/welcome-to-telescope/#comments</comments>
		<pubDate>Sat, 04 Sep 2010 17:51:03 +0000</pubDate>
		<dc:creator>Stewart Matheson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rtmatheson.com/?p=243</guid>
		<description><![CDATA[Telescope is a new type of forum application. Why not check the information page? Bookmark It]]></description>
			<content:encoded><![CDATA[<p>Telescope is a new type of forum application. Why not check the <a href="http://telescopeapp.net">information page</a>?</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Frtmatheson.com%2F2010%2F09%2Fwelcome-to-telescope%2F&amp;title=Welcome+to+Telescope" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Frtmatheson.com%2F2010%2F09%2Fwelcome-to-telescope%2F&amp;title=Welcome+to+Telescope" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Frtmatheson.com%2F2010%2F09%2Fwelcome-to-telescope%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Frtmatheson.com%2F2010%2F09%2Fwelcome-to-telescope%2F&amp;title=Welcome+to+Telescope" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Frtmatheson.com%2F2010%2F09%2Fwelcome-to-telescope%2F&amp;title=Welcome+to+Telescope" rel="nofollow" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Frtmatheson.com%2F2010%2F09%2Fwelcome-to-telescope%2F&amp;title=Welcome+to+Telescope" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Frtmatheson.com%2F2010%2F09%2Fwelcome-to-telescope%2F&amp;t=Welcome+to+Telescope" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://rtmatheson.com/2010/09/welcome-to-telescope/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing assert-random</title>
		<link>http://rtmatheson.com/2010/08/introducing-assert-random/</link>
		<comments>http://rtmatheson.com/2010/08/introducing-assert-random/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 11:11:15 +0000</pubDate>
		<dc:creator>Stewart Matheson</dc:creator>
				<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://rtmatheson.com/?p=232</guid>
		<description><![CDATA[Something I have been meaning to do for a long time now is create and release a ruby gem. Today I have done this. Introducing assert-random. Its a VERY simple gem that adds an assertion to test/unit. Assert random as a test accepts a block and runs this block 10 times. Once the block has [...]]]></description>
			<content:encoded><![CDATA[<p>Something I have been meaning to do for a long time now is create and release a ruby gem. Today I have done this. Introducing assert-random. Its a VERY simple gem that adds an assertion to test/unit. Assert random as a test accepts a block and runs this block 10 times. Once the block has been run it then checks the results of the block. Currently it tests to make sure that no objects that are the result of the block match. Not much but its a start.</p>
<p>Example that passes:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;">assert_random <span style="color:#9966CC; font-weight:bold;">do</span>
    <span style="color:#CC0066; font-weight:bold;">rand</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">1000</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>Example that fails:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;">assert_random <span style="color:#9966CC; font-weight:bold;">do</span>
    <span style="color:#006666;">1000</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>Basic stuff but I plan to extend it in the future so something like this will fail:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;">counter = <span style="color:#006666;">1</span>
assert_random <span style="color:#9966CC; font-weight:bold;">do</span>
    counter <span style="color:#006600; font-weight:bold;">+</span>= <span style="color:#006666;">1</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>I used the gem Jeweler. I got up and running very quickly and was able to focus on the functionality of the gem and not all of the meta details a gem needs. All that was generated for me. Awesome really.</p>
<p>Source: <a href="http://github.com/stewartmatheson/assert-random">http://github.com/stewartmatheson/assert-random</a><br />
RubyGem: <a href="http://rubygems.org/gems/assert-random">http://rubygems.org/gems/assert-random</a></p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Frtmatheson.com%2F2010%2F08%2Fintroducing-assert-random%2F&amp;title=Introducing+assert-random" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Frtmatheson.com%2F2010%2F08%2Fintroducing-assert-random%2F&amp;title=Introducing+assert-random" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Frtmatheson.com%2F2010%2F08%2Fintroducing-assert-random%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Frtmatheson.com%2F2010%2F08%2Fintroducing-assert-random%2F&amp;title=Introducing+assert-random" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Frtmatheson.com%2F2010%2F08%2Fintroducing-assert-random%2F&amp;title=Introducing+assert-random" rel="nofollow" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Frtmatheson.com%2F2010%2F08%2Fintroducing-assert-random%2F&amp;title=Introducing+assert-random" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Frtmatheson.com%2F2010%2F08%2Fintroducing-assert-random%2F&amp;t=Introducing+assert-random" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://rtmatheson.com/2010/08/introducing-assert-random/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Ruby, require, include and Mixins</title>
		<link>http://rtmatheson.com/2010/07/using-ruby-require-include-and-mixins/</link>
		<comments>http://rtmatheson.com/2010/07/using-ruby-require-include-and-mixins/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 16:46:01 +0000</pubDate>
		<dc:creator>Stewart Matheson</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://rtmatheson.com/?p=220</guid>
		<description><![CDATA[When I first discovered Rails all those years ago I had not really heard of ruby. I think rails introduced a lot of new people to ruby such as my self. Its great for ruby to have all these new users however this is a problem as well. The problem is that people such as [...]]]></description>
			<content:encoded><![CDATA[<p>When I first discovered Rails all those years ago I had not really heard of ruby. I think rails introduced a lot of new people to ruby such as my self. Its great for ruby to have all these new users however this is a problem as well. The problem is that people such as myself jump right in to rails with out fully understanding ruby or in my case even partly understanding ruby.  This in it&#8217;s self is not a probelm however the deeper you go in to rails the longer your going to have to go back and look at the naked ruby.  This can lead to some problems later down the line. It can also make other peoples code hard to read. This is a weakness and something that I have been working on skilling up on.</p>
<p>This weakness was exposed today when I was trying to write an acts_as_method.  I am currently working on a rule based AI system and I wanted to separate the underlying code of the AI system from the rails models that provide the knowledge. Thats where the acts_as_method comes in. However it came in rather slowly.</p>
<p>My first hurdle was looking at the require vs include. Both sound the same but do different things.  Its important to understand this. The require opens reads and evaluates the code with in a ruby file. So for example say I have a file called Person.rb. In this file there was a class called &#8220;Person&#8221;. With me so far? I am working out of a file next to Person.rb called test.rb. Test.rb needs to know about Person.rb so that the Person class can be used. To do this we simply use</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'Person.rb'</span></pre></div></div>

<p>Simple enough. Ruby also supports shortcuts and will auto append the .rb so</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'Person'</span></pre></div></div>

<p>will also work. Again simple enough however all of a sudden it looks like we are talking about a class or a module here. This is what threw me a bit at first but remember it is the file. Directories work as you would expect. Say our person.rb is now in a models directory. Just use</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'models/person'</span></pre></div></div>

<p>Again no .rb but remember it is the file we are talking about. That brings us to include. Include in c++ for example includes a file the the way require works as described above but this is not the case in ruby.</p>
<p>In ruby we have mixins that allow use to add a module full of methods to any class we like. This is great and very handy as ruby does not support multiple inheritance. But who cares. Mixins are simple to use and make more sense. So lets consider the following</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> Person
  <span style="color:#9966CC; font-weight:bold;">def</span> say_goodbye
    <span style="color:#996600;">&quot;goodbye&quot;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">module</span> PersonMethods
  <span style="color:#9966CC; font-weight:bold;">def</span> say_hello
    <span style="color:#996600;">&quot;hello&quot;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
Person.<span style="color:#9966CC; font-weight:bold;">include</span><span style="color:#006600; font-weight:bold;">&#40;</span>PersonMethods<span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<p>Here we have a person class. We have a module with a method and we are using the include method to add the module methods to the person class. Now the person class will have both the say hello and say goodbye methods. The include is working on the program level. Not the file level. Very different to #include in c++ for example. I think form memory PHP has something smilier.</p>
<p>Who cares? Why do I need to do this? Why not just put both methods in the person class. Well you could do that and in this case its fine. However think about developing a Rails application for example.  You might have some logic that you want to use in a number of Rails applications. Cuting and pasting code from one model to another is one way to it but what about the following?</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>.<span style="color:#9900CC;">send</span> <span style="color:#ff3333; font-weight:bold;">:include</span>, PersonMethods</pre></div></div>

<p>This is one of my favorite things about ruby. You can add in methods to classes that have already been declared else where.  You can add them when you need and you can break up your methods in different ways and add them at different times. All of a sudden your writing extra features in to rails with out even touching the source. Well the rails models at least.</p>
<p>This does not just stop at rails. You can apply this to any class anywhere. You can even apply it to core ruby classes. You can change the way ruby works at runtime! Check out the ruby homepage for lots more info.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Frtmatheson.com%2F2010%2F07%2Fusing-ruby-require-include-and-mixins%2F&amp;title=Using+Ruby%2C+require%2C+include+and+Mixins" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Frtmatheson.com%2F2010%2F07%2Fusing-ruby-require-include-and-mixins%2F&amp;title=Using+Ruby%2C+require%2C+include+and+Mixins" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Frtmatheson.com%2F2010%2F07%2Fusing-ruby-require-include-and-mixins%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Frtmatheson.com%2F2010%2F07%2Fusing-ruby-require-include-and-mixins%2F&amp;title=Using+Ruby%2C+require%2C+include+and+Mixins" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Frtmatheson.com%2F2010%2F07%2Fusing-ruby-require-include-and-mixins%2F&amp;title=Using+Ruby%2C+require%2C+include+and+Mixins" rel="nofollow" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Frtmatheson.com%2F2010%2F07%2Fusing-ruby-require-include-and-mixins%2F&amp;title=Using+Ruby%2C+require%2C+include+and+Mixins" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Frtmatheson.com%2F2010%2F07%2Fusing-ruby-require-include-and-mixins%2F&amp;t=Using+Ruby%2C+require%2C+include+and+Mixins" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://rtmatheson.com/2010/07/using-ruby-require-include-and-mixins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Events in ActionScript3</title>
		<link>http://rtmatheson.com/2010/07/events-in-actionscript3/</link>
		<comments>http://rtmatheson.com/2010/07/events-in-actionscript3/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 16:55:25 +0000</pubDate>
		<dc:creator>Stewart Matheson</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[dispatcher]]></category>
		<category><![CDATA[events]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://rtmatheson.com/?p=202</guid>
		<description><![CDATA[There are a lot of posts around the Internet on ActionScript. A lot of them are very poorly written. Whilst they take the time to explain the &#8220;what&#8221; they don&#8217;t take the time to explain the &#8220;why&#8221;. I will attempt to do that with this blog post. Events are a vital part of developing with [...]]]></description>
			<content:encoded><![CDATA[<p>There are a lot of posts around the Internet on ActionScript. A lot of them are very poorly written. Whilst they take the time to explain the &#8220;what&#8221; they don&#8217;t take the time to explain the &#8220;why&#8221;. I will attempt to do that with this blog post.</p>
<p>Events are a vital part of developing with ActionScript 3. Events are a very flexible way to make your code moduler and loosely coupled. Flush supports a number of events prepackaged. These include mouseclick events and keyboard events.</p>
<p>Whilst these are important for making any kind of user interface its custom events can I am going to explain how to use today. In the example I set up custom event for a unit within a strategy game I am developing. Think of civilisation and moving units around on a map.</p>
<p>When creating a custom event the first thing to do is write the custom event class. The custom event class must extend the event class which can be found in the flash.events package. </p>
<p>In this example the unit event class covers all events that relate to units. Obviously. Specifically the events I wish to send include movement, when the unit is selected, when the unit is deselected and when the unit has finished its movement. </p>
<p>In the class there is a static string declared representing each of these event types.  The event model in action script uses this string to decide what listeners to call. Therefore this string is needed when adding an event listener.</p>
<p>In the class is the constructor. The constructor accepts one variable which is this event string. Make sure when you declare the constructor that the super call with the command string is present. This is all ActionScript needs to handle the event.</p>
<p>You may require to send additional information with the event. I have done this by using get and set methods. As the event is simply a class there are no limits on what functionality you can implement within the event itself.</p>

<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
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;">package com.<span style="color: #006600;">events</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">geom</span>.<span style="color: #006600;">MapPoint</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> UnitEvent <span style="color: #0066CC;">extends</span> Event <span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> const MOVEMENT:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;movement&quot;</span>;
		<span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> const SELECTED:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;selected&quot;</span>;
		<span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> const DESELECTED:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;deselected&quot;</span>;
		<span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> const MOVEMENT_COMPLETE:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;movement_complete&quot;</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> targetLocation:MapPoint;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> startLocation:MapPoint;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> UnitEvent<span style="color: #66cc66;">&#40;</span>command:<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #0066CC;">super</span><span style="color: #66cc66;">&#40;</span>command<span style="color: #66cc66;">&#41;</span>; <span style="color: #66cc66;">&#125;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getTargetLocation<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:MapPoint <span style="color: #66cc66;">&#123;</span> <span style="color: #b1b100;">return</span> targetLocation; <span style="color: #66cc66;">&#125;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> setTargetLocation<span style="color: #66cc66;">&#40;</span>t:MapPoint<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span> targetLocation = t; <span style="color: #66cc66;">&#125;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getStartLocation<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:MapPoint <span style="color: #66cc66;">&#123;</span> <span style="color: #b1b100;">return</span> startLocation; <span style="color: #66cc66;">&#125;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> setStartLocation<span style="color: #66cc66;">&#40;</span>t:MapPoint<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span> startLocation = t; <span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>Once we have the event class written we a free to dispatch it. Despatching an event can be done from any class that extends IDispatcher. IDispatcher is built into ActionScript. </p>
<p>The following example is an excert from a class that handles the unit. The code creates a new unit event. The new unit event takes one constructor which is the movement complete static variable of the event itself. This calls any listeners that are subscribed to that particular event type. After the locations are set the dispatchEvent method is called. This takes one parameter which is the event instance.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>movesLeftThisTurn <span style="color: #66cc66;">&amp;</span>lt;= <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> movementCompleteEvent:UnitEvent = <span style="color: #000000; font-weight: bold;">new</span> UnitEvent<span style="color: #66cc66;">&#40;</span>UnitEvent.<span style="color: #006600;">MOVEMENT_COMPLETE</span><span style="color: #66cc66;">&#41;</span>;
	movementCompleteEvent.<span style="color: #006600;">setStartLocation</span><span style="color: #66cc66;">&#40;</span>startLocation<span style="color: #66cc66;">&#41;</span>;
	movementCompleteEvent.<span style="color: #006600;">setTargetLocation</span><span style="color: #66cc66;">&#40;</span>currentLocation<span style="color: #66cc66;">&#41;</span>;
	startLocation = m;
	movesLeftThisTurn = movement;
	dispatchEvent<span style="color: #66cc66;">&#40;</span>movementCompleteEvent<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>So now we have a custom event class, we have code that dispatches the event however we do not have any way of listening for the event. A listener is set up with an addEventListener method. This method takes two parameters. </p>
<p>The first parameter is the string representation of the event. Remember when we first created the instance of the event? We passed it a single string parameter. When we add an event listener that listener will only be called if the event is created with that particular string parameter. This allows us to create different types of events in a single class. It also allows us to blind behaviours for different events. A very powerful system! </p>
<p>The second parameter that this method takes is a string representation of the function that the event is calling. Make sure to omit the brackets at the end of the function as we dont want to call function we simply want to tell the listener about it.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> unitFactory<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Unit
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> u:Unit = <span style="color: #000000; font-weight: bold;">new</span> Unit<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:
	u.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>UnitEvent.<span style="color: #006600;">MOVEMENT</span>, unitView.<span style="color: #006600;">moved</span><span style="color: #66cc66;">&#41;</span>;
	u.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>UnitEvent.<span style="color: #006600;">MOVEMENT</span>, activeState.<span style="color: #006600;">selectNextUnit</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #b1b100;">return</span> u;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>The final step is to add the actual listener. The listener is a function in itself. The listener accepts one variable. The event that you have passed. This was the event that was sent in the dispatchEvent method. Make sure that every event listener returns void. If the event listener does not have a return type void then the event will not be fired properly.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> UnitView <span style="color: #0066CC;">extends</span> View <span style="color: #66cc66;">&#123;</span>
	...
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> moved<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:UnitEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
	<span style="color: #66cc66;">&#123;</span>
		x  = <span style="color: #0066CC;">e</span>.<span style="color: #006600;">getTargetLocation</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">xpos</span>;
		y  = <span style="color: #0066CC;">e</span>.<span style="color: #006600;">getTargetLocation</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">ypos</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>In the above event listener we update the units position as this event listener is fired when the unit is moved.</p>
<p>I hope this helps. Please give me feedback. If there is any other topics you would like me to blog about please don&#8217;t hesitate to ask.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Frtmatheson.com%2F2010%2F07%2Fevents-in-actionscript3%2F&amp;title=Events+in+ActionScript3" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Frtmatheson.com%2F2010%2F07%2Fevents-in-actionscript3%2F&amp;title=Events+in+ActionScript3" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Frtmatheson.com%2F2010%2F07%2Fevents-in-actionscript3%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Frtmatheson.com%2F2010%2F07%2Fevents-in-actionscript3%2F&amp;title=Events+in+ActionScript3" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Frtmatheson.com%2F2010%2F07%2Fevents-in-actionscript3%2F&amp;title=Events+in+ActionScript3" rel="nofollow" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Frtmatheson.com%2F2010%2F07%2Fevents-in-actionscript3%2F&amp;title=Events+in+ActionScript3" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Frtmatheson.com%2F2010%2F07%2Fevents-in-actionscript3%2F&amp;t=Events+in+ActionScript3" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://rtmatheson.com/2010/07/events-in-actionscript3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A few more details on my masters research project&#8230;</title>
		<link>http://rtmatheson.com/2010/06/first-map/</link>
		<comments>http://rtmatheson.com/2010/06/first-map/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 15:21:35 +0000</pubDate>
		<dc:creator>Stewart Matheson</dc:creator>
				<category><![CDATA[Rambling]]></category>
		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://rtmatheson.com/?p=182</guid>
		<description><![CDATA[I mentioned in my last post that started work on a hush-hush project. When I say hush-hush I really mean a project in which the details have not quite been refined. I can now reveal that the project I&#8217;m working on is a Flash-based Web game. The game is going to be a turn-based strategy [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_192" class="wp-caption alignnone" style="width: 423px"><a rel="attachment wp-att-192" href="http://rtmatheson.com/2010/06/first-map/firstmapbig/"><img class="size-full wp-image-192 " title="FirstMapBig" src="http://rtmatheson.com/wp-content/uploads/2010/06/FirstMapBig.jpg" alt="" width="413" height="292" /></a><p class="wp-caption-text">A very rough draft of what the first map in the game might look like.</p></div>
<p>I mentioned in my last post that started work on a hush-hush project. When I say hush-hush I really mean a project in which the details have not quite been refined.  I can now reveal that the project I&#8217;m working on is a Flash-based Web game. The game is going to be a turn-based strategy game. The game will feature an isometric view with tiles. Here&#8217;s my first rough version of the tiles that I want to include in the game. The colours are not quite right and there needs to be more variety however it is a good starting point. Don&#8217;t be too rough on me. I&#8217;m not really a designer.</p>
<p>I can also tell you that this game will feature an artificial intelligence system that I have not seen anywhere before. Instead of the artificial intelligence been coded into the game the artificial intelligence is housed within a Web application. The game requests back to the Web application asking the new artificial intelligence instructions. This is my dissertation for my masters. It&#8217;s my final research peace. A system like this probably doesn&#8217;t have any place in a commercial title. What I am really hoping to achieve is a proof of concept. Can a single artificial intelligence system operate across a distributed player network? I&#8217;m not sure but stick around if you would like to see the results.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Frtmatheson.com%2F2010%2F06%2Ffirst-map%2F&amp;title=A+few+more+details+on+my+masters+research+project%26%238230%3B" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Frtmatheson.com%2F2010%2F06%2Ffirst-map%2F&amp;title=A+few+more+details+on+my+masters+research+project%26%238230%3B" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Frtmatheson.com%2F2010%2F06%2Ffirst-map%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Frtmatheson.com%2F2010%2F06%2Ffirst-map%2F&amp;title=A+few+more+details+on+my+masters+research+project%26%238230%3B" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Frtmatheson.com%2F2010%2F06%2Ffirst-map%2F&amp;title=A+few+more+details+on+my+masters+research+project%26%238230%3B" rel="nofollow" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Frtmatheson.com%2F2010%2F06%2Ffirst-map%2F&amp;title=A+few+more+details+on+my+masters+research+project%26%238230%3B" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Frtmatheson.com%2F2010%2F06%2Ffirst-map%2F&amp;t=A+few+more+details+on+my+masters+research+project%26%238230%3B" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://rtmatheson.com/2010/06/first-map/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Up and running with Rails3 beta4</title>
		<link>http://rtmatheson.com/2010/06/up-and-running-with-rails3-beta4/</link>
		<comments>http://rtmatheson.com/2010/06/up-and-running-with-rails3-beta4/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 10:27:33 +0000</pubDate>
		<dc:creator>Stewart Matheson</dc:creator>
				<category><![CDATA[Rambling]]></category>

		<guid isPermaLink="false">http://rtmatheson.com/?p=170</guid>
		<description><![CDATA[Like everyone else on the rails community I am very excited about the upcoming release of rails3. I had some free time yesterday so I decided it&#8217;s time to install rails 3. I had some headaches. I don&#8217;t know if it&#8217;s me being misinformed however I initially attempted to install rails three with Ruby 1.9.2. [...]]]></description>
			<content:encoded><![CDATA[<p>Like everyone else on the rails community I am very excited about the upcoming release of rails3. I had some free time yesterday so I decided it&#8217;s time to install rails 3. I had some headaches. I don&#8217;t know if it&#8217;s me being misinformed however I initially attempted to install rails three with Ruby 1.9.2. This was a disaster. Well not quite a disaster it wants however painful. Rails itself installed fine. The gems were configured I was just having some problems with the application generator.</p>
<p>I decided to cut my losses and go to Ruby 1.9.1. Again I ran into trouble. This time up problems came when I was attempting to save records into the database. This error is known to the community and I got the impression that it was the version of Ruby I was using.</p>
<p>In the end I decided to cut my losses and go back to Ruby 1.8.7. As Ruby 1.8.7 has proved time and time again its the version to go with. Everything is working now and I am currently using rails3.</p>
<p>If you&#8217;re using a Mac like I am I would recommend compiling a fresh version of Ruby from source. This way you don&#8217;t interfere with your previous Ruby installation. If you need to run multiple versions of Ruby I suggest you check out Ruby version manager.</p>
<p>I am very excited about a lot of the changes in rails three. Full credit to David and the team for acknowledging that there still is quite a hefty barrier of entry for new users. The bunder gem is a welcome addition. I think this will ease some of the pain for new users. Especially new users joining an existing rails project.  In addition there have been several refinements in the API. The routing API has been considerably refined and it&#8217;s a much cleaner interface.</p>
<p>I can&#8217;t wait to get moving. I got some work to do today but once I get that finished in going to start specing out my first rails3 application. WOO!</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Frtmatheson.com%2F2010%2F06%2Fup-and-running-with-rails3-beta4%2F&amp;title=Up+and+running+with+Rails3+beta4" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Frtmatheson.com%2F2010%2F06%2Fup-and-running-with-rails3-beta4%2F&amp;title=Up+and+running+with+Rails3+beta4" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Frtmatheson.com%2F2010%2F06%2Fup-and-running-with-rails3-beta4%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Frtmatheson.com%2F2010%2F06%2Fup-and-running-with-rails3-beta4%2F&amp;title=Up+and+running+with+Rails3+beta4" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Frtmatheson.com%2F2010%2F06%2Fup-and-running-with-rails3-beta4%2F&amp;title=Up+and+running+with+Rails3+beta4" rel="nofollow" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Frtmatheson.com%2F2010%2F06%2Fup-and-running-with-rails3-beta4%2F&amp;title=Up+and+running+with+Rails3+beta4" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Frtmatheson.com%2F2010%2F06%2Fup-and-running-with-rails3-beta4%2F&amp;t=Up+and+running+with+Rails3+beta4" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://rtmatheson.com/2010/06/up-and-running-with-rails3-beta4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A new theme, a twitter client and a hush-hush project.</title>
		<link>http://rtmatheson.com/2010/06/a-new-theme-a-twitter-client-and-a-hush-hush-project/</link>
		<comments>http://rtmatheson.com/2010/06/a-new-theme-a-twitter-client-and-a-hush-hush-project/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 15:41:39 +0000</pubDate>
		<dc:creator>Stewart Matheson</dc:creator>
				<category><![CDATA[Rambling]]></category>

		<guid isPermaLink="false">http://rtmatheson.com/?p=166</guid>
		<description><![CDATA[Today I uploaded a new theme to this blog.&#160; This is the first time I have ever changed the look and the feel of this blog since its launch two years ago. It makes me happy. Change is as good as a holiday.&#160; I have been working on the design the in the last day [...]]]></description>
			<content:encoded><![CDATA[<p>Today I uploaded a new theme to this blog.&nbsp; This is the first time I have ever changed the look and the feel of this blog since its launch two years ago. It makes me happy. Change is as good as a holiday.&nbsp; I have been working on the design the in the last day and a half. Nothing special. You might not even say it&#8217;s better than the last design however I can say that this is 100% my blog now. No one else on the Internet has a design like this. It was a bit sad going to other blogs and seeing the exact same design. Not any more. A pat on the back to wordpress as well. Despite the fact that it&#8217;s written in PHP it&#8217;s actually very easy to theme. Well done guys an excellent blogging platform.</p>
<p>There are some problems. The HTML does not validate completely however this is due to the plug-ins I am using. I noticed that all of the code causing breaking HTML validation is outputted by the various plug-ins I have installed. No bother the page seems to render okay. That said I have not tested in Internet Explorer yet.&nbsp; I&#8217;m not sure about the links on the left hand side. The event model is not working correctly sometimes the links jut up and down. I might disable the JavaScript if it gets really annoying.</p>
<p>I have also added my latest twitter status to the page. I love twitter and use it constantly. It will be good to have my status there. At least something on this blog will get regularly updated <img src='http://rtmatheson.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . My use of twitter has increased greatly over the last few months and I have noticed a distinct lack of any decent twitter client for Windows. That&#8217;s why very shortly I will be posting my own twitter client that quite frankly leaves all of the other twitter clients I have used on Windows in its wake. It doesn&#8217;t say much about existing social applications on Windows as it only took me two or three days to write.</p>
<p>With the new theme for my blog and a completed twitter client I can now focus on my dissertation. I will not have much time to post on this blog. I hopefully however will put my dissertation online and make it available for download. As many of the details are not finalised I will not go into them yet.&nbsp; I can tell you I plan to build a web server that encapsulates an artificial intelligence algorithm to serve out artificial intelligence as a normal web server would serve documents. Hopefully that wets your appetite enough to come back to this space for updates in the future.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Frtmatheson.com%2F2010%2F06%2Fa-new-theme-a-twitter-client-and-a-hush-hush-project%2F&amp;title=A+new+theme%2C+a+twitter+client+and+a+hush-hush+project." rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Frtmatheson.com%2F2010%2F06%2Fa-new-theme-a-twitter-client-and-a-hush-hush-project%2F&amp;title=A+new+theme%2C+a+twitter+client+and+a+hush-hush+project." rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Frtmatheson.com%2F2010%2F06%2Fa-new-theme-a-twitter-client-and-a-hush-hush-project%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Frtmatheson.com%2F2010%2F06%2Fa-new-theme-a-twitter-client-and-a-hush-hush-project%2F&amp;title=A+new+theme%2C+a+twitter+client+and+a+hush-hush+project." rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Frtmatheson.com%2F2010%2F06%2Fa-new-theme-a-twitter-client-and-a-hush-hush-project%2F&amp;title=A+new+theme%2C+a+twitter+client+and+a+hush-hush+project." rel="nofollow" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Frtmatheson.com%2F2010%2F06%2Fa-new-theme-a-twitter-client-and-a-hush-hush-project%2F&amp;title=A+new+theme%2C+a+twitter+client+and+a+hush-hush+project." rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Frtmatheson.com%2F2010%2F06%2Fa-new-theme-a-twitter-client-and-a-hush-hush-project%2F&amp;t=A+new+theme%2C+a+twitter+client+and+a+hush-hush+project." rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://rtmatheson.com/2010/06/a-new-theme-a-twitter-client-and-a-hush-hush-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial: Installing Nginx, Apache and SVN</title>
		<link>http://rtmatheson.com/2010/04/installing-nginx-apache-and-svn/</link>
		<comments>http://rtmatheson.com/2010/04/installing-nginx-apache-and-svn/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 14:38:23 +0000</pubDate>
		<dc:creator>Stewart Matheson</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://rtmatheson.com/?p=153</guid>
		<description><![CDATA[In this video I install Nginx Apache and SVN. Download links are here&#8230; http://mirror.lividpenguin.com/pub/apache/httpd/httpd-2.2.15.tar.gz http://subversion.tigris.org/downloads/subversion-1.6.9.tar.gz http://nginx.org/download/nginx-0.7.65.tar.gz Here are the apache configurations I used &#60;IfModule mpm_prefork_module&#62; StartServers 1 MinSpareServers 1 MaxSpareServers 1 MaxClients 10 MaxRequestsPerChild 0 &#60;/IfModule&#62; &#160; &#60;Location /repos&#62; DAV svn SVNPath /usr/local/nginx_svn_test/testrepos SVNAutoversioning on Options Indexes FollowSymLinks Order allow,deny Allow from all &#60;/Location&#62; This [...]]]></description>
			<content:encoded><![CDATA[<p>In this video I install Nginx Apache and SVN.  Download links are here&#8230;</p>
<p><object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=10719817&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=10719817&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object></p>
<p>http://mirror.lividpenguin.com/pub/apache/httpd/httpd-2.2.15.tar.gz</p>
<p>http://subversion.tigris.org/downloads/subversion-1.6.9.tar.gz</p>
<p>http://nginx.org/download/nginx-0.7.65.tar.gz</p>
<p>Here are the apache configurations I used</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;IfModule</span> mpm_prefork_module<span style="color: #000000; font-weight: bold;">&gt;</span></span>
    StartServers          1
    MinSpareServers       1
    MaxSpareServers       1
    MaxClients           10
    MaxRequestsPerChild   0
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/IfModule<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Location</span> /repos<span style="color: #000000; font-weight: bold;">&gt;</span></span>
    DAV svn
    SVNPath /usr/local/nginx_svn_test/testrepos
    SVNAutoversioning on
    Options Indexes FollowSymLinks
    Order allow,deny
    Allow from all
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Location<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>This is the Nginx proxy pass configuration</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">location <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  proxy_pass http:<span style="color: #000000; font-weight: bold;">//</span>localhost:<span style="color: #000000;">86</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

<p>The following is the line that configures the apache compile.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--enable-dav</span> <span style="color: #660033;">--enable-dav-fs</span> <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>nginx_svn_test <span style="color: #660033;">--disable-alias</span> <span style="color: #660033;">--disable-userdir</span> <span style="color: #660033;">--disable-actions</span> <span style="color: #660033;">--disable-dir</span> <span style="color: #660033;">--disable-negotiation</span> <span style="color: #660033;">--disable-cgi</span> <span style="color: #660033;">--disable-cgid</span> <span style="color: #660033;">--disable-status</span>      <span style="color: #660033;">--disable-autoindex</span> <span style="color: #660033;">--disable-asis</span> <span style="color: #660033;">--disable-mime</span> <span style="color: #660033;">--disable-version</span> <span style="color: #660033;">--disable-setenvif</span> <span style="color: #660033;">--disable-env</span> <span style="color: #660033;">--disable-log-config</span> <span style="color: #660033;">--disable-include</span> <span style="color: #660033;">--disable-filter</span> <span style="color: #660033;">--disable-auth-basic</span> <span style="color: #660033;">--disable-authz-default</span> <span style="color: #660033;">--disable-authz-user</span> <span style="color: #660033;">--disable-authz-groupfile</span> <span style="color: #660033;">--disable-authz-host</span> <span style="color: #660033;">--disable-authn-default</span> <span style="color: #660033;">--disable-authn-file</span></pre></div></div>

<p>The following is the configure line for the SVN install.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>nginx_apache_svn_test <span style="color: #660033;">--with-apxs</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>nginx_apache_svn_test<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>apxs</pre></div></div>

<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Frtmatheson.com%2F2010%2F04%2Finstalling-nginx-apache-and-svn%2F&amp;title=Tutorial%3A+Installing+Nginx%2C+Apache+and+SVN" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Frtmatheson.com%2F2010%2F04%2Finstalling-nginx-apache-and-svn%2F&amp;title=Tutorial%3A+Installing+Nginx%2C+Apache+and+SVN" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Frtmatheson.com%2F2010%2F04%2Finstalling-nginx-apache-and-svn%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Frtmatheson.com%2F2010%2F04%2Finstalling-nginx-apache-and-svn%2F&amp;title=Tutorial%3A+Installing+Nginx%2C+Apache+and+SVN" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Frtmatheson.com%2F2010%2F04%2Finstalling-nginx-apache-and-svn%2F&amp;title=Tutorial%3A+Installing+Nginx%2C+Apache+and+SVN" rel="nofollow" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Frtmatheson.com%2F2010%2F04%2Finstalling-nginx-apache-and-svn%2F&amp;title=Tutorial%3A+Installing+Nginx%2C+Apache+and+SVN" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Frtmatheson.com%2F2010%2F04%2Finstalling-nginx-apache-and-svn%2F&amp;t=Tutorial%3A+Installing+Nginx%2C+Apache+and+SVN" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://rtmatheson.com/2010/04/installing-nginx-apache-and-svn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working on the subject observer pattern</title>
		<link>http://rtmatheson.com/2010/03/working-on-the-subject-observer-pattern/</link>
		<comments>http://rtmatheson.com/2010/03/working-on-the-subject-observer-pattern/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 13:34:28 +0000</pubDate>
		<dc:creator>Stewart Matheson</dc:creator>
				<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://rtmatheson.com/?p=135</guid>
		<description><![CDATA[Lately I have been writing a lot of game oriented C++ code. As with any form of development it&#8217;s both a rewarding and frustrating process. I am relatively new to C++ as well so I am still grappling with the ins and outs of the language. One of the things I have come to love [...]]]></description>
			<content:encoded><![CDATA[<p>Lately I have been writing a lot of game oriented C++ code. As with any form of development it&#8217;s both a rewarding and frustrating process. I am relatively new to C++ as well so I am still grappling with the ins and outs of the language.</p>
<p>One of the things I have come to love about C++ is the flexibility. You can code C++ in virtually any style you want. It supports a higher level object oriented design but you can also get down and fiddle with bits if you need to. At the moment I&#8217;m interested in the high-level features of the language, the low-level features can wait.</p>
<p>One thing I have been working a lot on is the understanding of programming patterns in relation to C++. For the kind of work I am doing at the moment understanding programming patterns is almost as important as understanding the language itself. You can code in an ad-hoc way however it&#8217;s when you start to introduce programming patterns when things start to make sense and become&#8230; dare I say fun. Just look at the impact Ruby on Rails had to the Web development world. In a sea of ad hoc development one framework comes along that implements one gigantic programming pattern and it&#8217;s hailed as the second coming of Christ.</p>
<p>One of the most important programming patterns is the subject observer pattern. This is what I am detailing in the post. Subject observer fits in with model view controller. Basically a change to the model occurs, the model notifies the views on the subject and the pattern is born. In this particular example the subject is the model and the Observer are the views. It doesn&#8217;t have to be particular to any other class and the example I give allows you to inherit from the subject observer classes and implement them in any way you want. One of the goals with this exercise was to keep the solution is generic as possible.</p>
<p>The subject observer pattern is powerful because it allows you to loosely couple your views and your models. Who doesn&#8217;t love that. In C++ terms the model contains a vector pointers to its observers. The model is dumb in this sense. It doesn&#8217;t know who its observers are and nor does it care. Observers can be added and removed from the model at any time as long as some sort of a array/vector/list of the observers is maintained. Note that this &#8220;model&#8221; solution does not include away to detach subjects from observers. It should not be too difficult to work this out but if you have problems ask me.</p>
<p>The following example has been tested with the GNU C++ compiler. In this case I am running it on a Macintosh. The code should be fairly generic and you should be run at different compilers. If you can&#8217;t let me know.</p>
<p>In the code the horn class observes the alarm class. Thus making the alarm class the subject. Note how the horn and alarm class inherit from observer and subject respectively. The alarm gets triggered by the yes you guessed it triggered method. This it is an update to the model and as a result calls the notify observer method. This method which is inherited from subject loops through a vector of observer pointers calling the notify method on each observer. The notify method is a member of observer and inherited in the Horn class. The notify method gets passed a subject. This is so the notified object can extract information from the subject. While some solutions may not require the notified object to obtain any data from the subject the solution allows the Observer complete access to the subject.</p>
<p>Note in the horn class that there is a typecast. This typecast converts the subject pointer and alarm pointer allowing methods on the alarm to be called from the Horn class. In this case the Horn class fetches the ID of the alarm but it could be any kind of data.</p>
<p>I hope this explanation of the subject observer pattern helps. If you have any questions please post a reply to this comment. I will try to answer questions to the best of my knowledge bearing in mind that I am new to C++ myself.</p>
<p>Anyway time for code.</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #339900;">#include &lt;vector&gt;</span>
<span style="color: #339900;">#include &lt;typeinfo&gt;</span>
<span style="color: #339900;">#include &lt;string&gt;</span>
&nbsp;
<span style="color: #0000ff;">class</span> Subject<span style="color: #008080;">;</span>
&nbsp;
<span style="color: #0000ff;">class</span> Observer
<span style="color: #008000;">&#123;</span>
<span style="color: #0000ff;">public</span><span style="color: #008080;">:</span>
    <span style="color: #0000ff;">virtual</span> <span style="color: #0000ff;">void</span> notify<span style="color: #008000;">&#40;</span>Subject<span style="color: #000040;">*</span> s<span style="color: #008000;">&#41;</span> <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
    <span style="color: #0000ff;">virtual</span> ~Observer<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span><span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
&nbsp;
<span style="color: #0000ff;">class</span> Subject
<span style="color: #008000;">&#123;</span>
    std<span style="color: #008080;">::</span><span style="color: #007788;">vector</span> observers<span style="color: #008080;">;</span>
<span style="color: #0000ff;">protected</span><span style="color: #008080;">:</span>
    <span style="color: #0000ff;">void</span> notify_observers<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        std<span style="color: #008080;">::</span><span style="color: #007788;">vector</span><span style="color: #008080;">::</span><span style="color: #007788;">iterator</span> iter<span style="color: #008080;">;</span>
        <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span>iter <span style="color: #000080;">=</span> observers.<span style="color: #007788;">begin</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> iter <span style="color: #000040;">!</span><span style="color: #000080;">=</span> observers.<span style="color: #007788;">end</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #000040;">++</span>iter<span style="color: #008000;">&#41;</span>
            <span style="color: #008000;">&#40;</span><span style="color: #000040;">*</span>iter<span style="color: #008000;">&#41;</span><span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>notify<span style="color: #008000;">&#40;</span><span style="color: #0000dd;">this</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #0000ff;">public</span><span style="color: #008080;">:</span>
    <span style="color: #0000ff;">virtual</span> ~Subject<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span><span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
    <span style="color: #0000ff;">void</span> register_observer<span style="color: #008000;">&#40;</span>Observer<span style="color: #000040;">*</span> o<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        observers.<span style="color: #007788;">push_back</span><span style="color: #008000;">&#40;</span>o<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
&nbsp;
<span style="color: #0000ff;">class</span> Alarm <span style="color: #008080;">:</span> <span style="color: #0000ff;">public</span> Subject
<span style="color: #008000;">&#123;</span>
<span style="color: #0000ff;">public</span><span style="color: #008080;">:</span>
    Alarm<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        std<span style="color: #008080;">::</span><span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;alarm created&quot;</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0000ff;">void</span> triggerd<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        std<span style="color: #008080;">::</span><span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;The alarm has been triggerd&quot;</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #008080;">;</span>
        notify_observers<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0000ff;">int</span> <span style="color: #0000ff;">const</span> get_alarm_id<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#123;</span> <span style="color: #0000ff;">return</span> <span style="color: #0000dd;">100</span><span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
&nbsp;
<span style="color: #0000ff;">class</span> Horn <span style="color: #008080;">:</span> <span style="color: #0000ff;">public</span> Observer
<span style="color: #008000;">&#123;</span>
<span style="color: #0000ff;">public</span><span style="color: #008080;">:</span>
    <span style="color: #0000ff;">virtual</span> <span style="color: #0000ff;">void</span> notify<span style="color: #008000;">&#40;</span>Subject<span style="color: #000040;">*</span> s<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        Alarm <span style="color: #000040;">*</span>a<span style="color: #008080;">;</span>
        a <span style="color: #000080;">=</span> <span style="color: #0000ff;">dynamic_cast</span><span style="color: #000080;">&lt;</span>Alarm<span style="color: #000040;">*</span><span style="color: #000080;">&gt;</span><span style="color: #008000;">&#40;</span>s<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
        std<span style="color: #008080;">::</span><span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> a<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>get_alarm_id<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
&nbsp;
<span style="color: #0000ff;">int</span> main <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    Alarm a <span style="color: #000080;">=</span> Alarm<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    Horn h <span style="color: #000080;">=</span> Horn<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    a.<span style="color: #007788;">register_observer</span><span style="color: #008000;">&#40;</span><span style="color: #000040;">&amp;</span>h<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    a.<span style="color: #007788;">triggerd</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    <span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Frtmatheson.com%2F2010%2F03%2Fworking-on-the-subject-observer-pattern%2F&amp;title=Working+on+the+subject+observer+pattern" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Frtmatheson.com%2F2010%2F03%2Fworking-on-the-subject-observer-pattern%2F&amp;title=Working+on+the+subject+observer+pattern" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Frtmatheson.com%2F2010%2F03%2Fworking-on-the-subject-observer-pattern%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Frtmatheson.com%2F2010%2F03%2Fworking-on-the-subject-observer-pattern%2F&amp;title=Working+on+the+subject+observer+pattern" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Frtmatheson.com%2F2010%2F03%2Fworking-on-the-subject-observer-pattern%2F&amp;title=Working+on+the+subject+observer+pattern" rel="nofollow" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Frtmatheson.com%2F2010%2F03%2Fworking-on-the-subject-observer-pattern%2F&amp;title=Working+on+the+subject+observer+pattern" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Frtmatheson.com%2F2010%2F03%2Fworking-on-the-subject-observer-pattern%2F&amp;t=Working+on+the+subject+observer+pattern" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://rtmatheson.com/2010/03/working-on-the-subject-observer-pattern/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An update and a few recommendations.</title>
		<link>http://rtmatheson.com/2010/03/an-update-and-a-few-recommendations/</link>
		<comments>http://rtmatheson.com/2010/03/an-update-and-a-few-recommendations/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 16:53:42 +0000</pubDate>
		<dc:creator>Stewart Matheson</dc:creator>
				<category><![CDATA[Rambling]]></category>

		<guid isPermaLink="false">http://rtmatheson.com/?p=131</guid>
		<description><![CDATA[Some of you may or may not know I have commenced my masters in London. I don&#8217;t have that much time for web development at the moment so posts here have been fairly sporadic. I can however update on what I have been doing for my masters. Firstly I&#8217;m doing my masters in computer game [...]]]></description>
			<content:encoded><![CDATA[<p>Some of you may or may not know I have commenced my masters in London. I don&#8217;t have that much time for web development at the moment so posts here have been fairly sporadic. I can however update on what I have been doing for my masters. Firstly I&#8217;m doing my masters in computer game technology. I&#8217;m exploring many different game technologys and I want to share a few of them with you right now.</p>
<h3>Box 2-D</h3>
<p>Box 2-D is a fantastic physics library. I&#8217;ve been programming quite a lot using box 2-D and I really enjoy it. Box 2-D supports joints, bodies and the number of various other components that can be used to model real worlds. It&#8217;s written in C++ but there is also a port available in action script. There are a number of flash games that are using this port to various levels of success. The possibilities are endless and I am sure I can find a way to incorporate this library into some Web work or to use it to animate an interface that is not necessarily game orientated. Something I would have never considered before starting this course.</p>
<h3>Simple fast multimedia library</h3>
<p>The simple fast multimedia library is a tool for producing desktop games. It supports Linux, Macintosh OS X and Windows. It can produce both 2-D and 3-D games. It produces 3-D games by providing interfaces to OpenGL classes and methods. It produces 2-D games by providing classes that handle the displaying and updating of sprites.  It&#8217;s also got classes for sound and controller imports. There&#8217;s a handy integration project for Xcode so you can develop easily on Macintosh OS X if you choose to. I&#8217;m pretty sure the same exists for visual studio on Windows but I am not 100% sure. A welcome change as there is a lot of computer game engines that specifically run on Windows. Not that I would hold a grudge against any gamer who are solely interested in Windows. Let&#8217;s be honest there&#8217;s not a whole lot going on around Macintosh in the gaming industry.</p>
<h3>Microsoft XNA</h3>
<p>XNA is a platform developed by Microsoft. It supports both Windows games and Xbox games. It installs itself as an extension to visual studio. It&#8217;s completely free and anyone can download the express edition of visual studio as well as the Microsoft XNA installer. The really cool thing is that you don&#8217;t have to pay to start developing games. You are however limited to C# Microsoft&#8217;s proprietary implementation of Java. There is quite an extensive website for an and it&#8217;s very easy to publish to the Xbox live Arcade once you have finished developing a game. As is the custom with Microsoft, XNA almost in its own world ignoring other technologies and platforms out there. It uses exclusively Microsoft directX with no support for OpenGL. Again you can&#8217;t really begrudge Microsoft for wanting to support their own platform. It is however ironic when they say that XNA supports multiple platforms. Windows and the Xbox. Ironic.</p>
<p>There are so many other game technologies are available and so many other resources at the game developers disposal you feel spoilt for choice. Much like the Web there are different tools out there that are good at different things and it&#8217;s up to the developer to choose the appropriate tool for the job. I&#8217;m surprised because I thought more of the games industry was based around building up proprietary libraries and not really sharing a whole lot of code. Whilst the big players undoubtedly do this and so they should they have the budget to do so there is room for the Indy game developer. People in my position who want to get started in the industry but don&#8217;t have a lot or even any money to spend on licensing engines and technology. Whilst it&#8217;s hard to break into the gaming industry there are certainly plenty of tools around to help you do it. Really encouraging stuff.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Frtmatheson.com%2F2010%2F03%2Fan-update-and-a-few-recommendations%2F&amp;title=An+update+and+a+few+recommendations." rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Frtmatheson.com%2F2010%2F03%2Fan-update-and-a-few-recommendations%2F&amp;title=An+update+and+a+few+recommendations." rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Frtmatheson.com%2F2010%2F03%2Fan-update-and-a-few-recommendations%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Frtmatheson.com%2F2010%2F03%2Fan-update-and-a-few-recommendations%2F&amp;title=An+update+and+a+few+recommendations." rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Frtmatheson.com%2F2010%2F03%2Fan-update-and-a-few-recommendations%2F&amp;title=An+update+and+a+few+recommendations." rel="nofollow" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Frtmatheson.com%2F2010%2F03%2Fan-update-and-a-few-recommendations%2F&amp;title=An+update+and+a+few+recommendations." rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Frtmatheson.com%2F2010%2F03%2Fan-update-and-a-few-recommendations%2F&amp;t=An+update+and+a+few+recommendations." rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://rtmatheson.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://rtmatheson.com/2010/03/an-update-and-a-few-recommendations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
