magpiebrain

Sam Newman's site, a Consultant at ThoughtWorks

Posts from the ‘Uncategorized’ category

I’ve been running a parallel feed produced by “FeedBurner”:http://www.feedburner.com/ for a few weeks now, and have been so impressed with the results that I’ve decided to replace my feed with the FeedBurner produced one. Anyone subscribing to my “feed”:http://www.magpiebrain.com/index.xml shouldn’t have to change anything – I’ve set up a redirect rule so you’ll get my new RSS feed complete with del.icio.us links spliced in, a “nice display”:http://feeds.feedburner.com/Magpiebrain of the feed if you load it in a browser (at least on IE – a Mozilla/Firefox XSLT issue spoils things a little), and it will even optimise the content for specific aggregators.

Teasers of the recent Batman film sent me scurrying off to re-read Frank Miller’s Dark Knight Returns, only to find that I couldn’t, well, find it. Sitting back (and scratching my chin in a position that I hope makes me look thoughtful, but I suspect makes me look like I’ve got a itchy beard) I wondered about what else I’d lost. A quick brainstorm later, and I had the following list:

# The Dark Knight Returns
# Muse’s Origin Of Symmetry
# Beat Takeshi’s Sonatine
# Fear and loathing in Las Vegas (Region 1 DVD)
# The tweezers from my Swiss Army Knife
# The desk-clip for my angle-poise lamp
# Dandy Warhol’s “You drive fast, I’ll do the drugs” T-Shirt. (I think my girlfriend threw this out)
# Black Books season 1 (DVD)
# An IKEA dressing gown, which I bought and never opened

If anybody finds any of this stuff, let me know will you? Alternatively, if you’ve lost anything give me a yell – I’ve got all kinds of crap sitting around that I have no idea how I got in the first place…

A laptop malfunction this week caused me to re-evaluate my backup strategy. I’ve decided against the “don’t back anything up” approach, in favour of the “backing things up is actually quite useful” approach. The laptop was fixed thanks to our helpful admin guy, however I’ve taken the hint.

The most important thing I had to consider when planning my back strategy is that I’m lazy – really lazy. If I have to even push a button to start a backup, chances are it isn’t going to get done very often. A quick poke around the hardware sites turned up the “Linksys Network Storage Link”:http://www.tomsnetworking.com/Reviews-155-ProdID-NSLU2-1.php (NSL). Simply put, the NSL lets you plug a couple of external USB drives in, and allows you network access via the wonders of Samba. The front end admin console lets you schedule backups of networked computers, which sounded right up my alley – now all I have to do is remember to leave my laptop turned on overnight (which is still asking a lot). I’ve ordered one from “EBuyer”:http://www.ebuyer.com along with a “Maxtor external drive”:http://tinyurl.com/2s3km, which should arrive next week. I’ll let you know how it goes.
Continue reading…

A pack of two Twinkies(R) has just landed on my desk. They’ll be my first. I’m thinking about hot-footing it over to a fish and chip shot and getting them deep fried…

Courtesy of Warren Ellis, via his blog “Die Puny Humans(Die Puny Humans – not work safe)”:http://www.diepunyhumans.com/ (in no way safe for work!):

“sure, buy yourself a cute little Apple. Then save yourself some time and money by throwing the fucking thing out of the window, going out again and getting yourself a proper bloody computer”

Thanks have to go out to Simon, who yet again as “uncovered a gem(Fail Fast)”:http://www.brunningonline.net/simon/blog/archives/001460.html of a post over at his blog. Mike Mason’s “Null is bad, hmm-kay?”:http://mikemason.ca/2004/07/03/#040NullIsBad makes the point that when creating new method skeletons (for example when auto-generating methods from tests) the default IDE behaviour is typically to do nothing (in the case of void returns) or return null. Even worse, when auto-generating a method with an array return type IDEA will return the following code:


public Object[] getSomeArray() {
  return new Object[0];
}

This can often result in problems tracking down why a test is failing (or even why normal code is failing) as the unimplemented method is being called, a null is being returned and passed on, and when an error does occur it can often happen quite some way from the original method call.

A better approach of course is to throw an exception from the auto-generated method body detailing why you shouldn’t be calling it. This is a simple matter in IDEA and I’m sure the other IDE’s out there. Flush with my new knowledge I mentioned this to a colleague by way of a helpful piece of advice, only to find he already did it. There is a lesson to be learnt there I’m sure…

The subject of testing abstract classes came up recently. Imagine the following scenario – I have a class @AbstractBob@ which provides an implementation of a method @callFred@. @ConcreteBob@ extends @AbstractBob@ and implements the required methods – at this stage it doesn’t override @callFred@. Now what would you test? There are several approaches I can think of:

# Just test the concrete class
# Test the methods defined in the abstract class by creating a stub implementation, then test the methods explicitly implemented in the concrete class but not those implemented in the abstract.
# Create an abstract @TestCase@ (or whatever – depends on your testing tool) which tests those methods implemented in the abstract class. Then, subclass for testing your concrete class
Continue reading…

Any initial impressions are that its very nice indeed. I uninstalled 0.8 before installing “as advised(Firefox 0.9 release notes)”:http://www.mozilla.org/products/firefox/releases/, and was a little disappointed to see that it lost my settings. This however was a minor inconvenience (most of my bookmarks are in “del.icio.us”:http://del.icio.us for example) – the extension manager is fantastic, and it was a breeze to reinstall my favourite “Web Developer”:http://update.mozilla.org/extensions/moreinfo.php?application=firefox&id=60&vid=63 extension (which has added even more useful features, such as improved CSS reports and a “page speed report”:http://www.websiteoptimization.com/cgi-bin/wso/wso.pl?url=http%3A//www.magpiebrain.com/. Now all I have to do is wait for the “Tab Browser Extension”:http://white.sakura.ne.jp/~piro/xul/_tabextensions.html.en to support the new API…