<?xml version="1.0" encoding="iso-8859-1"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <id>http://www.holygoat.co.uk/blog/id</id>
<updated>2010-03-11T13:27:00-08:00</updated>
<generator>phposxom/0.6b-rn</generator>
<rights>Copyright Richard Newman</rights>
<title type="text">holygoat.co.uk</title>
<link rel="alternate" type="text/html" hreflang="en" href="http://www.holygoat.co.uk/blog" />
<link rel="self" type="application/atom+xml" href="http://www.holygoat.co.uk/blog/feed/atom" />
<link rel="alternate" type="application/xhtml+xml" hreflang="en" href="http://www.holygoat.co.uk/blog" />
<subtitle type="text">Richard Newman's Blog &#0187; technology, semantic web, life.</subtitle>
<author><name>Richard Newman</name><uri>http://www.holygoat.co.uk/foaf.rdf#RichardNewman</uri></author>
<entry>
<updated>2010-03-11T13:27:00-08:00</updated>
<id>http://www.holygoat.co.uk/blog/entry/2010-03-11-1/id</id>
<rights>Copyright Richard Newman</rights>
<title>Strip class files from a Java jar</title>
<link href="http://www.holygoat.co.uk/blog/entry/2010-03-11-1" rel="alternate" type="text/html" />
<link href="http://www.holygoat.co.uk/blog/entry/2010-03-11-1" rel="alternate" type="application/xhtml+xml" />
<content type="xhtml" xml:lang="en-GB"><div xmlns="http://www.w3.org/1999/xhtml"><p>I occasionally hit an issue whereby a Clojure library is built with an earlier version of Clojure, and its included class files cause an error such as
</p>
<pre>Caused by: java.lang.NoSuchMethodError: clojure.lang.RestFn.&lt;init&gt;(I)V (compojure.clj:9)
</pre>
<p>The easiest immediate fix is to strip class file from the jar. Awful hacky shell scripting to the rescue! This did the trick. It ain't pretty, but hey.</p>
<pre>
mkdir $1-tmp
mv $1 $1-tmp
cd $1-tmp
jar xf $1
find . -name '*.class' -exec rm {} ;
jar cf $1 *
mv $1 ..
cd ..
rm -r $1-tmp
</pre>
<p>Use like this: <tt>unclassify foo.jar</tt>.</p><br /><hr /><p><a href="http://www.haloscan.com/comments/holygoat/2010_03_11_1/" title="comments">View or post a comment</a>.</p></div></content>
</entry>
<entry>
<updated>2010-01-26T17:33:26-08:00</updated>
<id>http://www.holygoat.co.uk/blog/entry/2010-01-26-1/id</id>
<rights>Copyright Richard Newman</rights>
<title>Small flashlights</title>
<link href="http://www.holygoat.co.uk/blog/entry/2010-01-26-1" rel="alternate" type="text/html" />
<link href="http://www.holygoat.co.uk/blog/entry/2010-01-26-1" rel="alternate" type="application/xhtml+xml" />
<content type="xhtml" xml:lang="en-GB"><div xmlns="http://www.w3.org/1999/xhtml"><p>On a whim I ordered a <a href="http://www.amazon.com/gp/product/B002HRF7PM?ie=UTF8&amp;tag=holygoacouk-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B002HRF7PM">Leatherman Monarch 200 flashlight</a><img src="http://www.assoc-amazon.com/e/ir?t=holygoacouk-20&amp;l=as2&amp;o=1&amp;a=B002HRF7PM" width="1" height="1" alt="" style="border:none !important; margin:0px !important;" />. For $10 I thought it was worth a try.</p>
<p>I normally carry a <a href="http://www.amazon.com/gp/product/B002CWEFHS?ie=UTF8&amp;tag=holygoacouk-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B002CWEFHS">4Sevens Quark 123</a><img src="http://www.assoc-amazon.com/e/ir?t=holygoacouk-20&amp;l=as2&amp;o=1&amp;a=B002CWEFHS" width="1" height="1" alt="" style="border:none !important; margin:0px !important;" />, or a small <a href="http://www.4sevens.com/index.php?cPath=297_332" title="Preon">Preon</a>, but I like to have lights everywhere. Comes in handy when the power goes out!</p>
<p>Here's how it stacks up against the <a href="http://www.amazon.com/gp/product/B001GAOO6Y?ie=UTF8&amp;tag=holygoacouk-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B001GAOO6Y">Fenix E01</a><img src="http://www.assoc-amazon.com/e/ir?t=holygoacouk-20&amp;l=as2&amp;o=1&amp;a=B001GAOO6Y" width="1" height="1" alt="" style="border:none !important; margin:0px !important;" /> ($12.50) and the <a href="http://www.lummi.co.uk/Wee_NS.html" title="Lummi Wee">Lummi Wee</a>, which cost me about &pound;50 all told (it has tritium phials).</p>
<div class="gallery"><a href="http://holygoat.co.uk/images/2010-01-26/flashlights.jpg" title="Full size"><img src="http://holygoat.co.uk/images/2010-01-26/flashlights_s.jpg" alt="three flashlights" width="300" height="400"/></a></div><div class="spacer"></div>
<p>The E01 is slightly brighter, and the Leatherman is much bluer in color. (My &#8220;natural&#8221; LED lights are even less blue.) The Lummi Wee, as you might expect from a high-output light <a href="http://www.candlepowerforums.com/vb/showthread.php?t=221196" title="10180 batteries">that uses boutique batteries</a>, kicks out a lot more light.</p>
<p>However, I'm not disappointed: the Monarch is <em>tiny</em>, 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&#8230;</p>
<br /><hr /><p><a href="http://www.haloscan.com/comments/holygoat/2010_01_26_1/" title="comments">View or post a comment</a>.</p></div></content>
</entry>
<entry>
<updated>2010-01-23T20:58:00-08:00</updated>
<id>http://www.holygoat.co.uk/blog/entry/2010-01-23-1/id</id>
<rights>Copyright Richard Newman</rights>
<title>Damn you, Mail</title>
<link href="http://www.holygoat.co.uk/blog/entry/2010-01-23-1" rel="alternate" type="text/html" />
<link href="http://www.holygoat.co.uk/blog/entry/2010-01-23-1" rel="alternate" type="application/xhtml+xml" />
<content type="xhtml" xml:lang="en-GB"><div xmlns="http://www.w3.org/1999/xhtml"><p>Mail.app is so classy. This is in my console log.</p>
<pre>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:
&lt;NSKeyValueObservationInfo 0x39ea320&gt; (
&lt;NSKeyValueObservance 0x4e328d0: Observer: 
0x16a80a60, Key path: isDisconnected, Options:
&lt;New: NO, Old: NO, Prior: NO&gt; Context: 0x0,
Property: 0x1b0c0040&gt;
)</pre><br /><hr /><p><a href="http://www.haloscan.com/comments/holygoat/2010_01_23_1/" title="comments">View or post a comment</a>.</p></div></content>
</entry>
<entry>
<updated>2009-12-24T09:41:00-08:00</updated>
<id>http://www.holygoat.co.uk/blog/entry/2009-12-24-1/id</id>
<rights>Copyright Richard Newman</rights>
<title>Damn you, iTunes</title>
<link href="http://www.holygoat.co.uk/blog/entry/2009-12-24-1" rel="alternate" type="text/html" />
<link href="http://www.holygoat.co.uk/blog/entry/2009-12-24-1" rel="alternate" type="application/xhtml+xml" />
<content type="xhtml" xml:lang="en-GB"><div xmlns="http://www.w3.org/1999/xhtml"><p>Before flying out for Christmas, I made sure to rip five more episodes of The Wire to keep me entertained on the plane.</p>
<p>Oh! A new version of HandBrake. Sweet. I ripped, I added to iTunes, I labeled the videos as &#8220;TV Shows&#8221; (thanks for paying attention to where I dragged them, iTunes).</p>
<p>Now, in NJ, I come to sync&#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 &#8220;this video format won't play on this device&#8221; message.</p>
<p>Is it the additional 2 pixels of vertical resolution that the Info window reports? Otherwise the video files are identical.</p>
<p>Nothing in the Console. No messages. Damn you, iTunes. Happy Christmas to me.</p>
<br /><hr /><p><a href="http://www.haloscan.com/comments/holygoat/2009_12_24_1/" title="comments">View or post a comment</a>.</p></div></content>
</entry>
<entry>
<updated>2009-10-19T14:10:00-07:00</updated>
<id>http://www.holygoat.co.uk/blog/entry/2009-10-19-1/id</id>
<rights>Copyright Richard Newman</rights>
<title>Fix to avoid sh: cc: not found while loading Python's uuid module</title>
<link href="http://www.holygoat.co.uk/blog/entry/2009-10-19-1" rel="alternate" type="text/html" />
<link href="http://www.holygoat.co.uk/blog/entry/2009-10-19-1" rel="alternate" type="application/xhtml+xml" />
<content type="xhtml" xml:lang="en-GB"><div xmlns="http://www.w3.org/1999/xhtml"><p><tt>uuid</tt> uses <tt>ctypes.util.find_library</tt> to find <tt>libuuid</tt> and <tt>libc</tt>.</p>
<p><tt>find_library</tt> calls out to <tt>cc</tt>/<tt>gcc</tt> to do its work.</p>
<p>This produces an annoying <tt>sh: cc: not found</tt> message at runtime when you don't have a damn compiler on your production box. Here's the diff against <tt>uuid.py</tt>.</p>
<blockquote><pre>402c402,406
&lt;             lib = ctypes.CDLL(ctypes.util.find_library(libname))
---
&gt;             # Attempt static first.
&gt;             path = {'uuid': '/usr/lib/libuuid.so',
&gt;                     'c':    '/usr/lib/libc.so'}.get(libname) or 
&gt;                    ctypes.util.find_library(libname)
&gt;             lib = ctypes.CDLL(path)
</pre></blockquote><br /><hr /><p><a href="http://www.haloscan.com/comments/holygoat/2009_10_19_1/" title="comments">View or post a comment</a>.</p></div></content>
</entry>
<entry>
<updated>2009-09-28T21:51:00-07:00</updated>
<id>http://www.holygoat.co.uk/blog/entry/2009-09-28-1/id</id>
<rights>Copyright Richard Newman</rights>
<title>Multipart data in CherryPy</title>
<link href="http://www.holygoat.co.uk/blog/entry/2009-09-28-1" rel="alternate" type="text/html" />
<link href="http://www.holygoat.co.uk/blog/entry/2009-09-28-1" rel="alternate" type="application/xhtml+xml" />
<content type="xhtml" xml:lang="en-GB"><div xmlns="http://www.w3.org/1999/xhtml"><p>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.</p>
<p>By default, it passes each part as a named <em>string</em> argument to your handler function.</p>
<p>I finally found the correct incantations to get <tt>cherrypy.request.body.parts</tt> to contain the <tt>Entity</tt> instances, each of which has a <tt>.content_type</tt>, <tt>.name</tt>, <i>etc.</i> From there I can constitute a kind of sane arglist.</p>
<blockquote>
<pre># 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)</pre>
</blockquote>
<blockquote>
<pre># In your handler class:
class Foo(object):
    _cp_config = {'tools.multipart_tool.on': True}</pre>
</blockquote>
<p>The advice on the CherryPy wiki suggests setting the "multipart" processor, which is overruled by the multipart/form-data processor. Pah.</p>
<p>The more I use Python, the more I find it totally unsuitable for getting things done.</p><br /><hr /><p><a href="http://www.haloscan.com/comments/holygoat/2009_09_28_1/" title="comments">View or post a comment</a>.</p></div></content>
</entry>
<entry>
<updated>2009-09-25T20:42:00-07:00</updated>
<id>http://www.holygoat.co.uk/blog/entry/2009-09-25-1/id</id>
<rights>Copyright Richard Newman</rights>
<title>Vimperator, how I love you</title>
<link href="http://www.holygoat.co.uk/blog/entry/2009-09-25-1" rel="alternate" type="text/html" />
<link href="http://www.holygoat.co.uk/blog/entry/2009-09-25-1" rel="alternate" type="application/xhtml+xml" />
<content type="xhtml" xml:lang="en-GB"><div xmlns="http://www.w3.org/1999/xhtml"><p>Put this in <tt>~/.vimperatorrc</tt>.</p>
<blockquote><pre>set editor="/Applications/MacVim.app/Contents/MacOS/Vim -g -f"</pre></blockquote>
<p>Now find a textfield when you launch Vimperator, and hit Ctrl-I. Editing textfields in MacVim! Hooray!</p><br /><hr /><p><a href="http://www.haloscan.com/comments/holygoat/2009_09_25_1/" title="comments">View or post a comment</a>.</p></div></content>
</entry>
<entry>
<updated>2009-09-23T19:58:00-07:00</updated>
<id>http://www.holygoat.co.uk/blog/entry/2009-09-23-1/id</id>
<rights>Copyright Richard Newman</rights>
<title>Oh, OmniWeb</title>
<link href="http://www.holygoat.co.uk/blog/entry/2009-09-23-1" rel="alternate" type="text/html" />
<link href="http://www.holygoat.co.uk/blog/entry/2009-09-23-1" rel="alternate" type="application/xhtml+xml" />
<content type="xhtml" xml:lang="en-GB"><div xmlns="http://www.w3.org/1999/xhtml"><blockquote><pre>$ leaks OmniWeb
Process 71336: 1915517 nodes malloced for 158662 KB
Process 71336: 2989 leaks for 435024 total leaked bytes.</pre></blockquote><p>This is with OmniWeb at 249MB RSIZE. I've had it break 1GB several times. Thing leaks like a sieve.</p><br /><hr /><p><a href="http://www.haloscan.com/comments/holygoat/2009_09_23_1/" title="comments">View or post a comment</a>.</p></div></content>
</entry>
</feed>
