Archive for October, 2004

Cycling toys

Wednesday, October 27th, 2004

The weather in Canberra is improving, so I’m running out of excuses to not be on my bike. To give me added incentive, I’m spending hard-earned money on cycling “stuff”!

There is a planned purchase of a new mountain bike coming up – exciting stuff – stay tuned!

In the meantime, I’ve bought a CamelBak – for those who don’t know these are backpacks, typically designed with cyclists in mind that also include a water reservoir, with a drinking tube. I’ve taken it on one short ride, and wow! So much better than your standard drink bottle – you can hold heaps more for a start, but more importantly, you can grab a drink whenever, even when powering up a steep hill, picking your way between gravel, rocks and loose sand.

With a waterbottle, you’d be stuck waiting till you got to an “easy bit” at the top before you could slake your thirst, plus your water bottle would have that tasty flavour of dust ;)

24 Hour Mont

Sunday, October 10th, 2004

Saw the start of the 24 Hour Mont yesterday, and it was great! Apparently something like 2000 riders in around 600 teams.

For those who aren’t across it, the event runs for 24 hours, with the idea being to do as many laps as you can. Obviously, the bigger the team you’re in, the easier – you get more of a break between laps.

And yes, there are some people who join up in a team of 1. Hats off to you peoples!

Its certainly a pretty inspiring sight. The next day I hopped straight on my MTB and did some checking out of Majura Pines. Maybe next year, I’ll get off my butt, and go in the Mont myself – assuming I can find a team of 50 odd people ;)

Check out the start of the event:

Start of the 24 Hr Mont

JRobin – a quick and easy graphing tool

Tuesday, October 5th, 2004

So, finally got around to playing with JRobin, and I’m pretty impressed. To those who don’t know, JRobin is a re-implementation of RRDTool, a data storing and graphing utility, in pure Java (The original is your standard configure, make, make install C jobby).

Anyone who has worked in Network Management has almost certainly encountered RRDTool – its a nice generic tool to store arbitrary numeric data without having to worry about files growing without bound, due to its trick of being able to aggregate data as time goes by. Because of its command line interface, it can be grafted into any little sysadmin script to produce graphs on pretty much any aspect of a system.

I’ve been a big user of it in the past, mainly with Perl. RRDTool comes with Perl bindings which makes it pretty convenient. Similar bindings have existed for Java, but the need to manually compile up RRDTool for your particular platform has detracted somewhat from the run-anywhere Java thing!

JRobin is a re-implementation of RRDTool in pure java. So, bundle the JAR up and it should just work, no matter where your application runs.

I’ve just hacked together a quick app that reads in a log file and produces a graph, and the process is pretty painless. Loading up my log file (of timestamp, value pairs) was done with the following:


while ((line = reader.readLine()) != null) {
StringTokenizer tokenizer = new StringTokenizer(line);
long time = Long.parseLong(tokenizer.nextToken());
double value = Double.parseDouble(tokenizer.nextToken());
Sample sample = db.createSample();
sample.setTime(time);
sample.setValue("temp", value);
sample.update();
}

And producing a JPanel containing a graph is even easier!


RrdGraphDef def = new RrdGraphDef();
def.setTimePeriod(Util.getTimestamp(2004,9,01), Util.getTimestamp(2004,10,4));
def.setVerticalLabel("Degrees");
def.setTitle("Computer Room temperature");
def.datasource("t", RRDFILENAME, "temp", "AVERAGE");
def.area("t", new Color(0xFF,0,0),"Temperature");
def.gprint("t", "AVERAGE","Avg temp: @3@r");
def.setLowerLimit(0L);
RrdGraph g = new RrdGraph(def);
JPanel p = g.getChartPanel();

Pretty straightforward, Huh?!

Now, if its graphs you’re after, bear in mind that JRobin is not designed to produce 101 different types of 3D, animated, translucent graphs – you get a basic line graph, and thats it (although its perfectly servicable, and not unattractive). If you want fancy graphs, you’re better of storing the data yourself and using JFreeChart.

One final little thing, in this already overly-long post. As someone who does a lot of Perl code (and is imbued with some of that culture), I’ve gotta say its refreshing to be able to produce my graph without a single Factory, or Delegate, or Proxy in sight. I mean, don’t get me wrong – I love my Design Patterns – but sometimes you just want to write code. You know what I mean? ;)

Kyoto looks like getting up

Friday, October 1st, 2004

So, it looks like it’s finally going to happen! ABC News Online is carrying the following story:

Kyoto supporters jubilant as Russia backs ratification. 01/10/2004. ABC News Online

On a personal note, I think its fantastic. I just can’t understand the attitude of those who say “The agreement’s not perfect because a) it doesn’t include developing countries, or b) it doesn’t go far enough, therefore we shouldn’t ratify it”. The key thing to me would seem to be it’s a start! There are no other agreements on the international table, and given how long Kyoto has taken to get to this stage, it doesn’t seem likely we’d see a radically different agreement get approved in the next 10 years. So, lets take what we can.

I also see from the above news story that next year talks begin to set the next range of targets, and to bring China and India on board, which goes a long way to resolving some of the Kyoto criticisms.

And on a final note, I’m hoping someone can explain the Australian Liberal Party’ stance on Kyoto. Near as I can understand it, it is “We won’t ratify the protocol, but we will meet our targets under the protocol”. Soooooo, we will go to all the effort to meet our targets but won’t sign the protocol which would allow us to benefit financially? You gotta admit, its seems like a strange approach. Unless, of course, there was no intention to meet our targets in the first place! But hey, I’m sure there’s a well-reasoned argument behind it all that I’m just not seeing…

And you never know, maybe the impending ratification will encourage a “change of heart”. Here’s hoping!