<?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:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>code monk</title>
	<atom:link href="http://drj11.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://drj11.wordpress.com</link>
	<description>hacking habits</description>
	<pubDate>Fri, 04 Jul 2008 09:50:12 +0000</pubDate>
	<generator>http://wordpress.org/?v=MU</generator>
	<language>en</language>
			<item>
		<title>How to solve any (anthropogenic) problem</title>
		<link>http://drj11.wordpress.com/2008/07/02/how-to-solve-any-anthropogenic-problem/</link>
		<comments>http://drj11.wordpress.com/2008/07/02/how-to-solve-any-anthropogenic-problem/#comments</comments>
		<pubDate>Wed, 02 Jul 2008 08:54:10 +0000</pubDate>
		<dc:creator>drj11</dc:creator>
		
		<category><![CDATA[rant]]></category>

		<guid isPermaLink="false">http://drj11.wordpress.com/?p=190</guid>
		<description><![CDATA[Tim Tyler writes a dry ironic piece titled «Destroy the Entertainment Industry» (warning: contains 2 tits).  I can&#8217;t tell if he&#8217;s being genuinely serious or not.  His arguments canter along at a nice pace, until suddenly he nukes himself in the foot, by suggesting germ-line manipulation as a solution. Specifically, &#8220;If humans exhibit [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Tim Tyler writes <a href="http://timtyler.org/destroy_the_entertainment_industry/">a dry ironic piece titled «Destroy the Entertainment Industry»</a> (warning: contains 2 tits).  I can&#8217;t tell if he&#8217;s being genuinely serious or not.  His arguments canter along at a nice pace, until suddenly he nukes himself in the foot, by suggesting <em>germ-line manipulation</em> as a solution. Specifically, &#8220;If humans exhibit variation in their susceptability to entertainment-induced pathologies, maybe a human can be constructed that is less prone to this type of malfunction&#8221;.</p>
<p>Of course, I&#8217;m not denying that there is a gene for &#8220;susceptability to entertainment-induced pathlogies&#8221; (pedants: &#8220;a gene for X&#8221; is used in the same sense as Dawkins uses it in «The Selfish Gene»), it may even be possible to manipulate the gene or its hosting population.  The problem with this argument is that it&#8217;s so universally applicable so as to make it useless.  Germ-line manipulation now becomes the crucial new tool in solving any public policy problem (or in fact, any problem at all).  People blow each other up too much, that&#8217;s a problem.  How do we solve it?  Germ-line manipulation, simply eliminate the gene for &#8220;blowing each other up&#8221; from the population.</p>
<p>This turns into a rather amusing game, where when anyone poses a problem, you simply reply with your mantra of <em>germ-line manipulation</em>.  Let&#8217;s see how it&#8217;s played:</p>
<p>People abuse the disabled parking spots in public car parks?  Germ-line manipulation solves the problem by removing the gene for &#8220;being an asshole&#8221; from the population.  Too much dog poop on the streets?  Germ-line manipulation.  Too many stupid blog articles?  Germ-line manipulation.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/drj11.wordpress.com/190/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/drj11.wordpress.com/190/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/drj11.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/drj11.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/drj11.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/drj11.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/drj11.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/drj11.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/drj11.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/drj11.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/drj11.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/drj11.wordpress.com/190/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=drj11.wordpress.com&blog=258145&post=190&subd=drj11&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://drj11.wordpress.com/2008/07/02/how-to-solve-any-anthropogenic-problem/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/drj11-128.jpg" medium="image">
			<media:title type="html">drj11</media:title>
		</media:content>
	</item>
		<item>
		<title>Wii love Endless Ocean</title>
		<link>http://drj11.wordpress.com/2008/06/10/wii-love-endless-ocean/</link>
		<comments>http://drj11.wordpress.com/2008/06/10/wii-love-endless-ocean/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 08:44:57 +0000</pubDate>
		<dc:creator>drj11</dc:creator>
		
		<category><![CDATA[games]]></category>

		<guid isPermaLink="false">http://drj11.wordpress.com/?p=187</guid>
		<description><![CDATA[So far (1 evening of play) it seems to be a really good game, it&#8217;s instantly relaxing and manages to be fairly compulsive and interesting.  The water is done really well in several different ways.  Underwater in the lagoon the water dims just the right amount to make it feel like a private [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>So far (1 evening of play) it seems to be a really good game, it&#8217;s instantly relaxing and manages to be fairly compulsive and interesting.  The water is done really well in several different ways.  Underwater in the lagoon the water dims just the right amount to make it feel like a private pool.  The droplets running off your visor and evaporating when you surface are just spot-on.</p>
<p>It makes me want to play Wave Race 64, which still has most excellent water.  Available on the Wii virtual console apparently.</p>
<p>I&#8217;m just left wondering:</p>
<p>1) Why even a pacific diving simulation game has an annoying bint of a side-kick; and,<br />
2) When it&#8217;s all going to be revealed that the fish are actually a new military genetically modified breeding program for aqua-metroids, and there&#8217;s a lost pirate research vessel buried on the ocean floor.  In other words: When do I get my plasma cannon?</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/drj11.wordpress.com/187/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/drj11.wordpress.com/187/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/drj11.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/drj11.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/drj11.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/drj11.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/drj11.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/drj11.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/drj11.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/drj11.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/drj11.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/drj11.wordpress.com/187/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=drj11.wordpress.com&blog=258145&post=187&subd=drj11&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://drj11.wordpress.com/2008/06/10/wii-love-endless-ocean/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/drj11-128.jpg" medium="image">
			<media:title type="html">drj11</media:title>
		</media:content>
	</item>
		<item>
		<title>Unredeemed by Cate&#8217;s boots</title>
		<link>http://drj11.wordpress.com/2008/06/06/unredeemed-by-cates-boots/</link>
		<comments>http://drj11.wordpress.com/2008/06/06/unredeemed-by-cates-boots/#comments</comments>
		<pubDate>Fri, 06 Jun 2008 09:28:51 +0000</pubDate>
		<dc:creator>drj11</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://drj11.wordpress.com/?p=186</guid>
		<description><![CDATA[Cate Blanchett in jack boots, with a sword.  Think on that for a moment or two.  It has the potential to fulfil fantasies you never knew you had.  With such promise how did it manage to go so wrong?
And that crystal skull was clearly a cheap plastic knock-off.
     [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Cate Blanchett in jack boots, with a sword.  Think on that for a moment or two.  It has the potential to fulfil fantasies you never knew you had.  With such promise how did it manage to go so wrong?</p>
<p>And that crystal skull was clearly a cheap plastic knock-off.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/drj11.wordpress.com/186/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/drj11.wordpress.com/186/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/drj11.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/drj11.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/drj11.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/drj11.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/drj11.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/drj11.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/drj11.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/drj11.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/drj11.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/drj11.wordpress.com/186/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=drj11.wordpress.com&blog=258145&post=186&subd=drj11&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://drj11.wordpress.com/2008/06/06/unredeemed-by-cates-boots/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/drj11-128.jpg" medium="image">
			<media:title type="html">drj11</media:title>
		</media:content>
	</item>
		<item>
		<title>calloc when multiply overflows</title>
		<link>http://drj11.wordpress.com/2008/06/04/calloc-when-multiply-overflows/</link>
		<comments>http://drj11.wordpress.com/2008/06/04/calloc-when-multiply-overflows/#comments</comments>
		<pubDate>Wed, 04 Jun 2008 15:29:56 +0000</pubDate>
		<dc:creator>drj11</dc:creator>
		
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://drj11.wordpress.com/?p=185</guid>
		<description><![CDATA[Recall that calloc allocates contiguous space for n objects of size s:
void *calloc(size_t n, size_t s);
Observe that this is the same as allocating a block of size n×s.  So why not just go malloc(n*s) instead?  Well, for one thing calloc initialises the memory to all-bits-zero, but I&#8217;m not concerned with that right now. [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Recall that <a href="http://www.opengroup.org/onlinepubs/000095399/functions/calloc.html">calloc</a> allocates contiguous space for <var>n</var> objects of size <var>s</var>:</p>
<p><code>void *calloc(size_t n, size_t s);</code></p>
<p>Observe that this is the same as allocating a block of size <var>n</var>×<var>s</var>.  So why not just go <code>malloc(n*s)</code> instead?  Well, for one thing <code>calloc</code> initialises the memory to all-bits-zero, but I&#8217;m not concerned with that right now.  The problem with <code>malloc(n*s)</code> is that the product <var>n</var>×<var>s</var> can overflow:</p>
<p><code>malloc(65537*65537)</code></p>
<p>On most 32-bit platforms this will overflow 32-bit arithmetic and be silently equivalent to <code>malloc(131073)</code>.  That&#8217;s a problem.</p>
<p>Because <code>calloc</code> is passed the factors of the product it can, in principle, test the factors to see if the product would overflow, before using the product.  In the case where <var>n</var>×<var>s</var> would overflow it can simply fail the allocation (returning <code>NULL</code>) instead of allocating a block of completely the wrong size.</p>
<p>I don&#8217;t think the standard gives implementations much wiggle room in this area:</p>
<blockquote><p>
The calloc function allocates space for an array of nmemb objects, each of whose size<br />
is size.  The space is initialized to all bits zero.</p>
<p>Returns </p>
<p>The calloc function returns either a null pointer or a pointer to the allocated space.
</p></blockquote>
<p>&#8220;Returns either a null pointer or a pointer to the allocated space&#8221;, nothing about the behaviour being undefined if the implied required size exceeds <code>size_t</code> or anything like that.  However, I don&#8217;t think any serious C programmer would think that <code>calloc</code> is <em>required</em> to catch the overflow case, certainly I didn&#8217;t expect it, and I think it would be a good thing.</p>
<p>So, what if you wanted to implement <code>calloc</code> so that it catches the overflow case and returns <code>NULL</code>.  This boils down to:</p>
<p>Given <var>n</var> and <var>s</var>, each a <code>size_t</code>, how do you detect when the product <code>n*s</code> overflows?</p>
<p>Obviously I&#8217;m more interested in portable solutions than not.</p>
<p>After a brief bit of thinking about multi-word arithmetic and other such horribleness the following occurred to me:</p>
<pre name="code" class="c">

if((size_t)-1 / n &gt; s) {
    return NULL;
}
</pre>
<p>(note that <code>(size_t)-1</code> is guaranteed to be the largest value that will fit in a <code>size_t</code>)</p>
<p>I like this code, it&#8217;s portable, it&#8217;s clear, it does the right thing.  The only eensy-teensy leetle worry I have is that the division might be a bit slow.  Since the allocation of memory can take as few as 20 instruction cycles (see [GRUNWALD 1993]), an additional 40 or so cycles for a division might be too much overhead sometimes.  We could have a fast conservative test for the okay case.  For example if both <var>n</var> and <var>s</var> are smaller than 65536 then we&#8217;re guaranteed to not overflow:</p>
<pre name="code" class="c">

if((n &gt; 65535 || s &gt; 65535) &amp;&amp;
    (size_t)-1 / n &gt; s)
{
    return NULL;
}
</pre>
<p>This avoids doing the division when both <var>n</var> and <var>s</var> are suitably small.  Of course there are still a range of cases where the product <code>n*s</code> does not overflow, but we end up doing the division test anyway.  That&#8217;s not so bad because in those cases we&#8217;re allocating at least 65536 bytes anyway.</p>
<p>The 65536 test is a bit weak.  It&#8217;s the largest value we can portably test against because <code>size_t</code>&#8217;s maximum value might be as low as 65536<sup>2</sup>-1.  Can we portably do any better?  If we could compute square roots at compile time we could do something like this:</p>
<pre name="code" class="c">

if((n &gt; sqrt((size_t)-1) || s &gt; sqrt((size_t)-1) &amp;&amp;
    (size_t)-1 / n &gt; s)
{
    return NULL;
}
</pre>
<p>but I can&#8217;t think of way to do that.</p>
<p>What if we merely accommodate the next most common size for <code>size_t</code>, namely 64 bits?  Observe that 2<sup>64</sup>-1 is 641×6700417×4294967295 (the latter factor is 2<sup>32</sup>-1, the first two factors are the prime factors of 2<sup>32</sup>+1).</p>
<p>Here is a portable test for &#8220;<code>size_t</code> has at least 64 bits&#8221; that is a compile time constant:</p>
<p><code>((size_t)-1)/641u/6700417u &gt;= 4294967295u</code></p>
<p>This is portable because all the literals are guaranteed to fit in <code>unsigned long</code>.</p>
<p>So we can use this test to select a lower bound for maximum <code>size_t</code> value&#8217;s square root:</p>
<pre name="code" class="c">

#define LBMAXSZSQRT ((((size_t)-1)/641u/6700417u &gt;= 4294967295u) ? \
    65535 : 4294967295)

if((n &gt; LBMAXSZQRT || s &gt; LBMAXSZSQRT) &amp;&amp;
    (size_t)-1 / n &gt; s)
{
    return NULL;
}
</pre>
<p>We could extend this approach to support this sort of early-pass test for any finite number of <code>size_t</code> widths, but 32 and 64 seem to be the most important.  In any case we still get <em>some</em> sort of early-pass test that avoids the divide whatever width <code>size_t</code> is.</p>
<p>So that&#8217;s how to make a nice robust <code>calloc</code>.  We&#8217;ve all heard the blurb about how we should rely on the C library wherever possible because its routines will be highly tested, robust, and carefully optimised.  So naturally every existing <code>calloc</code> out there performs this overflow check and doesn&#8217;t just multiply its arguments together?  Oh no.  Even I was surprised.</p>
<p>On OS X (10.4.11) <code>calloc(65537, 65537)</code> returns a non-NULL pointer.  This is a bug.</p>
<p><a href="http://www.google.com/codesearch?hl=en&amp;q=+lang:c+file:malloc.c+calloc+show:29NVklYRJcY:BNMUqDSfpaw:yYhuXu0Wy7A&amp;sa=N&amp;cd=2&amp;ct=rc&amp;cs_p=ftp://ftp.freebsd.org/pub/FreeBSD/development/CVSup/ezm3/ezm3-1.2-NetBSDi386-boot.tar.bz2&amp;cs_f=ezm3-1.2/boot-NetBSDi386/m3core/NetBSDi386/malloc.c">PHK&#8217;s code in NetBSD is typical</a>, it just multiples the two arguments and uses the result, reckless to overflow.</p>
<p>Hurray for FreeBSD: <a href="http://www.google.com/codesearch?hl=en&amp;q=+lang:c+file:malloc.c+%22Try+to+avoid+division+here%22+show:wCtOr8zS4hU:xu84-JC_YNA:wCtOr8zS4hU&amp;sa=N&amp;cd=2&amp;ct=rc&amp;cs_p=cvs+:pserver:anoncvs%40anoncvs.at.FreeBSD.org:/home/ncvs+src&amp;cs_f=lib/libc/stdlib/malloc.c#l4578">they do almost exactly what I suggest</a>, but with a fast test that is just the tiniest bit unportable.</p>
<p>REFERENCES</p>
<p>[GRUNWALD 1993] &#8220;CustoMalloc: Efficient Synthesized Memory Allocators&#8221;; SOFTWARE—PRACTICE AND EXPERIENCE, VOL. 23(8), 851–869 (AUGUST 1993); 1993-08</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/drj11.wordpress.com/185/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/drj11.wordpress.com/185/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/drj11.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/drj11.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/drj11.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/drj11.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/drj11.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/drj11.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/drj11.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/drj11.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/drj11.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/drj11.wordpress.com/185/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=drj11.wordpress.com&blog=258145&post=185&subd=drj11&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://drj11.wordpress.com/2008/06/04/calloc-when-multiply-overflows/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/drj11-128.jpg" medium="image">
			<media:title type="html">drj11</media:title>
		</media:content>
	</item>
		<item>
		<title>double puzzle: the next floor</title>
		<link>http://drj11.wordpress.com/2008/06/03/double-puzzle-the-next-floor/</link>
		<comments>http://drj11.wordpress.com/2008/06/03/double-puzzle-the-next-floor/#comments</comments>
		<pubDate>Tue, 03 Jun 2008 14:12:51 +0000</pubDate>
		<dc:creator>drj11</dc:creator>
		
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://drj11.wordpress.com/?p=184</guid>
		<description><![CDATA[As I was looking at ms I came across some C code of the form:
floor(1 + x) - 1
where x is a double precision floating point value. (I&#8217;m too polite to show you the actual code, see streec.c line 443 if you must).
Question: when is this different from floor(x)?
It&#8217;s quite a fun little puzzle.  [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>As I was looking at <a href="http://home.uchicago.edu/~rhudson1/source/mksamples.html">ms</a> I came across some C code of the form:</p>
<p><code>floor(1 + x) - 1</code></p>
<p>where <var>x</var> is a double precision floating point value. (I&#8217;m too polite to show you the actual code, see streec.c line 443 if you must).</p>
<p>Question: when is this different from <code>floor(x)</code>?</p>
<p>It&#8217;s quite a fun little puzzle.  I give my answers below.</p>
<p>For the purposes of this discussion I&#8217;ll assume that <code>double</code> is an IEEE double precision floating point type.  So that means <code>double</code> exactly represents numbers of the form</p>
<p>m×2<sup>e</sup></p>
<p>where <var>m</var> and <var>e</var> are both integers, respecting the following ranges:<br />
-2<sup>53</sup> &lt; m &lt; 2<sup>53</sup><br />
-1074 &lt;= e &lt;= 971</p>
<p>2<sup>53</sup> is the first value that occurred to me.  This is the smallest integer representable as a double where its successor is not exactly representable.  So if <var>x</var> is 2<sup>53</sup> then <var>x</var>+1 is also 2<sup>53</sup> (IEEE round-to-even), floor(2<sup>53</sup>) is 2<sup>53</sup> (it&#8217;s an integer), and 2<sup>53</sup> - 1 is exactly representable (the successor of 2<sup>53</sup> is not exactly representable, but its predecessor is).</p>
<p>A similar thing happens for some of the numbers bigger than 2<sup>53</sup> and less than 2<sup>54</sup>.  In this range the step between adjacent doubles is 2 (in the representation scheme above, <var>e</var> is 1).  These doubles are all integers, so <code>floor</code> isn&#8217;t going to change anything, so <code>floor(1+x)-1)</code> is <code>(x+1)-1</code>, and <code>floor(x)</code> is <code>x</code>.  When <var>x</var> is a double represented by an <var>m</var> that is odd then <var>x</var>+1 and <var>x</var> will be different because of the round-to-even rule.  For exactly the same reason <var>x</var>+1-1 will be the same as <var>x</var>+1.  An example is <var>x</var> = 2<sup>53</sup>+2.  This is represented as 4503599627370497×2<sup>1</sup>, but <var>x</var>+1-1 is 4503599627370498×2<sup>1</sup>.  In general a similar thing happens for a number of the form 2i where <var>i</var> is an odd positive integer and 2<sup>52</sup> &lt; <var>i</var> &lt; 2<sup>53</sup>.</p>
<p>The previous problem was that we had a number <var>x</var> and adding 1 to it made the result round up to the next higher integer.  A similar thing happens for very small negative values.  If <var>x</var> is negative and very close to 0 then <var>x</var>+1 might be sufficiently close to 1 to be rounded to 1.  This happens when -2<sup>-54</sup> &lt;= x &lt; 0 (numbers just a bit less than -2<sup>-54</sup> get round to 1-2<sup>-53</sup> when 1 is added to them).</p>
<p>-0.  This is sort of degenerate case of the above.  -0 can be thought of as being just the tiniest bit less than 0, and this difference cancels completely when 1 is added.</p>
<p>In the above case when <var>x</var> is small and negative what happens is that it is just smaller than an integer, and this difference gets cancelled entirely when 1 is added.  So that whilst <var>x</var> is not an integer <var>x</var>+1 is.  A similar thing happens at every number that&#8217;s just a bit less than an integer power of 2 (a reasonably small positive power of 2).  For example 7.999999999999999 (which is 8-2<sup>-50</sup>) rounds to 9 when 1 is added.  So <code>floor(7.999999999999999+1)-1</code> is 8, but floor(7.999999999999999) is 7.  This happens for every number of the form 2<sup>i</sup>-2<sup>i-53</sup> (this is nextafter(2<sup>i</sup>, 0)) where <var>i</var> is a non-negative integer and <var>i</var> &lt; 52.</p>
<p>Possibly I&#8217;ve missed some cases.  Especially negative ones.</p>
<p>In the case where I originally found the code I&#8217;m pretty sure the difference is irrelevant.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/drj11.wordpress.com/184/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/drj11.wordpress.com/184/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/drj11.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/drj11.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/drj11.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/drj11.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/drj11.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/drj11.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/drj11.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/drj11.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/drj11.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/drj11.wordpress.com/184/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=drj11.wordpress.com&blog=258145&post=184&subd=drj11&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://drj11.wordpress.com/2008/06/03/double-puzzle-the-next-floor/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/drj11-128.jpg" medium="image">
			<media:title type="html">drj11</media:title>
		</media:content>
	</item>
		<item>
		<title>Tabs: Stupid, Wrong, Intolerable</title>
		<link>http://drj11.wordpress.com/2008/06/02/tabs-stupid-wrong-intolerable/</link>
		<comments>http://drj11.wordpress.com/2008/06/02/tabs-stupid-wrong-intolerable/#comments</comments>
		<pubDate>Mon, 02 Jun 2008 08:23:04 +0000</pubDate>
		<dc:creator>drj11</dc:creator>
		
		<category><![CDATA[programming]]></category>

		<category><![CDATA[rant]]></category>

		<guid isPermaLink="false">http://drj11.wordpress.com/?p=183</guid>
		<description><![CDATA[Here&#8217;s why tabs are wrong:


        if( (segsites &#62; 0 ) &#124;&#124; ( pars.mp.theta &#62; 0.0 ) ) {
               if( (pars.mp.segsitesin &#62; 0 ) &#38;&#38; ( pars.mp.theta &#62; 0.0 ))
      [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Here&#8217;s why tabs are wrong:</p>
<pre name="code" class="c">

        if( (segsites &gt; 0 ) || ( pars.mp.theta &gt; 0.0 ) ) {
               if( (pars.mp.segsitesin &gt; 0 ) &amp;&amp; ( pars.mp.theta &gt; 0.0 ))
                       fprintf(pf,&quot;prob: %g\n&quot;, probss ) ;
           fprintf(pf,&quot;segsites: %d\n&quot;,segsites);
                   if( segsites &gt; 0 )   fprintf(pf,&quot;positions: &quot;);
                   for( i=0; i&lt;segsites; i++)
              fprintf(pf,&quot;%6.4lf &quot;,posit[i] );
           fprintf(pf,&quot;\n&quot;);
               if( segsites &gt; 0 )
                  for(i=0;i&lt;pars.cp.nsam; i++) { fprintf(pf,&quot;%s\n&quot;, list[i] ); }
            }
</pre>
<p>I never want to see this shit.  That was how this code looked when I opened it in <code>vi</code>.  With tabstops set to the default of 8.  It is of course much improved once I guess that the correct tabstop should be 4:</p>
<pre name="code" class="c">

        if( (segsites &gt; 0 ) || ( pars.mp.theta &gt; 0.0 ) ) {
           if( (pars.mp.segsitesin &gt; 0 ) &amp;&amp; ( pars.mp.theta &gt; 0.0 ))
               fprintf(pf,&quot;prob: %g\n&quot;, probss ) ;
           fprintf(pf,&quot;segsites: %d\n&quot;,segsites);
           if( segsites &gt; 0 )   fprintf(pf,&quot;positions: &quot;);
           for( i=0; i&lt;segsites; i++)
              fprintf(pf,&quot;%6.4lf &quot;,posit[i] );
           fprintf(pf,&quot;\n&quot;);
           if( segsites &gt; 0 )
              for(i=0;i&lt;pars.cp.nsam; i++) { fprintf(pf,&quot;%s\n&quot;, list[i] ); }
        }
</pre>
<p>but later down the same file (with tabstop still set to 4):</p>
<pre name="code" class="c">

    }
   else if( segsitesin &gt; 0 ) {

        pk = (double *)malloc((unsigned)(nsegs*sizeof(double)));
        ss = (int *)malloc((unsigned)(nsegs*sizeof(int)));
        if( (pk==NULL) || (ss==NULL) ) perror(&quot;malloc error. gensam.2&quot;);

      tt = 0.0 ;
      for( seg=0, k=0; k&lt;nsegs; seg=seglst[seg].next, k++) {
        if( mfreq &gt; 1 ) ndes_setup( seglst[seg].ptree, nsam );
        end = ( k&lt;nsegs-1 ? seglst[seglst[seg].next].beg -1 : nsites-1 );
        start = seglst[seg].beg ;
        len = end - start + 1 ;
        tseg = len/(double)nsites ;
               if( mfreq == 1 ) pk[k] = ttime(seglst[seg].ptree,nsam)*tseg ;
               else pk[k] = ttimemf(seglst[seg].ptree,nsam, mfreq)*tseg ;
                 tt += pk[k] ;
      } 
</pre>
<p>which doesn&#8217;t look very tidy whatever I set tabstop to.  Also, the curly ket preceding the <code>else</code> is to the left of the <code>else</code> and on an earlier line; that confuses the JavaScript syntax coloriser code (which isn&#8217;t mine) and causes it to crop the <code>else</code> token incorrectly.  Select the &#8220;view plain&#8221; link to see all the code.</p>
<p>The code is from <a href="http://home.uchicago.edu/~rhudson1/source/mksamples.html">ms</a>, a genetic sample generation program used by scientists.</p>
<p>It seems to me that tabs are an <em>attractive nuisance</em>.  Something that seems like a good idea, but which can lead to trouble.  Sure, you and I can use them safely, but in the hands of the péons they just lead to madness.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/drj11.wordpress.com/183/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/drj11.wordpress.com/183/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/drj11.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/drj11.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/drj11.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/drj11.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/drj11.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/drj11.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/drj11.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/drj11.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/drj11.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/drj11.wordpress.com/183/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=drj11.wordpress.com&blog=258145&post=183&subd=drj11&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://drj11.wordpress.com/2008/06/02/tabs-stupid-wrong-intolerable/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/drj11-128.jpg" medium="image">
			<media:title type="html">drj11</media:title>
		</media:content>
	</item>
		<item>
		<title>Python Long Masks</title>
		<link>http://drj11.wordpress.com/2008/05/14/python-long-masks/</link>
		<comments>http://drj11.wordpress.com/2008/05/14/python-long-masks/#comments</comments>
		<pubDate>Wed, 14 May 2008 13:20:20 +0000</pubDate>
		<dc:creator>drj11</dc:creator>
		
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://drj11.wordpress.com/?p=181</guid>
		<description><![CDATA[x&#38;y is a long when either x or y is a long.  When it could/should be only when both are long.
In particular x&#38;1 is a long whenever x is.  Despite the fact that the numerical answer is either 0 or 1.
I&#8217;m not saying this is wrong, just&#8230; ugly.
Roll on Py3K.
    [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><code>x&amp;y</code> is a long when <em>either</em> <var>x</var> or <var>y</var> is a long.  When it could/should be only when <em>both</em> are long.</p>
<p>In particular <code>x&amp;1</code> is a long whenever <var>x</var> is.  Despite the fact that the numerical answer is either 0 or 1.</p>
<p>I&#8217;m not saying this is wrong, just&#8230; ugly.</p>
<p>Roll on Py3K.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/drj11.wordpress.com/181/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/drj11.wordpress.com/181/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/drj11.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/drj11.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/drj11.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/drj11.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/drj11.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/drj11.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/drj11.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/drj11.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/drj11.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/drj11.wordpress.com/181/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=drj11.wordpress.com&blog=258145&post=181&subd=drj11&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://drj11.wordpress.com/2008/05/14/python-long-masks/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/drj11-128.jpg" medium="image">
			<media:title type="html">drj11</media:title>
		</media:content>
	</item>
		<item>
		<title>Curly Logo: Wii Edition</title>
		<link>http://drj11.wordpress.com/2008/05/13/curly-logo-wii-edition/</link>
		<comments>http://drj11.wordpress.com/2008/05/13/curly-logo-wii-edition/#comments</comments>
		<pubDate>Tue, 13 May 2008 09:09:00 +0000</pubDate>
		<dc:creator>drj11</dc:creator>
		
		<category><![CDATA[Curly Logo]]></category>

		<category><![CDATA[Wii]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[programming]]></category>

		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://drj11.wordpress.com/?p=180</guid>
		<description><![CDATA[I also announced this on the Curly Logo news feed, but it&#8217;s sufficiently amusing that I&#8217;ll also mention it here.  And also inject some discussion.
So, Curly Logo now works on the Wii.  I think this is quite cool, and quite impractical.  Of course there isn&#8217;t really a Wii edition, there&#8217;s one &#8220;edition&#8221; [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I also announced this on the <a href="feed://www.amberfrog.com/logo/news/atom/">Curly Logo news feed</a>, but it&#8217;s sufficiently amusing that I&#8217;ll also mention it here.  And also inject some discussion.</p>
<p>So, <a href="http://www.amberfrog.com/logo/">Curly Logo</a> now works on the Wii.  I think this is quite cool, and quite impractical.  Of course there isn&#8217;t really a Wii edition, there&#8217;s one &#8220;edition&#8221; that all browsers and all platforms see.</p>
<p>So the Wii is a bit of a frivolous platform, and I don&#8217;t think I&#8217;m going to get very many Curly Logo users on the Wii.  That&#8217;s not why I made Curly Logo work on the Wii.  In fact it was only few weeks ago that it even occurred to me that Curly Logo might work on the Wii (I only used the Wii&#8217;s browser briefly after I first got it, mostly for the novelty of reading the BBC news website on my TV).  At first I dismissed the Wii, silly platform, awkward UI, not worth it.  But then I came round to thinking that the Wii represents a cornerstone of the Curly Logo philosophy.  One that could be briefly described as minimal installation, maximal accessibility.</p>
<p>The reason Curly Logo is implemented in JavaScript and not .net or flash or C is so that it can be deployed to anyone using a browser, with zero installation.  As few barriers as possible between you and using it.  In a way I see this philosophy of being a descendent of 1980&#8217;s language implementations in ROM.  So this philosophy is all very well and good, but to be of any use, I actually have to get Curly Logo working on random browsers.  Which is why I decided to get Curly Logo working on the Wii.  As a sort of proof of concept that it was reasonable to get JavaScript only applications running on more or less any suitable browser.</p>
<p>It turns out that the tricky part of getting Curly Logo running on the Wii was getting it running on Opera.  And happily, the desktop version of Opera is sufficiently like the Wii version that once it was working on desktop Opera it just worked on the Wii.  The Wii even implements SVG; who would&#8217;ve guessed?</p>
<p>Opera seems like a bit of a funny browser.  It&#8217;s like they&#8217;re trying to be a full fledged standards compliant A-list browser, but they just don&#8217;t make the grade like Firefox and Safari.  But perhaps that&#8217;s just because I spend more time with those two.</p>
<p>So the two speedbumps on the road to Opera glory were: <code>btoa</code>; and, CSS box-model.  So it turns out that whilst Firefox and Safari implement the <a href="http://developer.mozilla.org/en/docs/DOM:window.btoa">non-standard <code>btoa</code> function</a>, Opera does not.  <a href="http://drj11.wordpress.com/2007/11/20/a-use-for-uncompressed-pngs/">Curly Logo uses <code>btoa</code> when it generates a 1&#215;1 PNG file</a> to use as the background for the text area.  Happily I already had a JavaScript implementation of <code>btoa</code> that I used for testing.  Parts of Curly Logo are tested using a command line JavaScript interpreter (<a href="http://www.mozilla.org/js/spidermonkey/">SpiderMonkey</a>) which doesn&#8217;t include <code>btoa</code>, so I had to write a version for that.  It was a simple matter to move it from test code, which is not delivered, to product code.</p>
<p>The CSS box-model is probably the part of Curly Logo that I understand the least.  I don&#8217;t think I&#8217;m trying to do anything heroic (after all there are only two boxes: the SVG drawing area, and the text area), it&#8217;s just the CSS spec is very complex, and I don&#8217;t understand it.  The problem was that the drawing area containing the SVG was only tall enough to show the top half of the turtle.  And I think this turned out to be because Opera had decided that the best height for the SVG element was just big enough to show half the turtle.  I guess conceptually it&#8217;s a bit of a tricky problem, how big should the box be that contains a random load of SVG?  Anyway, explicitly fixing the height of the SVG element to be the same as its containing block sorts it out (the CSS is: «svg { height: 100%; }»).</p>
<p>There are two more Opera quirks that I&#8217;ve noticed that I&#8217;ve left unfixed for now: <code>settbg</code>, to SET Text BackGround colour, doesn&#8217;t work unless you specify alpha, so <a href="http://www.amberfrog.com/logo/#settbg%20%22%235c5c"><code>settbg "#5c5c</code></a> works just fine, but <a href="http://www.amberfrog.com/logo/#settbg%20%22%235c5"><code>settbg "#5c5</code></a> borks and dumps a JavaScript exception backtrace all over the text area.  Quality.  The other quirk is that the arrow character used to represent evaluation, as in «2 * π ⇒ 6.283185307179586», displays as a box in Opera (on my Mac, on the Wii it works just fine).  The <code>settbg</code> problem is caused by lack of <code>atob</code> (the inverse function of <code>btoa</code>), and I happen to not have a JavaScript version of that lying around.  Yet.  The arrow/box problem is inexcusable and not my fault.  I suppose I could work around it by choosing a different character (or drawing the arrow in SVG!) but I&#8217;m not inclined to do that.  The arrow convention is nicked from CLTL2, by the way.</p>
<p>For Curly Logo the Wii is not a great platform.  The TV is pretty fuzzy, the text is small, the colours are wrong.  Typing commands in the text box is awkward, the Wii screen keyboard completely replaces the web page so you can&#8217;t use any context.  But it works.  I think it vindicates the JavaScript &#8220;write once, run anywhere&#8221; philosophy.  I wonder if the Wii implements the <a href="http://www.w3.org/TR/REC-CSS2/media.html#media-types"><em>TV</em> CSS media type</a>, that would be the best way to fix the font size problem.</p>
<p>Speedwise Opera seems to be pretty nippy, it comes in somewhere between Safari and Firefox.  For example <a href="http://www.amberfrog.com/logo/gallery/#dragon">the dragon</a> takes about 15 seconds in Opera (Safari: 5, Firefox: 25).  Even on the weedy little Wii (729 MHz PowerPC), dragon takes just over 2 minutes, which isn&#8217;t too much of a wait.  The best bit is that there&#8217;s no &#8220;Click here to continue running this slow script&#8221; button to press, and that you can see the turtle in motion.  The downside is that it didn&#8217;t take me very long before I crashed the Wii, requiring it to be reset with the power button.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/drj11.wordpress.com/180/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/drj11.wordpress.com/180/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/drj11.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/drj11.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/drj11.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/drj11.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/drj11.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/drj11.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/drj11.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/drj11.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/drj11.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/drj11.wordpress.com/180/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=drj11.wordpress.com&blog=258145&post=180&subd=drj11&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://drj11.wordpress.com/2008/05/13/curly-logo-wii-edition/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/drj11-128.jpg" medium="image">
			<media:title type="html">drj11</media:title>
		</media:content>
	</item>
		<item>
		<title>Talk about Python</title>
		<link>http://drj11.wordpress.com/2008/05/07/talk-about-python/</link>
		<comments>http://drj11.wordpress.com/2008/05/07/talk-about-python/#comments</comments>
		<pubDate>Wed, 07 May 2008 16:05:28 +0000</pubDate>
		<dc:creator>drj11</dc:creator>
		
		<category><![CDATA[PyConUK]]></category>

		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://drj11.wordpress.com/?p=179</guid>
		<description><![CDATA[PyConUK 2008 is asking for submissions.  You should give a talk.
You should give a talk because I want to hear what you have to say.  And so will others.  People tend to think that no-one will want to hear what they&#8217;ve been doing, or that it won&#8217;t be interesting.  But on [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>PyConUK 2008 is <a href="http://www.pyconuk.org/callforpapers.html">asking for submissions</a>.  You should give a talk.</p>
<p>You should give a talk because I want to hear what you have to say.  And so will others.  People tend to think that no-one will want to hear what they&#8217;ve been doing, or that it won&#8217;t be interesting.  But on the whole I just don&#8217;t think it&#8217;s true.</p>
<p>Communication is a skill, and it is improved by practice.  I think computer scientists and software engineers should all strive to be better communicators.</p>
<p>Python is not a huge community, we do not have a PR department.  If we want Python to grow then we have to grow it ourselves.  Conferences like PyConUK are an important part of that community growth, and the speakers—that&#8217;s you—that provide content are an important part of the conference.</p>
<p>What should you speak about?  Why you love Python, why you hate Python.  Your favourite module.  How you saved the world from global nuclear catastrophe with a simple Python script.  Anything really.</p>
<p>I&#8217;ve submitted my talk already, and—<em>shock</em>—it&#8217;s <em>not</em> about <a href="http://drj11.wordpress.com/2007/09/10/introduction-to-functional-programming-in-python-slides/">functional programming</a>.</p>
<p>Look forward to hearing what you have to say in September.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/drj11.wordpress.com/179/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/drj11.wordpress.com/179/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/drj11.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/drj11.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/drj11.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/drj11.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/drj11.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/drj11.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/drj11.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/drj11.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/drj11.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/drj11.wordpress.com/179/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=drj11.wordpress.com&blog=258145&post=179&subd=drj11&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://drj11.wordpress.com/2008/05/07/talk-about-python/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/drj11-128.jpg" medium="image">
			<media:title type="html">drj11</media:title>
		</media:content>
	</item>
		<item>
		<title>Lost Searchers</title>
		<link>http://drj11.wordpress.com/2008/05/06/lost-searchers/</link>
		<comments>http://drj11.wordpress.com/2008/05/06/lost-searchers/#comments</comments>
		<pubDate>Tue, 06 May 2008 09:28:10 +0000</pubDate>
		<dc:creator>drj11</dc:creator>
		
		<category><![CDATA[searching]]></category>

		<guid isPermaLink="false">http://drj11.wordpress.com/?p=153</guid>
		<description><![CDATA[WordPress gives me a very convenient view of what people have been searching for when they reach my blog.  I think most readers are regulars; some come from sporadic programming.reddit.com spikes, but some come via search.
I feel sorry for some of these people, coming across my blog in the middle of their search must [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>WordPress gives me a very convenient view of what people have been searching for when they reach my blog.  I think most readers are regulars; some come from sporadic programming.reddit.com spikes, but some come via search.</p>
<p>I feel sorry for some of these people, coming across my blog in the middle of their search must be like stepping on a rake whilst looking for the lost ball in the garden.</p>
<p>«Element Not Good For Monks» - ok, so the search is a bit wacky, but I&#8217;m sure I&#8217;m not the blog they&#8217;re looking for.  There&#8217;s a Kryptonite for monks?</p>
<p>«quilting pattern flower uk» - Search engines have obviously decided on the basis of <a href="http://drj11.wordpress.com/2007/04/22/behold-the-colour-purple/">this post about purple <em>things</em></a>, and this one <a href="http://drj11.wordpress.com/2007/04/05/learning-my-multiplication-tables-in-j-again/">about multiplication in rings</a> that I have something to do with flower quilting patterns.  Sorry, no.</p>
<p>«multiplication table» - this is a relatively popular search term, it crops up a few times a week.  Sufficiently popular that I&#8217;m thinking of creating a blog post for it.</p>
<p>«c++ matrix multiplication code» - close, but no cigar.  Anyway, using Google to do your homework assignments is cheating.</p>
<p>«how to find sex of foetus in ultrasound» - it&#8217;s clear what they&#8217;re looking for and my blog doesn&#8217;t help them at all.  If I had to guess I&#8217;d say you look for the willy.</p>
<p>«emacs python color» - there are quite a few variations on this theme, obviously looking for emacs modes that do colour syntax highlighting for various languages (not just python, I see fortran, javascript, and so on).  Sorry, no idea.</p>
<p>«metroid 2 map» - Well, I suppose I do have a <a href="http://drj11.wordpress.com/2007/10/22/what-i-did-on-my-holiday-metroid-ii/">Metroid II map</a>, but really it&#8217;s a celebration of how not to do mapping.  Sorry, not very useful.  Anyway, regardless of what I think about maps in video games, using somebody else&#8217;s map is clearly cheating.</p>
<p>«where is the colon» - umm&#8230; somewhere behind your belly button?</p>
<p>«most fragile part of the brain» - I have no idea, and I&#8217;m not just about to experiment to find out.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/drj11.wordpress.com/153/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/drj11.wordpress.com/153/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/drj11.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/drj11.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/drj11.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/drj11.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/drj11.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/drj11.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/drj11.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/drj11.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/drj11.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/drj11.wordpress.com/153/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=drj11.wordpress.com&blog=258145&post=153&subd=drj11&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://drj11.wordpress.com/2008/05/06/lost-searchers/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/drj11-128.jpg" medium="image">
			<media:title type="html">drj11</media:title>
		</media:content>
	</item>
	</channel>
</rss>