<?xml version="1.0" encoding="iso-8859-1"?>
<!-- name="generator" content="phposxom/0.6b-rn" -->
<rss version="0.91">
<channel>
<title>holygoat.co.uk</title>
<link>http://www.holygoat.co.uk/blog</link>
<description>Richard Newman's Blog &#0187; technology, semantic web, life.</description>
<language>en-GB</language>
<item>
<title>Small flashlights</title>
<link>http://www.holygoat.co.uk/blog/entry/2010-01-26-1</link>
<description>&lt;p&gt;On a whim I ordered a &lt;a href=&quot;http://www.amazon.com/gp/product/B002HRF7PM?ie=UTF8&amp;amp;tag=holygoacouk-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B002HRF7PM&quot;&gt;Leatherman Monarch 200 flashlight&lt;/a&gt;&lt;img src=&quot;http://www.assoc-amazon.com/e/ir?t=holygoacouk-20&amp;amp;l=as2&amp;amp;o=1&amp;amp;a=B002HRF7PM&quot; width=&quot;1&quot; height=&quot;1&quot; alt=&quot;&quot; style=&quot;border:none !important; margin:0px !important;&quot; /&gt;. For $10 I thought it was worth a try.&lt;/p&gt;
&lt;p&gt;I normally carry a &lt;a href=&quot;http://www.amazon.com/gp/product/B002CWEFHS?ie=UTF8&amp;amp;tag=holygoacouk-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B002CWEFHS&quot;&gt;4Sevens Quark 123&lt;/a&gt;&lt;img src=&quot;http://www.assoc-amazon.com/e/ir?t=holygoacouk-20&amp;amp;l=as2&amp;amp;o=1&amp;amp;a=B002CWEFHS&quot; width=&quot;1&quot; height=&quot;1&quot; alt=&quot;&quot; style=&quot;border:none !important; margin:0px !important;&quot; /&gt;, or a small &lt;a href=&quot;http://www.4sevens.com/index.php?cPath=297_332&quot; title=&quot;Preon&quot;&gt;Preon&lt;/a&gt;, but I like to have lights everywhere. Comes in handy when the power goes out!&lt;/p&gt;
&lt;p&gt;Here's how it stacks up against the &lt;a href=&quot;http://www.amazon.com/gp/product/B001GAOO6Y?ie=UTF8&amp;amp;tag=holygoacouk-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B001GAOO6Y&quot;&gt;Fenix E01&lt;/a&gt;&lt;img src=&quot;http://www.assoc-amazon.com/e/ir?t=holygoacouk-20&amp;amp;l=as2&amp;amp;o=1&amp;amp;a=B001GAOO6Y&quot; width=&quot;1&quot; height=&quot;1&quot; alt=&quot;&quot; style=&quot;border:none !important; margin:0px !important;&quot; /&gt; ($12.50) and the &lt;a href=&quot;http://www.lummi.co.uk/Wee_NS.html&quot; title=&quot;Lummi Wee&quot;&gt;Lummi Wee&lt;/a&gt;, which cost me about &amp;pound;50 all told (it has tritium phials).&lt;/p&gt;
&lt;div class=&quot;gallery&quot;&gt;&lt;a href=&quot;http://holygoat.co.uk/images/2010-01-26/flashlights.jpg&quot; title=&quot;Full size&quot;&gt;&lt;img src=&quot;http://holygoat.co.uk/images/2010-01-26/flashlights_s.jpg&quot; alt=&quot;three flashlights&quot; width=&quot;300&quot; height=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;spacer&quot;&gt;&lt;/div&gt;
&lt;p&gt;The E01 is slightly brighter, and the Leatherman is much bluer in color. (My &amp;#8220;natural&amp;#8221; LED lights are even less blue.) The Lummi Wee, as you might expect from a high-output light &lt;a href=&quot;http://www.candlepowerforums.com/vb/showthread.php?t=221196&quot; title=&quot;10180 batteries&quot;&gt;that uses boutique batteries&lt;/a&gt;, kicks out a lot more light.&lt;/p&gt;
&lt;p&gt;However, I'm not disappointed: the Monarch is &lt;em&gt;tiny&lt;/em&gt;, has a clicky tailcap (which is both easy to use and hard to accidentally depress: much better in my opinion than twist activation), seems pretty robust, and costs no more than a Photon. This one is going on the wife's keychain, and I might order another to stash in a bag&amp;#8230;&lt;/p&gt;

&lt;br /&gt;&lt;hr /&gt;&lt;p&gt;&lt;a href="http://www.haloscan.com/comments/holygoat/2010_01_26_1/" title="comments"&gt;View or post a comment&lt;/a&gt;.&lt;/p&gt;</description>
</item>
<item>
<title>Damn you, Mail</title>
<link>http://www.holygoat.co.uk/blog/entry/2010-01-23-1</link>
<description>&lt;p&gt;Mail.app is so classy. This is in my console log.&lt;/p&gt;
&lt;pre&gt;2010-01-23 Jan 23 19:55:40  Mail[1749] 
An instance 0x1cfa80f0 of class IMAPConnection is
being deallocated while key value observers are 
still registered with it. Observation info is 
being leaked, and may even become mistakenly 
attached to some other object. Set a breakpoint 
on NSKVODeallocateBreak to stop here in the 
debugger. Here's the current observation info:
&amp;lt;NSKeyValueObservationInfo 0x39ea320&amp;gt; (
&amp;lt;NSKeyValueObservance 0x4e328d0: Observer: 
0x16a80a60, Key path: isDisconnected, Options:
&amp;lt;New: NO, Old: NO, Prior: NO&amp;gt; Context: 0x0,
Property: 0x1b0c0040&amp;gt;
)&lt;/pre&gt;
&lt;br /&gt;&lt;hr /&gt;&lt;p&gt;&lt;a href="http://www.haloscan.com/comments/holygoat/2010_01_23_1/" title="comments"&gt;View or post a comment&lt;/a&gt;.&lt;/p&gt;</description>
</item>
<item>
<title>Damn you, iTunes</title>
<link>http://www.holygoat.co.uk/blog/entry/2009-12-24-1</link>
<description>&lt;p&gt;Before flying out for Christmas, I made sure to rip five more episodes of The Wire to keep me entertained on the plane.&lt;/p&gt;
&lt;p&gt;Oh! A new version of HandBrake. Sweet. I ripped, I added to iTunes, I labeled the videos as &amp;#8220;TV Shows&amp;#8221; (thanks for paying attention to where I dragged them, iTunes).&lt;/p&gt;
&lt;p&gt;Now, in NJ, I come to sync&amp;#8230; and they won't. iTunes shows them in the list, lets me check them, and syncs, but simply ignores those. Older rips copy fine. It doesn't even have the courtesy to show the usual &amp;#8220;this video format won't play on this device&amp;#8221; message.&lt;/p&gt;
&lt;p&gt;Is it the additional 2 pixels of vertical resolution that the Info window reports? Otherwise the video files are identical.&lt;/p&gt;
&lt;p&gt;Nothing in the Console. No messages. Damn you, iTunes. Happy Christmas to me.&lt;/p&gt;

&lt;br /&gt;&lt;hr /&gt;&lt;p&gt;&lt;a href="http://www.haloscan.com/comments/holygoat/2009_12_24_1/" title="comments"&gt;View or post a comment&lt;/a&gt;.&lt;/p&gt;</description>
</item>
<item>
<title>Fix to avoid sh: cc: not found while loading Python's uuid module</title>
<link>http://www.holygoat.co.uk/blog/entry/2009-10-19-1</link>
<description>&lt;p&gt;&lt;tt&gt;uuid&lt;/tt&gt; uses &lt;tt&gt;ctypes.util.find_library&lt;/tt&gt; to find &lt;tt&gt;libuuid&lt;/tt&gt; and &lt;tt&gt;libc&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;&lt;tt&gt;find_library&lt;/tt&gt; calls out to &lt;tt&gt;cc&lt;/tt&gt;/&lt;tt&gt;gcc&lt;/tt&gt; to do its work.&lt;/p&gt;
&lt;p&gt;This produces an annoying &lt;tt&gt;sh: cc: not found&lt;/tt&gt; message at runtime when you don't have a damn compiler on your production box. Here's the diff against &lt;tt&gt;uuid.py&lt;/tt&gt;.&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;402c402,406
&amp;lt;             lib = ctypes.CDLL(ctypes.util.find_library(libname))
---
&amp;gt;             # Attempt static first.
&amp;gt;             path = {'uuid': '/usr/lib/libuuid.so',
&amp;gt;                     'c':    '/usr/lib/libc.so'}.get(libname) or 
&amp;gt;                    ctypes.util.find_library(libname)
&amp;gt;             lib = ctypes.CDLL(path)
&lt;/pre&gt;&lt;/blockquote&gt;
&lt;br /&gt;&lt;hr /&gt;&lt;p&gt;&lt;a href="http://www.haloscan.com/comments/holygoat/2009_10_19_1/" title="comments"&gt;View or post a comment&lt;/a&gt;.&lt;/p&gt;</description>
</item>
<item>
<title>Multipart data in CherryPy</title>
<link>http://www.holygoat.co.uk/blog/entry/2009-09-28-1</link>
<description>&lt;p&gt;I've spent a little while trying to get CherryPy 3.2 to handle multipart/form-encoded data in a useful fashion. That is, I need access to the Content-Type of each part.&lt;/p&gt;
&lt;p&gt;By default, it passes each part as a named &lt;em&gt;string&lt;/em&gt; argument to your handler function.&lt;/p&gt;
&lt;p&gt;I finally found the correct incantations to get &lt;tt&gt;cherrypy.request.body.parts&lt;/tt&gt; to contain the &lt;tt&gt;Entity&lt;/tt&gt; instances, each of which has a &lt;tt&gt;.content_type&lt;/tt&gt;, &lt;tt&gt;.name&lt;/tt&gt;, &lt;i&gt;etc.&lt;/i&gt; From there I can constitute a kind of sane arglist.&lt;/p&gt;
&lt;blockquote&gt;
&lt;pre&gt;# Somewhere early on
def multipart_tool():
    cherrypy.request.body.processors[u'multipart/form-data'] = cherrypy._cpreqbody.process_multipart
    
cherrypy.tools.multipart_tool = cherrypy.Tool('on_start_resource', multipart_tool)&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;pre&gt;# In your handler class:
class Foo(object):
    _cp_config = {'tools.multipart_tool.on': True}&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;p&gt;The advice on the CherryPy wiki suggests setting the &quot;multipart&quot; processor, which is overruled by the multipart/form-data processor. Pah.&lt;/p&gt;
&lt;p&gt;The more I use Python, the more I find it totally unsuitable for getting things done.&lt;/p&gt;
&lt;br /&gt;&lt;hr /&gt;&lt;p&gt;&lt;a href="http://www.haloscan.com/comments/holygoat/2009_09_28_1/" title="comments"&gt;View or post a comment&lt;/a&gt;.&lt;/p&gt;</description>
</item>
<item>
<title>Vimperator, how I love you</title>
<link>http://www.holygoat.co.uk/blog/entry/2009-09-25-1</link>
<description>&lt;p&gt;Put this in &lt;tt&gt;~/.vimperatorrc&lt;/tt&gt;.&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;set editor=&quot;/Applications/MacVim.app/Contents/MacOS/Vim -g -f&quot;&lt;/pre&gt;&lt;/blockquote&gt;
&lt;p&gt;Now find a textfield when you launch Vimperator, and hit Ctrl-I. Editing textfields in MacVim! Hooray!&lt;/p&gt;
&lt;br /&gt;&lt;hr /&gt;&lt;p&gt;&lt;a href="http://www.haloscan.com/comments/holygoat/2009_09_25_1/" title="comments"&gt;View or post a comment&lt;/a&gt;.&lt;/p&gt;</description>
</item>
<item>
<title>Oh, OmniWeb</title>
<link>http://www.holygoat.co.uk/blog/entry/2009-09-23-1</link>
<description>&lt;blockquote&gt;&lt;pre&gt;$ leaks OmniWeb
Process 71336: 1915517 nodes malloced for 158662 KB
Process 71336: 2989 leaks for 435024 total leaked bytes.&lt;/pre&gt;&lt;/blockquote&gt;&lt;p&gt;This is with OmniWeb at 249MB RSIZE. I've had it break 1GB several times. Thing leaks like a sieve.&lt;/p&gt;
&lt;br /&gt;&lt;hr /&gt;&lt;p&gt;&lt;a href="http://www.haloscan.com/comments/holygoat/2009_09_23_1/" title="comments"&gt;View or post a comment&lt;/a&gt;.&lt;/p&gt;</description>
</item>
<item>
<title>Beautiful code</title>
<link>http://www.holygoat.co.uk/blog/entry/2009-09-18-1</link>
<description>&lt;p&gt;I just took the time to start reading Tom Faulhaber's description of &lt;a href=&quot;http://infolace.blogspot.com/2009/08/simple-webhooks-with-clojure-and-ring.html&quot; title=&quot;simple webhooks&quot;&gt;simple webhooks with Clojure and Ring&lt;/a&gt;. A mere two pages in I hit some staggeringly beautiful code.&lt;/p&gt;
&lt;p&gt;I hope Tom won't mind me quoting it here:&lt;/p&gt;
&lt;blockquote&gt;
&lt;pre class=&quot;code&quot;&gt;(defn hook-server
  &quot;Build a simple webhook server on the specified
   port. Invokes ring to fill a blocking queue, 
   whose elements are processed by handle-payload.&quot;
  [port]
  (doseq [payload
          (fill-queue
            (fn [fill]
              (ring.jetty/run {:port port}
                              (partial app fill)))
            :queue-size 10)]
    (handle-payload payload)))
&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;p&gt;Go read the article and figure out the control flow there. Once you get it, &lt;em&gt;wow&lt;/em&gt;. Defining an app in terms of a sequence generated by incoming requests.&lt;/p&gt;
&lt;p&gt;This is why I love programming as a profession.&lt;/p&gt;
&lt;br /&gt;&lt;hr /&gt;&lt;p&gt;&lt;a href="http://www.haloscan.com/comments/holygoat/2009_09_18_1/" title="comments"&gt;View or post a comment&lt;/a&gt;.&lt;/p&gt;</description>
</item>
</channel>
</rss>
