<?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>29 Steps &#124; Ruby, Rails, Web 2.0 development and design &#124; UK &#124; Our Blog</title>
	<atom:link href="http://29steps.co.uk/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://29steps.co.uk/blog</link>
	<description>Blog of 29 Steps, a Ruby Rails company in UK</description>
	<lastBuildDate>Sat, 10 Jul 2010 16:09:10 +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>New Ruby Gem &#8211; Amaze SNS version 1.0.1</title>
		<link>http://29steps.co.uk/blog/2010/07/08/new-ruby-gem-amaze-sns-version-1-0-1/</link>
		<comments>http://29steps.co.uk/blog/2010/07/08/new-ruby-gem-amaze-sns-version-1-0-1/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 20:38:39 +0000</pubDate>
		<dc:creator>Chee Yeo</dc:creator>
				<category><![CDATA[amazon]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[gemcutter]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[rubygems]]></category>
		<category><![CDATA[simple notification service]]></category>
		<category><![CDATA[amazon simple notification service]]></category>
		<category><![CDATA[gem]]></category>

		<guid isPermaLink="false">http://29steps.co.uk/blog/?p=121</guid>
		<description><![CDATA[new ruby gem version 1.0.1 which interfaces with the Amazon Simple Notification Service]]></description>
			<content:encoded><![CDATA[<div id="attachment_130" class="wp-caption alignleft" style="width: 726px"><a title="http://rubygems.org/gems/amaze_sns" rel="Rubygems site of Amaze SNS gem" href="http://rubygems.org/gems/amaze_sns" target="_blank"><img class="size-full wp-image-130 " style="margin: 0px; border: 0pt none;" title="Amaze SNS rubygem" src="http://29steps.co.uk/blog/wp-content/uploads/2010/07/gem_r1_c1.jpg" alt="Amaze SNS gem on rubygems.org" width="716" height="239" /></a><p class="wp-caption-text">Amaze SNS rubygem</p></div>
<p>One of the things which I have always wanted to do is to contribute back to the open source community at large. For years I have been using and adopting other people&#8217;s work so its only fair to keep the cycle moving. Since it is my first attempt at creating a ruby gem, I decided to pick an area of usage which is relatively new as well as straight forward to maintain and develop.</p>
<p>This started back in May and Amazon AWS just launched their Simple Notification Service(SNS) for short. After reading through their API and from my earlier brushing with the S3 request protocol for the S3 IPhone App, I had gain more familiarity with how the AWS API calls work and so I made a gem called &#8216;amaze_sns&#8217; which interfaces with the SNS service.</p>
<p>The Amaze SNS gem is in its stable release and its version is at 1.0.1. Please note &#8211; this is different from the amaze-sns gem which has since been yanked from rubygems as it is buggy and not advisable to be used.</p>
<p>To install the latest version, just do</p>
<pre>
<code style="text-align: justify;">sudo gem install amaze_sns</code>
</pre>
<p>The source code can be found at <a class="wp-oembed" title="Amaze SNS source on github" href="http://github.com/cheeyeo/Amazon-SNS-Ruby" target="_blank">http://github.com/cheeyeo/Amazon-SNS-Ruby</a>and the actual rubygems page on <a class="wp-oembed" title="Amaze SNS rubygem page" href="http://rubygems.org/gems/amaze_sns" target="_blank">http://rubygems.org/gems/amaze_sns</a></p>
<p>So far, it has received over 400+ downloads since May but that was mainly for the older version &#8211; amaze-sns &#8211; which due to a fatal flaw I realised did not work. Apologies for those of you who downloaded that earlier version &#8211; I&#8217;m still learning what else can I say.</p>
<p>Version 1.0.1 is confirmed to work and supports quite a few new nifty features if I may say so</p>
<ul>
<li>You can now set attributes for each topic and the Policy attribute of a topic is JSON parsed so you can access it like a hash</li>
</ul>
<ul>
<li>EventMachine support is rolled back to the earlier stable version and you can still use your own code blocks to parse the response.</li>
</ul>
<ul>
<li>Sample code has been provided in the &#8216;examples&#8217; folder.</li>
</ul>
<ul>
<li>Fixed some weird bug whereby the Topic actions does not return the response of an action due to the way the EventMachine reactor loop exits on dual core machines running ruby 1.8.7 ??</li>
</ul>
<p>No doubt this will be an ongoing project as the API is still in a state of flux and so expect further updates as and when they arrive.</p>
<p>Further plans to develop an actual Rails app to showcase it in use in production is in the pipeline.</p>
<p>The eventual goal is to be able to wrap up the requests call within a Rack middleware so it can parse the requests and responses away from the core app.</p>
<p>I have added Pledgie support on the github page &#8211; I know it is only a small thing on the whole scale of things but any contribution you make will go towards allowing me to develop this gem further.</p>
<p>Please feel free to forward any links of projects you have used it in and I will showcase it on a dedicated page for it.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://29steps.co.uk/blog/2010/07/08/new-ruby-gem-amaze-sns-version-1-0-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>IPhone video streaming take 1 &#8211; Compiling the segmenter on OS X 10.5</title>
		<link>http://29steps.co.uk/blog/2010/06/06/iphone-video-streaming-take-1-compiling-the-segmenter-on-os-x-10-5/</link>
		<comments>http://29steps.co.uk/blog/2010/06/06/iphone-video-streaming-take-1-compiling-the-segmenter-on-os-x-10-5/#comments</comments>
		<pubDate>Sun, 06 Jun 2010 20:08:26 +0000</pubDate>
		<dc:creator>Chee Yeo</dc:creator>
				<category><![CDATA[html]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[m3u8]]></category>
		<category><![CDATA[segementer]]></category>
		<category><![CDATA[video streaming]]></category>

		<guid isPermaLink="false">http://29steps.co.uk/blog/?p=110</guid>
		<description><![CDATA[Short extract on video streaming on the IPhone platform.]]></description>
			<content:encoded><![CDATA[<p>One of the main features I wanted to incorporate into Cuepoint App originally was the encoding of a video into a format suitable for streaming on the Iphone. After reading an article from <a href="http://www.ioncannon.net/programming/452/iphone-http-streaming-with-ffmpeg-and-an-open-source-segmenter/">http://www.ioncannon.net/programming/452/iphone-http-streaming-with-ffmpeg-and-an-open-source-segmenter/</a> I tried to compile the segmenter in the article on os x 10.5. After several attempts I gave up and only recently did I manage to get it to compile and function properly on the os x platform. Although the segmenter still throws out &#8216;mpegts &lt; dts &#8216; errors at least it did compile and generate the relevant ts and m3u8 files necessary to allow a video to stream on the IPHone simulator as a test bed.</p>
<p>Here are the steps I took:</p>
<ol>
<li>First download the latest ffmpeg version from the svn repo. The revision number I used was 23197</li>
<li> Next download the segmenter from the article link above. Then edit the Makefile as follows:
<pre>
<code>
gcc -Wall -I/
-g segmenter.c -o segmenter -lavformat -lavcodec -lavutil -lbz2 -lm -lz -lfaac -lmp3lame -lx264 -lfaad
</code></pre>
</li>
</ol>
<p>And that was it. The binary would be compiled into /usr/bin.</p>
<p>In order to test the segmented files you would need to run the processed files within another web application and view it within the safari browser on the IPHone simulator. Below are some screenshots of it in action:</p>
<p><a href="http://29steps.co.uk/blog/wp-content/uploads/2010/06/vid.png"><img class="alignnone size-full wp-image-112" title="Video streaming on Iphone" src="http://29steps.co.uk/blog/wp-content/uploads/2010/06/vid.png" alt="Image of streaming video in Iphone simulator" width="386" height="742" /></a></p>
<p><a href="http://29steps.co.uk/blog/wp-content/uploads/2010/06/vid2.png"><br />
<img class="size-full wp-image-113 alignnone" title="Video streaming on Iphone" src="http://29steps.co.uk/blog/wp-content/uploads/2010/06/vid2.png" alt="IPhone video streaming initial page" width="386" height="742" /></a></p>
<p>In the next follow up I hope to go into further detail on the process involved. Meantime, please checkout the link above and the apple site for documentation on the process.</p>
<p>The following command is adapted from the blog post mentioned previously and works really well for me:</p>
<pre>
<code>ffmpeg -y -i test.m4v -f mpegts -acodec libmp3lame -ar 48000 -ab 128k -vcodec libx264 -s 320x240 -b 1000k -flags +loop -cmp +chroma -subq 5 -trellis 1 -refs 1 -coder 0 -me_range 16 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 1500k -maxrate 1000k -bufsize 1000k -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -g 30 -aspect 320:240 -async 2 output.ts</code>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://29steps.co.uk/blog/2010/06/06/iphone-video-streaming-take-1-compiling-the-segmenter-on-os-x-10-5/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New Ruby gem AmazeSNS</title>
		<link>http://29steps.co.uk/blog/2010/05/03/new-ruby-gem-amazesns/</link>
		<comments>http://29steps.co.uk/blog/2010/05/03/new-ruby-gem-amazesns/#comments</comments>
		<pubDate>Mon, 03 May 2010 13:45:30 +0000</pubDate>
		<dc:creator>Chee Yeo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[asynchronous]]></category>
		<category><![CDATA[eventmachine]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://29steps.co.uk/blog/?p=108</guid>
		<description><![CDATA[New ruby gem plugin AmazeSNS which accesses the Amazon SNS service and also uses EventMachine to speed up requests making it asynchronous]]></description>
			<content:encoded><![CDATA[<p>Hi all,</p>
<p>just a short note that I have released a new plugin on my github account:</p>
<p><a href="http://github.com/cheeyeo/Amazon-SNS-Ruby">http://github.com/cheeyeo/Amazon-SNS-Ruby</a></p>
<p>I&#8217;m still in the process of wrapping up into a gem once the spec tests are passed so please bear with me.</p>
<p>The plugin is designed to integrate with the Amazon Simple Notification Service which is similar to the Pusher service as rolled out by the cool guys at New Bamboo. You can design your next generation of Real Time Web apps using SNS. </p>
<p>For the &#8216;uninitiated&#8217;, RTW (Real Time Web) relies on HTML5 websockets which are bi-directional transport streams between the browser and your app, so the moment you make an update to your app, say added in a new blog post,it can notify all the clients who are designed to listen specifically to that particular event and update the blog page in real time. </p>
<p>Similarly, SNS supports push actions through a &#8216;publish&#8217; action which enables subscribers to a particular &#8216;topic&#8217; to receive messages via email or JSON through SMTP and http respectively. So far, I have only tried out the SMTP delivery option and sadly it does not support HTML messages at this point. </p>
<p>One cool feature of the plugin is the performance and scalability of it when I started developing it. Originally it only used a single HTTPClient object connection. After having caught the EventMachine bug and async IO operations I was curious about whether a EM version of it would really speed things up.</p>
<p>I added in EM and ran some benchmarks and here are the results below:</p>
<p><script src="http://gist.github.com/388098.js?file=gistfile1.rb"></script></p>
<p>100 requests were made to SNS service backend. As you can see, each httpclient request averages 0.75 secs whereas with EM it only takes 0.27 secs! That is less than half and by using EM in conjunction with EventMachine::HttpRequest or the em-http gem, that also supports Deferrable module in EM which means higher concurrency and parallel requests.</p>
<p>This is my first attempt at writing a gem or plugin so your comments and feedback are welcome as it is not perfect by any means. </p>
<p>I also want to thank the following gem authors: Pusher and Happening, from which AmazeSNS borrows some of its ideas from. </p>
]]></content:encoded>
			<wfw:commentRss>http://29steps.co.uk/blog/2010/05/03/new-ruby-gem-amazesns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RVM Rocks</title>
		<link>http://29steps.co.uk/blog/2010/04/12/rvm-rocks/</link>
		<comments>http://29steps.co.uk/blog/2010/04/12/rvm-rocks/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 10:03:04 +0000</pubDate>
		<dc:creator>Chee Yeo</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[multiple versions]]></category>
		<category><![CDATA[RVM]]></category>

		<guid isPermaLink="false">http://29steps.co.uk/blog/?p=94</guid>
		<description><![CDATA[Using RVM (Ruby Version Manager) to manage different Ruby versions on 1 machine.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve learnt about RVM (Ruby Version Manager) through a contact of mine and decided to try it out for myself as to how easy it is to manage multiple versions of Ruby on one dev machine. And it does exactly what it says on the tin &#8211; it just works out of the box!</p>
<p>I already have Ruby 1.9 installed locally with the alias of &#8216;ruby19&#8242; through a manual install but the problem with that approach is that you would have to reference that directly within your own Ruby scripts and to remember to call &#8216;irb19&#8242; version of that. Add in multiple versions and you would have a management crisis at hand.</p>
<p>With RVM, it manages all these versions for you without any conflicts. All you need to change from one version to another is to type the following in terminal</p>
<pre><code>rvm 1.9.1 # this switches to ruby 1.9.1 assuming you have it installed</code></pre>
<p>Here&#8217;s what I did to install RVM on an OS X 10.5.8 :</p>
<p>Firstly,  I installed the gem version of rvm:
<pre><code>sudo gem install rvm</code></pre>
<p>You can run the bash script as documented on the RVM documentation site but I had permission issues on mkdir on here. The important thing to note is not to use sudo as that will present problems further down the road. Ideally the command you want to achieve is &#8216;rvm <whatever>&#8216; without needing to be root.</p>
<p>Once the gem is installed, I run the following command:
<pre><code>rvm-install</code></pre>
<p>This will install rvm on your local machine, creating a binary at &#8216;/usr/local/bin/rvm&#8217;. Run &#8216;which rvm&#8217; to make sure it is all working.</p>
<p>The fun part is to install a ruby version of your choice. I went for Ruby 1.9 but you can choose whichever version you want.  The command is as simple as :</p>
<pre><code>rvm install 1.9.1</code></pre>
<p>This will fetch a copy of the source and compile it so it will take a while.</p>
<p>Once that is complete, open up a new terminal or tab and type the following:</p>
<pre><code> rvm list</code></pre>
<p>This is my display on my local machine:</p>
<pre><code>
  rvm Rubies
<br/>ruby-1.9.1-p378 [ i386 ]<br/><br/>System Ruby<br/>system [ ppc i386 ]<br/>
</code>
</pre>
<p>To switch back to your default system verison of ruby just type:</p>
<pre><code>rvm system</code></pre>
<p>In order to see the changes , you would need to switch to a new tab after the RVM and Ruby install or else it does not show up. </p>
<p>In addition I have to append the following two lines at the bottom of both my &#8216;.bashrc&#8217; and &#8216;.bash_profile&#8217; files:</p>
<pre>
 <code>
  if [[ -s /Users/cheeyeo/.rvm/scripts/rvm ]] ; then source /Users/cheeyeo/.rvm/scripts/rvm ; fi
</code>
</pre>
<p>This adds the path to your rvm install on your home directory so you can access the rvm and rvm install commands.</p>
<p>Another quick tip: if you want to use a specific version of Ruby on startup, just set its default:</p>
<pre>
<code>
  rvm --default <version></code>
</pre>
<p>More information and examples can be found on the RVM website:  <a href="http://rvm.beginrescueend.com/" target="_blank">http://rvm.beginrescueend.com/</a></p>
<p>It is really worth trying out and you will be surprised how much time it saves you on managing multiple ruby versions.</p>
]]></content:encoded>
			<wfw:commentRss>http://29steps.co.uk/blog/2010/04/12/rvm-rocks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick March 2010 update</title>
		<link>http://29steps.co.uk/blog/2010/03/23/quick-march-2010-update/</link>
		<comments>http://29steps.co.uk/blog/2010/03/23/quick-march-2010-update/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 12:31:11 +0000</pubDate>
		<dc:creator>Chee Yeo</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[march]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://29steps.co.uk/blog/?p=92</guid>
		<description><![CDATA[quick update for march 2010]]></description>
			<content:encoded><![CDATA[<p>First off, I did not make the initial commitment I promised myself which was to write one blog post every week so I&#8217;m going to take that back and just make blog posts when it is appropriate to do so. I think there is a world of difference in making blog posts for the sake of filling up space compared to talking about a specific issue.</p>
<p>Just a quick update on my progress. I have been busy doing commercial work for the past two months with various clients, one of which is helping Hermes Technologies to relaunch their web application, <a href="http://hiredhelp.ie">HiredHelp.ie</a> , to make it suitable for deployment onto Heroku. One of the significant aspects of it is to redevelop their search capabilities to run on SOLR, rather than xapain as the former is supported by Heroku. That is still ongoing as we speak.</p>
<p>On another footnote, my own <a href="http://itunes.apple.com/us/app/s3-app/id360581069?mt=8">iphone application</a>, <a href="http://itunes.apple.com/us/app/s3-app/id360581069?mt=8">S3 app</a> has been officially launched and accepted by the app store. After several bug fixes and reviews the hard work has paid off and I was ecstatic to find out today that was the case. I want to  thank the developers of ASIHTTP request library and Tapku library for the brilliant work they did on their open source projects, none of which this app will not have been what it is.</p>
<p>What&#8217;s next in the pipeline? I am working hard on pushing forward some of my own work which will be sold as products on the main site. One of which is a video encoding system and another a calendar application running on Redis DB, and it functions similarly to iCal but in the browser. Check this space for more details.</p>
<p>However back to the grind as they say!</p>
]]></content:encoded>
			<wfw:commentRss>http://29steps.co.uk/blog/2010/03/23/quick-march-2010-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Phusion Passenger and memcache</title>
		<link>http://29steps.co.uk/blog/2010/01/01/passenger-memcache/</link>
		<comments>http://29steps.co.uk/blog/2010/01/01/passenger-memcache/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 17:40:46 +0000</pubDate>
		<dc:creator>Chee Yeo</dc:creator>
				<category><![CDATA[apache2]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[memcache]]></category>
		<category><![CDATA[passenger]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://29steps.co.uk/blog/?p=73</guid>
		<description><![CDATA[Fix Passenger with memcache spawn processes issue]]></description>
			<content:encoded><![CDATA[<p>One of my recently deployed Rails app uses memcache with Phusion Passenger. I read on the Phusion documentation about the possibility of corrupted commands issued to memcache through the spawned processes within Passenger. </p>
<p>I added the declarations below within the config/environment.rb file to overcome this issue:</p>
<pre>
<code>
   &nbsp;&nbsp;&nbsp;begin
   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PhusionPassenger.on_event(:starting_worker_process) do |forked|
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if forked
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# We're in smart spawning mode, so...
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Close duplicated memcached connections - they will open themselves
       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CACHE.reset
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end
   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# In case you're not running under Passenger (i.e. devmode with mongrel)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rescue NameError => error
&nbsp;&nbsp;&nbsp;end
 </code>
</pre>
<p>The CACHE constant is set within the cache_fu plugin. All the declaration does is similar to that outlined in the Appendix of the Phusion documentation with the addition of the &#8216;begin..rescue&#8217; block to counteract exceptions which may arise.</p>
<p>I understand from comments on the Passenger google group that cache_fu causes problems with memcached. If anyone has any further information on the above please feel free to comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://29steps.co.uk/blog/2010/01/01/passenger-memcache/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New Year Resolutions 2010</title>
		<link>http://29steps.co.uk/blog/2010/01/01/new-year-resolutions-2010/</link>
		<comments>http://29steps.co.uk/blog/2010/01/01/new-year-resolutions-2010/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 17:25:58 +0000</pubDate>
		<dc:creator>Chee Yeo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://29steps.co.uk/blog/?p=52</guid>
		<description><![CDATA[Happy new year 2010]]></description>
			<content:encoded><![CDATA[<p><img class="postimg" title="new year 2010" src="http://29steps.co.uk/blog/wp-content/uploads/2010/01/new_year_banner.jpg" alt="Happy New Year 2010" title="new_year_banner" width="468" height="70" class="size-full wp-image-62" /></p>
<p>I&#8217;m not a firm believer of new year resolutions as I tend not to be able to keep them for some reason or other. But I thought for 2010 I might try a different approach and adopt some to keep myself occupied while waiting for my next gig.</p>
<p>The list below is by no way complete ( in fact, a simple app could be built to manage it??):</p>
<h3>Write more regular blog posts</h3>
<p>At least once or twice a week. May not have to be technical but at least topical</p>
<h3> List of technologies to look out for:</h3>
<p>    2010 is going to be an exciting time for the development of Rails 3 but also in these areas I&#8217;m particularly<br />
   interested in: <strong>cloud computing; collaborative map-reduce problem solving; HTML 5; new schemaless databases</strong>
    </p>
<h3>Keep more up to date than before</h3>
<p> I tend to spend too much time on projects so the idea is to speed up development so I can have<br />
more free time to myself to keep up to date with the latest and greatest as well as for my personal life.<br />
This means rethinking on my current way of working and applying the 80-20 principle</p>
<h3>Be Faster,Better,Stronger</h3>
<p>No pun intended on the Daft Punk song but to be better and faster at what I can do</p>
<p>Also a big Thank You to all those who supported 29 Steps. All my best wishes to you for 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://29steps.co.uk/blog/2010/01/01/new-year-resolutions-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>acts_as_xapian numeric range searching</title>
		<link>http://29steps.co.uk/blog/2009/12/30/acts_as_xapian-numeric-range-searching/</link>
		<comments>http://29steps.co.uk/blog/2009/12/30/acts_as_xapian-numeric-range-searching/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 16:38:51 +0000</pubDate>
		<dc:creator>Chee Yeo</dc:creator>
				<category><![CDATA[acts_as_xapian]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[xapian]]></category>

		<guid isPermaLink="false">http://29steps.co.uk/blog/?p=49</guid>
		<description><![CDATA[Fixing the 'unknown range' operation error in acts_as_xapian plugin]]></description>
			<content:encoded><![CDATA[<p>I recently implemented Xapian and the acts_as_xapian plugin into my rails project. However, I ran into the &#8216;Unknown range&#8217; operation error. </p>
<p>By applying the patches listed <a href="http://pastie.org/304493" target="_blank">here </a> and <a href="http://pastie.org/304481" target="_blank">here</a>, that solves the problem for me.</p>
<p>Please note that the changes have to be made to the &#8216;acts_as_xapian&#8217; lib file within the vendors directory and then rebuild your index and restart your web app before seeing the changes take effect.</p>
<p>Also, if you are performing a numeric range search don&#8217;t prefix the values with &#8216;:&#8217;</p>
<p> For example, searching for &#8216;prices0..100&#8242; is a numeric range search while &#8216;prices:low&#8217; is a term search for specific attribute of that model.</p>
]]></content:encoded>
			<wfw:commentRss>http://29steps.co.uk/blog/2009/12/30/acts_as_xapian-numeric-range-searching/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using cache_fu with will_paginate</title>
		<link>http://29steps.co.uk/blog/2009/12/30/using-cache_fu-with-will_paginate/</link>
		<comments>http://29steps.co.uk/blog/2009/12/30/using-cache_fu-with-will_paginate/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 16:03:31 +0000</pubDate>
		<dc:creator>Chee Yeo</dc:creator>
				<category><![CDATA[cache]]></category>
		<category><![CDATA[memcache]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[will_paginate]]></category>
		<category><![CDATA[cache expiry]]></category>
		<category><![CDATA[cache_fu]]></category>

		<guid isPermaLink="false">http://29steps.co.uk/blog/?p=38</guid>
		<description><![CDATA[How to expire cached actions with cache_fu and will_paginate]]></description>
			<content:encoded><![CDATA[<p>Firstly, apologies for not updating regularly enough (last post was in September &#8211; yikes!). We have been busy working on two freelance projects since then: firstly with <a href="http://www.southeastscotlandforum.ac.uk/" target="_blank">South East Forum</a> for 55 Degrees; and finally with <a href="http://hiredhelp.ie" target="_blank">HiredHelp</a>, which is a service provider listing page for Hermes Technologies based in Ireland.</p>
<p>I want to start off the new series of posts with interesting tidits I learnt while developing on these two projects.</p>
<p>On the HiredHelp website, we try to cache as much of the DB calls as possible using memecached with the cache_fu plugin. One of the obstacles we came across was if we had to cache the index action of say a list of babysitters with pagination added in, the subsequent paginated pages do not show. This is due to the fact that the cache is storing the page as &#8216;babysitters/index&#8217; and not &#8216;babysitters?page=xxx&#8217;. </p>
<p>You will need to provide a &#8216;cached_path&#8217; to the caches_action in the controller.</p>
<p>For example:</p>
<p>This is the &#8216;caches_action&#8217; method within the controller:</p>
<pre>
  <code>
      caches_action :index, :cache_path => :index_cache_path.to_proc
      <br/>
      def index
        @babysitters = Babysitter.cached(:list).paginate(:page =&gt; params[:page],:per_page =&gt; 10)
      end
   <br/>
  private
        def index_cache_path
          p = ''
          p = params[:page] if params[:page] and params[:page] != 1
          'babysitters/' + p
    end
   </code>
</pre>
<p>The &#8216;cached&#8217; method was provided by cache_fu and calls the method &#8216;list&#8217; within the Babysitter model. The index_cache_path method simply appends the page params from the wii_paginate plugin to the end of the index url. So pages like &#8216;babysitters?page=2&#8242; will be cached as &#8216;babysitters/2&#8242; etc.</p>
<p>Now to expire the paginated pages, I wrote a custom method within my sweepers file:</p>
<pre>
  <code>
  #within BabysitterSweeper
  <br/>
  def expire_cache
    total = (Babysitter.list.size.to_i)
    if total <= 10
      expire_fragment("babysitters/index")
    else
      pages = (total % 10) + (total /10) -1
      1.upto(pages) do |page|
        expire_fragment("babysitters/#{page}")
      end
      expire_fragment("babysitters/index")
      <br/>
    end
  end
  </code>
</pre>
<p> The method computes the number of listings allowed per page as stipulated in the wii_paginate call in the index action. In our case it is 10. If the number of entries is less than 10, that means we only expire the index action. If not, we calculate the number of paginated pages there are. If we have say 22 entries that will be split into 3 paginated pages with 2 pages containing 10 entries and a third page with 2 entries. The &#8216;expire_cache&#8217; method will expire the fragements labelled &#8216;babysitters/2&#8242; etc from the index call such as &#8216;babysitters?page=2&#8242;.</p>
]]></content:encoded>
			<wfw:commentRss>http://29steps.co.uk/blog/2009/12/30/using-cache_fu-with-will_paginate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compiling C libraries on OS X</title>
		<link>http://29steps.co.uk/blog/2009/09/24/compiling-c-libraries-on-os-x/</link>
		<comments>http://29steps.co.uk/blog/2009/09/24/compiling-c-libraries-on-os-x/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 21:01:29 +0000</pubDate>
		<dc:creator>Chee Yeo</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[compiling]]></category>

		<guid isPermaLink="false">http://29steps.co.uk/blog/?p=36</guid>
		<description><![CDATA[If you have compiled or built shared C libraries before you would have come across the following code:

  
     gcc -c -fPIC some_code.c -o some_code.o
      gcc -shared -Wl,-soname,mylib.so.1 -o mylib.so.1.0.1  some_code.o
   

The above essentially compiles native C code into object files using [...]]]></description>
			<content:encoded><![CDATA[<p>If you have compiled or built shared C libraries before you would have come across the following code:</p>
<pre>
  <code>
     gcc -c -fPIC some_code.c -o some_code.o<br/>
      gcc -shared -Wl,-soname,mylib.so.1 -o mylib.so.1.0.1  some_code.o
   </code>
</pre>
<p>The above essentially compiles native C code into object files using gcc compiler and then linking it into a library called &#8216;mylib.so&#8217;.</p>
<p>If you issue the command above on a MAC, you will get the following errors:</p>
<pre>
   <code>
      /usr/bin/ld: unknown flag: -soname
      collect2: ld returned 1 exit status
    </code>
</pre>
<p>Within OS X, the second command will not work as OS X treats shared libraries as dynamic libraries. The second line needs to be changed to:</p>
<pre>
   <code>
      gcc -Wall -D_FILE_OFFSET_BITS=64 -fPIC -arch ppc -arch i386 -arch x86_64 -dynamiclib -o mylib.dylib calc_mean.o
   </code>
</pre>
<p>Then move the shared library mylib.dylib into &#8216;/usr/lib/&#8217;:</p>
<pre>
  <code>
    sudo cp -v mylib.dylib /usr/lib/
  </code>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://29steps.co.uk/blog/2009/09/24/compiling-c-libraries-on-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
