<?xml version='1.0' encoding='utf-8' ?>
<!--  If you are running a bot please visit this policy page outlining rules you must respect. http://www.livejournal.com/bots/  -->
<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns:media='http://search.yahoo.com/mrss/' xmlns:atom10='http://www.w3.org/2005/Atom'>
<channel>
  <title>Egregious Thoughts</title>
  <link>http://ghewgill.livejournal.com/</link>
  <description>Egregious Thoughts - LiveJournal.com</description>
  <lastBuildDate>Mon, 02 Jan 2012 02:05:20 GMT</lastBuildDate>
  <generator>LiveJournal / LiveJournal.com</generator>
  <lj:journal>ghewgill</lj:journal>
  <lj:journalid>1231916</lj:journalid>
  <lj:journaltype>personal</lj:journaltype>
  <atom10:link rel='hub' href='http://pubsubhubbub.appspot.com/' />
  <image>
    <url>http://l-userpic.livejournal.com/6834531/1231916</url>
    <title>Egregious Thoughts</title>
    <link>http://ghewgill.livejournal.com/</link>
    <width>100</width>
    <height>100</height>
  </image>

<item>
  <guid isPermaLink='true'>http://ghewgill.livejournal.com/146430.html</guid>
  <pubDate>Mon, 02 Jan 2012 02:05:20 GMT</pubDate>
  <title>new photo galleries</title>
  <link>http://ghewgill.livejournal.com/146430.html</link>
  <description>&lt;p&gt;I&apos;ve been busy processing photo galleries from the last year (or two) and putting them online for your perusal.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://hewgill.com/photo/trips/vancouver-2010/&quot;&gt;&lt;img src=&quot;http://hewgill.com/photo/trips/vancouver-2010//IMG_1541.JPG_resize_200.jpg&quot;&gt;Vancouver 2010&lt;/a&gt;
&lt;li&gt;&lt;a href=&quot;http://hewgill.com/photo/trips/northland-2010/&quot;&gt;&lt;img src=&quot;http://hewgill.com/photo/trips/northland-2010//IMG_1819.JPG_resize_200.jpg&quot;&gt;Northland 2010&lt;/a&gt;
&lt;li&gt;&lt;a href=&quot;http://hewgill.com/photo/trips/south-island-2011/&quot;&gt;&lt;img src=&quot;http://hewgill.com/photo/trips/south-island-2011//IMG_2225.JPG_resize_200.jpg&quot;&gt;South Island 2011&lt;/a&gt;
&lt;li&gt;&lt;a href=&quot;http://hewgill.com/photo/weather/snow/christchurch/20110725/&quot;&gt;&lt;img src=&quot;http://hewgill.com/photo/weather/snow/christchurch/20110725/IMG_2149.JPG_resize_200.jpg&quot;&gt;Snow in Christchurch&lt;/a&gt;
&lt;li&gt;&lt;a href=&quot;http://hewgill.com/photo/animals/toothless/&quot;&gt;&lt;img src=&quot;http://hewgill.com/photo/animals/toothless/IMG_1496.JPG_resize_200.jpg&quot;&gt;Toothless the cat&lt;/a&gt;
&lt;/ul&gt;</description>
  <comments>http://ghewgill.livejournal.com/146430.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://ghewgill.livejournal.com/146037.html</guid>
  <pubDate>Sun, 01 Jan 2012 06:46:25 GMT</pubDate>
  <title>2011 in review</title>
  <link>http://ghewgill.livejournal.com/146037.html</link>
  <description>&lt;p&gt;2011 was the year that was pretty much defined by the earthquakes in Christchurch. Everything else &lt;em&gt;seems&lt;/em&gt; insignificant, but it turns out I did other things too.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Christchurch was devastated by the earthquakes of 22 February. Unlike the big one last year, this one was almost directly under the city and destroyed lives, property, and livelihoods. Again we were lucky and did not sustain any major damage.
&lt;li&gt;My parents visited in September. I took a couple of weeks off work and we did a big tour of the South Island and they had a great time.
&lt;li&gt;Received a Microsoft MVP for C++ award for a second time. This is based on my continuing participation answering programming questions on &lt;a href=&quot;http://stackoverflow.com&quot;&gt;Stack Overflow&lt;/a&gt;.
&lt;li&gt;Amy and I officially became New Zealand citizens on 7 November.
&lt;li&gt;Passed my NCEA Level 1 Chinese assessment. This involved a one minute spoken presentation where I talked about our trip with my parents.
&lt;li&gt;In December, moved to Auckland. Amy will be attending school at AUT for a three-year programme for sign language interpreting for the Deaf. I&apos;ll be working remotely from home, which is new for me. We plan to return to Christchurch after Amy is done.
&lt;/ul&gt;

&lt;p&gt;And, in the software section:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Published the &lt;a href=&quot;http://hewgill.com/~greg/stackoverflow/ebooks/&quot;&gt;Stack Overflow ebooks&lt;/a&gt;, which is a library of the top rated questions and answers on Stack Overflow for the most popular tags.
&lt;li&gt;Contributed a number of improvements to &lt;a href=&quot;http://cppcheck.sourceforge.net/&quot;&gt;Cppcheck&lt;/a&gt;, a static analyser for C and C++.
&lt;li&gt;Started on a &lt;a href=&quot;https://github.com/ghewgill/lentil&quot;&gt;Javascript implementation of a Java VM&lt;/a&gt;. Others have done this too, I just wanted to try.
&lt;li&gt;Added the &lt;a href=&quot;https://github.com/ghewgill/nwr&quot;&gt;NOAA Weather Radio tools&lt;/a&gt; to Github (I had written that code years ago, but had never released the source).
&lt;li&gt;&lt;a href=&quot;http://picomath.org&quot;&gt;picomath&lt;/a&gt; is a collection of standalone mathematical functions in many different programming languages.
&lt;/ul&gt;</description>
  <comments>http://ghewgill.livejournal.com/146037.html</comments>
  <category>annual</category>
  <lj:security>public</lj:security>
  <lj:reply-count>1</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://ghewgill.livejournal.com/145715.html</guid>
  <pubDate>Sun, 05 Jun 2011 12:07:24 GMT</pubDate>
  <title>noaa weather radio tools</title>
  <link>http://ghewgill.livejournal.com/145715.html</link>
  <description>After many years (since 2003!) I have finally put the source code to my &lt;a href=&quot;http://hewgill.com/nwr/&quot;&gt;NOAA Weather Radio tools&lt;/a&gt; online at &lt;a href=&quot;https://github.com/ghewgill/nwr&quot;&gt;ghewgill/nwr on Github&lt;/a&gt;. Over the years I had quite a few people email me asking for the source code. I finally am able to reply to them all with a link to the code.</description>
  <comments>http://ghewgill.livejournal.com/145715.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>1</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://ghewgill.livejournal.com/145471.html</guid>
  <pubDate>Sun, 16 Jan 2011 01:08:18 GMT</pubDate>
  <title>minilink performance improvement</title>
  <link>http://ghewgill.livejournal.com/145471.html</link>
  <description>My &lt;a href=&quot;http://lnk.nu&quot;&gt;minilink/lnk.nu link shortener&lt;/a&gt; has been getting increasingly popular lately. There was a sharp jump up in activity in mid-October, which has now put the request rate at around 20k requests per day. There have been spikes up to 40k per day, too.&lt;br /&gt;&lt;br /&gt;This increase in activity has taken a toll on my server, since minilink had been implemented as a simple Python CGI program. This was the original implementation I started with and I haven&apos;t needed to change it. However, CGI is only appropriate for low performance applications, and minilink is probably edging into medium performance at this point. A CGI program has to start up an entire Python runtime environment for &lt;em&gt;every&lt;/em&gt; request.&lt;br /&gt;&lt;br /&gt;Over the last two days, there have been big enough activity spikes that the load on my server goes through the roof and it can&apos;t really handle the requests anymore. This can cause things to crash and run out of memory and other impolite behaviours. This happened once last March, and twice in the last two days.&lt;br /&gt;&lt;br /&gt;Today I did something I should have done long ago: I converted minilink from a CGI program to a &lt;a href=&quot;http://en.wikipedia.org/wiki/Web_Server_Gateway_Interface&quot;&gt;WSGI&lt;/a&gt; program. WSGI improves performance because it keeps the Python runtime loaded in memory, and with Apache&apos;s &lt;a href=&quot;http://code.google.com/p/modwsgi/&quot;&gt;mod_wsgi&lt;/a&gt;, the calls into Python code are much faster.&lt;br /&gt;&lt;br /&gt;I also implemented a simple test suite so that I could refactor the implementation while ensuring that the behaviour stayed the same. That&apos;s something I should have done long ago, too.&lt;br /&gt;&lt;br /&gt;You may see an increase in performance when using minilink starting today. If you see anything go wrong though, please let me know.</description>
  <comments>http://ghewgill.livejournal.com/145471.html</comments>
  <category>minilink</category>
  <category>python</category>
  <lj:security>public</lj:security>
  <lj:reply-count>4</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://ghewgill.livejournal.com/145305.html</guid>
  <pubDate>Sun, 09 Jan 2011 05:32:08 GMT</pubDate>
  <title>stack overflow questions in ebook format</title>
  <link>http://ghewgill.livejournal.com/145305.html</link>
  <description>In my quest to create useful reference ebooks for the Kindle, I&apos;ve created ebooks of the top rated programming questions on &lt;a href=&quot;http://stackoverflow.com&quot;&gt;Stack Overflow&lt;/a&gt; for the &lt;a href=&quot;http://stackoverflow.com/tags&quot;&gt;top 20 tags&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://hewgill.com/~greg/stackoverflow/ebooks/&quot;&gt;Stack Overflow ebooks&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;These files are created from the monthly &lt;a href=&quot;http://blog.stackoverflow.com/category/cc-wiki-dump/&quot;&gt;Stack Overflow Creative Commons data dump&lt;/a&gt;. I&apos;ve got a combination of Python, Java, and XSLT scripts that process the raw XML database dumps into something usable. Then the Amazon &lt;tt&gt;kindlegen&lt;/tt&gt; program creates the ebook file (in Mobipocket format).&lt;br /&gt;&lt;br /&gt;Last year I got a new computer with a fast CPU and lots of memory and disk space. While working on the XML processor, I realised that I was doing a lot of work seeking around a big XML file (it&apos;s over 4 GB) and collecting questions and answers together. This was taking quite some time because of the sheer size of the files. Since I am running a 64-bit OS (FreeBSD 8 amd64), I memory mapped the entire 4 GB XML file into memory and then didn&apos;t have to think about seeking anymore. Letting the OS manage the caching is a much better approach, and the improved performance really shows.&lt;br /&gt;&lt;br /&gt;The preprocessing step (that needs to run once per data dump) creates all the HTML files for each question and its set of answers. I was originally storing all the files in one directory, but a million files in a single directory wasn&apos;t working very well. I ended up splitting the question number into groups of three digits, so &lt;tt&gt;1234567.html&lt;/tt&gt; is actually stored in &lt;tt&gt;123/456/7.html&lt;/tt&gt;. This step takes about two hours to run.&lt;br /&gt;&lt;br /&gt;Creating each ebook file is then a single XSLT transformation (taking about a minute), plus the &lt;tt&gt;kindlegen&lt;/tt&gt; step which can take several minutes depending on the number of questions. The performance of &lt;tt&gt;kindlegen&lt;/tt&gt; isn&apos;t very impressive and appears to be O(n&lt;sup&gt;2&lt;/sup&gt;) in the number of pages.&lt;br /&gt;&lt;br /&gt;The source for all this is available &lt;a href=&quot;https://github.com/ghewgill/so-static&quot;&gt;on Github&lt;/a&gt;.</description>
  <comments>http://ghewgill.livejournal.com/145305.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>2</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://ghewgill.livejournal.com/145105.html</guid>
  <pubDate>Sat, 01 Jan 2011 07:05:19 GMT</pubDate>
  <title>2010 in review</title>
  <link>http://ghewgill.livejournal.com/145105.html</link>
  <description>&lt;p&gt;2010 was a pretty interesting year.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Went to Hawaii for three weeks with Amy. Didn&apos;t get to see flowing lava, but did get to swim with turtles! (Pictures coming when I get around to it, just got the underwater film roll developed a couple of weeks ago.)&lt;/li&gt;
&lt;li&gt;Got a &lt;a href=&quot;http://hewgill.com/journal/entries/554-cat&quot;&gt;cat, &quot;Toothless&quot;&lt;/a&gt;. I had never had a pet before, and he&apos;s now a constant source of smiles for us (eg. &lt;a href=&quot;http://www.flickr.com/photos/amyrtw/4939962140/&quot;&gt;staring contest&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=ijs1xNbxd4Q&quot;&gt;chasing bees&lt;/a&gt;, &lt;a href=&quot;http://hewgill.com/~greg/big-yawn.jpg&quot;&gt;big yawn&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Visited my grandmother in Canada for her 101&amp;frac12;th birthday in a whirlwind weekend trip. She died &lt;a href=&quot;http://hewgill.com/journal/entries/563-margaret-hunter-young-gammie-15-dec-1908---8-dec-2010&quot;&gt;a week before her 102nd birthday&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Repaired a &lt;a href=&quot;http://hewgill.com/journal/entries/557-one-hundred-year-old-heirloom&quot;&gt;hundred year old clock&lt;/a&gt;, which belonged to my great-great-great-grandfather.&lt;/li&gt;
&lt;li&gt;Came through the &lt;a href=&quot;http://en.wikipedia.org/wiki/2010_Canterbury_earthquake&quot;&gt;7.1 earthquake&lt;/a&gt; here in Christchurch with only superficial damage.&lt;/li&gt;
&lt;li&gt;Got a &lt;a href=&quot;http://hewgill.com/journal/entries/558-amazon-kindle-first-impressions&quot;&gt;Kindle&lt;/a&gt;, started reading a lot more.&lt;/li&gt;
&lt;li&gt;Started a &lt;a href=&quot;http://hewgill.com/journal/entries/560-my-weekend-in-pictures&quot;&gt;bathroom renovation&lt;/a&gt; project. Amy&apos;s doing the hard work (project management); I did the fun demolition.&lt;/li&gt;
&lt;li&gt;Helped Amy with a &lt;a href=&quot;http://amyrtw.livejournal.com/26687.html&quot;&gt;mural on our bedroom wall&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Did an evening &lt;a href=&quot;http://www.flickr.com/photos/amyrtw/4939949860/&quot;&gt;chocolate making class&lt;/a&gt;. 12 dozen chocolates is a &lt;em&gt;lot&lt;/em&gt;!&lt;/li&gt;
&lt;li&gt;New open source software: &lt;a href=&quot;http://hewgill.com/journal/entries/555-hp-15c-calculator-simulator&quot;&gt;HP-15C calculator simulator&lt;/a&gt;, &lt;a href=&quot;http://hewgill.com/journal/entries/564-rss2mobi-google-reader-to-mobipocket-creator&quot;&gt;rss2mobi&lt;/a&gt;, &lt;a href=&quot;http://hewgill.com/journal/entries/565-chinese-english-dictionary-for-kindle&quot;&gt;Chinese-English dictionary for Kindle&lt;/a&gt;, &lt;a href=&quot;https://github.com/ghewgill/pyqver&quot;&gt;pyqver&lt;/a&gt; updated for Python 3.&lt;/li&gt;
&lt;/ul&gt;</description>
  <comments>http://ghewgill.livejournal.com/145105.html</comments>
  <category>annual</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://ghewgill.livejournal.com/144650.html</guid>
  <pubDate>Thu, 30 Dec 2010 20:22:30 GMT</pubDate>
  <title>chinese-english dictionary for kindle</title>
  <link>http://ghewgill.livejournal.com/144650.html</link>
  <description>Further to my previous entry on &lt;a href=&quot;http://hewgill.com/journal/entries/561-kindle-3-and-chinese-text&quot;&gt;Chinese text in the Kindle&lt;/a&gt;, I&apos;ve put some more work into the Chinese-English dictionary I mentioned.&lt;br /&gt;&lt;br /&gt;I used the &lt;a href=&quot;http://cc-cedict.org/wiki/&quot;&gt;CC-CEDICT&lt;/a&gt; dictionary as the basis for my dictionary. I also used the radical stroke count database from the &lt;a href=&quot;http://unicode.org/charts/unihan.html&quot;&gt;Unihan Database&lt;/a&gt;. The result is a traditional radical-stroke order dictionary that seems reasonably usable on the Kindle.&lt;br /&gt;&lt;br /&gt;One of the great features of the Kindle is the ability to set a default dictionary so that when you&apos;re reading text, you can simply point to a word and the Kindle will automatically look it up and show the definition in a small popup window. I&apos;ve been able to create such dictionary files successfully for English, but have not been successful for Chinese. I currently suspect that the Kindle simply doesn&apos;t recognise the Chinese characters as something it can look up in a dictionary, so it doesn&apos;t even try. (If anybody has any ideas on this, feedback would be most welcome.)&lt;br /&gt;&lt;br /&gt;The current result can be found here: &lt;a href=&quot;http://hewgill.com/hanzidict/&quot;&gt;Chinese-English Dictionary&lt;/a&gt;.</description>
  <comments>http://ghewgill.livejournal.com/144650.html</comments>
  <category>kindle</category>
  <category>chinese</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://ghewgill.livejournal.com/144491.html</guid>
  <pubDate>Sun, 19 Dec 2010 01:47:45 GMT</pubDate>
  <title>rss2mobi: google reader to mobipocket creator</title>
  <link>http://ghewgill.livejournal.com/144491.html</link>
  <description>&lt;p&gt;I&apos;ve been using my Kindle to read RSS feeds through Google Reader. Using the Kindle&apos;s built-in web browser, Google Reader works surprisingly well (as long as you enable keyboard shortcut commands). However, there are some annoyances:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The text is pretty small due to the layout of the Reader web page. It&apos;s possible to zoom in, but then you need to scroll left and right to read each line of text (which is awkward). The text is certainly not as readable as regular books on the Kindle.
&lt;li&gt;Clicking on a link in Google Reader wants to open a new window, and the Kindle browser simply pops up a message box stating that multiple windows are not supported, with no option to continue.
&lt;li&gt;You must be connected to the Internet to use Google Reader, and can&apos;t browse it offline.
&lt;/ul&gt;

&lt;p&gt;In order to address these issues, I&apos;ve created a program that creates proper e-books in Mobipocket format using &lt;tt&gt;kindlegen&lt;/tt&gt;. I had to solve several problems to make this work:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I wanted to use the RSS feeds I&apos;ve already configured in Google Reader. The Google Reader API is undocumented, so I had to rely on (out of date) descriptions of the API (eg. &lt;a href=&quot;http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;http://blog.martindoms.com/2009/08/15/using-the-google-reader-api-part-1/&quot;&gt;here&lt;/a&gt;).
&lt;li&gt;Downloading just the text of feeds wasn&apos;t quite enough, so I had to download all the images and then rewrite the &lt;tt&gt;&amp;lt;img&amp;gt;&lt;/tt&gt; tags in the HTML to refer to the included image files.
&lt;li&gt;In order to tell the kindle each entry is a &quot;chapter&quot; and therefore allow navigation by skipping to the next entry, I had to create a table of contents in &lt;tt&gt;.ncx&lt;/tt&gt; format.
&lt;li&gt;Originally &lt;tt&gt;kindlegen&lt;/tt&gt; refused to recognise my HTML files as UTF-8 encoded, and built Mobipocket files with the wrong encoding. Eventually I figured out through trial and error that the HTML file names must end in &lt;tt&gt;.html&lt;/tt&gt; (I was using no extension).
&lt;/ul&gt;

&lt;p&gt;Currently this &lt;tt&gt;rss2mobi&lt;/tt&gt; program downloads all the new entries from Google Reader and packs them up into a file that I can manually copy to my Kindle. Next to do is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mark the downloaded entries as &quot;read&quot; in Google Reader so they aren&apos;t downloaded next time.
&lt;li&gt;Automatically transfer the file to the Kindle. Amazon provides a service where I can email the document to a special email address, and then it will be automatically sent to the Kindle wirelessly.
&lt;/ul&gt;

&lt;p&gt;Once all this is in place, I can set up a daily task that gets the new content from Google Reader, and transfers it to my Kindle without any manual interaction.&lt;/p&gt;

&lt;p&gt;You can find the code for &lt;a href=&quot;https://github.com/ghewgill/rss2mobi&quot;&gt;&lt;tt&gt;rss2mobi&lt;/tt&gt; on Github&lt;/a&gt;.&lt;/p&gt;</description>
  <comments>http://ghewgill.livejournal.com/144491.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>2</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://ghewgill.livejournal.com/144156.html</guid>
  <pubDate>Wed, 15 Dec 2010 10:40:46 GMT</pubDate>
  <title>Margaret Hunter Young (Gammie), 15 Dec 1908 - 8 Dec 2010</title>
  <link>http://ghewgill.livejournal.com/144156.html</link>
  <description>Today my grandmother would have been 102. She was born in Aberdeen, Scotland in 1908, and moved to Vancouver, Canada with her family a few years later. She was a teacher of French and Latin when she married my grandfather, but stopped teaching when they married (this was required by law at the time).&lt;br /&gt;&lt;br /&gt;My grandmother never learned to drive a car, and I don&apos;t think she ever even rode a bicycle. However, she traveled a lot with my grandfather, both for his work (teacher training) and for leisure. During these travels, they made many lifelong friends. I remember at Christmas time they always had dozens (or was it hundreds?) of greeting cards hung on string around their dining room.&lt;br /&gt;&lt;br /&gt;She had an astounding memory. Some 35ish years ago, they traveled to New Zealand (and Australia, Fiji, etc), but the trip was still so fresh in her mind that she could even recall &lt;em&gt;specific roads&lt;/em&gt; they had driven here in New Zealand. We would tell her about a trip we took the week before, and she could probably remember details better than we could.&lt;br /&gt;&lt;br /&gt;When Amy and I would call to chat with her, she was always glad to hear from us but she always tried to keep the call short. After, all, it was long distance and must have cost us a fortune! (Really, it doesn&apos;t add up very fast at Skype rates.) She never quite got the hang of the modern electronic world; the most advanced device she learned to use was probably a microwave oven. &lt;br /&gt;&lt;br /&gt;Amy and I took a quick trip to Canada in June to celebrate her 101&amp;frac12;th birthday (when you get to that age, you get to choose what time of year you want to celebrate your birthday). It was great to see her, she was doing very well all things considered.&lt;br /&gt;&lt;br /&gt;Margaret passed quietly in her sleep last week. Today we had cup of tea with dinner in her honour, that&apos;s what she would have wanted.</description>
  <comments>http://ghewgill.livejournal.com/144156.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>1</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://ghewgill.livejournal.com/144086.html</guid>
  <pubDate>Tue, 30 Nov 2010 09:24:30 GMT</pubDate>
  <title>kiwi pycon 2010 notes</title>
  <link>http://ghewgill.livejournal.com/144086.html</link>
  <description>&lt;p&gt;Last week I went to &lt;a href=&quot;http://nz.pycon.org/&quot;&gt;Kiwi PyCon 2010&lt;/a&gt; in Waitangi (New Zealand, of course). I didn&apos;t take my laptop and the Kindle isn&apos;t really built for notetaking, so I scribbled notes the old fashioned way on a sheet of venue-provided note paper. The following is a dump of what I have.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Consider &lt;a href=&quot;http://fabfile.org&quot;&gt;Fabric&lt;/a&gt; for automating deployment/admin tasks
&lt;li&gt;A different approach is &lt;a href=&quot;http://wiki.opscode.com/display/chef/Home&quot;&gt;Chef&lt;/a&gt;, which is a declarative language for describing what you want your deployment to look like
&lt;li&gt;&lt;a href=&quot;https://launchpad.net/wikkid&quot;&gt;Wikkid&lt;/a&gt; is a new wiki, similar to &lt;a href=&quot;http://ikiwiki.info&quot;&gt;ikiwiki&lt;/a&gt; but in Python. It uses &lt;a href=&quot;http://docs.repoze.org/who/2.0/&quot;&gt;repoze.who&lt;/a&gt; for authentication, which needs OpenID support.
&lt;li&gt;&lt;a href=&quot;https://github.com/gabrielfalcao/lettuce&quot;&gt;lettuce&lt;/a&gt; is like &lt;a href=&quot;http://cukes.info/&quot;&gt;cucumber&lt;/a&gt; for Python
&lt;li&gt;Learn &lt;a href=&quot;http://hudson-ci.org/&quot;&gt;Hudson&lt;/a&gt;. Probably more well-supported than Buildbot.
&lt;li&gt;When creating automated test code, prefer anonymous &quot;stock&quot; object creation functions instead of specifying the full content of the object all the time. With the full content, how can you easily identify what&apos;s special or important about that object?
&lt;li&gt;Use an &lt;code&gt;addCleanup&lt;/code&gt; style method to localise cleanup of test objects
&lt;li&gt;Apparently, &lt;code&gt;reduce()&lt;/code&gt; is almost always used to sum numbers (now we have &lt;code&gt;sum()&lt;/code&gt;, of course). In my code, I seem to have also used it for &lt;code&gt;max()&lt;/code&gt;, &lt;code&gt;string.join()&lt;/code&gt;, and &lt;code&gt;all()&lt;/code&gt;.
&lt;li&gt;Does my Psil deserve to be on PyPi? Maybe.
&lt;li&gt;Prefer &lt;a href=&quot;http://docs.python.org/library/xml.etree.elementtree.html&quot;&gt;&lt;code&gt;elementtree&lt;/code&gt;&lt;/a&gt; over &lt;code&gt;xml.dom&lt;/code&gt;
&lt;li&gt;Investigate &lt;a href=&quot;http://code.google.com/p/pymox/&quot;&gt;Mox&lt;/a&gt; for mock objects
&lt;li&gt;Python has a pure functional subset. Write something to identify pure functional code. Introduce a pattern matching decorator. Offer some Erlang-like features for Python (easy message passing, lots of parallel processes, etc).
&lt;li&gt;Wikkid again. Support Git in addition to Bzr.
&lt;li&gt;There exists a &lt;a href=&quot;http://wiki.python.org/moin/3to2&quot;&gt;3to2&lt;/a&gt; converter in addition to 2to3
&lt;li&gt;Embed Unicode characters by name: &lt;code&gt;&quot;\N{LATIN CAPITAL LETTER H}ello world&quot; == &quot;Hello world&quot;&lt;/code&gt;
&lt;li&gt;&lt;a href=&quot;http://pypi.python.org/pypi/Unidecode&quot;&gt;Unidecode&lt;/a&gt; claims to be able to convert Chinese characters to Pinyin
&lt;li&gt;&lt;a href=&quot;http://chardet.feedparser.org/&quot;&gt;Chardet&lt;/a&gt; can auto-detect character encodings
&lt;/ul&gt;

&lt;p&gt;Kiwi PyCon was great again this year! Lots of good presentations and worthwhile discussion. Plenty of excellent giveaways too, nobody went away empty-handed.&lt;/p&gt;</description>
  <comments>http://ghewgill.livejournal.com/144086.html</comments>
  <category>python</category>
  <lj:security>public</lj:security>
  <lj:reply-count>8</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://ghewgill.livejournal.com/143778.html</guid>
  <pubDate>Tue, 09 Nov 2010 09:50:26 GMT</pubDate>
  <title>kindle 3 and chinese text</title>
  <link>http://ghewgill.livejournal.com/143778.html</link>
  <description>A few weeks ago I started a beginner level Chinese (Mandarin) evening class at the local community college. We&apos;re about four weeks in and I&apos;m really enjoying it, will definitely do more.&lt;br /&gt;&lt;br /&gt;I thought it would be an interesting project to load a Chinese-English dictionary onto my Kindle for reference. I&apos;ve already played with &lt;tt&gt;kindlegen&lt;/tt&gt;, which takes a collection of HTML files along with some additional metadata and creates a MobiPocket &lt;tt&gt;.mobi&lt;/tt&gt; format file for the Kindle. (I&apos;ve got several ideas for reference documents that could be loaded onto the Kindle, more on that later.)&lt;br /&gt;&lt;br /&gt;Anyway, I&apos;ve now got a prototype Chinese dictionary loaded onto the Kindle. However, although many of the characters are displayed correctly, quite a few are just empty boxes (in the form of &lt;a href=&quot;http://www.cafepress.com/nucleartacos.26746952&quot;&gt;I &amp;#x2b1c; Unicode&lt;/a&gt;). I couldn&apos;t find any particular pattern to the missing characters, for example &amp;#x4ed6; (he) displayed correctly but &amp;#x5979; (she) did not.&lt;br /&gt;&lt;br /&gt;Some research with Google showed that some people had &lt;a href=&quot;http://www.mobileread.com/forums/showthread.php?t=88004&quot;&gt;hacked the Kindle&lt;/a&gt; and found a way to load different font files onto the device. I didn&apos;t try doing that, becuase I thought there should be a better solution. After all, Chinese text &lt;em&gt;is&lt;/em&gt; displayed correctly in the Kindle web browser! Furthermore, if I copy a UTF-8 format file directly to the Kindle for display, it will have the missing character problem. But if I email the file to Amazon where they automatically reformat it to a &lt;tt&gt;.azw&lt;/tt&gt; book file and deliver it to the Kindle, the characters show up correctly. If I convert to a MobiPocket book file myself, missing characters.&lt;br /&gt;&lt;br /&gt;After laboriously paging through dozens of threads on mobileread.com (typical internet &quot;forum&quot; software really is awful), I finally found a solution. It uses an undocumented debug feature of the Kindle. Press &amp;lt;Home&amp;gt; &amp;lt;Search&amp;gt; and enter the following commands:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;    ;debugOn &amp;lt;Enter&amp;gt;
    ~setLocale zh-CN &amp;lt;Enter&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;That&apos;s it, that is all that was required. I have no idea what this actually does or how it changes the Kindle&apos;s interpretation of UTF-8 documents (UTF-8 is supposed to be an unambiguous encoding of Unicode). But I now have a very basic Chinese-English dictionary in my Kindle.</description>
  <comments>http://ghewgill.livejournal.com/143778.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>9</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://ghewgill.livejournal.com/143444.html</guid>
  <pubDate>Mon, 25 Oct 2010 07:34:20 GMT</pubDate>
  <title>my weekend in pictures</title>
  <link>http://ghewgill.livejournal.com/143444.html</link>
  <description>Saturday: Removed a tonne of bricks from the front path, piled them in the back. Sunday: Laid down weed mat and installed close to a tonne of gravel. The bricks had grass and weeds growing between them and were always damp and slippery.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.flickr.com/photos/ghewgill/5113164661/&quot;&gt;&lt;img src=&quot;http://farm2.static.flickr.com/1148/5113164661_3b3003cdd9_m.jpg&quot;&gt;&lt;/a&gt; &lt;a href=&quot;http://www.flickr.com/photos/ghewgill/5113167813/&quot;&gt;&lt;img src=&quot;http://farm2.static.flickr.com/1057/5113167813_f062703229_m.jpg&quot;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Monday: Bathroom renovation begins. Removed grotty old shower door, bathtub, and shelves. Now we have an (almost) empty box inside the house which will (eventually) contain a new bathroom.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.flickr.com/photos/ghewgill/5113758118/&quot;&gt;&lt;img src=&quot;http://farm2.static.flickr.com/1355/5113758118_a26687429a_m.jpg&quot;&gt;&lt;/a&gt; &lt;a href=&quot;http://www.flickr.com/photos/ghewgill/5113161533/&quot;&gt;&lt;img src=&quot;http://farm2.static.flickr.com/1137/5113161533_085fa759b0_m.jpg&quot;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;What I didn&apos;t get to:&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.flickr.com/photos/ghewgill/5113171137/&quot;&gt;&lt;img src=&quot;http://farm2.static.flickr.com/1365/5113171137_18cb855579_m.jpg&quot;&gt;&lt;/a&gt;</description>
  <comments>http://ghewgill.livejournal.com/143444.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>1</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://ghewgill.livejournal.com/143236.html</guid>
  <pubDate>Sun, 03 Oct 2010 20:21:35 GMT</pubDate>
  <title>bad math: pet ownership and lottery winners</title>
  <link>http://ghewgill.livejournal.com/143236.html</link>
  <description>&lt;p&gt;A headline in the local paper this morning reads &lt;a href=&quot;http://www.stuff.co.nz/oddstuff/4192789/Lucky-Lotto-winnners-like-cats&quot;&gt;Lucky Lotto winnners like cats&lt;/a&gt; with the first two paragraphs:&lt;/p&gt;

&lt;blockquote&gt;HAVING A cat could improve your chances of winning Lotto - by a whisker.&lt;/blockquote&gt;

&lt;blockquote&gt;A survey released today by New Zealand Lotteries shows 39 percent of big Lotto winners have cats, making felines the most popular pets among lucky Lotto winners. Dogs are second but way behind with only 27 percent of big winners preferring man&apos;s best friend to moggies.&lt;/blockquote&gt;

&lt;p&gt;My first reaction upon reading that was, &quot;so what?&quot;. Surely the pet ownership statistics among the general population would be reflected in those statistics for the small number of lotto winners. The &lt;a href=&quot;http://petfoodnz.co.nz/market.htm&quot;&gt;New Zealand Petfood Manufacturers Assocation&lt;/a&gt; claims the ownership numbers for New Zealand as a whole are 53% for cats and 35% for dogs.&lt;/p&gt;

&lt;p&gt;What does this tell us? These numbers show that a greater proportion of &lt;em&gt;non-pet owners&lt;/em&gt; win the lottery than there are non-pet-owners in the general population. Having a cat certainly doesn&apos;t &quot;improve your chances&quot; as the article claims. (These are just rough numbers because we don&apos;t know what proportion of either the general population or lottery winners own &lt;em&gt;both&lt;/em&gt; a cat and a dog.)&lt;/p&gt;

&lt;p&gt;They say the lottery is a tax on people who are bad at math. Apparently, the &quot;bad at math&quot; part extends to those writing about the lottery, too.&lt;/p&gt;</description>
  <comments>http://ghewgill.livejournal.com/143236.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://ghewgill.livejournal.com/142979.html</guid>
  <pubDate>Sat, 18 Sep 2010 04:10:52 GMT</pubDate>
  <title>amazon kindle first impressions</title>
  <link>http://ghewgill.livejournal.com/142979.html</link>
  <description>I got my Amazon Kindle 3 earlier this week! I pre-ordered it around the end of August and seemed to receive it here in New Zealand before some US users received theirs. It was packed in an integrated protective/shipping box, and my first thought upon opening it was, &quot;Amazon has been taking lessons from Apple.&quot; The device was sitting face up with clear plastic film on both sides that was easy to remove. Since the e-ink display doesn&apos;t take any power to hold the display, they had already displayed basic instructions on the screen ready to go (just where to plug it in and where the power switch is).&lt;br /&gt;&lt;br /&gt;The display is fantastic! It&apos;s super high resolution, quite high contrast, and the brighter the ambient light is, the easier it is to read. The first day after I got it, I sat on a beach in full afternoon sun and it was brilliant. Any other LCD display would have been struggling.&lt;br /&gt;&lt;br /&gt;I got the model with both WiFi and 3G, and both seem to work well enough. There was no trouble connecting to my home network, and the 3G works fine even if I&apos;m on the bus. The price of 3G networking is included in the cost of the device itself and books you buy, so there&apos;s no contract and I need to have no relationship with whoever provides the 3G. The Kindle now has an experimental web browser which can browse any web site on WiFi but is limited to the Kindle store and Wikipedia on 3G. However, with Wikipedia on free 3G this device actually &lt;em&gt;is&lt;/em&gt; the Hitchhiker&apos;s Guide to the Galaxy. All it needs is &lt;big&gt;DON&apos;T PANIC&lt;/big&gt; in large friendly letters on the front.&lt;br /&gt;&lt;br /&gt;For the first few days, I didn&apos;t spend anything on content because &lt;a href=&quot;http://gutenberg.org&quot;&gt;Project Gutenberg&lt;/a&gt; (among others) provide free ready-to-download &quot;.mobi&quot; format files for the Kindle. Downloading books is a simple click and the book magically shows up on the Kindle home page. The first (and only, so far) book I bought was &lt;a href=&quot;http://oreilly.com/catalog/9780596518189&quot;&gt;Erlang Programming&lt;/a&gt; which I bought on my way home on the bus the other day. The purchasing experience is seamless so I&apos;m going to have to watch that I don&apos;t spend all my money on books.&lt;br /&gt;&lt;br /&gt;The Kindle comes with two dictionaries built in, the &quot;Oxford Dictionary of English&quot; and &quot;The New Oxford American Dictionary&quot;. Both these are books in their own right that can be read and browsed, but also when reading any other content you can point to a word and look it up in the dictionary (you can choose which one is your default). I often look up words to be sure I know what they mean (I&apos;m a big user of &lt;a href=&quot;http://en.wiktionary.org&quot;&gt;wiktionary.org&lt;/a&gt;) so having the dictionary available everywhere is excellent.&lt;br /&gt;&lt;br /&gt;There are some highlighting and note-taking features, and these seem to integrate into the social media space somehow so you can see what other people have highlighted and annotated. I haven&apos;t played with any of those features yet.&lt;br /&gt;&lt;br /&gt;The web browser itself feels quite clunky and difficult to use (this is partly because the screen isn&apos;t a touch screen and you have to use the little navigation buttons to move a pointer around to point to things). I could log in and use some sites like Twitter, but the browser wouldn&apos;t let me type my name into the Gmail login screen  for example (I tried both the regular and &quot;mobile&quot; sites). I look forward to upgrades on the browser, hopefully they will correct these problems. But the Kindle will never match an iPhone/iPod/iPad for general browsing capability.&lt;br /&gt;&lt;br /&gt;I&apos;m very happy with the Kindle and I believe I will find myself reading more because of it.</description>
  <comments>http://ghewgill.livejournal.com/142979.html</comments>
  <category>kindle</category>
  <lj:security>public</lj:security>
  <lj:reply-count>7</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://ghewgill.livejournal.com/142722.html</guid>
  <pubDate>Fri, 27 Aug 2010 11:10:23 GMT</pubDate>
  <title>one hundred year old heirloom</title>
  <link>http://ghewgill.livejournal.com/142722.html</link>
  <description>&lt;div style=&quot;float: right&quot;&gt;&lt;a href=&quot;http://hewgill.com/photo/misc/clock/&quot;&gt;&lt;img src=&quot;http://hewgill.com/photo/misc/clock/IMG_1661.JPG_resize_200.jpg&quot;&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;When I was young, my grandparents had a fancy marble clock in their home. It always fascinated me, because it would chime every half hour (they would turn on the chime for me). At some point, a picture frame fell on the clock, which broke apart nearly all the marble pieces. The clock got put in a box where it stayed for 30 years. But my grandparents always said it was &lt;em&gt;my&lt;/em&gt; clock.&lt;/p&gt;

&lt;p&gt;Fast forward to earlier this year. Amy happened to be looking at antique clocks as she was thinking that something like that would go well on the mantel above the fireplace. I said, &quot;Hey, did I ever tell you about my clock?&quot; Apparently, I hadn&apos;t. The next day we called my parents, who found the box of clock parts under the stairs, and we managed to coordinate its transport to here in New Zealand with only minor damage.&lt;/p&gt;

&lt;p&gt;Some of the marble bits were broken and one of the metal movement supports was bent, but everything was present and the movement (all the mechanical bits) worked. I researched its history and found that it was probably made in France in the late 19th or early 20th century, and the adhesive used at that time was roughly, plaster of Paris and egg white. This probably protected the marble pieces because the adhesive wasn&apos;t that strong and came apart first before breaking the marble. However, we decided to put it back together with a modern glue (not too strong, but not just white glue).&lt;/p&gt;

&lt;p&gt;The more interesting part about this clock is its history as it relates to my family. The &lt;a href=&quot;http://hewgill.com/photo/misc/clock/IMG_1659.JPG.html&quot;&gt;inscription&lt;/a&gt; reads:&lt;/p&gt;

&lt;center&gt;
Sons of Temperance Friendly Society&lt;br&gt;
Birmingham District Grand Division&lt;br&gt;
Presented to Bro. William Aucott J.P.&lt;br&gt;
as a mark of esteem and appreciation&lt;br&gt;
on completion of 44 years continuous service&lt;br&gt;
as Trustee of the above Society&lt;br&gt;
August 27th 1910
&lt;/center&gt;

&lt;p&gt;William Aucott was my great great great grandfather. He was born in 1830 in Leicestershire in England, was an early trade union leader when such things were being founded for the first time in 1863, became president of the National Association of Ironworkers in 1874, and served in a number of different roles in different labour organisations throughout his lifetime. He was involved in the Methodist church, helped establish the Sons of Temperance Society in Wednesbury, and was a magistrate on the Wednesbury bench.&lt;/p&gt;

&lt;p&gt;Exactly one hundred years ago today, William Aucott was presented with this very clock as thanks for his service to the society. I&apos;m sure he would be happy to know that the clock remains a treasured posession in our family.&lt;/p&gt;</description>
  <comments>http://ghewgill.livejournal.com/142722.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>3</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://ghewgill.livejournal.com/142469.html</guid>
  <pubDate>Tue, 24 Aug 2010 08:43:20 GMT</pubDate>
  <title>web site content management using git</title>
  <link>http://ghewgill.livejournal.com/142469.html</link>
  <description>For the past several years, I&apos;ve managed my web site content using a local copy (of everything) on my home machine, and a simple &lt;a href=&quot;http://www.samba.org/rsync/&quot;&gt;rsync&lt;/a&gt; script that transfers changed files up to my web site host. While this works, it&apos;s limited (there&apos;s only one &quot;source&quot; copy of my content) and fragile (if I need to change something on the server, I need to remember to make a local copy before syncing again).&lt;br /&gt;&lt;br /&gt;I&apos;ve always known it would be better to manage the content using a real source control system. When I first started managing my web site like this, the state of the art in source control was Subversion, but I never got around to actually setting it up. Today, my source control system of choice is Git, and it seems like a natural fit.&lt;br /&gt;&lt;br /&gt;Importing all my content into a new repository is easy, and I pushed up the repository to my web host overnight. The compressed repo size is 2.6 GB and Git handles it just fine. It feels much better to have multiple mirror copies of the site content, and it&apos;s much nicer to be able to manage it using a powerful tool like Git.</description>
  <comments>http://ghewgill.livejournal.com/142469.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://ghewgill.livejournal.com/142269.html</guid>
  <pubDate>Tue, 22 Jun 2010 10:55:17 GMT</pubDate>
  <title>HP-15C calculator simulator</title>
  <link>http://ghewgill.livejournal.com/142269.html</link>
  <description>I&apos;m a bit of a calculator geek. My favourite calculator is the &lt;a href=&quot;http://www.hpmuseum.org/hp15.htm&quot;&gt;HP-15C&lt;/a&gt;, an advanced scientific programmable RPN calculator made in the 1980s. It&apos;s got a distinctive form factor:&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://hp15c.com&quot;&gt;&lt;img src=&quot;http://hp15c.com/images/15-small.jpg&quot;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I bought mine in 1987 and it got me through university, and still runs on the same set of batteries it came with 23 years ago. The &lt;a href=&quot;http://www.hpmuseum.org/hp12c.htm&quot;&gt;HP-12C&lt;/a&gt; financial version of this calculator did so well that it continues to be sold to this day.&lt;br /&gt;&lt;br /&gt;These days it&apos;s a bit awkward to actually carry a calculator around (since there are computers everywhere), so I&apos;ve implemented a (nearly complete) simulator for the HP-15C in Javascript. You can find it at &lt;a href=&quot;http://hp15c.com&quot;&gt;http://hp15c.com&lt;/a&gt; along with some more information about its capabilities and current known issues.&lt;br /&gt;&lt;br /&gt;If you&apos;re unfamiliar with this calculator, you can find a scanned copy of the &lt;a href=&quot;http://hp15c.org/hp15c.pdf&quot;&gt;Owner&apos;s Handbook&lt;/a&gt; (and the &lt;a href=&quot;http://hp15c.org/hp15cAdvanced.pdf&quot;&gt;Advanced Functions Handbook&lt;/a&gt;) online. There is even a &lt;a href=&quot;http://hp15c.org&quot;&gt;Petition to Bring Back the 15C&lt;/a&gt; that you can sign.&lt;br /&gt;&lt;br /&gt;If you&apos;ve ever used this calculator, or one like it, I hope you find this simulator entertaining. Feedback, bug reports, and even contributions are welcome!</description>
  <comments>http://ghewgill.livejournal.com/142269.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>2</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://ghewgill.livejournal.com/142063.html</guid>
  <pubDate>Sat, 17 Apr 2010 23:59:51 GMT</pubDate>
  <title>cat</title>
  <link>http://ghewgill.livejournal.com/142063.html</link>
  <description>&lt;div style=&quot;float: right&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/ghewgill/4529636234/&quot;&gt;&lt;img src=&quot;http://farm5.static.flickr.com/4001/4529636234_d4d76fcd5f_m.jpg&quot;&gt;&lt;br&gt;Toothless&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;Yesterday Amy and I adopted a young black male cat from the SPCA. We had been talking about getting a cat for a while, and while we were out yesterday decided to go have a look. They had quite a few cats available, and we both quite liked the look of a small grey female with a very distinguished narrow face. However, this black one seemed much friendlier and purred a lot. It was a toss-up for a while but we were both won over by the black one.&lt;/p&gt;

&lt;p&gt;We had just finished watching the movie &quot;How to Train Your Dragon&quot;, which features a rather feline black dragon named &quot;Toothless&quot;. That would be a fitting name for a black cat, we thought. While we were doing the paperwork, they noted that he was due for his deworming pill, so they gave him the pill right there. But while he was taking the pill, we noticed one of his teeth didn&apos;t look right. Sure enough, it was askew and fell out in Amy&apos;s hand! They suspected that it may have been like that for a while and that he would be fine without it. We realised right then that the name &quot;Toothless&quot; would stick.&lt;/p&gt;

&lt;p&gt;He&apos;s very friendly and purrs almost continuously when sitting near us (right now I&apos;m slouching on the futon with my laptop propped up on my knees, with Toothless sitting on my chest purring). He knows where his food and litter box is, but we&apos;re definitely going to have to get him a scratching post to save our furniture. For now he&apos;s got full reign over the living room and kitchen, and we&apos;ll introduce him to the rest of the house in time. Ultimately he will be an outdoor cat too, because we regularly leave windows and doors open to let the air through the house. Hopefully he won&apos;t get too tangled up with the other cats in the neighbourhood (of course he&apos;s been fixed).&lt;/p&gt;

&lt;p&gt;Very happy with him.&lt;/p&gt;</description>
  <comments>http://ghewgill.livejournal.com/142063.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>6</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://ghewgill.livejournal.com/141628.html</guid>
  <pubDate>Thu, 18 Feb 2010 09:41:36 GMT</pubDate>
  <title>sunrise/sunset update, new google chart api features</title>
  <link>http://ghewgill.livejournal.com/141628.html</link>
  <description>Just a small update today: I updated the &lt;a href=&quot;http://hewgill.com/sunriseset/&quot;&gt;Sunrise and Sunset&lt;/a&gt; graph page to show a green line on the graph to indicate the current date.&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;img src=&quot;http://chart.apis.google.com/chart?chs=400x300&amp;amp;cht=lc&amp;amp;chd=e:wKwFwAv6v0vuvnvhvavTvLvEu9u1utumueuWuOuHt.t3tvtotgtZtRtKtCs7s0stsmsfsYsRsKsDr8r1rvrorhrbrUt4t1tutothtbtUtOtItBs7s0susnshsasUsOsIsBr7r1rvrprjrerYrTrOrIrEq.q7q2qzqvqsqpqmqkqiqgqfqeqeqeqeqfqgqhqjqmqpqsqvqzq4q8rBrHrMrSrZrfrmrtr1r9sFsNsVsesnsws5tCtLtVtftptyt8uGuRubuluvu5vEvOvYvitHtRtbtltvt5uCuMuVueunuwu5vBvJvRvZvgvnvuv1v7wBwGwLwQwUwYwbwewhwjwkwlwmwmwmwlwjwiwfwdwZwWwSwN,HXHXHXHYHZHbHdHfHiHmHqHuHzH4H9IDIJIQIXIeIlItI1I9JFJOJXJgJpJyJ7KFKPKYKiKsK2LALKLULeLoLyL8MGO7PAPKPUPdPnPxP6QDQMQVQeQnQvQ3Q.RHRPRWRdRkRqRwR2R7SBSFSKSOSSSVSYSbSdSeSgShShSiShShSgSfSdSbSYSWSTSPSMSISESAR7R2RxRsRnRiRcRXRRRLRFQ.Q6Q0QuQnQhQbQVQPQJQDP9P3PxPrPlPePYPSPMPGPAO6OzOtOnOgOaLmLfLZLSLLLFK-K3KwKpKiKbKUKMKFJ-J2JvJnJgJYJRJKJCI7I0ItImIfIYISILIFIAH6H1HwHsHoHkHhHeHcHaHYHX,________________________________________________..AA__________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________&amp;amp;chxt=x,y&amp;amp;chtt=Sunrise%20and%20Sunset%20for%20Christchurch%2C%20New%20Zealand&amp;amp;chdl=Sunrise%7CSunset%7CToday&amp;amp;chco=0000ff,ff4f00,008000&amp;amp;chxl=0:%7CJan%7CFeb%7CMar%7CApr%7CMay%7CJun%7CJul%7CAug%7CSep%7COct%7CNov%7CDec%7CJan%7C1:%7C00:00%7C23:00%7C22:00%7C21:00%7C20:00%7C19:00%7C18:00%7C17:00%7C16:00%7C15:00%7C14:00%7C13:00%7C12:00%7C11:00%7C10:00%7C09:00%7C08:00%7C07:00%7C06:00%7C05:00%7C04:00%7C03:00%7C02:00%7C01:00%7C00:00&amp;amp;chg=8.333333333333334,4.166666666666667&quot;&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;In related news, I noticed that the &lt;a href=&quot;http://code.google.com/apis/charttools/index.html&quot;&gt;Google Chart API&lt;/a&gt; has been significantly upgraded recently, with interactive charts (a fully Javascript solution, no plugins such as Flash), plus &lt;a href=&quot;http://code.google.com/apis/chart/docs/gallery/chart_gall.html&quot;&gt;new types of static charts&lt;/a&gt; including &lt;a href=&quot;http://code.google.com/apis/chart/docs/gallery/formulas.html&quot;&gt;Forumlas using TeX&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;img src=&quot;http://chart.apis.google.com/chart?cht=tx&amp;amp;chl=\oint_\gamma%20f(z)\,dz%20=%200&quot;&gt;&lt;/center&gt;</description>
  <comments>http://ghewgill.livejournal.com/141628.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>1</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://ghewgill.livejournal.com/141442.html</guid>
  <pubDate>Tue, 16 Feb 2010 07:49:46 GMT</pubDate>
  <title>careless people</title>
  <link>http://ghewgill.livejournal.com/141442.html</link>
  <description>Today when I went to get my bike from the bike shed at work on the way home, I noticed that it had been shifted from one side of its stall to the other. As soon as I got on, I noticed the right handgrip was tweaked to the side, and as soon as I shifted gears I noticed that the derailleur was wonky. I could still shift but the gears were all out of alignment.&lt;br /&gt;&lt;br /&gt;It looks like somebody knocked my bike over at some point today, which scuffed up the right handgrip and bent the derailleur hanger. I&apos;m annoyed because of careless people who knock over other people&apos;s bikes, and doubly annoyed because it&apos;s going to cost me a new derailleur hanger to fix this.</description>
  <comments>http://ghewgill.livejournal.com/141442.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://ghewgill.livejournal.com/141297.html</guid>
  <pubDate>Wed, 10 Feb 2010 08:24:52 GMT</pubDate>
  <title>twig - twitter irc gateway</title>
  <link>http://ghewgill.livejournal.com/141297.html</link>
  <description>My primary &quot;instant&quot; communications medium is &lt;a href=&quot;http://en.wikipedia.org/wiki/Internet_Relay_Chat&quot;&gt;IRC&lt;/a&gt;. I&apos;ve used IRC for roughly 15 years and it&apos;s an integral part of my communications toolkit.&lt;br /&gt;&lt;br /&gt;In order to follow Twitter, rather than having to reload the Twitter home page all the time or use a separate Twitter client, I was looking for a way to make tweets show up in an IRC channel. Originally I wrote an IRC &quot;bot&quot;, which reloaded my Twitter page periodically and posted new tweets to an IRC channel. This was a bit fragile and wasn&apos;t a great solution, since it depends on connecting to some existing IRC network.&lt;br /&gt;&lt;br /&gt;There is a project called &lt;a href=&quot;http://www.bitlbee.org/&quot;&gt;BitlBee&lt;/a&gt; that is an IRC &lt;em&gt;server&lt;/em&gt; that connects to various different IM networks (AIM, Jabber, etc). You connect your IRC client to your own local BitlBee server, which then connects to the IM networks of your choice. BitlBee is written in C and is therefore less easy to adapt and modify than if it were implemented in a more modern language.&lt;br /&gt;&lt;br /&gt;I wanted to play with the &lt;a href=&quot;http://apiwiki.twitter.com/Streaming-API-Documentation&quot;&gt;Twitter Streaming API&lt;/a&gt;, so I wrote a Twitter-IRC gateway in Python called &lt;a href=&quot;http://github.com/ghewgill/twig&quot;&gt;twig&lt;/a&gt;. Right now it does the simplest thing possible - it forwards tweets from the people you follow on Twitter into an IRC channel. It&apos;s a select-loop based single threaded implementation which should be easy to extend and modify.&lt;br /&gt;&lt;br /&gt;If you use IRC and want to follow Twitter, check it out &lt;a href=&quot;http://github.com/ghewgill/twig&quot;&gt;on Github&lt;/a&gt;.</description>
  <comments>http://ghewgill.livejournal.com/141297.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://ghewgill.livejournal.com/140975.html</guid>
  <pubDate>Sun, 24 Jan 2010 18:34:12 GMT</pubDate>
  <title>the state of the livejournal</title>
  <link>http://ghewgill.livejournal.com/140975.html</link>
  <description>&lt;p&gt;My LiveJournal &quot;friends&quot; page looks pretty sad today. It&apos;s got 25 entries covering four days (back in the heyday of LJ, my friends list would typically roll over 25 entries in a day). There&apos;s one of my own entries, but as for the rest of them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Number of new posts in the last 24 hours: 0 (except for &lt;span class=&apos;ljuser ljuser-name_status&apos; lj:user=&apos;status&apos; style=&apos;white-space:nowrap&apos;&gt;&lt;a href=&apos;http://status.livejournal.com/profile&apos;&gt;&lt;img src=&apos;http://l-stat.livejournal.com/img/userinfo.gif?v=92.2&apos; alt=&apos;[info]&apos; width=&apos;16&apos; height=&apos;16&apos; style=&apos;vertical-align: bottom; border: 0; padding-right: 1px;&apos;/&gt;&lt;/a&gt;&lt;a href=&apos;http://status.livejournal.com/&apos;&gt;&lt;b&gt;status&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; telling everybody the site is still up)&lt;/li&gt;
&lt;li&gt;Number of posts by people I&apos;ve actually met in real life: 0&lt;/li&gt;
&lt;li&gt;12 entries by &lt;span class=&apos;ljuser ljuser-name_jwz&apos; lj:user=&apos;jwz&apos; style=&apos;white-space:nowrap&apos;&gt;&lt;a href=&apos;http://jwz.livejournal.com/profile&apos;&gt;&lt;img src=&apos;http://l-stat.livejournal.com/img/userinfo.gif?v=92.2&apos; alt=&apos;[info]&apos; width=&apos;16&apos; height=&apos;16&apos; style=&apos;vertical-align: bottom; border: 0; padding-right: 1px;&apos;/&gt;&lt;/a&gt;&lt;a href=&apos;http://jwz.livejournal.com/&apos;&gt;&lt;b&gt;jwz&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; (occasionally amusing but mostly videos I don&apos;t watch)&lt;/li&gt;
&lt;li&gt;2 annoying &quot;loudtwitter&quot; crossposts&lt;/li&gt;
&lt;li&gt;1 LJ news update from &lt;span class=&apos;ljuser ljuser-name_news&apos; lj:user=&apos;news&apos; style=&apos;white-space:nowrap&apos;&gt;&lt;a href=&apos;http://news.livejournal.com/profile&apos;&gt;&lt;img src=&apos;http://l-stat.livejournal.com/img/newsinfo.gif?v=92.2&apos; alt=&apos;[info]&apos; width=&apos;16&apos; height=&apos;16&apos; style=&apos;vertical-align: bottom; border: 0; padding-right: 1px;&apos;/&gt;&lt;/a&gt;&lt;a href=&apos;http://news.livejournal.com/&apos;&gt;&lt;b&gt;news&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;1 post where a mutual friend actually posts words they&apos;ve written instead of just pictures.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;LiveJournal = dead.&lt;/p&gt;</description>
  <comments>http://ghewgill.livejournal.com/140975.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>10</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://ghewgill.livejournal.com/140769.html</guid>
  <pubDate>Sat, 23 Jan 2010 01:11:29 GMT</pubDate>
  <title>two dead mp3 players, what next?</title>
  <link>http://ghewgill.livejournal.com/140769.html</link>
  <description>&lt;p&gt;I usually only use my MP3 player (Creative Zen Stone Plus) to listen to podcasts when I take the bus to work. After the Christmas holiday break, I went to plug in my player to copy the latest podcasts to it, and it didn&apos;t power up. I tried the reset button on it, I tried &quot;charging&quot; it for a whole day, I tried everything suggested on the Creative troubleshooting site, and didn&apos;t get so much as a blink out of its little LED. It&apos;s possible that the battery was drained to a level below some threshold where it refuses to charge again (apparently that sometimes happens with Li-ion batteries).&lt;/p&gt;

&lt;p&gt;I liked the player, so I found another identical one on Trademe (New Zealand&apos;s own version of Ebay). I charged it up, copied my current files to it, and it worked like a charm. For just &lt;strong&gt;two days&lt;/strong&gt;. Then, as I was copying some more files to it, I got some odd I/O errors during copying, followed by generally slow performance (and USB timeout errors in my Macbook &lt;tt&gt;system.log&lt;/tt&gt; file), followed by a complete loss of files on the device and and inability to boot it up (turning it on shows the &quot;Creative&quot; logo screen and nothing further). That was an unfortunate waste of $60.&lt;/p&gt;

&lt;p&gt;I&apos;m now on the hunt for a new player. One of the features I use on the player is the ability to delete a file while I&apos;m listening to it. I do this whenever I&apos;m done listening to a podcast, as unlike music the exception is wanting to &lt;em&gt;keep&lt;/em&gt; the file. Anyway, a file delete operation is a must, and I never realised that this was apparently an uncommon feature. Fortunately, today virtually all manufacturers provide the full user manuals for their devices online for download. Because deleting files seems to be an obscure feature, it generally doesn&apos;t seem to be mentioned in the short blurbs.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sony Walkman - no delete function&lt;/li&gt;
&lt;li&gt;Philips GoGear - no delete function&lt;/li&gt;
&lt;li&gt;Samsung U4 - delete function, but not current file!&lt;/li&gt;
&lt;li&gt;Creative Zen Stone - delete function, including current file&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I&apos;m sort of having trouble finding other models because I know I don&apos;t want an iPod (I&apos;ve written my own program to download and manage podcast feeds, so I need an ordinary filesystem interface). I also don&apos;t care about: video, photos, hackability (ie. I don&apos;t need to load &lt;a href=&quot;http://www.rockbox.org/&quot;&gt;Rockbox&lt;/a&gt;), more than about 4GB of space, or anything over about NZ$100.&lt;/p&gt;

&lt;p&gt;I&apos;m currently undecided between trying my luck with &lt;em&gt;another&lt;/em&gt; Zen Stone from Trademe (as they don&apos;t seem to be sold at retail here anymore), or getting a Samsung U4 at retail so I can return/replace it if it&apos;s not working for me. Does anybody have any other ideas?&lt;/p&gt;</description>
  <comments>http://ghewgill.livejournal.com/140769.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>14</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://ghewgill.livejournal.com/140515.html</guid>
  <pubDate>Thu, 07 Jan 2010 10:45:24 GMT</pubDate>
  <title>y2010 bugs found via google code search</title>
  <link>http://ghewgill.livejournal.com/140515.html</link>
  <description>&lt;p&gt;Last week the news started coming about regarding various computing system failures caused by the rollover to the year 2010. I wondered how easy it would be to identify such bugs in open source software, using &lt;a href=&quot;http://codesearch.google.com&quot;&gt;Google Code Search&lt;/a&gt;. What kind of bug would be would be easy to identify? A common error in the last century was to use a C printf format string &quot;19%d&quot;, which would roll over from 1999 to 19100 at the turn of the century.&lt;/p&gt;

&lt;p&gt;What if people used &quot;200%d&quot; as a format string? That would roll over from 2009 to 20010 in the year 2010. But surely nobody would &lt;em&gt;actually&lt;/em&gt; do that, right? &lt;a href=&quot;http://www.google.com/codesearch?q=200%25d&quot;&gt;Wrong.&lt;/a&gt; Some of those hits are false hits and not relevant to dates, but I found about 10 open source projects with such date-related format strings. Some of them are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.bitpim.org/&quot;&gt;BitPim&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://sourceforge.net/projects/honeygraph&quot;&gt;HoneyGraph&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.cs.uit.no/~daniels/PacketProxy/index.html&quot;&gt;PacketProxy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://code.google.com/p/projeto-sombra/&quot;&gt;SOmBRA&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I&apos;ve sent suggested patches to fix the bug(s) to each project that I could find.&lt;/p&gt;

&lt;p&gt;I&apos;m pretty sure this technique of using Google Code Search has been used to locate unsafe coding practices related to software security vulnerabilities, but I wonder whether anybody has successfully applied it to other types of software bugs.&lt;/p&gt;</description>
  <comments>http://ghewgill.livejournal.com/140515.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>4</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://ghewgill.livejournal.com/140281.html</guid>
  <pubDate>Fri, 01 Jan 2010 03:22:05 GMT</pubDate>
  <title>2009 in review</title>
  <link>http://ghewgill.livejournal.com/140281.html</link>
  <description>&lt;p&gt;2009 seems to have had even fewer changes than previous years. But it still had lots going on!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://hewgill.com/journal/entries/489-chc-akl-yvr-den-dfw-fra-dub-lhr-kef-lhr-nrt-chc&quot;&gt;Circumnavigated the globe for the first time&lt;/a&gt;. Amy had already &lt;a href=&quot;http://amyrtw.com/&quot;&gt;done this once&lt;/a&gt;, and it&apos;s good to catch up.&lt;/li&gt;
&lt;li&gt;As a result of the above trip, I visited &lt;a href=&quot;http://hewgill.com/photo/trips/islands-world-2009/frankfurt/index.html&quot;&gt;Germany&lt;/a&gt;, &lt;a href=&quot;http://hewgill.com/photo/trips/islands-world-2009/ireland/index.html&quot;&gt;Ireland&lt;/a&gt;, &lt;a href=&quot;http://hewgill.com/photo/trips/islands-world-2009/iceland/index.html&quot;&gt;Iceland&lt;/a&gt; (with the &lt;a href=&quot;http://hewgill.com/photo/trips/islands-world-2009/iceland/100km/IMG_7072.JPG.html&quot;&gt;furthest from the equator I&apos;ve ever been, past 66&amp;deg;N&lt;/a&gt;), &lt;a href=&quot;http://hewgill.com/photo/trips/islands-world-2009/london/index.html&quot;&gt;London&lt;/a&gt;, and &lt;a href=&quot;http://hewgill.com/photo/trips/islands-world-2009/tokyo/index.html&quot;&gt;Tokyo&lt;/a&gt; for the first time.&lt;/li&gt;
&lt;li&gt;Amy and I had a big wedding reception (two years later!) with my extended family in Vancouver. Saw lots of people I hadn&apos;t seen for years.&lt;/li&gt;
&lt;li&gt;Attended &lt;a href=&quot;http://sxsw.com&quot;&gt;SXSW&lt;/a&gt; as a participant for the first time. Plus, the &lt;em&gt;seventh&lt;/em&gt; annual &lt;a href=&quot;http://nucleartacos.com/&quot;&gt;Nuclear Tacos at SXSW&lt;/a&gt;!&lt;/li&gt;
&lt;li&gt;Met &lt;a href=&quot;http://hewgill.com/journal/entries/484-open-source-serendipity&quot;&gt;Andy Hopper&lt;/a&gt; (the head of the Computer Technology Department at Cambridge University) through a string of coincidences, plus some work I did on VNC back in 1998.&lt;/li&gt;
&lt;li&gt;Presented a &lt;a href=&quot;http://hewgill.com/journal/entries/543-psil-presentation-and-compiler-details&quot;&gt;lightning talk on Psil&lt;/a&gt; at &lt;a href=&quot;http://nz.pycon.org/&quot;&gt;Kiwi PyCon&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;New open source software: &lt;a href=&quot;http://github.com/ghewgill/pyqver&quot;&gt;pyqver&lt;/a&gt; (identify required version for Python code), &lt;a href=&quot;http://github.com/ghewgill/emulino&quot;&gt;emulino&lt;/a&gt; (Arduino emulator), &lt;a href=&quot;http://hewgill.com/journal/entries/536-mandelbrot-set-viewer&quot;&gt;mandelbrot set viewer&lt;/a&gt;, &lt;a href=&quot;http://github.com/ghewgill/relight&quot;&gt;relight&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Works in progress: &lt;a href=&quot;http://github.com/ghewgill/psil&quot;&gt;psil&lt;/a&gt;, &lt;a href=&quot;http://github.com/ghewgill/xearth&quot;&gt;xearth&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;</description>
  <comments>http://ghewgill.livejournal.com/140281.html</comments>
  <category>annual</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
</channel>
</rss>

