<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Geoff on...</title>
	
	<link>http://www.geoffon.com</link>
	<description>technology</description>
	<pubDate>Sat, 29 Nov 2008 09:32:18 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/GeoffOnTech" type="application/rss+xml" /><item>
		<title>Go On A Charity Date</title>
		<link>http://feeds.feedburner.com/~r/GeoffOnTech/~3/468479015/</link>
		<comments>http://www.geoffon.com/2008/11/28/go-on-a-charity-date/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 16:26:19 +0000</pubDate>
		<dc:creator>Geoff</dc:creator>
		
		<category><![CDATA[Projects]]></category>

		<category><![CDATA[charity]]></category>

		<category><![CDATA[charity date]]></category>

		<category><![CDATA[charity dating]]></category>

		<category><![CDATA[dating]]></category>

		<category><![CDATA[facebook]]></category>

		<category><![CDATA[girls]]></category>

		<guid isPermaLink="false">http://www.geoffon.com/?p=53</guid>
		<description><![CDATA[Donate 2 Date is a website that helps raise money for charity by setting people up on dates. This is not just for celebrities (though you might find one or two), it&#8217;s for everyone. It&#8217;s a fantastic way to raise money, no marathons or shaved heads, just a good time with philanthropist.
After you sign up, [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Donate 2 Date" href="http://www.donate2date.net/stats/redirect?token=blog_post_2&amp;url=http://www.donate2date.net/">Donate 2 Date</a> is a website that helps raise money for charity by setting people up on dates. This is not just for celebrities (though you might find one or two), it&#8217;s for everyone. It&#8217;s a fantastic way to raise money, no marathons or shaved heads, just a good time with philanthropist.</p>
<p>After you sign up, you&#8217;re listed in the current auctions. People can come along and bid for a date with you. You are in complete control over who you accept. No need to worry about some weird (but rich) person winning your auction. You can pick the person you most like the look of (if they show suitable generosity to your chosen charity of course!)</p>
<p>Despite being brand new, there have already been a number of bidding wars over some people, reaching into the hundreds of pounds.</p>
<p style="text-align: center;"><a href="http://www.donate2date.net/stats/redirect?token=blog_post_2&amp;url=http://apps.facebook.com/donatetodate/facebook/d2d_user/user/07f5940aa-c3fd-445e-b51d-2fb75472cb99"><img class="aligncenter size-medium wp-image-54" style="display: inline;" title="Bidding War 1" src="http://www.geoffon.com/wp-content/uploads/2008/11/l-bidding-war.jpg" alt="" width="604" height="556" /></a><a href="http://www.donate2date.net/stats/redirect?token=blog_post_2&amp;url=http://apps.facebook.com/donatetodate/facebook/d2d_user/user/072dd39fe-5413-4d8c-a37b-2080015e1acd"><img class="aligncenter size-medium wp-image-55" style="display: inline;" title="Bidding War 2" src="http://www.geoffon.com/wp-content/uploads/2008/11/li-bidding-war.jpg" alt="" width="600" height="604" /></a></p>
<p style="text-align: left;">You can read more about Donate 2 Date <a title="Donate 2 Date" href="http://www.donate2date.net/stats/redirect?token=blog_post_2&amp;url=http://www.donate2date.net/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geoffon.com/2008/11/28/go-on-a-charity-date/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.geoffon.com/2008/11/28/go-on-a-charity-date/</feedburner:origLink></item>
		<item>
		<title>Spotify Rocks</title>
		<link>http://feeds.feedburner.com/~r/GeoffOnTech/~3/462751166/</link>
		<comments>http://www.geoffon.com/2008/11/23/spotify-rocks/#comments</comments>
		<pubDate>Sun, 23 Nov 2008 11:40:39 +0000</pubDate>
		<dc:creator>Geoff</dc:creator>
		
		<category><![CDATA[Review]]></category>

		<category><![CDATA[spotify]]></category>

		<guid isPermaLink="false">http://www.geoffon.com/?p=50</guid>
		<description><![CDATA[Spotify is a new music service that lets you listen to unlimited amounts of music for free. They have an impressively complete collection and you have complete control over what you listen to. The only caveat: it&#8217;s ad supported. However, the ads are sparse (about one 30 second add for every album you listen to).
I [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.geoffon.com/wp-content/uploads/2008/11/logo.png"><img class="alignleft size-medium wp-image-51" style="float: left; margin-right: 20px;" title="Spotify" src="http://www.geoffon.com/wp-content/uploads/2008/11/logo.png" alt="" width="108" height="116" /></a><a href="http://www.spotify.com">Spotify</a> is a new music service that lets you listen to unlimited amounts of music for free. They have an impressively complete collection and you have complete control over what you listen to. The only caveat: it&#8217;s ad supported. However, the ads are sparse (about one 30 second add for every album you listen to).</p>
<p>I was initially skeptical about having ads. I hate radio stations that will have you listening to adverts all day long or TV stations that play a few minutes of ads every 20 minutes. But adverts in Spotify are rare enough that it doesn&#8217;t bother me. If you don&#8217;t like the adverts, you can pay a subscription at £9.99 a month or a day pass for £0.99 (for parties perhaps?). I think the £9.99 a month is a little steep, but luckily I&#8217;m happy with the ad-supported version.</p>
<p>They have most of the music I like to listen to. However, they often don&#8217;t have the obscure first albums (produced by tiny labels), which is a real shame. I expect this will change if Spotify gets big. There are a couple of big names who are not available. The only one I have really missed is Metallica&#8217;s <a href="http://en.wikipedia.org/wiki/Metallica%27s_ninth_studio_album">new album</a>.</p>
<p>Each artist has links to similar artists. This is nice for finding new music, but doesn&#8217;t appear to be particularly clever. That said, exploring is effortless because songs are played instantly and the browsing interface is very well designed. Songs and playlists can be sent to friends using special URLs, but these have to be emailed or IMed, it would be much better to have a more tightly integrated social network. I&#8217;m sure this will follow later on.</p>
<p>At the moment, Spotify is invitation only. I have a few spare, leave me your email and I&#8217;ll send you one if I have one left.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geoffon.com/2008/11/23/spotify-rocks/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.geoffon.com/2008/11/23/spotify-rocks/</feedburner:origLink></item>
		<item>
		<title>Donate 2 Date</title>
		<link>http://feeds.feedburner.com/~r/GeoffOnTech/~3/437073341/</link>
		<comments>http://www.geoffon.com/2008/10/30/donate-2-date/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 16:23:43 +0000</pubDate>
		<dc:creator>Geoff</dc:creator>
		
		<category><![CDATA[Projects]]></category>

		<category><![CDATA[charity]]></category>

		<category><![CDATA[dating]]></category>

		<category><![CDATA[Donate 2 Date]]></category>

		<guid isPermaLink="false">http://www.geoffon.com/?p=43</guid>
		<description><![CDATA[Donate 2 Date is a Facebook application to help raise money for charity by setting people up on dates. Users can bid on other users for the chance to take them out. I&#8217;ve been working on this project for a few months, let me know what you think!
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.donate2date.net"><img class="alignleft size-medium wp-image-44" style="float: left; margin-right: 10px;" title="logo" src="http://www.geoffon.com/wp-content/uploads/2008/10/logo.jpg" alt="" width="183" height="113" /></a><a title="Donate 2 Date" href="http://www.donate2date.net">Donate 2 Date</a> is a Facebook application to help raise money for charity by setting people up on dates. Users can bid on other users for the chance to take them out. I&#8217;ve been working on this project for a few months, let me know what you think!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geoffon.com/2008/10/30/donate-2-date/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.geoffon.com/2008/10/30/donate-2-date/</feedburner:origLink></item>
		<item>
		<title>Doing EC2 Without Scalr</title>
		<link>http://feeds.feedburner.com/~r/GeoffOnTech/~3/417203714/</link>
		<comments>http://www.geoffon.com/2008/10/10/doing-ec2-without-scalr/#comments</comments>
		<pubDate>Fri, 10 Oct 2008 22:00:28 +0000</pubDate>
		<dc:creator>Geoff</dc:creator>
		
		<category><![CDATA[Scalability]]></category>

		<category><![CDATA[Cloud Computing]]></category>

		<category><![CDATA[ec2]]></category>

		<category><![CDATA[scalr]]></category>

		<guid isPermaLink="false">http://www.geoffon.com/?p=36</guid>
		<description><![CDATA[It is important that your website can scale. You can spend all your energy promoting it and adding features, but that is all wasted if it cannot deal with all those users who are desperate to use your site. The architecture is at least half the battle. We are spoilt these days with affordable options [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.geoffon.com/wp-content/uploads/2008/10/image-server-farm15752254_std148155151_std.jpeg"><img class="alignleft size-full wp-image-37" style="padding-right: 10px; float: left;" title="Server Farm" src="http://www.geoffon.com/wp-content/uploads/2008/10/image-server-farm15752254_std148155151_std.jpeg" alt="" width="234" height="176" /></a>It is important that your website can scale. You can spend all your energy promoting it and adding features, but that is all wasted if it cannot deal with all those users who are desperate to use your site. The architecture is at least half the battle. We are spoilt these days with affordable options to be able to deal with scale. Cloud computing has become a buzz word and big tech companies are scrambling to carve out their chunk of the market. So far we have <a href="http://aws.amazon.com">EC2</a>, <a href="http://code.google.com/appengine/">Google App Engine</a>, <a href="http://joyent.com/">Joyent</a>, VPS services (such as <a href="http://www.slicehost.com/">Slicehost</a>) and a number of others.</p>
<p>EC2 was one of the first and most mature of the offerings. Though it does not stray far from the traditional concept of a machine (with fixed CPU and memory), what it does do is give you access to as many of these as you need at any one point and the (very) basic tools to manage them. They provide the basic infrastructure: machines, network connections and data storage. It is up to you to do the rest: load balancing, application servers, relational databases, backups, replication, redundancy, fail-over, etc.</p>
<p>Scalr promises to help with some of these issues, notably load balancing, and backups / replication / fail-over for MySQL. The idea is great but the project is not mature (despite the claim to v1.0) and the architecture is not very solid. To be fair, this is acknowledged to some degree in that v2 is to be a complete redesign. After a period of two months using Scalr, I decided to move on because of these issues:</p>
<p> </p>
<ul>
<li>Ad-hoc design: a strange combination of PHP, bash, MySQL and CRON. The interaction between these components was overly complicated, which means debugging was tricky and the system itself was prone to getting mixed up (for example: CRON calling PHP to do a backup but the MySQL state was stuck so backups were being skipped, silently, for weeks). V2 is to be Java.</li>
<li>Buggy: rebundling an instance would break the load balancer. It would get confused about the new instances and refuse to update. This was only solved by restarting the whole farm.</li>
<li>Scalr makes the decision to start new instances based on the load average. This is over simplistic really and can mean that your machines are under heavy load for a little too long which new instances are being brought up.</li>
<li>Scalr is built on Ubuntu 7.04 AMIs, upgrading the distro breaks it.</li>
</ul>
<div>I do like what Scalr are trying to do. Just having pre-built load balancing servers, application servers and MySQL servers that are able to replicate and reconfigure themselves based on load is great. However, Scalr v1 is experimental really, I&#8217;m very keen to see how the next version evolves.</div>
<div>One alternative is to build the architecture yourself. It&#8217;s actually not very hard (and quite quick). All you need is a decent scripting language that has good SSH and EC2 libraries and some experience with MySQL and linux admin. A few days work (4 in my case) will get you:</div>
<div>
<ul>
<li>Run and stop instances with a single command, including application servers, master and slave MySQL instances.</li>
<li>MySQL slave replication (automatically configured against the current master)</li>
<li>NGINX load balancer, always up to date with the application servers.</li>
<li>Automatic backup and restore facilities.</li>
<li>Various other tricks that your setup might benefit from.</li>
</ul>
</div>
<div>All that would be needed to catch up with Scalr&#8217;s features (albeit not generically) is to automatically bring up the required instances as demand changes and automatically fail over MySQL instances. Not much more work and with the added benefit that you can tailor your load algorithm to your site (i.e. use response times instead of load averages). I would recommend getting your hands dirty!</div>
]]></content:encoded>
			<wfw:commentRss>http://www.geoffon.com/2008/10/10/doing-ec2-without-scalr/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.geoffon.com/2008/10/10/doing-ec2-without-scalr/</feedburner:origLink></item>
		<item>
		<title>Spotlight Goes Dotty</title>
		<link>http://feeds.feedburner.com/~r/GeoffOnTech/~3/384009332/</link>
		<comments>http://www.geoffon.com/2008/09/05/spotlight-goes-dotty/#comments</comments>
		<pubDate>Fri, 05 Sep 2008 07:53:37 +0000</pubDate>
		<dc:creator>Geoff</dc:creator>
		
		<category><![CDATA[OS X]]></category>

		<category><![CDATA[apple]]></category>

		<category><![CDATA[mac]]></category>

		<category><![CDATA[Spotlight]]></category>

		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://www.geoffon.com/?p=28</guid>
		<description><![CDATA[The last 3 times I have had a new install of OS X, I&#8217;ve noticed that it gets sluggish after a few weeks. Loading up the monitor app shows a process called mdworker being heavy on both CPU and memory.
My first reaction was that it was some sort of virus or at best a rogue [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.geoffon.com/wp-content/uploads/2008/09/spotlight.jpg"><img class="alignleft size-medium wp-image-29" style="float: left; margin-right: 10px;" title="Spotlight" src="http://www.geoffon.com/wp-content/uploads/2008/09/spotlight.jpg" alt="" width="188" height="188" /></a>The last 3 times I have had a new install of OS X, I&#8217;ve noticed that it gets sluggish after a few weeks. Loading up the monitor app shows a process called mdworker being heavy on both CPU and memory.</p>
<p>My first reaction was that it was some sort of virus or at best a rogue app, but googling mdworker revealed that it was part of OS X. More precisely it is the Spotlight indexing daemon (keeps track of all your files to make searching faster).</p>
<p>My first reaction was to look for a way to turn off spotlight. I don&#8217;t really use it very much and <a title="Quicksilver" href="http://www.blacktree.com/">Quicksilver</a> covers the needs I do have. However, Spotlight is also needed to search your mail, which I can&#8217;t do without.</p>
<p>The problem appears when Spotlight is trying to keep up with a large number of new files on the system. In my case copying some music onto a new machine. The most straightforward solution is to tell Spotlight to ignore those files. This is easily done in <strong>System Preferences</strong> -&gt; <strong>Spotlight</strong> -&gt; <strong>Privacy</strong> -&gt; <strong>Add ( + )</strong>. I added my Music directory which is where iTunes stores it&#8217;s library.</p>
<p><a href="http://www.geoffon.com/wp-content/uploads/2008/09/picture-10.png"><img class="aligncenter size-full wp-image-31" title="Spotlight Privacy" src="http://www.geoffon.com/wp-content/uploads/2008/09/picture-10.png" alt="" width="500" height="474" /></a></p>
<p>It is odd that this should be a problem. Indexing is something that should happen in the background. There is no reason for it to affect the user. It appears that Apple decided that it was more important for files to be searchable than for the operating system to be responsive.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geoffon.com/2008/09/05/spotlight-goes-dotty/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.geoffon.com/2008/09/05/spotlight-goes-dotty/</feedburner:origLink></item>
		<item>
		<title>A Good Reason To Use IFrames For Facebook Apps</title>
		<link>http://feeds.feedburner.com/~r/GeoffOnTech/~3/340028777/</link>
		<comments>http://www.geoffon.com/2008/07/19/a-good-reason-to-use-iframes-for-facebook-apps/#comments</comments>
		<pubDate>Sat, 19 Jul 2008 18:04:41 +0000</pubDate>
		<dc:creator>Geoff</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[aws]]></category>

		<category><![CDATA[ec2]]></category>

		<category><![CDATA[facebook]]></category>

		<category><![CDATA[scaling]]></category>

		<category><![CDATA[scalr]]></category>

		<guid isPermaLink="false">http://www.geoffon.com/?p=25</guid>
		<description><![CDATA[If you use canvas pages to display your Facebook apps, dealing with scale suddenly becomes quite a bit harder. A request must be served in less than 4 seconds otherwise it fails completely. This is fine when your traffic is constant, but can catch you off your guard if you get a sudden spike.
I&#8217;m currently [...]]]></description>
			<content:encoded><![CDATA[<p><img style="float:left; margin-right: 10px;" src="http://www.geoffon.com/wp-content/uploads/2008/03/logo_facebook_small.jpg" alt="" />If you use canvas pages to display your Facebook apps, dealing with scale suddenly becomes quite a bit harder. A request must be served in less than 4 seconds otherwise it fails completely. This is fine when your traffic is constant, but can catch you off your guard if you get a sudden spike.</p>
<p>I&#8217;m currently building a Facebook app using Scalr to deal with scaling. This automatically creates new Amazon EC2 instances to deal with increases in load and kills them again when traffic dies down. The problem arises in deciding when to start a new instance.</p>
<p>Scalr keeps track of the server load average.  This is a moving average over 15 minutes. It&#8217;s a good idea to use a slow moving average like this so as to not start instances prematurely. It will only do so if the existing instances do actually need some help (especially considering Amazon charge by the hour). However, this introduces lag in starting a new server, say about 5 minutes.</p>
<p>If I weren&#8217;t serving pages to users via Facebook this wouldn&#8217;t be such a problem. There would be small window when the site would be a little sluggish. For a canvas page this means pages are considered to have timed out, not good!</p>
<p>Of course, using IFrame&#8217;s is generally faster because it doesn&#8217;t have the proxy overhead (and sometimes sluggish Facebook servers). There are some drawbacks in losing some cool FBML functionality (e.g. fb:can-see) and you will have to make a lot more calls to the API, but I now think IFrames are the way to go.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geoffon.com/2008/07/19/a-good-reason-to-use-iframes-for-facebook-apps/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.geoffon.com/2008/07/19/a-good-reason-to-use-iframes-for-facebook-apps/</feedburner:origLink></item>
		<item>
		<title>Is SQLAlchemy Ready For Production?</title>
		<link>http://feeds.feedburner.com/~r/GeoffOnTech/~3/300061645/</link>
		<comments>http://www.geoffon.com/2008/05/28/is-sqlalchemy-ready-for-production/#comments</comments>
		<pubDate>Wed, 28 May 2008 20:02:14 +0000</pubDate>
		<dc:creator>Geoff</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[databases]]></category>

		<category><![CDATA[mysql]]></category>

		<category><![CDATA[python]]></category>

		<category><![CDATA[sqlalchemy]]></category>

		<guid isPermaLink="false">http://www.geoffon.com/?p=23</guid>
		<description><![CDATA[I have built my most recent project using SQLAlchemy (SQLA) 0.4. It is a reasonably young library, so I thought others considering using SQLAlchemy might benefit from my experiences.
The most recent version is 0.4, so it obviously does not claim to be &#8216;finished&#8217; (can software ever be?) However, there are plenty of benefits in using [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.geoffon.com/wp-content/uploads/2008/05/sqla-logo6.gif" alt="SQLAlchemy" title="sqla-logo" width="188" height="52" class="alignleft size-medium wp-image-24" style="float: left; margin-right: 10px;"/>I have built my most recent project using <a href="http://www.sqlalchemy.org/">SQLAlchemy</a> (SQLA) 0.4. It is a reasonably young library, so I thought others considering using SQLAlchemy might benefit from my experiences.</p>
<p>The most recent version is 0.4, so it obviously does not claim to be &#8216;finished&#8217; (can software ever be?) However, there are plenty of benefits in using it already:</p>
<ul>
<li>Ridding your beautiful Python code of any SQL. It&#8217;s untidy and pain to work with (which means bugs).</li>
<li>ORM (Object Relational Model) to fit in with a nice OO architecture.</li>
<li>Free sharding to split your database horizontally.</li>
<li>DB independant code, so you can switch if you feel the need.</li>
<li>Hassle free transactions and DB connection management.</li>
</ul>
<p>Sounds great doesn&#8217;t it? In general this is exactly what you get. However, there are a few points which are very important to consider before committing yourself to using SQLA.</p>
<p><b><i>Forcing Indices</i></b></p>
<p>Anyone who has had to do something reasonably involved in MySQL has spent time optimising their indices. Sadly, MySQL is not very clever about how it chooses the index to use for a particular query. In some cases the only option is to force it with <code>FORCE</code>. </p>
<p>This is <i>not</i> available in SQLA, so anytime you need to do this, you&#8217;ll have to manually specify the SQL. Not only does this partly defeat the point of SQLA, but it also happens that the place you most need the SQL abstraction is often the same place you need to force an index. Consider a complicated search page. You are searching over a large data set using a number of filters. MySQL is probably going to get the index wrong and you&#8217;re going to have to generate a complicated SQL query without SQLAlchemy&#8217;s help.</p>
<p><b><i>Commit ORM Objects</i></b></p>
<p>SQLAlchemy can be a little silly about detecting a change in an ORM object. If you assign to a member variable which is part of the schema, it will be marked as dirty even if the value doesn&#8217;t actually change. </p>
<p>The solution is to check for a change before assigning, which does not make for neat code!</p>
<p><b><i>Sharding</i></b></p>
<p>It&#8217;s a good idea to plan for scaling as early as possible. It can be <i>very</i> difficult to build the necessary bits in later when you need it (and will also under pressure to fix things fast). One common way to deal with scale is to split large tables over several machines, this is known as sharding (each independant chunk of table is known as a shard).</p>
<p>SQLAlchemy has some code to help you there. All you need to do is to define 3 functions which tell SQLA which shard a particular row is in. Really simple. Sadly, this part of the code is not very mature at all:</p>
<ul>
<li>query.count() doesn&#8217;t work (nor any scalar query). I had to write a function to query each shard in turn and sum the result. The real problem here is that it was not clear at all which bits of functionality will or won&#8217;t work with sharding (expect long debugging sessions, digging into the SQLA code).</li>
<li>The ORM caches objects and identifies them by their primary key. However, a common MySQL trick when sharding is to have an auto_incremented INT as the primary key of each shard but use something like a UUID as the &#8216;real&#8217; primary key recognised by the code (this speeds things up quite a bit). Of course, the auto_incremented key will not be unique across shards and this will confuse SQLAlchemy. I think the best solution here (suggested by someone on the SQLAlchemy group) is to have a 2 column primary key with an INT and another integer shard identifier, making it unique.</li>
</ul>
<p><b><i>No Server Side Cursors</i></b></p>
<p>A minor point, but might be important for some. Server side cursors come in handy sometimes when you are dealing with large amounts of data.</p>
<p><b><i>Tips For Optimising</i></b></p>
<ul>
<li>Periodically check the SQL queries being made with the <code>echo</code> option. There might be some surprises in there (though usually easily fixed). This kind of thing usually pops up because you will use the ORM instance and forget / not realise that it will result in a query (from a software design point of view, great. From an optimisation point of view, awful).</li>
<li>Use <code>set_shard</code> on a query whenever you are able. If you know which shard the column you want is, no need to go checking the other ones. A common example is when the shard identitifier is in one of the query parameters.</li>
<li>Design for scale right from the beginning and develop / test on a distributed architecture (i.e. have at least 2 shards). This doesn&#8217;t need to be difficult, for example: just create two databases on your developement box to simulate two machines.</li>
</ul>
<p><b><i>Conclusion</i></b></p>
<p>I still think that SQLAlchemy is worth using. Overall it will save time and effort as long as you are careful and not afraid to get your hands dirty when the going gets tough. I expect most of these problems will be addressed in (near) future releases.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geoffon.com/2008/05/28/is-sqlalchemy-ready-for-production/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.geoffon.com/2008/05/28/is-sqlalchemy-ready-for-production/</feedburner:origLink></item>
		<item>
		<title>C# BHO Tutorial</title>
		<link>http://feeds.feedburner.com/~r/GeoffOnTech/~3/299402439/</link>
		<comments>http://www.geoffon.com/2008/05/27/c-bho-tutorial/#comments</comments>
		<pubDate>Tue, 27 May 2008 23:12:04 +0000</pubDate>
		<dc:creator>Geoff</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[bho]]></category>

		<category><![CDATA[c#]]></category>

		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.geoffon.com/2008/05/27/c-bho-tutorial/</guid>
		<description><![CDATA[I get a fair bit of traffic from people looking for help with C# and BHOs (my event handling post). There isn&#8217;t much information about and the only beginners tutorial went missing a few months back. A new one has appeared, anyone wanting to get going should check it out.
]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.geoffon.com/wp-content/uploads/2008/05/ie7.jpg' alt='ie7' width="100px" style="float:left; margin-right:10px;"/>I get a fair bit of traffic from people looking for help with C# and BHOs (my <a href="http://www.geoffon.com/2007/12/21/c-browser-helper-object-event-handling/">event handling</a> post). There isn&#8217;t much information about and the only beginners tutorial went missing a few months back. A <a href="http://www.codeproject.com/kb/cs/attach_bho_with_c_.aspx">new one</a> has appeared, anyone wanting to get going should check it out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geoffon.com/2008/05/27/c-bho-tutorial/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.geoffon.com/2008/05/27/c-bho-tutorial/</feedburner:origLink></item>
		<item>
		<title>Vim: The Word Processor</title>
		<link>http://feeds.feedburner.com/~r/GeoffOnTech/~3/290458207/</link>
		<comments>http://www.geoffon.com/2008/05/14/vim-the-word-processor/#comments</comments>
		<pubDate>Wed, 14 May 2008 21:31:07 +0000</pubDate>
		<dc:creator>Geoff</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://www.geoffon.com/2008/05/14/vim-the-word-processor/</guid>
		<description><![CDATA[I love Vim. It took me a while to get there, but I've been using it exclusively for coding for a couple of years now and it has become second nature. I first learnt to use it during a practical exercise for an operating systems course at uni. We had to write a Minix driver [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.geoffon.com/wp-content/uploads/2008/05/vim-editor_logo.png' alt='Vim Logo'  style="float:left; margin-right: 10px;" width="200px"/>I love <a href="http://www.vim.org/">Vim</a>. It took me a while to get there, but I've been using it exclusively for coding for a couple of years now and it has become second nature. I first learnt to use it during a practical exercise for an operating systems course at uni. We had to write a <a href="http://www.minix3.org/">Minix</a> driver so all the work had to be done on the command line. A powerful text editor was a must. I think I used Vi (rather than Emacs) because it was available and I had been told it was great. It was a steep learning curve, but I got a hang of the basics after a few days.</p>
<p>It was a couple of years before I started to use it again. In the meantime I'd mostly been working with .NET and Java so I'd been using some pretty decent development environments and it didn't seem necessary to use anything else (especially considering the power of their debuggers). But I moved into the world of the web and started writing PHP and then Python, these did not really have especially good IDEs and so it was back to a text editor and my choice was Vim. It also coincided with worsening RSI, for which Vim is great.</p>
<p>I tend to learn a couple of features in a burst every few months when something really bugs me. This is probably not ideal, but Vim is <i>so</i> powerful I will never learn it all. I've been keeping a to do list in a text file recently (rather than on paper - go planet!) but Vim's defaults are not great for editing prose:</p>
<ul>
<li>Vim's word wrap is by character, not word.</li>
<li>k and j (up and down) work on a line basis. If you have a wrapped line, you cannot move inside it with  j and k (like you would with a normal text editor).</li>
</ul>
<p>Of course, Vim is hugely powerful and can be tweaked to be much more useable when writing prose. These <code>.vimrc</code> commands:</p>
<ul>
<li>Wrap lines by cutting lines off at word boundaries.</li>
<li>The word wrap is virtual, no extra line break is inserted (so that it's easy to edit afterwards).</li>
<li>j and k are replaced with gj and gk which allow you to move up and down <i>inside</i> a wrapped line.</li>
<li>I've also added the spell checker (I've not played around with it properly yet, but it looks a little weak).</li>
<li>smartindent for bullet points.</li>
</ul>
<p><br/></p>
<div class="igBar"><span id="lcode-2"><a href="#" onclick="javascript:showPlainTxt('code-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-2">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">autocmd BufRead *\.<span style="">txt</span> setlocal formatoptions=l</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">autocmd BufRead *\.<span style="">txt</span> setlocal lbr</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">autocmd BufRead *\.<span style="">txt</span> map &lt;buffer&gt; j gj</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">autocmd BufRead *\.<span style="">txt</span>&nbsp; map &lt;buffer&gt; k gk</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">autocmd BufRead *\.<span style="">txt</span> setlocal smartindent</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">autocmd BufRead *\.<span style="">txt</span> setlocal spell spelllang=en_us </div>
</li>
</ol>
</div>
</div>
</div>
<p>
<br/><br />
On a slightly different note: if you're using OS X, get <a href="http://code.google.com/p/macvim/">this</a> port of Vim. It's aim (and it does) is to integrate better into Macs. It's worth getting just because it has pretty Carbon tabs <img src='http://www.geoffon.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.geoffon.com/2008/05/14/vim-the-word-processor/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.geoffon.com/2008/05/14/vim-the-word-processor/</feedburner:origLink></item>
		<item>
		<title>Facebook Chat Firefox Plugin</title>
		<link>http://feeds.feedburner.com/~r/GeoffOnTech/~3/276449796/</link>
		<comments>http://www.geoffon.com/2008/04/23/facebook-chat-firefox-plugin/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 21:53:36 +0000</pubDate>
		<dc:creator>Geoff</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[facebook]]></category>

		<category><![CDATA[firefox]]></category>

		<category><![CDATA[growl]]></category>

		<guid isPermaLink="false">http://www.geoffon.com/2008/04/23/facebook-chat-firefox-plugin/</guid>
		<description><![CDATA[Facebook finally released their chat functionality to all their users today. It's fantastic! I quickly came to the conclusion that it did have one major flaw: you have to be on the Facebook page to see any incoming messages. So to solve this, I quickly knocked up a Firefox add-on to alert you if you [...]]]></description>
			<content:encoded><![CDATA[<p><img style="float:left;" src="http://www.geoffon.com/wp-content/uploads/2008/03/logo_facebook_small.jpg" alt="Facebook" /><a href="http://www.facebook.com/">Facebook</a> finally <a href="http://www.techcrunch.com/2008/04/22/facebook-finishes-chat-integration-makes-this-bloggers-life-miserable/">released</a> their chat functionality to all their users today. It's fantastic! I quickly came to the conclusion that it did have one major flaw: you have to be on the Facebook page to see any incoming messages. So to solve this, I quickly knocked up a Firefox add-on to alert you if you have any new chat messages. You can download it <a href="https://addons.mozilla.org/en-US/firefox/addon/7099">here</a>.</p>
<p><img src="http://www.geoffon.com/wp-content/uploads/2008/04/picture-6.png" alt="Firefox Facebook Chat Add-on Screenshot" /></p>
<p>It uses the built-in Firefox alert system, so you'll need Firefox 3 on OS X (for Growl) and 2 for other OSs. At the moment you also have to leave the Facebook page open, if I have time later, I'll deal with this so that you can close the Facebook page.</p>
<p><strong>PLUG</strong>: <a title="Donate 2 Date" href="http://www.donate2date.net">Donate 2 Date</a> is my Facebook app. It helps raise money for charity by setting people up on dates. Check it <a href="http://www.donate2date.net">out</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geoffon.com/2008/04/23/facebook-chat-firefox-plugin/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.geoffon.com/2008/04/23/facebook-chat-firefox-plugin/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic Page Served (once) in 0.665 seconds --><!-- Cached page served by WP-Cache -->
