Monthly Archives: November 2006

BigDecimal equals might not be what you expect

import java.math.BigDecimal;   public class BigDecimalTest { public static void main(String[] args) { BigDecimal a = new BigDecimal("0"); BigDecimal b = new BigDecimal("0.0"); System.out.println(a.equals(b)); // => false System.out.println(a.compareTo(b) == 0); // => true } } BigDecimal in Java poses a small trap for the unwary, because its equals method doesn’t work how you might expect. […]

open source Java

Since the announcement last week, lots of people have been pondering over what the open source Java release will mean. As far as I can see, it’s almost entirely about improving acceptance in Linux. Distributions with strict restrictions on what licenses they can use, like Debian, will now be able to include Java. I use […]

Giggle 2 Search Caching

Finally, time for my third article about caching in my ‘Giggle 2’ project. The last part was about Fragment Caching, while this part is about my changes for Search Caching.To recap: the search page in the application presents some problems that are not entirely addressed by the ‘standard’ caching behaviour in Rails. Users can enter […]

testing socket timeouts

A while ago I wrote about a test server I had written to help test our systems against their external dependencies. And it has proved very useful. This week I was once again working on improvements to our external transaction handling, and while my test server was useful, we also wanted to test against the […]

patching up

I quietly deployed my Giggle 2 project into its production environment on Friday evening: and once my wife had joined in some testing, I then had a few bug fixes to make! First I had to sort out the Capistrano deployment script. Due to a misunderstanding on my part, it didn’t create the temporary directories […]

A brief guide to Screen

screen is a very useful utility if you work in a terminal window. It lets you open multiple “windows” within your terminal session, and lets you detach from a session and come back to it later. screen is installed as standard in some Linux distributions, but you might have to install a package for it. […]


Last night I tried to implement my idea for a ‘LRU File Store’ for Rails fragment caching. The idea was that it would extend the standard FileStore, and just override the read method so that it would ‘touch’ a file if it was read. This would make it easy for a cleanup script to find […]

default values for primitives

I’ve just spent a few hours trying to figure out a problem in our application. It turns out that the page I was looking at has a condition at the top where if the object ID in question is 0, it assumes that it hasn’t been set. This was a problem because I was trying […]