Producing W3C Datetime Format with Timezone in Java

W3C Datetime (also known as ISO 8601) is a standard machine readable way of formatting dates. In its most specific form, dates can be printed with time and time zone in this format:


For example:


It is not as easy to produce dates in this format in Java as it should be. I needed to format dates like this for creating an XML Sitemap file.


Graphing the performance of sub-domains in Google Analytics

My currency conversion website has a subdomain for each language.  It supports over 40 languages.  The entire domain is tracked in a single Google Analytics account.    I wanted to know which subdomains were performing best and which were performing worst, and how that was changing over time. (more…)

USB sound in Ubuntu – automatically selecting a USB audio device when it is plugged in

Ubuntu has started to support USB audio.    When I plug in a USB speaker or headset, it gets recognized and installed automatically.  However there are some bugs:

  • The USB sound device does not get selected automatically.   This is especially annoying for headphones.  When you plug in analog headphones, the sound automatically switches to them and the main speakers turn off.
  • The volume settings are turned way up for the device.  Ideally it would remember the volume settings from the last time the device was plugged in.
  • When the computer goes to sleep, the volume of usb devices gets turned way up on wake.

I discovered that I could address these shortcomings by creating a script.