<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Keep Within the Lines</title>
	<atom:link href="http://keepwithinthelines.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://keepwithinthelines.wordpress.com</link>
	<description>Hey, who says this is just another Rails blog?</description>
	<lastBuildDate>Fri, 20 Feb 2009 18:54:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='keepwithinthelines.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Keep Within the Lines</title>
		<link>http://keepwithinthelines.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://keepwithinthelines.wordpress.com/osd.xml" title="Keep Within the Lines" />
	<atom:link rel='hub' href='http://keepwithinthelines.wordpress.com/?pushpress=hub'/>
		<item>
		<title>96Methods.com</title>
		<link>http://keepwithinthelines.wordpress.com/2009/02/20/96methodscom/</link>
		<comments>http://keepwithinthelines.wordpress.com/2009/02/20/96methodscom/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 18:54:00 +0000</pubDate>
		<dc:creator>gblake</dc:creator>
				<category><![CDATA[Develop]]></category>

		<guid isPermaLink="false">http://keepwithinthelines.wordpress.com/?p=33</guid>
		<description><![CDATA[Ok, I finally have my own site being hosted. It&#8217;s mainly a blog but may have some examples of the things I&#8217;ve been working on in the not-too-distant future. It&#8217;s not perfect, but it&#8217;s mine. The posts on this blog will, therefore, now come to an end, unless I manage to screw-up the new site. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=keepwithinthelines.wordpress.com&amp;blog=2866468&amp;post=33&amp;subd=keepwithinthelines&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ok, I finally have my own site being hosted. It&#8217;s mainly a blog but may have some examples of the things I&#8217;ve been working on in the not-too-distant future.</p>
<p>It&#8217;s not perfect, but it&#8217;s mine. The posts on this blog will, therefore, now come to an end, unless I manage to screw-up the new site.</p>
<p>The new site can be found at: <a href="http://www.96methods.com">96methods.com</a>. Please come and take a look.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/keepwithinthelines.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/keepwithinthelines.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/keepwithinthelines.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/keepwithinthelines.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/keepwithinthelines.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/keepwithinthelines.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/keepwithinthelines.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/keepwithinthelines.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/keepwithinthelines.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/keepwithinthelines.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/keepwithinthelines.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/keepwithinthelines.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/keepwithinthelines.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/keepwithinthelines.wordpress.com/33/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=keepwithinthelines.wordpress.com&amp;blog=2866468&amp;post=33&amp;subd=keepwithinthelines&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://keepwithinthelines.wordpress.com/2009/02/20/96methodscom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/908616fee75aec26332a5cc56d2e4eed?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gblake</media:title>
		</media:content>
	</item>
		<item>
		<title>Small Worlds</title>
		<link>http://keepwithinthelines.wordpress.com/2008/11/20/small-worlds/</link>
		<comments>http://keepwithinthelines.wordpress.com/2008/11/20/small-worlds/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 19:23:07 +0000</pubDate>
		<dc:creator>gblake</dc:creator>
				<category><![CDATA[Virtual Worlds]]></category>

		<guid isPermaLink="false">http://keepwithinthelines.wordpress.com/?p=25</guid>
		<description><![CDATA[I apologise for the rambling nature of this post. I began writing it some weeks ago and felt that I should just get it posted as otherwise it would just sit for several more weeks. So, Small Worlds&#8230;.. Or more to the point, Virtual Worlds. Virtual worlds such as Second Life, Google&#8217;s Lively (although not [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=keepwithinthelines.wordpress.com&amp;blog=2866468&amp;post=25&amp;subd=keepwithinthelines&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I apologise for the rambling nature of this post. I began writing it some weeks ago and felt that I should just get it posted as otherwise it would just sit for several more weeks. So, Small Worlds&#8230;..</p>
<p>Or more to the point, Virtual Worlds. Virtual worlds such as Second Life, Google&#8217;s Lively (<a href="http://googleblog.blogspot.com/2008/11/lively-no-more.html">although not for much longer</a>), <a href="http://www.there.com">There</a>, etc. I perhaps somewhat naively think that these things are going to be the next big thing on the web, or if not the next big thing then the next big thing after that. I think that the potential for creativity, remote working, entertainment, work, distance learning, collaboration and communication is huge.</p>
<p>I am however a little concerned that the sheer number of virtual world providers with their closed standards (or lack of standards) could mean that we won&#8217;t be able to settle on a specific platform and that we&#8217;ll end up with a number of non-integrating virtual worlds.</p>
<p>There are a large number of, for want of a better expression, virtual world sites out there at the moment and they all seem to have boundaries to creativity. Take Second Life as a first example. It would be great if 3D models produced using a 3D modelling package (Blender, 3D Studio Max, etc.) could be imported into Second Life but I don&#8217;t believe that this is currently possible. Instead the in-world tools must be used. Some of the newer virtual worlds are in beta phase still and there&#8217;s no way for your average user to create content, they must rely upon existing models. This applies to Google&#8217;s Lively and <a href="http://www.smallworlds.com">Small Worlds</a>.</p>
<p>On the subject of Small Worlds this world seems to be more of a game (and a world full of games) in itself rather than a place where business may be conducted. Small Worlds is in Beta and, currently, there&#8217;s no way of obtaining currency with which to purchase things unless you perform various tasks. For example, you have a small amount of currency, or credits, when you first enter the world and receive further credits when you complete a task or mission. These missions cover some of the basic tasks that you may want to perform such as visiting a shop to buy a sofa for your room or making a simplistic drawing on a whiteboard. The missions are good in that they offer a number of things to do for the newbie and essentially provide training in a fun way so that the new user can get to know how to achieve things in the virtual world. However I feel like it&#8217;s akin to jumping through hoops to receive a reward.</p>
<p>I&#8217;ve recently gained an invite to the <a href="http://www.metaplace.com">Metaplace</a> world beta but I&#8217;ve not had much chance to take a really good look at it yet. My initial impressions are that it&#8217;s a bit like Small Worlds, has the same isometric 3D viewing system, but the existing objects seem to have very little interactions available. I&#8217;ve spent a very short time playing with There and perhaps should go back and take a further look.</p>
<p>One rather exciting possibility is <a href="https://lg3d-wonderland.dev.java.net/">Sun&#8217;s Wonderland project</a>. I became aware of Wonderland because some of the folks at work are beginning to experiment with it. As far as I&#8217;m aware hosting of the world would have to be arranged but the potential seems big as the project is open source, content can be created and the behaviours behind objects can be extended or even completely written as far as I can deduce. The server and client are both written in Java and it even supports voice communication.</p>
<p>What I want is something like Second Life where it&#8217;s possible to buy some land and start making things, such as buildings and the interiors of those buildings, but with the ability to produce the models of these objects outside of the virtual world and to then import into the world. If anyone knows of such a place please let me know. I may return to Second Life one of these days and look into getting a piece of land for myself. Why do I want this? Well to keep my options open and to explore what might be the future of the web.</p>
<p>A possible future post: Are the Virtual Worlds one way of getting off the current consumer bandwagon? Shifting consumer greed (my own included) from desiring real world (energy greedy and resource greedy) possessions to virtual world possessions?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/keepwithinthelines.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/keepwithinthelines.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/keepwithinthelines.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/keepwithinthelines.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/keepwithinthelines.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/keepwithinthelines.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/keepwithinthelines.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/keepwithinthelines.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/keepwithinthelines.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/keepwithinthelines.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/keepwithinthelines.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/keepwithinthelines.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/keepwithinthelines.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/keepwithinthelines.wordpress.com/25/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=keepwithinthelines.wordpress.com&amp;blog=2866468&amp;post=25&amp;subd=keepwithinthelines&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://keepwithinthelines.wordpress.com/2008/11/20/small-worlds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/908616fee75aec26332a5cc56d2e4eed?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gblake</media:title>
		</media:content>
	</item>
		<item>
		<title>Drupal versus ?</title>
		<link>http://keepwithinthelines.wordpress.com/2008/08/31/drupal-versus/</link>
		<comments>http://keepwithinthelines.wordpress.com/2008/08/31/drupal-versus/#comments</comments>
		<pubDate>Sun, 31 Aug 2008 18:28:30 +0000</pubDate>
		<dc:creator>gblake</dc:creator>
				<category><![CDATA[Meaningless Drivel]]></category>

		<guid isPermaLink="false">http://keepwithinthelines.wordpress.com/?p=19</guid>
		<description><![CDATA[I&#8217;ve wanted to get this little blog of mine hosted without having to rely upon the somewhat limiting wordpress.com domain name. I don&#8217;t think that I can change the style of this site unless I have it hosted with a host of my choice. I could use Rails to support the backend of the site [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=keepwithinthelines.wordpress.com&amp;blog=2866468&amp;post=19&amp;subd=keepwithinthelines&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve wanted to get this little blog of mine hosted without having to rely upon the somewhat limiting wordpress.com domain name. I don&#8217;t think that I can change the style of this site unless I have it hosted with a host of my choice. I could use Rails to support the backend of the site but this seems like total overkill and someone at my place of work suggested that take a look at the Drupal CMS. I installed Drupal on my PC but I&#8217;ve not really had time to play with it during the past few weeks. It seems incredibly powerful but it also looks like there is a very big learning curve and frankly I can do without that right now.</p>
<p>I was just flicking through an old issue of .net magazine (known as Practical Web Design outside of the UK) and found an article on building WordPress themes. It seems the obvious solution. I guess that I saw WordPress simply as a blogging tool, but hey, what is my site going to be? Well a blog and somewhere to experiment a little so WordPress should be fine for now.</p>
<p>Sorry Drupal, you seem like an excellent CMS but I just don&#8217;t have the time to figure out how to tame you.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/keepwithinthelines.wordpress.com/19/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/keepwithinthelines.wordpress.com/19/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/keepwithinthelines.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/keepwithinthelines.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/keepwithinthelines.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/keepwithinthelines.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/keepwithinthelines.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/keepwithinthelines.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/keepwithinthelines.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/keepwithinthelines.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/keepwithinthelines.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/keepwithinthelines.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/keepwithinthelines.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/keepwithinthelines.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/keepwithinthelines.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/keepwithinthelines.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=keepwithinthelines.wordpress.com&amp;blog=2866468&amp;post=19&amp;subd=keepwithinthelines&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://keepwithinthelines.wordpress.com/2008/08/31/drupal-versus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/908616fee75aec26332a5cc56d2e4eed?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gblake</media:title>
		</media:content>
	</item>
		<item>
		<title>Ubuntu goes Desktop</title>
		<link>http://keepwithinthelines.wordpress.com/2008/07/31/ubuntu-goes-desktop/</link>
		<comments>http://keepwithinthelines.wordpress.com/2008/07/31/ubuntu-goes-desktop/#comments</comments>
		<pubDate>Thu, 31 Jul 2008 20:30:32 +0000</pubDate>
		<dc:creator>gblake</dc:creator>
				<category><![CDATA[OS]]></category>

		<guid isPermaLink="false">http://keepwithinthelines.wordpress.com/?p=17</guid>
		<description><![CDATA[Well I&#8217;ve now got around to getting myself a new hard drive for my desktop PC and I&#8217;ve installed Ubuntu 8.04 on it. Actually managed to get my Netgear wireless device working and, therefore, my wireless connection working fairly quickly (thanks to the Ubuntu forum). I&#8217;ve also got Aptana Studio working, Rails working, I&#8217;ve even [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=keepwithinthelines.wordpress.com&amp;blog=2866468&amp;post=17&amp;subd=keepwithinthelines&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Well I&#8217;ve now got around to getting myself a new hard drive for my desktop PC and I&#8217;ve installed Ubuntu 8.04 on it. Actually managed to get my Netgear wireless device working and, therefore, my wireless connection working fairly quickly (thanks to the Ubuntu forum). I&#8217;ve also got Aptana Studio working, Rails working, I&#8217;ve even got Subversion config. control working and my Rails project checked in. Wow!</p>
<p>I bookmarked some of the Ubuntu forum pages that helped me configure my system for wireless net access but looking at them now I can&#8217;t remember which ones I used. So much for documenting my &#8216;process&#8217;!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/keepwithinthelines.wordpress.com/17/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/keepwithinthelines.wordpress.com/17/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/keepwithinthelines.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/keepwithinthelines.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/keepwithinthelines.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/keepwithinthelines.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/keepwithinthelines.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/keepwithinthelines.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/keepwithinthelines.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/keepwithinthelines.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/keepwithinthelines.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/keepwithinthelines.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/keepwithinthelines.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/keepwithinthelines.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/keepwithinthelines.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/keepwithinthelines.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=keepwithinthelines.wordpress.com&amp;blog=2866468&amp;post=17&amp;subd=keepwithinthelines&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://keepwithinthelines.wordpress.com/2008/07/31/ubuntu-goes-desktop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/908616fee75aec26332a5cc56d2e4eed?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gblake</media:title>
		</media:content>
	</item>
		<item>
		<title>Ubuntu</title>
		<link>http://keepwithinthelines.wordpress.com/2008/05/27/ubuntu/</link>
		<comments>http://keepwithinthelines.wordpress.com/2008/05/27/ubuntu/#comments</comments>
		<pubDate>Tue, 27 May 2008 19:00:31 +0000</pubDate>
		<dc:creator>gblake</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://keepwithinthelines.wordpress.com/?p=14</guid>
		<description><![CDATA[I initially installed Ubuntu on my laptop some months ago, maybe even as long ago as a year or more. I didn&#8217;t use it. It wasn&#8217;t that I didn&#8217;t want to use it, on the contrary; I wanted to break the grip that MS Windows had on me. I wanted to try out an operating [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=keepwithinthelines.wordpress.com&amp;blog=2866468&amp;post=14&amp;subd=keepwithinthelines&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I initially installed Ubuntu on my laptop some months ago, maybe even as long ago as a year or more. I didn&#8217;t use it. It wasn&#8217;t that I didn&#8217;t want to use it, on the contrary; I wanted to break the grip that MS Windows had on me. I wanted to try out an operating system that wouldn&#8217;t, I hoped, have my PC whirring away for the first 5 or 10 minutes following boot-up, 5 or 10 minutes where I could do nothing but sit and wait. Now I have to admit that this problem only occurred on my laptop which only has something like 512Mb of memory and I blame some of the problems on my Zone Alarm anti-virus/firewall software. But I hoped for a better world, free of Windows.</p>
<p>So back to the reason for not using Ubuntu initially. Well both of my PCs connect to the internet via a wireless connection, even my desktop PC. The problem with Ubuntu was that it didn&#8217;t want to talk to my wireless router. If I connected my computer to the router using an ethernet cable all was fine and I could access the internet but not so via a wireless connection. I gave up on it. I just couldn&#8217;t be bothered trying to get it to work. Didn&#8217;t have time, couldn&#8217;t find the patience and so that was that. Until recently.</p>
<p>I&#8217;ve just spent a bank holiday weekend getting the wireless connection working (well just a few hours last Friday evening) and getting Ruby on Rails up and running. As I write this entry I&#8217;ve managed to port my current rails project from Windows to Ubuntu and it all seems to work!! Yay!</p>
<p>My problem now is can I repeat what I&#8217;ve just done? Can I install Ubuntu on my desktop PC and repeat my success that I had with my laptop? All I can say is that it wasn&#8217;t easy. A lot of time was spent searching with Google to find out how to install software, how to configure things and what Linux commands were available to copy files, navigate directories, etc. Foolishly, I didn&#8217;t make any notes as I went along, so all I&#8217;ve got to go on is a small number of bookmarked web pages and my instinct. I might purchase a second hard-drive for my desktop PC and get Ubuntu installed on that. I will attempt to make notes along the way next time and perhaps those notes will find their way onto this blog.</p>
<p>I bet that you can&#8217;t wait, dear reader!!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/keepwithinthelines.wordpress.com/14/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/keepwithinthelines.wordpress.com/14/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/keepwithinthelines.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/keepwithinthelines.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/keepwithinthelines.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/keepwithinthelines.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/keepwithinthelines.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/keepwithinthelines.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/keepwithinthelines.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/keepwithinthelines.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/keepwithinthelines.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/keepwithinthelines.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/keepwithinthelines.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/keepwithinthelines.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/keepwithinthelines.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/keepwithinthelines.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=keepwithinthelines.wordpress.com&amp;blog=2866468&amp;post=14&amp;subd=keepwithinthelines&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://keepwithinthelines.wordpress.com/2008/05/27/ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/908616fee75aec26332a5cc56d2e4eed?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gblake</media:title>
		</media:content>
	</item>
		<item>
		<title>boagworld</title>
		<link>http://keepwithinthelines.wordpress.com/2008/04/28/boagworld/</link>
		<comments>http://keepwithinthelines.wordpress.com/2008/04/28/boagworld/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 19:09:30 +0000</pubDate>
		<dc:creator>gblake</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://keepwithinthelines.wordpress.com/?p=13</guid>
		<description><![CDATA[What the blazes has happened to the BoagWorld site? There&#8217;s now some kind of landing page with just a notice about the return of the podcast on 7th May and a link to a Wikipedia entry. I&#8217;ve not visited the site for a week or two so I don&#8217;t know if there was any notice, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=keepwithinthelines.wordpress.com&amp;blog=2866468&amp;post=13&amp;subd=keepwithinthelines&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>What the blazes has happened to the <a href="http://boagworld.com">BoagWorld</a> site? There&#8217;s now some kind of landing page with just a notice about the return of the podcast on 7th May and a link  to a Wikipedia entry. I&#8217;ve not visited the site for a week or two so I don&#8217;t know if there was any notice, although Paul Boag did, I think, say that the <a href="http://boagworld.com">BoagWorld</a> site was going to be re-branded as well as their <a href="http://www.headscape.co.uk">Headscape</a> site.</p>
<p>Oh well, I guess we&#8217;ll have to see what develops&#8230;</p>
<p>If you&#8217;ve not visited the <a href="http://boagworld.com">BoagWorld </a>site I highly recommend it, and their podcast is one of the best, if not the best, on web design / development.</p>
<p>*edit* They&#8217;re back and looking good!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/keepwithinthelines.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/keepwithinthelines.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/keepwithinthelines.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/keepwithinthelines.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/keepwithinthelines.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/keepwithinthelines.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/keepwithinthelines.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/keepwithinthelines.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/keepwithinthelines.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/keepwithinthelines.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/keepwithinthelines.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/keepwithinthelines.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/keepwithinthelines.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/keepwithinthelines.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/keepwithinthelines.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/keepwithinthelines.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=keepwithinthelines.wordpress.com&amp;blog=2866468&amp;post=13&amp;subd=keepwithinthelines&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://keepwithinthelines.wordpress.com/2008/04/28/boagworld/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/908616fee75aec26332a5cc56d2e4eed?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gblake</media:title>
		</media:content>
	</item>
		<item>
		<title>To Do</title>
		<link>http://keepwithinthelines.wordpress.com/2008/04/12/to-do/</link>
		<comments>http://keepwithinthelines.wordpress.com/2008/04/12/to-do/#comments</comments>
		<pubDate>Sat, 12 Apr 2008 11:09:52 +0000</pubDate>
		<dc:creator>gblake</dc:creator>
				<category><![CDATA[Meaningless Drivel]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://keepwithinthelines.wordpress.com/?p=10</guid>
		<description><![CDATA[I followed one of my RSS feeds yesterday to the TechCrunch site where there was an article that speculated as to whether or not Google are working on a To Do List app. From this article I then visited one or two more articles from TechCrunch about To Do List products. From reading the articles [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=keepwithinthelines.wordpress.com&amp;blog=2866468&amp;post=10&amp;subd=keepwithinthelines&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I followed one of my RSS feeds yesterday to the TechCrunch site where there was an <a title="Google To Do List Product" href="http://www.techcrunch.com/2008/04/11/google-launching-todo-list-product/">article</a> that speculated as to whether or not Google are working on a To Do List app. From this article I then visited one or two more <a title="TechCrunch To Do List Article" href="http://www.techcrunch.com/2006/05/08/do-more-online-to-do-lists-compared/">articles </a>from TechCrunch about To Do List products. From reading the articles it becomes immediately obvious that there are an awful lot of these types of site out there. I&#8217;ve not tried out very many of these sites but they all seem to allow the user to create a to do list, tick stuff off your list, add more items, etc. Some allow only one list to be created, some allow more than one, some have an Ajax-style front end so that you can perform actions such as drag-and-drop but there doesn&#8217;t seem to be a great deal of difference between a lot of them.</p>
<p>For some time now I&#8217;ve wanted to create my own To Do List site. Well not just a plain to do list site, something a little more specific than that maybe. After I&#8217;d read those TechCrunch articles yesterday I began to wonder why I should bother though. What would my little site add, if anything, to the growing number of similar sites? Surely it would just get lost in all of the noise? Well that may be true, perhaps there really is no point in adding another To Do site. After mulling this over for a while I came to the conclusion that I should continue to produce my own site and I came to this conclusion for a couple of reasons.</p>
<p>I&#8217;m trying to learn Ruby on Rails and want to produce some form of web site fairly soon. Even if I&#8217;m just adding another To Do-type app. to the masses that already exist I will be learning from the experience. That&#8217;s the first good thing that would come from it. Secondly, my original concept for my site wasn&#8217;t just to produce a web-based To Do list application. As I had the idea several years ago I can&#8217;t quite remember my very first idea but I think that the To Do scenario was something I thought of adding to the site to make it a little more acceptable to people who might use it in the office, allowing them to plan their tasks and plan their day. So my idea isn&#8217;t just to create a To Do list site but it would allow the user to make lists of actions and enable them to group actions into projects. For some reason something is stopping me from actually writing about the exact nature of my planned site, almost as if I think that someone is going to steal my idea and make lots of money from it which, quite honestly, is never going to happen. If I told you right now what this idea was you&#8217;d probably think, &#8220;Oh, is that <em>it</em>!?&#8221;, or, &#8220;So it&#8217;s basically just a to do list with a bit of pointless extra stuff?&#8221;. Indeed you may have a point but I&#8217;m going to continue regardless anyway!</p>
<p>I could now spend ages coming up with a design for the site and researching into various topics (such as <a title="Getting Things Done" href="http://en.wikipedia.org/wiki/Getting_things_done">GTD</a>) but I feel that it&#8217;s time for me to simply sit down and get something produced. Currently I think that I shall get a simple site produced and get it hosted so that it&#8217;s out there. Then I&#8217;ll add some more functionality to it. But right now the key is to stop procrastinating and get something developed.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/keepwithinthelines.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/keepwithinthelines.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/keepwithinthelines.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/keepwithinthelines.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/keepwithinthelines.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/keepwithinthelines.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/keepwithinthelines.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/keepwithinthelines.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/keepwithinthelines.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/keepwithinthelines.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/keepwithinthelines.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/keepwithinthelines.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/keepwithinthelines.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/keepwithinthelines.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/keepwithinthelines.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/keepwithinthelines.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=keepwithinthelines.wordpress.com&amp;blog=2866468&amp;post=10&amp;subd=keepwithinthelines&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://keepwithinthelines.wordpress.com/2008/04/12/to-do/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/908616fee75aec26332a5cc56d2e4eed?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gblake</media:title>
		</media:content>
	</item>
		<item>
		<title>&lt;code&gt;</title>
		<link>http://keepwithinthelines.wordpress.com/2008/04/05/code/</link>
		<comments>http://keepwithinthelines.wordpress.com/2008/04/05/code/#comments</comments>
		<pubDate>Sat, 05 Apr 2008 10:44:57 +0000</pubDate>
		<dc:creator>gblake</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://keepwithinthelines.wordpress.com/?p=9</guid>
		<description><![CDATA[Well this is damned annoying!!! Grrrrr&#8230;&#8230;. Whenever I add a block of code to one of my posts WordPress seems to screw it up. It might be that I&#8217;m doing something stupid myself of course. I think this issue will be seen by anyone who reads these posts which is even more frustrating. If I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=keepwithinthelines.wordpress.com&amp;blog=2866468&amp;post=9&amp;subd=keepwithinthelines&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Well this is damned annoying!!! Grrrrr&#8230;&#8230;.</p>
<p>Whenever I add a block of code to one of my posts WordPress seems to screw it up. It might be that I&#8217;m doing something stupid myself of course.</p>
<p>I think this issue will be seen by anyone who reads these posts which is even more frustrating. If I view a page containing a code block, navigate away from that page to a different post and then back to the original the code block seems to have magically added blank lines between each line of code. I can only assume that this is a WordPress bug of some kind; I did a Google search some weeks ago about this problem but didn&#8217;t find any actual solution. I thought that I&#8217;d solved it by adding &lt;pre&gt;&lt;/pre&gt; markup but it would seem not.</p>
<p>Oh, I&#8217;ve also changed the theme as I was sick of having my lines of code cut-off due to having a very small column width.</p>
<p>Maybe one day I&#8217;ll get my blog hosted and write my own blog platform!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/keepwithinthelines.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/keepwithinthelines.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/keepwithinthelines.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/keepwithinthelines.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/keepwithinthelines.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/keepwithinthelines.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/keepwithinthelines.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/keepwithinthelines.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/keepwithinthelines.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/keepwithinthelines.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/keepwithinthelines.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/keepwithinthelines.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/keepwithinthelines.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/keepwithinthelines.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/keepwithinthelines.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/keepwithinthelines.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=keepwithinthelines.wordpress.com&amp;blog=2866468&amp;post=9&amp;subd=keepwithinthelines&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://keepwithinthelines.wordpress.com/2008/04/05/code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/908616fee75aec26332a5cc56d2e4eed?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gblake</media:title>
		</media:content>
	</item>
		<item>
		<title>Login Routine: A 1st Attempt</title>
		<link>http://keepwithinthelines.wordpress.com/2008/04/05/login-routine-a-1st-attempt/</link>
		<comments>http://keepwithinthelines.wordpress.com/2008/04/05/login-routine-a-1st-attempt/#comments</comments>
		<pubDate>Sat, 05 Apr 2008 10:00:02 +0000</pubDate>
		<dc:creator>gblake</dc:creator>
				<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://keepwithinthelines.wordpress.com/?p=7</guid>
		<description><![CDATA[So I have started to convert my PHP-based issue tracker application to a Rails-based version. When the users of the issue tracker access the site the first thing that they must do is login. This is achieved with a simple form where they supply their username and their password. I was looking at my copy [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=keepwithinthelines.wordpress.com&amp;blog=2866468&amp;post=7&amp;subd=keepwithinthelines&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So I have started to convert my PHP-based issue tracker application to a Rails-based version. When the users of the issue tracker access the site the first thing that they must do is login. This is achieved with a simple form where they supply their username and their password. I was looking at my copy of <a href="http://www.pragprog.com/titles/rails2">Agile Web Development with Rails</a> to see how to handle the user login routine. The snippets of code that follow have either been taken directly from this book or have been very heavily influenced by it. Oh, by the way, I&#8217;ve tried most of this code but some of it hasn&#8217;t been (the user registration bit in particular) so beware. I have asked myself the question, &#8220;Why am I spending my time writing this blog entry when I only seem to be copying an example from a book?&#8221;. I think the answer is that it has helped me to understand how this user login routine works and it&#8217;s helped me come to terms with some of the Ruby / Rails concepts, such as the use of virtual attributes and the use of hash algorithms. I&#8217;m only really reproducing snippets of code from the book and not swathes of the actual text (the book is obviously far, far better than explaining than I am!) and the code has been changed my myself a little. Right, back to the code.</p>
<p>I had defined all of the models for the issue tracker app. a little while ago and my User model already had a password field but I wanted to change this to a field named <code>hashed_password</code>, so I created a migration to achieve this. I also created another migration to create a field named <code>salt</code>. Yes they could have been combined into just one migration to achieve this but it just didn&#8217;t happen that way.</p>
<p>OK, I&#8217;m not 100% sure of what a &#8216;salt&#8217; is and to be honest I don&#8217;t think that I need to know the full story. It seems to simply be a random bit pattern that can be combined with a plain text password to create a more secure password. You can perhaps, if you would like, take a look at the Wikipedia entry for a <a title="salt definition" href="http://en.wikipedia.org/wiki/Salt_(cryptography)">salt</a> to get further information.</p>
<p>The plain text password can be combined with this salt and then passed through a <a title="SHA definition" href="http://en.wikipedia.org/wiki/SHA_hash_functions">Secure Hash Algorithm (SHA)</a> to produce a 160-bit hash. This hashed password can then be stored in the database (stored in the string-type attribute named <code>hashed_password</code>); along with the salt value so that we can use it to recreate the hashed version of the password from the password that a user submits when they attempt to login to the site. The SHA that I&#8217;ve used is the Rails method named (<code>Digest::SHA1::</code>)<code>hexdigest</code>.</p>
<p>I&#8217;ll firstly talk about the code that is used to register a new user first before going on to look at the login procedure.</p>
<p>When our theoretical user first uses the site they will be asked to register as a new user. We will assume that this simply requires them to supply a username and a password. We won&#8217;t worry about details such as ensuring that the username is unique in this simplistic example. The password that the user supplies will need to be stored somewhere temporarily while the unencrypted password is given the hash treatment. To achieve this I added a virtual attribute to my existing model. A virtual attribute is basically a model attribute which is not stored in the database. I added this with the following code where getter and setter methods were defined in my model:</p>
<pre># The getter:
def password
 @password
end
# The setter:
def password=(pwd)
 @password = pwd (#1)
 return if pwd.blank?
 create_salt (#2)
 self.hashed_password = User.encrypt_password(pwd, self.salt) (#3)
end</pre>
<p>The setter is used by my account controller when the user registers. The code belonging to my registration action that sits within this controller follows:</p>
<pre>
# Create a new user object:
@user = User.new(params[:user])

# Has post been made and user saved?
if request.post? and @user.save
 flash.now[:notice] = 'You have registered successfully'
 redirect_to :controller =&gt; :issues, :action =&gt; :list
end</pre>
<p>The HTML from my registration view is as follows:</p>
<pre>&lt;% form_for :user do |form| %&gt;
 &lt;p&gt;
  &lt;label for="user_name"&gt;Enter a username:&lt;/label&gt;
  &lt;%= form.text_field :name %&gt;
 &lt;/p&gt;
 &lt;p&gt;
  &lt;label for="user_password"&gt;Enter a password:&lt;/label&gt;
  &lt;%= form.password_field :password %&gt;
 &lt;/p&gt;
 &lt;%= image_submit_tag('register.gif', :alt =&gt; 'Register') %&gt;
&lt;% end %&gt;</pre>
<p>Ok, so I&#8217;m still learning but I <em>think</em> that the setter method for my password attribute is probably called when the new User object is created (with the line  <code>@user = User.new(params[:user])</code> in the controller), as the data in the params hash would be used to initialise the User object data. However, being a little new to all of this, I&#8217;m not completely sure of this. If I am correct then, once the registration form has been submitted, the password setter function will be called and the plain-text password that the user entered will be passed to it. This password is assigned to an instance variable (#1 in the setter code seen above) and, provided that the password is not completely blank, the <code>create_salt</code> method is called to create a salt for us (#2) and finally the salt is passed to the <code>encrypt_password</code> method along with the plain-text version of the password and the resulting encrypted password is then assigned to the <code>hashed_password</code> model attribute that is finally saved in the database.</p>
<p>Here&#8217;s the code for the <code>create_salt</code> method which I added to my User model as a private method:</p>
<pre>def create_salt
 self.salt = self.object_id.to_s + rand.to_s
end</pre>
<p>Essentially this method takes the id of our user object, converts it to a string, creates a random number, converts this to a string and then joins the two strings before assigning the new string to the <code>salt</code> attribute. The use of the keyword <code>self</code> ensures that the attributes belonging to the current object are used. If self was omitted I believe that the variables would simply be treated as local variables (local to the <code>create_salt</code> method that is). I&#8217;ve pretty much taken this method verbatim from the book.</p>
<p>Next is the <code>encrypt_password</code> method which actually takes the plain-text password and the salt that was defined by the <code>create_salt</code> method, concatenates them together along with a bit of extra text and passes them to the hexdigest method:</p>
<pre>def self.encrypt_password(password, salt)
 # Join the unencrypted password and the salt:
 value_to_hash = password + 'addtomakemoretricky' + salt

 # Run through the SHA1 digest and return:
 Digest::SHA1::hexdigest(value_to_hash)
end</pre>
<p>This method was also defined in my User model as a private method.</p>
<h3>Login</h3>
<p>Once our user has successfully registered with the site they will need to login when they visit the site in the future. After the user has registered they would ideally be sent an email which gives them a link that will take them to a special first time login page. Once they have logged in for the first time the system would then fully activate the account for that user. This might help to prevent malicious scripts from registering invalid users. I have yet to write the Rails code to achieve however I have done something similar in PHP.</p>
<p>Anyway, on to the login process. Here&#8217;s a snippet of code from my view that I used to present the login form to the user:</p>
<pre>&lt;% form_tag do %&gt;
 &lt;p&gt;
  &lt;label for="name"&gt;Username:&lt;/label&gt;
  &lt;%= text_field_tag :name, params[:name] %&gt;
 &lt;/p&gt;
 &lt;p&gt;
  &lt;label for="password"&gt;Password:&lt;/label&gt;
  &lt;%= password_field_tag :password, nil %&gt;
 &lt;/p&gt;
 &lt;%= image_submit_tag('login.gif', :alt =&gt; 'Login') %&gt;
&lt;% end %&gt;</pre>
<p>You can see here that the <code>password_field_tag</code> method is using the <code>password</code> attribute.</p>
<p>Once the user has keyed-in their password and hit the submit button the controller takes over. My controller had the following code:</p>
<pre># Has the form been posted yet?
if request.post?
 # Check if the user details are valid:
 user = User.authenticate(params[:name], params[:password])
 # Valid user object returned?
 if user
  # Store the user's id in a session variable:
  session[:user_id] = user.id
  # Redirect to the main page
  redirect_to :controller =&gt; :issues, :action =&gt; :list
 else
  flash.now[:notice] = "Invalid username or password, please try again."
 end
end</pre>
<p>The first if statement checks that the form has been submitted (otherwise the block is skipped and the login view is shown). I then call my <code>authenticate</code> class method that belongs to my User class. If the <code>authenticate</code> method successfully returns a user object the id of this user is stored in a session and the user is redirected to my main page otherwise, if the authentication fails, the login page is shown again with a flash message.</p>
<p>Right, so the <code>authenticate</code> method takes the user&#8217;s username and plain-text password from our form&#8217;s params hash, but what happens then? Here&#8217;s the code from my model:</p>
<pre>def self.authenticate(username, password)
 user = self.find_by_username(username) # (1)
 if user
  if user.salt
   desired_password = encrypt_password(password, user.salt) # (2)
  end

  if user.hashed_password != desired_password # (3)
   user = nil
  end
 end
 # Return the user object
 user
end</pre>
<p>Essentially (1) we find the user in the database using the username that was entered at the form, if this username is found we then (2) encrypt the password that was entered at the form using the salt that was originally used for that user (during the registration process) and we then (3) compare the encrypted password that was derived from the login form with the encrypted password that was been stored in the database when the user registered. If they are the same we have not only found the user&#8217;s username but we also have the matching password and so we return the user object to the controller (which stores the user id in a session, etc.).</p>
<p>If you&#8217;ve read this post and actually found it to be useful in any way then please leave a comment letting me know. I&#8217;ve been quite surprised that this blog has had a small trickle of traffic, principally on my post about the use of the <a title="select helper" href="http://keepwithinthelines.wordpress.com/2008/03/17/using-select-helper-in-rails/">select</a> helper.<br />
It&#8217;s taken me quite some time to write this particular blog post and I&#8217;m a little worried that it contains numerous mistakes and bit of mis-information. I&#8217;m going to think twice before I decide to write a post in this level of detail again as I&#8217;ve literally taken about a week or so to write the entire post! Yes someone might be searching for help on a particular topic and find their way to this blog but there are going to be far better sites and forums to find more accurate information.</p>
<p>Possibly see a future post for a list of  rails web resources that I find useful.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/keepwithinthelines.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/keepwithinthelines.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/keepwithinthelines.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/keepwithinthelines.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/keepwithinthelines.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/keepwithinthelines.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/keepwithinthelines.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/keepwithinthelines.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/keepwithinthelines.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/keepwithinthelines.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/keepwithinthelines.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/keepwithinthelines.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/keepwithinthelines.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/keepwithinthelines.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/keepwithinthelines.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/keepwithinthelines.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=keepwithinthelines.wordpress.com&amp;blog=2866468&amp;post=7&amp;subd=keepwithinthelines&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://keepwithinthelines.wordpress.com/2008/04/05/login-routine-a-1st-attempt/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/908616fee75aec26332a5cc56d2e4eed?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gblake</media:title>
		</media:content>
	</item>
		<item>
		<title>Using select Helper in Rails</title>
		<link>http://keepwithinthelines.wordpress.com/2008/03/17/using-select-helper-in-rails/</link>
		<comments>http://keepwithinthelines.wordpress.com/2008/03/17/using-select-helper-in-rails/#comments</comments>
		<pubDate>Mon, 17 Mar 2008 20:33:03 +0000</pubDate>
		<dc:creator>gblake</dc:creator>
				<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://keepwithinthelines.wordpress.com/?p=8</guid>
		<description><![CDATA[In my last post I wrote that I had produced a PHP application for the company that I currently work for. Well, now that I&#8217;m trying to learn Ruby on Rails I decided that I would convert that applicition from PHP to Rails. I&#8217;ve not really allocated very much time to the task at the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=keepwithinthelines.wordpress.com&amp;blog=2866468&amp;post=8&amp;subd=keepwithinthelines&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In my last post I wrote that I had produced a PHP application for the company that I currently work for. Well, now that I&#8217;m trying to learn Ruby on Rails I decided that I would convert that applicition from PHP to Rails. I&#8217;ve not really allocated very much time to the task at the moment but hope I can give it some more of my time soon.</p>
<p>One of the things that the PHP application had was a number of drop-down combo-boxes (or selection lists) on the main page. These were used to filter the displaying of problems that the system was tracking. The user could use these selection lists to get the app. to show only problems that they had raised for example, or to only show problems that related to a particular system. This app. was being used to track problems with a large piece of software that we had recently delivered to our customer. Without going into details, the software was focused on the training of ground-crew who maintain fast jets. This meant that problems tracked by the app. would relate to various aircraft system, engine, communications, navigation, etc.</p>
<p>Anyway, back to the selection lists. As I have a table in my database listing all of the aircraft systems I could have simply populated my selection list with the systems from that table/model quite simply:</p>
<p>In the controller:</p>
<pre>@system_names =  System.find(:all, <img src='http://s1.wp.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> rder =&gt; 'description')</pre>
<p>In the view:</p>
<pre>
&lt;% form_tag do %&gt;
   &lt;p&gt;
      &lt;label for="system_id"&gt;System Title to filter on:&lt;/label&gt;
      &lt;%= select_tag(:system_id,
         options_from_collection_for_select(@system_names,
         :id, :description) %&gt;
   &lt;/p&gt;
   &lt;%= submit_tag 'Filter Issues' %&gt;
&lt;% end %&gt;</pre>
<p>However I wanted to ensure that the option selected by the user would remain selected and I also wanted to add an option to the beginning of the list that could be used to switch the filter off. I thought at the beginning of the week that this would be a really easy task but I spent several days of frustration trying different options, looking at the online <a href="http://api.rubyonrails.org/" title="Rails Framework Documentation">Rails Framework Documentation</a> and searching a <a href="http://railsforum.com/index.php" title="Rails Forum">Rails Forum</a> or two. I was about to give up and submit a post to one of the forums when I had a breakthrough.</p>
<p>I finally worked out what I needed to add to the <code>options_from_collection_for_select</code> helper method to get the previously selected option to appear selected if the form was submitted:</p>
<pre>&lt;%= select_tag(:system_id,
   options_from_collection_for_select(@system_names,
   :id, :description, params[:system_id].to_i) %&gt;</pre>
<p>It was some time before I realised that I needed to add <code>to_i</code> to convert the string stored in <code>params</code> to an integer. I guess that I had assumed that this conversion would take place automatically. This highlights one of my problems learning Rails and that&#8217;s the fact that I haven&#8217;t really got any experience using Ruby and I&#8217;m beginning to think that is a mistake.</p>
<p>As I write this post I&#8217;m realising that I don&#8217;t actually need to have the previously selected option selected in the selection list using this technique. Instead I&#8217;ll simply find out what the user had selected and store it in a session variable; the use of <code>params</code> will only work if the user is submitting a form that needs to be re-displayed because of an error in the form, for example.</p>
<p>Adding an option to the beginning of the selection list took me longer to achieve and I don&#8217;t know if I&#8217;ve done it the best or easiest way. I&#8217;m just glad that I got it worked out eventually! I dropped the <code>options_from_collection_for_select</code> helper method in favour of the <code>options_for_select</code> method:</p>
<pre>&lt;%= select_tag( :system_id,
   options_for_select(@system_names,
   params[:system_id].to_i) ) %&gt;</pre>
<p>In the controller I was toying with the idea of using the <code>find</code> method in the same way, to grab all available systems,  and then adding the new option to the beginning of the list. Again, I had a number of problems with this due to my limited knowledge of Ruby as well as my inexperience at using Rails. Eventually I came to the following solution, where I convert the array of objects that is returned by the <code>find</code> method to an array of arrays (using the <code>map</code> method) and then joining this to another array of arrays that contains my first option:</p>
<pre>@system_names =  System.find(:all, <img src='http://s1.wp.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> rder =&gt; 'description')
@system_names = [ ["No Filter Selected", 0] ]
   + @system_names.map {|p| [ p.description, p.id ] }</pre>
<p>It actually appears to work.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/keepwithinthelines.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/keepwithinthelines.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/keepwithinthelines.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/keepwithinthelines.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/keepwithinthelines.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/keepwithinthelines.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/keepwithinthelines.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/keepwithinthelines.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/keepwithinthelines.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/keepwithinthelines.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/keepwithinthelines.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/keepwithinthelines.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/keepwithinthelines.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/keepwithinthelines.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/keepwithinthelines.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/keepwithinthelines.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=keepwithinthelines.wordpress.com&amp;blog=2866468&amp;post=8&amp;subd=keepwithinthelines&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://keepwithinthelines.wordpress.com/2008/03/17/using-select-helper-in-rails/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/908616fee75aec26332a5cc56d2e4eed?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gblake</media:title>
		</media:content>
	</item>
	</channel>
</rss>
