<?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"
	>

<channel>
	<title>temporalcohesion.co.uk</title>
	<atom:link href="http://temporalcohesion.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://temporalcohesion.co.uk</link>
	<description>from the mind of...</description>
	<pubDate>Fri, 12 Sep 2008 08:00:06 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<item>
		<title>Building the Project Euler framework, part 3</title>
		<link>http://temporalcohesion.co.uk/2008/09/12/building-the-project-euler-framework-part-3/</link>
		<comments>http://temporalcohesion.co.uk/2008/09/12/building-the-project-euler-framework-part-3/#comments</comments>
		<pubDate>Fri, 12 Sep 2008 08:00:06 +0000</pubDate>
		<dc:creator>stuart</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://temporalcohesion.co.uk/?p=44</guid>
		<description><![CDATA[In part 2, I showed you an improved, although still pretty basic problem runner framework for Project Euler. I did leave out some things though, and I&#8217;m going to try and explain them now.
Firstly, I haven&#8217;t really shown how I use the Problem interface. You can see it in part 1 of this series of [...]]]></description>
			<content:encoded><![CDATA[<p>In part 2, I showed you an improved, although still pretty basic problem runner framework for Project Euler. I did leave out some things though, and I&#8217;m going to try and explain them now.</p>
<p>Firstly, I haven&#8217;t really shown how I use the Problem interface. You can see it in part 1 of this series of posts. In Eclipse, you can create a new class in a package, which should bring up the &#8220;New Java Class&#8221; dialog. Give the class a name - for Project Euler problems I&#8217;ve chosen to name them &#8220;One&#8221;, &#8220;Two&#8221;, &#8220;Three&#8221; etc. You can then add an interface that the class is to implement, click &#8216;Add&#8217;, and type in Problem. You can also choose some methods to stub out, tick &#8216;public static void main(String[] args)&#8217;. Click Ok, and you should get something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="java java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">co.uk.temporalcohesion.euler.problems</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">co.uk.temporalcohesion.euler.interfaces.Problem</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> One <span style="color: #000000; font-weight: bold;">implements</span> Problem <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> answer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// TODO Auto-generated method stub</span>
		<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">null</span>;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">int</span> id<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// TODO Auto-generated method stub</span>
		<span style="color: #000000; font-weight: bold;">return</span> 0;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">double</span> time<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// TODO Auto-generated method stub</span>
		<span style="color: #000000; font-weight: bold;">return</span> 0;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * @param args
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// TODO Auto-generated method stub</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>I can hear you asking why am I including then main(String[] args) function if we already have a class that is capable of running the problems (the main Euler class)? Well, what I do to create is to create a Euler object in the problems main method, and get it to run the problem, like this:</p>

<div class="wp_syntax"><div class="code"><pre class="java java" style="font-family:monospace;">        <span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * @param args
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">new</span> Euler<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">run</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span>, <span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span>;
	<span style="color: #009900;">&#125;</span></pre></div></div>

<p>So the problem class is running itself using the Euler object, which knows how to find the problem, instantiate it and run it. I find doing things this way is easier when working on the problem, as you can simply run the problem as a java application, and it will output the result in a standard format we are expecting to to the console in Eclipse.</p>
<p>Thinking about it, you might be wondering - what&#8217;s the point of all this, it seems a little excessive for something that can be done fairly easily? Well - I&#8217;ve done it like this because the whole point of me doing the problems on Project Euler, is to practice problem solving and become more comfortable in my use of Java. So I think what I&#8217;ve done is pretty valid in that regard.</p>]]></content:encoded>
			<wfw:commentRss>http://temporalcohesion.co.uk/2008/09/12/building-the-project-euler-framework-part-3/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Building the Project Euler framework, part 2</title>
		<link>http://temporalcohesion.co.uk/2008/09/05/building-the-project-euler-framework-part-2/</link>
		<comments>http://temporalcohesion.co.uk/2008/09/05/building-the-project-euler-framework-part-2/#comments</comments>
		<pubDate>Fri, 05 Sep 2008 08:00:09 +0000</pubDate>
		<dc:creator>stuart</dc:creator>
		
		<category><![CDATA[Coding]]></category>

		<category><![CDATA[Java]]></category>

		<category><![CDATA[Project Euler]]></category>

		<guid isPermaLink="false">http://temporalcohesion.co.uk/?p=38</guid>
		<description><![CDATA[In Part 1, I showed a basic problem runner framework for Project Euler, however there are a number of ways in which we can improve it. For example:

How can we run a specific problem?
How can we hide the answer, but still run the problem?
How can we avoid manually adding problems to the List of problems?
Not [...]]]></description>
			<content:encoded><![CDATA[<p>In Part 1, I showed a basic problem runner framework for Project Euler, however there are a number of ways in which we can improve it. For example:</p>
<ul>
<li>How can we run a specific problem?</li>
<li>How can we hide the answer, but still run the problem?</li>
<li>How can we avoid manually adding problems to the List of problems?</li>
<li>Not really to do with the framework, but how can we automate building everything?</li>
</ul>
<p>I&#8217;ll demonstrate some ways that we can do all that, except for the 4th option, which is handled by Ant.</p>
<h2>Improving the framework</h2>
<p>The first thing that we can do is to add a utility function that handles showing the answers, this way we only have one place in the code that we need to update when we want to change how the answers are shown.</p>

<div class="wp_syntax"><div class="code"><pre class="java java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> showAnswers<span style="color: #009900;">&#40;</span>Problem problem<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Problem: &quot;</span> <span style="color: #339933;">+</span> problem.<span style="color: #006633;">id</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;. Answer: &quot;</span>
				<span style="color: #339933;">+</span> problem.<span style="color: #006633;">answer</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;. Time: &quot;</span> <span style="color: #339933;">+</span> problem.<span style="color: #006633;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;s&quot;</span><span style="color: #009900;">&#41;</span>;</pre></div></div>

<p>}</p>
<p>To run a specific problem, we need to overload the <em>run()</em> function to access the problem we want, and show the answer.</p>

<div class="wp_syntax"><div class="code"><pre class="java java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> run<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">try</span><span style="color: #009900;">&#123;</span>
			Problem problem <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>Problem<span style="color: #009900;">&#41;</span> problems.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span>;<span style="color: #666666; font-style: italic;">/* problem list starts at 0 */</span>
&nbsp;
			<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>problem <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				showAnswers<span style="color: #009900;">&#40;</span>problem<span style="color: #009900;">&#41;</span>;
			<span style="color: #009900;">&#125;</span>
			<span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;There doesn't appear to be an answer for problem &quot;</span> <span style="color: #339933;">+</span> i<span style="color: #009900;">&#41;</span>;
			<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">IndexOutOfBoundsException</span> e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #003399;">System</span>.<span style="color: #006633;">err</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;There doesn't appear to be an answer for problem &quot;</span> <span style="color: #339933;">+</span> i<span style="color: #009900;">&#41;</span>;
		<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span></pre></div></div>

<p>As you can see, we get the specified problem out of the list, and use our new <em>showAnswers()</em> function to display the answer.  I&#8217;ve tried to include some good error checking - we might try to get a problem that doesn&#8217;t exist.</p>
<p>In order to prevent the answer from being shown, we can add a boolean parameter to the <em>run()</em> and <em>showAnswers()</em> functions.</p>

<div class="wp_syntax"><div class="code"><pre class="java java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> showAnswers<span style="color: #009900;">&#40;</span>Problem problem, <span style="color: #000066; font-weight: bold;">boolean</span> showAnswers<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>showAnswers<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Problem: &quot;</span> <span style="color: #339933;">+</span> problem.<span style="color: #006633;">id</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;. Answer: &quot;</span>
					<span style="color: #339933;">+</span> problem.<span style="color: #006633;">answer</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;. Time: &quot;</span> <span style="color: #339933;">+</span> problem.<span style="color: #006633;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;s&quot;</span><span style="color: #009900;">&#41;</span>;
			<span style="color: #009900;">&#125;</span>
			<span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
				problem.<span style="color: #006633;">answer</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">/* we still need to work out the answer */</span>
				<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Problem: &quot;</span> <span style="color: #339933;">+</span> problem.<span style="color: #006633;">id</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;. Time: &quot;</span> <span style="color: #339933;">+</span> problem.<span style="color: #006633;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;s&quot;</span><span style="color: #009900;">&#41;</span>;
			<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> run<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">boolean</span> showAnswers<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>Problem problem <span style="color: #339933;">:</span> problems<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>problem <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				showAnswers<span style="color: #009900;">&#40;</span>problem, showAnswers<span style="color: #009900;">&#41;</span>;
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Dont&#8217;t forget to change the overloaded <em>run(int i)</em> to <em>run(int i, boolean showAnswers)</em>. This way we can control exactly  whether to show the answers when we run all the problems, or to show the answer if we run a specific problem.</p>
<p>One thing remains to do, and that is to correctly parse the command line arguments to control whether the answers are shown or not. We want to handle something like this:</p>
<p>C:\development\euler&gt;java -jar ProjectEuler.jar 42 -noanswer</p>
<p>Where 42 is problem 42, and -noanswer clearly specifies not to show the answer. We&#8217;ll also need to handle all combinations of this as well, such as:</p>
<p>C:\development\euler&gt;java -jar ProjectEuler.jar 42</p>
<p>Which should show the answer. I&#8217;m not going to show my code for parsing the command line arguements, I&#8217;ll leave that as an exercise for the reader, as I believe that it is adequately covered elsewhere on the internet, and in any number of Java books.</p>
<p>The more astute among you will notice that I&#8217;ve not mentioned how we are going to avoid manually adding problems to the List of problems. I&#8217;ll cover that next time.</p>]]></content:encoded>
			<wfw:commentRss>http://temporalcohesion.co.uk/2008/09/05/building-the-project-euler-framework-part-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Source control using Dropbox</title>
		<link>http://temporalcohesion.co.uk/2008/08/29/source-control-using-dropbox/</link>
		<comments>http://temporalcohesion.co.uk/2008/08/29/source-control-using-dropbox/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 09:00:08 +0000</pubDate>
		<dc:creator>stuart</dc:creator>
		
		<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://temporalcohesion.co.uk/?p=24</guid>
		<description><![CDATA[Everyone developer should use some form of source control. It&#8217;s like an unwritten law, if you don&#8217;t use it, then you should - as long as it isn&#8217;t sourcesafe.
A few weeks ago, I recently managed to get hold of an invite to Dropbox, which describes itself as &#8220;Secure back up, sync and sharing made easy&#8221;. [...]]]></description>
			<content:encoded><![CDATA[<p>Everyone developer should use some form of <a title="Wikipedia entry on source control" href="http://en.wikipedia.org/wiki/Source_control" target="_blank">source control</a>. It&#8217;s like an unwritten law, if you don&#8217;t use it, then you should - as long as it isn&#8217;t <a title="Jeff Atwood on why you shouldn't use sourcesafe" href="http://www.codinghorror.com/blog/archives/000660.html" target="_blank">sourcesafe</a>.</p>
<p>A few weeks ago, I recently managed to get hold of an invite to <a title="get dropbox" href="http://www.getdropbox.com/" target="_blank">Dropbox</a>, which describes itself as &#8220;Secure back up, sync and sharing made easy&#8221;. I&#8217;ve been using it both as a basic form of source control, and because I always tend to forget my usb pendrive, as a portable storage device.</p>
<p>The great thing about Dropbox is that you get 2gb of free storage. So far, I&#8217;ve sync&#8217;d a few photo&#8217;s, some word documents and pdf&#8217;s and the Java source for my Project Euler code, and according to the Dropbox client on my laptop, I&#8217;ve used 0.1% of 2gb. This is more than enough for me, and more than likely I&#8217;ll use it for some more coding projects. I&#8217;d like to see how a Visual Studio project takes to being sync&#8217;d across different computers.</p>
<p>With Dropbox, you get complete file history, so if you mistakenly remove some code that turns out to be pretty vital&#8230; you can get it back using the simple to use web interface. While you can share folders, and allow people to modify shared folders, I&#8217;m not too sure that it would work too well for collaborative software development. I think it would be far better to get a proper form of source control running on a server both parties have access to. There are plenty of proper source control providers out there with free options, and I am considering moving my code onto one of those, if I can find one that has a reasonable yearly subscription.</p>
<p>For my current requirements, it suits me just fine. I realise that Dropbox is not intended to be a source control system, however&#8230; When the client is able to sync specific folders that you tell it to, it will be perfect.</p>]]></content:encoded>
			<wfw:commentRss>http://temporalcohesion.co.uk/2008/08/29/source-control-using-dropbox/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Building the Project Euler framework, part 1</title>
		<link>http://temporalcohesion.co.uk/2008/08/22/building-the-project-euler-framework-part-1/</link>
		<comments>http://temporalcohesion.co.uk/2008/08/22/building-the-project-euler-framework-part-1/#comments</comments>
		<pubDate>Fri, 22 Aug 2008 09:00:30 +0000</pubDate>
		<dc:creator>stuart</dc:creator>
		
		<category><![CDATA[Coding]]></category>

		<category><![CDATA[Java]]></category>

		<category><![CDATA[Project Euler]]></category>

		<guid isPermaLink="false">http://temporalcohesion.co.uk/?p=17</guid>
		<description><![CDATA[As promised, here is the first part of the series of posts I hope to write demonstrating how I wrote my problem runner framework for Project Euler.
Firstly, before you continue reading, I suggest that you research the Command pattern, Google will also provide you with some good sources in your research.
Done? Ok then. It shouldn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>As promised, here is the first part of the series of posts I hope to write demonstrating how I wrote my problem runner framework for <a title="Project Euler!" href="http://projecteuler.net/" target="_blank">Project Euler</a>.</p>
<p>Firstly, before you continue reading, I suggest that you research the <a title="The Command pattern on Wikipedia" href="http://en.wikipedia.org/wiki/Command_pattern" target="_blank">Command</a> pattern, Google will also provide you with some good sources in your research.</p>
<p>Done? Ok then. It shouldn&#8217;t matter what <span class="ubernym uttAbbreviation" onmouseover="domTT_activate(this, event, 'content', 'Integrated Development Environment' );"><abbr class="uttAbbreviation" title="Integrated Development Environment">IDE</abbr></span> you use, I am using Eclipse (ganymede), any <span class="ubernym uttAbbreviation" onmouseover="domTT_activate(this, event, 'content', 'Integrated Development Environment' );"><abbr class="uttAbbreviation" title="Integrated Development Environment">IDE</abbr></span> should do. If you don&#8217;t know what an <span class="ubernym uttAbbreviation" onmouseover="domTT_activate(this, event, 'content', 'Integrated Development Environment' );"><abbr class="uttAbbreviation" title="Integrated Development Environment">IDE</abbr></span> is, then go and find out, and then come back.</p>
<h2>Start Coding</h2>
<p>In your <span class="ubernym uttAbbreviation" onmouseover="domTT_activate(this, event, 'content', 'Integrated Development Environment' );"><abbr class="uttAbbreviation" title="Integrated Development Environment">IDE</abbr></span>, and following the <a title="Java package naming conventions" href="http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html" target="_blank">Java package naming conventions</a>, create a package to hold the Project Euler code, for example: co.uk.temporalcohesion.euler.problems. Because we are going to need an interface, also create a package to hold those, as this can help keep things more organised, for example: co.uk.temporalcohesion.euler.interfaces</p>
<p>Let&#8217;s define that interface</p>

<div class="wp_syntax"><div class="code"><pre class="java java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">interface</span> Problem <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Answer method. Returns the answer for the problem
	 * @return - the integer answer to the problem
	 */</span>
	<span style="color: #003399;">String</span> answer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * The problem number.
	 * @return - The number of the problem
	 */</span>
	<span style="color: #000066; font-weight: bold;">int</span> id<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * How long does it take to work out the answer?
	 * @return - The time in seconds it takes to work out the answer to the problem
	 */</span>
	<span style="color: #000066; font-weight: bold;">double</span> time<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Before we move on an implement that interface in a problem, let&#8217;s write the basic problem runner itself. We&#8217;ll need a way to register an instance of a problem, and a way to run the problem and get the answer.</p>

<div class="wp_syntax"><div class="code"><pre class="java java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Euler <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">private</span> List<span style="color: #339933;">&amp;</span>lt;Problem<span style="color: #339933;">&amp;</span>gt; problems <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">ArrayList</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> Euler<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		problems.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> One<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> run<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>Problem prob <span style="color: #339933;">:</span> problems<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Problem &quot;</span> <span style="color: #339933;">+</span> prob.<span style="color: #006633;">id</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;: &quot;</span> <span style="color: #339933;">+</span> prob.<span style="color: #006633;">answer</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>;
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">new</span> Euler<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">run</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>That&#8217;s pretty much all you need for a basic problem runner. You just register an instance of each problem you write into the problems List object in the constructor, and run the program, and it iterates through each Problem in the List, and outputs the answer.</p>
<p>I&#8217;m not going to give you the code to problem one, however it is pretty trivial if you know what the modulus operator is used for&#8230;</p>
<p>As you can see, the problem runner itself is fairly basic, and does present some immediate areas of improvement, such as running a specific problem.</p>
<p>I&#8217;ll cover that next time.</p>]]></content:encoded>
			<wfw:commentRss>http://temporalcohesion.co.uk/2008/08/22/building-the-project-euler-framework-part-1/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Project Euler problem runner framework in Java</title>
		<link>http://temporalcohesion.co.uk/2008/08/15/project-euler-problem-runner-framework-in-java/</link>
		<comments>http://temporalcohesion.co.uk/2008/08/15/project-euler-problem-runner-framework-in-java/#comments</comments>
		<pubDate>Fri, 15 Aug 2008 08:30:03 +0000</pubDate>
		<dc:creator>stuart</dc:creator>
		
		<category><![CDATA[Coding]]></category>

		<category><![CDATA[Java]]></category>

		<category><![CDATA[Project Euler]]></category>

		<guid isPermaLink="false">http://temporalcohesion.co.uk/?p=13</guid>
		<description><![CDATA[Recently, I&#8217;ve been working on the problems on Project Euler, and I&#8217;ve done the first 16 problems (in Java), although I will freely admit that I had help on two of the most difficult ones. I do intend on continuing to do the problems, and I am currently working on problem 17, however I paused [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I&#8217;ve been working on the problems on <a title="Projec Euler!" href="http://projecteuler.net/" target="_blank">Project Euler</a>, and I&#8217;ve done the first 16 problems (in Java), although I will freely admit that I had help on two of the most difficult ones. I do intend on continuing to do the problems, and I am currently working on problem 17, however I paused to write the problem runner framework I&#8217;m going to talk about in this post.</p>
<p>What I had started to do, was to write each solution in it&#8217;s own Class, and have the main(String[] args) method output the answer. This was fine for the first few problems, and I could have continued to do it like that for all of the problems - however I wanted to be able to run all the problems at once, or a specific problem, and get the answer(s), or not show the answers but still get the timings.</p>
<p>After chatting with one of the Senior Dev&#8217;s at my job, he pointed out that what I wanted to do was basically the <a title="Command Pattern on Wikipedia" href="http://en.wikipedia.org/wiki/Command_pattern" target="_blank">Command</a> pattern. He sent me some example code, although once he&#8217;d said &#8220;Command pattern&#8221; I knew exactly what it was that I needed to do.</p>
<p>Thus, my problem runner framework was born, and whilst fairly simple, it does employ some techniques that the beginning Java developer might not be aware of. So, what I am going to (try) to do over the next few weeks is write a series of posts that show how I wrote it, partly just to have some content on my blog (which I am really, really lazy at updating), secondly to see how good I am at explaining something like this, and thirdly - it might actually be useful to someone.</p>
<p>The output of the problem runner framework looks like this:</p>
<p>C:\development&gt;java -jar euler.jar -noanswers<br />
Project Euler : Problem Runner - http://projecteuler.net/</p>
<p>Problem: 1. Time: 0.0s<br />
Problem: 2. Time: 0.0s<br />
Problem: 3. Time: 0.347s<br />
Problem: 4. Time: 0.307s<br />
Problem: 5. Time: 63.803s<br />
Problem: 6. Time: 0.0s<br />
Problem: 7. Time: 0.335s<br />
Problem: 8. Time: 0.0020s<br />
Problem: 9. Time: 34.178s<br />
Problem: 10. Time: 0.369s<br />
Problem: 11. Time: 1.218275999017E9s<br />
Problem: 12. Time: 0.021s<br />
Problem: 13. Time: 0.0s<br />
Problem: 14. Time: 21.717s<br />
Problem: 15. Time: 0.0s<br />
Problem: 16. Time: 0.0010s</p>
<p>As you can see, I have output a list of the problems, and the time taken to solve the problem, but I haven&#8217;t shown the answer.</p>
<p>Well, you didn&#8217;t think I was going to tell you the answers&#8230; Did you?</p>
<p>This also shows that I need to work on problem 5, 9 and 14 to try and optimise the solution to speed up performance, Project Euler says that problems &#8220;should&#8221; take under a minute to solve, however I&#8217;d still like to improve the code.</p>]]></content:encoded>
			<wfw:commentRss>http://temporalcohesion.co.uk/2008/08/15/project-euler-problem-runner-framework-in-java/feed/</wfw:commentRss>
		</item>
		<item>
		<title>New Year&#8217;s Resolutions are so passé</title>
		<link>http://temporalcohesion.co.uk/2008/01/07/new-years-resolutions-are-so-passe/</link>
		<comments>http://temporalcohesion.co.uk/2008/01/07/new-years-resolutions-are-so-passe/#comments</comments>
		<pubDate>Mon, 07 Jan 2008 00:18:13 +0000</pubDate>
		<dc:creator>stuart</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://temporalcohesion.co.uk/2008/01/07/new-years-resolutions-are-so-passe/</guid>
		<description><![CDATA[It&#8217;s true, New Years resolutions are passé. Every year, you look at what is wrong in your life and triumphantly decide that you are going to resolve these problems by issuing a bold and sweeping set of statements, or edicts.

Lose weight
Stop smoking
Get fit

These are what you want to achieve, chasing that ever elusive dream of [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s true, New Years resolutions are passé. Every year, you look at what is wrong in your life and triumphantly decide that you are going to resolve these problems by issuing a bold and sweeping set of statements, or edicts.</p>
<ul>
<li>Lose weight</li>
<li>Stop smoking</li>
<li>Get fit</li>
</ul>
<p>These are what you want to achieve, chasing that ever elusive dream of making your life better. Can you? Can a simple list of statements help you achieve these goals? I&#8217;m not so sure. For some people I&#8217;m sure that they don&#8217;t even have to write them down, those super motivated people who seem to exude success.</p>
<p>I used to do this, on scraps of easily lost paper, &#8220;Stuart&#8217;s New Year&#8217;s Resolutions!&#8221; it would say, with a list of two or three word ambition&#8217;s for the year. Lost by February. For the last few years I haven&#8217;t even bothered with writing them down, I&#8217;d just mouth off to anyone who would listen, &#8220;I&#8217;m gonna do this, and that, this year, you wait and see&#8221;.</p>
<p>Which funnily enough, didn&#8217;t get me very far with achieving very much. That said, 2007 was a year I&#8217;ll never forget, for a number of reasons (not all of which I want to go into here), and it has led me to believe even more than I did, that it is all well and good to strole through life without a care, thinking everything is fine and dandy. Because it is not. Doing that will get you stuck, trapped in a rut that you can&#8217;t get out of, never having made anything of your life.</p>
<p>Thankfully, I&#8217;m pretty certain that I&#8217;m not in a rut. Trust me, I&#8217;ve been there and I know what it is like.</p>
<p>So what to do instead of making &#8216;New Year&#8217;s Resolutions&#8217;? It&#8217;s simple: Set goals. &#8220;But&#8221;, I hear you cry, &#8220;a goal IS a resolution?!&#8221; Which in this sense I suppose they are, however there is a crucial difference. A goal set&#8217;s out what you want to do and how you are going to achieve it.</p>
<p>The above list could be re-written like so:</p>
<ul>
<li>Lose weight by eating healthily and exercising more to get fit.</li>
<li>Stop smoking by using patches and will power, giving up completely by Easter.</li>
<li>Get fit, by joining a gym, running and cycling and lose 2 stone by Easter</li>
</ul>
<p>These aren&#8217;t my goals for this year&#8230; Ok, I don&#8217;t smoke, but the other two count. I&#8217;m not revealing my other goals&#8230; yet. I have several though, and I intend to get stuck in and achieve them.</p>]]></content:encoded>
			<wfw:commentRss>http://temporalcohesion.co.uk/2008/01/07/new-years-resolutions-are-so-passe/feed/</wfw:commentRss>
		</item>
		<item>
		<title>more cake</title>
		<link>http://temporalcohesion.co.uk/2007/10/10/more-cake/</link>
		<comments>http://temporalcohesion.co.uk/2007/10/10/more-cake/#comments</comments>
		<pubDate>Wed, 10 Oct 2007 20:04:10 +0000</pubDate>
		<dc:creator>stuart</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://temporalcohesion.co.uk/2007/10/10/more-cake/</guid>
		<description><![CDATA[Something I discovered fairly quickly when coding (cake)PHP in eclipse, is that, like code completion in Models, unless you do a little extra configuration, code completion in Views won&#8217;t work.
If however, you make a slight modification to the Views index.ctp, and create a HtmlHelper() yourself, then you get code completion on $html-&#62;, and access to [...]]]></description>
			<content:encoded><![CDATA[<p>Something I discovered fairly quickly when coding (cake)<a href="http://www.php.net" class="ubernym uttInitialism" onmouseover="domTT_activate(this, event, 'content', 'PHP: Hypertext Preprocessor' );"><abbr class="uttInitialism" title="PHP: Hypertext Preprocessor">PHP</abbr></a> in eclipse, is that, like code completion in Models, unless you do a little extra configuration, code completion in Views won&#8217;t work.</p>
<p>If however, you make a slight modification to the Views index.ctp, and create a HtmlHelper() yourself, then you get code completion on $html-&gt;, and access to all the methods, and the rendered view isn&#8217;t affected at all.</p>
<p>For example:</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000088;">$html</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HtmlHelper<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>I found the answer to this after posting on the <a href="http://groups.google.com/group/cake-php/browse_thread/thread/04b94b593714b394/9c71e02157bcaacd#9c71e02157bcaacd" target="_blank">CakePHP google group</a>, and getting a good answer from a user. Top Stuff</p>]]></content:encoded>
			<wfw:commentRss>http://temporalcohesion.co.uk/2007/10/10/more-cake/feed/</wfw:commentRss>
		</item>
		<item>
		<title>cakePHP with Eclipse</title>
		<link>http://temporalcohesion.co.uk/2007/10/07/cakephp-with-eclipse/</link>
		<comments>http://temporalcohesion.co.uk/2007/10/07/cakephp-with-eclipse/#comments</comments>
		<pubDate>Sun, 07 Oct 2007 13:17:11 +0000</pubDate>
		<dc:creator>stuart</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://temporalcohesion.co.uk/2007/10/07/cakephp-with-eclipse/</guid>
		<description><![CDATA[
After chatting with one of my friends who is earning loads of cash doing php web development, I&#8217;ve decided that I&#8217;m going  relearn PHP, not because I want a change of career, I&#8217;m happy where I am, but because&#8230; I just want to.
Because I&#8217;ve become a bit of a snob, used to having intellisense [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://temporalcohesion.co.uk/wp-content/uploads/2007/10/php_dev_in_eclipse.png" title="cakePHP development in Eclipse"><img src="http://temporalcohesion.co.uk/wp-content/uploads/2007/10/php_dev_in_eclipse.thumbnail.png" title="cakePHP development in Eclipse" alt="cakePHP development in Eclipse" align="left" height="223" hspace="20" width="295" /></a></p>
<p>After chatting with one of my friends who is earning loads of cash doing php web development, I&#8217;ve decided that I&#8217;m going  relearn <a href="http://www.php.net" class="ubernym uttInitialism" onmouseover="domTT_activate(this, event, 'content', 'PHP: Hypertext Preprocessor' );"><abbr class="uttInitialism" title="PHP: Hypertext Preprocessor">PHP</abbr></a>, not because I want a change of career, I&#8217;m happy where I am, but because&#8230; I just want to.</p>
<p>Because I&#8217;ve become a bit of a snob, used to having intellisense and and all the wonders that <span class="ubernym uttAbbreviation" onmouseover="domTT_activate(this, event, 'content', 'Integrated Development Environment' );"><abbr class="uttAbbreviation" title="Integrated Development Environment">IDE</abbr></span>&#8217;s such as Visual Studio and Borland Delphi provide, I wanted to do my <a href="http://www.php.net" class="ubernym uttInitialism" onmouseover="domTT_activate(this, event, 'content', 'PHP: Hypertext Preprocessor' );"><abbr class="uttInitialism" title="PHP: Hypertext Preprocessor">PHP</abbr></a> development in a proper <span class="ubernym uttAbbreviation" onmouseover="domTT_activate(this, event, 'content', 'Integrated Development Environment' );"><abbr class="uttAbbreviation" title="Integrated Development Environment">IDE</abbr></span>. Since I&#8217;ve been doing a lot of Java at work - enter <a href="http://www.eclipse.org" title="The Eclipse IDE" target="_blank">Eclipse</a>, and the <a href="http://www.eclipse.org/pdt/" title="Eclipse PDT plugins" target="_blank">Eclipse <a href="http://www.php.net" class="ubernym uttInitialism" onmouseover="domTT_activate(this, event, 'content', 'PHP: Hypertext Preprocessor' );"><abbr class="uttInitialism" title="PHP: Hypertext Preprocessor">PHP</abbr></a></a> plugins.</p>
<p>As you can see in the screenshot above (which shows some code from the <a href="http://www.cakephp.org" title="A Nice Piece of Cake!">cakePHP</a> 15 minute blog tutorial), the plugins provide an awesome amount of functionality, such as:</p>
<ul>
<li>Code folding</li>
<li>Intellisense/code completion</li>
<li>Syntax highlighting/colouring</li>
<li>API Documentation tool-tips</li>
</ul>
<p>All this functionality is pretty easy to set up, and there is a pretty good guide available in <a href="http://bakery.cakephp.org/articles/view/setting-up-eclipse-to-work-with-cake" target="_blank">The Bakery</a> that covers just about everything you need to know to get going. There was a little bit of configuration that I did that was slightly different to that guide:</p>
<p>Firstly, I don&#8217;t believe that you need to set up cakePHP as a project in order to get the code completion to work. If you expand your project, and right click on your project include paths, you should be on the <a href="http://www.php.net" class="ubernym uttInitialism" onmouseover="domTT_activate(this, event, 'content', 'PHP: Hypertext Preprocessor' );"><abbr class="uttInitialism" title="PHP: Hypertext Preprocessor">PHP</abbr></a> Include path dialog, in the projects properties. If you add an external folder, and browse to the cake core directory (for me: C:\xampp\htdocs\cake), and click ok, you should now have code completion and all the associated awesomeness in your project, with the added benefit that for any different projects in your workspace, you can set up different versions of cakePHP or (I haven&#8217;t tried this though) a different framework such as <a href="http://www.symfony-project.com">Symfony</a>.</p>
<p>Secondly, for code completion in Models, you just have to do something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> PostsController <span style="color: #000000; font-weight: bold;">extends</span> AppController<span style="color: #009900;">&#123;</span><span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$name</span> <span style="color: #339933;">=</span> <span style="">'Posts'</span>;
&nbsp;
<span style="color: #0000ff; font-style: italic;">/**
&nbsp;
* @var Post
&nbsp;
*/</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$Post</span>;
&nbsp;
<span style="color: #339933;">...</span>code
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Hope this is of use to somebody <img src='http://temporalcohesion.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>]]></content:encoded>
			<wfw:commentRss>http://temporalcohesion.co.uk/2007/10/07/cakephp-with-eclipse/feed/</wfw:commentRss>
		</item>
		<item>
		<title>source control systems</title>
		<link>http://temporalcohesion.co.uk/2007/08/20/source-control-systems/</link>
		<comments>http://temporalcohesion.co.uk/2007/08/20/source-control-systems/#comments</comments>
		<pubDate>Mon, 20 Aug 2007 22:39:35 +0000</pubDate>
		<dc:creator>stuart</dc:creator>
		
		<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://temporalcohesion.co.uk/2007/08/20/source-control-systems/</guid>
		<description><![CDATA[The other day, I watched the Linus Torvalds tech talk at google, which he gave on source control systems. It was mostly (biased) about how great git is, and how other source control systems, with a few exceptions, have mostly got it wrong. This all got me thinking about source control systems I have used.
Now, [...]]]></description>
			<content:encoded><![CDATA[<p>The other day, I watched the Linus Torvalds <a href="http://www.youtube.com/watch?v=4XpnKHJAok8" title="Linus Torvald's tech talk on git" target="_blank">tech talk</a> at google, which he gave on source control systems. It was mostly (biased) about how great <a href="http://git.or.cz/" target="_blank">git</a> is, and how other source control systems, with a few exceptions, have mostly got it wrong. This all got me thinking about source control systems I have used.</p>
<p>Now, I use Microsoft&#8217;s <a href="http://msdn2.microsoft.com/en-us/vstudio/aa718670.aspx" target="_blank">Visual Sourcesafe</a> every day at work, and let me tell you: it&#8217;s shit. The only (slightly) good thing about it, is the integration with VS.Net 2005, which is unsurprisingly very good. I know that I&#8217;m not really offering much of an argument as to exactly why VSS is a horrible pile of dog turd, but anyone whose ever used will understand.</p>
<p>Anyway. I digress.</p>
<p>I never really thought that the creator of Linux would be such an engaging and humorous speaker - aren&#8217;t stereotypes fun - but he was. It kind of got me thinking about source control. I&#8217;ve used CVS and SVN before on a few open source projects I&#8217;ve contributed to, or just wanted to get the latest source for.</p>
<p>I&#8217;ve mostly only ever used CVS or SVN, arguably the two most popular version control systems currently in use today. Better than VSS in every way, but still lacking quite a lot. For instance it&#8217;s a well known fact that merges in CVS are a horrible nightmare, and that merges in SVN aren&#8217;t much better. Thankfully I&#8217;ve never had to do them. And I know enough about VSS to know that merges are just generally avoided. Like you&#8217;d try to avoid an STI.</p>
<p>So, over the weekend (you&#8217;ll notice how much of my free time is &#8220;over the weekend&#8221;) I decided to have a little play with with some distributed version control systems. Now, I&#8217;m not going to go on about what one of those is, nor how great they are, as you can use google for that. But suffice to say that they are fucking ace.</p>
<p>I had to discount Git pretty much straight away - for various reasons (development being primary) I&#8217;ve installed Winxp back onto my laptop, and I&#8217;m playing with Windows Server 2003 R2 on my dev server, so I road tested Mercurial and Bazaar-ng. I spent a great deal of time researching the two systems, and ultimately decided to go with bazaar.  I&#8217;ve not really got down to much development with bazaar yet, but early results look promising.</p>
<p>After about 10 minutes fannying around, I had Bazaar installed, and a shared repository set-up on my dev server, which I checked out and branched a few times on my laptop (3 branches: dev, testing and stable). With bazaar I can make as many dev branches as I like, for each crazy idea I have, and easily merge them upstream as they become awesomely realised ideas, or deleted and forgotten about like a red-headed step-child.</p>
<p>This is all on my laptop, and I can easily push my working code onto my desktop if I want to code on there, or back onto my server for safe keeping, or publish it on a website. Or any combination of those. I&#8217;ll post some more about Bazaar after I&#8217;ve been using it for a while.</p>]]></content:encoded>
			<wfw:commentRss>http://temporalcohesion.co.uk/2007/08/20/source-control-systems/feed/</wfw:commentRss>
		</item>
		<item>
		<title>linux adventures</title>
		<link>http://temporalcohesion.co.uk/2007/08/05/linux-adventures/</link>
		<comments>http://temporalcohesion.co.uk/2007/08/05/linux-adventures/#comments</comments>
		<pubDate>Sun, 05 Aug 2007 19:38:38 +0000</pubDate>
		<dc:creator>stuart</dc:creator>
		
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://temporalcohesion.co.uk/2007/08/05/linux-adventures/</guid>
		<description><![CDATA[I spent much of the weekend fucking around installing linux on my laptop. I like linux, it&#8217;s free, and there&#8217;s loads of cool software available. I tried:

Ubuntu 7.04
Fedora 7
opensuse 10.2

The actual installations themselves went pretty painlessly, just pop the disk in, and boot from it, and click install. These modern installations are pretty cool, not [...]]]></description>
			<content:encoded><![CDATA[<p>I spent much of the weekend fucking around installing linux on my laptop. I like linux, it&#8217;s free, and there&#8217;s loads of cool software available. I tried:</p>
<ul>
<li>Ubuntu 7.04</li>
<li>Fedora 7</li>
<li>opensuse 10.2</li>
</ul>
<p>The actual installations themselves went pretty painlessly, just pop the disk in, and boot from it, and click install. These modern installations are pretty cool, not like the good old days of installing redhat/slackware/debian from multiple floppy discs.</p>
<p>The only problem I had was getting my 3Com 3crwe62092b wireless lan pcmcia card to work. What a pain in the fucking arse that was. Ubuntu Feistey Fawn 7.04 wouldn&#8217;t even detect it, and Fedora 7 detected it, but it wouldn&#8217;t work.</p>
<p>Needless to say, I was getting frustrated at this point, and I downloaded opensuse 10.2, specifically a 44mb network install disk. And fuck me, it asked me for wlan details, and connected to my wireless network first time. Ace.</p>
<p>But - and theres always a but - when it rebooted there was a problem. The wireless stopped working. I managed to get the rest of the installation completed using a wired connection. After some further googling, it turns out that the solution to my problem was to download the atmel-firmware, and copy the *.bin&#8217;s to /lib/firmware. Rebooted and the wireless came up straightway. Hurrah!</p>
<p>I suspect that armed with this new knowledge I should be able to install Ubuntu/Fedora and get the card to work on them, but I&#8217;m liking opensuse enough that I&#8217;m not sure I can be bothered to reinstall a different distribution again.</p>
<p>This is also the reason that linux isn&#8217;t ready for the desktop yet - the average person wouldn&#8217;t spend time googling and recompiling kernels and installing different distributions just to get wireless working on their laptop. It should just work, with no effort. This is the advantage that windows has over linux, the driver support is significantly better.</p>
<p>But it works for me, so fuck em.</p>]]></content:encoded>
			<wfw:commentRss>http://temporalcohesion.co.uk/2007/08/05/linux-adventures/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
