Recommendations for Australian Contractor service companies?

I’m currently employed as a contractor, which means I need to have my own company (I operate as a sole trader). For a variety of reasons this sucks, and I’m interested in any recommendations for companies which act as contractor shell companies (I’m not sure what the proper terminology is). What I’m looking for is a company which employs me as an employee, and the company I actually work for pays my contract rate to. Then the shell company handles all the tax obligations, etc.

I’ve heard of a few companies in Australia which do this, but the only one I remembered to save is Entity Solutions. Anyone got any other recommendations (or experience with them)?

Firefox accessibility tool for checking secure sites

I’d previously mentioned that we was looking for a XUL programmer at work. Fortunately, we found someone who – while he didn’t know XUL – knew enough Javascript to be able to pick it up.

I’ve now been able to do a screencast of the project we were working on – a Firefox plugin for checking accessibility for sites which require a login – which is pretty cool if you are a web developer and care about accessibility. More details on my work blog.

Tomcat XML error

Getting this error in Tomcat?

java.lang.NoSuchMethodError: org.w3c.dom.Node.getTextContent()Ljava/lang/String;

There’s a good chance you installed Tomcat with the JDK 1.4 Compatibility package and are now running under JDK 5.

To fix it, delete xercesImpl.jar, xml-apis.jar and xalan.jar from $CATALINA_HOME\common\endorsed\

Desktop Tower Defense Strategies

Somewhat to my surprise, it seems that more people want to read about Desktop Tower Defense than they do about anything else I’ve written. Over the last few days roughly 40% of the traffic to this blog has been to my previous post on DTD.

While I’m a long way from an excellent player, I’ve developed my strategies to the point where I’m consistently scoring just below 6000 points.

My first tip is that it’s a mistake to try and build a really long maze. When I started playing I tried to make the longest maze possible, covering the board with towers. That’s a mistake because you just can’t get the firepower you need to stop the creeps on higher levels. Instead, concentrate on upgrading towers in the center of the board. I find its better to upgrade a couple of towers to the maximum level, a fair few to medium levels, but I leave plenty untouched. I usually aim to have two Squirt Towers upgraded to Typhoon Towers separated by a Bash Tower.

My second tip is to use Swarm Towers. For a while I tried to avoid that, and thought that I should be able to deal with flying creeps just using Squirt Towers. It might be possible, but I sure haven’t got it to work. One problem with the Squirt Tower only strategy is that typically they are also dealing with other creeps at the same time the flying creeps need to be shot down. I’ve found that three appropriately upgraded Swarm Towers give enough support to my existing Squirt Towers to enable me to shoot down all flying creeps.

My final tip it to be aggressive in the use of the “Send next level” button. It’s pretty easy to pick up 500+ points like this.

I think these three tips are the difference between scoring 3500 and scoring 5900+. If I had to guess I’d say the first tip is worth over 1000 points, and the second two are worth roughly 500 points each.

So there you go – Nick’s quick Desktop Tower Defense Strategy guide. Feel free to add your own tips here, and to add your scores to the “badmagicnumber” group

Performance monitoring with Google Webmaster Tools

So I was recently involved in some performance tuning for a fairly large Australian website. One of the problems with performance tuning is that typically there’s no historical metrics to compare any changes against.

Fortunately, Google records this infomation as part of their crawl, and if you have signed to use the Google Webmaster Tools you can see this data.

In our case, this was very useful, because we were able to demonstrate a pretty significant improvement (download time (ms) vs Date):

Download Times

(year, I know – I’m still not really happy with that performance either, but there are some infrastructure problems which are proving difficult to work around….)

My problem with Guice

I went to a presentation at my local Java User’s Group last Monday on Guice. I’m a long time Spring user (and fan), so I was interested to see what benefits it had over Spring.

I came away with the impression that Guice looks pretty interesting, but its main benefit over Spring is the lack of XML. That’s okay I guess (although I personally think the case against XML is often overstated). I certainly wouldn’t be opposed to using Guice in a project based on what I saw – except for one thing….

My big issue with Guice is the fact that it appears to be invasive. Based on the presentation I saw it seemed that you need to instrument your code with @Inject annotation for the dependency resolver to provide that dependency. That’s fine in your application code, but it means wrappers seem to be required for third party libraries. However, there are some hints from the documentation that this isn’t the case (‘Observe the Java type and the optional “binding annotation” of the element to be injected‘). OTOH, ‘sometimes you can’t use annotations, and you need to manually wire up an object (a 3rd party component for example). When this comes up, you write a custom provider‘ (See http://code.google.com/p/google-guice/wiki/SpringComparison). That’s kind of confusing, and something I’ll need to investigate more.

All in all – an interesting option, and one that certainly replaces PicoContainer as the best code-centric dependency injection container.

DWR Callback closures inside loops

I’ve been doing a fair bit of Javascript lately. Like anytime I learn a new language I look back at code I wrote a week ago and thing OMG… what was I thinking!?

One useful thing I learnt today was how to use the DWR closure callback pattern inside a loop.

My original code looked like this:


var taggedLinks = $$(".taggedlink");

for(var i=0; i < taggedlinks.length; i++) {
	RatingApi.getRating(taggedLinks[i].href, {
		callback: function(data) {
			displayRating(data, taggedLinks[i]);
		}
	});
}

Where RatingApi.getRating(..) is a DWR AJAX call. It’s fairly clear what the problem is: the displayRating function is called when RatingApi.getRating returns. Obviously the value of i will be not what was expected.

The solution looks like this (thanks Ben!):


var taggedLinks = $$(".taggedlink");

for(var i=0; i < taggedlinks.length; i++) {
	var remoteCall = {
		index : i,
		callback: function(data) {
			displayRating(data, taggedLinks[this.index]);
		}
	};	

	RatingApi.getRating(taggedLinks[i].href, remoteCall);
}