<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Go Tripod Ltd</title>
	<atom:link href="http://www.gotripod.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gotripod.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Mon, 01 Mar 2010 22:23:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The Most Lightweight Audio Player for OSX</title>
		<link>http://www.gotripod.com/2010/03/01/the-most-lightweight-audio-player-for-osx/</link>
		<comments>http://www.gotripod.com/2010/03/01/the-most-lightweight-audio-player-for-osx/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 22:23:14 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[Github]]></category>
		<category><![CDATA[Labs]]></category>
		<category><![CDATA[Objective-C and Cocoa]]></category>

		<guid isPermaLink="false">http://www.gotripod.com/?p=1181</guid>
		<description><![CDATA[I had an issue. iTunes is a fine program, with loads of great features, and it&#8217;s essential for the iTunes store and syncing my iPhone. Trouble is, in my house, we&#8217;ve got a central media server which reports 1037 albums &#8211; pulled from the CD collections of four music lovers. The combination of network access [...]]]></description>
			<content:encoded><![CDATA[<p>I had an issue. iTunes is a fine program, with loads of great features, and it&#8217;s essential for the iTunes store and syncing my iPhone. Trouble is, in my house, we&#8217;ve got a central media server which reports 1037 albums &#8211; pulled from the CD collections of four music lovers. The combination of network access and a huge number of songs means that iTunes does get a little sluggish. I&#8217;ve tried alternatives &#8211; Songbird, Picoplay, Cog &#8211; but to be honest I want something that&#8217;s fast as lightning and I&#8217;m not really interested in the library features of iTunes. </p>
<p>I&#8217;ve written a <a href="http://github.com/colinramsay/osxplayer">very rough and ready Objective-C media player</a>. It sits as an OSX menu icon, near the spotlight and airport icons, and allows you to pick a directory of audio files to play. That&#8217;s pretty much it. You can choose &#8220;pause&#8221;, &#8220;skip&#8221; and &#8220;quit&#8221; to control the player, but there&#8217;s no notifications, libraries, fancy features or airs and graces.</p>
<p>I want to thank Matteo Bertozzi for teaching me <a href="http://th30z.netsons.org/2008/10/cocoa-system-statusbar-item-aka-traybar/">how to create the system bar items</a>, and P.J. Onori for the <a href="http://somerandomdude.com/projects/iconic/">icon from the Iconic set</a> which I used. I&#8217;m using this player daily, so it works for me, but we&#8217;re putting it in our labs and it&#8217;s on github, so please <a href="http://github.com/colinramsay/osxplayer">fork the audioplayer repo</a> if you have any features you want to add.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gotripod.com/2010/03/01/the-most-lightweight-audio-player-for-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How We Track Projects</title>
		<link>http://www.gotripod.com/2010/02/13/how-we-track-projects/</link>
		<comments>http://www.gotripod.com/2010/02/13/how-we-track-projects/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 10:10:29 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[37 Signals]]></category>
		<category><![CDATA[Campfire]]></category>
		<category><![CDATA[Go Tripod]]></category>
		<category><![CDATA[Project Management]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.gotripod.com/?p=1117</guid>
		<description><![CDATA[Depending on time of year, current workload, phase of moon, and other factors, the Go Tripod team may not always work from the same location. And even if we do, we&#8217;re often in Do Not Disturb mode with headphones on. We&#8217;ve found that the best way to keep track is by using the Campfire chat [...]]]></description>
			<content:encoded><![CDATA[<p>Depending on time of year, current workload, phase of moon, and other factors, the Go Tripod team may not always work from the same location. And even if we do, we&#8217;re often in Do Not Disturb mode with headphones on. We&#8217;ve found that the best way to keep track is by using the Campfire chat system, which allows not only standard back-and-forth yapping, but sharing of source code and images. A killer feature for us is the ability to see what&#8217;s been talked about if we&#8217;ve not been in the chatroom for a few hours; Campfire offers transcripts of everything that&#8217;s been said in your absence. </p>
<p>So we&#8217;re always in <em>Campfire</em>, and it&#8217;s an integrated part of our working day. As Go Tripod is going from strength to strength, we&#8217;ve started to need a way of doing a similar thing with projects &#8211; a very simple way for anyone to see and overview of projects that are on the go right now. We&#8217;ve kind of tried this before, but the stuff that we&#8217;ve tried either hasn&#8217;t been simple enough or we&#8217;ve only used it rarely because it&#8217;s separated out from every other part of our work. In the latter case, it just gets left by the wayside and forgotten.</p>
<p>The idea sprang to mind to somehow involve Campfire in the proceedings. Maybe we change the room title to reflect the current open projects? The problem with the room title is that it&#8217;s a bit out of the way up the top of the screen and could be affected by the same issue as I described above &#8211; out of sight, out of mind. So the solution needed to be integrated. In fact we basically needed another team member in Campfire, our communication method of choice, talking to us and updating us. Some kind of automated team member&#8230; Some kind of robot?</p>
<h2>The Technical Bit</h2>
<p>I did a quick search &#8211; <a href="http://github.com/timriley/campfire-bot">Tim Riley&#8217;s Campfire Bot</a> looked absolutely perfect, with its plugin system, so I tried to use that. Unfortunately I couldn&#8217;t get the latest source code to work, and I had other <a href="http://github.com/collectiveidea/tinder/issues#issue/3">issues</a> when I tried to use the <a href="http://github.com/collectiveidea/tinder/">Tinder</a> library which underlies the Campfire Bot.</p>
<p>A quick scout around for some more libraries led me to <a href="http://github.com/qrush/broach">Broach</a>, a simple wrapper for the Campfire API, and the 37 Signals <a href="http://developer.37signals.com/campfire/streaming">example code for the Campfire Streaming</a> API, which uses the <a href="http://github.com/voloko/twitter-stream">twitter-stream</a> library. I quickly put together a proof of concept using these tools and some sneaky code which allowed us to issue commands to the bot from the Campfire window itself.</p>
<h2>The Results</h2>
<p>A picture tells a thousand words:</p>
<p><a href="http://www.gotripod.com/wp-content/uploads/2010/02/projects.png"><img src="http://www.gotripod.com/wp-content/uploads/2010/02/projects.png" alt="List Projects with GoTripodBot" title="!projects" width="458" height="53" class="alignleft size-full wp-image-1121" /></a></p>
<p>A list of current projects! And Simon decides to add another:</p>
<p><a href="http://www.gotripod.com/wp-content/uploads/2010/02/open.png"><img src="http://www.gotripod.com/wp-content/uploads/2010/02/open.png" alt="Open a Project with GoTripodBot" title="!open" width="548" height="79" class="alignleft size-full wp-image-1125" /></a></p>
<p>GoTripodBot is a helpful fellow:</p>
<p><a href="http://www.gotripod.com/wp-content/uploads/2010/02/help.png"><img src="http://www.gotripod.com/wp-content/uploads/2010/02/help.png" alt="Getting Help from GoTripodBot" title="!help" width="486" height="50" class="alignleft size-full wp-image-1133" /></a></p>
<p>And a brief insight into the world of development (I wrote some unit tests after this):</p>
<p><a href="http://www.gotripod.com/wp-content/uploads/2010/02/dev-issues.png"><img src="http://www.gotripod.com/wp-content/uploads/2010/02/dev-issues.png" alt="Development issues with GoTripodBot" title="dev-issues" width="308" height="205" class="alignleft size-full wp-image-1137" /></a></p>
<h2>Conclusion</h2>
<p>Of course there&#8217;s a lot more to our project management process than this (and a lot more projects to manage than I&#8217;ve shown!) but having such easy transparency into this top layer of our work is really going to improve our awareness of what&#8217;s happening <em>right now</em> in the world of Go Tripod.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gotripod.com/2010/02/13/how-we-track-projects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ext JS 3.0 Cookbook &#8211; Available Now</title>
		<link>http://www.gotripod.com/2009/11/02/ext-js-3-0-cookbook-available-now/</link>
		<comments>http://www.gotripod.com/2009/11/02/ext-js-3-0-cookbook-available-now/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 09:49:06 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[Authoring]]></category>
		<category><![CDATA[Ext JS]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.gotripod.com/?p=925</guid>
		<description><![CDATA[The Ext JS 3.0 Cookbook by Jorge Ramon is now available. As Jorge says in his introductory post:
The Ext JS 3.0 Cookbook is for developers who want a book of useful techniques, with explanations, that they can refer to and adapt to their purposes. 
I was a Technical Reviewer for this book, and it contains [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.packtpub.com/ext-js-3-0-cookbook/">Ext JS 3.0 Cookbook</a> by <a href="http://miamicoder.com/">Jorge Ramon</a> is now available. As Jorge says in his <a href="http://www.miamicoder.com/post/2009/08/Announcing-the-Ext-JS-30-Cookbook.aspx">introductory post</a>:</p>
<blockquote><p>The Ext JS 3.0 Cookbook is for developers who want a book of useful techniques, with explanations, that they can refer to and adapt to their purposes. </p></blockquote>
<p>I was a Technical Reviewer for this book, and it contains not just simple recipes to get you started, but complex ones to allow you to bend Ext JS to your will. If you buy Ext JS 3.0 Cookbook eBook along with the eBook edition of the book I co-authored, Learning Ext JS, you can get a 50% discount using the promo code <strong>jsco34ler</strong> on the <a href="http://www.packtpub.com/ext-js-3-0-cookbook/">Packt website</a>. Congratulations Jorge!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gotripod.com/2009/11/02/ext-js-3-0-cookbook-available-now/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Problem Solving in Software</title>
		<link>http://www.gotripod.com/2009/10/30/problem-solving-in-software/</link>
		<comments>http://www.gotripod.com/2009/10/30/problem-solving-in-software/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 14:03:03 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[Entrepreneurship]]></category>
		<category><![CDATA[Go Tripod]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.gotripod.com/?p=909</guid>
		<description><![CDATA[Very occasionally, people will start asking me in detail what I do for a living. When &#8220;I write software&#8221; or &#8220;I make websites&#8221; doesn&#8217;t satisfy them, I go into a bit more detail about the different aspects of my job. One thing that happens quite regularly if I don&#8217;t go into enough detail, is that [...]]]></description>
			<content:encoded><![CDATA[<p>Very occasionally, people will start asking me in detail what I do for a living. When &#8220;I write software&#8221; or &#8220;I make websites&#8221; doesn&#8217;t satisfy them, I go into a bit more detail about the different aspects of my job. One thing that happens quite regularly if I don&#8217;t go into <em>enough</em> detail, is that I&#8217;ll tell someone how long it took to write something, or how much it cost, and they&#8217;ll raise their eyebrows.</p>
<p>&#8220;How can it cost so much?! It&#8217;s just a website!&#8221;</p>
<p>I can see their point. Most websites contain common elements &#8211; login, lists, articles, shopping carts, and so on &#8211; so you&#8217;d think that once you&#8217;ve written one, you&#8217;ll have the bits and pieces you need to make more. And taken individually, each of these parts are fairly straightforward &#8211; a list of products contains some pretty basic HTML, surely? And HTML is just a text file?</p>
<p>And again, that&#8217;s a fair point. The real time isn&#8217;t taken in writing these bits and pieces, it&#8217;s taken in understanding how the customer wants them to be written and how they need to fit together in a certain situation. For example, a shopping cart quickly becomes more complex when the customer adds on a few more features:</p>
<ul>
<li>Integrates with Google Checkout</li>
<li>Customers can save carts for later ordering</li>
<li>Customers can reload past orders into a few cart</li>
</ul>
<p>But it&#8217;s not just the cart, it&#8217;s viewing products too &#8211; what if certain customers see custom trade prices? Or products can be assigned to multiple categories and the customer wants to see how many products are in each category next to the category name? All of these things are minor when taking in isolation, but together they are a thousand tiny cuts which bleed development time.</p>
<p>As well as a collection of features, a specification for a website will also discuss requirements in language which is specific to the company you&#8217;re quoting for. Rather than &#8220;cart&#8221; you might have &#8220;basket&#8221;. Or you could have &#8220;assessors&#8221;, &#8220;reviewers&#8221;, &#8220;investigators&#8221;, or any other number of terms which a company uses internally and when referencing all of the features they want on their site. <a href="http://domaindrivendesign.org/">Eric Evans talks</a> about the &#8220;domain&#8221; of a problem when discussing software &#8211; not only do you have to appreciate what kind of features are necessary but you have to understand the domain in which they&#8217;re going to be used, in order to create a solution which fits together correctly.</p>
<p>So software is a whole big bag of questions and clarifications and solutions. From a developer&#8217;s point of view, it&#8217;s not just a case of taking some standard components and piecing them together &#8211; though that does happen occasionally. Instead every step of the development process is about solving problems, by understanding what the customer wants and by understanding the problem domain. Every day of development sees a developer tackle a new bit of work that needs resolving in a novel way, and that&#8217;s why making software isn&#8217;t just a case of shoving some parts together and hoping that it works, but a process, an evolution of the initial ideas.</p>
<p>When clients come to us and ask for software, they&#8217;ll pitch it by saying &#8220;make us a website&#8221;. But we know that what they really mean is &#8220;look, understand, and solve our problem&#8221;. And that&#8217;s what we do. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.gotripod.com/2009/10/30/problem-solving-in-software/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Dynamic Nested Forms in Rails 2.3+ Using RJS</title>
		<link>http://www.gotripod.com/2009/09/30/dynamic-nested-forms-in-rails-2-3-using-rjs/</link>
		<comments>http://www.gotripod.com/2009/09/30/dynamic-nested-forms-in-rails-2-3-using-rjs/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 08:11:55 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[accepts_nested_attributes_for]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.gotripod.com/2009/09/30/dynamic-nested-forms-in-rails-2-3-using-rjs/</guid>
		<description><![CDATA[Rails 2.3 delivered a new feature that allows you to easily write forms in rails that can process nested attributes for related objects using the accepts_nested_attributes_for method in your models. Now there is a plugin to make adding and removing nested forms a walk in the park!
I am not going to go into detail about [...]]]></description>
			<content:encoded><![CDATA[<p>Rails 2.3 delivered a new feature that allows you to easily write forms in rails that can process nested attributes for related objects using the accepts_nested_attributes_for method in your models. Now there is a plugin to make adding and removing nested forms a walk in the park!</p>
<p>I am not going to go into detail about this feature as <a href="http://ryandaigle.com/articles/2009/2/1/what-s-new-in-edge-rails-nested-attributes#comment-form">Ryan Daigle has an excellent write up on his blog</a>.</p>
<p>However I have been looking at ways to easily add and remove nested form blocks using Javascript/RJS and came across a good method of achieving this <a href="http://railsforum.com/viewtopic.php?pid=91229">by Marsvin on the RailsForum website</a>.</p>
<p>We have used this method a few times now, so thought we would roll it up into a plugin. Simply install the plugin to give you two new view helpers that allow you to create links to add and remove these nested form item partials using RJS.</p>
<p><a href="http://github.com/miletbaker/add_nested_fields">Visit the plugin&#8217;s page on GitHub to install or view the documentation.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gotripod.com/2009/09/30/dynamic-nested-forms-in-rails-2-3-using-rjs/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ASP.NET SMTP &#8211; Setting a Pickup Directory for Development</title>
		<link>http://www.gotripod.com/2009/08/03/asp-net-smtp-setting-a-pickup-directory-for-development/</link>
		<comments>http://www.gotripod.com/2009/08/03/asp-net-smtp-setting-a-pickup-directory-for-development/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 16:39:07 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[.Net]]></category>

		<guid isPermaLink="false">http://www.gotripod.com/?p=669</guid>
		<description><![CDATA[One of the hidden gems of System.Net is the ability to change from using an SMTP server for sending your email. Instead you can specify a pickup directory which will receive all emails sent from your application as a .EML text file. There are clearly uses for this in production &#8211; you may have a [...]]]></description>
			<content:encoded><![CDATA[<p>One of the hidden gems of System.Net is the ability to change from using an SMTP server for sending your email. Instead you can specify a pickup directory which will receive all emails sent from your application as a .EML text file. There are clearly uses for this in production &#8211; you may have a second application which monitors this pickup directory and sends the emails after performing some processing on them. </p>
<p>My favourite use of this feature is for development &#8211; when you&#8217;re sending loads of test emails you can avoid polluting your inbox and simply check the pickup directory. You also avoid having to set up an SMTP host and all of the associated configuration.</p>
<p>Simply add the following to your web.config&#8217;s system.net section:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mailSettings<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;smtp</span> <span style="color: #000066;">deliveryMethod</span>=<span style="color: #ff0000;">&quot;SpecifiedPickupDirectory&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;specifiedPickupDirectory</span> <span style="color: #000066;">pickupDirectoryLocation</span>=<span style="color: #ff0000;">&quot;c:\temp\&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/smtp<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mailSettings<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Make sure you&#8217;ve got the right permissions on the directory. Now, send an email from your application and watch it appear in c:\temp, as if by magic!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gotripod.com/2009/08/03/asp-net-smtp-setting-a-pickup-directory-for-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scale-9 in Objective-C Cocoa on the Mac</title>
		<link>http://www.gotripod.com/2009/06/18/scale-9-in-objective-c-cocoa-on-the-mac/</link>
		<comments>http://www.gotripod.com/2009/06/18/scale-9-in-objective-c-cocoa-on-the-mac/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 22:49:35 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[Objective-C and Cocoa]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Scale9]]></category>
		<category><![CDATA[UI Design]]></category>

		<guid isPermaLink="false">http://clockobj.co.uk/?p=297</guid>
		<description><![CDATA[Having used flash extensively for the last few years I have really come to rely on using Scale-9 scaling on UI elements in the rich internet apps I design and develop. It is a great technique for things like rounded rectangles, button graphics etc and ensuring the rounded corners do not distort when stretched.
I have [...]]]></description>
			<content:encoded><![CDATA[<p>Having used flash extensively for the last few years I have really come to rely on using Scale-9 scaling on UI elements in the rich internet apps I design and develop. It is a great technique for things like rounded rectangles, button graphics etc and ensuring the rounded corners do not distort when stretched.</p>
<p>I have recently been doing Cocoa Development on Mac OS X 10.5 and was looking for a way to do this in Cocoa and <a href="http://www.karlkraft.com/index.php/2007/11/14/nsdrawninepartimage/">came across</a> a great drawing method named <a href="http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Miscellaneous/AppKit_Functions/Reference/reference.html">NSDrawNinePartImage</a>. The method has the following signature:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #a61390;">void</span> NSDrawNinePartImage<span style="color: #002200;">&#40;</span><span style="color: #a61390;">NSRect</span> frame,
   <span style="color: #400080;">NSImage</span> <span style="color: #002200;">*</span>topLeftCorner,
   <span style="color: #400080;">NSImage</span> <span style="color: #002200;">*</span>topEdgeFill,
   <span style="color: #400080;">NSImage</span> <span style="color: #002200;">*</span>topRightCorner,
   <span style="color: #400080;">NSImage</span> <span style="color: #002200;">*</span>leftEdgeFill,
   <span style="color: #400080;">NSImage</span> <span style="color: #002200;">*</span>centerFill,
   <span style="color: #400080;">NSImage</span> <span style="color: #002200;">*</span>rightEdgeFill,
   <span style="color: #400080;">NSImage</span> <span style="color: #002200;">*</span>bottomLeftCorner,
   <span style="color: #400080;">NSImage</span> <span style="color: #002200;">*</span>bottomEdgeFill,
   <span style="color: #400080;">NSImage</span> <span style="color: #002200;">*</span>bottomRightCorner,
   NSCompositingOperation op,
   CGFloat alphaFraction,
   <span style="color: #a61390;">BOOL</span> flipped
<span style="color: #002200;">&#41;</span>;</pre></div></div>

<p><span id="more-401"></span><br />
This method requires the developer to provide 9 separate images to create the 9 sections of the scale 9 image. Luckily the article I had stumbled across had a handy example for using a single class, so I thought that I would use their technique to create a simple generic class that can be used to draw a single NSImage as a Scale-9 scalable image. This could be used for example in an NSView or NSButtonCell.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">//</span>
<span style="color: #11740a; font-style: italic;">//  GTDrawImage.m</span>
<span style="color: #11740a; font-style: italic;">//  StretchMyView</span>
<span style="color: #11740a; font-style: italic;">//</span>
<span style="color: #11740a; font-style: italic;">//  Created by Jon Baker on 17/06/2009.</span>
<span style="color: #11740a; font-style: italic;">//  Copyright 2009 Go Tripod Ltd. All rights reserved.</span>
<span style="color: #11740a; font-style: italic;">//</span>
&nbsp;
<span style="color: #6e371a;">#import &quot;GTDrawImage.h&quot;</span>
&nbsp;
<span style="color: #a61390;">@implementation</span> GTDrawImage
&nbsp;
&nbsp;
<span style="color: #002200;">+</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> drawScalableImage<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSImage</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>sourceImage scaleTopLeft<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">NSPoint</span><span style="color: #002200;">&#41;</span>topLeftPoint scaleBottomRight<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">NSPoint</span><span style="color: #002200;">&#41;</span>bottomRightPoint inFrame<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">NSRect</span><span style="color: #002200;">&#41;</span>frame
<span style="color: #002200;">&#123;</span>
	NSSize sourceSize <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>sourceImage size<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #11740a; font-style: italic;">// Top left</span>
	<span style="color: #a61390;">NSRect</span> topLeftTileRect <span style="color: #002200;">=</span> NSMakeRect<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">0</span>, topLeftPoint.x, sourceSize.height <span style="color: #002200;">-</span> topLeftPoint.y<span style="color: #002200;">&#41;</span>;
	<span style="color: #a61390;">NSRect</span> topLeftCutRect <span style="color: #002200;">=</span> NSMakeRect<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, topLeftPoint.y, topLeftTileRect.size.width, topLeftTileRect.size.height<span style="color: #002200;">&#41;</span>;
&nbsp;
	<span style="color: #11740a; font-style: italic;">// TopRight</span>
	<span style="color: #a61390;">NSRect</span> topRightTileRect <span style="color: #002200;">=</span> NSMakeRect<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>,<span style="color: #2400d9;">0</span>, sourceSize.width <span style="color: #002200;">-</span> bottomRightPoint.x, topLeftTileRect.size.height<span style="color: #002200;">&#41;</span>;
	<span style="color: #a61390;">NSRect</span> topRightCutRect <span style="color: #002200;">=</span> NSMakeRect<span style="color: #002200;">&#40;</span>sourceSize.width <span style="color: #002200;">-</span> topRightTileRect.size.width, topLeftPoint.y, topRightTileRect.size.width, topRightTileRect.size.height<span style="color: #002200;">&#41;</span>;
&nbsp;
	<span style="color: #11740a; font-style: italic;">// Top</span>
	<span style="color: #a61390;">NSRect</span> topTileRect <span style="color: #002200;">=</span> NSMakeRect<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">0</span>, sourceSize.width <span style="color: #002200;">-</span> topLeftTileRect.size.width <span style="color: #002200;">-</span> topRightTileRect.size.width, topLeftTileRect.size.height<span style="color: #002200;">&#41;</span>;
	<span style="color: #a61390;">NSRect</span> topCutRect <span style="color: #002200;">=</span> NSMakeRect<span style="color: #002200;">&#40;</span>topLeftPoint.x, topLeftPoint.y, topTileRect.size.width, topTileRect.size.height<span style="color: #002200;">&#41;</span>;
&nbsp;
	<span style="color: #11740a; font-style: italic;">// Bottom Left</span>
	<span style="color: #a61390;">NSRect</span> bottomLeftTileRect <span style="color: #002200;">=</span> NSMakeRect<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">0</span>, topLeftCutRect.size.width, bottomRightPoint.y<span style="color: #002200;">&#41;</span>;
	<span style="color: #a61390;">NSRect</span> bottomLeftCutRect <span style="color: #002200;">=</span> NSMakeRect<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">0</span>, bottomLeftTileRect.size.width, bottomLeftTileRect.size.height<span style="color: #002200;">&#41;</span>;
&nbsp;
	<span style="color: #11740a; font-style: italic;">// Bottom Right</span>
	<span style="color: #a61390;">NSRect</span> bottomRightTileRect <span style="color: #002200;">=</span> NSMakeRect<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>,<span style="color: #2400d9;">0</span>, topRightCutRect.size.width, bottomLeftTileRect.size.height<span style="color: #002200;">&#41;</span>;
	<span style="color: #a61390;">NSRect</span> bottomRightCutRect <span style="color: #002200;">=</span> NSMakeRect<span style="color: #002200;">&#40;</span>topRightCutRect.origin.x, <span style="color: #2400d9;">0</span>, bottomRightTileRect.size.width , bottomRightTileRect.size.height <span style="color: #002200;">&#41;</span>;
&nbsp;
	<span style="color: #11740a; font-style: italic;">// Bottom</span>
	<span style="color: #a61390;">NSRect</span> bottomTileRect <span style="color: #002200;">=</span> NSMakeRect<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>,<span style="color: #2400d9;">0</span>, topTileRect.size.width, bottomLeftTileRect.size.height<span style="color: #002200;">&#41;</span>;
	<span style="color: #a61390;">NSRect</span> bottomCutRect <span style="color: #002200;">=</span> NSMakeRect<span style="color: #002200;">&#40;</span>topCutRect.origin.x, <span style="color: #2400d9;">0</span>, bottomTileRect.size.width, bottomTileRect.size.height<span style="color: #002200;">&#41;</span>;
&nbsp;
	<span style="color: #11740a; font-style: italic;">// left</span>
&nbsp;
	<span style="color: #a61390;">NSRect</span> leftTileRect <span style="color: #002200;">=</span> NSMakeRect<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">0</span>, bottomLeftTileRect.size.width, sourceSize.height <span style="color: #002200;">-</span> topTileRect.size.height <span style="color: #002200;">-</span> bottomTileRect.size.height<span style="color: #002200;">&#41;</span>;
	<span style="color: #a61390;">NSRect</span> leftCutRect <span style="color: #002200;">=</span> NSMakeRect<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, bottomRightPoint.y, leftTileRect.size.width, leftTileRect.size.height<span style="color: #002200;">&#41;</span>;
&nbsp;
	<span style="color: #11740a; font-style: italic;">// right</span>
&nbsp;
	<span style="color: #a61390;">NSRect</span> rightTileRect <span style="color: #002200;">=</span> NSMakeRect<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">0</span>, topRightCutRect.size.width, leftCutRect.size.height<span style="color: #002200;">&#41;</span>;
	<span style="color: #a61390;">NSRect</span> rightCutRect <span style="color: #002200;">=</span> NSMakeRect<span style="color: #002200;">&#40;</span>bottomRightPoint.x, bottomRightPoint.y, rightTileRect.size.width, rightTileRect.size.height<span style="color: #002200;">&#41;</span>;
&nbsp;
	<span style="color: #11740a; font-style: italic;">//center</span>
	<span style="color: #a61390;">NSRect</span> centerTileRect <span style="color: #002200;">=</span> NSMakeRect<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">0</span>, topTileRect.size.width, leftTileRect.size.height<span style="color: #002200;">&#41;</span>;
	<span style="color: #a61390;">NSRect</span> centerCutRect <span style="color: #002200;">=</span> NSMakeRect<span style="color: #002200;">&#40;</span>topCutRect.origin.x, bottomRightPoint.y, centerTileRect.size.width, centerTileRect.size.height<span style="color: #002200;">&#41;</span>;
&nbsp;
	<span style="color: #400080;">NSImage</span> <span style="color: #002200;">*</span>topLeft <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSImage</span> alloc<span style="color: #002200;">&#93;</span> initWithSize<span style="color: #002200;">:</span>topLeftTileRect.size<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>topLeft lockFocus<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>sourceImage drawInRect<span style="color: #002200;">:</span>topLeftTileRect fromRect<span style="color: #002200;">:</span>topLeftCutRect operation<span style="color: #002200;">:</span>NSCompositeCopy fraction<span style="color: #002200;">:</span><span style="color: #2400d9;">1.0</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>topLeft unlockFocus<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #400080;">NSImage</span> <span style="color: #002200;">*</span>top <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSImage</span> alloc<span style="color: #002200;">&#93;</span> initWithSize<span style="color: #002200;">:</span>topTileRect.size<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>top lockFocus<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>sourceImage drawInRect<span style="color: #002200;">:</span>topTileRect fromRect<span style="color: #002200;">:</span>topCutRect operation<span style="color: #002200;">:</span>NSCompositeCopy fraction<span style="color: #002200;">:</span><span style="color: #2400d9;">1.0</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>top unlockFocus<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #400080;">NSImage</span> <span style="color: #002200;">*</span>topRight <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSImage</span> alloc<span style="color: #002200;">&#93;</span> initWithSize<span style="color: #002200;">:</span>topRightTileRect.size<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>topRight lockFocus<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>sourceImage drawInRect<span style="color: #002200;">:</span>topRightTileRect fromRect<span style="color: #002200;">:</span>topRightCutRect operation<span style="color: #002200;">:</span>NSCompositeCopy fraction<span style="color: #002200;">:</span><span style="color: #2400d9;">1.0</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>topRight unlockFocus<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #11740a; font-style: italic;">//setup center section, left, right</span>
	<span style="color: #400080;">NSImage</span> <span style="color: #002200;">*</span>left <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSImage</span> alloc<span style="color: #002200;">&#93;</span> initWithSize<span style="color: #002200;">:</span>leftTileRect.size<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>left lockFocus<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>sourceImage drawInRect<span style="color: #002200;">:</span>leftTileRect fromRect<span style="color: #002200;">:</span>leftCutRect operation<span style="color: #002200;">:</span>NSCompositeCopy fraction<span style="color: #002200;">:</span><span style="color: #2400d9;">1.0</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>left unlockFocus<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #400080;">NSImage</span> <span style="color: #002200;">*</span>center <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSImage</span> alloc<span style="color: #002200;">&#93;</span> initWithSize<span style="color: #002200;">:</span>centerTileRect.size<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>center lockFocus<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>sourceImage drawInRect<span style="color: #002200;">:</span>centerTileRect fromRect<span style="color: #002200;">:</span>centerCutRect operation<span style="color: #002200;">:</span>NSCompositeCopy fraction<span style="color: #002200;">:</span><span style="color: #2400d9;">1.0</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>center unlockFocus<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #400080;">NSImage</span> <span style="color: #002200;">*</span>right <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSImage</span> alloc<span style="color: #002200;">&#93;</span> initWithSize<span style="color: #002200;">:</span>rightTileRect.size<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>right lockFocus<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>sourceImage drawInRect<span style="color: #002200;">:</span>rightTileRect fromRect<span style="color: #002200;">:</span>rightCutRect operation<span style="color: #002200;">:</span>NSCompositeCopy fraction<span style="color: #002200;">:</span><span style="color: #2400d9;">1.0</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>right unlockFocus<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #400080;">NSImage</span> <span style="color: #002200;">*</span>bottomLeft <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSImage</span> alloc<span style="color: #002200;">&#93;</span> initWithSize<span style="color: #002200;">:</span>bottomLeftTileRect.size<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>bottomLeft lockFocus<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>sourceImage drawInRect<span style="color: #002200;">:</span>bottomLeftTileRect fromRect<span style="color: #002200;">:</span>bottomLeftCutRect operation<span style="color: #002200;">:</span>NSCompositeCopy fraction<span style="color: #002200;">:</span><span style="color: #2400d9;">1.0</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>bottomLeft unlockFocus<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #400080;">NSImage</span> <span style="color: #002200;">*</span>bottom <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSImage</span> alloc<span style="color: #002200;">&#93;</span> initWithSize<span style="color: #002200;">:</span>bottomTileRect.size<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>bottom lockFocus<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>sourceImage drawInRect<span style="color: #002200;">:</span>bottomTileRect fromRect<span style="color: #002200;">:</span>bottomCutRect operation<span style="color: #002200;">:</span>NSCompositeCopy fraction<span style="color: #002200;">:</span><span style="color: #2400d9;">1.0</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>bottom unlockFocus<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #400080;">NSImage</span> <span style="color: #002200;">*</span>bottomRight <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSImage</span> alloc<span style="color: #002200;">&#93;</span> initWithSize<span style="color: #002200;">:</span>bottomRightTileRect.size<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>bottomRight lockFocus<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>sourceImage drawInRect<span style="color: #002200;">:</span>bottomRightTileRect fromRect<span style="color: #002200;">:</span>bottomRightCutRect operation<span style="color: #002200;">:</span>NSCompositeCopy fraction<span style="color: #002200;">:</span><span style="color: #2400d9;">1.0</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>bottomRight unlockFocus<span style="color: #002200;">&#93;</span>;
&nbsp;
&nbsp;
	NSDrawNinePartImage<span style="color: #002200;">&#40;</span>
						frame,
						topLeft, top, topRight,
						left, center, right,
						bottomLeft, bottom, bottomRight,
						NSCompositeSourceOver, <span style="color: #2400d9;">1.0</span>, <span style="color: #a61390;">NO</span><span style="color: #002200;">&#41;</span>;
&nbsp;
	<span style="color: #002200;">&#91;</span>topLeft release<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>top release<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>topRight release<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>left release<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>center release<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>right release<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>bottomLeft release<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>bottom release<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>bottomRight release<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #a61390;">@end</span></pre></div></div>

<p>To use this generic classes, you simply need to import it where required:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#import &quot;GTDrawImage.h&quot;</span></pre></div></div>

<p>&#8230;and then you can call from within, for example the drawRect:, selector using the following method:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>drawRect<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">NSRect</span><span style="color: #002200;">&#41;</span>rect <span style="color: #002200;">&#123;</span>
	<span style="color: #002200;">&#91;</span>GTDrawImage drawScalableImage<span style="color: #002200;">:</span>baseImage scaleTopLeft<span style="color: #002200;">:</span>NSMakePoint<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">8</span>, <span style="color: #2400d9;">16</span><span style="color: #002200;">&#41;</span> scaleBottomRight<span style="color: #002200;">:</span>NSMakePoint<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">16</span>,<span style="color: #2400d9;">8</span><span style="color: #002200;">&#41;</span> inFrame<span style="color: #002200;">:</span> <span style="color: #002200;">&#91;</span>self bounds<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>drawScalableImage takes an NSImage, in this case baseImage, and two reference points (NSPoint) to split the image into nine slices, firstly the scaleTopLeft: and secondly the scaleBottomRight:, both located from the bottom left corner. So for example to split a 24px x 24px image into 9 equal 8px by 8px segments (see below), the topLeftPoint would be x=8px, y=16px and the bottom x=16 and y=8.</p>
<p><img class="s3-img" src="http://clockobj.co.uk.s3.amazonaws.com/scale9.png" border="0" alt="scale9.png" /></p>
<p>Just download the following classes into your projects and away you go:</p>
<ul>
<li>Header: <a class="s3-link" href="http://clockobj.co.uk.s3.amazonaws.com/GTDrawImage.h">GTDrawImage.h</a></li>
<li>Implementation: <a class="s3-link" href="http://clockobj.co.uk.s3.amazonaws.com/GTDrawImage.m">GTDrawImage.m</a></li>
<li>Sample Project using GTDrawImage: <a class="s3-link" href="http://clockobj.co.uk.s3.amazonaws.com/StretchMyView.zip">StretchMyView.zip</a> (Adapted example I found. Unfortunately I can&#8217;t remember where and so don&#8217;t know who to credit)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.gotripod.com/2009/06/18/scale-9-in-objective-c-cocoa-on-the-mac/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Great 404 Page Idea</title>
		<link>http://www.gotripod.com/2009/06/18/great-404-page-idea/</link>
		<comments>http://www.gotripod.com/2009/06/18/great-404-page-idea/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 09:53:23 +0000</pubDate>
		<dc:creator>simon</dc:creator>
				<category><![CDATA[Entrepreneurship]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[404]]></category>

		<guid isPermaLink="false">http://clockobj.co.uk/?p=273</guid>
		<description><![CDATA[I came across a great 404 page the other day and thought I would share it. The page at first glances looks like any other but if you read the text, you will see that they have redeemed themselves for the broken link by offering me a discount of $3 off any of their products.

This [...]]]></description>
			<content:encoded><![CDATA[<p>I came across <a href="http://www.hogbaysoftware.com/book/">a great 404 page</a> the other day and thought I would share it. The page at first glances looks like any other but if you read the text, you will see that they have redeemed themselves for the broken link by offering me a discount of $3 off any of their products.</p>
<p><img class="s3-img" style="border: 0px initial initial;" src="http://clockobj.co.uk.s3.amazonaws.com/Picture 1.png" border="0" alt="Picture 1.png" width="477" height="439" /></p>
<p>This is a great way to capture the interest of would be browsers that would normally see this page and immediately hit the back key, instead not only do they capture my attention, but they also tap into my curiosity which gets me to immediately click the products link.</p>
<p>In this case I didn&#8217;t need any of their products but this is a great tip.</p>
<p>Also note the search bar being visible. This is essential on a 404 page for keeping customers that know what they are looking for on your site.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gotripod.com/2009/06/18/great-404-page-idea/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Rails deployment is so easy these days</title>
		<link>http://www.gotripod.com/2008/11/22/rails-deployment-is-so-easy-these-days/</link>
		<comments>http://www.gotripod.com/2008/11/22/rails-deployment-is-so-easy-these-days/#comments</comments>
		<pubDate>Sat, 22 Nov 2008 12:04:16 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Phusion Passenger]]></category>

		<guid isPermaLink="false">http://clockobj.co.uk/?p=196</guid>
		<description><![CDATA[I have been meaning to blog about Phusion Passenger for a while as about 3-4 months ago we migrated Stubmatic from using Apache / Mongrel Cluster to Phusion Passenger A.K.A. mod_rails.

Mod rails is extreamly easy to install. Make sure you update gem first:

gem update --system

Then install the Phusion Passenger gem

gem install passenger

Once complete you can [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.gotripod.com/wp-content/uploads/2008/11/enterprise_logo_alpha.png"><img class="float_left alignleft size-full wp-image-214" style="margin: 5px;" title="enterprise_logo_alpha" src="http://www.gotripod.com/wp-content/uploads/2008/11/enterprise_logo_alpha.png" alt="" width="261" height="68" /></a>I have been meaning to blog about Phusion Passenger for a while as about 3-4 months ago we migrated Stubmatic from using Apache / Mongrel Cluster to <a href="http://www.modrails.com/">Phusion Passenger A.K.A. mod_rails</a>.<br />
<span id="more-196"></span><br />
Mod rails is extreamly easy to install. Make sure you update gem first:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gem update <span style="color: #660033;">--system</span></pre></div></div>

<p>Then install the Phusion Passenger gem</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gem <span style="color: #c20cb9; font-weight: bold;">install</span> passenger</pre></div></div>

<p>Once complete you can run the Phusion Passenger install that compiles mod_rails for you.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">passenger-install-apache2-module</pre></div></div>

<p>Once this completes it will give you some code to past into your httpd.conf file and you are ready to start configuring your sites.. Well actually if you have been using Mongrels then time to strip most of the configuration out of your https.conf file. You can have as simple a configuration as shown below. <strong>Note:</strong> The DocumentRoot should be set to the public folder within your app. Passenger automatically detects that this is a rails app.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">    ServerName www.stubmatic.com
    DocumentRoot /websites/stubmatic/public</pre></div></div>

<p>One thing to note is that by default Passenger disables ModRewrite for that VirtualHost and in our case we use ModRewrite for a number of things such as providing a Maintenance page when maintenance.html is in our public folder allowing us to take the app offline. We also use ModRewrite to hide .svn folders, so we needed to use ModRewrite. Thankfully Passenger provides a solution. <strong>Note: You must first make sure you remove the .htaccess file in your rails public folder!</strong></p>
<p>So our new Apache configuration looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">    ServerName www.stubmatic.com
    DocumentRoot /websites/stubmatic/public
&nbsp;
    RailsAllowModRewrite on
&nbsp;
    RewriteEngine On
&nbsp;
    RewriteRule ^(.*/)?.svn/ - [F,L]
&nbsp;
    RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f
    RewriteCond %{SCRIPT_FILENAME} !maintenance.html
    RewriteRule ^.*$ /maintenance.html [L]</pre></div></div>

<p>If you want to setup an Apache / Phusion Passenger testing server you will also need to add the following directive to your VirtualHost configuration:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">RailsEnv development</pre></div></div>

<p>As you can see Phusion Passenger make deployment of Ruby on Rails as trivial as deploying a PHP. You can easily reload Phusion Passenger by running the following command from within your Rails project root.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">touch tmp/restart.txt</pre></div></div>

<p>In terms of performance, Phusion Passenger holds it&#8217;s own against Mongrel and there are <a href="http://www.modrails.com/documentation.html">plenty of details on Phusion&#8217;s website</a>.</p>
<p>For more information:</p>
<ol>
<li><a href="http://www.modrails.com/">Phusion Passenger</a></li>
<li><a href="http://www.modrails.com/documentation/Users%20guide.html">Phusion Passenger Documentation</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.gotripod.com/2008/11/22/rails-deployment-is-so-easy-these-days/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Excellent OS X SQLite 3 Management &amp; Query App</title>
		<link>http://www.gotripod.com/2008/11/20/excellent-os-x-sqlite-3-management-query-app/</link>
		<comments>http://www.gotripod.com/2008/11/20/excellent-os-x-sqlite-3-management-query-app/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 20:11:50 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[Flex and Air]]></category>
		<category><![CDATA[Objective-C and Cocoa]]></category>
		<category><![CDATA[Python Django]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Adobe Air]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[sqlite 3]]></category>

		<guid isPermaLink="false">http://clockobj.co.uk/?p=190</guid>
		<description><![CDATA[


iPhone and Adobe Air developers (as well as any others that use SQLite 3) Menial has just released an excellent little app for creating, managing and running queries against SQLite 3 databases called Bases.

The application is simple to use, very user friendly and has worked well from the testing I have done. It costs just [...]]]></description>
			<content:encoded><![CDATA[<dl id="attachment_191" class="wp-caption alignnone" style="width: 138px;">
<dt class="wp-caption-dt"><a href="http://www.gotripod.com/wp-content/uploads/2008/11/baseicon.png"><img class="size-medium wp-image-191 alignnone float_left" title="baseicon" src="http://www.gotripod.com/wp-content/uploads/2008/11/baseicon.png" alt="Base Icon" width="102" height="102" /></a></dt>
</dl>
<p>iPhone and Adobe Air developers (as well as any others that use SQLite 3) <a href="http://menial.co.uk">Menial</a> has just released an excellent little app for creating, managing and running queries against SQLite 3 databases called Bases.</p>
<p><a href="http://www.gotripod.com/wp-content/uploads/2008/11/schema1.png"><img class="alignnone size-full wp-image-193" title="schema1" src="http://www.gotripod.com/wp-content/uploads/2008/11/schema1.png" alt="" width="500" height="424" /></a></p>
<p>The application is simple to use, very user friendly and has worked well from the testing I have done. It costs just £10 and there is a free trial available so you can try before you buy.</p>
<p><a href="http://menial.co.uk/software/base/">Find out more and download here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gotripod.com/2008/11/20/excellent-os-x-sqlite-3-management-query-app/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
