28 May 2011 dan   » (Master)

Bullet time

Short bits

  • HTC have apparently reversed their policy on locking their phone bootloaders – i.e. in future, they say they won’t do it any more. I find it interesting that LWN have reported this as “The CEO of HTC has seemingly posted on Facebook that its phones will not be locked down” whereas every other report I’ve seen has assumed it’s real, and only LWN have thought to wonder if Facebook really is an official HTC communication channel. Anyway, if it does prove to be true (I hope so) I will be reversing my previous recommendation against buying their phones
  • Here is a real working example (indeed, the primary use case) for use of thin-prefork. This blog is already running on it, and as of Tuesday so will be $WORK. And then maybe I can get back to some actual work. Hurrah.
  • After finishing the thin-prefork integration I spent some time on Friday trying to sort out $WORK’s exception handling. The exception handling stuff in Sinatra is … kind of involved, and if you test it by inserting
    raise Exception, “Error happens here”
    into a route, you may spend quite a while wondering why it doesn’t seem to be working properly. I wanted Sinatra to pass all exceptions up to Rack where I could use Rack::MailExceptions to send me email: eventually by reading sinatra/base.rb for a while I find (1) that enable :raise_errors, perhaps contrary to its documentation, doesn’t raise an error if there’s a error stanza in the application which would catch it; (2) that the default Sinatra::Base class installs exactly such an error clause for the base Exception class. So you may want to change your test code to use StandardError or something instead.
  • Once having done that, you will then find that Rack::MailExceptions requires Tmail, which has trouble with Ruby 1.9, and then you will find that the mail it sends you is not laid in any order you might reasonably hope for – the errant URL is buried two thirds of the way down – and eventually you will decide that you might as well just copy the entire file into your own code and edit it for your requirements. Which is what I did. There’s a ticket to fix the Tmail dependency: apparently porting it to the newer Mail gem is a non-starter due to its needing active_support, but it appears that recent versions of Mail no longer need active_support anyway, so maybe that decision can now be revisited.

Syndicated 2011-05-28 20:41:16 from diary at Telent Netowrks

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!