<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blackkettle &#187; Ruby</title>
	<atom:link href="http://blog.blackkettle.org/tags/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.blackkettle.org</link>
	<description>Things of Occasional Interest</description>
	<lastBuildDate>Wed, 10 Feb 2010 16:03:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>[ANN] celerity_parser 0.1.1</title>
		<link>http://blog.blackkettle.org/2009/06/22/ann-celerity_parser-011/</link>
		<comments>http://blog.blackkettle.org/2009/06/22/ann-celerity_parser-011/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 07:22:14 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[jruby]]></category>
		<category><![CDATA[rubygems]]></category>

		<guid isPermaLink="false">http://blog.blackkettle.org/?p=103</guid>
		<description><![CDATA[HTML parsing in JRuby seems to be going through a slightly odd patch. Nokogiri and Hpricot both seem to have problems. There&#8217;s one project I&#8217;m working on at the moment which needs xpath support, and by chance I happen to be using Celerity, which wraps htmlunit. If I need an HTML parser, I thought, there [...]]]></description>
			<content:encoded><![CDATA[<p>HTML parsing in JRuby seems to be going through a slightly odd patch. Nokogiri and Hpricot both seem to have problems. There&#8217;s one project I&#8217;m working on at the moment which needs xpath support, and by chance I happen to be using <a href="http://celerity.rubyforge.org">Celerity</a>, which wraps <a href="http://htmlunit.sourceforge.net">htmlunit</a>. If I need an HTML parser, I thought, there must be one somewhere hidden within that I can use. For extra bonus points, I wouldn&#8217;t even need to package any native code, celerity already has that covered&#8230;</p>
<p><a href="http://github.com/regularfry/celerity_parser/tree/master">And so it came to pass.</a> celerity_parser is an almost trivially thin wrapper around HtmlUnit&#8217;s HTMLParser class that&#8217;s got <i>just</i> enough functionality to do what I need, which is search for elements by xpath, and extract text and XHTML structure. When I say &#8220;trivially thin&#8221;, I really mean it &#8211; there&#8217;s a grand total of 2 Ruby classes, and 5 methods you might want to use.</p>
<p>Here&#8217;s how it works, taken from the README:</p>
<pre><code>
root_node = CelerityParser.parse(html_content)
found_elements = root_node.search("//html/head/title")
found_elements.first.text # => "Html page title"
</code></pre>
<p>That&#8217;s pretty much it. Dependencies are on jarib-celerity and jruby itself. Enjoy, and I&#8217;m open to pull requests and suggestions if you need more than this. I&#8217;ve not done any speed tests, but it&#8217;s native Java so might be quite nippy.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blackkettle.org/2009/06/22/ann-celerity_parser-011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Green Fields</title>
		<link>http://blog.blackkettle.org/2009/04/24/green-fields/</link>
		<comments>http://blog.blackkettle.org/2009/04/24/green-fields/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 19:36:45 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[s3]]></category>

		<guid isPermaLink="false">http://blog.blackkettle.org/?p=76</guid>
		<description><![CDATA[So&#8230; first green fields Major Project in a while. It&#8217;s a Rails app, but I&#8217;m shifting to PostgreSQL and Amazon EC2/S3 for a bunch of it, so there&#8217;s going to be a fair amount of new learnings here.
It also feels slightly odd to be jumping back into Rails again. I&#8217;ve not done any new Rails [...]]]></description>
			<content:encoded><![CDATA[<p>So&#8230; first green fields Major Project in a while. It&#8217;s a Rails app, but I&#8217;m shifting to PostgreSQL and Amazon EC2/S3 for a bunch of it, so there&#8217;s going to be a fair amount of new learnings here.</p>
<p>It also feels slightly odd to be jumping back into Rails again. I&#8217;ve not done any new Rails work for a little while; the majority of my consulting has been on apps frozen at 2.1, so it&#8217;ll be good to be working on the fresh code-base.</p>
<p>I&#8217;ve shut down Other People Work for the next couple of weeks to get this project out of the door, although I reckon that what with various travel and visiting plans, I&#8217;ve only got about 2/3rds of that time to play with.</p>
<p>No time to hang around here blogging, there&#8217;s work to be done!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blackkettle.org/2009/04/24/green-fields/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updating Metadata for 722 gems!  AARGH!</title>
		<link>http://blog.blackkettle.org/2008/06/26/updating-metadata-for-722-gems-aargh/</link>
		<comments>http://blog.blackkettle.org/2008/06/26/updating-metadata-for-722-gems-aargh/#comments</comments>
		<pubDate>Thu, 26 Jun 2008 16:03:04 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[rubygems]]></category>

		<guid isPermaLink="false">http://blog.blackkettle.org/?p=42</guid>
		<description><![CDATA[Seriously.  Is this really necessary?
alex@21:~/Documents/Projects/VPNGen$ gem search scp --remote

*** REMOTE GEMS ***

Updating metadata for 722 gems from http://gems.rubyforge.org/
..............................................................................................
..............................................................................................
..............................................................................................
...............................ERROR:  Interrupted

]]></description>
			<content:encoded><![CDATA[<p>Seriously.  Is this really necessary?</p>
<pre><code>alex@21:~/Documents/Projects/VPNGen$ gem search scp --remote

*** REMOTE GEMS ***

Updating metadata for 722 gems from http://gems.rubyforge.org/
..............................................................................................
..............................................................................................
..............................................................................................
...............................ERROR:  Interrupted
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.blackkettle.org/2008/06/26/updating-metadata-for-722-gems-aargh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VirtualBox, KVM, Windows and Linux</title>
		<link>http://blog.blackkettle.org/2008/06/12/virtualbox-kvm-windows-and-linux/</link>
		<comments>http://blog.blackkettle.org/2008/06/12/virtualbox-kvm-windows-and-linux/#comments</comments>
		<pubDate>Thu, 12 Jun 2008 17:13:09 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[virtualbox]]></category>

		<guid isPermaLink="false">http://blog.blackkettle.org/?p=40</guid>
		<description><![CDATA[Today I&#8217;ve been mostly bringing a new subcontractor up to speed on a project I&#8217;ve been working on for a while.  It&#8217;s quite a fun project that I&#8217;ll probably post about at some later date (think _why&#8217;s mousehole on steroids), but what I&#8217;ve spent most of my time on is wrangling virtual machine images.
For [...]]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;ve been mostly bringing a new subcontractor up to speed on a project I&#8217;ve been working on for a while.  It&#8217;s quite a fun project that I&#8217;ll probably post about at some later date (think _why&#8217;s mousehole on steroids), but what I&#8217;ve spent most of my time on is wrangling virtual machine images.</p>
<p>For me, kvm is the first (free) virtual machine host system that makes everything Just Work.  I always had problems with UML and Xen, qemu <strong>was</strong> too slow, and I always shied away from VMware.  Not entirely sure why, but there you go.</p>
<p>Now, back to this contractor:   he&#8217;s on Windows, I&#8217;m on Ubuntu Gutsy.  I know that my code won&#8217;t work on Windows, because I&#8217;m daemonising and fork()ing all over the place.  VMs to the rescue!  It looks to me like the best combination is kvm on my side, and VirtualBox on his.  There&#8217;s a very simple conversion that lets me convert my qcow image to a vmdk that VirtualBox can read:</p>
<p><code>qemu-img convert etch-rodents-i386.img -O vmdk etch-rodents-i386.vmdk</code></p>
<p>I&#8217;ve not seen this documented anywhere; most google hits mention the obsolete vditool, which I couldn&#8217;t get to run on my 64-bit host anyway.  </p>
<p>Added bonus: the vmdk image is slightly smaller than the qcow.  Win.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blackkettle.org/2008/06/12/virtualbox-kvm-windows-and-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
