Newer Entries » Subscribe to Latest Posts

23 Sep 2009

Empty or null String in Java

Posted by gavin. No Comments

It’s such a common bit of code that crops up everywhere. That familiar line:

if(var != null && var.length() > 0)

There are slight variations. Some use

if(var != null && !var.equals(""))

They’re all there to achieve the same purpose: check whether a String is null or empty.

I’ve always thought “there really should be a utility for this”, but written the code anyway. Today, when faced with repeating this pattern about 10 times, I finally decided to go and check the Apache Commons Lang javadoc and see if there was such a method. Unsurprisingly, there is, in StringUtils.

There’s actually a few:

  • isBlank(String)
  • isEmpty(String)
  • isNotBlank(String)
  • isNotEmpty(String)

Very handy.

  • Print
  • Add to favorites
  • Facebook
  • StumbleUpon
  • del.icio.us
  • FriendFeed
  • Twitter
  • Digg

22 Sep 2009

Symantec usability fail

Posted by gavin. No Comments

It seems that usability is a bit like buses.

On Sunday, I experienced the joys of Virgin Media’s website. Today, at work, I sat through a presentation of the results of a usability study on the product I work on. What surprised me were not the results of the study, but that our bad documentation and lack of usability seem to come as a shock to so many. Hopefully it will spur some improvement.

Finally, this evening Symantec Client Firewall popped up this handy dialogue

Symantec Usability Fail

Symantec Usability Fail

The path is very often a field which proves useful; it tells you where the file resides. “setup.exe” is a bit non-specific, and that information would have helped me arrive at a decision. No scrollbars, and no resize conspire to make this a thoroughly useless window.

  • Print
  • Add to favorites
  • Facebook
  • StumbleUpon
  • del.icio.us
  • FriendFeed
  • Twitter
  • Digg

20 Sep 2009

Virgin Media usability fail

Posted by gavin. No Comments

Looking at the time of the football this afternoon, I spotted that the match was on Sky. For a laugh, I thought I’d have a look to see how much adding sky to my Virgin Media account was (£24 for 1 channel, for reference).

Virgin have an online add-to-your package facility. First you enter your postcode, and then choose your number from a list. Pretty simple from a usability perspective, you’d think?

Virgin Media usability fail

Virgin Media usability fail

That took me far too long to find my number. I missed it on the first 2 scans through the list.

  • Print
  • Add to favorites
  • Facebook
  • StumbleUpon
  • del.icio.us
  • FriendFeed
  • Twitter
  • Digg

19 Sep 2009

Rediscovering old wallpaper

Posted by gavin. No Comments

I was recently browsing my deviantArt gallery, and looking at the old stuff I created during my Trillian skinning days.

I came across the TechNought wallpaper I made. It, of course, turned out nothing like I was intending. But in the end I was very happy with the result.


TechNought V1 by ~dreadnought on deviantART

And although I often look back at things I made years ago and am unimpressed, I still really like it, and am using it once more as my wallpaper. 1024×768 seems too small to me now though.

  • Print
  • Add to favorites
  • Facebook
  • StumbleUpon
  • del.icio.us
  • FriendFeed
  • Twitter
  • Digg

18 Sep 2009

Ocean Mist 2.0 and MapPress

Posted by gavin. No Comments

As part of building this site, I tried to do some google-map embedding.

I tried 2 separate WordPress plugins, MapPress and WP_GMaps2, and I could get neither to work.

After reading the comments on the Ocean Mist website, I found a link to this page which addressed a similar problem with FireStats and this theme.

The solution is fairly simple – it just involved adding

<? php wp_head(); ?>

To header.php

Guess it would apply to any WordPress plugin that tries to add stuff to <head>

I also had to add the following to the stylesheet to get the zoom slider and place markers to show correctly.

#content .mapp-div img {
    background-color: transparent;
}

  • Print
  • Add to favorites
  • Facebook
  • StumbleUpon
  • del.icio.us
  • FriendFeed
  • Twitter
  • Digg

18 Sep 2009

Wind of too much change

Posted by gavin. No Comments

As I often do when working on stuff, I like to crank out the youtube music videos to keep my spirits up.

Today, I ran across this

It’s just not quite the same

  • Print
  • Add to favorites
  • Facebook
  • StumbleUpon
  • del.icio.us
  • FriendFeed
  • Twitter
  • Digg

18 Sep 2009

Back from Scotland

Posted by gavin. No Comments

Photo of the bay in front of Strome castle

The bay in front of Strome castle

Back from the tour of Scotland 09.

This year, we stayed on the mainland, and headed along the west coast. We got all the way to Cape Wrath, then headed a little east before being forced to return.

Whilst on the holiday, we visited so many great places, I finally feel compelled to do that which I have been meaning to for a while; create this website and keep track of the places I go, the things I see/do etc etc.

So here it is. It will probably be slow going at first, but fingers crossed, eh.

  • Print
  • Add to favorites
  • Facebook
  • StumbleUpon
  • del.icio.us
  • FriendFeed
  • Twitter
  • Digg
  • Browse

    or
  • Latest Content

  • Gallery

    2008_0825Stanage0021 IMG_6804 2010_0102XmasAndNewYear0020 IMG_6734
  • Tags

  • RSS<img src="http://www.gavinwillingham.com/wp-content/plugins/twitter-widget-pro/twitter_logo_s.png" height="21" width="92" alt="twitter logo" />

  • Comments