Archive for January, 2004

New Design 1.0 Comments Off

I’ve spent a bit of time trying to come up with a new design for this site, all using nice, clean, XHTML and CSS, and as part of this I’ve been trying to make the site look less blocky and have more rounded edges and stuff in the design. I’ve come to the conclusion that this really sucks. The suppport for CSS, especially layer 3, is still way too weak for this to work. So, back to the drawing board, but at least I produced a couple of reasonable icons that I can reause, ho hum.

Java Multiple Inheritance Comments Off

Can somebody answer this question for me please: why does this code not work?

1
2
3
4
5
6
7
8
9
10
11
12
13
interface FooNode {
	public FooNode getSelf();
}
class BarNode {
	public BarNode getSelf() {
		return this;
		}
}
class FooBarNode extends BarNode implements FooNode {
	public FooBarNode getSelf() {
		return this;
	}
}

As far as I can see it should be fine, since FooBarNode is a FooNode and also is a BarNode the compiler should have nothing to complain about. Of course it doesn’t work, and I can see that this is so from the language specification; but the question remains: why?

My complaint is really that this breaks the semantic model completely. What, in essence, is being said by the FooNode.getSelf() interface method is that it returns an object which conforms to the FooNode interface. Given that FooBarNode does conform to this interface it should be fine as a return type from this method.

I assume that there is some deep reason, probably to do with efficiency of the virtual machine, why the language behaves like this; but having seen some of the design decisions to come out of Sun’s Java group I wouldn’t be too surprised if it was just an accidental fuck up.

Swing Font Defaults Comments Off

Fonts in Java look as ugly as sin, we all know this. Now, if you’re writing your own app or have the source code then you can get around this by setting the rendering hints on your JComponents. But if you don’t have the code, or can’t alter it because, for example, it would invalidate a support contract, is there any way of telling swing to use antialiasing on fonts by default? I’m hoping that there is some magic value that I can just add to my swing.properties file and be done with it, but an hour of searching on the net hasn’t found out what it is.

Irrational Opinions Comments Off

What Charles Miller forgets is that the ability to hold irrational opinions is taught at an early age by a large number of schools in the states. That whole Creationism thing just cracks me up every time I hear somebody mention it (God given right Charles? What were you thinking when you wrote that!).

To answer Lonita in the comments who mentions the right to bear arms, that’s an irrational belief as well. My understanding is that you get to keep and bear arms in order to be able to defend yourself from the tyranny of the government; now, is that really a practical attitude to take in an age where arms capable of doing this must, of necessity, include tanks, aircraft, chemical and biological agents and so on?