<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Tales from the Script</title>
	<atom:link href="http://benlancaster.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://benlancaster.wordpress.com</link>
	<description>Technobabble, mumblings and musings</description>
	<lastBuildDate>Fri, 09 Dec 2011 07:47:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='benlancaster.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/8a8c1212de0a197f0df22cee2f9bcba3?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Tales from the Script</title>
		<link>http://benlancaster.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://benlancaster.wordpress.com/osd.xml" title="Tales from the Script" />
	<atom:link rel='hub' href='http://benlancaster.wordpress.com/?pushpress=hub'/>
		<item>
		<title>How to keep Adobe Flash open without it slowing your Mac down to a snail&#8217;s pace</title>
		<link>http://benlancaster.wordpress.com/2009/12/24/adobe-flash-background-slowdow/</link>
		<comments>http://benlancaster.wordpress.com/2009/12/24/adobe-flash-background-slowdow/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 11:26:24 +0000</pubDate>
		<dc:creator>benlancaster</dc:creator>
				<category><![CDATA[Grumbles]]></category>
		<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[cs4]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[slowdown]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://benlancaster.wordpress.com/?p=103</guid>
		<description><![CDATA[I hate Flash. I can&#8217;t wait for HTML 5 and WebGL to come and replace it, but that&#8217;ll take a while so I guess I&#8217;m stuck with it until then. The biggest bugbear I have with Flash is that it seems impossible to have it running in the background without it making your machine grind [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benlancaster.wordpress.com&amp;blog=3831702&amp;post=103&amp;subd=benlancaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I hate Flash. I can&#8217;t wait for HTML 5 and WebGL to come and replace it, but that&#8217;ll take a while so I guess I&#8217;m stuck with it until then.</p>
<p>The biggest bugbear I have with Flash is that it seems impossible to have it running in the background without it making your machine grind to a halt. Here&#8217;s a means to keep it open without it killing your machine:</p>
<ol>
<li>Fire up Terminal (in /Applications/Utilities)</li>
<li>Run <code>ps ax | grep Flash</code></li>
<li>Look for the line that looks like<br />
<code>989   ??  S      0:12.00 /Applications/Adobe Flash CS4/Adobe Flash CS4.app/Contents/MacOS/Adobe Flash CS4 -psn_0_331857</code></li>
<li>Note down the number at the beginning (989 in this case)</li>
<li>Issue <code>kill -STOP 989</code> (replacing 989 with the number you noted down above)</li>
<li>Go about your business, Flash will sit in the background not using any resources whatsoever.</li>
<li>When you&#8217;re ready to fire it back up, go back to your terminal and issue <code>kill -CONT 989</code>, and Flash is back in business</li>
</ol>
<p>It&#8217;s probably a good idea to minimise Flash before you do the kill -STOP, because if you don&#8217;t then it&#8217;ll be stuck on your desktop and you won&#8217;t be able to move/minimise it at all.</p>
<p>Not ideal, but it saves quiting and re-opening it on a regular basis. &#8220;Why does Flash takes so long to load?&#8221; is a separate issue entirely!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/benlancaster.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/benlancaster.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/benlancaster.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/benlancaster.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/benlancaster.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/benlancaster.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/benlancaster.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/benlancaster.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/benlancaster.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/benlancaster.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/benlancaster.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/benlancaster.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/benlancaster.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/benlancaster.wordpress.com/103/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benlancaster.wordpress.com&amp;blog=3831702&amp;post=103&amp;subd=benlancaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://benlancaster.wordpress.com/2009/12/24/adobe-flash-background-slowdow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f3d31deaabc2aa2fba5748fa9382cf7?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">benlancaster</media:title>
		</media:content>
	</item>
		<item>
		<title>Installing PHP&#8217;s JSON extension on CentOS/RHEL 5</title>
		<link>http://benlancaster.wordpress.com/2009/09/15/installing-php-json-centos-rhel-5/</link>
		<comments>http://benlancaster.wordpress.com/2009/09/15/installing-php-json-centos-rhel-5/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 13:22:38 +0000</pubDate>
		<dc:creator>benlancaster</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Dev]]></category>

		<guid isPermaLink="false">http://benlancaster.wordpress.com/?p=90</guid>
		<description><![CDATA[According to php.net, &#8220;there is no installation needed to use [json_encode() and json_decode()]; they are part of the PHP Core&#8220;. While it&#8217;s certainly true that they are part of the source code, many of the binary packages available for RPM-based platforms (like Red Hat, CentOS and Fedora) have them disabled by default. There are a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benlancaster.wordpress.com&amp;blog=3831702&amp;post=90&amp;subd=benlancaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>According to php.net, &#8220;<a href="http://www.php.net/manual/en/json.installation.php">there is no installation needed to use [json_encode() and json_decode()]; they are part of the PHP Core</a>&#8220;. While it&#8217;s certainly true that they are part of the source code, many of the binary packages available for RPM-based platforms (like Red Hat, CentOS and Fedora) have them disabled by default.</p>
<p>There are a number of extensions (PEAR and otherwise) available as RPMs in the official repositories, but sadly not php-json.  To enable these functions on CentOS (and by nature, RHEL) 5, the process is simple but not immediately obvious:</p>
<ol>
<li>Make sure you have php, pear and the necessary development packages installed:
<pre>$ sudo yum install php php-pear php-devel
$ sudo yum install gcc make</pre>
</li>
<li>Use PECL to download the json package:
<pre>$ sudo pecl download json</pre>
</li>
<li>Owing to some odd default memory settings we can&#8217;t download and install the package with PECL, we have to use PEAR:
<pre>$ sudo pear install json-1.2.1.tgz</pre>
<p>PEAR will then trundle through and handle the <code>configure</code>, <code>make</code> and <code>make install</code> commands for you</li>
<li>Create a new file in <code>/etc/php.d</code> called <strong>json.ini</strong>, containing the following:
<pre>; php-json package - http://pecl.php.net/package/json
extension=json.so</pre>
</li>
<li>Reload apache:
<pre>$ sudo service httpd reload</pre>
</li>
<li>Test your work:
<pre>$ php -r 'var_dump(function_exists("json_encode"));'</pre>
<p>All being well, that&#8217;ll return <code>bool(true)</code></li>
</ol>
<p>&#8230;and there you have it.</p>
<p>Note: There&#8217;s a chance you&#8217;ll run in to an error that looks like this:</p>
<pre>/bin/sh: bad interpreter: Permission denied
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF
environment variable is set correctly and then rerun this script.
</pre>
<p>&#8230; most likely, this is because your temporary partition is mounted with &#8216;noexec&#8217;, check the output of <code>mount</code> and look for the line that refers to /tmp to confirm the presence of &#8216;noexec&#8217; in the mount options. In this instance you&#8217;ll either have to re-mount /tmp without noexec (by removing it from <code>/etc/fstab</code>) or untar, <code>phpize</code>, <code>configure</code>, <code>make</code> and <code>make install</code> manually.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/benlancaster.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/benlancaster.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/benlancaster.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/benlancaster.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/benlancaster.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/benlancaster.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/benlancaster.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/benlancaster.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/benlancaster.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/benlancaster.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/benlancaster.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/benlancaster.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/benlancaster.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/benlancaster.wordpress.com/90/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benlancaster.wordpress.com&amp;blog=3831702&amp;post=90&amp;subd=benlancaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://benlancaster.wordpress.com/2009/09/15/installing-php-json-centos-rhel-5/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f3d31deaabc2aa2fba5748fa9382cf7?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">benlancaster</media:title>
		</media:content>
	</item>
		<item>
		<title>Fun with ON DUPLICATE KEY UPDATE</title>
		<link>http://benlancaster.wordpress.com/2009/07/21/fun-with-on-duplicate-key-update/</link>
		<comments>http://benlancaster.wordpress.com/2009/07/21/fun-with-on-duplicate-key-update/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 10:17:10 +0000</pubDate>
		<dc:creator>benlancaster</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Web Dev]]></category>

		<guid isPermaLink="false">http://benlancaster.wordpress.com/?p=83</guid>
		<description><![CDATA[Scenario: I have a database table with a UNIQUE key on a date column so that there can never be more than one row per date. If I insert a new row for a day that already exists in the database, I&#8217;d like it to push all the subsequent, consecutive dates back by one day [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benlancaster.wordpress.com&amp;blog=3831702&amp;post=83&amp;subd=benlancaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Scenario: I have a database table with a UNIQUE key on a date column so that there can never be more than one row per date. If I insert a new row for a day that already exists in the database, I&#8217;d like it to push all the subsequent, consecutive dates back by one day until it reaches a &#8216;free&#8217; day.</p>
<p>Here&#8217;s what I thought:</p>
<pre>INSERT INTO
 `activity`
 (`name`,`date`)
VALUES
 ('date 7','2009-07-30')
ON DUPLICATE KEY
 UPDATE `date` = DATE_ADD(`date`, INTERVAL '1' DAY)</pre>
<p>My thinking is that the <a href="http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html">ON DUPLICATE KEY UPDATE</a> will bubble up the table and keep adding one day to every date until it reaches a day that doesn&#8217;t exist.</p>
<p>E.g., if my table content looks like this:</p>
<pre>date 1, 2009-07-30
date 2, 2009-07-31
date 3, 2009-08-01
date 4, 2009-08-02
date 5, 2009-08-04 &lt;- notice this date is two days past the previous one</pre>
<p>&#8230;and I go to insert &#8216;date 7&#8242; on 2009-07-31, I&#8217;d like it to do this:</p>
<pre>date 1, 2009-07-30
date 7, 2009-07-31 &lt;- newly inserted row
date 2, 2009-08-01 &lt;- this and subsequent rows are all incremented
                      by one until it hits a non-existent day
date 3, 2009-08-02
date 4, 2009-08-03
date 5, 2009-08-04 &lt;- notice this date hasn't changed</pre>
<p>But on duplicate key update doesn&#8217;t work like that, it only updates the clashing row, and if that row then clashes with a different row, it bails out with a duplicate key error.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/benlancaster.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/benlancaster.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/benlancaster.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/benlancaster.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/benlancaster.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/benlancaster.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/benlancaster.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/benlancaster.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/benlancaster.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/benlancaster.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/benlancaster.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/benlancaster.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/benlancaster.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/benlancaster.wordpress.com/83/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benlancaster.wordpress.com&amp;blog=3831702&amp;post=83&amp;subd=benlancaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://benlancaster.wordpress.com/2009/07/21/fun-with-on-duplicate-key-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f3d31deaabc2aa2fba5748fa9382cf7?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">benlancaster</media:title>
		</media:content>
	</item>
		<item>
		<title>Khalid Hanif, 1984 &#8211; 2009</title>
		<link>http://benlancaster.wordpress.com/2009/06/28/khalid-hanif-1984-2009/</link>
		<comments>http://benlancaster.wordpress.com/2009/06/28/khalid-hanif-1984-2009/#comments</comments>
		<pubDate>Sun, 28 Jun 2009 22:24:36 +0000</pubDate>
		<dc:creator>benlancaster</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://benlancaster.wordpress.com/?p=74</guid>
		<description><![CDATA[My dear friend Khalid passed away this week after a post-operative complication. He is survived by his sisters, both parents, wife Emma and 1 year-old daughter, Abigail. What follows is certainly not going to be well crafted. I&#8217;m writing this to help me organise my thoughts and to deal with a small part of the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benlancaster.wordpress.com&amp;blog=3831702&amp;post=74&amp;subd=benlancaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My dear friend Khalid passed away this week after a post-operative complication. He is survived by his sisters, both parents, wife Emma and 1 year-old daughter, Abigail.</p>
<p>What follows is certainly not going to be well crafted. I&#8217;m writing this to help me organise my thoughts and to deal with a small part of the grief of losing an old friend.</p>
<p>I have already given up trying to comprehend why he was taken from us so soon. The operation that ultimately lead to his death was due to bring him a new lease of life. Having suffered from an almost debilitating illness for most of the 9 years I&#8217;d known him; he was so excited to see an end to its effects. We were all equally excited for him.</p>
<p>Khalid and I met initially on MSN providing &#8220;technical support&#8221; for a mutual friend, and then properly a year or so later while we were at separate universities. I was studying in Reading, and Khalid in London. We soon discovered a number of shared interests &#8211; we both liked the same music, went to similar churches, were pretty good at knocking out websites, and could both handle some pretty hot curries.</p>
<p>We used to talk on MSN until the small hours on a daily basis; the first thing he&#8217;d always type was &#8220;How are you buddy?&#8221;, and it was never phatic. We learned so much from each other about what became our professions that I very much doubt that I would be doing what I do now if it had not been not for our friendship. More recently, we were incapable of having a conversation on the phone that lasted for less than an hour; even more impressive when you consider just how quickly that kid could talk!</p>
<p>I was privileged to be Khalid&#8217;s friend and to see him grow up from teenager, to a man, to a fine businessman, to a loving husband and most recently, a proud and gentle father. We took many of those life steps at the same time; it was as we took those steps that Khalid&#8217;s friendship was invaluable to me. I remember speaking to him moments before I got married &#8211; with all the stress and busyness I had experienced that morning, he was the one who brought me back down to earth in a single hug; he calmed me down, and reminded me what the whole day was about. I&#8217;ll never forget it.</p>
<p>Above all, I will remember Khalid&#8217;s generosity. He was never too busy to lend a hand and always trying to pick up the bill. When a freelancer pulled out of project at work at the last minute, Khalid stepped in at very short notice and put in two weeks of 16hr days to help me get the job done. After we&#8217;d (successfully) delivered the project on time, he got me a gift to say &#8220;thank you for the opportunity&#8221;. Such was his selflessness.</p>
<p>As someone who&#8217;s known Khalid for a while, I now have a very small part in a share of the responsibility to remember him to his gorgeous little Abigail. To do him justice will be no mean feat, but I have no doubt that she&#8217;ll grow up to inherit some of his infectious personality and we&#8217;ll be able to wholeheartedly say &#8220;You sound like your Dad&#8221;.</p>
<p>Godspeed, brother. You&#8217;ll be missed.</p>
<div id="attachment_75" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-75" title="Khalid Hanif" src="http://benlancaster.files.wordpress.com/2009/06/n512511923_1293595_9306.jpg?w=300&#038;h=199" alt="Khalid Hanif. March 3, 1984 - June 25, 2009" width="300" height="199" /><p class="wp-caption-text">Khalid Hanif. March 3, 1984 - June 25, 2009</p></div>
<p><strong>Update:</strong> I received a not from Khalid&#8217;s sister, Hanna, with details from the inquest in to his death:</p>
<blockquote><p>I thought I would inform you that the verdict of Khalid&#8217;s inquest was that [his death was caused by] a pelvic emboli &#8211; a blood clot formed in his pelvis as a result of surgery. </p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/benlancaster.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/benlancaster.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/benlancaster.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/benlancaster.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/benlancaster.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/benlancaster.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/benlancaster.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/benlancaster.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/benlancaster.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/benlancaster.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/benlancaster.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/benlancaster.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/benlancaster.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/benlancaster.wordpress.com/74/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benlancaster.wordpress.com&amp;blog=3831702&amp;post=74&amp;subd=benlancaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://benlancaster.wordpress.com/2009/06/28/khalid-hanif-1984-2009/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f3d31deaabc2aa2fba5748fa9382cf7?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">benlancaster</media:title>
		</media:content>

		<media:content url="http://benlancaster.files.wordpress.com/2009/06/n512511923_1293595_9306.jpg?w=300" medium="image">
			<media:title type="html">Khalid Hanif</media:title>
		</media:content>
	</item>
		<item>
		<title>Installing mod_geoip on CentOS 5.x or RHEL</title>
		<link>http://benlancaster.wordpress.com/2009/06/08/installing-mod_geoip-on-centos-5-x-or-rhel/</link>
		<comments>http://benlancaster.wordpress.com/2009/06/08/installing-mod_geoip-on-centos-5-x-or-rhel/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 10:08:24 +0000</pubDate>
		<dc:creator>benlancaster</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Web Dev]]></category>

		<guid isPermaLink="false">http://benlancaster.wordpress.com/?p=68</guid>
		<description><![CDATA[Frustratingly, there are no official mod_geoip RPMs available for RHEL/CentOS distributions (that I&#8217;ve come accross at least). So, the only way to install it are from source. Here are the steps I took, relying on the certified, official RPMs as much as possible. All commands assume you&#8217;re in as root and running on x86_64 architecture. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benlancaster.wordpress.com&amp;blog=3831702&amp;post=68&amp;subd=benlancaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Frustratingly, there are no official mod_geoip RPMs available for RHEL/CentOS distributions (that I&#8217;ve come accross at least). So, the only way to install it are from source. Here are the steps I took, relying on the certified, official RPMs as much as possible.</p>
<p>All commands assume you&#8217;re in as root and running on x86_64 architecture.</p>
<ul>
<li>Install the base GeoIP and related libraries:
<pre>
# yum install GeoIP GeoIP-devel GeoIP-data
</li>
<li>Install the necessary stuff to install the module with APXS:
<pre>
# yum install httpd-devel apr-devel
</pre>
</li>
<li>Download the mod_geoip source, and untar it:
<pre>
# wget http://geolite.maxmind.com/download/geoip/api/mod_geoip2/mod_geoip2_1.2.5.tar.gz
# tar -xzf mod_geoip2_1.2.5.tar.gz
</pre>
</li>
<li>Run the APXS install:
<pre>
# apxs -i -a -L/usr/lib64 -I/usr/include -lGeoIP -c mod_geoip.c
</pre>
</li>
</ul>
<p>...and you're done.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/benlancaster.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/benlancaster.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/benlancaster.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/benlancaster.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/benlancaster.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/benlancaster.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/benlancaster.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/benlancaster.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/benlancaster.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/benlancaster.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/benlancaster.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/benlancaster.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/benlancaster.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/benlancaster.wordpress.com/68/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benlancaster.wordpress.com&amp;blog=3831702&amp;post=68&amp;subd=benlancaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://benlancaster.wordpress.com/2009/06/08/installing-mod_geoip-on-centos-5-x-or-rhel/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f3d31deaabc2aa2fba5748fa9382cf7?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">benlancaster</media:title>
		</media:content>
	</item>
		<item>
		<title>Keeping things in sync with WordPress releases via SVN using vendor branches</title>
		<link>http://benlancaster.wordpress.com/2009/02/12/wordpress-update-svn-vendor-branch/</link>
		<comments>http://benlancaster.wordpress.com/2009/02/12/wordpress-update-svn-vendor-branch/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 10:37:40 +0000</pubDate>
		<dc:creator>benlancaster</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[upgrade]]></category>
		<category><![CDATA[vendor branch]]></category>

		<guid isPermaLink="false">http://benlancaster.wordpress.com/?p=29</guid>
		<description><![CDATA[When working with projects based on Open Source software or frameworks, I'm a big fan of hooking in to the vendors' own SVN repositories with svn:externals. When it came to Wordpress, however, this was beginning to look quite complicated.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benlancaster.wordpress.com&amp;blog=3831702&amp;post=29&amp;subd=benlancaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When working with projects based on Open Source software or frameworks, I&#8217;m a big fan of hooking in to the vendors&#8217; own SVN repositories with svn:externals. When it came to WordPress, however, this was beginning to look quite complicated. I&#8217;m just about to embark on a WordPress project that&#8217;s going to involve rather a lot of hacking about, but I wanted to make sure I could keep it in sync with WordPress updates given WP&#8217;s propensity for gaping security holes.</p>
<p>I&#8217;d be hacking about with WordPress files themselves, svn:externals wasn&#8217;t an option (except for plugins, of course). I&#8217;m certainly not the first to face this problem; at least <a href="http://meyerweb.com/eric/thoughts/2008/09/03/subverting-wordpress/">Eric Meyer</a> has (had?) similar requirements.</p>
<p>Having stumbled accross the <a href="http://svnbook.red-bean.com/en/1.4/svn.advanced.vendorbr.html">Vendor Branch pattern in the SVN book</a>, I thought I&#8217;d give it a go.</p>
<p>The concept is simple enough. My SVN repository would keep copies of tags from WordPress&#8217; repository, and I&#8217;d simply merge changes accross tags as and when they were released by WordPress. Here&#8217;s the steps I took to <span style="text-decoration:line-through;">hopefully</span> achieve my goal.</p>
<ol>
<li>Set up a new SVN repository, check it out, and create a few initial folders:
<pre>$ svnadmin create /srv/svn/my-wp-project
$ svn co file:///srv/svn/my-wp-project ~/
$ cd ~/my-wp-project
$ svn mkdir trunk branches vendor tags
$ svn ci</pre>
<p>&#8216;vendor&#8217; is where we&#8217;ll store our WordPress releases</li>
<li>Export the latest WordPress release in to trunk, and check in:
<pre>$ svn export --force http://svn.automattic.com/wordpress/tags/2.7/ \
                     trunk
$ svn ci</pre>
</li>
<li>Copy the newly created WP 2.7 in trunk to /vendor/wordpress-current and then tag it as /vendor/wordpress-2.7
<pre>$ svn cp file:///srv/svn/my-wp-project/trunk \
         file:///srv/svn/my-wp-project/vendor/wordpress-current
$ svn cp file:///srv/svn/my-wp-project/trunk \
         file:///srv/svn/my-wp-project/vendor/wordpress-2.7</pre>
</li>
<li>Make your WordPress changes to trunk as normal</li>
<li>New WordPress is out? Easy enough. Grab a checkout of your /vendor/wordpress-current and <strong>completely replace the files in it with the files in new WordPress release (2.8, for example)</strong>, rsync works quite well for this:
<pre>
$ svn export --force http://svn.automattic.com/wordpress/tags/2.8/ \
                     wordpress-2.8
$ rsync -avPh --delete --exclude '.svn' wordpress-2.8/* wordpress-current
</pre>
<p><code>svn add</code>ing any new files  (<del datetime="2009-06-16T09:51:42+00:00">not sure how to handle orphaned/deprecated files yet</del>) and <code>svn rm</code>ing any deleted files (those marked with an ! in <code>svn st</code> and then <code>svn ci</code></li>
<li>In your checkout of trunk, merge the changes in wordpress-current to those in wordpress-2.7 in to trunk:
<pre>$ svn merge file:///srv/svn/my-wp-project/vendor/wordpress-2.7      \
            file:///srv/svn/my-wp-project/vendor/wordpress-current  \
            .</pre>
</li>
<li>Finish by manually fixing any conflicts (yes, manually) and check in your copy of trunk</li>
</ol>
<p>I&#8217;ve done a trial run between some older versions of WordPress against a <em>slightly</em> modified installation, and it seemed to work well. Will update when the project&#8217;s evolved and I do it for real.</p>
<p><strong>Update February 12, 2009: </strong><a href="http://wordpress.org/development/2009/02/wordpress-271/">WordPress 2.7.1</a> is out, and my vendor branch update and merge to trunk went seamlessly. Good news.</p>
<p><strong>Update June 16, 2009: </strong><a href="http://wordpress.org/development/2009/06/wordpress-28/">WordPress 2.8</a> is now out, upgrade worked well, have updated the post with the route I took to do it. More good news.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/benlancaster.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/benlancaster.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/benlancaster.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/benlancaster.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/benlancaster.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/benlancaster.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/benlancaster.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/benlancaster.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/benlancaster.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/benlancaster.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/benlancaster.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/benlancaster.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/benlancaster.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/benlancaster.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benlancaster.wordpress.com&amp;blog=3831702&amp;post=29&amp;subd=benlancaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://benlancaster.wordpress.com/2009/02/12/wordpress-update-svn-vendor-branch/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f3d31deaabc2aa2fba5748fa9382cf7?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">benlancaster</media:title>
		</media:content>
	</item>
		<item>
		<title>How to completely disable FireFox cache</title>
		<link>http://benlancaster.wordpress.com/2009/02/10/how-to-completely-disable-firefox-cache/</link>
		<comments>http://benlancaster.wordpress.com/2009/02/10/how-to-completely-disable-firefox-cache/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 13:32:45 +0000</pubDate>
		<dc:creator>benlancaster</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://benlancaster.wordpress.com/?p=58</guid>
		<description><![CDATA[Web caching is great, there&#8217;s no doubt about it. Even in the days of 50Mb broadband, caching stuff still speeds things up no end. It&#8217;s also saved me (and my clients) a substantial amount of ££ in bandwidth costs. At home, and work, I set up a caching proxy server with Squid, rendering my browser [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benlancaster.wordpress.com&amp;blog=3831702&amp;post=58&amp;subd=benlancaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Web caching is great, there&#8217;s no doubt about it. Even in the days of 50Mb broadband, caching stuff still speeds things up no end. It&#8217;s also saved me (and my clients) a substantial amount of ££ in bandwidth costs.</p>
<p>At home, and work, I set up a caching proxy server with Squid, rendering my browser cache effectively useless. Here&#8217;s how to disable FireFox&#8217;s browser cache <em>completely</em>.</p>
<ol>
<li>Fire up FireFox</li>
<li>Type about:config in your address bar</li>
<li>Type &#8216;cache&#8217; in the search bar, and look for <code>network.http.use-cache,</code> and double click it to set it to <code>false</code>. Double clicking it again will set it to <code>true</code> and re-enable the cache</li>
</ol>
<p>&#8230;and then you&#8217;re done.</p>
<p>To forcibly reload a page and all its dependencies, direct from source, ignoring local and proxy caches hold the shift key and hit reload. This applies not only to FireFox but also IE6/7 and Safari (maybe others too). I have a feeling this may be a ratified standard.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/benlancaster.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/benlancaster.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/benlancaster.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/benlancaster.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/benlancaster.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/benlancaster.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/benlancaster.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/benlancaster.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/benlancaster.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/benlancaster.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/benlancaster.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/benlancaster.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/benlancaster.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/benlancaster.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benlancaster.wordpress.com&amp;blog=3831702&amp;post=58&amp;subd=benlancaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://benlancaster.wordpress.com/2009/02/10/how-to-completely-disable-firefox-cache/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f3d31deaabc2aa2fba5748fa9382cf7?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">benlancaster</media:title>
		</media:content>
	</item>
		<item>
		<title>Dynamically generated images with antialiased rounded corners in PHP</title>
		<link>http://benlancaster.wordpress.com/2009/02/04/php-gd-rounded-corners-with-stroke/</link>
		<comments>http://benlancaster.wordpress.com/2009/02/04/php-gd-rounded-corners-with-stroke/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 15:59:05 +0000</pubDate>
		<dc:creator>benlancaster</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[gd]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[rounded corners]]></category>

		<guid isPermaLink="false">http://benlancaster.wordpress.com/?p=52</guid>
		<description><![CDATA[Update: I&#8217;ve been really tardy about making sure the file&#8217;s always available &#8211; many apologies. Have migrated it over to Pastebin (and updated the links). Seems to me that every designer I&#8217;ve ever worked with has at one time or another a thing for designing sites with rounded corners everywhere. Reproducing this in HTML is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benlancaster.wordpress.com&amp;blog=3831702&amp;post=52&amp;subd=benlancaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><em><strong>Update:</strong> I&#8217;ve been really tardy about making sure the file&#8217;s always available &#8211; many apologies. Have migrated it over to Pastebin (and updated the links).</em></p>
<p>Seems to me that every designer I&#8217;ve ever worked with has at one time or another a thing for designing sites with rounded corners everywhere. Reproducing this in HTML is a major PITA on IE, I&#8217;ve always ended up with tag spaghetti, and a hacky solution made up with loads of little images that works fine on one browser but not the other.</p>
<p>So, I set about generating them on the fly, and came up with the attached script to do the job for me, using a pair of functions by <a href="http://mierendo.com/software/antialiased_arcs/">Ulrich Mierendorff</a>.</p>
<h2>Features</h2>
<ul>
<li>One ore more antialiased corners (see Usage below)</li>
<li>Background transparency</li>
<li>Can set background, foreground and stroke colour</li>
<li>Full control over dimensions</li>
<li>Server-side caching</li>
<li>Sends well-formed HTTP headers to promote caching (ETag, Last-Modified, Expires), and returns a &#8220;304 Not Modified&#8221; header if it&#8217;s been cached by the client already.</li>
</ul>
<h2>Todo</h2>
<ul>
<li>Ability to specify the stroke width dynamically, currently hard coded</li>
<li>Set a different radius for each corner</li>
<li>Refactor in to a class to handle everything</li>
<li>Use the URI to work out whether to serve GIF or PNG (no point in using JPEG for this purpose)</li>
</ul>
<h2>Usage</h2>
<p>Firstly, check you&#8217;re using PHP 5.1.x (may work on others, as yet untested) and have the GD library installed and working.</p>
<p>Update the cache settings (lines 72-81), make sure your cache folder exists and is writable, or set the CACHE_PATH constant to false.</p>
<p>You should be good to go. The accepted parameters are:</p>
<ul>
<li>bg &#8211; hex value (without the hash) for the background of the box</li>
<li>fg &#8211; hex value for the foreground of the box</li>
<li>w &#8211; width of the generated image</li>
<li>h &#8211; height of the generated image</li>
<li>corners &#8211; bit array for the corners. Each corner has a numeric value: top left = 2, top right = 4, bottom left = 8, bottom right = 16, add together these values to specify the corners you&#8217;d like rounded, so for the top corners only, 2 + 4 = 6. For all four corners, 2 + 4 + 8 + 16 = 30</li>
<li>style &#8211; either &#8220;stroke&#8221; (coloured line around the outside) or &#8220;round&#8221; (solid coloured box with rounded corners)</li>
<li>stroke &#8211; the stroke colour (ignored if style == round)</li>
</ul>
<p>Pass the parameters to the script in the querystring like so:</p>
<pre>bg=FFFFFF&amp;fg=990000&amp;w=200&amp;h=100&amp;corners=30&amp;style=stroke&amp;stroke=FF0000</pre>
<p>Which will give you an image like this:</p>
<p><img class="aligncenter size-full wp-image-53" title="stroke-ff0000" src="http://benlancaster.files.wordpress.com/2009/02/stroke-ff0000.png?w=406" alt="stroke-ff0000"   /></p>
<p>I use this script in conjunction with a mod_rewrite rule (<em>linebreaks marked \</em>):</p>
<pre>RewriteRule \
    ^boxes(/bg([0-9a-f]{6}))?/([0-9a-f]{6})/([0-9]+)x([0-9]+) \
    /([0-9]{1,2})/(round|stroke)(-([0-9a-f]{6}))?\.png$ \
    /background.php?bg=$2&amp;fg=$3&amp;w=$4&amp;h=$5&amp;corners=$6&amp;style=$7&amp;stroke=$9 \
    [QSA,L,NC]</pre>
<p>Which gives you a nicer looking URI and helps with caching http://www.example.com/boxes/bgFFFFFF/CC0000/400&#215;600/30/stroke-FF0000.png</p>
<p>I use MooTools to look for all elements with a given class, sniff the dimensions, and set the background image dynamically:</p>
<pre>window.addEvent('load',
  function ()
  {
    $$('.rounded').each(
      function (el)
      {
        x = el.getSize().x;
        y = el.getSize().y;
        el.setStyle(
          'background',
          'transparent url(/boxes/bgFFFFFF/CC0000/'
          +x+'x'+y+
          '/30/stroke-FF0000.png');
      }
    );
  }
);</pre>
<p>Et voila!</p>
<h2>Download</h2>
<p>One file, available <span style="text-decoration:line-through;">as a gzip&#8217;d text file</span> here:<span style="text-decoration:line-through;"> http://public.benlancaster.co.uk/background.txt.gz</span> <a href="http://pastebin.com/pastebin.php?dl=f6615b455">http://pastebin.com/pastebin.php?dl=f6615b455</a></p>
<p>MD5sum: <span style="text-decoration:line-through;">af6edc069116e6aea90790a682e352f4</span> 009859d57d3677635b15a044cb385de3</p>
<h2>License</h2>
<p>MIT License:</p>
<p>(c) 2009 Ben Lancaster</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the &#8220;Software&#8221;), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
<p>THE SOFTWARE IS PROVIDED &#8220;AS IS&#8221;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/benlancaster.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/benlancaster.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/benlancaster.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/benlancaster.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/benlancaster.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/benlancaster.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/benlancaster.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/benlancaster.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/benlancaster.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/benlancaster.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/benlancaster.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/benlancaster.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/benlancaster.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/benlancaster.wordpress.com/52/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benlancaster.wordpress.com&amp;blog=3831702&amp;post=52&amp;subd=benlancaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://benlancaster.wordpress.com/2009/02/04/php-gd-rounded-corners-with-stroke/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f3d31deaabc2aa2fba5748fa9382cf7?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">benlancaster</media:title>
		</media:content>

		<media:content url="http://benlancaster.files.wordpress.com/2009/02/stroke-ff0000.png" medium="image">
			<media:title type="html">stroke-ff0000</media:title>
		</media:content>
	</item>
		<item>
		<title>Thoughts on iPhoto 09</title>
		<link>http://benlancaster.wordpress.com/2009/01/28/thoughts-on-iphoto-09/</link>
		<comments>http://benlancaster.wordpress.com/2009/01/28/thoughts-on-iphoto-09/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 10:18:56 +0000</pubDate>
		<dc:creator>benlancaster</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Grumbles]]></category>
		<category><![CDATA[ilife]]></category>
		<category><![CDATA[iphoto]]></category>
		<category><![CDATA[review]]></category>

		<guid isPermaLink="false">http://benlancaster.wordpress.com/?p=49</guid>
		<description><![CDATA[My copy of iLife &#8217;09 arrived yesterday; more than any of the others, I was very keen to try out the new iPhoto. I&#8217;ve compiled a quick review below. Faces A very welcome addition, and it seems to work remarkably well once you&#8217;ve tagged the same person a few times. Plus, there&#8217;s great amusement to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benlancaster.wordpress.com&amp;blog=3831702&amp;post=49&amp;subd=benlancaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My copy of iLife &#8217;09 arrived yesterday; more than any of the others, I was very keen to try out the new iPhoto. I&#8217;ve compiled a quick review below.</p>
<h3>Faces</h3>
<p>A very welcome addition, and it seems to work remarkably well once you&#8217;ve tagged the same person a few times. Plus, there&#8217;s great amusement to be had when your iPhoto suggests your mother-inlaw looks like your dad, a car wheel and a donkey.</p>
<p>The initial scan took hours on my Core 2 Duo MacBook Pro, but it picked up faces in pretty much all the photos that had them.</p>
<p>My only gripes are that the Smart Albums haven&#8217;t been updated so I can create a Smart Album with all the pictures of me and my wife, for example. Also, tagging kids is very hit and miss; it seems to find them much harder to distinguish. Also, I can&#8217;t seem to find any integration with my Address Book &#8211; it&#8217;d make sense for it to suggest names as I type, and give me the option to set the contact&#8217;s picture from my iPhoto library.</p>
<h3>Places</h3>
<p>Another welcome feature. I&#8217;m don&#8217;t own a GPS-equipped camera, so none of mine are geotagged, but the manual interface is intuitive, and quick and easy to use (it&#8217;s an Apple product, afterall), although there are some glaringly obvious features that I can&#8217;t believe they missed. For example, let&#8217;s say I have an Event called &#8220;Holiday in Budapest, Hungary&#8221;, it wouldn&#8217;t be too hard to filter that name through a regular expression to at least suggest a map location?</p>
<h3>FaceBook &amp; Flickr integration</h3>
<p>This is one feature that&#8217;ll surely have pissed off the several companies who have written their own paid-for upload plugins, now rendered useless. I must admin I&#8217;m yet to play with this properly, but it&#8217;s good to see that it&#8217;ll let me upload images from RAW or TIFF files (missing from every plugin I&#8217;d tried previously).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/benlancaster.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/benlancaster.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/benlancaster.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/benlancaster.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/benlancaster.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/benlancaster.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/benlancaster.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/benlancaster.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/benlancaster.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/benlancaster.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/benlancaster.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/benlancaster.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/benlancaster.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/benlancaster.wordpress.com/49/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benlancaster.wordpress.com&amp;blog=3831702&amp;post=49&amp;subd=benlancaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://benlancaster.wordpress.com/2009/01/28/thoughts-on-iphoto-09/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f3d31deaabc2aa2fba5748fa9382cf7?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">benlancaster</media:title>
		</media:content>
	</item>
		<item>
		<title>A letter to Richard Branson re: Virgin in-flight food</title>
		<link>http://benlancaster.wordpress.com/2009/01/23/a-letter-to-richard-branson-virgin-inflight-food/</link>
		<comments>http://benlancaster.wordpress.com/2009/01/23/a-letter-to-richard-branson-virgin-inflight-food/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 14:12:59 +0000</pubDate>
		<dc:creator>benlancaster</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[branson]]></category>
		<category><![CDATA[funny]]></category>
		<category><![CDATA[in-flight food]]></category>
		<category><![CDATA[letter of complaint]]></category>
		<category><![CDATA[virgin]]></category>

		<guid isPermaLink="false">http://benlancaster.wordpress.com/?p=37</guid>
		<description><![CDATA[This has been doing the rounds at work: Oliver Beale Tel: obscured Email: oli.beale@obscured 17th December 2008 Dear Mr Branson REF: Mumbai to Heathrow 7th December 2008 Flying Club number obscured I love the Virgin brand, I really do which is why I continue to use it despite a series of unfortunate incidents over the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benlancaster.wordpress.com&amp;blog=3831702&amp;post=37&amp;subd=benlancaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This has been doing the rounds at work:</p>
<blockquote><p>Oliver Beale<br />
<em></em></p>
<p>Tel: <em>obscured</em><br />
Email: oli.beale@<em>obscured</em></p>
<p>17th December 2008</p>
<p>Dear Mr Branson</p>
<p><strong>REF:  Mumbai to Heathrow 7th December 2008 Flying Club number <em>obscured</em></strong></p>
<p>I love the Virgin brand, I really do which is why I continue to use it despite a series of unfortunate incidents over the last few years. This latest incident takes the biscuit. Ironically, by the end of the flight I would have gladly paid over a thousand rupees for a single biscuit following the culinary journey of hell I was subjected to at the hands of your corporation.</p>
<p>Look at this Richard. Just look at it:</p>
<p><img class="aligncenter size-medium wp-image-38" title="picture-2" src="http://benlancaster.files.wordpress.com/2009/01/picture-2.png?w=300&#038;h=225" alt="picture-2" width="300" height="225" /></p>
<p>I imagine the same questions are racing through your brilliant mind as were racing through mine on that fateful day. What is this? Why have I been given it? What have I done to deserve this? And, Which one is the starter, which one is the desert? You don’t get to a position like yours Richard with anything less than a generous sprinkling of observational power so I KNOW you will have spotted the tomato next to the two yellow shafts of sponge on the left. Yes, it’s next to the sponge shaft without the green paste. That’s got to be the clue hasn’t it. No sane person would serve a desert with a tomato would they. Well answer me this Richard, what sort of animal would serve a desert with peas in:</p>
<p><img class="aligncenter size-medium wp-image-39" title="picture-3" src="http://benlancaster.files.wordpress.com/2009/01/picture-3.png?w=225&#038;h=300" alt="picture-3" width="225" height="300" /></p>
<p>I know it looks like a baaji but it’s in custard Richard, custard. It must be the pudding. Well you’ll be fascinated to hear that it wasn’t custard. It was a sour gel with a clear oil on top. It’s only redeeming feature was that it managed to be so alien to my palette that it took away the taste of the curry emanating from our miscellaneous central cuboid of beige matter. Perhaps the meal on the left might be the desert after all.</p>
<p>Anyway, this is all irrelevant at the moment. I was raised strictly but neatly by my parents and if they knew I had started desert before the main course, a sponge shaft would be the least of my worries. So lets peel back the tin-foil on the main dish and see what’s on offer.</p>
<p>I’ll try and explain how this felt. Imagine being a twelve year old boy Richard. Now imagine it’s Christmas morning and you’re sat their with your final present to open. It’s a big one, and you know what it is. It’s that Goodmans stereo you picked out the catalogue and wrote to Santa about. Only you open the present and it’s not in there. It’s your hamster Richard. It’s your hamster in the box and it’s not breathing. That’s how I felt when I peeled back the foil and saw this:</p>
<p><img class="aligncenter size-medium wp-image-45" title="picture-41" src="http://benlancaster.files.wordpress.com/2009/01/picture-41.png?w=300&#038;h=224" alt="picture-41" width="300" height="224" /></p>
<p>Now I know what you’re thinking. You’re thinking it’s more of that Baaji custard. I admit I thought the same too, but no. It’s mustard Richard. MUSTARD. More mustard than any man could consume in a month. On the left we have a piece of broccoli and some peppers in a brown glue-like oil and on the right the chef had prepared some mashedpotato. The potato masher had obviously broken and so it was decided the next best thing would be to pass the potatoes through the digestive tract of a bird. Once it was regurgitated it was clearly then blended and mixed with a bit of mustard. Everybody likes a bit of mustard Richard. Jesus Christ.</p>
<p>By now I was actually starting to feel a little hypoglycaemic. I needed a sugar hit. Luckily there was a small cookie provided. It had caught my eye earlier due to it’s baffling presentation:</p>
<p><img class="aligncenter size-medium wp-image-41" title="picture-5" src="http://benlancaster.files.wordpress.com/2009/01/picture-5.png?w=225&#038;h=300" alt="picture-5" width="225" height="300" /></p>
<p>It appears to be in an evidence bag from the scene of a crime. A CRIME AGAINST BLOODY COOKING. Either that or some sort of back-street underground cookie, purchased off a gun-toting maniac high on his own supply of yeast. You certainly wouldn’t want to be caught carrying one of these through customs. Imagine biting into a piece of brass Richard. That would be softer on the teeth than the specimen above.</p>
<p>I was exhausted. All I wanted to do was relax but obviously I had to sit with that mess in front of me for half an hour. I swear the sponge shafts moved at one point.  Once cleared. I decided to relax with a bit of your world-famous onboard entertainment. I switched it on:</p>
<p><img class="aligncenter size-medium wp-image-42" title="picture-6" src="http://benlancaster.files.wordpress.com/2009/01/picture-6.png?w=300&#038;h=223" alt="picture-6" width="300" height="223" /></p>
<p>I apologise for the quality of the photo, it’s just it was incredibly hard to capture Boris Johnson’s face through the flickering white lines running up and down the screen. Perhaps it would be better on another channel:</p>
<p><img class="aligncenter size-medium wp-image-43" title="picture-7" src="http://benlancaster.files.wordpress.com/2009/01/picture-7.png?w=300&#038;h=224" alt="picture-7" width="300" height="224" /></p>
<p>Is that Ray Liotta? A question I found myself asking over and over again throughout the gruelling half-hour I attempted to watch the film like this. After that I switched off. I’d had enough. I was the hungriest I’d been in my adult life and I had a splitting headache from squinting at a crackling screen.</p>
<p>My only option was to simply stare at the seat in front and wait for either food, or sleep. Neither came for an incredibly long time. But when it did it surpassed my wildest expectations:</p>
<p><img class="aligncenter size-medium wp-image-44" title="picture-8" src="http://benlancaster.files.wordpress.com/2009/01/picture-8.png?w=223&#038;h=300" alt="picture-8" width="223" height="300" /></p>
<p>Yes! It’s another crime-scene cookie. Only this time you dunk it in the white stuff. Richard…. What is that white stuff? It looked like it was going to be yoghurt. It finally dawned on me what it was after staring at it. It was a mixture between the Baaji custard and the Mustard sauce. It reminded me of my first week at university. I had overheard that you could make a drink by mixing vodka and refreshers. I lied to my new friends and told them I’d done it loads of times. When I attempted to make the drink in a big bowl it formed a cheese Richard, a cheese. That cheese looked a lot like your baaji-mustard.</p>
<p>So that was that Richard. I didn’t eat a bloody thing. My only question is: How can you live like this? I can’t imagine what dinner round your house is like, it must be like something out of a nature documentary.</p>
<p>As I said at the start I love your brand, I really do. It’s just a shame such a simple thing could bring it crashing to it’s knees and begging for sustenance.</p>
<p>Yours Sincererly</p>
<p>Oliver Beale</p></blockquote>
<p>&#8230;here&#8217;s what accompanied the letter when it arrived in my inbox:</p>
<blockquote><p>Tom from <em>obscured</em> went to India with a friend [Oliver Beale] recently and flew with Virgin. [Oliver] was appalled by the food and wrote a letter of complaint when he returned. The letter found its way to Richard Branson’s desk and he phoned [Oliver] saying he and his family had been laughing all weekend about it as it was the funniest letter he’d ever had.</p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/benlancaster.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/benlancaster.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/benlancaster.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/benlancaster.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/benlancaster.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/benlancaster.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/benlancaster.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/benlancaster.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/benlancaster.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/benlancaster.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/benlancaster.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/benlancaster.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/benlancaster.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/benlancaster.wordpress.com/37/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benlancaster.wordpress.com&amp;blog=3831702&amp;post=37&amp;subd=benlancaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://benlancaster.wordpress.com/2009/01/23/a-letter-to-richard-branson-virgin-inflight-food/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f3d31deaabc2aa2fba5748fa9382cf7?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">benlancaster</media:title>
		</media:content>

		<media:content url="http://benlancaster.files.wordpress.com/2009/01/picture-2.png?w=300" medium="image">
			<media:title type="html">picture-2</media:title>
		</media:content>

		<media:content url="http://benlancaster.files.wordpress.com/2009/01/picture-3.png?w=225" medium="image">
			<media:title type="html">picture-3</media:title>
		</media:content>

		<media:content url="http://benlancaster.files.wordpress.com/2009/01/picture-41.png?w=300" medium="image">
			<media:title type="html">picture-41</media:title>
		</media:content>

		<media:content url="http://benlancaster.files.wordpress.com/2009/01/picture-5.png?w=225" medium="image">
			<media:title type="html">picture-5</media:title>
		</media:content>

		<media:content url="http://benlancaster.files.wordpress.com/2009/01/picture-6.png?w=300" medium="image">
			<media:title type="html">picture-6</media:title>
		</media:content>

		<media:content url="http://benlancaster.files.wordpress.com/2009/01/picture-7.png?w=300" medium="image">
			<media:title type="html">picture-7</media:title>
		</media:content>

		<media:content url="http://benlancaster.files.wordpress.com/2009/01/picture-8.png?w=223" medium="image">
			<media:title type="html">picture-8</media:title>
		</media:content>
	</item>
	</channel>
</rss>
