ClickAider
You are currently browsing the Bogle’s Blog weblog archives.

Hacking in Asterisk and Rails

Joe Heitzeberg is a former coworker of mine from Avogadro and Openwave and a great guy.

He has a new startup called Snapvine and an Oreilly article called Hacking in Asterisk and Rails, which you should definitely read if you’re interested in VOIP and/or Rails. They’ve created the open source framework ragi, which connects Rails and the open source PBX Asterisk.

Sri Lanka after the tsunami: one year later

I’m back in Sri Lanka one year after the tsunami of 2005. As always, being on the ground and reading the local papers gives a much better sense of what’s actually happening than anything in the international media. There are some interesting comparisons between what’s happened here and the response to Hurricane Katrina in the US.

Progress in rebuilding has been generally slow but also inconsistent. Tourism has almost completely recovered, but rebuiliding of fishing and individual homes has been much slower.

Building has been slowest in the hardest hit areas of the east the country, which is also the area of greatest political instability. In that region, only 50 or so houses have been rebuilt. In part, the slow pace of rebuilding has been the fault of well-intentioned by poorly thought out government responses soon after the initial crisis.

The government established a buffer zone of between 100 and 200 meters (200 in the east) where building was no longer permitted, promising to relocate people in that buffer zone to new homes elsewhere. Oddly, the buffer zone applies to homes but not hotels.

This plan utterly failed to take into account the time and expense of finding these homes, as well as the difficulties caused by moving people dependent on fishing so far inland. Uncertainty about the buffer zone has been widely blamed for the slow pace of reconstruction; the government only recently relented on the buffer zone but has yet to draw up a clear alternative policy.

The initial emergency response to the tsunami was more effective than that of the US government to Katrina, but bureaucracies the world over revert to common form given a little breathing room.

Given the slow pace of rebuilding, there are many throughout the country who are without good homes, a plight that is also familiar to Katrina victims. It’s going to be a long term process to fix the issues. There is widespread scorn here for the parachute journalistswho appeared briefly at the moments of greatest death and sorrow and then disappeared for the next hotspot. There are, however, some journalist, relief agencies, and so forth who are here for the long haul.

There has apparently been progress in setting up a tsunami warning system. Effectively implemented, this will probably do a lot more to prevent loss of life than the buffer zone could, and at a far lower cost.

New Google Homepage Module: Local Search

I’ve written an local search module for the Google homepage using the new Homepage API.

You can think of this as the moral equivalent of Berry 411 for the Google home page– it uses AJAX to support quick local searches near your home or work, displaying the results directly on the home page.

To add it to your home page, just click “Add Content” on the Google homepage and enter the following URL:
http://www.thebogles.com/google/local_search.xml

Developers might be interested in the following techniques used in the module:

  • It fetches and reformats external content using Google’s _IG_FetchContent function. This is pretty interesting; it allows you to remix the web for the home page in the style of Greasemonkey, but without requiring any external plugins.
  • It uses client side cookies to remember user state (their current location.) Really, Google should provide this functionality in the API itself, but until then, this will do.

    Sadly, Google doesn’t do geocoding, so I wasn’t able to display an accurate miniature map of the currently selected address as I was hoping to. Hopefull they will add this functionality to their API.

  • Instant Rails

    The Rails folks have achieved great traction by creating a system that’s extremely easy to install and use. Continuing this trend, there’s now Instant Rails:

    Instant Rails is a one-stop Rails runtime solution containing Ruby, Rails, Apache, and MySQL, all preconfigured and ready to run. No installer, you simply drop it into the directory of your choice and run it. It does not modify your system environment.

    This initial release of Instant Rails is for Windows, but there are plans for ports to Linux, BSD, and OSX.

    Instant rails supports both Webrick and Apache+SCGI– I believe the latter gives better overall performance. Both allow you to make changes to your models, views, and controllers without restarting any services.

    The whole package, including language runtime, web server, database service, and web framework, is less than 38 MB. For good measure, you also get PHP and MySQLAdmin, a PHP based MySQL administration tool.

    This is a great challenge to Microsoft– the .NET runtime alone is over 22MB, never mind IIS and SQL Server, and forces you to reboot your machine to complete the installation.

    I should note that I had better luck with the preview5 edition than the preview7 edition. With the latter I could start the WEBrick but not the SCGI version of the server.

    Reduced Adwords Relevance and Revenue

    I’ve been having an interesting time experimenting with Google Adwords. (Given the, shall we say, “elite” size of my readership, I can assure you the goal is not revenue.)

    Adwords recently has taken a significant turn for the worse finding relevant, valuable ads for this blog’s content. If you look at the Google ads in the sidebar to the web page, you’ll notice that all of the ads are generic “Get a free blog” ads, whereas two weeks ago they were less generic and at least somewhat related to the blog content.

    The effect of this loss of relevance is clear in the numbers: the eCPM (effective cost per 1000 impressions) dropped almost 50% for the period of December 14-20 compared with December 7-13, from $1.04 to $0.58.

    I’ve seen other blog posts complaining about similar adwords relevance issues and they’ve resorted to some fairly hacky things like moving non-essential content to iframes, but it’s not clear that would work here, or what else a blog author could do to impact relevance.

    You might say that the issue is the range of topics covered here, but even the Berry 411 category is displaying ads for real estate and singles.

    It gets weirder. The innovation category displays job ads while the Jobster category display blogging ads, despite lots of posts about recruiting and jobs.

    Perhaps a clue is that the Berry 411 home page displays really relevant Blackberry ads. This could be due to the fact that the content is essentially static and singularly focused, which perhaps lets Adwords do a better job.

    In any event, it’s clear that’s lots of room for innovation and improvement in contextual advertising and targeting.

    CanvasGraph: Graphing in Javascript

    Creating graphs on web pages used to be a somewhat developer and processor intensive endeavor. With the canvas tag now supported by Firefox 1.5, Safari, and Opera, it’s now possible to create a web developer to create nice looking graphs about as easily as text.

    CanvasGraph is a “small simple javascript library that allows you to conveniently plot simple line, bar and pie charts using the new HTML Canvas Tag.”

    The author uses the library to good effect on the Liquidx stats page.

    (Here are screenshots and links to other Canvas applications.)

    Rubyful Soup: A scraping tool for Ruby

    Beautiful Soup is my favorite python parsing and scraping tool. I was delighted to discover that the author has created a Ruby port called Rubyful Soup

    1. Rubyful Soup won’t choke if you give it bad markup. It yields a parse tree that makes approximately as much sense as your original document. This is usually good enough to collect the data you need and then run away.
    2. Rubyful Soup provides a few simple methods and Ruby-like idioms for navigating and searching a parse tree: a toolkit for dissecting a document and extracting what you need. You don’t have to create a custom parser for each application. It’s more flexible and easier to learn than XPath.

    I enjoy the author’s sense of humor. This comment block is from the original:


    # Enterprise class names! It has come to our attention that some people
    # think the names of the Beautiful Soup parser classes are too silly
    # and “unprofessional” for use in enterprise screen-scraping. We feel
    # your pain! For such-minded folk, the Beautiful Soup Consortium And
    # All-Night Kosher Bakery recommends renaming this file to
    # “RobustParser.py” (or, in cases of extreme enterprisitude,
    # “RobustParserBeanInterface.class”) and using the following
    # enterprise-friendly class aliases:
    class RobustXMLParser(BeautifulStoneSoup):
    pass
    class RobustHTMLParser(BeautifulSoup):
    pass
    class RobustWackAssHTMLParser(ICantBelieveItsBeautifulSoup):
    pass
    class SimplifyingSOAPParser(BeautifulSOAP):
    pass

    Gmail mobile

    From Search Engine Watch:

    If you’ve got a web-enabled mobile phone and a Gmail account, you can now access your mail on the run…

    Gmail mobile detects the type of device you’re using, and formats your mail accordingly, meaning you’ll have a different view using a comparatively wide-screen Treo than a smaller Motorola handset. You’ll also be able to view attachments, including Office files and PDF documents.

    Another cool feature is “call to reply.” If you have saved the phone number of an email sender in your contacts list, you have the option to reply via email or by calling them on the phone when using Gmail mobile.

    To access Gmail mobile, just enter m.gmail.com on your mobile phone browser.

    Kafka-esque Nightmare in Travel and Identity

    Government identity tracking is a mess. Ken’s Baggage is to be avoided.

    Please don’t make the mistake we did– If you’re planning to travel internationally, be SURE to check your children’s passports expiration dates. A small child’s passport is only good for 5 years, not 10.

    As we were on our way to the airport, we discovered that our older daughther’s passport had expired. When we got to the airport, they of course wouldn’t let her on the plane–she and I would have to get a passport extension and travel on a latter flight.

    Complicating matters, the State Department won’t grant a passport extension for a minor without both parents present or a notarized statement from the missing parent. (The goal for this is understandable, to prevent one parent from abducting a child.)

    We had to quickly get a notarized statement from my wife before the plan left. Unfortunately, we were stymied by a combination of confusing governmental identity regulations and an extreme lack of helpfulness from the Seatac airport notary public (rel=nofollow,nopatronize)

    The utterly unsympathetic notary insisted that a current US passport was not a valid form of ID for a notary public because it lacks a “physical description” as required by Washington State Law. I checked– the washington State does in fact require a “physical description”, and is mute on the point of whether passports are valid– but, come on– The US State Department consent form specifically says that a Passport is a valid ID. The University of Washington notary is happy to take a passport.

    I even tried offering to bring back the drivers license from home later. No dice.

    So now my wife is going to have to do something complicated to remotely notarize a statement at the embassy at her destination, which requires 24+ hours travel to reach. Until that happens we’re stuck. Sigh. Like I said, check your passport expiration dates early.

    del.icio.us issu.es

    I’m seeing repeated errors from del.icio.us searches, perhaps the result of too much champagne after the Yahoo aquisition? :-)

    Suprisingly, stack traces are not disabled; looks like the del.icio.us uses Perl and Mason.

    Update: The site has been officially down for most of the afternoon and evening.

    System error
    error: Can’t call method “prepare” on an undefined value at /www/del.icio.us/comp/_comp/get_popular_tags line 28.
    context: …
    24: < %init>
    25:
    26: my $tags = $m->cache->get($tag);
    27: if (!defined $tags) {
    28:
    29: $tag_q ||= $dbh->prepare(
    30: ’select
    31: dst_tag, score
    32: from

    code stack: /www/del.icio.us/comp/_comp/get_popular_tags:28
    /www/del.icio.us/site/tag/dhandler:20
    /www/del.icio.us/site/autohandler:110
    raw error
    Can’t call method “prepare” on an undefined value at /www/del.icio.us/comp/_comp/get_popular_tags line 28.

    Trace begun at /usr/share/perl5/HTML/Mason/Exceptions.pm line 131
    HTML::Mason::Exceptions::rethrow_exception(’Can\’t call method “prepare” on an undefined value at /www/del.icio.us/comp/_comp/get_popular_tags line 28.^J’) called at /www/del.icio.us/comp/_comp/get_popular_tags line 28
    HTML::Mason::Commands::__ANON__(’dbh’, undef, ‘tag’, ‘perl+seattle’, ‘title’, ‘related tags’) called at /usr/share/perl5/HTML/Mason/Component.pm line 134
    HTML::Mason::Component::run(’HTML::Mason::Component: :FileBased=
    HASH(0×1da9f10)’, ‘dbh’, undef, ‘tag’, ‘perl+seattle’, ‘title’, ‘related tags’) called at /usr/share/perl5/HTML/Mason/Request.pm line 1074
    eval {…} at /usr/share/perl5/HTML/Mason/Request.pm line 1068