This morning, I found out about a very useful jQuery function going by the unassuming name of data. This fantastic little beast creates a data store for an element, and lets you store just about anything in there.

One of the ways in which this can be used is to attach functions to an element, and using them when required. To demonstrate the usefulness of this feature, I wrote two versions of a simple validation system. In one, we use the data function to assign one or more validators to an input box [Example 1: using $(x).data()]. In the other, we iterate over the inputs and check them against validators as needed [Example 2: not using $(x).data()]. Read the full post

Generics in Java and C#

July 23, 2009 12:00 am Comments (2)

Today I was writing some interceptors in Java, and I wanted to be able to filter the input based on whether it implemented a given interface or otherwise. Class<?> exposes a very handy isAssignableFrom method for this, but it doesn’t look very nice, so I tried to go for something a bit neater, like:

   1: Feature.<TargetFeature>isImplementedBy(interceptedInstance);

Neat, and much more readable. I didn’t quite make it there, but got close enough for my purposes, and had some (very little) deeper knowledge of generics inflicted upon me for my sins.

Read the full post

Category Development

I’ve (belatedly) updated my iPhone 3g’s OS today. Just after the update, it started to heat up, and was not recharging no matter how long it was left on the charger. Restarting (hold down the home and the power buttons simultaneously for about 10s) seems to fix both issues.

First law of IT support – try restarting the bloody thing.

Category Other Stuff
Tags

Code reviews with NDepend

April 5, 2009 12:08 pm Comments (0)

Using NDepend to identify areas of interest in a code base.
Read the full post

Summary

An application that uses WMI to check for USB drives attached to a PC.

Read the full post

Category Development
Tags , ,

The people of the web are revolting against IE6! (at last). While many web developers and designers have been complaining about Internet Explorer 6 for ages, more people are now making a concerted effort to ease users away from this museum piece. There’s even a wiki about this worthy cause.

Simone Chiaretta wrote a great article about this campaign at CodeClimber, with instructions on including Vincent Hasselgård’s IE6 warning. Joe Levi also created a great variation of this to scare IE6 users with :)

Vive la revolution!

Category Development
Tags ,

How to create a sliding popup like the one used at SitePoint using jQuery.

Read the full post

Testing user interfaces is usually a pain in the butt. No matter how cool your UI is, it will often boil down to a brain-cell killing process clicking the same buttons over and over again. Thanks to the Geek Gods of .Net though, there are ways to automate this, and it’s not even that tough to do.

In this post, we’re going to use Automation peers to expose a button to a unit test, and have the test start the application, click the button, and confirm that the button does what it’s meant to do. We’re going to use MbUnit to write the test, and NBehave to make the tests nice and clear.

Read the full post

Category Development

Visual studio tends to create files that you don’t usually want to keep under source control, such as generated files, user option files, and so on. To avoid having to clean up every time you try to Add files, you can tell TortoiseSVN to ignore certain file name patterns. The following is what I usually use:

**/bin bin **/obj obj *.suo

You can set these patterns in the “Global ignore pattern” text box in the main screen of the TortoiseSVN settings dialog.

Category Development
Tags , ,

Janko at Warpspeed posted four very common (and very wrong) statements about UI and UX design in web applications. And sadly, they’re equally applicable to some desktop applications developed for non-public consumption.

Category Design