<?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>SickBiscuit</title>
	<atom:link href="http://sickbiscuit.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://sickbiscuit.com/blog</link>
	<description>The personal blog of Steven Wilkin</description>
	<lastBuildDate>Wed, 04 Apr 2012 10:54:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>An introduction to Sinatra</title>
		<link>http://sickbiscuit.com/blog/2012/03/27/an-introduction-to-sinatra/</link>
		<comments>http://sickbiscuit.com/blog/2012/03/27/an-introduction-to-sinatra/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 23:48:40 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Sinatra]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://sickbiscuit.com/blog/?p=613</guid>
		<description><![CDATA[Tonight I gave an introductory talk about Sinatra at the second meetup of BelfastRuby.
The Converser platform I&#8217;ve been building this last while uses a lot of Sinatra so when I was asked to give a talk about using Ruby to develop web apps without Rails it wasn&#8217;t hard to think of a subject.
This was my [...]]]></description>
			<content:encoded><![CDATA[<p>Tonight I gave an introductory talk about <a href="http://www.sinatrarb.com/">Sinatra</a> at the second meetup of <a href="http://belfastruby.com">BelfastRuby</a>.</p>
<p>The <a href="http://converser.io">Converser platform</a> I&#8217;ve been building this last while uses a lot of Sinatra so when I was asked to give a talk about using Ruby to develop web apps without Rails it wasn&#8217;t hard to think of a subject.</p>
<p>This was my first technical talk and apart from a touch of nerves and forgetting some of the jokes I had in mind I think things went well. Maybe I&#8217;ll end up giving another one before too long <img src='http://sickbiscuit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The slides are available at <a href="http://belfast-ruby-sinatra.heroku.com">belfast-ruby-sinatra.heroku.com</a> and make use of <a href="https://github.com/schacon/showoff">showoff</a> which itself uses Sinatra. Meta.</p>
<p>The source, including the code samples, is on <a href="https://github.com/stevenwilkin/belfast-ruby-sinatra">GitHub</a>.</p>
<p><strong>Update:</strong> some photos from the evening are now <a href="http://www.flickr.com/photos/fillyc/sets/72157629323664172">available on Flickr</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://sickbiscuit.com/blog/2012/03/27/an-introduction-to-sinatra/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tracking my coffee consumption with Redis, Sinatra and Cocoa</title>
		<link>http://sickbiscuit.com/blog/2012/03/07/tracking-my-coffee-consumption-with-redis-sinatra-and-cocoa/</link>
		<comments>http://sickbiscuit.com/blog/2012/03/07/tracking-my-coffee-consumption-with-redis-sinatra-and-cocoa/#comments</comments>
		<pubDate>Wed, 07 Mar 2012 22:00:17 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Coffee]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Redis]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Sinatra]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://sickbiscuit.com/blog/?p=608</guid>
		<description><![CDATA[I&#8217;ve often joked about putting together an app to track my coffee consumption, such is my reputation for consuming the black goodness. Like a lot of my other personal projects, the idea had a prolonged gestation period and was finally born through a welcome spark of motivation.
 Crafting fine web APIs
Over the past 6 months [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve often joked about putting together an app to track my coffee consumption, such is my reputation for consuming the black goodness. Like a lot of my other personal projects, the idea had a prolonged gestation period and was finally born through a welcome spark of motivation.</p>
<h2> Crafting fine web APIs</h2>
<p>Over the past 6 months the bulk of what I&#8217;ve been doing day to day with <a href="https://twitter.com/vigill">Vigill</a> has involved building web APIs for consumption by mobile clients. This has involved lots of <a href="http://www.sinatrarb.com/">Sinatra</a>, <a href="http://redis.io/">Redis</a> and <a href="http://mongodb.org/">MongoDB</a>.</p>
<p>In this time I&#8217;ve also put together a <a href="/blog/2011/11/01/my-also-ran-markdown-editor-for-os-x/">couple more</a> <a href="/blog/2012/01/31/a-simple-app-to-monitor-google-chrome-on-os-x/">Cocoa apps</a>.</p>
<h2>Thick client boogie</h2>
<p>An unexpected resurgance in enthusiam for developing desktop apps combined with a fluency in cranking out webservices put me in a good position to put together a simple API and client.</p>
<p>I&#8217;m not a big user of mobile apps but I do spend the bulk of my waking hours sitting in front of a Mac so producing a client for OS X was the logical choice.</p>
<p>For the API I considered using something a bit more esoteric than my standard toolkit, but no matter what combination of technologies I investigated not much seems to come close to the power and flexibilty I find with Ruby and it&#8217;s frameworks for performing the bulk of tasks required by the web applications of today.</p>
<h2>Areas of note</h2>
<p>A valid API key must be sent in the request headers when sending a POST to the Sinatra app. Validity of the key is determined by <a href="http://redis.io/commands/sismember">checking set membership</a> in Redis. A 4xx status code is returned if the key is missing or invalid.</p>
<p>The daily count is boosted with an <a href="http://redis.io/commands/hincrby">atomic increment of a hash field</a>.</p>
<p>The client is not much more than a GUI wrapper around some HTTP requests sent using <a href="https://github.com/AFNetworking/AFNetworking/">AFNetworking</a>. A <a href="/blog/2011/05/19/an-ios-client-for-my-uk-inflation-app/">previous native iOS client</a> I developed used <a href="https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSURLRequest_Class/Reference/Reference.html">NSURLRequest</a> directly and I found AFNetworking <em>much</em> simpler to use.</p>
<h2>Get the code</h2>
<p>The <a href="https://github.com/stevenwilkin/coffee-tracker">source for the API</a> and <a href="https://github.com/stevenwilkin/coffee-tracker-client-osx">the OS X client</a> is available on GitHub as usual and some further technical details are available in the READMEs.</p>
<p>You can keep up to date with my coffee consumption at <a href="http://coffee-tracker.herokuapp.com/">coffee-tracker.herokuapp.com</a>.</p>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://sickbiscuit.com/blog/2012/03/07/tracking-my-coffee-consumption-with-redis-sinatra-and-cocoa/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A simple app to monitor Google Chrome on OS X</title>
		<link>http://sickbiscuit.com/blog/2012/01/31/a-simple-app-to-monitor-google-chrome-on-os-x/</link>
		<comments>http://sickbiscuit.com/blog/2012/01/31/a-simple-app-to-monitor-google-chrome-on-os-x/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 01:12:54 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Open-Source]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://sickbiscuit.com/blog/?p=605</guid>
		<description><![CDATA[I was on-site with Vigill one day before Christmas and I mentioned to Oisin an idea I had for an app.
I was sick of having endless tabs open in Chrome, hogging memory, each one some seeming important enough at the time that I read it but now just a contextless enigma.
If I at least knew [...]]]></description>
			<content:encoded><![CDATA[<p>I was on-site with <a href="https://twitter.com/_vigill">Vigill</a> one day before Christmas and I mentioned to <a href="https://twitter.com/oisin">Oisin</a> an idea I had for an app.</p>
<p>I was sick of having endless tabs open in Chrome, hogging memory, each one some seeming important enough at the time that I read it but now just a contextless enigma.</p>
<p>If I at least knew how many tabs I had open, it would be a step in the right direction I thought. There&#8217;s got to be an app for that, right? Not that I could see. Opportunity knocks.</p>
<h2>Enter AppleScript</h2>
<p>I knew that <a href="http://en.wikipedia.org/wiki/AppleScript">AppleScript</a> would likely give me the functionality I was after so that night in the hotel I installed the Ruby version of the easier to use though now abandoned <a href="http://appscript.sourceforge.net/">AppScript</a> and was eventually able to get some details out of a running instance of Chrome concerning it&#8217;s open tabs.</p>
<p>Over the Christmas holidays I spent an evening playing with the NSAppleScript class and figuring out how to add an item into the OS X status bar. Huzzah!</p>
<h2>Give it a name</h2>
<p>Naming things and cache invalidation, 2 notoriously hard things. Inspiration soon struck though and I stumbled upon a catchy name for the app which corresponded to an available dot com domain. I didn&#8217;t register it straight away but later in a moment of entusiasm I whipped out a card card and starting piecing together a single page site with <a href="http://twitter.github.com/bootstrap/">Bootstrap</a> to give the app somewhere to live online.</p>
<p>Oisin and myself have been using Bootstrap a lot these last few months as we&#8217;ve been building out the Vigill platform and it&#8217;s truely a godsend for those of use with the natural tendency to produce apps which look like they&#8217;ve been designed by a programmer. I recommended it highly.</p>
<h2>The Future</h2>
<p>To date the app doesn&#8217;t do much, it sits in you status bar, displaying the number of open tabs in Chrome. You can click on the number and choose to quit the app. Fits a need but it&#8217;s nothing fancy.</p>
<p>Suggestions have included to show how long the oldest tab has been open, how much memory is being used and even an idea to apply some gamification and have an online leaderboard of tab fetishists.  </p>
<p>As with all my personal projects I never know if I&#8217;ll ever come back to them after the initial buzz of motivation has passed. In the early days of this blog, nearly <a href="http://sickbiscuit.com/blog/2006/08/09/its-alive/">6 years ago now, I was hacking on desktop apps</a> and I can feel myself being drawn back to the world of compilers and executables so chances are good I&#8217;ll revisit this app in order to sharpen my skills with Objective-C and Cocoa. Suggestions on a postcard please.</p>
<h2>Get It</h2>
<p>The app is available to download from <a href="http://chromitor.com">chromitor.com</a> and the code is available on <a href="https://github.com/stevenwilkin/chromitor">GitHub</a>, hopefully you&#8217;ll find it useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://sickbiscuit.com/blog/2012/01/31/a-simple-app-to-monitor-google-chrome-on-os-x/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>My also-ran Markdown Editor for OS X</title>
		<link>http://sickbiscuit.com/blog/2011/11/01/my-also-ran-markdown-editor-for-os-x/</link>
		<comments>http://sickbiscuit.com/blog/2011/11/01/my-also-ran-markdown-editor-for-os-x/#comments</comments>
		<pubDate>Tue, 01 Nov 2011 01:33:41 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Open-Source]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://sickbiscuit.com/blog/?p=587</guid>
		<description><![CDATA[Quite often I feel the need to learn something new for the sake of learning something new. Covey aficionados would know this as sharpening the saw.
I usually struggle deciding upon something however as there are so many areas to choose from in the software world and it isn&#8217;t everyday I feel drawn enough to something [...]]]></description>
			<content:encoded><![CDATA[<p>Quite often I feel the need to learn something new for the sake of learning something new. <a href="http://en.wikipedia.org/wiki/The_Seven_Habits_of_Highly_Effective_People">Covey aficionados</a> would know this as <em>sharpening the saw</em>.</p>
<p>I usually struggle deciding upon something however as there are so many areas to choose from in the software world and it isn&#8217;t everyday I feel drawn enough to something to put time and effort into it on top of holding down a day job.</p>
<p>Five years ago it was Rails, two years ago it was testing that I wanted to improve my skills with and I&#8217;m now waiting on whatever will be the next major piece of technology or practice I feel I need to push myself towards.</p>
<h2>Before the web</h2>
<p>When I started out teaching myself to write code I didn&#8217;t have access to the Internet and the web as we know it didn&#8217;t exist. My output was to evolve from simple CLI programs to games to desktop apps.</p>
<p>These past years a lot of my work life has involved developing web software with scripting languages. Compilers, graphics routines and assembly language have all started to become lost in the mists of time.</p>
<p>Returning to desktop software development seemed like both an interesting challenge and a break from dealing with the web. As I&#8217;ve little interest in cross-platform toolkits this meant Objective-C and Cocoa, technologies which I pick up every once in a while but haven&#8217;t produced much with. But what exactly to develop?</p>
<h2>Eating my own dog food</h2>
<p>In May I was working on-site with a client in Dublin and had to produce some documentation for the analytics platform I was building at the time. As usual I chose <a href="http://daringfireball.net/projects/markdown/">Markdown</a> and put up with the workflow of editing the content in Vi and running it through the supplied Perl script to see what the HTML, which was eventually to handed over to the client, looked like.</p>
<p>It struck me that here was repeated effort I could automate with software and there didn&#8217;t appear to be a widespread, simple Markdown editor for OS X. An opportunity at last to start work on a first offering from my software company I thought.</p>
<h2>The possible beginnings of a product-based business</h2>
<p>Over the course of a few months I added a bit of code here and an interface tweak there, mostly while staying in hotel rooms in Dublin. Any time I wanted to edit some Markdown I used the app and it suited my purposes fine.</p>
<p>I toyed with the idea of publishing what I had on the Mac App Store. I shared the binary with a couple of people to see what they made of it and was extremely pleased when one asked if it was ok to pass the app on. I could see a possible path opening before me allowing me to start stepping away from a consultancy business model to one centred on selling products.</p>
<h2>Beaten to it</h2>
<p>Life moved on though, I started a new contract which gave me a lot of new technology to play with and development of this side project was put on hold.</p>
<p>About a month ago I spotted <a href="http://mouapp.com/">Mou</a>. Not only was it more complete than my effort but it was better designed than I could hope for considering the limitations on my time and Cocoa experience. &#8220;Fair play&#8221; I thought, I wasn&#8217;t quick or decisive enough and as a result, if I&#8217;m to build this planned business it will have to be on the back of a different product.</p>
<p>Today I spotted <a href="http://markedapp.com/">Marked</a> and a quick search turns up a number of other apps and text-editor plugins. Such is life.</p>
<h2>Open source</h2>
<p>As of today it&#8217;s been over 3 months since the last commit to the repo and many superior alternatives exist so I thought I may as well give it away.</p>
<p>The app suits my needs though it would be even better if it could saving/load files from the local filesystem. I may well tinker with it for my own learning purposes but who knows what side-project my interests will wander to next.</p>
<p>The code is available on <a href="https://github.com/stevenwilkin/markdown-app">Github</a> and compiles with Xcode 4.1. Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://sickbiscuit.com/blog/2011/11/01/my-also-ran-markdown-editor-for-os-x/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>A tale of three pull requests</title>
		<link>http://sickbiscuit.com/blog/2011/09/05/a-tale-of-three-pull-requests/</link>
		<comments>http://sickbiscuit.com/blog/2011/09/05/a-tale-of-three-pull-requests/#comments</comments>
		<pubDate>Mon, 05 Sep 2011 22:06:54 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Open-Source]]></category>

		<guid isPermaLink="false">http://sickbiscuit.com/blog/?p=582</guid>
		<description><![CDATA[After years of earning a living through using free software I&#8217;ve finally contributed back to the open-source world.
Frustration
For the two and a half years I&#8217;ve been pushing some personal projects to Github and some of my code I&#8217;ve been told has even been helpful for others. While this is certainly open-source none of my efforts [...]]]></description>
			<content:encoded><![CDATA[<p>After years of earning a living through using free software I&#8217;ve finally contributed back to the open-source world.</p>
<h2>Frustration</h2>
<p>For the two and a half years I&#8217;ve been pushing some personal projects to <a href="https://github.com/stevenwilkin/">Github</a> and some of my code I&#8217;ve been told has even been helpful for others. While this is certainly open-source none of my efforts have affected existing codebases.</p>
<p>Numerous times I&#8217;ve scoured the bug trackers of projects I&#8217;ve had some sort of interest in, on the lookout for an issue I could investigate, even getting as far as reading through upteen lines of foreign code but ultimately unable to add anything.</p>
<h2>A first attempt</h2>
<p>The project I&#8217;ve been working on for my current client, like many other projects, makes use of a handful of libraries.</p>
<p>I discovered one library I&#8217;m using to access an API had failed to implement a feature I required. My choices were to abandon the library and the code I&#8217;d already written using it, open a feature request in the hopes it would be worked on or man up and do the needful myself. Can you guess what I decided upon?</p>
<p>After forking the repo and creating a feature branch I wrote a test for the needed behaviour, wrote some code to implement that behaviour, committed the changes when the test suite passed, pushed to GitHub and finally opened a pull request. Unfortunately the original author decided he didn&#8217;t want that feature in the library at that time.</p>
<p>Such is life, the code fit my own purposes, I was able to get with the task at hand and at the end of the month invoiced my client. Things have been worse.</p>
<h2>Once more with feeling</h2>
<p>A similar situation occured again a bit further down the line: another library I&#8217;ve been using required a small modification to fit in with the constraints placed upon this project. I went through the same procedure as above and this time there has been no response.</p>
<p>Ah well, things could still go either way and at the end of the day I still have the functionality I need.</p>
<h2>Third time lucky</h2>
<p>Last week i was debugging an issue involving authenticating against a <a href="http://en.wikipedia.org/wiki/Security_Assertion_Markup_Language">SAML</a> Identify Provider. I was eventually to deduce that the library in question on this occasion didn&#8217;t support the algorithm used to compute the digital signature of the authentication response.</p>
<p>I drank a lot of espresso, scratched my head a lot and then found a library supporting this algorithm. The downside was there was no documentation or tests.</p>
<p>There was nothing to do but read the code. I was able to get something working after a while and thought it would be a shame not to share my understanding so I wrote a quick test and put in place the mechanics to run the test which in itself yielding some more know how.</p>
<p>Forks, branches, pushes, pull requests, merges, deploys, happy client, problem solved, home time.</p>
<h2>Conclusion</h2>
<p>All I basically contributed was a unit test. I didn&#8217;t invent anything new or expend any great time or effort but I did give something of myself and didn&#8217;t expect anything in return. This has always been the spirit of open-source software and it&#8217;s why I use it all day, every day.</p>
<p>No matter how insignificant you feel your contribution may be, it&#8217;s the small changes that keep the wheels of the open-source machine turning.</p>
<p>The pull request was <a href="https://github.com/wonnage/xmlsec-ruby">merged into master</a>, maybe you&#8217;ll find it useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://sickbiscuit.com/blog/2011/09/05/a-tale-of-three-pull-requests/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>An iOS client for my UK inflation app</title>
		<link>http://sickbiscuit.com/blog/2011/05/19/an-ios-client-for-my-uk-inflation-app/</link>
		<comments>http://sickbiscuit.com/blog/2011/05/19/an-ios-client-for-my-uk-inflation-app/#comments</comments>
		<pubDate>Thu, 19 May 2011 15:15:48 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Screenshot]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://sickbiscuit.com/blog/?p=572</guid>
		<description><![CDATA[After last week&#8217;s great Xcake meet I felt a fresh surge to take on new challenges and bend some less-familiar pieces of technology to my will.
Motivation
The first product of this enthusiasm was a prototype web app built to get a bit more experience with Python and Google App Engine. A few days later it got [...]]]></description>
			<content:encoded><![CDATA[<p>After last week&#8217;s great <a href="http://digitalcircle.org/groups/mobile-apps-xcake">Xcake</a> meet I felt a fresh surge to take on new challenges and bend some less-familiar pieces of technology to my will.</p>
<h3>Motivation</h3>
<p>The first product of this enthusiasm was <a href="/blog/2011/05/12/keeping-an-eye-on-uk-inflation-with-google-app-engine/">a prototype web app</a> built to get a bit more experience with Python and Google App Engine. A few days later it got an API.</p>
<p>The resulting rapid feedback loop led me to pick up my copy of <a href="http://www.amazon.co.uk/gp/1430216263/?tag=sickbiscuitco-21">Beginning iPhone Development</a> which had been sitting gathering dust for the last couple of years and get stuck back into following the examples.</p>
<h3>Revisting Cocoa</h3>
<p>I first dabbled with developing for Cocoa when <a href="/blog/2007/02/28/first-post-from-os-x/">I first started using a Mac</a> and managed a range of &#8220;Hello World&#8221; apps, simple calculators and embedded WebKit views, but nothing substancial came of it. Thankfully a few of the concepts seemed to have stuck and after working through the first few chapters of the book again I felt confident enough to get started on something of my own and an iOS client for <a href="http://ukinflation.appspot.com/">ukinflation.appspot.com</a> seemed a logical choice.</p>
<p>This is the result:<br />
<img src="/blog/wp-content/uploads/2011/05/20110519_uk_inflation_app-resized.png" alt="UK Inflation App - Screenshot" title="UK Inflation App - Screenshot" /></p>
<h3>What I Learnt</h3>
<p>Even though this is a trivial app there have been a few aspects which have been useful from a learning perspective:</p>
<ul>
<li>accessing an external API</li>
<li>decoding JSON</li>
<li>local data persistance with a plist file</li>
<li>interacting with view elements</li>
</ul>
<p>These are all things which could make for useful reference material in the future.</p>
<h3>Moving on</h3>
<p>I&#8217;m not part of the <a href="http://developer.apple.com/programs/ios/">paid iOS developer program</a> at this time so I haven&#8217;t been able to test the app on actual hardware, which would have been nice. I may stump up the 99 bucks to get my hands on Xcode 4 and have the ability to run my code on a device. I may decide to have a crack at developing a desktop Mac app. Who knows.</p>
<p>The topic of <a href="http://en.wikipedia.org/wiki/Push_technology">push notifications</a> was mentioned at the last Xcake so there&#8217;s another potential area of investigation involving both server and client technologies.</p>
<p>Stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://sickbiscuit.com/blog/2011/05/19/an-ios-client-for-my-uk-inflation-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keeping an eye on UK inflation with Google App Engine</title>
		<link>http://sickbiscuit.com/blog/2011/05/12/keeping-an-eye-on-uk-inflation-with-google-app-engine/</link>
		<comments>http://sickbiscuit.com/blog/2011/05/12/keeping-an-eye-on-uk-inflation-with-google-app-engine/#comments</comments>
		<pubDate>Thu, 12 May 2011 10:43:56 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://sickbiscuit.com/blog/?p=553</guid>
		<description><![CDATA[Background
For a long time now whenever I&#8217;m on the search for something interesting to work on that could potentially be of value to myself and others my attention is brought to topics like machine learning, data mining and natural language processing.
These are all areas within computer science which are not particularly easy and have a [...]]]></description>
			<content:encoded><![CDATA[<h3>Background</h3>
<p>For a long time now whenever I&#8217;m on the search for something interesting to work on that could potentially be of value to myself and others my attention is brought to topics like <a href="http://en.wikipedia.org/wiki/Machine_learning">machine learning</a>, <a href="http://en.wikipedia.org/wiki/Data_mining">data mining</a> and <a href="http://en.wikipedia.org/wiki/Natural_language_processing">natural language processing</a>.</p>
<p>These are all areas within computer science which are not particularly easy and have a higher barrier of entry compared to building a typical web application for instance. Yet, if implemented correctly they can provide great insight and fame and fortune are bound to be near.</p>
<p>Joking aside. I studied artificial intelligence at <a href="http://www.qub.ac.uk/schools/eeecs/">university</a> and my undergraduate dissertation was focussed on <a href="http://en.wikipedia.org/wiki/Expert_system">expert systems</a> so I&#8217;ve a bit of exposure to these topics but nothing decidedly practical nor within the past decade.</p>
<h3>Interesting Books</h3>
<p>Some searching on Amazon turned up <a href="http://www.amazon.co.uk/dp/1449388345/tag=sickbiscuitco-21">a couple</a> <a href="http://www.amazon.co.uk/gp/product/0596529325/tag=sickbiscuitco-21">of books</a> which looked to be talking about the type of tasks I was interested in performing.</p>
<p>One thing these books have in common is that they use code examples in <a href="http://python.org/">Python</a>.</p>
<p>For nearly half a decade now a lot of my interest has been with <a href="/blog/2006/10/18/ruby-on-rails/">Ruby and related technologies</a> and so I&#8217;ve largely avoided Python considering the similarity of the space the two languages sit in. A look through the most popular AI books reveiled none using examples written in Ruby however.</p>
<p>The other day I came across a copy of <a href="https://www.packtpub.com/python-text-processing-nltk-20-cookbook/book">another book using Python</a> so I thought I may as well get a bit of hands on experience with the language and take it from there.</p>
<h3>Something Practical</h3>
<p>In the past I&#8217;ve tried to teach myself many languages from books but it has never been until I&#8217;ve needed to use the language for something practical that the know-how stuck.</p>
<p>Thankfully I didn&#8217;t have to wait long until inspiration struck. As a private investor in the current economic climate, a topic that has been in my mind has been the rate of inflation. Everytime I want to check how quickly my assets are being eroded by inflation I have to unleash Google and hope I land on the correct page and from there find the current rate amongst all the other information. This seemed like the perfect fit for <a href="/blog/2010/03/24/home-time-revisited-redeveloping-a-cakephp-application-with-sinatra/">yet another</a> <a href="/blog/2010/08/01/is-it-raining-in-belfast-redux/">single serving web app</a>.</p>
<p>My starting point was to write a Python script to scrape the <a href="http://www.statistics.gov.uk/cci/nugget.asp?id=19">Office for National Statistics</a> for the current value for the <a href="http://en.wikipedia.org/wiki/Retail_Price_Index">Retail Price Index</a>.</p>
<p>Next up was creating a basic web-app with <a href="http://code.google.com/appengine/">App Engine</a>. I&#8217;d tinkering with App Engine a bit previously so it was relatively straight-forward to follow the tutorials and piece together a single page app. Slightly more complicated was reading up on the Datastore and Memcache APIs but there were plenty of examples to follow.</p>
<h3>Conclusion</h3>
<p>The end result is <a href="http://ukinflation.appspot.com/">ukinflation.appspot.com</a>. It&#8217;s basic but deals with the job at hand. It&#8217;s also been a good introduction to various components of the App Engine environment: Datastore, Memcache, Cron, templates and the built-in webapp framework.</p>
<p>I&#8217;ve used in all of these types of technologies in other forms over the years and it&#8217;s amazing that you get so much functionality out of the box and as long as you embrace the constraints, scaling out comes for free.</p>
<p>I&#8217;ve still to make my mind up about Python though, maybe I&#8217;m just too accustomed to Ruby. Still, I&#8217;m glad to have another tool in  the toolbox and to not be restricted to any one set of tech.</p>
<h3>Share the Love</h3>
<p>As always the <a href="https://github.com/stevenwilkin/ukinflation">code is available on GitHub</a>, fork away!</p>
]]></content:encoded>
			<wfw:commentRss>http://sickbiscuit.com/blog/2011/05/12/keeping-an-eye-on-uk-inflation-with-google-app-engine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A minimal Rack app to lookup your external IP address</title>
		<link>http://sickbiscuit.com/blog/2011/02/20/a-minimal-rack-app-to-lookup-your-external-ip-address/</link>
		<comments>http://sickbiscuit.com/blog/2011/02/20/a-minimal-rack-app-to-lookup-your-external-ip-address/#comments</comments>
		<pubDate>Sun, 20 Feb 2011 01:14:41 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://sickbiscuit.com/blog/?p=544</guid>
		<description><![CDATA[I think I first heard the term &#8220;Rack-app&#8221; when I started using Heroku to host a couple of projects. I didn&#8217;t know an awful lot about Rack but I did know that it helped a great deal when it came to getting my Rails and Sinatra apps off my workstation and onto the web.
Tonight I [...]]]></description>
			<content:encoded><![CDATA[<p>I think I first heard the term &#8220;Rack-app&#8221; when I started using <a href="http://heroku.com/">Heroku</a> to host a couple of projects. I didn&#8217;t know an awful lot about <a href="https://github.com/rack/rack">Rack</a> but I did know that it helped a great deal when it came to getting my Rails and Sinatra apps off my workstation and onto the web.</p>
<p>Tonight I thought I&#8217;d have another quick look at how it works, what it takes to build a Rack-app and what information about the request is available to the handler.</p>
<p>The result was the following, an object which responds to <em>call</em> and returns a HTTP response code, headers and a body:</p>
<pre class="ruby">ip = <span style="color:#CC0066; font-weight:bold;">lambda</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>env<span style="color:#006600; font-weight:bold;">|</span>
  <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">200</span>, <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#996600;">&quot;Content-Type&quot;</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;text/plain&quot;</span><span style="color:#006600; font-weight:bold;">&#125;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span>env<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;REMOTE_ADDR&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
run ip</pre>
<p>I have this running on <a href="http://ip.stevenwilkin.com">ip.stevenwilkin.com</a> and it provides the same useful function as <a href="http://whatismyip.com">whatismyip.com</a> but without the ads <img src='http://sickbiscuit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The code is available on <a href="https://github.com/stevenwilkin/ip.stevenwilkin.com">GitHub</a> as always.</p>
]]></content:encoded>
			<wfw:commentRss>http://sickbiscuit.com/blog/2011/02/20/a-minimal-rack-app-to-lookup-your-external-ip-address/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backing up Delicious bookmarks to CouchDB</title>
		<link>http://sickbiscuit.com/blog/2011/01/11/backing-up-delicious-bookmarks-to-couchdb/</link>
		<comments>http://sickbiscuit.com/blog/2011/01/11/backing-up-delicious-bookmarks-to-couchdb/#comments</comments>
		<pubDate>Tue, 11 Jan 2011 23:15:12 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[couchdb]]></category>
		<category><![CDATA[database]]></category>

		<guid isPermaLink="false">http://sickbiscuit.com/blog/?p=531</guid>
		<description><![CDATA[Last year I started researching how CouchDB could be used for the BodyGuard web-app QA platform. Unfortunately I had to put my tinkerings to one side when some extra freelance work came in; contracting during the day and freelancing in the evenings quickly put an end to any spare time and my fitness efforts took [...]]]></description>
			<content:encoded><![CDATA[<p>Last year I started researching how <a href="http://couchdb.apache.org/">CouchDB</a> could be used for the <a href="http://bodyguardapp.com/">BodyGuard</a> web-app QA platform. Unfortunately I had to put my tinkerings to one side when some extra freelance work came in; contracting during the day and freelancing in the evenings quickly put an end to any spare time and my fitness efforts took a hit but I was only self-employed for a short while and it seemed the thing to do.</p>
<p>Since the urgency of the freelance work died down I&#8217;ve been looking for a small project to help me get back up to speed with Couch again and when the rumours of <a href="http://delicious.com/stevebiscuit">Delicious</a> being shutdown surfaced I saw the opportunity.</p>
<p>The code is quite simple but it served to refresh my memory and has an actual practical aspect which is a bonus <img src='http://sickbiscuit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  It&#8217;s available on <a href="https://github.com/stevenwilkin/delicious-couch">GitHub</a> as usual and the instructions below should get you up and running.</p>
<h2>Prerequisites</h2>
<ul>
<li>a pre-Yahoo Delicious account  (they use HTTP Basic Auth for authentication)</li>
<li>CouchDB running on port 5984 on your local machine, I recommend the binary distributions from <a href="http://www.couchone.com/get">CouchOne</a></li>
<li>nokogiri and couchrest gems must be installed:
<pre class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> nokogiri couchrest</pre>
</li>
</ul>
<h2>Clone the code from GitHub</h2>
<pre class="bash">git clone https:<span style="color: #000000; font-weight: bold;">//</span>github.com<span style="color: #000000; font-weight: bold;">/</span>stevenwilkin<span style="color: #000000; font-weight: bold;">/</span>delicious-couch
<span style="color: #7a0874; font-weight: bold;">cd</span> delicious-couch</pre>
<h2>Run the import script to fetch your saved bookmarks</h2>
<pre class="bash"><span style="color: #007800;">USER=</span>username <span style="color: #007800;">PASS=</span>password .<span style="color: #000000; font-weight: bold;">/</span>import.rb</pre>
<p>Substitute your Delicious username and password on the command line</p>
<h2>Create the design document</h2>
<pre class="bash">.<span style="color: #000000; font-weight: bold;">/</span>views.rb</pre>
<h2>Querying the data</h2>
<p>Now that the database had been populated and the views created, the contents can be queried</p>
<h3>View all urls</h3>
<pre class="bash">.<span style="color: #000000; font-weight: bold;">/</span>list_urls.rb</pre>
<h3>View all tags along with their count</h3>
<pre class="bash">.<span style="color: #000000; font-weight: bold;">/</span>count_tags.rb</pre>
<h3>View all urls with a specific tag</h3>
<pre class="bash">.<span style="color: #000000; font-weight: bold;">/</span>urls_by_tag.rb git</pre>
<p>Views all bookmarks tagged with &#8220;git&#8221;</p>
<p>This set of scripts is only scraping the surface of what is possible with CouchDB but it demonstrates the immense power of MapReduce along with the basics of interacting with CouchDB using Ruby. Clone <a href="https://github.com/stevenwilkin/delicious-couch">the code</a> and enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://sickbiscuit.com/blog/2011/01/11/backing-up-delicious-bookmarks-to-couchdb/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Installing RMagick on Debian Lenny</title>
		<link>http://sickbiscuit.com/blog/2010/12/25/installing-rmagick-on-debian-lenny/</link>
		<comments>http://sickbiscuit.com/blog/2010/12/25/installing-rmagick-on-debian-lenny/#comments</comments>
		<pubDate>Sat, 25 Dec 2010 01:39:16 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://sickbiscuit.com/blog/?p=520</guid>
		<description><![CDATA[Just a quick reminder to myself on how I installed RMagick on a Debian 5.0.4 &#8220;lenny&#8221; VPS. All commands to be run as root.
Build ImageMagick from source
curl -O ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
tar xvzf ImageMagick.tar.gz -C /usr/src/
cd /usr/src/ImageMagick-6.6.6-6/
./configure
make
make install
Install the RMagick Gem
gem install rmagick
Bingo!
As an interesting aside, ImageMagick handles a lot of image formats via delegate libraries. I previously [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick reminder to myself on how I installed RMagick on a Debian 5.0.4 &#8220;lenny&#8221; VPS. All commands to be run as root.</p>
<h2>Build ImageMagick from source</h2>
<pre>curl -O ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
tar xvzf ImageMagick.tar.gz -C /usr/src/
cd /usr/src/ImageMagick-6.6.6-6/
./configure
make
make install</pre>
<h2>Install the RMagick Gem</h2>
<pre>gem install rmagick</pre>
<p>Bingo!</p>
<p>As an interesting aside, ImageMagick handles a lot of image formats via delegate libraries. I previously installed RMagick on a CentOS box and had to seperately install TrueType fonts which were necessary for the project in question. These had to be installed <strong>before</strong> ImageMagick and were accessible through <em>yum</em> and the <em>xorg-x11-fonts-truetype</em> package.</p>
]]></content:encoded>
			<wfw:commentRss>http://sickbiscuit.com/blog/2010/12/25/installing-rmagick-on-debian-lenny/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

