Archive for January, 2003

Connected!

Saturday, January 4th, 2003

And seconds later from the last post, I am connected.

I turned on Network Authentication [Shared Mode], and it worked.

So the whole set of things needed was:

1) Change WEP key on network to fit inside 128-bit ASCII key format, ie) 20->7e.

2) Downgrade/upgrade the driver to the one on the Dell website. It has a lower version number than my current driver, but a more recent date. Odd.

3) For the hell of it, under the System->Hardware’s page for the wireless driver, set the Station ID and the Channel. This seems to help as Windows will start searching on this channel first.

4) Ensure Network Authentication mode is turned on.

I’m still using DHCP on the machine at the moment [I usually prefer to specify IP’s]. Just happy enough that it’s online.

XP breaks the law

Saturday, January 4th, 2003

After tweaking the driver for my wireless card [I think I actually downgraded to an older version], I finally got the Dell TrueMobile 1150 PC Card to admit there was a network there under XP. Indeed, with WEP turned off, and sitting near the router I can even connect now.

WEP turned on still screws it up, even though I have now got a key which works [you get a different type of icon when the WEP key is legal I _think_].

However, XP is rather aggressive. It keeps preferring to connect me to the linksys wireless network which apparantly my neighbour has next door. It doesn’t even seem to offer anyway for me to stop this happening. Obviously I’m not too impressed.

I seem to recall hearing comments about this type of thing before, so I doubt if it is surprise to anyone but me.

Decorator + Abstract = Mess

Saturday, January 4th, 2003

Ack. Conceptual problem:

I’ve grumbled about FilterOutputStream while playing with Commons IO’s development. It’s supposed to be for decorators, OutputStreams which filter to another OutputStream, but it also does some abstract work, redirecting some of the write methods to each other. ie) write(byte[]) maps to write(byte[],int,int), and both down to write(int) [I may have that topsy-turvy]. This can be a bit surprising. A decorator [or delegating] class should be true to its job and not do abstract pieces. However… wiith single-inheritence how do we then mix these two concepts?

Here’s my current setup. XmlWriter has three overloaded methods for writing the XmlVersion. writeXmlVersion(), writeXmlVersion(String,String) and writeXmlVersion(String,String,String). AbstractXmlWriter quite happily maps the shorter methods onto the longer one, with nulls being passed. DelegatingXmlWriter however implements XmlWriter and maps each one onto the method it delegates to. This means that when someone extends DelegatingXmlWriter, ie) PrettyPrintingXmlWriter [which adds a newline onto the end of the xml version, amongst other things] it has to override all three of the methods.

One solution is to have AbstractDelegatingXmlWriter, which repeats the code in AbstractXmlWriter. Another solution is to suggest multiple-inheritence would save the day [though as both would lead to the same interface at the top, I’m not sure if things would get painful]. Any others?

Abstract-helper is a good pattern. [I can’t think of the correct name].
Delegator is a good pattern [a Decorator that guarentees a truthful mapping].
But they don’t mix.

I think the solution is to trust the truthful-decorating concept and have each decorator goto the effort of mapping each method it has to accross.

Closing STDOUT

Saturday, January 4th, 2003

Thought I’d mention this, as I’d never really noticed this before.
Don’t do:

Writer writer = new OutputStreamWriter(System.out);
….
writer.close();

At least on Linux JDK 1.3.0, it seems to close your STDOUT too :)

Dependency Religion

Thursday, January 2nd, 2003

How do you know which library or framework to choose to use?

I imagine this is a common issue people have to face. Should we choose Tapestry or Velocity or …? Should we use Log4J, LogKit, commons-logging, Sun’s Log or …? Which Regexp should we use? Which IDE?

The meme I like to consider as the right one here is: “How much religion do you need to get to use it?”

Religion hits in a few ways. The first is, “How much do I have to believe/grokk to use this?”. The second is, “How much of my current set of beliefs still apply?”, thirdly there is, “What does this religion do for me?” and lastly there’s, “How transparent is this religion?”.

If you can find a library which doesn’t involve a new set of beliefs, merges with your existing beliefs and is transparent in that you can see it is easy to get into, and once you’re there you won’t be too deep in and lost, then it’s a good library.
Providing it does at least what you need to be done.

So, Avalon may involve subscribing to a framework of beliefs and a move to component oriented programming, but it’s one of the few that do the job.

Interfaces are a wonderful tool in Java, but to library/framework coders they’re also a big warning sign that the library/framework is becoming a religion. If the user HAS to implement Xxxx to get the benefits of the religion, a product is possibly too religious. If however they can get the catchy initial benefits without doing that, and then they can become a power-user or an optimised user by implementing, then it is a good religion, both in terms of marketing and in terms of the payback for user buy-in.

In other terms, I want my baby-steps to be easy and free but when I need to run I’m prepared to have to think.

I don’t know about you, but to me it makes a lot of sense to analogise my dependency analysis as a structured search for God(s).

OpenSource OPL

Wednesday, January 1st, 2003

EPOC/Psion have two major languages, OPLand Java.Symbian [makers of EPOC, part run by Psion] have announced news that OPL will become an open source project, over at the register.

netBook lives again

Wednesday, January 1st, 2003

The best machine I’ve ever owned is a Psion netBook. Psion recently released an update to the Symbian R5 OS [Symbian develop the OS, but device companies have to supply the hooks etc to the device] which amongst other things [Like the Opera browser I’m writing this on] includes wireless network support. So the Wireless card which Windows XP cannot handle is working fine on my PDA. netBooks rock. Psion are the Betamax of the PDA world. Their OSis still the best [although PocketXP and LinuxQT PDAs can now compete], they’ve always had a keyboard, and the netBook [Enterprise top of the range PDAIbought instead of a laptop] is a direct competitor to the smallest Sony VAIOs].