Thursday, 17 September 2009

Spot the deliberate mistake

Got caught out today doing some Jave code at work.

I thought I'd be a good boy and use Commons Lang utilities to implement toString(), hashCode() and equals(). Spot the mistake here:

public int hashCode() {
return new HashCodeBuilder(13, 73).append(field1).append(field2).hashCode();

Any ideas? Here's the corrected version:

public int hashCode() {
return new HashCodeBuilder(13, 73).append(field1).append(field2).toHashCode();

An easy mistake to make when using an IDE with auto-complete.

Luckily I was saved by my unit tests!

Monday, 20 April 2009

More Ubuntu progress

With regard to my previous post, I have recently upgraded to 9.04. I was finally getting too fed up with sound and display issues on 8.04 so upgraded to 8.10 (Intrepid), but found no improvements with the NVidia integration and sound on Skype. I took the plunge and went for the 9.04 release candidate. I have to say it is a massive improvement for me with instant out of the box dual monitor support and the sound stuff all works without having to install pulseaudio.

I need Windows less and less now and I feel the writing really is on the wall for Microsoft. This seems to be confirmed by the increasing amount of laptops for sale with Linux rather than Windows.

Happy days.

Sunday, 8 March 2009

Printing from Windows XP to a CUPS shared printer on Ubuntu

On the face of it, this task would seem to be very simple and there are various pages with instructions on how to set this up. Basically you configure CUPS to allow the local USB printer to be shared and then set up a new network printer on windows that has the address http://<hostname>:631/printers/<printername>. The problem is that, whilst this all seems to work OK, when you print, nothing seems to actually hit the printer. Nothing meaningful in the CUPS logs.

Lots of Googling brought me to this page.

The really critical part which makes things work is :

"Now, once you have that information, you can open a command prompt on
Windows, and type in the following command (all on one line, it is
wrapped here):

rundll32 printui.dll,PrintUIEntry /b "Printer on Ubuntu" /x /n
"blah" /if /f %windir%\inf\ntprint.inf /r
"http://<hostname>:631/printers/<printername>" /m "MS Publisher Imagesetter"

That command will install the MS Publisher Imagesetter printer driver
(which is a printer driver that uses PostScript, which is what CUPS
takes as input), and setup the printer spool on Windows. You can then
open the Printers control panel and set the printer as the default
printer, and you will be able to print to it."

Thursday, 5 February 2009

Igloo in Milton Keynes

The most snow I've seen at home in my lifetime!


Wednesday, 4 February 2009

Prince Caspian

My son Dylan got a Corn Snake for his 7th birthday. I made it's vivarium, but there is still quite a bit of kit to buy like a heat mat and thermostat.

Feeding time is once a week and is pretty amazing!


Monday, 5 January 2009

Day 14 - going home

Pack up for the drive to Miami airport via Naples and the Delnor-Wiggins state park, basically a car park for the stunning beach where we stopped for lunch in the 85 degree sun. Luck enough to see a wild Dolphin cruising by.

Highway 41 takes us through the everglades where, unfortunately, we do not have enough time to stop and go on an air boat.

Day 13 - Chill out last full day

Our last real holiday day was spent mainly on the very local beach, apart from a short drive around to get some present shopping and a meal in Clearwater Beach at Clear Sky Cafe, highly recommended, followed by a walk up Pier 60 to look at all the local jewellry stalls.

Day 12 - Clearwater Aquarium

Today we head to the Clearwater Aquarium for a great day out including a boat trip around the Clearwater Harbour and talks about Winter, the Dolphin without a tail.

Day 11 - goodbye Disney, hello Gulf coast

Today we pack up and leave Tuscana Apartments and take a 90 minute drive west via Tampa to Indian Rocks beach where we have a beach apartment booked for 3 nights at Sun 'n' Fun.

The apartment is pretty old by US standards dating from 1925, and to be honest, it shows and could do with some investment on internal fixtures and fittings. You can't however fault the location as Indian Rocks is a quite area between Clearwater Beach and St. Pete's beach on a very narrow strip of land barely wide enough for the road. The beach is just out the back and is fantastic white fine sand leading to the Gulf of Mexico sea, a haven for Dolphins, Pelicans etc.

After a quick play on the beach, we head off to explore nearby Clearwater Beach and make a plan for tomorrow before a meal out at nearby JD's, a very nice local restaurant.

Thursday, 1 January 2009

Day 10 - Epcot twice and New Years Eve fireworks

Yet another early start to get to Epcot for the 8am opening and a rush to get Fast-passes for Soarin'. We get a 9:15-10:15 time-slot which is pretty quick as it soon gets to be 5pm plus with a 3 hour wait for the main queue.
n and
Once we get on, after also going to "Living with the land" and "Circle of Life", it's pretty clear why the queues get so big so quickly. The ride has us flying over various sights of California including Yosemite and Lake Tahoe.

Once done, we leave for lunch at Ponderosa steak house, probably all that is wrong with American food! Then back to our pool for the afternoon in really lovely sunshine.

Early evening sees us heading back to Epcot as we luckily discover that the usual 9:30pm fireworks are re-sheduled to 7:30pm as it's New Years Eve, making them early enough for Robyn and Dylan. The whole place is packed out, but it's worth it as they're the best fireworks I've ever seen, and they do them every evening of the year!