<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Craig Russell Web n That</title>
	
	<link>http://www.craig-russell.co.uk</link>
	<description>Web developement, identity management, federated access, web tech, geekery and the odd bit of paper folding</description>
	<lastBuildDate>Fri, 27 Jan 2012 21:57:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/PagesFromMyHead" /><feedburner:info uri="pagesfrommyhead" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>New Year, New Job, New Challenges</title>
		<link>http://feedproxy.google.com/~r/PagesFromMyHead/~3/8j8pr_O_wuc/</link>
		<comments>http://www.craig-russell.co.uk/new-year-new-job-new-challenges/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 11:34:42 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
				<category><![CDATA[Comment]]></category>

		<guid isPermaLink="false">http://www.craig-russell.co.uk/?p=1010</guid>
		<description><![CDATA[I&#8217;m not much for &#8220;new year resolutions&#8221; but I have decided that this year I&#8217;m going to pull my finger out and be a bit more pro-active about doing things that I&#8217;ve been putting off. 2011 saw me finishing my MSc and being awarded a Distinctions for my efforts. Throughout the course I discovered that&#8230;]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not much for &#8220;new year resolutions&#8221; but I have decided that this year I&#8217;m going to pull my finger out and be a bit more pro-active about doing things that I&#8217;ve been putting off. 2011 saw me finishing my MSc and being awarded a Distinctions for my efforts. Throughout the course I discovered that I actually quite enjoy writing, so this year I&#8217;m setting out to do more of that (most likely on this blog). I&#8217;ve also had a few opportunities to do a bit of presentational speaking (both with the course and with work) which I found an uncomfortable experience, but this is something I&#8217;d like to get better at too.</p>
<p>2012 will also see me starting a new job at the <a href="http://www.le.ac.uk">University of Leicester</a>, which I am really excited about. I&#8217;ll be working as a Web Developer in the Marketing and Communications team and can&#8217;t wait to get stuck in. Developing for the web has been a big part of my working and personal life for the past decade or so, but this is the first job I&#8217;ve had where it will be the main focus of the role. Given the phenomenal rate of change in the industry I can&#8217;t wait to devote my full working day to learning about and applying some of the fascinating technologies that are being developed.</p>
<p>I&#8217;ve also <del datetime="2011-12-31T16:28:29+00:00">been tricked</del> agreed to run a <a href="http://quest-events.co.uk/frolics.htm">10k &#8220;fun run&#8221;</a> in March with some of my former colleagues. We&#8217;ll be raising money for Rainbows Hospice for Children and Young People so <a href="http://www.justgiving.com/Farmyardfrolics2012">give generously</a>. Because of this 2012 (or the first three months at least) will involve me doing a bit of training. I haven&#8217;t done anything approaching exercise since May, so I&#8217;ve got a fair bit of ground to make up there.</p>
<p>Lastly, but most significantly, I&#8217;m going to become an uncle in the summer to my brothers child. I can&#8217;t say how excited my wife and I are and we can&#8217;t wait to meet the little Russell.</p>
<p>So that&#8217;s what I&#8217;m looking forward to in 2012. It&#8217;s gonna be fun.</p>
<img src="http://feeds.feedburner.com/~r/PagesFromMyHead/~4/8j8pr_O_wuc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.craig-russell.co.uk/new-year-new-job-new-challenges/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.craig-russell.co.uk/new-year-new-job-new-challenges/</feedburner:origLink></item>
		<item>
		<title>Kindle 4 Custom Screen Savers</title>
		<link>http://feedproxy.google.com/~r/PagesFromMyHead/~3/4yqeWIUFNz0/</link>
		<comments>http://www.craig-russell.co.uk/kindle-4-custom-screen-savers/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 14:39:32 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.craig-russell.co.uk/?p=1006</guid>
		<description><![CDATA[Early Kindles allowed you to use your own images as screen savers, this feature was removed in later models. Thankfully people much smarter than me had written custom firmware giving you this feature back. Unfortunately this firmware hack doesn&#8217;t work with the latest 4th generation non-touch (NT) Kindle. There is however, still a way of&#8230;]]></description>
			<content:encoded><![CDATA[<p>Early Kindles allowed you to use your own images as screen savers, this feature was removed in later models. Thankfully people much smarter than me had written custom firmware giving you this feature back. Unfortunately this firmware hack doesn&#8217;t work with the latest 4th generation non-touch (NT) Kindle.</p>
<p>There is however, still a way of getting this functionality on the Kindle 4 NT, but it is quite fiddly and requires you to have some knowledge of Linux file systems, basic networking and SSH. I achieved this using a Linux (Ubuntu) PC, there instructions are probably largely similar for MACs too. Windows users will have to install some extra software tools and the networking bit will be different too (Don&#8217;t ask &#8211; I won&#8217;t know).</p>
<p>Basically all we&#8217;re going to do is move the screensaver images folder to the part of the kindle that is accessible over USB and creating a symbolic link to this location. However, the route from here to there is a bit contrived. If you&#8217;re not sure what you&#8217;re doing it&#8217;s best to ask a techo-literate friend to help out. Oh, it should also go without saying that this probably invalidates your warranty too.</p>
<h2>Diagnostic Mode</h2>
<p>The first thing we need to do is put the Kindle in to Diagnostic Mode.</p>
<ol>
<li>Connect the Kindle to your PC with the USB cable.</li>
<li>Create a file on the Kindle called <code>ENABLE_DIAGS</code></li>
<li>Unmount the Kindle and disconnect the USB cable.</li>
<li>Restart the Kindle<br/><br />
  <em>[MENU] Settings [MENU] Restart</em> <br/><br />
  This will take a few minutes.</li>
<li>You should now be in Diagnostic Mode.</li>
</ol>
<h2>Gaining Root Access</h2>
<p>Next we need to connect to the Kindle as root which will allow us to fiddle around with it.</p>
<ol>
<li>Connect the Kindle to your PC with the USB cable. It should <em>NOT</em> mount.</li>
<li>Enable USB Networking from the menu.<br/><br />
    <em>Misc individual diagnostics > Utilities > Enable USBNet</em></li>
<li>The Kindle should now be a network device on your PC. <br/><br />
    <code>ifconfig</code></li>
<li>Configure a IP address for the device. <br/><br />
    <code>ip addr add 192.168.15.241/24 dev usb0</code></li>
<li>You should now be able to SSH in to the Kindle as root. <br/><br />
    <code>ssh root@192.168.15.244</code> <br/><br />
    The password is &#8220;mario&#8221;.<br/><br />
    <strong>Edit:</strong> If &#8220;mario&#8221; doesn&#8217;t work <a href="http://members.ping.de/~sven/kindle.html" target="_blank">try this tool</a>.</li>
<li>You now have root access to your Kindle</li>
</ol>
<h2>Moving the Screen Savers</h2>
<p>Now we&#8217;re going to move the screensavers from their existing location to a new folder in <code>/mnt/us/</code>, which is the folder accessible via USB.</p>
<ol>
<li>First mount the required partition.<br/><br />
    <code>mount /dev/mmcblk0p1 /mnt/base-mmc</code></li>
<li>Backup the existing screensavers.<br/><br />
    <code>mv /mnt/base-mmc/opt/amazon/screen_saver/600x800 /mnt/base-mmc/opt/amazon/screen_saver/600x800.bak</code></li>
<li>Create a folder for custom screen savers.<br/><br />
    <code>mkdir /mnt/us/screensaver</code></li>
<li>Create a link from the screen saver location to the new folder.<br/><br />
    <code>ln -sfn /mnt/us/screensaver /mnt/base-mmc/opt/amazon/screen_saver/600x800</code></li>
<li>You can optionally copy the existing screen savers to the new folder if you want to keep them.<br/><br />
    <code>cp /mnt/base-mmc/opt/amazon/screen_saver/600x800.bak/* /mnt/us/screensaver/</code></li>
<li>End the SSH session.<br/><br />
    <code>exit</code></li>
<li>Exit Diagnostic Mode<br/><br />
    <em>Exit, Reboot or Disable Diags > Disable Diagnostics > To continue &#8211; FW LEFT</em></li>
<li>Wait a few minutes for the Kindle to reboot.</li>
<li>That&#8217;s the screen savers moved!</li>
</ol>
<h2>Setting Custom Screen Savers</h2>
<p>Now you can copy your own screen saver images to your Kindle. All you need to do is connect your Kindle to your PC with the USB cable and copy the images you want in to the <code>screensaver</code> folder.</p>
<p>The images files must be 600&#215;800 pixels. I think they also have to be PNG files and 72dpi in 32bit indexed greyscale. Some people on the forums have said that this isn&#8217;t necessary, others say it is. But this format works fine for me where others didn&#8217;t.</p>
<p>There are various sites out there with Kindle screen savers to download, you may or may not need to do some image conversion. I leave it to you to experiment.</p>
<p>You also have to researt the Kindle fully (<em>[MENU] Settings [MENU] Restart</em>) before the new screen savers will work.</p>
<p>Have fun!</p>
<p><strong>Edit:</strong> <a href="http://www.craig-russell.co.uk/downloads/Kindle4OriginalScreensavers.zip">Here&#8217;s the original Kindle 4 Screen Savers</a>.</p>
<img src="http://feeds.feedburner.com/~r/PagesFromMyHead/~4/4yqeWIUFNz0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.craig-russell.co.uk/kindle-4-custom-screen-savers/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		<feedburner:origLink>http://www.craig-russell.co.uk/kindle-4-custom-screen-savers/</feedburner:origLink></item>
		<item>
		<title>HTML5 Reference: Free Kindle Book</title>
		<link>http://feedproxy.google.com/~r/PagesFromMyHead/~3/cLDDbgh97i4/</link>
		<comments>http://www.craig-russell.co.uk/html5-reference-free-kindle-book/#comments</comments>
		<pubDate>Thu, 29 Dec 2011 17:40:49 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.craig-russell.co.uk/?p=1001</guid>
		<description><![CDATA[So, I got a Kindle for Xmas. It is awesome. Pretty much the first thing I did with it is start hunting for free web development ebooks. I was quite surprised to find that there wasn&#8217;t a free tag reference for HTML5. So I made one. It&#8217;s not in the Amazon store, but you can&#8230;]]></description>
			<content:encoded><![CDATA[<p>So, I got a Kindle for Xmas. It is awesome.</p>
<p>Pretty much the first thing I did with it is start hunting for free web development ebooks. I was quite surprised to find that there wasn&#8217;t a free tag reference for HTML5.</p>
<p>So I made one.</p>
<p>It&#8217;s not in the Amazon store, but you can download and copy it to you Kindle over USB.</p>
<p><a href="http://www.craig-russell.co.uk/downloads/HTML5_Reference.mobi">Download HTML5 Reference here</a>.</p>
<img src="http://feeds.feedburner.com/~r/PagesFromMyHead/~4/cLDDbgh97i4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.craig-russell.co.uk/html5-reference-free-kindle-book/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.craig-russell.co.uk/html5-reference-free-kindle-book/</feedburner:origLink></item>
		<item>
		<title>JavaScript Physics Orbiting Objects</title>
		<link>http://feedproxy.google.com/~r/PagesFromMyHead/~3/pWhpJk195LE/</link>
		<comments>http://www.craig-russell.co.uk/javascript-physics-orbiting-objects/#comments</comments>
		<pubDate>Sun, 11 Dec 2011 13:31:34 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.craig-russell.co.uk/?p=998</guid>
		<description><![CDATA[Finally I&#8217;ve found a decent example of a JS physics simulation. This example by Jorn Zaefferer shows how to model a bouncing ball with vector arithmetic. I&#8217;ve tweaked this code to build a simulation of objects orbiting about a point. The only key difference is that the gravity for each ball is recalculated relative to&#8230;]]></description>
			<content:encoded><![CDATA[<p>Finally I&#8217;ve found a decent example of a JS physics simulation. This <a href="http://bassistance.de/2011/12/09/vector-math-basics-to-animate-a-bouncing-ball-in-javascript/" target="_blank">example by Jorn Zaefferer</a> shows how to model a bouncing ball with vector arithmetic.</p>
<p>I&#8217;ve tweaked this code to build a simulation of objects orbiting about a point. The only key difference is that the gravity for each ball is recalculated relative to the &#8220;sun&#8221; with each animation step. I&#8217;ve also removed collision detection with the window borders.</p>
<p>There&#8217;s a live <a href="http://craig-russell.co.uk/examples/orbiting_ball/" target="_blank">example here</a>. View the source for the.. er.. source.</p>
<img src="http://feeds.feedburner.com/~r/PagesFromMyHead/~4/pWhpJk195LE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.craig-russell.co.uk/javascript-physics-orbiting-objects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.craig-russell.co.uk/javascript-physics-orbiting-objects/</feedburner:origLink></item>
		<item>
		<title>Git Tip: BRANCH-README</title>
		<link>http://feedproxy.google.com/~r/PagesFromMyHead/~3/mE70tB_GTDY/</link>
		<comments>http://www.craig-russell.co.uk/git-tip-branch-readme/#comments</comments>
		<pubDate>Fri, 18 Nov 2011 14:02:44 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.craig-russell.co.uk/?p=991</guid>
		<description><![CDATA[Here&#8217;s a quick tip for keeping track which branch is for what in a git repo. Create a file called BRANCH-README in the repo root, and for each new branch include a summary describing what the the branch is for. Branch: bugfix-123-autherror Author: Craig Russell Date: Fri 18th Nov 2011 Description: Fix for bug #123&#8230;]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick tip for keeping track which branch is for what in a git repo.</p>
<p>Create a file called <code>BRANCH-README</code> in the repo root, and for each new branch include a summary describing what the the branch is for.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Branch: bugfix-123-autherror
Author: Craig Russell
Date: Fri 18th Nov 2011
Description: Fix for bug #123 - User receives authentication error when uploading content.</pre></div></div>

<p>What do you think? Do you have a branch management strategy you&#8217;d like to share? Drop a comment below.</p>
<img src="http://feeds.feedburner.com/~r/PagesFromMyHead/~4/mE70tB_GTDY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.craig-russell.co.uk/git-tip-branch-readme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.craig-russell.co.uk/git-tip-branch-readme/</feedburner:origLink></item>
		<item>
		<title>How To Create and Test a Ruby on Rails Plugin</title>
		<link>http://feedproxy.google.com/~r/PagesFromMyHead/~3/2wSxVCe7RyY/</link>
		<comments>http://www.craig-russell.co.uk/how-to-create-and-test-a-ruby-on-rails-plugin/#comments</comments>
		<pubDate>Wed, 09 Nov 2011 15:27:05 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.craig-russell.co.uk/?p=976</guid>
		<description><![CDATA[I&#8217;ve been learning how to create a plugin in Ruby on Rails 3.1 and test it using RSpec. I haven&#8217;t been able to find a tutorial for this anywhere, so I&#8217;ll share what I&#8217;ve done here. First up, use rails to generate a new plugin. ]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been learning how to create a plugin in Ruby on Rails 3.1 and test it using RSpec. I haven&#8217;t been able to find a tutorial for this anywhere, so I&#8217;ll share what I&#8217;ve done here.</p>
<p>First up, use rails to generate a new plugin.</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">$ rails generate plugin HelloWorld</pre></div></div>

<p>This will create a folder in <code>/vendor/plugins/hello_world</code> containing template files for the plugin. What it won&#8217;t do is create a test file for RSpec, so we&#8217;ll create it manually later. This is a <a href="https://github.com/rspec/rspec-rails/issues/258" target="_blank">known issue</a>.</p>
<p>In the plugin folder there&#8217;s a few files, most of which are self-explanatory. We&#8217;re only going to be interested in <code>hello_world/init.rb</code> and <code>hello_world/lib/hello_world.rb</code>.</p>
<p><code>hello_world/init.rb</code> tells Rails what to do with the plugin. We&#8217;re not going to do too much, so we just need to require the main class file.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># Include hook code here</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'hello_world'</span></pre></div></div>

<p>Next we create the main class in <code>hello_world/lib/hello_world.rb</code>.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># HelloWorld</span>
<span style="color:#9966CC; font-weight:bold;">class</span> HelloWorld
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Before we go any further we should set up a test, because we do things properly. RSpec tests live in <code>/spec</code> so we&#8217;ll create a folder for plugin tests and create a spec file for our plugin there.</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">$ mkdir /spec/plugins
$ touch /spec/plugins/hello_world_spec.rb</pre></div></div>

<p>Lets define a simple test for our plugin in <code>/spec/plugins/hello_world_spec.rb</code></p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'spec_helper'</span>
describe HelloWorld <span style="color:#9966CC; font-weight:bold;">do</span>
  describe <span style="color:#996600;">&quot;should have method&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    it <span style="color:#996600;">&quot;'hi'&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
      response = HelloWorld.<span style="color:#9900CC;">instance_methods</span>.<span style="color:#9966CC; font-weight:bold;">include</span>? <span style="color:#ff3333; font-weight:bold;">:hi</span>
      response.<span style="color:#9900CC;">should</span> == <span style="color:#0000FF; font-weight:bold;">true</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>We&#8217;ve done a few things here, firstly we&#8217;ve required the RSpec helper file, all RSpec tests need this. The first describe block is defined with the name of the class we are testing. Then we&#8217;ve added a test to check that a method exists. If you run the test, it should fail.</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">$ rspec /spec/plugins/hello_world_spec.rb</pre></div></div>

<p>Now we can add a method to the <code>HelloWorld</code> class, which should get the test to pass.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># HelloWorld</span>
<span style="color:#9966CC; font-weight:bold;">class</span> HelloWorld
  <span style="color:#9966CC; font-weight:bold;">def</span> hi
    <span style="color:#996600;">&quot;Hello World!&quot;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>That&#8217;s it!</p>
<p>Now you have a working plugin, you can use it in your Rails application. You can create objects in controllers and call functions from views, there&#8217;s no need to explicitly require the plugin anywhere.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># app/controllers/pages_controller.rb</span>
<span style="color:#9966CC; font-weight:bold;">class</span> PagesController <span style="color:#006600; font-weight:bold;">&lt;</span> ApplicationController
  <span style="color:#9966CC; font-weight:bold;">def</span> hello
    <span style="color:#0066ff; font-weight:bold;">@hw</span> = HelloWorld.<span style="color:#9900CC;">new</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;!-- app/views/pages/hello.html.erb --&gt;
&lt;p&gt;&lt;%= @hw.hi %&gt;&lt;/p&gt;</pre></div></div>

<img src="http://feeds.feedburner.com/~r/PagesFromMyHead/~4/2wSxVCe7RyY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.craig-russell.co.uk/how-to-create-and-test-a-ruby-on-rails-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.craig-russell.co.uk/how-to-create-and-test-a-ruby-on-rails-plugin/</feedburner:origLink></item>
		<item>
		<title>Learning Ruby and Ruby on Rails</title>
		<link>http://feedproxy.google.com/~r/PagesFromMyHead/~3/uqA5OTJL1SU/</link>
		<comments>http://www.craig-russell.co.uk/learning-ruby-and-ruby-on-rails/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 10:21:11 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.craig-russell.co.uk/?p=962</guid>
		<description><![CDATA[I&#8217;ve been wanting to learn ruby and rails for a while now. But my previous efforts haven&#8217;t worked out well. These past few weeks I&#8217;ve committed to finally getting a reasonable grasp on this technology. I&#8217;ve used a few different resources and picked up a couple of tips en-route, which I share for you here&#8230;]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been wanting to learn ruby and rails for a while now. But my previous efforts haven&#8217;t worked out well. These past few weeks I&#8217;ve committed to finally getting a reasonable grasp on this technology. I&#8217;ve used a few different resources and picked up a couple of tips en-route, which I share for you here.</p>
<h2>Installing Everything</h2>
<p>I&#8217;ve tried and failed to install Ruby and Rails before, on one occasion I completely frigged my <del>L</del>AMP stack. I run Ubuntu on my laptop and this is the guide that worked for me.</p>
<p><a href="http://blog.sudobits.com/2011/10/27/how-to-install-ruby-on-rails-in-ubuntu-11-10/" target="_blank">How to install Ruby on Rails in Ubuntu 11.10</a></p>
<p>Having installed everything, you might notice that the Ruby version swaps back to 1.8.7 with every new session. You can set the default version of Ruby by running this command.</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">$ rvm --default use 1.9.2</pre></div></div>

<h2>Starting With Ruby</h2>
<p>Before starting with Rails, it&#8217;s well worth having a good grasp of Ruby. I found these two tutorials very helpful. The first is ideal if (like me) you&#8217;ve never written a line of ruby. The second is a tour-de-force around the language.</p>
<p><a href="http://www.ruby-lang.org/en/documentation/quickstart/" target="_blank">Ruby in 20 Minutes</a></p>
<p><a href="http://rubykoans.com/" target="_blank">Ruby Koans</a></p>
<p>When working through the Koans, have an interactive ruby console open to try out things as you learn them. You can open a Ruby console like this:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">$ irb</pre></div></div>

<h2>Starting With Ruby on Rails</h2>
<p>Once you&#8217;re up-to-speed with Ruby, you can start dipping your toe in to Rails. I&#8217;ve not spent much time with Rails yet, but so-far, I&#8217;ve found these resources very useful.</p>
<p><a href="http://guides.rubyonrails.org/getting_started.html" target="_blank">Getting Started With Rails</a></p>
<p>This is a short exercise that takes you through the basics of Rails while building a simple blog platform.</p>
<p><a href="http://ruby.railstutorial.org/chapters/beginning#top" title="Rails Tutorial">Rails Tutorial</a></p>
<p>You should definitely take the time to work your way through the Rails Tutorial. The course covers all areas of the framework (including versioning with <a href="http://git-scm.com/" title="Git">Git</a>, unit testing with <a href="http://rspec.info/" title="RSpec">RSpec</a> and deploying to <a href="http://www.heroku.com/" title="Heroku">Heroku</a>) on the way to building a Twitteresq micro-blogging app. The author suggests that no prior knowledge of ruby is needed, but personally I found it better to work through the Ruby Koans first to better separate the Ruby from the Rails in my mind.</p>
<h2>Resources</h2>
<p><a href="http://railsapi.com/doc/rails-v3.0.8rc1_ruby-v1.9.2/" target="_blank">Rails API</a></p>
<p>A complete reference for the Rails API and the Ruby language.</p>
<p><a href="http://www.phptoruby.com/" target="_blank">PHP to Ruby</a></p>
<p>If you&#8217;re coming to Ruby from PHP (as I am) this site is your bi-lingual dictionary.</p>
<img src="http://feeds.feedburner.com/~r/PagesFromMyHead/~4/uqA5OTJL1SU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.craig-russell.co.uk/learning-ruby-and-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.craig-russell.co.uk/learning-ruby-and-ruby-on-rails/</feedburner:origLink></item>
		<item>
		<title>Data Mining – Harder Than it Should Be</title>
		<link>http://feedproxy.google.com/~r/PagesFromMyHead/~3/VAPtfpwmOnI/</link>
		<comments>http://www.craig-russell.co.uk/data-mining-harder-than-it-should-be/#comments</comments>
		<pubDate>Wed, 12 Oct 2011 08:21:47 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
				<category><![CDATA[Comment]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.craig-russell.co.uk/?p=949</guid>
		<description><![CDATA[I&#8217;ve recently finished an MSc in Intelligent Systems at De Montfort University (I passed with distinction &#8211; thanks for asking). One module of the course was devoted to using Data Mining techniques to explore data sets. Data Mining differs from the more common analysis of data. Commonly a data set may be analysed statistically, looking&#8230;]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently finished an <a href="http://www.cse.dmu.ac.uk/msccir/" target="_blank">MSc in Intelligent Systems at De Montfort University</a> (I passed with distinction &#8211; thanks for asking). One module of the course was devoted to using Data Mining techniques to explore data sets. Data Mining differs from the more common analysis of data. Commonly a data set may be analysed statistically, looking for the distribution of this or calculating the rate of change in that, whereas applying data mining techniques can expose otherwise obscure patterns in the data. Or to put it another way: using statistics you are asking the data what to show, but Data Mining reveals to you what the data has.</p>
<p>As part of the course we used one of the major data mining products on the market. As an class of Masters Degree students, learning about the subtle intricacies of our chosen subject, the product served us well. We were able to tweak and twiddle with more switches than a 747. We had the luxury of time to run, re-run, rinse and repeat data processing over and over. I&#8217;m equally sure that for professional data mining consultants, hired by large wealthy companies to trawl vast private data repositories, these products are worth the thousands of pounds of license fees they pay.</p>
<p>But what about everyone else? What about the campaigns <a href="http://www.freeourdata.org.uk/" target="_blank">working to holding government to account over public data</a>? What about the new-breed of <a href="http://www.guardian.co.uk/news/datablog/2011/jul/28/data-journalism" target="_blank">data journalist exposing stories otherwise hidden in obscure facts and figures</a>? What about the <a href="http://buzzdata.com/about" target="_blank">data evangelists enlightening and entertaining with wonderful visualisations</a>? How accessible is data mining for these people? How affordable? How usable?</p>
<p>Not enough.</p>
<p>With increasingly more data being placed in the public domain, so increases the need for tools to explore this data. Data Mining tools are out there, but are no-where-near as accessible as the data that requires them.</p>
<p>It is with this in mind that I have begun to develop an accessible, usable and intuitive suite of tools to explore data sets. The first of these, <a href="http://clusterbombapp.com" target="_blank">Clusterbomb</a>, will mine data sets to expose the hidden clusters of records buried within. I&#8217;m expecting to have an alpha release out early next year, but for now <a href="http://clusterbombapp.com" target="_blank">sign up to the mailing list</a> to keep an eye on developments. Clusterbomb is also on <a href="http://twitter.com/clusterbombapp" target="_blank">Twitter</a> and <a href="http://facebook.com/clusterbombapp/" target="_blank">Facebook</a>.</p>
<blockquote><p>❝To be ahead of the rest, you need to see more than they do❞</p></blockquote>
<img src="http://feeds.feedburner.com/~r/PagesFromMyHead/~4/VAPtfpwmOnI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.craig-russell.co.uk/data-mining-harder-than-it-should-be/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.craig-russell.co.uk/data-mining-harder-than-it-should-be/</feedburner:origLink></item>
		<item>
		<title>Bang Bang – Command Recall in Linux</title>
		<link>http://feedproxy.google.com/~r/PagesFromMyHead/~3/mLcLtqhXW-Q/</link>
		<comments>http://www.craig-russell.co.uk/bang-bang-command-recall-in-linux/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 15:53:09 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.craig-russell.co.uk/?p=930</guid>
		<description><![CDATA[The loveliness that is the Linux shell has buried in it a billion little nuggets of hyper efficiency. I&#8217;ve been learning about the bang history commands, which are a great way to save time when running the similar commands over and over (more thorough documentation here). Repeating Commands Repeat last command !! Repeat last command&#8230;]]></description>
			<content:encoded><![CDATA[<p>The loveliness that is the Linux shell has buried in it a billion little nuggets of hyper efficiency. I&#8217;ve been learning about the bang history commands, which are a great way to save time when running the similar commands over and over (<a href="http://www.softpanorama.org/Scripting/Shellorama/bash_command_history_reuse.shtml">more thorough documentation here</a>).</p>
<h2>Repeating Commands</h2>
<p>Repeat last command</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">!!</pre></div></div>

<p>Repeat last command that started with <em>x</em></p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">!x</pre></div></div>

<p>Repeat last command that has the substring <em>x</em></p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">!?x</pre></div></div>

<p>Repeat 10th command in the history file</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">!10</pre></div></div>

<p>Repeat 10th from last command in the history file</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">!-10</pre></div></div>

<h2>Fetching Parameters</h2>
<p>Fetch parameters from last command</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">!!*</pre></div></div>

<p>Fetch first parameter from last command</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">!!^</pre></div></div>

<p>Fetch last parameter from last command</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">!!$</pre></div></div>

<p>Fetch third parameter from last command</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">!!3</pre></div></div>

<h2>Modifiers</h2>
<p>Repeat last command substituting <em>foo</em> for <em>bar</em></p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">!!:s/foo/bar/</pre></div></div>

<p>Print last command without running it</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">!!:p</pre></div></div>

<img src="http://feeds.feedburner.com/~r/PagesFromMyHead/~4/mLcLtqhXW-Q" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.craig-russell.co.uk/bang-bang-command-recall-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.craig-russell.co.uk/bang-bang-command-recall-in-linux/</feedburner:origLink></item>
	</channel>
</rss>

