Computers


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:

YYYY-MM-DDThh:mm:ss.sTZD

For example:

1997-07-16T19:20:30.45+01:00

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.

(more…)


Graphing the performance of sub-domains in Google Analytics

My currency conversion website coinmill.com 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.

(more…)


Installing a CUPS printer via the command line under Ubuntu

I try to script everything I can on Linux.  When I install something on my desktop, I like to be able to run a script to install the same thing on my laptop.  When a computer breaks, I like to be able to run all the scripts to have it set up again just the way that it was. Here is how I scripted the installation of my printer.

(more…)


Resetting Wireless Networking on Ubuntu without Rebooting

The wireless network on my laptop has always been unreliable.  When I open the lid of the laptop and the computer wakes up from sleep, there is a 10% chance that the wireless network won’t be able to connect.   In the past, the only thing that works in this situation is a full reboot of the laptop.

(more…)


Ubuntu Global Keybindings for Gnome (Quantal)

I recently re-installed Ubuntu on my desktop computer.  It was about 8 years since the previous full install.  I’d kept it up to date with latest Ubuntu upgrades.   I wanted to change the hard drive configuration and put most of the os on a solid state drive.  There was also a lot of cruft that I had installed over the years and a clean slate would get rid of tons of software I no longer use.

The re-install worked very well.   The most noticeable improvement was boot time.  Partly from the solid state drive and partly from the removal of all the extra software.  I didn’t lose much in the process.  I have a script that installs software that I use that isn’t included by default.  The script also tweaks a bunch of settings.  But, the one thing that I lost was my global key bindings.

(more…)


Nedit – A Text Editor for Linux with Some Killer Features

I’ve been using Nedit for at least 10 years as my primary text editor.     It has standard features for a programmer’s text editor:

  • Syntax highlighting
  • Line numbering
  • Brace matching

There are a few areas in which the authors put in a lot of attention to detail.  It outshines every other text editor that I’ve ever used in these areas.

(more…)


TripAdvisor’s Hotel Availability Comparison

Since I spent about six months of my professional life working on TripAdvisor’s hotel availability comparison feature, I thought a little writeup about it here would be appropriate. If you fill in the form over on the right you will be taken to a page on TripAdvisor that shows hotels that are available for the dates that you chose.

(more…)


Opening .jar Files

The jar file format is common for distributing programs and libraries that are written in Java. Jar stands for Java Archive. Your browser may download Java applets in a .jar file or you may get a .jar file that contains a Java application that needs to be run. The file format is also by Mozilla and Firefox as the format for XUL applications, plugins, and skins.

The jar file format is a container and compression file format. Each jar file compresses and contains other files. Jar files are very easy to open. There are many programs that will act as an opener for jar files. In fact, any program that can open zip files can open jar files. The jar format is identical to the zip file format.

(more…)