August 10th, 2008
I was just browsing through the Mnesia User’s Guide and surprised to see a lot more detail on the features supporting table fragmentations, Mnesia’s term for data sharding. It sure looks like Mnesia has an impressive feature set for building a fault tolerant large data store. In particular, it looks like you can manage a set of nodes hosting the db as well as the number of fragments for a given table and do add/removes of both at run time. I need to find some time to take it for a test drive. Is it easy to use? Is it fast enough to use as the backing store of a high performance web service?
Technorati Tags: databases, erlang, scalability
Posted in programming | No Comments »
August 10th, 2008
Regan and I watched 12 Angry Men last night on dvd. I had not seen it before. This is the 1957 court room drama starring Henry Fonda and directed by Sidney Lumet. If you haven’t seen it, I highly recommend it. The action takes place entirely in a small spartan jury room on a hot summer night. It’s the sort of film you can easily imagine being performed as a play. The original version, however, was televised in the series Studio One (according to IMDB). And it runs only 96 minutes, which is further evidence that there is no good reason to make a film longer than two hours.
Posted in null | No Comments »
August 2nd, 2008
This morning I decided to a bit of maintenance work on my blog and noticed that my Worpress installation was out of date with the current release. I was running 2.5.1 and 2.6.0 is now available.
I had used the automatic upgrade plugin for my last upgrade and everything went very smoothly. This time, however, I was unable to log into the admin console after completing the upgrade.

It seems that there is a browser cache issue, or perhaps something specific to Firefox 3. I tried using the lost password feature and received a magic URL via email, but this also failed to work. After finding this post during an initial google search, I tried getting to my site via Safari and that worked. Anyhow, perhaps this saves you some panic if you find yourself in the same situation.
Posted in null | 1 Comment »
June 14th, 2008
It seems like a lifetime ago that I developed the weaver package for caching code chunks in Sweave documents. The paper that I presented at the DSC 2007 has finally been published in Computational Statistics. The title is Caching Code Chunks in Dynamic Documents: The weaver package. Here’s the abstract:
Authoring dynamic documents can become tedious for authors when a document contains one or more time consuming code chunks and each edit requires reprocessing all of the document. We introduce the weaver package that allows computationally expensive code chunks to be cached in order to speed up the edit/process/review cycle for dynamic documents authored using the Sweave framework.
And here a link to an unofficial pdf and the weaver package.
Technorati Tags: Bioconductor, R
Posted in Bioconductor, R | No Comments »
April 13th, 2008
In order to exercise a RESTful web service I’ve been working on, I wrote a quick Ruby script to hammer the service with large update requests. After uncovering and fixing a handful of concurrency issues in the server, I started seeing timeout errors in my test script when I sent numerous simultaneous updates. The errors look like:
/opt/local/lib/ruby/1.8/timeout.rb:54:in `rbuf_fill': execution expired (Timeout::Error)
from /opt/local/lib/ruby/1.8/timeout.rb:56:in `timeout'
from /opt/local/lib/ruby/1.8/timeout.rb:76:in `timeout'
from /opt/local/lib/ruby/1.8/net/protocol.rb:132:in `rbuf_fill'
from /opt/local/lib/ruby/1.8/net/protocol.rb:116:in `readuntil'
from /opt/local/lib/ruby/1.8/net/protocol.rb:126:in `readline'
from /opt/local/lib/ruby/1.8/net/http.rb:2017:in `read_status_line'
from /opt/local/lib/ruby/1.8/net/http.rb:2006:in `read_new'
from /opt/local/lib/ruby/1.8/net/http.rb:1047:in `request'
from /opt/local/lib/ruby/1.8/net/http.rb:1034:in `request'
from /opt/local/lib/ruby/1.8/net/http.rb:543:in `start'
from /opt/local/lib/ruby/1.8/net/http.rb:1032:in `request'
from /opt/local/lib/ruby/1.8/net/http.rb:842:in `post'
from ./rndsender.rb:21:in `post_update'
from ./rndsender.rb:76:in `main'
from ./rndsender.rb:80
Adding a rescue as shown below allows you to handle the timeout error:
def post_update(path, payload)
http = Net::HTTP.new(@host, @port)
res = http.post(path, payload, {'Content-Type' =>; 'application/xml'})
case res
when Net::HTTPSuccess
puts "update posted"
else
res.error!
end
rescue Timeout::Error =>; e
puts "update timeout error"
end
After searching a bit on the web, I came across this post that had the magic incantation for adjusting the timeout in the Net::HTTP API. Here it is:
http = Net::HTTP.new(@host, @port)
http.read_timeout = 500
And in case you are interested in actually making use of the timeout, be warned! Read this in which you will learn that
Ruby’s Thread#raise, Thread#kill, and the timeout.rb standard library based on them are inherently broken and should not be used for any purpose. And by extension, net/protocol.rb and all the net/* libraries that use timeout.rb are also currently broken (but they can be fixed).
Technorati Tags: programming, Ruby
Posted in null | No Comments »