Testing JavaScript with QUnit for for Dummies, sorry, Java developers

Disclaimer: I’m no javascript expert so I may be am almost certainly talking a load of rubbish here. I was just looking for a unit testing framework for some javascript I’m writing (rather the the home-rolled framework I’ve out-grown) and came across QUnit. I’ve not tried any others so feel free to suggest alternatives. So far, it’s great and does everything I want and took me almost no time to learn....

January 11, 2012 · (Updated January 11, 2012) · 2 min · matt

The cheapest way to get a Samsung Galaxy S2 in the UK

If you’re a materialistic idiot like me, you’ll be interested in how you can get your hands on a disgustingly extravagant smartphone while parting with the least amount of cash possible. The best deal I found for the Galaxy S2 (by far) has been through Tesco: Free handset T-Mobile network 300 mins/300 texts 24 month contract Free delivery 500MB Data Booster + Unlimited Internet £20 of free apps available (through some T&Cs) £20....

December 7, 2011 · (Updated December 7, 2011) · 3 min · matt

Night 317 Wednesday 27th July – Climbing Fuji-san

This is it, our final adventure of the trip. We’ve ridden camels across the desert, boated up the Ganges, hiked along the Nepalese border, zip-lined across waterfalls, trodden through jungle with elephants, tandem-navigated vineyards, thrown ourselves out of a plane and off a cable-car, crashed a campervan, scuba-dived in the Great Barrier Reef, seen the Taj Mahal, the Petronas Towers, Angkor Wat & the Sydney Opera House. Now we’re off to climb 6km through the night to reach the summit of Mt Fuji, the highest mountain in Japan, in time for sunrise....

November 15, 2011 · (Updated November 15, 2011) · 11 min · karen

Day 317 Wednesday 27th July – Tokyo

This may say this blog post is for 27th July but I am trying to write it up on 7th November, 103 days after the occasion so please accept my apologies for the tediousness. I have no idea why Japan has taken me so long to write about and how I made time whilst travelling to write up the rest of the travels is a weird one. Anyone who reads this may think why the hell am I bothering when it was so long ago....

November 15, 2011 · (Updated November 15, 2011) · 4 min · karen

Day 316 Tuesday 26th July – Kyoto & Tokyo – Tokyo Dome baseball

Back to Tokyo again today. Our final trip on the Shinkansen and I think we have got our money’s worth. Based on Google maps we did a total of 1104 miles which is about ¥25 per mile (approx 20p). That’s cheaper than our old RX-8 (when we were materialistic and had money to spend on silly cars). In detail for anyone who likes this kind of stuff, like me, the distances were Tokyo –> Hiroshima (507 miles), Hiroshima –> Miyajima (16 miles), Miyajima –> Hiroshima (16 miles), Hiroshima –> Kyoto (224 miles), Kyoto –> Nara (26 miles), Nara –> Kyoto (26 miles), Kyoto –> Tokyo (289 miles)....

November 15, 2011 · (Updated November 15, 2011) · 4 min · karen

Simplify your API – Can Singletons be used for Good, not Evil?

I recently wrote an article about singletons in java. The only thing I wanted to cover was that if you really want a singleton, I recommend you use the enum pattern. This post was motivated after more interesting comments were raised about testability when you see the “static” keyword. When you type “static” a little alarm bell should ring in your head to warn you that there could be trouble ahead....

November 14, 2011 · (Updated November 14, 2011) · 5 min · matt

Day 315 Monday 25th July – Kyoto & Osaka – Ryoan-ji & Kinkaku-ji temples + Tenjin Matsuri festival

We hadn’t planned on going to Osaka as we didn’t think we would have enough time but the guy at the hostel mentioned there would be a big festival there today starting at 3pm so we felt we should go and have a look. The thing is we had also been recommended some other temples in Kyoto and tomorrow we’re off back to Tokyo so we had to get up early to get it all in....

October 28, 2011 · (Updated October 28, 2011) · 6 min · karen

Bug with JQuery validation error messages showing tooltip text

I had the following html in my form: <label for="email-input">Email</label> &lt;input id="email-input" type="text" title="Don't worry, your email will not be displayed on the website or given to anyone else. We hate spam too." /> Nothing complicated there I hope. I had the help text set in the title attribute of the input which I styled with the lovely qTip to make it look nice. I validated my entry using the jQuery validation plugin which also works well....

October 28, 2011&nbsp;·&nbsp;(Updated October 28, 2011)&nbsp;·&nbsp;1 min&nbsp;·&nbsp;matt

How to enable Offline Google Docs for Google Apps users

Do you still not have the offline option for Google Docs? If you’re a Google Apps user, then your apps administrator has to enable it first: Log in to the Google Apps control panel at https://www.google.com/a/your_domain.com (replace _your_domain.com_with your actual domain name). From the menu bar at the top of the page, click Settings. In the left menu, click Docs. Select the Allow users to enable offline docs check box. Click Save changes....

October 26, 2011&nbsp;·&nbsp;(Updated October 26, 2011)&nbsp;·&nbsp;1 min&nbsp;·&nbsp;matt

How to write Singletons in java

Singletons get a pretty bad press. Often described as an “anti-pattern”. I think it’s a little unfair since I find them pretty useful in several situations. However, the reason they can be bad is important to understand: Making a class a singleton can make it difficult to test its clients, as it’s impossible to substitute a mock implementation for a singleton unless it implements an interface that serves as its type....

October 26, 2011&nbsp;·&nbsp;(Updated October 26, 2011)&nbsp;·&nbsp;3 min&nbsp;·&nbsp;matt