<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0" xml:base="http://townx.org">
<channel>
 <title>townx</title>
 <link>http://townx.org/blog/elliot</link>
 <description>Blog on Ruby on Rails, open source, music, family, random other stuff</description>
 <language>en</language>
<image><url>http://www.feedburner.com/fb/images/pub/fb_pwrd.gif</url></image><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/townx" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item><title>Links for 2009-11-04 [del.icio.us]</title><link>http://feedproxy.google.com/~r/townx/~3/d6dJCJB0s5g/townxelliot</link><pubDate>Thu, 05 Nov 2009 00:00:00 PST</pubDate><guid isPermaLink="false">http://del.icio.us/townxelliot#2009-11-04</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="http://github.com/tobi/clarity/"&gt;clarity at master - GitHub&lt;/a&gt;&lt;br/&gt;
For tailing/searching logs in /var/log via a web interface&lt;/li&gt;
&lt;/ul&gt;</description><feedburner:origLink>http://del.icio.us/townxelliot#2009-11-04</feedburner:origLink></item><item><title>Links for 2009-11-03 [del.icio.us]</title><link>http://feedproxy.google.com/~r/townx/~3/-XX5PrthdMI/townxelliot</link><pubDate>Wed, 04 Nov 2009 00:00:00 PST</pubDate><guid isPermaLink="false">http://del.icio.us/townxelliot#2009-11-03</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="http://spoon.net/browsers/"&gt;Browser Sandbox - Run any browser from the web&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description><feedburner:origLink>http://del.icio.us/townxelliot#2009-11-03</feedburner:origLink></item><item>
 <title>Back on Fedora</title>
 <link>http://feedproxy.google.com/~r/townx/~3/xyGP04ziPkE/back-fedora</link>
 <description>&lt;p&gt;A few years ago, I used to work on RedHat Linux, then Fedora: my first Linux machine ran RedHat Linux. Then I got sick of things breaking every time I upgraded (on one traumatic occasion, my audio stopped working after a Fedora upgrade) and switched to Ubuntu.&lt;/p&gt;

&lt;p&gt;But in my new job, I need Linux, but also need to encrypt my laptop's hard drive. I had a go at doing this with Ubuntu, with disastrous results. Didn't really know what I was doing (I did manage to encrypt the hard drive, but couldn't figure out how to mount it during boot). Fedora makes this simple, though. So I moved across, and have to say I'm pretty glad I did. It's very similar to Ubuntu in many ways, and I don't feel like I'm missing anything. My main annoyance was &lt;span class="caps"&gt;SEL&lt;/span&gt;inux, which just wanted to stop me having any kind of fun with my computer; so I switched it off.&lt;/p&gt;

&lt;p&gt;So, if you need to &lt;span class="caps"&gt;PGP &lt;/span&gt;encrypt your hard drive, but currently use Ubuntu, have a look at Fedora instead.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/townx?a=xyGP04ziPkE:8_tC9lhaAA4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/townx?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/townx?a=xyGP04ziPkE:8_tC9lhaAA4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/townx?i=xyGP04ziPkE:8_tC9lhaAA4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/townx?a=xyGP04ziPkE:8_tC9lhaAA4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/townx?i=xyGP04ziPkE:8_tC9lhaAA4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
 <comments>http://townx.org/blog/elliot/back-fedora#comments</comments>
 <category domain="http://townx.org/tech">tech</category>
 <pubDate>Tue, 03 Nov 2009 18:20:34 -0600</pubDate>
 <dc:creator>elliot</dc:creator>
 <guid isPermaLink="false">787 at http://townx.org</guid>
<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/</creativeCommons:license><feedburner:origLink>http://townx.org/blog/elliot/back-fedora</feedburner:origLink></item>
<item>
 <title>Playing mp3s on Moblin (2.1)</title>
 <link>http://feedproxy.google.com/~r/townx/~3/0FA2FgXo2iA/playing-mp3s-moblin-2-1</link>
 <description>&lt;p&gt;I have an EeePC with &lt;a href="http://moblin.org/"&gt;Moblin&lt;/a&gt; 2.1 (release candidate) installed on it (via the packages in &lt;a href="http://repo.moblin.org/moblin/releases/2.1/ia32/os/" title="http://repo.moblin.org/moblin/releases/2.1/ia32/os/"&gt;http://repo.moblin.org/moblin/releases/2.1/ia32/os/&lt;/a&gt;). By default, you don't get an mp3 decoder with this distribution. It wasn't obvious (when I googled for it) how to install the right GStreamer plugins: several blog entries suggested a variety of pretty hacky methods and work-arounds.&lt;/p&gt;

&lt;p&gt;Then I chanced on a blog entry which mentioned that Fluendo have a free legally-downloadable &lt;span class="caps"&gt;RPM &lt;/span&gt;of their own mp3 encoder; I remember someone at work mentioning it too. I downloaded and installed this onto my netbook with no difficulties. You have to register for an account and go through a faux shopping basket to get it, but it is fairly painless. Here's the product page &lt;span class="caps"&gt;URL&lt;/span&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.fluendo.com/shop/product/fluendo-mp3-decoder/" title="http://www.fluendo.com/shop/product/fluendo-mp3-decoder/"&gt;http://www.fluendo.com/shop/product/fluendo-mp3-decoder/&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/townx?a=0FA2FgXo2iA:RF3sMtl4eVY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/townx?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/townx?a=0FA2FgXo2iA:RF3sMtl4eVY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/townx?i=0FA2FgXo2iA:RF3sMtl4eVY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/townx?a=0FA2FgXo2iA:RF3sMtl4eVY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/townx?i=0FA2FgXo2iA:RF3sMtl4eVY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
 <comments>http://townx.org/blog/elliot/playing-mp3s-moblin-2-1#comments</comments>
 <category domain="http://townx.org/tech">tech</category>
 <pubDate>Tue, 03 Nov 2009 18:03:51 -0600</pubDate>
 <dc:creator>elliot</dc:creator>
 <guid isPermaLink="false">786 at http://townx.org</guid>
<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/</creativeCommons:license><feedburner:origLink>http://townx.org/blog/elliot/playing-mp3s-moblin-2-1</feedburner:origLink></item>
<item><title>Links for 2009-10-30 [del.icio.us]</title><link>http://feedproxy.google.com/~r/townx/~3/n2FztCNusJI/townxelliot</link><pubDate>Sat, 31 Oct 2009 00:00:00 PDT</pubDate><guid isPermaLink="false">http://del.icio.us/townxelliot#2009-10-30</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="http://pyjs.org/book/output/Bookreader.html"&gt;Pyjamas Book&lt;/a&gt;&lt;br/&gt;
Write Python code and compile it to Javascript; also provides an AJAX widget set and a desktop widget set (so the same app. can run in either a browser or on a desktop)&lt;/li&gt;
&lt;/ul&gt;</description><feedburner:origLink>http://del.icio.us/townxelliot#2009-10-30</feedburner:origLink></item><item><title>Links for 2009-10-29 [del.icio.us]</title><link>http://feedproxy.google.com/~r/townx/~3/YdvJf8gTFec/townxelliot</link><pubDate>Fri, 30 Oct 2009 00:00:00 PDT</pubDate><guid isPermaLink="false">http://del.icio.us/townxelliot#2009-10-29</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="http://rails-nutshell.labs.oreilly.com/index.html"&gt;Rails in a Nutshell&lt;/a&gt;&lt;br/&gt;
Rails 3.0 book available to read for free online&lt;/li&gt;
&lt;/ul&gt;</description><feedburner:origLink>http://del.icio.us/townxelliot#2009-10-29</feedburner:origLink></item><item><title>Links for 2009-10-28 [del.icio.us]</title><link>http://feedproxy.google.com/~r/townx/~3/HNXSUaZjGJI/townxelliot</link><pubDate>Thu, 29 Oct 2009 00:00:00 PDT</pubDate><guid isPermaLink="false">http://del.icio.us/townxelliot#2009-10-28</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.playframework.org/"&gt;Play framework&lt;/a&gt;&lt;br/&gt;
Rails-like Java web app framework (via Simon Willison)&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.boomkat.com/item.cfm?id=222584"&gt;THE CARETAKER, Persistent Repetition Of Phrases - Boomkat music download&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.boomkat.com/item.cfm?id=223509"&gt;MOUNT KIMBIE, Sketch On Glass EP - Boomkat music download&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description><feedburner:origLink>http://del.icio.us/townxelliot#2009-10-28</feedburner:origLink></item><item><title>Links for 2009-10-27 [del.icio.us]</title><link>http://feedproxy.google.com/~r/townx/~3/vA_5A6axlrQ/townxelliot</link><pubDate>Wed, 28 Oct 2009 00:00:00 PDT</pubDate><guid isPermaLink="false">http://del.icio.us/townxelliot#2009-10-27</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.pivotaltracker.com/"&gt;Pivotal Tracker - Free Lightweight Agile Project Management &amp;amp; Team Collaboration&lt;/a&gt;&lt;br/&gt;
&amp;quot;Tracker is a free, award winning, agile project management tool that enables real time collaboration around a shared, prioritized backlog.

Velocity tracking and emergent iterations
    Make planning decisions using accurate projections based on past performance.
Story-based iterative planning
    Base your software project management on proven agile methods.
Real-time collaboration
    See what your team is doing and react to change instantly.&amp;quot;&lt;/li&gt;
&lt;/ul&gt;</description><feedburner:origLink>http://del.icio.us/townxelliot#2009-10-27</feedburner:origLink></item><item><title>Links for 2009-10-25 [del.icio.us]</title><link>http://feedproxy.google.com/~r/townx/~3/OoQm99ytpZo/townxelliot</link><pubDate>Mon, 26 Oct 2009 00:00:00 PDT</pubDate><guid isPermaLink="false">http://del.icio.us/townxelliot#2009-10-25</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="http://simonwillison.net/2009/Oct/22/redis/"&gt;Why I like Redis&lt;/a&gt;&lt;br/&gt;
Interesting-sounding &amp;quot;data-structure server&amp;quot;,  a bit like memcached with replication support, a kind of key/value store but with the facility to store more-structured data&lt;/li&gt;
&lt;/ul&gt;</description><feedburner:origLink>http://del.icio.us/townxelliot#2009-10-25</feedburner:origLink></item><item>
 <title>My favourite blog</title>
 <link>http://feedproxy.google.com/~r/townx/~3/Cy44T-_42oI/my-favourite-blog</link>
 <description>&lt;p&gt;I was going to put "probably", but then decided that, no, this is my favourite:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://ageofuncertainty.blogspot.com/" title="http://ageofuncertainty.blogspot.com/"&gt;http://ageofuncertainty.blogspot.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I love the way this chap writes. Mainly about second-hand books he's found and/or read, but often about their cover art, the ephemera he finds inside them, brilliant expositions about small towns he's visited, and other bits and pieces. There's a certain gentle Englishness, quiet pathos, and calm reflection about his work which strikes just the right balance for me.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/townx?a=Cy44T-_42oI:2AX8rUpMKFU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/townx?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/townx?a=Cy44T-_42oI:2AX8rUpMKFU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/townx?i=Cy44T-_42oI:2AX8rUpMKFU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/townx?a=Cy44T-_42oI:2AX8rUpMKFU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/townx?i=Cy44T-_42oI:2AX8rUpMKFU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
 <comments>http://townx.org/blog/elliot/my-favourite-blog#comments</comments>
 <category domain="http://townx.org/miscellaneous">misc</category>
 <pubDate>Tue, 15 Sep 2009 18:01:58 -0500</pubDate>
 <dc:creator>elliot</dc:creator>
 <guid isPermaLink="false">785 at http://townx.org</guid>
<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/</creativeCommons:license><feedburner:origLink>http://townx.org/blog/elliot/my-favourite-blog</feedburner:origLink></item>
<item>
 <title>xtranormal and making movies</title>
 <link>http://feedproxy.google.com/~r/townx/~3/oRIa7ol-ypM/xtranormal-and-making-movies</link>
 <description>&lt;p&gt;&lt;object width="480" height="390"&gt;&lt;param name="movie" value="http://www.xtranormal.com/players/jwplayer.swf"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;param name="flashvars"value="height=390&amp;amp;width=480&amp;amp;file=http://newvideos.xtranormal.com/standard/7673c9a6-8b71-11de-a3cd-003048d6740d_16_standard_medium-flv.flv&amp;amp;image=http://newvideos.xtranormal.com/standard/7673c9a6-8b71-11de-a3cd-003048d6740d_16_standard_poster.jpg&amp;amp;link=http://www.xtranormal.com/watch?e=20090817183120635&amp;amp;searchbar=false&amp;amp;autostart=false"/&gt;&lt;embed src="http://www.xtranormal.com/players/jwplayer.swf" width="480" height="390" allowscriptaccess="always" allowfullscreen="true" flashvars="height=390&amp;amp;width=480&amp;amp;file=http://newvideos.xtranormal.com/standard/7673c9a6-8b71-11de-a3cd-003048d6740d_16_standard_medium-flv.flv&amp;amp;image=http://newvideos.xtranormal.com/standard/7673c9a6-8b71-11de-a3cd-003048d6740d_16_standard_poster.jpg&amp;amp;link=http://www.xtranormal.com/watch?e=20090817183120635&amp;amp;searchbar=false&amp;amp;autostart=false"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;object width="480" height="390"&gt;&lt;param name="movie" value="http://www.xtranormal.com/players/embedded-xnl-stats.swf"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.xtranormal.com/players/embedded-xnl-stats.swf" width="1" height="1" allowscriptaccess="always"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;

&lt;p&gt;Above is the first movie I've made with &lt;a href="http://xtranormal.com/"&gt;xtranormal&lt;/a&gt;, called &lt;a href="http://www.xtranormal.com/watch?e=20090817183120635"&gt;Ex-super villain first date&lt;/a&gt;. Not sure how I've never come across this site before, but it is a fantastic piece of web engineering: an in-browser (Flash), animated movie creation application. Basic accounts are free, and give you a pretty good range of stuff you can do. The interface is very simple and intuitive. It seems best suited to the sort of stilted absurdist style I attempted above, which took me maybe an hour to put together. Much fun.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/townx?a=oRIa7ol-ypM:xiO-Z_CQJ-A:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/townx?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/townx?a=oRIa7ol-ypM:xiO-Z_CQJ-A:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/townx?i=oRIa7ol-ypM:xiO-Z_CQJ-A:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/townx?a=oRIa7ol-ypM:xiO-Z_CQJ-A:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/townx?i=oRIa7ol-ypM:xiO-Z_CQJ-A:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
 <comments>http://townx.org/blog/elliot/xtranormal-and-making-movies#comments</comments>
 <category domain="http://townx.org/tech">tech</category>
 <pubDate>Mon, 17 Aug 2009 17:38:10 -0500</pubDate>
 <dc:creator>elliot</dc:creator>
 <guid isPermaLink="false">784 at http://townx.org</guid>
<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/</creativeCommons:license><feedburner:origLink>http://townx.org/blog/elliot/xtranormal-and-making-movies</feedburner:origLink></item>
<item>
 <title>Memory leaks and JQuery and htmlunit and...</title>
 <link>http://feedproxy.google.com/~r/townx/~3/VO5ElYvrf50/memory-leaks-and-jquery</link>
 <description>&lt;p&gt;(Just a quick note about JQuery and &lt;a href="http://code.google.com/p/rdfquery/"&gt;rdfquery&lt;/a&gt; and memory leaks and htmlunit and such like for lost souls googling desperately for clues.)&lt;/p&gt;

&lt;p&gt;I was having issues with some &lt;a href="http://code.google.com/p/webdriver/"&gt;Webdriver&lt;/a&gt; tests, running under the &lt;a href="http://htmlunit.sourceforge.net/"&gt;htmlunit&lt;/a&gt; driver: they worked locally, but ran into Java "out of memory: heap space exhaustion" issues when running as part of a &lt;a href="https://hudson.dev.java.net/"&gt;Hudson&lt;/a&gt; build on our Linux build server. The build also worked on another virtual machine with the Internet Explorer driver, so it seemed to be something specific to the htmlunit driver (maybe). After upgrading Java, upgrading Hudson (the continuous integration server), and tweaking the Java heap size, and still no joy, I found a few mentions of memory leaks in relation to htmlunit and JQuery (the Javascript library we're using), which I decided were worth investigating.&lt;/p&gt;

&lt;p&gt;One comment in particular seemed plausible: that the Javascript on the pages under test was causing memory leaks in the Javascript engine in htmlunit (Rhino, I think?). It seemed possible that how we were using JQuery was causing Javascript to leak memory, but only in the context of the htmlunit driver. I trawled around the various bug trackers for htmlunit and webdriver, and got a few ideas (though couldn't pin the issue down enough to raise a bug myself).&lt;/p&gt;

&lt;p&gt;One suggested fix (in the general context of JQuery, rather than specifically with regard to htmlunit) was to ensure that any event handlers bound to &lt;span class="caps"&gt;DOM &lt;/span&gt;elements via JQuery should explicitly be removed when the page unloads. This was easy to implement: I just added a final event binding to each page which looked like this (inside a &amp;lt;script&amp;gt; tag, obviously):&lt;/p&gt;



&lt;pre&gt;
$(document).unload(function() {$('*').unbind(); });
&lt;/pre&gt;



&lt;p&gt;I was also using the short-hand JQuery event binding syntax in my code, i.e. things like this:&lt;/p&gt;



&lt;pre&gt;
$('#save').click(function() {
   // ...
});
&lt;/pre&gt;



&lt;p&gt;I changed these to the long-hand form (as this issue only started appearing when I started using the short-hand version):&lt;/p&gt;



&lt;pre&gt;
$('#save').bind('click', function() {
   // ...
});
&lt;/pre&gt;



&lt;p&gt;One last thing I did was ensure that I called the &lt;code&gt;quit()&lt;/code&gt; method on any Webdriver driver instances after I'd finished with them; and &lt;code&gt;closeAllWindows()&lt;/code&gt; on any htmlunit WebClient instances when finished with them.&lt;/p&gt;

&lt;p&gt;Unfortunately, I didn't do this very scientifically, and made all these changes at once. But the end result was that the build started running again. So if you're having out of memory errors with Webdriver/htmlunit/Hudson/JQuery/rdfquery, you at least have somewhere to start from :)&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/townx?a=VO5ElYvrf50:-Z3BHLvQThY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/townx?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/townx?a=VO5ElYvrf50:-Z3BHLvQThY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/townx?i=VO5ElYvrf50:-Z3BHLvQThY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/townx?a=VO5ElYvrf50:-Z3BHLvQThY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/townx?i=VO5ElYvrf50:-Z3BHLvQThY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
 <comments>http://townx.org/blog/elliot/memory-leaks-and-jquery#comments</comments>
 <category domain="http://townx.org/tech">tech</category>
 <pubDate>Wed, 12 Aug 2009 10:23:16 -0500</pubDate>
 <dc:creator>elliot</dc:creator>
 <guid isPermaLink="false">783 at http://townx.org</guid>
<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/</creativeCommons:license><feedburner:origLink>http://townx.org/blog/elliot/memory-leaks-and-jquery</feedburner:origLink></item>
<item>
 <title>Never Toss a Johnny</title>
 <link>http://feedproxy.google.com/~r/townx/~3/oWpCixTTpW0/never-toss-johnny</link>
 <description>&lt;p&gt;I've completed track 2 of my mathis album, &lt;cite&gt;Never Toss a Johnny&lt;/cite&gt;. At this rate, the album should be finished in 5 years' time.&lt;/p&gt;

&lt;p&gt;You can listen to it on Last.fm here: &lt;a href="http://www.last.fm/music/Mathis/_/Never+Toss+A+Johnny?autostart" title="http://www.last.fm/music/Mathis/_/Never+Toss+A+Johnny?autostart"&gt;http://www.last.fm/music/Mathis/_/Never+Toss+A+Johnny?autostart&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Mind your ears, though - it's a bit peaky. I used this oscillator thing towards the end, and while a nice effect, it does veer towards damaging your ears at times. And there's some loud clanging in the middle which might wake a baby or dozing pet.&lt;/p&gt;

&lt;p&gt;(For background, this track uses only samples of music by Johnny Mathis, plus lots of effects. You might hear a fragment of &lt;cite&gt;Fly Me to the Moon&lt;/cite&gt; if you're lucky.)&lt;/p&gt;

&lt;p&gt;If you want a download, I've put some higher-quality mp3s onto S3 (including some of my other tracks), as follows:&lt;/p&gt;


&lt;ol&gt;
&lt;li&gt;&lt;a href="http://townx.org.s3.amazonaws.com/never_toss.mp3"&gt;Never Toss a Johnny by mathis&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://townx.org.s3.amazonaws.com/neighbour.mp3"&gt;Neighbour Forgotten Like a Silent Ray by mathis&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://townx.org.s3.amazonaws.com/close_to_you.mp3"&gt;Close To You (Unfinished) by Spill Twins&lt;/a&gt; - a cover of the Carpenter's song, written from memory, i.e. I didn't look at the sheet music while writing it; I also didn't finish it&lt;/li&gt;
&lt;li&gt;&lt;a href="http://townx.org.s3.amazonaws.com/nipple_soup.mp3"&gt;Nipple Soup by Spill Twins&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://townx.org.s3.amazonaws.com/splashflap.mp3"&gt;SplashFlap by Spill Twins&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://townx.org.s3.amazonaws.com/bread_sounds.mp3"&gt;Bread Sounds (Batch and Tin) by Spill Twins&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://townx.org.s3.amazonaws.com/breeding.mp3"&gt;Breeding in Your Sponge by Spill Twins&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://townx.org.s3.amazonaws.com/ant_mansion.mp3"&gt;Ant Mansion by Spill Twins&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/townx?a=oWpCixTTpW0:L1Ybm4Tenrg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/townx?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/townx?a=oWpCixTTpW0:L1Ybm4Tenrg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/townx?i=oWpCixTTpW0:L1Ybm4Tenrg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/townx?a=oWpCixTTpW0:L1Ybm4Tenrg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/townx?i=oWpCixTTpW0:L1Ybm4Tenrg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
 <comments>http://townx.org/blog/elliot/never-toss-johnny#comments</comments>
 <category domain="http://townx.org/topic/mathis">mathis</category>
 <category domain="http://townx.org/topic/music">music</category>
 <pubDate>Thu, 30 Jul 2009 15:14:06 -0500</pubDate>
 <dc:creator>elliot</dc:creator>
 <guid isPermaLink="false">782 at http://townx.org</guid>
<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/</creativeCommons:license><feedburner:origLink>http://townx.org/blog/elliot/never-toss-johnny</feedburner:origLink></item>
<item>
 <title>Prolegomena 1 (Logo poem/generative art, of sorts)</title>
 <link>http://feedproxy.google.com/~r/townx/~3/0QxP9kBxJrM/prolegomena-1-logo-poem-generative-art-sorts</link>
 <description>&lt;p&gt;&lt;img src="http://townx.org/files/Prolegomena1.png" alt="" height="258" width="264" /&gt;&lt;/p&gt;



&lt;pre&gt;
make &amp;quot;sky 1
make &amp;quot;into 2

to understand
  load &amp;quot;me
  clean home see home see obscure
  repeat :sky + :into [ see ]
end

to see
  television setscrunch :into golden :sky
  repeat often [ right pan forward sky ]
end

to golden :offering
  output :into * :offering
end

to television
  make &amp;quot;me happy
end

to happy
  op &amp;quot;erate &amp;quot;the &amp;quot;switches
end

to often
  make &amp;quot;trouble :sky + :into + :sky
  output power (:into + :sky) :trouble
end

to pan
  output :sky
end

to obscure
  hideturtle
end
&lt;/pre&gt;



&lt;p&gt;This is a &lt;a href="http://el.media.mit.edu/Logo-foundation/logo/programming.html"&gt;Logo&lt;/a&gt; program which is also (kind of) a piece of poetry and image generator (it creates the image shown above). I did it a while back and found it an interesting exercise. I thought you might also find it interesting. Have you done anything similar? Anyone?&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/townx?a=0QxP9kBxJrM:mqd9E_4U51o:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/townx?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/townx?a=0QxP9kBxJrM:mqd9E_4U51o:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/townx?i=0QxP9kBxJrM:mqd9E_4U51o:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/townx?a=0QxP9kBxJrM:mqd9E_4U51o:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/townx?i=0QxP9kBxJrM:mqd9E_4U51o:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
 <comments>http://townx.org/blog/elliot/prolegomena-1-logo-poem-generative-art-sorts#comments</comments>
 <category domain="http://townx.org/tech">tech</category>
 <pubDate>Wed, 22 Jul 2009 08:29:16 -0500</pubDate>
 <dc:creator>elliot</dc:creator>
 <guid isPermaLink="false">780 at http://townx.org</guid>
<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/</creativeCommons:license><feedburner:origLink>http://townx.org/blog/elliot/prolegomena-1-logo-poem-generative-art-sorts</feedburner:origLink></item>
<item>
 <title>Example of how to put RDFa into an HTML list</title>
 <link>http://feedproxy.google.com/~r/townx/~3/AQKmfuYi5uM/example-how-put-rdfa-html-list</link>
 <description>&lt;p&gt;I'm not going to try to explain &lt;a href="http://www.w3.org/TR/rdf-primer/"&gt;&lt;span class="caps"&gt;RDF&lt;/span&gt;&lt;/a&gt; and/or &lt;a href="http://www.w3.org/TR/xhtml-rdfa-primer/"&gt;&lt;span class="caps"&gt;RDF&lt;/span&gt;a&lt;/a&gt; here, but thought any poor suckers looking for &lt;span class="caps"&gt;RDF&lt;/span&gt;a examples might benefit from me posting what I finally worked out, with help from my colleague &lt;a href="http://dynamicorange.com/"&gt;Rob&lt;/a&gt;. Namely, how to annotate an &lt;span class="caps"&gt;HTML &lt;/span&gt;ordered list (&amp;lt;ol&amp;gt;) with &lt;span class="caps"&gt;RDF&lt;/span&gt;a attributes; and how to put &lt;span class="caps"&gt;RDF&lt;/span&gt;a attributes onto form elements.&lt;/p&gt;

&lt;p&gt;Here's the &lt;span class="caps"&gt;HTML &lt;/span&gt;page with &lt;span class="caps"&gt;RDF&lt;/span&gt;a embedded in it. What I'm representing here is a sequence of collections, and the individual collections within it:&lt;/p&gt;



&lt;pre&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;
&amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML+RDFa 1.0//EN&amp;quot; &amp;quot;http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd&amp;quot;&amp;gt;
&amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;Collections&amp;lt;/title&amp;gt;
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
    &amp;lt;h1&amp;gt;Collections&amp;lt;/h1&amp;gt;
    &amp;lt;form method=&amp;quot;post&amp;quot; action=&amp;quot;http://receptacular.org/collections&amp;quot;&amp;gt;
      &amp;lt;ol xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot; xmlns:rdfs=&amp;quot;http://www.w3.org/2000/01/rdf-schema#&amp;quot; xmlns:rdf=&amp;quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&amp;quot; xmlns:xsd=&amp;quot;http://www.w3.org/2001/XMLSchema#&amp;quot; xmlns:rec=&amp;quot;http://receptacular.org/schema#&amp;quot; typeof=&amp;quot;rdf:Seq&amp;quot; about=&amp;quot;http://receptacular.org/collections&amp;quot;&amp;gt;
        &amp;lt;li rel=&amp;quot;rdf:_1&amp;quot; resource=&amp;quot;http://receptacular.org/collections/1&amp;quot;&amp;gt;
          &amp;lt;span style=&amp;quot;display:none;&amp;quot; rel=&amp;quot;rdf:type&amp;quot; resource=&amp;quot;http://receptacular.org/schema#Collection&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;
          &amp;lt;div class=&amp;quot;collection-label&amp;quot; property=&amp;quot;rdfs:label&amp;quot;&amp;gt;Vague Collection&amp;lt;/div&amp;gt;
          &amp;lt;input type=&amp;quot;checkbox&amp;quot; id=&amp;quot;collections-1-hidden&amp;quot; property=&amp;quot;rec:hidden&amp;quot; datatype=&amp;quot;xsd:boolean&amp;quot; content=&amp;quot;false&amp;quot;/&amp;gt;
          &amp;lt;label for=&amp;quot;collections-1-hidden&amp;quot;&amp;gt;hidden&amp;lt;/label&amp;gt;
          &amp;lt;input type=&amp;quot;checkbox&amp;quot; id=&amp;quot;collections-1-defaultSearch&amp;quot; property=&amp;quot;rec:defaultSearch&amp;quot; datatype=&amp;quot;xsd:boolean&amp;quot; content=&amp;quot;false&amp;quot;/&amp;gt;
          &amp;lt;label for=&amp;quot;collections-1-defaultSearch&amp;quot;&amp;gt;use for searches&amp;lt;/label&amp;gt;
        &amp;lt;/li&amp;gt;
        &amp;lt;li rel=&amp;quot;rdf:_2&amp;quot; resource=&amp;quot;http://receptacular.org/collections/2&amp;quot;&amp;gt;
          &amp;lt;span style=&amp;quot;display:none;&amp;quot; rel=&amp;quot;rdf:type&amp;quot; resource=&amp;quot;http://receptacular.org/schema#Collection&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;
          &amp;lt;div class=&amp;quot;collection-label&amp;quot; property=&amp;quot;rdfs:label&amp;quot;&amp;gt;Archive Collection&amp;lt;/div&amp;gt;
          &amp;lt;input type=&amp;quot;checkbox&amp;quot; id=&amp;quot;collections-2-hidden&amp;quot; property=&amp;quot;rec:hidden&amp;quot; datatype=&amp;quot;xsd:boolean&amp;quot; content=&amp;quot;false&amp;quot;/&amp;gt;
          &amp;lt;label for=&amp;quot;collections-2-hidden&amp;quot;&amp;gt;hidden&amp;lt;/label&amp;gt;
          &amp;lt;input type=&amp;quot;checkbox&amp;quot; id=&amp;quot;collections-2-defaultSearch&amp;quot; property=&amp;quot;rec:defaultSearch&amp;quot; datatype=&amp;quot;xsd:boolean&amp;quot; content=&amp;quot;false&amp;quot;/&amp;gt;
          &amp;lt;label for=&amp;quot;collections-2-defaultSearch&amp;quot;&amp;gt;use for searches&amp;lt;/label&amp;gt;
        &amp;lt;/li&amp;gt;
        &amp;lt;li rel=&amp;quot;rdf:_3&amp;quot; resource=&amp;quot;http://receptacular.org/collections/3&amp;quot;&amp;gt;
          &amp;lt;span style=&amp;quot;display:none;&amp;quot; rel=&amp;quot;rdf:type&amp;quot; resource=&amp;quot;http://receptacular.org/schema#Collection&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;
          &amp;lt;div class=&amp;quot;collection-label&amp;quot; property=&amp;quot;rdfs:label&amp;quot;&amp;gt;Main Collection&amp;lt;/div&amp;gt;
          &amp;lt;input type=&amp;quot;checkbox&amp;quot; id=&amp;quot;collections-3-hidden&amp;quot; property=&amp;quot;rec:hidden&amp;quot; datatype=&amp;quot;xsd:boolean&amp;quot; content=&amp;quot;true&amp;quot; checked=&amp;quot;checked&amp;quot;/&amp;gt;
          &amp;lt;label for=&amp;quot;collections-3-hidden&amp;quot;&amp;gt;hidden&amp;lt;/label&amp;gt;
          &amp;lt;input type=&amp;quot;checkbox&amp;quot; id=&amp;quot;collections-3-defaultSearch&amp;quot; property=&amp;quot;rec:defaultSearch&amp;quot; datatype=&amp;quot;xsd:boolean&amp;quot; content=&amp;quot;true&amp;quot; checked=&amp;quot;checked&amp;quot;/&amp;gt;
          &amp;lt;label for=&amp;quot;collections-3-defaultSearch&amp;quot;&amp;gt;use for searches&amp;lt;/label&amp;gt;
        &amp;lt;/li&amp;gt;
      &amp;lt;/ol&amp;gt;
      &amp;lt;p&amp;gt;
        &amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;Save&amp;quot; id=&amp;quot;save-collections&amp;quot;/&amp;gt;
      &amp;lt;/p&amp;gt;
    &amp;lt;/form&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;



&lt;p&gt;Available online here: &lt;a href="http://receptacular.org/collections" title="http://receptacular.org/collections"&gt;http://receptacular.org/collections&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Things of note:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;The doctype declaration. This is the &lt;span class="caps"&gt;W3C &lt;/span&gt;sanctioned doctype for &lt;span class="caps"&gt;XHTML&lt;/span&gt;+RDFa pages. By the way, the &lt;span class="caps"&gt;W3C &lt;/span&gt;validator will correctly validate this page, but standard &lt;span class="caps"&gt;XHTML &lt;/span&gt;validators don't (e.g. like "this one"http://nutrun.com/weblog/xhtmlvalidator-validate-xhtml-in-java/:). That's another story...&lt;/li&gt;
&lt;li&gt;Namespace declarations on the &amp;lt;ol&amp;gt; element wrapping the list items. This is what causes standard &lt;span class="caps"&gt;XHTML &lt;/span&gt;validation approaches to fail.&lt;/li&gt;
&lt;li&gt;The &amp;lt;ol&amp;gt; element is defined with &lt;strong&gt;typeof="rdf:Seq"&lt;/strong&gt; and &lt;strong&gt;about="http://receptacular.org/collections"&lt;/strong&gt;. This sets it up as the &lt;span class="caps"&gt;RDF&lt;/span&gt; Seq resource.&lt;/li&gt;
&lt;li&gt;The &amp;lt;li&amp;gt; elements inside the &amp;lt;ol&amp;gt; are Seq items, within the wrapping Seq resource. Each is each defined as a resource using the &lt;strong&gt;resource&lt;/strong&gt; attribute. They are linked back to the enclosing &amp;lt;ol&amp;gt; element using the &lt;strong&gt;rel&lt;/strong&gt; attribute on each. Note that the value for the &lt;strong&gt;rel&lt;/strong&gt; attribute is an rdf Seq number, which orders the items within the enclosing Seq resource.&lt;/li&gt;
&lt;li&gt;The &lt;span class="caps"&gt;RDF &lt;/span&gt;type of each Seq item is set using a hidden &amp;lt;span&amp;gt; element. Note that these elements have no text in them, but have opening and closing tags. If you just use a self-closing start tag for this element, the &lt;span class="caps"&gt;HTML &lt;/span&gt;doesn't display property. &lt;/li&gt;
&lt;li&gt;The &amp;lt;span&amp;gt; elements use the &lt;strong&gt;rel&lt;/strong&gt; attribute to mark their &lt;span class="caps"&gt;RDF &lt;/span&gt;type relationship to the outer list item; and the &lt;strong&gt;resource&lt;/strong&gt; attribute to specify the location of the resource representing their type.&lt;/li&gt;
&lt;li&gt;Each Seq item has an enclosed &amp;lt;div&amp;gt; which represents its &lt;strong&gt;rdfs:label&lt;/strong&gt; property. Note that the &lt;strong&gt;property&lt;/strong&gt; RDFa attribute is used to specify which property of the enclosing resource is being defined. Also note that the value of the property is inlined between the start and end tags of the &amp;lt;div&amp;gt;.&lt;/li&gt;
&lt;li&gt;The two checkboxes define two more properties for each Seq resource: &lt;strong&gt;rec:hidden&lt;/strong&gt; and &lt;strong&gt;rec:defaultSearch&lt;/strong&gt;. (The semantics of the properties aren't discussed here, as I'm concentrating on syntax.) Each is defined on a standard &lt;span class="caps"&gt;XHTML &lt;/span&gt;&amp;lt;input&amp;gt; element: the relationship to the enclosing Seq item is defined with the &lt;strong&gt;property&lt;/strong&gt; attribute; the value of the property is defined using the &lt;strong&gt;content&lt;/strong&gt; attribute; and the data type of the literal value is defined via the &lt;strong&gt;datatype&lt;/strong&gt; attribute. Any of the standard &lt;span class="caps"&gt;XML &lt;/span&gt;datatypes could be used here, or other types from other schemas.&lt;/li&gt;
&lt;li&gt;When working with form elements which represent property values for &lt;span class="caps"&gt;RDF &lt;/span&gt;resources, you may need to change the &lt;strong&gt;content&lt;/strong&gt; attribute in response to UI changes. (In the application from which this example was extracted, we use &lt;a href="http://jquery.com/"&gt;JQuery&lt;/a&gt; to respond to changes in the check box which set the &lt;strong&gt;content&lt;/strong&gt; attribute.)&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;To see the &lt;span class="caps"&gt;RDF &lt;/span&gt;which can be extracted from this page, you can use the &lt;span class="caps"&gt;W3C'&lt;/span&gt;s &lt;a href="http://www.w3.org/2007/08/pyRdfa/"&gt;&lt;span class="caps"&gt;RDF&lt;/span&gt;a Distiller&lt;/a&gt;. Here's the resulting &lt;span class="caps"&gt;RDF&lt;/span&gt;:&lt;/p&gt;



&lt;pre&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;
&amp;lt;rdf:RDF
  xmlns:dist=&amp;quot;http://www.w3.org/2007/08/pyRdfa/distiller#&amp;quot;
  xmlns:rdf=&amp;quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&amp;quot;
  xmlns:rdfs=&amp;quot;http://www.w3.org/2000/01/rdf-schema#&amp;quot;
  xmlns:rec=&amp;quot;http://receptacular.org/schema#&amp;quot;
  xmlns:xhv=&amp;quot;http://www.w3.org/1999/xhtml/vocab#&amp;quot;
  xmlns:xml=&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot;
  xmlns:xsd=&amp;quot;http://www.w3.org/2001/XMLSchema#&amp;quot;
&amp;gt;
  &amp;lt;rdf:Seq rdf:about=&amp;quot;http://receptacular.org/collections&amp;quot;&amp;gt;
    &amp;lt;rdf:_1&amp;gt;
      &amp;lt;rec:Collection rdf:about=&amp;quot;http://receptacular.org/collections/1&amp;quot;&amp;gt;
        &amp;lt;rec:hidden rdf:datatype=&amp;quot;http://www.w3.org/2001/XMLSchema#boolean&amp;quot;&amp;gt;false&amp;lt;/rec:hidden&amp;gt;
        &amp;lt;rec:defaultSearch rdf:datatype=&amp;quot;http://www.w3.org/2001/XMLSchema#boolean&amp;quot;&amp;gt;false&amp;lt;/rec:defaultSearch&amp;gt;
        &amp;lt;rdfs:label&amp;gt;Vague Collection&amp;lt;/rdfs:label&amp;gt;
      &amp;lt;/rec:Collection&amp;gt;
    &amp;lt;/rdf:_1&amp;gt;
    &amp;lt;rdf:_2&amp;gt;
      &amp;lt;rec:Collection rdf:about=&amp;quot;http://receptacular.org/collections/2&amp;quot;&amp;gt;
        &amp;lt;rec:hidden rdf:datatype=&amp;quot;http://www.w3.org/2001/XMLSchema#boolean&amp;quot;&amp;gt;false&amp;lt;/rec:hidden&amp;gt;
        &amp;lt;rec:defaultSearch rdf:datatype=&amp;quot;http://www.w3.org/2001/XMLSchema#boolean&amp;quot;&amp;gt;false&amp;lt;/rec:defaultSearch&amp;gt;
        &amp;lt;rdfs:label&amp;gt;Archive Collection&amp;lt;/rdfs:label&amp;gt;
      &amp;lt;/rec:Collection&amp;gt;
    &amp;lt;/rdf:_2&amp;gt;
    &amp;lt;rdf:_3&amp;gt;
      &amp;lt;rec:Collection rdf:about=&amp;quot;http://receptacular.org/collections/3&amp;quot;&amp;gt;
        &amp;lt;rec:hidden rdf:datatype=&amp;quot;http://www.w3.org/2001/XMLSchema#boolean&amp;quot;&amp;gt;true&amp;lt;/rec:hidden&amp;gt;
        &amp;lt;rec:defaultSearch rdf:datatype=&amp;quot;http://www.w3.org/2001/XMLSchema#boolean&amp;quot;&amp;gt;true&amp;lt;/rec:defaultSearch&amp;gt;
        &amp;lt;rdfs:label&amp;gt;Main Collection&amp;lt;/rdfs:label&amp;gt;
      &amp;lt;/rec:Collection&amp;gt;
    &amp;lt;/rdf:_3&amp;gt;
  &amp;lt;/rdf:Seq&amp;gt;
&amp;lt;/rdf:RDF&amp;gt;
&lt;/pre&gt;



&lt;p&gt;Saving changes to an &lt;span class="caps"&gt;RDF&lt;/span&gt;a-enabled form like this is another challenge, for which we used &lt;a href="http://code.google.com/p/rdfquery/"&gt;rdfquery&lt;/a&gt;, and &lt;span class="caps"&gt;RDF &lt;/span&gt;library for JQuery. (I recommend you use the latest svn &lt;span class="caps"&gt;HEAD &lt;/span&gt;version of this library, as older versions have a bug where they ignore &lt;span class="caps"&gt;RDF&lt;/span&gt;a elements nested inside elements without &lt;span class="caps"&gt;RDF&lt;/span&gt;a attributes.) Maybe I'll get round to that another time.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/townx?a=AQKmfuYi5uM:y_JkmurN4VU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/townx?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/townx?a=AQKmfuYi5uM:y_JkmurN4VU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/townx?i=AQKmfuYi5uM:y_JkmurN4VU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/townx?a=AQKmfuYi5uM:y_JkmurN4VU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/townx?i=AQKmfuYi5uM:y_JkmurN4VU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
 <comments>http://townx.org/blog/elliot/example-how-put-rdfa-html-list#comments</comments>
 <category domain="http://townx.org/tech">tech</category>
 <category domain="http://townx.org/howtos">howtos</category>
 <pubDate>Tue, 30 Jun 2009 04:52:35 -0500</pubDate>
 <dc:creator>elliot</dc:creator>
 <guid isPermaLink="false">779 at http://townx.org</guid>
<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/</creativeCommons:license><feedburner:origLink>http://townx.org/blog/elliot/example-how-put-rdfa-html-list</feedburner:origLink></item>
<item>
 <title>Script to copy random mp3s from a directory to an mp3 player</title>
 <link>http://feedproxy.google.com/~r/townx/~3/EMpBzEIBdy0/script-copy-random-mp3s-directory-mp3-player</link>
 <description>&lt;p&gt;This is a Ruby script which randomly copies mp3 files from one directory to an mp3 player. I wrote it so I could easily fill up my mp3 player from the 9000 odd mp3s I have on a different external drive.&lt;/p&gt;

&lt;p&gt;To run it, you'll need the &lt;strong&gt;sys-filesystem&lt;/strong&gt; gem (see &lt;a href="http://rubyforge.org/projects/sysutils" title="http://rubyforge.org/projects/sysutils"&gt;http://rubyforge.org/projects/sysutils&lt;/a&gt;):&lt;/p&gt;



&lt;pre&gt;
$ gem install sys-filesystem
&lt;/pre&gt;



&lt;p&gt;Next, edit these variables in the script (near the top):&lt;br /&gt;
* &lt;code&gt;source_dir&lt;/code&gt; to the directory containing the mp3s you want to select from&lt;br /&gt;
* &lt;code&gt;dest_dir&lt;/code&gt; to the path for the directory on your mp3 player you want to copy to&lt;/p&gt;

&lt;p&gt;&lt;span style="color:red"&gt;Be a bit careful, as this will attempt to fill the &lt;code&gt;dest_dir&lt;/code&gt; you specify with mp3 files from &lt;code&gt;source_dir&lt;/code&gt;. You might end up filling the wrong disk up.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Then just run it with ruby from the command line:&lt;/p&gt;



&lt;pre&gt;
$ ruby mp3s_random.rb
&lt;/pre&gt;



&lt;p&gt;Note that it won't delete anything from the destination drive, and will attempt to fill all the space available. Also note that it doesn't keep trying mp3s until it finds one which will fit the last remaining space: once it tries to copy a file which won't fit, it stops. You can always run it again to see whether the next run finds a file small enough to fit.&lt;/p&gt;

&lt;p&gt;I've only tested it on Linux, but, who knows, it might work on Windows too. (No operating-system specific commands are used in the script, as it uses Ruby for all file operations.)&lt;/p&gt;

&lt;p&gt;The code is below, but I've attached it as well.&lt;/p&gt;



&lt;pre&gt;
require 'rubygems'
require 'sys/filesystem'
require 'ftools'

source_dir = '/media/disk/music'
dest_dir = '/media/disk-1/music'

files = Dir[File.join(source_dir, '/**/*.mp3')]
num_files = files.size

stat = Sys::Filesystem.stat(dest_dir)

disk_free_space_kb = (stat.blocks_free * stat.fragment_size).to_kb

files_selected = []

while disk_free_space_kb &amp;gt; 0 and num_files &amp;gt; 0 do
  # choose an mp3
  file_num_to_copy = rand(num_files - 1) + 1
  file_path = files.delete_at(file_num_to_copy)

  num_files = num_files - 1

  # work out how big file is
  file_size_kb = File.stat(file_path).size.to_kb

  # subtract from free space
  if (disk_free_space_kb - file_size_kb) &amp;gt; 0
    files_selected &amp;lt;&amp;lt; file_path
    disk_free_space_kb = disk_free_space_kb - file_size_kb
  else
    break
  end
end

files_selected.each do |f|
  copy_to_path = File.join(dest_dir, File.basename(f))
  puts &amp;quot;Copying #{f} to device&amp;quot;
  File.copy(f, copy_to_path)
end
&lt;/pre&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/townx?a=EMpBzEIBdy0:bzcUr79VfZA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/townx?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/townx?a=EMpBzEIBdy0:bzcUr79VfZA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/townx?i=EMpBzEIBdy0:bzcUr79VfZA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/townx?a=EMpBzEIBdy0:bzcUr79VfZA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/townx?i=EMpBzEIBdy0:bzcUr79VfZA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
 <comments>http://townx.org/blog/elliot/script-copy-random-mp3s-directory-mp3-player#comments</comments>
 <category domain="http://townx.org/tech">tech</category>
 <category domain="http://townx.org/howtos">howtos</category>
 <enclosure url="http://townx.org/files/mp3s_random.rb" length="939" type="application/x-ruby" />
 <pubDate>Tue, 30 Jun 2009 04:24:41 -0500</pubDate>
 <dc:creator>elliot</dc:creator>
 <guid isPermaLink="false">778 at http://townx.org</guid>
<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/</creativeCommons:license><feedburner:origLink>http://townx.org/blog/elliot/script-copy-random-mp3s-directory-mp3-player</feedburner:origLink></item>
<item>
 <title>How I worked out that curl is doing bad things with MARC</title>
 <link>http://feedproxy.google.com/~r/townx/~3/e5ArutwJhZA/how-i-worked-out-curl-doing-bad-things-marc</link>
 <description>&lt;p&gt;I work on a system at &lt;a href="http://talis.com/"&gt;Talis&lt;/a&gt; which posts &lt;span class="caps"&gt;MARC &lt;/span&gt;records from customer library databases into a &lt;span class="caps"&gt;MARC &lt;/span&gt;to &lt;span class="caps"&gt;RDF &lt;/span&gt;transformer. The resulting &lt;span class="caps"&gt;RDF &lt;/span&gt;generated from the &lt;span class="caps"&gt;MARC &lt;/span&gt;is sent into the &lt;a href="http://www.talis.com/platform/"&gt;Talis Platform&lt;/a&gt;, where it's used to power &lt;a href="http://talis.com/prism"&gt;Prism&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Over the last day or so I've been working on a bug which has prevented some records going correctly through this process. Along the way, I noticed another bug occurring somewhere between the post from the customer site into our &lt;span class="caps"&gt;MARC &lt;/span&gt;to &lt;span class="caps"&gt;RDF &lt;/span&gt;transformer. It looked as if line break characters in the original &lt;span class="caps"&gt;MARC &lt;/span&gt;record were being lost somewhere in the process. Consequently, when the &lt;span class="caps"&gt;MARC &lt;/span&gt;was pushed into the transformer, the record got spat out as invalid, as the length specified in the &lt;span class="caps"&gt;MARC &lt;/span&gt;leader didn't correspond to the length of the record (now it had lost its line break characters). (By the way, working directly with byte streams is the only way to work with &lt;span class="caps"&gt;MARC, &lt;/span&gt;for precisely this reason.)&lt;/p&gt;

&lt;p&gt;I had a sudden insight on the way home, triggered by remembering issues I'd had with &lt;a href="http://curl.haxx.se/"&gt;curl&lt;/a&gt; (the command line &lt;span class="caps"&gt;HTTP &lt;/span&gt;client) working on &lt;a href="http://code.google.com/p/hardfidget/"&gt;another personal project&lt;/a&gt;. On that project, I'd been trying to post &lt;span class="caps"&gt;RDF &lt;/span&gt;triples in ntriple format into my application using curl. However, the application only seemed to recognise the first &lt;span class="caps"&gt;RDF &lt;/span&gt;triple in the posted file. I couldn't understand why.&lt;/p&gt;

&lt;p&gt;Then, when I echoed the body of the &lt;span class="caps"&gt;HTTP &lt;/span&gt;request, as received by my app from curl, I realised the issue: curl was sending the body of the request &lt;span class="caps"&gt;WITHOUT LINE BREAKS.&lt;/span&gt; As line break characters act as the delimiter between triples in &lt;span class="caps"&gt;RDF &lt;/span&gt;ntriple format, my app was only seeing a single &lt;span class="caps"&gt;RDF &lt;/span&gt;ntriple. When I tried an alternative tool to send the posts (the extremely useful &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/2691"&gt;Poster add-on for Firefox&lt;/a&gt;), the ntriples were received correctly.&lt;/p&gt;

&lt;p&gt;Once I remembered this, I decided to do some debugging of the kind of requests curl would send if it were posting &lt;span class="caps"&gt;MARC &lt;/span&gt;records. My hypothesis was that curl was stripping line break characters from the &lt;span class="caps"&gt;MARC &lt;/span&gt;record (which is bad, as they are valid characters in &lt;span class="caps"&gt;MARC&lt;/span&gt;), and hence causing the record to be shorter than the leader said it should be.&lt;/p&gt;

&lt;p&gt;First step was to put together something to echo and/or save &lt;span class="caps"&gt;HTTP &lt;/span&gt;request bodies. &lt;a href="http://rack.rubyforge.org/"&gt;Rack&lt;/a&gt; is ideal for this sort of thing, so I used this little Rack web server program:&lt;/p&gt;



&lt;pre&gt;
require 'rubygems'
require 'rack'

def save_body(body)
  File.open('last_raw_request', 'w') {|f| f.write(body)}
  body
end

Rack::Handler::WEBrick.run(lambda {|e| [200, {}, save_body(e['rack.input'].read)]}, :Port=&amp;gt;7777)
&lt;/pre&gt;



&lt;p&gt;This saves the raw request body to a file called "last_raw_request".&lt;/p&gt;

&lt;p&gt;I first posted a &lt;span class="caps"&gt;MARC &lt;/span&gt;file with line breaks in it (attached) using Poster (with Content-Type set to application/marc21) through Firefox. The &lt;span class="caps"&gt;MARC &lt;/span&gt;file came through intact and still valid.&lt;/p&gt;

&lt;p&gt;I then posted a &lt;span class="caps"&gt;MARC &lt;/span&gt;file with line breaks in it using curl:&lt;/p&gt;



&lt;pre&gt;
curl -d @marcfile.mrc -H &amp;quot;Content-Type:application/marc21&amp;quot; &lt;a href="http://localhost:7777/" title="http://localhost:7777/"&gt;http://localhost:7777/&lt;/a&gt;
&lt;/pre&gt;



&lt;p&gt;Which produced an invalid &lt;span class="caps"&gt;MARC &lt;/span&gt;file with line breaks missing.&lt;/p&gt;

&lt;p&gt;The solution is to use the &lt;code&gt;--data-binary&lt;/code&gt; switch when using curl to send binary data, which we're not doing when sending &lt;span class="caps"&gt;MARC &lt;/span&gt;from the customer site. Mostly this doesn't matter, but it does when the &lt;span class="caps"&gt;MARC &lt;/span&gt;record contains line break characters.&lt;/p&gt;

&lt;p&gt;Namely:&lt;/p&gt;



&lt;pre&gt;
curl --data-binary @marcfile.mrc -H &amp;quot;Content-Type:application/marc21&amp;quot; &lt;a href="http://localhost:7777/" title="http://localhost:7777/"&gt;http://localhost:7777/&lt;/a&gt;
&lt;/pre&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/townx?a=e5ArutwJhZA:R5hnNwXC0NY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/townx?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/townx?a=e5ArutwJhZA:R5hnNwXC0NY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/townx?i=e5ArutwJhZA:R5hnNwXC0NY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/townx?a=e5ArutwJhZA:R5hnNwXC0NY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/townx?i=e5ArutwJhZA:R5hnNwXC0NY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
 <comments>http://townx.org/blog/elliot/how-i-worked-out-curl-doing-bad-things-marc#comments</comments>
 <category domain="http://townx.org/tech">tech</category>
 <pubDate>Wed, 10 Jun 2009 04:21:31 -0500</pubDate>
 <dc:creator>elliot</dc:creator>
 <guid isPermaLink="false">777 at http://townx.org</guid>
<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/</creativeCommons:license><feedburner:origLink>http://townx.org/blog/elliot/how-i-worked-out-curl-doing-bad-things-marc</feedburner:origLink></item>
<lastBuildDate>Thu, 05 Nov 2009 00:00:00 PST</lastBuildDate></channel>
</rss>
