Be Careful with Dates

The year 2000 came and went, and the world went on.  There were no horrific date rollover bugs, despite all the press.  However, that doesn't mean that date rollover issues do not exist.

I just debugged a date rollover issue.  It manifested as follows:

Our application worked fine in our local environment (of course), but when we deployed to a customer's server, the cookies didn't work.  We took a look at the HTTP Headers using Chrome, and everything seemed fine.  But still they didn't work.

However, when I took a close look at the headers in our test environment and the server environment, the issue jumped right out at me.

Here was the header from our local environment:

Set-Cookie:prop1=value1;Path=/ourapp;Expires=Mon, 10-Jun-2080 00:13:42 GMT

And on the customer's server:

et-Cookie:prop1=value1; Expires=Sun, 09-Jun-80 23:59:24 GMT; Path=/ourapp

Do you see it?  It is rather obvious.

It is a date roll-over issue.

The problem was caused when we set the cookie expiration date to Integer.MAX_VALUE.  This resulted in a date some time in 2080.  In our local environment, Jetty handles this properly and uses a long date format for the year.

However, the production server uses IBM WebSphere, and it takes a short cut.  It simply renders 2080 as 80.

So the browser sees the date and discards it as expired.  Apparently it doesn't use the 'context clue' of Sun to determine which century the date is in...

By setting a realistic expiration date for the cookie, it works just fine.

We were distracted for a bit by IBM WebSphere adding: Cache-Control:no-cache="set-cookie, set-cookie2"  However in the end that seems to be unrelated.

Hope this can help someone else.

Investing in Electronics

In a fast moving marketplace like Consumer Electronics, where your newest cellphone is out of date within a year and ancient after two, I thought it would be worthwhile celebrating some of the electronics that have served me well year after year.

Some of these are great investments because they are in a category that evolves more slowly.  Others are examples where buying quality really pays off.

Printers

First, while it is no longer with me, I want to celebrate again my HP 4L Laser Printer.  I finally retired the printer in 2008 after 14 years of great service.  I wrote about its retirement here.



The HP 4L was replaced by a Dell 1320c, with a wired network connection.  It has served well for 4 years now, and will hopefully continue for another 10.  It was more expensive then an ink jet, but if it continues to serve it will be well worth it.

Audio/Video Receivers

I still own and actively use ever receiver I've purchased since I started college, over 18 years ago.  The oldest receiver is the Pioneer VSX-D503S.

 
While it no longer has the features to be a primary Home Theatre Receiver, its amplifier still works great.  It now powers the outdoor speakers by my patio.

It was replaced in my Home Theatre setup by a Yamaha RX-V992 in 1998.
With Dolby Digital Decoding, and multiple digital audio inputs, this receiver has stayed relevant in my system for the last 14 years, and is still my primary A/V Receiver.

Network Attached Storage

Finally, my ReadyNAS NV+ has been a great purchase and constant workhorse for me.  
Purchased in 2007, it is relatively young compared to the previous two examples, but for a computer accessory, it is ancient.

At its base, it provides access to a set of RAID drives over the network.  But it also has a rich eco-system of software add-ons, and has been well maintained by ReadyNAS (now Netgear).  With SSH access, it is really a small linux box, which in addition to providing file hosting also serves as my DynDNS client, linux shell access, SVN server, and occasional Bit Torrent client.  At the time it replaced a full 'desktop' linux server, and I've never looked back.  While I did have to replace the power supply last year, it has worked flawlessly otherwise, and I'm happy to upgrade a power supply every 4 years if it keeps working great.

Keys To Longevity

What are the keys to finding great electronic investments?  First, the Printer and A/V Receiver categories are places where the core technology isn't evolving that quickly.  In areas like these, I think it makes sense to spend the additional money up front for a quality, 'top of the line' product that will last.  If you buy 'as much receiver as you can afford', it will likely last you a long time.

Second, you need to be willing to augment them with accessories.  While my receiver has several digital inputs, it didn't always have the right mix.  I had to add a $30 Optical to Coax digital audio convert to connect up a new component.  But a $30 accessory to keep a (original cost) $999 receiver working is a no-brainer.

For my Dell 1320c printer, it has wired internet but no wireless.  But again, with the purchase of a wireless adapter, I was able to extend the life of the printer.

Third, flexibility extends a components life.  By purchasing a receiver with a lot of inputs, it was able to continue to provide value over time.  With the ReadyNAS NV+, I was able to evolve the features it provided, reducing the need to 'upgrade' to something newer.

And finally, buy quality.  At the time, there were less expensive options for each of these purchases.  But buy spending a bit more for a workhorse device, I saved money in the long run.

Rapids Pre-Game Warm-up

I got to sit on the bench and watch the Rapids pre-game warm-up on Saturday (April 26) for the game against Chivas USA. I took some pictures of the team warming up. You can see the full set here. Below are some of the highlights.