<?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>Yak Shaving</title>
	<atom:link href="http://www.chrishannam.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chrishannam.co.uk</link>
	<description>just me</description>
	<lastBuildDate>Wed, 05 May 2010 11:40:30 +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>Compiling Couchdb on Karmic</title>
		<link>http://www.chrishannam.co.uk/2010/05/compiling-couchdb-on-karmic/</link>
		<comments>http://www.chrishannam.co.uk/2010/05/compiling-couchdb-on-karmic/#comments</comments>
		<pubDate>Wed, 05 May 2010 11:40:30 +0000</pubDate>
		<dc:creator>channam</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.chrishannam.co.uk/?p=287</guid>
		<description><![CDATA[This had my annoyed for a while. When I came to run ./configure I got:

checking for JS_NewContext in -lmozjs... no
checking for JS_NewContext in -ljs... no
checking for JS_NewContext in -ljs3250... no
checking for JS_NewContext in -ljs32... no
configure: error: Could not find the js library.

Is the Mozilla SpiderMonkey library installed?

I was unable to find much help until I [...]]]></description>
			<content:encoded><![CDATA[<p>This had my annoyed for a while. When I came to run ./configure I got:</p>
<pre class="python">
checking for JS_NewContext in -lmozjs... no
checking for JS_NewContext in -ljs... no
checking for JS_NewContext in -ljs3250... no
checking for JS_NewContext in -ljs32... no
configure: error: Could not find the js library.

Is the Mozilla SpiderMonkey library installed?
</pre>
<p>I was unable to find much help until I looked at the instructions for installing from source <a href="http://wiki.apache.org/couchdb/Installing_on_Ubuntu?action=show&#038;redirect=InstallingOnUbuntu">http://wiki.apache.org/couchdb/Installing_on_Ubuntu?action=show&#038;redirect=InstallingOnUbuntu</a>. Which in retrospect would have been a good place to start. Use the following to stop the above error:</p>
<pre class="python">
./configure --with-js-include=/usr/include/xulrunner-1.9.1.9/unstable --with-js-lib=/usr/lib/xulrunner-devel-1.9.1.9/lib
</pre>
<p>Oh and make sure you have xulrunner and its dev package installed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrishannam.co.uk/2010/05/compiling-couchdb-on-karmic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python and Notify OSD</title>
		<link>http://www.chrishannam.co.uk/2010/05/python-and-notify-osd/</link>
		<comments>http://www.chrishannam.co.uk/2010/05/python-and-notify-osd/#comments</comments>
		<pubDate>Sat, 01 May 2010 13:00:59 +0000</pubDate>
		<dc:creator>channam</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.chrishannam.co.uk/?p=285</guid>
		<description><![CDATA[Silly little bit of code that will tell you when a command line operation has finished.

#!/usr/bin/env python

import sys
import pynotify

if __name__ == '__main__':
    if not pynotify.init ("icon-summary-body"):
        sys.exit (1)

    print sys.stdin.read()

    n = pynotify.Notification ("Finished")

    n.show()

This was [...]]]></description>
			<content:encoded><![CDATA[<p>Silly little bit of code that will tell you when a command line operation has finished.</p>
<pre class="python">
#!/usr/bin/env python

import sys
import pynotify

if __name__ == '__main__':
    if not pynotify.init ("icon-summary-body"):
        sys.exit (1)

    print sys.stdin.read()

    n = pynotify.Notification ("Finished")

    n.show()
</pre>
<p>This was based on <a href="https://wiki.ubuntu.com/NotificationDevelopmentGuidelines?action=AttachFile&#038;do=view&#038;target=icon-summary-body.py">https://wiki.ubuntu.com/NotificationDevelopmentGuidelines?action=AttachFile&#038;do=view&#038;target=icon-summary-body.py</a> over on the article <a href="https://wiki.ubuntu.com/NotificationDevelopmentGuidelines">Notify OSD</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrishannam.co.uk/2010/05/python-and-notify-osd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SimpleGeo</title>
		<link>http://www.chrishannam.co.uk/2010/04/simplegeo/</link>
		<comments>http://www.chrishannam.co.uk/2010/04/simplegeo/#comments</comments>
		<pubDate>Sat, 24 Apr 2010 19:56:49 +0000</pubDate>
		<dc:creator>channam</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[simplegeo]]></category>

		<guid isPermaLink="false">http://www.chrishannam.co.uk/?p=266</guid>
		<description><![CDATA[While pottering about I found SimpleGeo.
I&#8217;m still struggling a little for a use case for this. It&#8217;s cool and that&#8217;s enough for me, yes I am that fickle.
Its a simple enough idea and well implemented. You sign up for free. The free account gives you a single &#8220;layer&#8221;. A layer is a collection of data [...]]]></description>
			<content:encoded><![CDATA[<p>While pottering about I found <a href="http://simplegeo.com/">SimpleGeo</a>.</p>
<p>I&#8217;m still struggling a little for a use case for this. It&#8217;s cool and that&#8217;s enough for me, yes I am that fickle.</p>
<p>Its a simple enough idea and well implemented. You sign up for free. The free account gives you a single &#8220;layer&#8221;. A layer is a collection of data points that you wish to map. Paid for accounts allow more layers but as I&#8217;m only playing I&#8217;m not about to find out. Python is well supported but not very well documented.</p>
<p><a href="http://help.simplegeo.com/faqs/api-documentation/clients-and-example-code">http://help.simplegeo.com/faqs/api-documentation/clients-and-example-code</a> contains what you need to get the libs downloaded and running. From here on I&#8217;m going to assume you have got it installed and running.</p>
<p>Creating a record:</p>
<pre class="python">
from simplegeo import Record
r = Record('layername', '1', '53.762282', '-0.355662')
r
<simplegeo.Record object at 0x8dbc9cc>
client.add_record(r)
b = client.add_record(r)
print client.get_record('layername', '1')
{'created': 1270653503, 'geometry':
{'type': 'Point', 'coordinates': [-0.35566199999999998, 53.762281999999999]},
'properties': {'layer': 'layername', 'type': 'object'},
'layerLink': {'href': 'http://api.simplegeo.com/0.1/layer/layername.json'},
'type': 'Feature', 'id': '1', 'selfLink':
{'href': 'http://api.simplegeo.com/0.1/records/layername/1.json'}}
</pre>
<p>The code above creates and saves a record on Simple Geo&#8217;s servers and fetches the same record. Its all pretty simple stuff. Where it gets cool is using get_nearby. This allows you to send a location and get back all data points near that location.</p>
<pre class="python">
print client.get_nearby(layer='layername',arg='53.762281,-0.3456')
{'type': 'FeatureCollection', 'features': [
{'distance': 355.3372151292516, 'created': 1270659182, 'geometry':
{'type': 'Point', 'coordinates': [-0.35099999999999998, 53.762281999999999]},
'properties': {'layer': 'layername', 'type': 'place'}, 'layerLink':
{'href': 'http://api.simplegeo.com/0.1/layer/layername.json'},
'type': 'Feature', 'id': '1', 'selfLink':
{'href': 'http://api.simplegeo.com/0.1/records/layername/1.json'}},
{'distance': 960.75183289629251, 'created': 1271073482, 'geometry':
{'type': 'Point', 'coordinates': [-0.33100000000000002, 53.762281999999999]},
'properties': {'layer': 'layername', 'type': 'place'},
'layerLink': {'href': 'http://api.simplegeo.com/0.1/layer/layername.json'},
'type': 'Feature', 'id': 'TheAdelphi', 'selfLink':
{'href': 'http://api.simplegeo.com/0.1/records/layername/TheAdelphi.json'}}]}
</pre>
<p>Pushing the coolness a bit further is get_density. This takes a location and using Sky Hooks&#8217; <a href="http://www.skyhookwireless.com/spotrank/index.php">Spot Rank</a> will predict the density of people in the supplied location.</p>
<pre class="python">
print client.get_density('51.5019', '-0.1189', 'tue')
</pre>
<p>Also worth a mention is the method get_history. This will return the last 20 locations of the record with the supplied id.</p>
<pre class="python">
print client.get_history('layername', '1')
{'type': 'GeometryCollection', 'geometries': [
{'type': 'Point', 'coordinates': [-0.35099999999999998, 53.762281999999999],
'created': 1270659182},
{'type': 'Point', 'coordinates': [-0.35099999999999998, 53.762281999999999],
'created': 1270659072},
{'type': 'Point', 'coordinates': [-0.35566199999999998, 53.762281999999999],
'created': 1270653503}]}
</pre>
<p>While this is all very cool the only gotcha I have found is that longitude and latitude can be the wrong way round. So if you are getting no hits check the long and lat from get_record are the right way round. This is mentioned in the documentation on the Simple Geo&#8217;s site.</p>
<p>Another super cool feature is the dashboard offered when you login to Simple Geo&#8217;s site. There is a Google maps instance which you can use to find you data on. Handy for debugging.</p>
<p>Due to the almost total lack of documentation I worked out most of the above using source <a href="http://http://github.com/simplegeo/python-simplegeo/blob/master/simplegeo/__init__.py">http://github.com/simplegeo/python-simplegeo/blob/master/simplegeo/__init__.py</a>. Its simple enough to read.</p>
<p>Once I find a use for this I will write up some stuff. In the mean time if you get stuck give me a shout, chances you will be stuck at the same point I was&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrishannam.co.uk/2010/04/simplegeo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WebDriver and Select Boxes</title>
		<link>http://www.chrishannam.co.uk/2009/09/webdriver-and-select-boxes/</link>
		<comments>http://www.chrishannam.co.uk/2009/09/webdriver-and-select-boxes/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 20:24:59 +0000</pubDate>
		<dc:creator>channam</dc:creator>
				<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.chrishannam.co.uk/?p=258</guid>
		<description><![CDATA[This one had me puzzled for a while as I never took the time to sit down and read the documentation fully&#8230; I decided to look at this again after seeing the issue appear on the WebDriver mailing list. How to you use select and option html elements? Below is Python demo.
$ python
Python 2.6.2 (release26-maint, [...]]]></description>
			<content:encoded><![CDATA[<p>This one had me puzzled for a while as I never took the time to sit down and read the documentation fully&#8230; I decided to look at this again after seeing the issue appear on the WebDriver mailing list. How to you use select and option html elements? Below is Python demo.</p>
<pre class="python">$ python
Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; from webdriver_firefox.webdriver import FirefoxLauncher
&gt;&gt;&gt; from webdriver_firefox.webdriver import WebDriver
&gt;&gt;&gt; d = WebDriver()
&gt;&gt;&gt; d.get("http://cassandra.appspot.com/")
&gt;&gt;&gt; e = d.find_elements_by_xpath(
"/html/body/div[@id='container']/div[@id='search']/form[@id='searchForm']/div/select")
&gt;&gt;&gt; r = e[0]
&gt;&gt;&gt; t = r.find_elements_by_tag_name("option")
&gt;&gt;&gt; t
[&lt;webdriver_firefox.webelement.WebElement object at 0x8dd778c&gt;,
&lt;webdriver_firefox.webelement.WebElement object at 0x8dd772c&gt;,
&lt;webdriver_firefox.webelement.WebElement object at 0x8dd77ac&gt;,
&lt;webdriver_firefox.webelement.WebElement object at 0x8dd77ec&gt;]
&gt;&gt;&gt; for i in t:
...     print i.get_text()
...
Artist
Location
last.fm Username
Venue
&gt;&gt;&gt; t[2].set_selected()
&gt;&gt;&gt;</pre>
<p>Now in your WebDriver browser session the option box has changed to &#8220;last.fm Username&#8221;. Excuse the variable names but I wanted to make a note before I lost the code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrishannam.co.uk/2009/09/webdriver-and-select-boxes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Speeding up the Web</title>
		<link>http://www.chrishannam.co.uk/2009/09/speeding-up-the-web/</link>
		<comments>http://www.chrishannam.co.uk/2009/09/speeding-up-the-web/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 16:28:28 +0000</pubDate>
		<dc:creator>channam</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.chrishannam.co.uk/?p=255</guid>
		<description><![CDATA[Might be old news and to be honest it should be if you do web development Speed. This page from Google contains lots of tips for speeding up web pages, lots of useful tips and worth at least one read.
]]></description>
			<content:encoded><![CDATA[<p>Might be old news and to be honest it should be if you do web development <a href="http://code.google.com/speed/articles/">Speed</a>. This page from Google contains lots of tips for speeding up web pages, lots of useful tips and worth at least one read.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrishannam.co.uk/2009/09/speeding-up-the-web/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Little Script to Check Twitter&#8217;s Status</title>
		<link>http://www.chrishannam.co.uk/2009/08/little-script-to-check-twitters-status/</link>
		<comments>http://www.chrishannam.co.uk/2009/08/little-script-to-check-twitters-status/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 15:31:22 +0000</pubDate>
		<dc:creator>channam</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.chrishannam.co.uk/?p=253</guid>
		<description><![CDATA[
#!/usr/bin/env python

from lxml import html

print "Starting..."

page = html.parse("http://www.pingdom.com/reports/vb1395a6sww3/check_overview/?name=twitter.com%2Fhome")

if page:
    try:
        t = page.xpath("/html/body/div[@id='content']/table[1]/tr[2]/td")
        status_icon = t[0].xpath("img/@src")[0]
        status = status_icon.split('_')[2].split('.')[0]
        date = t[1].text
   [...]]]></description>
			<content:encoded><![CDATA[<pre name="code" class="python">
#!/usr/bin/env python

from lxml import html

print "Starting..."

page = html.parse("http://www.pingdom.com/reports/vb1395a6sww3/check_overview/?name=twitter.com%2Fhome")

if page:
    try:
        t = page.xpath("/html/body/div[@id='content']/table[1]/tr[2]/td")
        status_icon = t[0].xpath("img/@src")[0]
        status = status_icon.split('_')[2].split('.')[0]
        date = t[1].text
        print "Twitter is %s! Checked at: %s Pacific Time (GMT - 8:00)" % (status, date)
    except:
        print "Unable to correctly verify Twitters status"
else:
    print "Can't access http://www.pingdom.com status page!"
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.chrishannam.co.uk/2009/08/little-script-to-check-twitters-status/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Conduit from SVN</title>
		<link>http://www.chrishannam.co.uk/2009/07/conduit-from-svn/</link>
		<comments>http://www.chrishannam.co.uk/2009/07/conduit-from-svn/#comments</comments>
		<pubDate>Sun, 19 Jul 2009 21:26:29 +0000</pubDate>
		<dc:creator>channam</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.chrishannam.co.uk/2009/07/conduit-from-svn/</guid>
		<description><![CDATA[Installed in it from svn and kept getting:  ImportError: No module named conduit
Fixed it with a: sudo cp -r /usr/lib/python2.6/site-packages/conduit /usr/lib/python2.6/ after failing with ./autogen.sh &#8211;prefix /usr
]]></description>
			<content:encoded><![CDATA[<p>Installed in it from svn and kept getting:  ImportError: No module named conduit</p>
<p>Fixed it with a: sudo cp -r /usr/lib/python2.6/site-packages/conduit /usr/lib/python2.6/ after failing with ./autogen.sh &#8211;prefix /usr</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrishannam.co.uk/2009/07/conduit-from-svn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get CouchDB up and running</title>
		<link>http://www.chrishannam.co.uk/2009/07/get-couchdb-up-and-running/</link>
		<comments>http://www.chrishannam.co.uk/2009/07/get-couchdb-up-and-running/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 11:01:39 +0000</pubDate>
		<dc:creator>channam</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.chrishannam.co.uk/?p=250</guid>
		<description><![CDATA[run:
sudo apt-get install libcurl4-gnutls-dev libmozjs-dev libicu-dev erlang
This should be all you require to build and install apache-couchdb-0.9.0
]]></description>
			<content:encoded><![CDATA[<p>run:<br />
sudo apt-get install libcurl4-gnutls-dev libmozjs-dev libicu-dev erlang</p>
<p>This should be all you require to build and install apache-couchdb-0.9.0</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrishannam.co.uk/2009/07/get-couchdb-up-and-running/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Playing a DVD</title>
		<link>http://www.chrishannam.co.uk/2009/07/playing-a-dvd/</link>
		<comments>http://www.chrishannam.co.uk/2009/07/playing-a-dvd/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 22:49:52 +0000</pubDate>
		<dc:creator>channam</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.chrishannam.co.uk/?p=248</guid>
		<description><![CDATA[A friend was getting the following error when playing some dvds:
[  172.864397] Buffer I/O error on device sr0, logical block 278
Following https://help.ubuntu.com/community/RestrictedFormats/PlayingDVDs solved it.
]]></description>
			<content:encoded><![CDATA[<p>A friend was getting the following error when playing some dvds:</p>
<p>[  172.864397] Buffer I/O error on device sr0, logical block 278</p>
<p>Following <a href="https://help.ubuntu.com/community/RestrictedFormats/PlayingDVDs">https://help.ubuntu.com/community/RestrictedFormats/PlayingDVDs</a> solved it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrishannam.co.uk/2009/07/playing-a-dvd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Contact API</title>
		<link>http://www.chrishannam.co.uk/2009/07/google-contact-api/</link>
		<comments>http://www.chrishannam.co.uk/2009/07/google-contact-api/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 20:06:03 +0000</pubDate>
		<dc:creator>channam</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.chrishannam.co.uk/?p=239</guid>
		<description><![CDATA[This is more for me as a reminder.
To find the postal address from a gdata.contacts.ContactEntry use:

import atom
import gdata.contacts
import gdata.contacts.service
gd_client = gdata.contacts.service.ContactsService()
gd_client.email = 'jo@gmail.com'
gd_client.password = 'passdword'
gd_client.source = 'exampleCo-exampleApp-1'
gd_client.ProgrammaticLogin()
from lxml import etree
feed = gd_client.GetContactsFeed()
entry = feed.entry[0]
entry
entry.postal_address[0].text
'123 Fake Street'

Took me ages to figure that out&#8230;
]]></description>
			<content:encoded><![CDATA[<p>This is more for me as a reminder.</p>
<p>To find the postal address from a gdata.contacts.ContactEntry use:</p>
<pre name="code" class="python">
import atom
import gdata.contacts
import gdata.contacts.service
gd_client = gdata.contacts.service.ContactsService()
gd_client.email = 'jo@gmail.com'
gd_client.password = 'passdword'
gd_client.source = 'exampleCo-exampleApp-1'
gd_client.ProgrammaticLogin()
from lxml import etree
feed = gd_client.GetContactsFeed()
entry = feed.entry[0]
entry
entry.postal_address[0].text
'123 Fake Street'
</pre>
<p>Took me ages to figure that out&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrishannam.co.uk/2009/07/google-contact-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
