Skip to main content

Posts

Showing posts from June, 2009

Be careful writing hashCode() methods when using HashCodeBuilder

I've blogged in the past about using the Apache Commons EqualsBuilder and HashCodeBuilder to write simpler equals() & hashCode() methods . My colleague recently blogged about a potential pitfall when using this approach , I'll summarise his findings here: Be VERY careful when you ask the HashCodeBuilder to generate the resulting hashcode value: Make sure you call builder.toHashCode() rather than builder.hashCode() The first correctly generates a hashcode value based on the objects that you have added to the builder, the second gives you the hashcode of the builder object itself - definitely not the value you would be expecting (and would be a sure fire way to lose your objects in a Collection )... Technorati Tags: Java , Apache Commons , HashCodeBuilder , hashCode , Andrew Beacock

How to escape text when pasting into Eclipse (including XML)

When you paste text into Eclipse it does just that - places where the cursor is in it's full un-altered original form. This is fine most of the time apart from when you might want to copy a chunk of XML (or a similar large body of text). What you end up with in this case is the text pasted in with red lines everywhere because the text hasn't been properly escaped for Java code. To enable escaping of pasted text open the Preferences panel ('Window' menu -> 'Preferences...' option), then choose: 'Java' -> 'Editor' -> 'Typing' and tick the box which says "Escape text when pasting in a string literal": Now whenever you post in text which is broken over multiple lines, Eclipse will insert the relevant quotes of Java to make Eclipse happy. Technorati Tags: Java , Eclipse , Editor , Escaping Text , XML , Andrew Beacock

Summary of June's Manchester Spring User Group Meeting

I missed the first Manchester Spring User Group meeting back in April which I heard was excellent so I made sure I didn't miss June's meeting . The sessions (based at the University of Manchester Core Technology Facility - cool building BTW) were organised by Cake Solutions (in particular their MD Guy Remond) and it was Guy that introduced the evening and laid out the agenda. Just a quick note about the venue, it's a very new tidy building, the room was an excellent size (seating for 50+ people) and coffee (and cake!) were provided. Parking was free and immediately outside the building, just press the buzzer and mention the Spring User Group... The first talk was by Paul Sweby (of CapGemini ) entitled: Spring in Government - Improving System & Personal Performance Paul works on the HM Revenue & Customs website and started his talk by providing some pretty impressive statistics: around 40 million tax payers use the HMRC web site for various purposes. The sof

Improving slow wifi bandwidth performance on an Acer Aspire One

We've noticed over the past few days that it was taking a long time to download stuff on our Acer Aspire One . Tonight I found out that it was only slow when it was unplugged from the mains - so it's a power-saving 'feature'. I couldn't find any options within the power saving section of Windows control panel, so it was off to google for some help. Within seconds I found the perfect solution explained very clearly over on Peve's Blog . I'm not going to repeat his instructions as he explains it great already so head over there to read his post entitled Acer Aspire One Slow Wifi - Thanks Peve! Technorati Tags: Acer , Aspire One , Wifi , Apevere , Andrew Beacock

How to copy recorded TV programmes off your PVR (Humax 9200T)

We have had a Humax 9200T PVR for quite some time now and occasionally we have wanted a more portable copy (think DVD) of a particular programme that we have recorded. If you flip down the right-hand panel you will notice an unlabelled standard USB B socket . It's by the use of this socket that you can stream recorded programmes off the Humax and onto a PC ready for converting to a DVD (or just watching on the PC). Here's how you do it: Visit Humax's support site and download & install their rather old and flaky Media E-Linker software (Click the "Media E-Linker software (Version 2.5) download link). Get a regular USB lead with an 'A' type plug on one end, and a 'B' type plug on the other. Plug the 'B' end into the Humax, and the 'A' into any USB socket on your PC. Your PC should now 'find' the Humax and request to install the drivers, I let mine 'auto-search' and it found and installed the drivers just fine (I t

The Spring User Group comes back to Manchester on June 15th

Back in March I blogged about the first North West Spring User Group meeting . Well on the 15th June they are coming back to Manchester. I wasn't able to attend the last one but an old colleague Bill Comer attended the session . June's session is on "Grails eye for the Spring guy" by Russ Miles (MD of OpenCredo ). Russ has also blogged about the future talk over on his blog . It sounds good and I'm planning on attending this time so if you see me there come over and say hi! Technorati Tags: Java , Spring , Hibernate , Manchester , North West , Russ Miles , Andrew Beacock