<?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>The Tomes Of Experience</title>
	<atom:link href="http://www.xerxesb.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xerxesb.com</link>
	<description>&#039;Cause there are some things you just *can&#039;t* get from a book...</description>
	<lastBuildDate>Sun, 02 Jun 2013 11:41:58 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.0</generator>
	<item>
		<title>Resizing Raspbian image for QEmu</title>
		<link>http://www.xerxesb.com/2013/resizing-raspbian-image-for-qemu/</link>
		<comments>http://www.xerxesb.com/2013/resizing-raspbian-image-for-qemu/#comments</comments>
		<pubDate>Sun, 02 Jun 2013 11:41:58 +0000</pubDate>
		<dc:creator><![CDATA[Xerxes]]></dc:creator>
				<category><![CDATA[IT & Software]]></category>

		<guid isPermaLink="false">http://www.xerxesb.com/?p=946</guid>
		<description><![CDATA[I&#8217;m running Raspbian (Wheesy 2013-05-29) under QEmu just to make dev a bit quicker. The problem goes that the Raspbian image is 2GB which leaves only 200Mb free for apps/data. To resize the image, start by resizing the image and giving it an extra 2GB (this is run on the host): &#62; qemu-img resize 2013-05-29-wheezy-armel.img [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m running Raspbian (Wheesy 2013-05-29) under QEmu just to make dev a bit quicker. The problem goes that the Raspbian image is 2GB which leaves only 200Mb free for apps/data.</p>
<p>To resize the image, start by resizing the image and giving it an extra 2GB (this is run on the host):</p>
<pre style="padding-left: 30px;">&gt; qemu-img resize 2013-05-29-wheezy-armel.img +2G</pre>
<pre style="padding-left: 30px;"></pre>
<p>Now boot into Raspbian and issue the following to resize the partition (from within linux):</p>
<pre style="padding-left: 30px;">1. &gt; sudo fdisk /dev/sda
2. Print the partition table ("p"). Take note of the starting block of the main partition
3. Delete the main partition ("d"). Should be partition 2.
4. Create (n)ew partition. (P)rimary. Position (2)
5. Start block should be the same as start block from the original partition
6. Size should be the full size of the image file (just press "enter")
7. Now write the partition table (w)
8. Reboot (shutdown -r now). After reboot,
9. &gt; sudo resize2fs /dev/sda2</pre>
<p>&nbsp;</p>
<p>When that&#8217;s all done, run &#8220;df -h&#8221; and you should have plenty of space.</p>
<pre></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.xerxesb.com/2013/resizing-raspbian-image-for-qemu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>git-describe and the tale of the wrong commits</title>
		<link>http://www.xerxesb.com/2010/git-describe-and-the-tale-of-the-wrong-commits/</link>
		<comments>http://www.xerxesb.com/2010/git-describe-and-the-tale-of-the-wrong-commits/#comments</comments>
		<pubDate>Mon, 20 Dec 2010 07:17:04 +0000</pubDate>
		<dc:creator><![CDATA[Xerxes]]></dc:creator>
				<category><![CDATA[IT & Software]]></category>

		<guid isPermaLink="false">http://www.xerxesb.com/?p=924</guid>
		<description><![CDATA[Like most things in life, our current software project is powered by Git, and historically we&#8217;ve been using git to generate the version numbers for our builds by sucking it out from the tags in our repository via git-describe. $ git describe --tags --long --match v* v0.3.0-0-g865eb5f This works wonderfully well when you have a [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Like most things in life, our current software project is powered by <a class="zem_slink freebase/en/git" title="Git (software)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Git_%28software%29">Git</a>, and historically we&#8217;ve been using git to generate the version numbers for our builds by sucking it out from the tags in our repository via <em>git-describe</em>.</p>
<p><code>$ git describe --tags --long --match v*<br />
v0.3.0-0-g865eb5f</code></p>
<p>This works wonderfully well when you have a single-line commit history, as the tag for versioning is the most recent tag.</p>
<p>Recently, however, we switched to using Vincent Driessen&#8217;s <a href="http://nvie.com/posts/a-successful-git-branching-model/">Git branching model</a>, which opens up a serious hole in the simple versioning system. When you prepare a hotfix release for master, you tag the hotfix branch at the point the hotfix is being applied. This has the unfortunate side-effect of screwing up the way <em>git describe</em> determines the &#8220;nearest&#8221; tag.</p>
<p>I&#8217;ve created a <a href="https://github.com/xerxesb/gitdemo">sample repo demonstrating this problem</a>. If you&#8217;re not keen on grabbing the repo, follow along with the screenshot below.</p>
<p><img class="aligncenter size-full wp-image-931" title="git tag versioning" src="http://www.xerxesb.com/wp-content/uploads/2010/12/git-tag-versioning1.png" alt="" width="458" height="135" /></p>
<p>Basically what we see here is a hotfix being applied for release v0.1.0 while development continues on v0.2.0. The hotfix is merged back into develop (but decided not to be merged into master as the hotfix could wait until the next release).</p>
<p>Running the git-describe command above *SHOULD* yield v0.2.0-4-gba68c2f as the tag for develop in order to be true, however it comes back as v0.1.1-4-gba68c2f, which leads to our builds being completely mis-versioned. (We just versioned 0.2.0 code as 0.1.1 &#8211; how shit are we?)</p>
<p>Okay, so why is git picking up my v0.1.1 tag instead of the v0.2.0 tag? Turns out it has a lot to do with the explanation of how git-describe works:</p>
<blockquote><p>If multiple tags were found during the walk then the tag which has the fewest commits different from the input committish will be selected and output. Here fewest commits different is defined as the number of commits which would be shown by <em>git log tag..input</em> will be the smallest number of commits possible.</p></blockquote>
<p>Which is all well and good, however the <em>describe</em> algorithm ended up traversing a merge-branch down from develop and erroneously (for our purposes) finding v0.1.1 because it was closer to HEAD than v0.2.0 (well specifically in this example case they have the same number of commits, but the <em>depth</em> of the merged branch seems to be more appealing to git)</p>
<p>Digging around a bit more, I found that the <em>git log</em> command actually has an argument to have git-log search only the first (oldest) of multiple parent commits (ie: merges). enter <em>&#8211;first-parent</em></p>
<blockquote><p>Follow only the first parent commit upon seeing a merge commit. This option can give a better overview when viewing the evolution of a particular topic branch, because merges into a topic branch tend to be only about adjusting to updated upstream from time to time, and this option allows you to ignore the individual commits brought in to your history by such a merge.</p></blockquote>
<p>&#8230;and when you use that to find the appropriate tag, it does!<br />
<code>$ git log --oneline --decorate=short --first-parent | grep '(tag:' | head -n1<br />
b4aa13c (tag: v0.2.0) continued work on develop</code></p>
<p>So first-parent history search behaviour is what I want, but it&#8217;s not available on git-describe. Turns out, i&#8217;m not the only one who&#8217;s <a href="http://kerneltrap.org/mailarchive/git/2010/9/21/40071/thread">come across this</a>&#8230;It&#8217;s a shame, really because <em>describe</em> does everything else perfectly, except for the algorithm to find the closest tag.</p>
<p>Unfortunately there&#8217;s no clear work-around or even a solution as to when a <em>&#8211;first-parent</em> argument will be made available for <em>git-describe</em>, which meant I had to come up with this monstrous flake of rake script to get the build version identifier (formatting doesn&#8217;t do it justice):</p>
<pre name="code" class="ruby">def git_version_identifier
  tag_number = `git log --oneline --decorate=short --first-parent | grep '(tag:' | head -n1`

  version_number = /v(\d+)\.(\d+)\.(\d+)/.match(tag_number)

  `git describe --tags --long --match #{version_number}`.chomp
end</pre>
<p>which (in a nutshell):</p>
<ol>
<li>Finds the appropriate tag number for the current branch as per the bash-fu you saw earlier</li>
<li>Parses the previous output for the tag identifier (vx.x.x as per our convention)</li>
<li>Fires THAT tag id into <em>git describe</em> to get it to generate the identifier properly, bypassing its search mechanism</li>
</ol>
<p>Seems convoluted and i&#8217;m not really happy with the result. Hoping that someone out there knows something I dont.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xerxesb.com/2010/git-describe-and-the-tale-of-the-wrong-commits/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scripting Google Chrome for OSX using AppleScript</title>
		<link>http://www.xerxesb.com/2010/scripting-google-chrome-for-osx-using-applescript/</link>
		<comments>http://www.xerxesb.com/2010/scripting-google-chrome-for-osx-using-applescript/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 12:28:21 +0000</pubDate>
		<dc:creator><![CDATA[Xerxes]]></dc:creator>
				<category><![CDATA[IT & Software]]></category>

		<guid isPermaLink="false">http://www.xerxesb.com/?p=916</guid>
		<description><![CDATA[When it comes to software tools, i like to spend my time bleeding on the edge, where possible. One of the downsides to this, however is when you hit the carotid artery and bleed your tech heart all over the place. Having recently experienced this problem while using the dev channel build of Chrome, i&#8217;m [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>When it comes to software tools, i like to spend my time bleeding on the edge, where possible. One of the downsides to this, however is when you hit the carotid artery and bleed your tech heart all over the place. Having recently experienced this problem while using the dev channel build of Chrome, i&#8217;m fairly cautious of all the tabs I have open and losing them was a (queue Elton John&#8230;) sad sad situation, to say the least.</p>
<p>More recently I became the custodian of an older generation MacBook Pro as a challenge to see how much of my life could transport over to OSX from Windows. One of the things I wanted to make sure of was that (at the very least) I managed to keep a backup of all my open tabs, should the shit hit the fan and a dev build of Chrome for Mac bit the proverbial. The nice thing about Chrome is that when your normal life is replaced with a gLife, you can sync all your bookmarks with big brother and they&#8217;ll keep them around for you to access anywhere.</p>
<p>So after a few tweets and pointers in the right direction, I learned that Mac has long had this thing called AppleScript &#8211; basically a language which can be used to automate any part of the operating system and programs which it hosts. After <a href="http://www.mactech.com/articles/mactech/Vol.21/21.06/UserInterfaceScripting/index.html">a lot</a> <a href="http://dougscripts.com/itunes/itinfo/keycodes.php">of</a> <a href="http://www.macosxautomation.com/applescript/learn.html">googling</a>, reading help files and finding the <a href="http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&#038;id=ukelele">incredibly useful Ukelele</a> i managed to scrounge together the following script (saved here in case i ever need it again)</p>
<pre name="code" class="c#">
tell application "Google Chrome" to activate
tell application "System Events"
	-- bookmark all tabs
	keystroke "d" using {command down, shift down}
	tell application process "Google Chrome"
		repeat until sheet 1 of window 1 exists
		end repeat
	end tell
	
	keystroke ((current date) as string)
	
	-- tab to bookmark folder list
	key code 48
	
	keystroke "Other"
	key code 124 -- retain focus on "Other..." folder
	key code 125 -- down arrow for "Tabs" subfolder
	
	keystroke return
end tell
</pre>
<p>It&#8217;s not a highly dynamic or robust script, but then again nor does it need to be &#8211; it&#8217;s running in a controlled environment and does the job of what I need (near) perfectly well.</p>
<p>Scheduled an iCal event to execute the script at 1am, and hey presto i&#8217;m happy to be playing around on the edge once more.</p>
<p>Notice in a previous paragraph I said the script is <em>near</em> perfect. One of the limitations of AppleScript is that its higher-level functions require a library of commands to be built into any application you intend on scripting. Currently, the script library for Chrome is pretty average, so everything has to be done by simulating keystrokes. The only thing I can&#8217;t do (or at least couldn&#8217;t immediately see how to do) was to prune old backups &#8211; the only way I&#8217;ve found I could do this was to highlight the bookmark folder from the bookmarks bar and right-click to delete.</p>
<p>Either way, im happy with the result, and it&#8217;s another language I can add to my arsenal.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xerxesb.com/2010/scripting-google-chrome-for-osx-using-applescript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BASH &#8211; [: too many arguments</title>
		<link>http://www.xerxesb.com/2010/bash-too-many-arguments/</link>
		<comments>http://www.xerxesb.com/2010/bash-too-many-arguments/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 05:08:18 +0000</pubDate>
		<dc:creator><![CDATA[Xerxes]]></dc:creator>
				<category><![CDATA[IT & Software]]></category>

		<guid isPermaLink="false">http://www.xerxesb.com/?p=903</guid>
		<description><![CDATA[I&#8217;ve been writing a little bash script to wrap up the functionality in the JIRA CLI, and i&#8217;d noticed that sometimes, my script was spitting out the following error: sh.exe": [: too many arguments The code in question was: j () { if [ -z $3 ]; then echo jira --action progressIssue --issue "$1" --step [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been writing a little bash script to wrap up the functionality in the JIRA CLI, and i&#8217;d noticed that sometimes, my script was spitting out the following error:</p>
<p><code>sh.exe": [: too many arguments</code></p>
<p>The code in question was:</p>
<pre name="code" class="code">j () {
if [ -z $3 ]; then
echo jira --action progressIssue --issue "$1" --step "$2";
...
...</pre>
<p>It turns out the problem was that the variable $3 in the second line was being substituted directly into the if statement, without being quote delimited. So Bash is treating any input in $3 with spaces as multiple arguments (hence the &#8220;too many arguments&#8221; error). Duh. </p>
<p>Solution is to quote the $3 variable in the conditional to treat it as a single argument. Shouldn&#8217;t make this mistake again&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xerxesb.com/2010/bash-too-many-arguments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up Time Machine on a LaCie Network Space, wireless-ly</title>
		<link>http://www.xerxesb.com/2010/setting-up-time-machine-on-a-lacie-network-space-wireless-ly/</link>
		<comments>http://www.xerxesb.com/2010/setting-up-time-machine-on-a-lacie-network-space-wireless-ly/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 00:08:30 +0000</pubDate>
		<dc:creator><![CDATA[Xerxes]]></dc:creator>
				<category><![CDATA[IT & Software]]></category>
		<category><![CDATA[nas]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[time machine]]></category>

		<guid isPermaLink="false">http://www.xerxesb.com/?p=902</guid>
		<description><![CDATA[The marketing of the LaCie Network Space 2 claims that the device is Time Machine compatible, but when you try and dig for instructions on how to get it to work, the tubes becomes very very empty. If you&#8217;re connecting your Network Space via USB, I imagine the device works out of the box. i.e. [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>The marketing of the LaCie Network Space 2 claims that the device is Time Machine compatible, but when you try and dig for instructions on how to get it to work, the tubes becomes very very empty.</p>
<p>If you&#8217;re connecting your Network Space via USB, I imagine the device works out of the box. i.e. you just connect it to the Mac and Time Machine will find the drive and use it. In my case, my Network Space is connected to a wireless router, and I wanted to use it as if it was a Time Capsule.</p>
<p>Ordinarily, when you try and set up a Time Capsule, Time Machine will try and search for the Time Capsule over Bonjour, but because the Network Space doesnt identify itself as a Time Capsule it doesnt show up in the list. As it turns out, you can still do this, but you first need to tell Mac to chill out and show Time Machine capable devices which AREN&#8217;T the Time Capsule. In Terminal:</p>
<p><code>defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1</code></p>
<p>Now, when you &#8220;Show Supported Devices&#8221; in Time Machine, the OpenShare share is discovered and you&#8217;re good to go.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xerxesb.com/2010/setting-up-time-machine-on-a-lacie-network-space-wireless-ly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Command Line Replacement for Gitk</title>
		<link>http://www.xerxesb.com/2010/command-line-replacement-for-gitk/</link>
		<comments>http://www.xerxesb.com/2010/command-line-replacement-for-gitk/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 00:37:31 +0000</pubDate>
		<dc:creator><![CDATA[Xerxes]]></dc:creator>
				<category><![CDATA[IT & Software]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://www.xerxesb.com/?p=823</guid>
		<description><![CDATA[It&#8217;s no surprise I love git. To date, the worst part about git however, was the lacklustre downright shithouse  state of the pre-packaged GUI tools &#8211; git gui and gitk. Well here&#8217;s a command-line replacement i&#8217;ve devised for gitk which does a reasonable job at visualising a project tree. git log --oneline --decorate=full --graph --remotes Sick.]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s no surprise I love git. To date, the worst part about git however, was the lacklustre downright shithouse  state of the pre-packaged GUI tools &#8211; <em>git gui</em> and <em>gitk.</em></p>
<p><em><span style="font-style: normal;">Well here&#8217;s a command-line replacement i&#8217;ve devised for gitk which does a reasonable job at visualising a project tree.</span></em></p>
<p><code>git log --oneline --decorate=full --graph --remotes</code></p>
<p>Sick.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xerxesb.com/2010/command-line-replacement-for-gitk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Design of (Almost) Everyday Things: Impact Drill</title>
		<link>http://www.xerxesb.com/2010/design-of-almost-everyday-things-impact-drill/</link>
		<comments>http://www.xerxesb.com/2010/design-of-almost-everyday-things-impact-drill/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 22:41:23 +0000</pubDate>
		<dc:creator><![CDATA[Xerxes]]></dc:creator>
				<category><![CDATA[IT & Software]]></category>
		<category><![CDATA[ux]]></category>

		<guid isPermaLink="false">http://www.xerxesb.com/?p=825</guid>
		<description><![CDATA[Hopefully Don will forgive me for the creative licence I&#8217;ve taken in bastardising on the title of his book, but it seemed quite fitting given my recent experience with my Ryobi impact drill. Basically what we&#8217;re talking about here is a standard, off-the-shelf drill with two operating modes: Drill mode and Impact/Hammer mode Without getting into the detail of why [&#8230;]]]></description>
				<content:encoded><![CDATA[<p style="text-align: left">Hopefully Don will forgive me for the creative licence I&#8217;ve taken in bastardising on the title of his book, but it seemed quite fitting given my recent experience with my Ryobi impact drill.</p>
<p style="text-align: left">Basically what we&#8217;re talking about here is a standard, off-the-shelf drill with two operating modes: Drill mode and Impact/Hammer mode</p>
<p style="text-align: left">Without getting into the detail of why you need two drill modes, the point remains that the drill itself contains a switch to flick between both modes.</p>
<p style="text-align: center"><a href="http://www.xerxesb.com/wp-content/uploads/2010/07/IMG_6864_s.jpg"><img class="aligncenter size-medium wp-image-890" src="http://www.xerxesb.com/wp-content/uploads/2010/08/IMG_6864_s-300x200.jpg" alt="" width="300" height="200" /></a><br />
(click the image to see a bigger version)</p>
<p style="text-align: left">So the question is &#8211; <em>which way do you need to flick the switch in order to engage hammer mode?</em> Do you flick it right so that you can see the Hammer glyph, or do you flick it to the left so that the Hammer is covered up?</p>
<p style="text-align: left">I asked a number of people this question, and interestingly <strong>NOBODY </strong>got the answer right. If you answered <em>&#8220;flick it to the left so that the Hammer is covered up&#8221;</em> then you got it WRONG. The switch actually needs to be flicked to the right. I cant explain why it was done like this and it seems completely counter-intuitive to me. There are much better ways of representing this modal change &#8211; the most obvious being  if the glyphs themselves were shown on the side of the switch rather than at the bottom, and they swapped positions. This means the switch is then used to &#8220;engage&#8221; a particular mode, and the ambiguity is now removed by having to physically move the switch closer to the appropriate glyph.</p>
<p style="text-align: left">
<p style="text-align: left">So in the course of typing this blog-post, I thought about giving Ryobi a chance to respond and sent them a brief description of the problem and my proposed solution. Sadly I haven&#8217;t heard back from them. Shows how much they care about customer feedback in general. Ryobi fail.</p>
<p style="text-align: left"><strong><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xerxesb.com/2010/design-of-almost-everyday-things-impact-drill/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Chrome App Extensions</title>
		<link>http://www.xerxesb.com/2010/chrome-app-extensions/</link>
		<comments>http://www.xerxesb.com/2010/chrome-app-extensions/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 12:30:56 +0000</pubDate>
		<dc:creator><![CDATA[Xerxes]]></dc:creator>
				<category><![CDATA[IT & Software]]></category>
		<category><![CDATA[Evernote]]></category>
		<category><![CDATA[extensions]]></category>
		<category><![CDATA[Google Chrome]]></category>
		<category><![CDATA[Google Reader]]></category>

		<guid isPermaLink="false">http://www.xerxesb.com/?p=801</guid>
		<description><![CDATA[In the last few weeks I happened to come across Chrome web-apps. This feature of Chrome 6 obsoletes the Create Application Shortcut feature and replaces it with a more featured (or at the very least better thought-out) system for hosting a web-application within the browser. Just like Chrome Extensions, the web-applications are packaged in .CRX files and [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>In the last few weeks I happened to come across <a href="http://code.google.com/chrome/apps/" target="_blank">Chrome web-apps</a>. This feature of Chrome 6 obsoletes the <em>Create Application Shortcut</em> feature and replaces it with a more featured (or at the very least better thought-out) system for hosting a web-application within the browser. Just like Chrome Extensions, the web-applications are packaged in .CRX files and are installed using the Extension Manager (chrome://extensions)</p>
<p>At their heart, the web-apps can run in one of two modes:</p>
<ol>
<li><strong>Server-less App &#8211; </strong>All of the content required for the web-app is self-contained within the package. All code and images are stored on the local machine, and there&#8217;s no network access required by the plugin. These plugins can be installed by anyone, from anywhere</li>
<li><strong>Hosted App &#8211; </strong>On the other hand, if you have a website/webapp already written, you can easily package up the relevant URLs, give the app a few hi-res icons and you&#8217;re good to go. The only catch here is that the only domains able to serve the extension are those registered in the app itself.</li>
</ol>
<p>Upon finding out about this feature, I found the two default apps which come with Chrome in the <em>%AppData%\Local\Google\Chrome\Application\&lt;version&gt;\Resources\* </em>folder. Here you&#8217;ll find apps for GMail, GDocs and GCal. To install them, just open up the Extension Manager and select <em>Load Unpacked Extension</em>. The new icons will be shown on your New Tab screen.</p>
<p>Recently, i&#8217;ve become a big fan of Evernote, and have been using it a fair amount for both taking notes and just sharing content with myself across several computers. I figured it was an opportune moment to create an Evernote web-app extension for Chrome. It was pretty easy too &#8211; just whack in the right URLs and create a nice transparent icon.</p>
<h6>Installing the plugins:</h6>
<p>Firstly, you need to be running Chrome 6 (any build from the dev channel), so it&#8217;s immediately not suited to non-techs (at the time of writing). Secondly, you need to enable app mode in Chrome by running it with the <em>&#8211;enable-apps</em> command line option. Easiest way of doing this is to modify the shortcut you use to run Chrome (here&#8217;s a more <a href="http://chromeossite.com/2010/05/31/chromium-apps-a-sneak-peak-of-whats-to-come/">detailed description of enabling apps in Chrome</a>)</p>
<p>Now as a developer, it was easy for me to create this extension and install it myself. Providing it to others, however is not so simple. As mentioned previously, hosted app extensions can only be installed by downloading them from the website for which the app is written. This means to use my Evernote plugin, it would ideally need to be hosted on www.evernote.com. There <strong>are</strong> other ways though, and you can install the plugin by right-clicking the file and saving it to disk and then drag-drop the extension into Chrome from where you saved it.</p>
<p>Below i&#8217;ve attached the extensions for both Evernote and a quick one I whipped up for Google Reader. I&#8217;m looking forward to creating more of these <img src="http://www.xerxesb.com/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /></p>

<div class="zemanta-pixie" style="margin-top: 10px;height: 15px"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: none;float: right" src="http://img.zemanta.com/zemified_e.png?x-id=66614b07-a888-4cf7-b2ff-2e8342844b34" alt="Enhanced by Zemanta" /></a><span class="zem-script more-related more-info pretty-attribution paragraph-reblog"></span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.xerxesb.com/2010/chrome-app-extensions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding attachments of any type to WordPress</title>
		<link>http://www.xerxesb.com/2010/adding-attachments-of-any-type-to-wordpress/</link>
		<comments>http://www.xerxesb.com/2010/adding-attachments-of-any-type-to-wordpress/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 11:45:39 +0000</pubDate>
		<dc:creator><![CDATA[Xerxes]]></dc:creator>
				<category><![CDATA[IT & Software]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.xerxesb.com/?p=807</guid>
		<description><![CDATA[All content here is written in relation to WordPress 3.0 self-hosted Amazingly I failed to find a single page on the net describing this problem, or how to attach any files to WordPress. It seems that the main problem is that the Content Uploader is geared towards uploading media &#8211; GIF, PNG, JPG, PDF, DOC [&#8230;]]]></description>
				<content:encoded><![CDATA[<blockquote><p>All content here is written in relation to WordPress 3.0 self-hosted</p></blockquote>
<p>Amazingly I failed to find a single page on the net describing this problem, or how to attach any files to WordPress.</p>
<p>It seems that the main problem is that the Content Uploader is geared towards uploading media &#8211; GIF, PNG, JPG, PDF, DOC etc&#8230; But if you want to upload other files (eg: .ZIP files) then the uploader will error out with a very useless <strong>File type does not meet security guidelines. Try another.</strong>. </p>
<p>The problem here is that WordPress is looking at the extension of the file, blocking the content from being uploaded, but then provides no system to update the list of allowed extensions/MIME types.</p>
<p>Eventually I found a plugin (<strong>pjw-mime-config</strong>) which allows you to modify the registered MIME types supported by a WordPress installation. Simply install the plugin, visit the config section (Settings -> MIME Types) and add your extension/MIME type to the list.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xerxesb.com/2010/adding-attachments-of-any-type-to-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JetBrains: Teach with pleasure!</title>
		<link>http://www.xerxesb.com/2010/jetbrains-teach-with-pleasure/</link>
		<comments>http://www.xerxesb.com/2010/jetbrains-teach-with-pleasure/#comments</comments>
		<pubDate>Fri, 07 May 2010 22:39:45 +0000</pubDate>
		<dc:creator><![CDATA[Xerxes]]></dc:creator>
				<category><![CDATA[IT & Software]]></category>

		<guid isPermaLink="false">http://www.xerxesb.com/?p=795</guid>
		<description><![CDATA[Whenever i&#8217;m teaching my class, my laptop is connected to the projector and i&#8217;m running through an example on the screen, I make a conscious effort to NOT use ReSharper because its refactorings do so much and the keystrokes are so fast that my students are unable to keep up with the content i&#8217;m presenting. [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Whenever i&#8217;m teaching my class, my laptop is connected to the projector and i&#8217;m running through an example on the screen, I make a conscious effort to NOT use ReSharper because its refactorings do so much and the keystrokes are so fast that my students are unable to keep up with the content i&#8217;m presenting. Remember in most cases, these are students who don&#8217;t know how to create a property or a field or variable, so my &#8220;Extract Field&#8221; refactor just completely loses them. Just because I make a conscious effort not to however, doesn&#8217;t mean I subconsciously make the mistake every now and then. And almost every time I make the mistake I have to explain what just happened, what the tool was, and what it did for me. Most classes just nod their head and placate me so that we don&#8217;t run overtime (again). Keep the loud, talky-talky man happy and we might all get out before 10pm&#8230;</p>
<p>Except this semester. For the first time, I had students come up after the class and ask me about ReSharper, and what it did. I gave them a 5 minute whirl-wind tour of the tool, showing them the extract field/variable/method refactorings, move file refactoring, live templates and the integrated unit-testing. It seemed like they were hooked.  In the weeks following, I was inspecting code they were writing on their personal computers, and noticed the ReSharper menu in the VS toolbar. Seemed like a victory! One step closer to bridging the gap between academia and industry.</p>
<p>This got me thinking about ways I could further motivate my students to put more effort into this subject, and had an idea of getting in touch with JetBrains to see if they&#8217;d be interested in partnering by providing a licence for ReSharper to give away to the student who performs best in the subject. The idea would be for me to dedicate 10-15 minutes at the start of my lesson to actually explain the tool to the class, why it&#8217;s important for them to use this particular tool and give them the demo to blow their metaphorical pants off. This all started to brew about 2 months ago&#8230;</p>
<p>Well as of last night, the first part of my plan fell into place. After long discussions with JetBrains, I&#8217;m pleased to say they&#8217;re happy to award a personal edition licence of ReSharper for C# to the best student in the class, for each semester <strong>as an ongoing initiative</strong>! I really wasn&#8217;t expecting such a committed outcome from them, but thoroughly pleased with the result! </p>
<p>Now all I have to do is evangelise&#8230;I figure that the students who get the best marks are the ones who have put genuine care and effort into the project, and one of them deserves to be rewarded with a tool which makes them more productive and helps them enjoy what they do more.</p>
<p>Just wanted to shout-out here to anyone who reads this blog and hasn&#8217;t used ReSharper &#8211; you really are missing out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xerxesb.com/2010/jetbrains-teach-with-pleasure/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Right Person For The Job</title>
		<link>http://www.xerxesb.com/2010/the-right-person-for-the-job/</link>
		<comments>http://www.xerxesb.com/2010/the-right-person-for-the-job/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 03:52:47 +0000</pubDate>
		<dc:creator><![CDATA[Xerxes]]></dc:creator>
				<category><![CDATA[IT & Software]]></category>

		<guid isPermaLink="false">http://www.xerxesb.com/?p=786</guid>
		<description><![CDATA[I&#8217;ve been involved in the recruitment processes for many companies over the last few years, and i&#8217;ve seen time and time again the same common (simple) mistakes which often affect how a candidate is perceived. First of all &#8211; your resume and cover sheet (or equivalent thereof) is of paramount importance. Its primary goal is [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been involved in the recruitment processes for many companies over the last few years, and i&#8217;ve seen time and time again the same common (simple) mistakes which often affect how a candidate is perceived.</p>
<p>First of all &#8211; your <strong>resume and cover sheet</strong> (or equivalent thereof) is of paramount importance. Its primary goal is to introduce us and start a (mental) conversation. When you apply for a job, you&#8217;re basically telling me &#8220;I exist! I have the skills you need, and I&#8217;m the kind of person you&#8217;d like to work with&#8221;. The first part seems quite trivial, but remember <em>I DON&#8217;T KNOW YOU</em> and up until about 5 seconds ago <em>YOU DIDN&#8217;T EXIST</em>. So you want to take every possible opportunity to help me get to know you better. </p>
<p><strong>Don&#8217;t tell me things I already know</strong>. In particular I don&#8217;t want you to copy-paste content from our corporate website and spew it back to me. I&#8217;m reading your resume because I want to know about you. If you want to show your great research skills, find some other way of doing it&#8230;And even if you ARE going to copy-paste at least change the content so it reads as if you wrote it from your perspective, instead of leaving it in the corporate marketing speak so commonly read (true story&#8230;)? Humour me, please?</p>
<p>Me personally &#8211; i&#8217;m a stickler for <strong>grammar, spelling and punctuation</strong>. If you&#8217;re submitting a resume as a Word doc, I have to assume that you&#8217;re submitting it not only to me but to a number of other people too. If you apply for 20 jobs, each of these companies have 2 people reading your resume, and each person spends 5 minutes reading it, that&#8217;s 3 hours of total reading time that your document is analysed and scrutinised. In that time, some people will be guaranteed to find spelling mistakes &#8211; and these reflect on your attention to detail. If you were writing a book that would take 3 hours to read, you&#8217;d (hopefully) put a bit of effort in to make sure that the book had minimal errors &#8211; so why would you not do the same for your 3 page resume? Which leads me nicely into the next point..</p>
<p><strong>Keep your resume short</strong>. Don&#8217;t send me 50 pages. Don&#8217;t send me 10 pages. 3 pages is perfectly fine and 5 is pushing the limit. If you can&#8217;t succinctly condense your work experience into 5 pages, you&#8217;re not concentrating hard enough on telling me your best skills to suit the role we&#8217;re hiring for. I&#8217;m not interested in reading about a job you had 10 years ago where you made the best damn Cookie Man cookies in Central Plaza. Tell me about your work experience which is relevant to the job you&#8217;ve applied for.</p>
<p>But don&#8217;t limit yourself to just &#8220;work&#8221; experience. I&#8217;m interested in reading about<strong> your pet-projects</strong>, (software related) things that you do outside hours, and maybe even some not-so-software related. Please don&#8217;t write a 4-line paragraph extolling your abilities at feeding the ducks in your local park. Mentioning it as one of your interests gets me thinking about how you&#8217;re not just a 9-5 desk jockey, and anything more is just detracting from the goal at hand (see above).</p>
<p><strong>Lying on your resume</strong>. I know a few people who quietly admit that they lie on their resume about their skills and abilities, arguing that they can always learn said technology/tool in time and no-one would ever know. Things start becoming unstuck when you don&#8217;t know, and you&#8217;re caught with your pants at your ankles struggling to explain how it is that you&#8217;re able to re-compile the Linux kernel using only a pocket knife and some paper-clips. <strong>Just don&#8217;t do it</strong>. This practice reflects badly on you when it backfires and if you do happen to &#8220;get away with it&#8221; during the hiring process, it will sooner or later reveal itself once we&#8217;re working together.</p>
<p><strong>The Manager&#8217;s Guide To Technology</strong>. Here, i&#8217;m referring to a giant list of every-single technology you can think you&#8217;ve ever come in contact with, and writing it up as a &#8220;skill&#8221;. XML isn&#8217;t a skill. Nor is Microsoft Word. I&#8217;ll pat you on the back for opening a Word Document if you really want, but I won&#8217;t be using that as criteria for offering you a job. If you must, then please only list things that are genuine skills/practices. TDD, BDD, CI, whatever&#8230;If you need to explicitly mention software you&#8217;ve specialised in, then mention that separately. Whilst it might be an achievement on your part, reading hundreds of them is just noise on my part.</p>
<p><strong>Be creative</strong>. Throw in a little design or layout your content differently to the standard Page template. It shows me you&#8217;re willing to give your resume some attention in order to grab mine. I like being grabbed (quote, end-quote). Besides, it&#8217;s an opportunity to show me your creativity. I wouldn&#8217;t recommend going crazy and being radical about your design &#8211; after all I still need to read it and follow it. But all things considered, being different is an advantage &#8211; you&#8217;re more likely to be remembered that way.</p>
<p>They&#8217;re pretty much the main ones which come to mind. I reserve the right to change this list the next time I see something stupid.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xerxesb.com/2010/the-right-person-for-the-job/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Lessons from the classroom</title>
		<link>http://www.xerxesb.com/2010/lessons-from-the-classroom/</link>
		<comments>http://www.xerxesb.com/2010/lessons-from-the-classroom/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 07:46:49 +0000</pubDate>
		<dc:creator><![CDATA[Xerxes]]></dc:creator>
				<category><![CDATA[IT & Software]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.xerxesb.com/?p=778</guid>
		<description><![CDATA[As a number of you might know, I have been tutoring programming subjects at my old university for a number of years now. Both C# and VB.NET and the one common theme i&#8217;ve seen in these classes is that despite having completed a mandatory object-oriented programming subject, a large proportion of students just don&#8217;t get [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>As a number of you might know, I have been tutoring programming subjects at <a href="http://www.uts.edu.au">my old university</a> for a number of years now. Both C# and VB.NET and the one common theme i&#8217;ve seen in these classes is that despite having completed a mandatory object-oriented programming subject, a large proportion of students just don&#8217;t get OO. Furthermore, most of them have no real idea of how to solve a programming problem other than a very heavy, top-down method:</p>
<ol>
<li>Students are given a programming assignment to solve, and 5 weeks to complete it</li>
<li>They look at problem at the wholistic level just to try and understand the problem</li>
<li>Start designing a UI and use all the wonderful draggy-droppy components on their forms</li>
<li>Spend 2 weeks tweaking their UI colours and text box alignments.</li>
<li>Spend 1 week hacking together some code so that their UI starts to interact</li>
<li>Spend 1 week tweaking more UI elements</li>
<li>Realise there&#8217;s only 1 week left and they are missing 30% of the functionality</li>
<li>Panic, ask for extensions, submit the assignment late, or all of those together.</li>
</ol>
<p>After seeing this pattern over and over, I&#8217;ve tried different ways to address the problem in my classes. The first thing I tried was to verbally (and written in the student forums) express my sentiments that students should focus less on their UI upfront and try to make sure they have basic UI completeness first, all of the functionality implemented and finally come back to polish the UI. After all, I was seeing a great number of assignments come through with functionality either untested, totally broken or just altogether missing. Sadly my words seemed to fall upon deaf ears, and the quality of assignments were not up to the standard I was expecting.</p>
<p>Tackling this problem differently, <a href="http://groups.google.com.au/group/ozaltdotnet/browse_thread/thread/b9378e1c654890f4/d6f4babe090649ec#msg_d6f4babe090649ec">last year I thought I&#8217;d try and introduce the concept of unit-testing, TDD</a> and told them to think less about the upfront-design and instead focus on testing individual components of their system independently and build up to a solution. At the time, it seemed like a lot of students were receptive to the idea of unit-testing and test-upfront, but when the assignments came down, it looked like they just fell back into old habits and the quality of assignments seemed (on the whole) not much different to previous semesters&#8217;. After talking to some of them, I suspect the problem was that it became too difficult for them to manage this new &#8220;style&#8221; of writing their programs and keep up on top of their other coursework. The quickest and dirtiest appeared to work, and the mentality that this was purely just another assignment for the sake of passing uni seemed clearer than ever. I&#8217;m guilty of this attitude too, as when I was in uni it was more of a concern for me to make sure I completed the assignment as quickly as possible so I could spend quality time on <a href="http://en.wikipedia.org/wiki/Pub_trivia">other activities</a>. The problem with the unit-test/TDD approach was that it offers little to a student in a reward system. Unit-tested software takes longer to write than it&#8217;s direct-implementation counterpart. This pays off in the long-run, but when your &#8220;long-run&#8221; is only as long as a 6 month semester, then why investing extra time? It&#8217;s a classic ROI question. What I needed was a way to motivate students to improve the quality of their code, and without the seemingly large overhead of the automated tests.</p>
<p>This semester i&#8217;ve shaken things up once again, and have dropped the unit-testing/TDD mantra. Instead, i&#8217;m focusing <strong>*heavily*</strong> on problem decomposition, units of work, single responsibility and class separation. If unit-testing doesn&#8217;t drive students to think about their application functionality upfront, then hopefully teaching them a way to make a large problem seem easily palatable will motivate them to start thinking code-first instead of UI-first. Introduction to the concept of having one class per file seemed quite foreign and unnecessary when I discussed it in our first class last week. That didn&#8217;t fill me with confidence. Despite that, i committed to persisting with this trend, and re-enforced the importance of responsibility separation under the guise of making code easier to understand, but more importantly giving the students a method for decomposing a problem and forming a solution. This I think has been the key, because receptiveness to the idea suddenly picked up when I demonstrated building a simple Guess The Number game using a number of small, discrete components. They saw what at first appeared to be a task far too large for a 90 minute class, but by identifying single functions (like &#8220;ask the user to guess a number&#8221; and &#8220;determine if the user guessed too high&#8221;) and tackling them one-by-one we produced a solution, and it&#8217;s final composition was easy to follow. #win. </p>
<p>I&#8217;d also changed my presentation style and was more boisterous than normal. (for anyone who knows me in person, this would be pretty intense). My theory was that if I captured their attention, it would provoke them to treat my class differently to any of their others. After all, if i&#8217;m putting the effort in, they would reciprocate, wouldn&#8217;t they? Well i&#8217;m pleased to say that after 2 weeks (yes it&#8217;s early days still) i&#8217;ve had more students hang around for the full class than before and most importantly, when i&#8217;ve run overtime nearly 70% of my students are staying back (up to an hour &#8211; 10pm at night) to ask questions and learn more. </p>
<p>It still awaits to be proven whether this approach makes a difference with their assignments, but certainly I&#8217;ve seen a rather large improvement in the participation of students. I&#8217;m attributing this to a combination of making the classes more entertaining, and slicing the content so it&#8217;s easily digested. Historically this has been pretty bad at university level. Hopefully this time i&#8217;ve hit a winning formula.</p>
<div class="zemanta-pixie" style="margin-top:10px;height:15px"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/bcd607d4-eac4-497a-aec8-477bffcd99cc/" title="Reblog this post [with Zemanta]"><img class="zemanta-pixie-img"/></a><span class="zem-script more-related more-info pretty-attribution paragraph-reblog"></span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.xerxesb.com/2010/lessons-from-the-classroom/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Making Resolving Conflicts in Git Easier</title>
		<link>http://www.xerxesb.com/2010/making-resolving-conflicts-in-git-easier/</link>
		<comments>http://www.xerxesb.com/2010/making-resolving-conflicts-in-git-easier/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 03:32:39 +0000</pubDate>
		<dc:creator><![CDATA[Xerxes]]></dc:creator>
				<category><![CDATA[IT & Software]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://www.xerxesb.com/?p=772</guid>
		<description><![CDATA[One thing that bugs me when using Git, is that resolving merge conflicts isn&#8217;t a seamless process. It involves the fiddly task of opening files which conflicted, then resolving the conflict and then staging the changes. The part which bugs me the most is having to either type the full filename in order to open [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>One thing that bugs me when using Git, is that resolving merge conflicts isn&#8217;t a seamless process. It involves the fiddly task of opening files which conflicted, then resolving the conflict and then staging the changes.</p>
<p>The part which bugs me the most is having to either type the full filename in order to open it in any editor, OR i have to use the mouse to clipboard the filename and then paste it onto the commandline. Just not straightforward enough.</p>
<p>So i knocked up a quick bash script which makes use of git&#8217;s ability to <a href="http://nullstyle.com/2007/06/22/create-custom-commands-in-git/">create extensions for git commands</a>. This script issues a rebase (i also have one for merge) and will fire off <a href="http://www.xerxesb.com/2009/opening-a-file-in-your-favourite-editor-from-the-command-line/">my preferred editor for editing files outside Visual Studio</a>.</p>
<pre name="code" class="sh">
#!/bin/bash
# git-resolve-rebase

git rebase $1 
modified=`git status | grep 'unmerged' | uniq`

if [ -n "$modified" ]; then
	git status | grep 'unmerged' | awk '{print $3}' | uniq | xargs -n1 e
fi
</pre>
<p>(where e is the shell-script to launch E-Text Editor</p>
<p>To use this extension, all i need to do is:</p>
<pre name="code" class="console">
$ (MyBranch)> git resolve-rebase master
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.xerxesb.com/2010/making-resolving-conflicts-in-git-easier/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Unsatisfied By My Specification Pattern</title>
		<link>http://www.xerxesb.com/2010/unsatisfied-by-my-specification-pattern/</link>
		<comments>http://www.xerxesb.com/2010/unsatisfied-by-my-specification-pattern/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 00:50:02 +0000</pubDate>
		<dc:creator><![CDATA[Xerxes]]></dc:creator>
				<category><![CDATA[IT & Software]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Patterns]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.xerxesb.com/?p=763</guid>
		<description><![CDATA[This week, I hit an interesting problem which I don&#8217;t feel like was solved in the best possible way. The problem was that we needed to filter a list of objects based on some known criteria. Testing the specification is pretty important as there are a series of and&#8217;ed negating conditions (eg: IF this AND [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>This week, I hit an interesting problem which I don&#8217;t feel like was solved in the best possible way. The problem was that we needed to filter a list of objects based on some known criteria. Testing the specification is pretty important as there are a series of and&#8217;ed negating conditions (eg: IF this AND NOT that AND NOT the other etc&#8230;), in total about 5 unique criteria for the one filter. </p>
<p>Ordinarily this kind of implementation would lend itself nicely to the <a href="http://en.wikipedia.org/wiki/Specification_pattern">Specification Pattern</a> given that all information required to determine if the specification is satisfied exists on the object member being passed in at the time of evaluation. In my case, however, I had 3 conditions that the object being evaluated must not exist in 3 different lists. To give you an example the object under evaluation is a model, and this step of filtering is part of a much larger process involving running the model through a recursive algorithm. At each step of the algorithm, the model object could have</p>
<ul>
<li>Run through the algorithm succesfully</li>
<li>Been aborted during execution of the algorithm</li>
<li>Still awaiting to be executed through the algorithm</li>
</ul>
<p>These three states are tracked by keeping 3 lists &#8211; one for each criteria. The filter that I was working on had to filter based on whether the model under evaluation was NOT in those three lists. I realise the wordiness of me explaining this doesn&#8217;t really clear the air, so lets look at some code (with relevant types changed).</p>
<p>This is my model:</p>
<pre name="code" class="c#">
    public class User
    {
       public bool Enabled { get; set; }
       public string Name { get; set; }
       public UserType TypeOfUser { get; set; }
    }
</pre>
<p>The code which uses my filter looks something like this. This guy will be called recursively based on the result that gets returned from here. In this case, i&#8217;m building the allValidUsersFilter.</p>
<pre name="code" class="c#">
public class ReplacementUserFinder
{
        ...ctor...fields...etc

        public User FindReplacementUser(User userToReplace, IList&lt;User&gt; allPossibleUsers, IList&lt;User&gt; usersStillToBeEvaluated, IList&lt;User&gt; usersAlreadyEvaluated, IList&lt;User&gt; usersAbortedDuringEvaluation)
        {
            var validUsers = _allValidUsersFilter.Filter(allPossibleUsers, usersStillToBeEvaluated, usersAlreadyEvaluated, usersAbortedDuringEvaluation);
            var replacementUser = _bestReplacementCandidateFinder.Find(validUsers, userToReplace);

            return replacementUser;
        }
}
</pre>
<p>and the interface for the AllValidUsersFilter &#8211; it&#8217;s purpose is to filter the list of all users to a list of potential candidates given the list of all users:</p>
<pre name="code" class="c#">
        public IList&lt;User&gt; Filter(IList&lt;User&gt; allpossibleUsers, IList&lt;User&gt; usersStillToBeEvaluated, IList&lt;User&gt; usersAlreadyEvaluated, IList&lt;User&gt; usersAbortedDuringEvaluation)
        {
            return allpossibleUsers.Where(x =&gt; 
                _isUserEnabledSpecification.IsSatisfiedBy(x) &#038;&#038;
                _isOverseasUserSpecification.IsSatisfiedBy(x) &#038;&#038;
                    !_isUserStillToBeEvaluatedSpecification.IsSatisfiedBy(x, usersStillToBeEvaluated) &#038;&#038;
                    !_isUserAlreadyEvaluatedSpecification.IsSatisfiedBy(x, usersAlreadyEvaluated) &#038;&#038;
                    !_isUserAbortedDuringEvaluationSpecification.IsSatisfiedBy(x, usersAbortedDuringEvaluation)
            ).ToList();
        }
</pre>
<p>The specification instances here are being ctor injected into my filter&#8217;s instance so that I can use a behavioural style assertion to check that the specification is invoked correctly by the filter.</p>
<p>The IsUserEnabledSpecification, and IsOverseasUserSpecification just use the well-known ISpecification<t> interface pattern, but in order to evaluate the the other three, I had to create an IListSpecification</t><t , TList> and it feels somehow unsatisfying because the only thing different between them is that I have to pass in the list to the IsSatisfiedBy methods.</p>
<p>I&#8217;m not happy with this result, and we went through several different options before settling on this one purely just so we could move forward, and come back to address this later.</p>
<p>Hoping someone out there might have some suggestions&#8230;After writing this post, i&#8217;ve come up with another idea which would probably be cleaner&#8230;need to try it out.</p>
<p></t></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xerxesb.com/2010/unsatisfied-by-my-specification-pattern/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mount a VHD in Windows 7</title>
		<link>http://www.xerxesb.com/2010/mount-a-vhd-in-windows-7/</link>
		<comments>http://www.xerxesb.com/2010/mount-a-vhd-in-windows-7/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 05:23:34 +0000</pubDate>
		<dc:creator><![CDATA[Xerxes]]></dc:creator>
				<category><![CDATA[IT & Software]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.xerxesb.com/?p=759</guid>
		<description><![CDATA[Windows 7 (and possibly even Vista) has the ability to mount a VHD. The VHD could have been created from Virtual PC or Virtual Server, or it could be a System Image backup created by Windows Backup. To mount the VHD, open the Computer Management console (Start -> &#8220;Computer Management&#8221;). Right-click the Disk Management option [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Windows 7 (and possibly even Vista) has the ability to mount a VHD. The VHD could have been created from Virtual PC or Virtual Server, or it could be a System Image backup created by Windows Backup.</p>
<p>To mount the VHD, open the Computer Management console (Start -> &#8220;Computer Management&#8221;). Right-click the Disk Management option in the tree and select Attach VHD.</p>
<p>Awesome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xerxesb.com/2010/mount-a-vhd-in-windows-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coo&#8230;.Cooooooo</title>
		<link>http://www.xerxesb.com/2010/coo-cooooooo/</link>
		<comments>http://www.xerxesb.com/2010/coo-cooooooo/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 10:35:28 +0000</pubDate>
		<dc:creator><![CDATA[Xerxes]]></dc:creator>
				<category><![CDATA[IT & Software]]></category>

		<guid isPermaLink="false">http://www.xerxesb.com/2010/coo-cooooooo/</guid>
		<description><![CDATA[Making any kind of noises is apparently all the rage now&#8230;.ha-ha-ha&#8230;.coo ooo ooo mmmm. basically anything which doesn&#8217;t add up to &#8220;i&#8217;m hungry&#8221; or &#8220;i need my bum changed&#8221;. patience, xerx&#8230;.]]></description>
				<content:encoded><![CDATA[<p>Making any kind of noises is apparently all the rage now&#8230;.ha-ha-ha&#8230;.coo ooo ooo mmmm. basically anything which doesn&#8217;t add up to &#8220;i&#8217;m hungry&#8221; or &#8220;i need my bum changed&#8221;.</p>
<p>patience, xerx&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xerxesb.com/2010/coo-cooooooo/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Relocating Your Windows Profile To A Different Location</title>
		<link>http://www.xerxesb.com/2010/relocating-your-windows-profile-to-a-different-location/</link>
		<comments>http://www.xerxesb.com/2010/relocating-your-windows-profile-to-a-different-location/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 06:27:19 +0000</pubDate>
		<dc:creator><![CDATA[Xerxes]]></dc:creator>
				<category><![CDATA[IT & Software]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.xerxesb.com/?p=739</guid>
		<description><![CDATA[In the last few OS rebuilds of my machine, i&#8217;ve preferred to relocate my user profile to a different partition, and leave my C:\ as small and light as possible. The added benefit is that I can then backup an entire partition in a snap and be guaranteed i haven&#8217;t lost any major user-data. To [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>In the last few OS rebuilds of my machine, i&#8217;ve preferred to relocate my user profile to a different partition, and leave my C:\ as small and light as possible. The added benefit is that I can then backup an entire partition in a snap and be guaranteed i haven&#8217;t lost any major user-data.</p>
<p>To do this (under Windows 7), follow the steps below. This assumes you have formatted your machine and have a clean install of Win7 with your user account (with admin access) created.</p>
<h5>Enable the Administrator account</h5>
<p>This account is disabled by default and you will need to enable it in order to move your profile around.</p>
<ol>
<li>Press Start, and type &#8220;Computer Management&#8221; and run the first program</li>
<li>Under Local Users and Groups\Users, you will see the Administrator account. Right-click the Administrator, select Properties. In the General tab, uncheck &#8220;Account is disabled&#8221;. Apply. Ok.</li>
<li>If you don&#8217;t know the password for the Admin account, I suggest right-clicking the Administrator and Reset Password</li>
<li>Log out of your current user account and log in as the Administrator</li>
</ol>
<div id="attachment_740" style="width: 160px" class="wp-caption aligncenter"><a href="http://www.xerxesb.com/wp-content/uploads/2010/01/Admin-account.png"><img src="http://www.xerxesb.com/wp-content/uploads/2010/01/Admin-account-150x150.png" alt="Enabling the Administrator account" title="Enabling the Administrator account" width="150" height="150" class="size-thumbnail wp-image-740" /></a><p class="wp-caption-text">Enabling the Administrator account</p></div>
<p>&nbsp;</p>
<h5>Copy The Profile To Its New Location</h5>
<p>Logged in as Administrator, open Windows Explorer and navigate to C:\Users\. You will see your account folder there. **Move (dont copy!)** your account folder to the new location you want. In my case, I moved it to D:\home\.</p>
<h5>Update The Profile&#8217;s Home Folder Path</h5>
<p>You now need to update the user account to tell it that the profile exists in a different location. </p>
<ol>
<li>Press Start, and type &#8220;Computer Management&#8221; and run the first program</li>
<li>Under Local Users and Groups\Users, you will see your user account. Right-click the account, select Properties. In the Profile tab, select &#8220;Local path&#8221;, and type in the new path of the profile. (eg: D:\home\xerxes). Apply. Ok.</li>
</ol>
<div id="attachment_745" style="width: 160px" class="wp-caption aligncenter"><a href="http://www.xerxesb.com/wp-content/uploads/2010/01/xerxes-properties.png"><img src="http://www.xerxesb.com/wp-content/uploads/2010/01/xerxes-properties-150x150.png" alt="Profile Home Path" title="Profile Home Path" width="150" height="150" class="size-thumbnail wp-image-745" /></a><p class="wp-caption-text">Profile Home Path</p></div>
<p>&nbsp;</p>
<h5>Update Registry To Find New Profile</h5>
<p>I probably should have mentioned this before, but if you&#8217;re not comfortable modifying your Windows Registry, you probably shouldn&#8217;t attempt this. Moreover, <a href="http://www.disney.com">you probably shouldn&#8217;t be reading my blog</a>. </p>
<ol>
<li>Start -> Run, &#8220;Regedit&#8221;, Enter</li>
<li>Find the key <em>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList</em>. There will be a string value called <em>Profiles Directory</em>. Update the value to be your new profile home directory. (eg: D:\home)</li>
<li>Within the ProfileList key, there are a bunch of sub-keys, one for each user profile registered on the system. Scroll through them and look at the value <em>ProfileImagePath</em>, and find the one which mentions your username. Update the value of the ProfileImagePath to be the new path to your user profile (eg: D:\home\xerxes)</li>
</ol>
<div id="attachment_747" style="width: 160px" class="wp-caption aligncenter"><a href="http://www.xerxesb.com/wp-content/uploads/2010/01/profile-registry.png"><img src="http://www.xerxesb.com/wp-content/uploads/2010/01/profile-registry-150x150.png" alt="Updating User Profile Location In Registry" title="Updating User Profile Location In Registry" width="150" height="150" class="size-thumbnail wp-image-747" /></a><p class="wp-caption-text">Updating User Profile Location In Registry</p></div>
<p>&nbsp;</p>
<h5>Fin//</h5>
<p>You&#8217;re all done. Log out of the administrator account and try logging back into your own profile. If you did everything right, this should just work. If you want to disable the Administrator account again, you can do so after logging back into yours. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.xerxesb.com/2010/relocating-your-windows-profile-to-a-different-location/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Increase Development Productivity With Tomatoes</title>
		<link>http://www.xerxesb.com/2009/increase-development-productivity-with-tomatoes/</link>
		<comments>http://www.xerxesb.com/2009/increase-development-productivity-with-tomatoes/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 12:00:35 +0000</pubDate>
		<dc:creator><![CDATA[Xerxes]]></dc:creator>
				<category><![CDATA[IT & Software]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[time-management]]></category>

		<guid isPermaLink="false">http://www.xerxesb.com/?p=725</guid>
		<description><![CDATA[Recently, my programming-pair and I adopted the Pomodoro time-management technique and applied it to our software dev tasks. We&#8217;ve been doing this for about a week and we&#8217;ve found it incredibly helpful. Our work environment is fantastic, but sometimes it&#8217;s too easy to be distracted by work-related interruptions (or other). This system allows us to [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Recently, my programming-pair and I adopted the <a href="http://www.pomodorotechnique.com/">Pomodoro time-management</a> technique and applied it to our software dev tasks. We&#8217;ve been doing this for about a week and we&#8217;ve found it incredibly helpful. Our work environment is fantastic, but sometimes it&#8217;s too easy to be distracted by work-related interruptions (or other). This system allows us to focus on core development activities for a block of time, and a short-break in between. The purpose of this system is <strong>NOT</strong> to force us into being more productive for the sake of management or metrics &#8211; it&#8217;s to allow us to make the best use of the time we already have.</p>
<p>In a nutshell, the pomodoro (<em>tomato</em> in Italian) technique involves:</p>
<ol>
<li>Pick a task and work to complete it in 25 minutes</li>
<li>Break for 5 minutes</li>
<li>Repeat steps 1 &amp; 2 three more times (4x25min blocks + 5x5min breaks in total)</li>
<li>Have a 15 minute break</li>
</ol>
<p>Although we&#8217;re still aiming to achieve 4 consecutive pomodoros in a row, we both have noticed the increased focus and commitment to delivering on our development tasks. The 25 minute time block actually acts as an incentive to try and complete a problem up to a logically clean point before time runs out &#8211; this has in turn helped us break the problem down into smaller tasks.</p>
<p>This system worked so well within the first few days of using it, we even set-up a box and screen right in the middle of our desks which (amongst other things) is used to display a big timer from the website  <a href="http://tomatoi.st/">http://tomatoi.st/</a>. Any visitors who come to talk to us are kindly pointed to the big count-down and asked to come back at a time that&#8217;s better for us. Whilst it might seem unprofessional, we&#8217;ve yet to encounter someone who felt it important to disturb us in the middle of a timed task. There&#8217;s something about two people working diligently at a desk with a count-down over their heads that prevents others from wanting to disturb them.</p>
<p>What&#8217;s also nice about the tomatoi.st timer, is that it keeps track of the last 7 actions (either pomodoro or break). I whipped up a <a class="zem_slink freebase/guid/9202a8c04000641f8000000004838036" href="http://pipes.yahoo.com/" title="Yahoo! Pipes" rel="homepage">Yahoo pipe</a> to <a href="http://pipes.yahoo.com/xerxesb/pomodoros">convert the pomodoro list into an RSS feed</a>. The purpose of the RSS feed is to at least keep historical records of how we&#8217;ve been tracking to see how whether or not we&#8217;re improving. This content could be fed into <a href="http://www.uladoo.com/">uladoo</a> and tracked via Twitter or some other unnecessarily Web 2.0 service.</p>
<p>No doubt we&#8217;ll refine this process the more we work with it, but it&#8217;s been quite beneficial thusfar. I suspect a lot of other development teams will also benefit from this practice.</p>
<div class="zemanta-pixie" style="margin-top:10px;height:15px"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/0ca8ad8b-e6a7-40be-a91e-416150ad60f9/" title="Reblog this post [with Zemanta]"><img class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_e.png?x-id=0ca8ad8b-e6a7-40be-a91e-416150ad60f9" alt="Reblog this post [with Zemanta]" style="border:none;float:right"/></a><span class="zem-script more-related more-info pretty-attribution paragraph-reblog"><script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.xerxesb.com/2009/increase-development-productivity-with-tomatoes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Viewing a File&#8217;s History in Git</title>
		<link>http://www.xerxesb.com/2009/viewing-a-files-history-in-git/</link>
		<comments>http://www.xerxesb.com/2009/viewing-a-files-history-in-git/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 10:39:58 +0000</pubDate>
		<dc:creator><![CDATA[Xerxes]]></dc:creator>
				<category><![CDATA[IT & Software]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://www.xerxesb.com/2009/viewing-a-files-history-in-git/</guid>
		<description><![CDATA[To view the full history of a file in your Git repo, use this: gitk &#60;filename&#62;]]></description>
				<content:encoded><![CDATA[<p>To view the full history of a file in your Git repo, use this:</p>
<pre name="code" class="console">gitk &lt;filename&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.xerxesb.com/2009/viewing-a-files-history-in-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recovering your Git repository after doing a &#8220;git reset &#8211;hard&#8221;</title>
		<link>http://www.xerxesb.com/2009/recovering-your-git-repository-after-doing-a-git-reset-hard/</link>
		<comments>http://www.xerxesb.com/2009/recovering-your-git-repository-after-doing-a-git-reset-hard/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 02:36:46 +0000</pubDate>
		<dc:creator><![CDATA[Xerxes]]></dc:creator>
				<category><![CDATA[IT & Software]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://www.xerxesb.com/?p=693</guid>
		<description><![CDATA[There are many stupid people in this world. This guy is another one of them: Yes that&#8217;s right, yours truly really screwed up this time. For future reference (and in a nutshell), git checkout is not the same as git reset, particularly when you throw in the hard option. I know this now, and in [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>There are many stupid people in this world. This guy is another one of them:<br />
<img src="http://www.xerxesb.com/wp-content/uploads/2009/08/n693311395_80183_5719-113x150.jpg" alt="Picture of Xerxes Battiwalla" title="Xerxes Battiwalla" width="113" height="150" class="size-thumbnail wp-image-694"/></p>
<p>Yes that&#8217;s right, yours truly really screwed up this time. </p>
<p>For future reference (and in a nutshell), <strong>git checkout</strong> is not the same as <strong>git reset</strong>, particularly when you throw in the <strong>hard</strong> option. I know this now, and in fact I knew it when i accidentally blew away half my repository &#8211; didn&#8217;t make the end result any less pleasing.</p>
<p>Here&#8217;s the gitk output of what my tree looked like before the wipe:</p>
<p><img src="http://www.xerxesb.com/wp-content/uploads/2009/08/FullHistory.PNG" alt="Full project history from gitk" title="" width="410" height="253" class="size-full wp-image-697" /></p>
<p>I was intending to checkout a previous revision of the repo to show how some code had evolved over time. Normally I would do this from the command line, but this time I (crazily) chose to use (the very disabled) gitk to do this, and blindly chose the &#8220;hard&#8221; option without thinking. So what I was left with was a very lacking repository and even sorely bruised ego. Goodbye repo history! It&#8217;s been nice knowing you&#8230;.</p>
<p><img src="http://www.xerxesb.com/wp-content/uploads/2009/08/wiped_repo.PNG" alt="Wiped Repository" title="Wiped Repository" width="400" height="70" class="alignnone size-full wp-image-703" /></p>
<p>Thanks to the <a href="http://www.davesquared.net">ever-knowledgeable davesquared</a>, there&#8217;s a way to recover your git repo once you bone yourself. If you escape the clutches of the gitk demon, the command line interface gives you a better level of control (and content which is crawlable by search engines <img src="http://www.xerxesb.com/wp-includes/images/smilies/icon_wink.gif" alt=";)" class="wp-smiley" /> )</p>
<p>It turns out that until the repository is cleaned (<strong>git gc</strong>) and stale objects are cleared, the repo still has the necessary content stored, it&#8217;s just not visible. (if the following block looks terrible in your renderer, click through the link to read it properly.)</p>
<pre name="code" class="console">
<span style="color:green;">xerxes@laptop</span> <span style="color:olive;">/d/source/dotnet/CodeKatas/.git/logs (GIT_DIR!)</span>
$ cat HEAD
0000000000000000000000000000000000000000 f167fd4068e4b92134964e073f2e69a0cc8fced9 Xerxes <xerxes @local> 1250928395 +1000 commit (initial): Initial commit of binary search
f167fd4068e4b92134964e073f2e69a0cc8fced9 dd31afc8d793aaa952e032a77675b8e67f6b26bc Xerxes </xerxes><xerxes @local> 1251007341 +1000 commit: Removedbin/obj from source control
dd31afc8d793aaa952e032a77675b8e67f6b26bc 0642a5e64a513f8949f7aa9e1d35a298fb713bfc Xerxes </xerxes><xerxes @local> 1251007422 +1000 commit: removed.suo from source control
0642a5e64a513f8949f7aa9e1d35a298fb713bfc 0cf0929cfb9a31707b2ae937f0c6e73bd9e5bcb9 Xerxes </xerxes><xerxes @local> 1251007479 +1000 commit: Implemented first binary tree implementation. it is shit
0cf0929cfb9a31707b2ae937f0c6e73bd9e5bcb9 6c27c54370bf2b79369dc5ef02ef7338bbf2865a Xerxes </xerxes><xerxes @local> 1251010817 +1000 commit: Refactored first implementation to remove unnecessary elements
6c27c54370bf2b79369dc5ef02ef7338bbf2865a 937fcb1c36bf437e0df11847ee579ca60151144d Xerxes </xerxes><xerxes @local> 1251021898 +1000 commit: removedresharper settings file from project
937fcb1c36bf437e0df11847ee579ca60151144d b12a95ea3c636615345559979d3fc0e93fecc0bc Xerxes </xerxes><xerxes @local> 1251022036 +1000 commit: Rewritten first implementation of b-search to get practice.
b12a95ea3c636615345559979d3fc0e93fecc0bc f57503a6116822c9632e6b4dc6cb423640c6a152 Xerxes </xerxes><xerxes @local> 1251028214 +1000 commit: 3rd implementation of binary search using shifted bounds.
f57503a6116822c9632e6b4dc6cb423640c6a152 be510f0f88baa38d8d2e645f568405d052f5bb14 Xerxes </xerxes><xerxes @local> 1251028265 +1000 commit (amend):Another rewrite of binary search using shifted bounds.
be510f0f88baa38d8d2e645f568405d052f5bb14 2c0b21e7aea2dd27fc7281d1a20a887e2e1f3d0d Xerxes </xerxes><xerxes @local> 1251090393 +1000 commit: Yet another re-write of the shifted boundary method.
2c0b21e7aea2dd27fc7281d1a20a887e2e1f3d0d d2a23e1cad8b36de1361700b89733a3b08401e2c Xerxes </xerxes><xerxes @local> 1251253854 +1000 commit: Moved BinaryTree project to top-level folder
d2a23e1cad8b36de1361700b89733a3b08401e2c 4e8bd70336e89f9000f29553d53d98cb568bc809 Xerxes </xerxes><xerxes @local> 1251253901 +1000 commit: Added nunit to the list of dependencies
4e8bd70336e89f9000f29553d53d98cb568bc809 551c754f27f10826dab43c50d8a3151b7e2740f5 Xerxes </xerxes><xerxes @local> 1251253922 +1000 commit: Implemented FizzBuzz
551c754f27f10826dab43c50d8a3151b7e2740f5 11884f5935c85d4ec1497fe3a8eb39211d731fdc Xerxes </xerxes><xerxes @local> 1251269688 +1000 commit (amend):Moved parameters onto FizzBuzz method and out of constructor
11884f5935c85d4ec1497fe3a8eb39211d731fdc cbda7a8c68c88900eb1c58ab7bf613bad26892ad Xerxes </xerxes><xerxes @local> 1251269732 +1000 commit (amend):Implemented FizzBuzz solution
cbda7a8c68c88900eb1c58ab7bf613bad26892ad b40c951696a2d11854fce6a9fca1be9fc436e61b Xerxes </xerxes><xerxes @local> 1251341643 +1000 commit: Anotherre-implementation of the shifted-boundaries method
b40c951696a2d11854fce6a9fca1be9fc436e61b b2c2a8b103aa43dac8e443cfc866fa35f9ffb048 Xerxes </xerxes><xerxes @local> 1251341967 +1000 commit: RenamedBinarySearch to ShiftedBoundariesBinarySearch
b2c2a8b103aa43dac8e443cfc866fa35f9ffb048 30a224eb40c441df8a18b06eeb68af47a86bc37f Xerxes </xerxes><xerxes @local> 1251344036 +1000 commit: Implemented RecursiveBinarySearch (badly). requires refactor
30a224eb40c441df8a18b06eeb68af47a86bc37f 0fbf8ace753f408b0e972b593e2b6a03dd2d0354 Xerxes </xerxes><xerxes @local> 1251345463 +1000 commit: CreatedTreeNode Search
0fbf8ace753f408b0e972b593e2b6a03dd2d0354 0cf0929cfb9a31707b2ae937f0c6e73bd9e5bcb9 Xerxes </xerxes><xerxes @local> 1251345505 +1000 0cf0929cfb9a31707b2ae937f0c6e73bd9e5bcb9: updating HEAD
0cf0929cfb9a31707b2ae937f0c6e73bd9e5bcb9 2c0b21e7aea2dd27fc7281d1a20a887e2e1f3d0d Xerxes </xerxes><xerxes @local> 1251345635 +1000 checkout: moving from master to 2c0b2

<span style="color:green;">xerxes@laptop</span> <span style="color:olive;">/d/source/dotnet/CodeKatas/.git/logs (GIT_DIR!)</span>
$ 
</xerxes></pre>
<p>The beauty here is that the log has kept full record of all the SHAs for each commit in the repo. NOW i&#8217;m able to reset my master back to the appropriate commit by using the SHA-1 hash. So i checked out onto the master branch and issued:</p>
<pre name="code" class="console" style="overflow:hidden;">
<span style="color:green;">xerxes@laptop</span> <span style="color:olive;">/d/source/dotnet/CodeKatas (master)</span>
$ git reset --hard 0fbf8ace753f408b0e972b593e2b6a03dd2d0354 
</pre>
<p>and that reset my master back to the right revision, thereby restoring my history, code and sanity.</p>
<p>nb: i have taken some of these screenshots trying to reproduce after the event, so they might look a little doctored. Despite this, the findings and end results are the same.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xerxesb.com/2009/recovering-your-git-repository-after-doing-a-git-reset-hard/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

 Served from: tumblr.xerxesb.com @ 2015-06-29 20:11:20 by W3 Total Cache -->