Saturday, March 31, 2007

Progress of a sort

A long while ago I blogged about the state of the cyclepath where it crosses the M11.

Today, to my surprise, I found that the whole section of path, and more had been ripped out to the hard-core base.

Maybe, after coming on for 4 years, the problem is going to be fixed, sorta soon, like.

Friday, March 30, 2007

Standalone Jython — ImportError: no module named awt

I've spent probably about a day figuring out what's going on here, Google being no help whatsoever, so figure I might as well publish.

Scenario -- Jython 2.2b1, installed in standalone mode i.e. all of /Lib inside the jar, and cachedir being skipped.

Now this sort of code works with Jython launched from the jar in the standard install:



but with Jython.jar from the standalone the code gives

C:\jython2.2b1-standalone>java -jar jython.jar
Jython 2.2b1 on java1.6.0 (JIT: null)
Type "copyright", "credits" or "license" for more information.
>>> import java.awt
Traceback (innermost last):
  File "", line 1, in ?
ImportError: no module named awt
>>> ^Z

Hunting down the error message, it is raised in org.python.core.imp, ultimately from JavaImportHelper.tryAddPackage() failing. Meanwhile, from the other direction, doing

import sys
dir(sys)

gave me that sys has a packageManager attribute. And that has a makeJavaPackage method. This lives in org.python.core.PackageManager


So, that seemed worth giving a try. Like



And that, at last, worked.

Now, you might think it would be elegant to do something like



to allow for the cases where it would work anyway; but this doesn't work -- the branch is taken, but the conditional packaging doesn't seem to stick. However, it doesn't seem to matter if you always explicitly add the package as part of the initialisation, even when not strictly needed. So stick with the simple case. It's more Pythonic that way, after all.

Sunday, March 25, 2007

Spring again

Yesterday was pretty horrid -- dull, and in the afternoon, cold drizzle, unpleasant to cycle home from town in. It was an afternoon to retreat back to bed, with cat and laptop for warmth.

I slept in solidly this morning, even after settling down around 10pm last night, pretty much sleeping the clock round (even without figuring summer time into the equation).

Having covered the pond with bubblewrap last Sunday (ahead of sleet and frost), the warm and sunny weather meant it could be exposed again. As expected, the frogspawn was gone -- having been there since more than 3 weeks ago -- and I spotted a couple of tiny tadpoles.

Leaf buds are starting to burst now, so maybe real spring is here again.

Friday, March 23, 2007

And now for something completely different…

Late to the party, I know, but this year I finally got around to trying out Python, just for the heck of it. After all, working in a heavily Microsoft shop, the in thing in the day-job is .Net -- or C#, as it is usually known.

Which is where IronPython has come in very useful as a wedge issue. So far I've used it a lot in various build scripting applications -- it has been very useful for things like automating version number updates based on the check-in levels used to build. I now wonder why I've spent so long in the past grubbing around with extended .BAT and .CMD files to achieve what a few lines of Python will do.

There are joys in just being able to write version3 = '.'join(version.split('.')[0:3]) to turn a.b.c.d into a.b.c, as well as being able to just include by reference, rather than cut and paste, from other scripts -- like the whole getting the version information into the a.b.c.d string in the first place.

For the moment it's my current software infatuation, something I will use wherever the opportunity arises. Rather like I felt about Java ten years ago; though that language has now fallen from my favour.

[Now playing - Planet Rock]

Anime — Mushishi

This is one of the titles from about a year ago that I have been slowly savouring.

A sort of X-files in what might be Meiji Japan (mid 19th century), or might be some future that has returned to that state. Ginko is one of the wandering Mushi-shi — literally "bug masters" — who dispenses folk remedies for the afflictions caused by not quite living things that lurk under the surface of the waking world, or in odd corners — be they swamps travelling to the sea, back-to-front rainbows, or snails that crawl into inner ears where they can eat silence.

In mood, it is a “chill-out” sort of title. People talk; seasons pass; families grow, as Ginko wanders the land. There is no overarching plot, each episode is self contained — and may interleave with others. The episodes themselves are evocatively titled for the conundrum that will be encountered — things like One Night Bridge, The Dew Consuming Swarm, The Mountain-bearing Robe.

Very highly recommended, and a rare case of the anime bettering the manga it was drawn from —, colour, sound and movement are all sensitively used. I shall be interested to see how the live-action movie, which draws on the more human-interest episodes, like Ginko's origin story, will turn out.

Saturday, March 17, 2007

Milestones

Three years, 18,592 miles (5835 this year). And the first MOT and an oil-change on Monday.

Given the extra amount of driving I was doing last spring, when Karen was staying with friends, and I was going over for dinner about every other day; and then going on holiday a couple of times, I'm surprised it was less. All the cycling over the summer sure mounted up!

Friday, March 16, 2007

A taste of spring

A week of fine, mild, sunny weather has meant that I cycled to work every day this week -- I don't think I'll manage to do any earlier in the season than that (compare last year :) ).

On Wednesday, when we went out to the pub at lunchtime, it was warm enough in the sun to sit outside at one of the picnic tables to eat.

And now we're promised a plunge back to sleet and snow next week. :(

Sunday, March 11, 2007

Spring

The frogspawn I first noticed last Saturday has accumulated further over the week. The forsythia is now bursting its buds. And today was warm and sunny enough for wearing a T-shirt while hoeing the cow-parsley and mowing the lawn.

There is a lot of moss in the lawn this year -- not having done any treatment last year has brought it all back.

Saturday, March 03, 2007

Anime — Soukou no STRAIN

I don't as a rule go for mecha or space anime, but this title from Q4 '06 started with the advantage of being a short stand-alone series. And while it was not earth-shatteringly epic, it was a fun little ride, with some nods to realism, in the highly relativistic spaceflight and the time dilation effects.

It certainly grabbed my attention when at the end of the first episode, not only does everyone we've been introduced to (but the heroine) die; but her beloved brother has been revealed as the traitor who has killed them — and has managed to destroy the irreplaceable mimic-unit which allows her to pilot the top-grade mecha class (the STRAIN of the title).

That gives her 12 episodes to start again from zero, find and defeat her brother, and save the human race — while gaining (and losing) more colleagues by the way, being bullied by many of her colleagues and fending off the advances of others…

Friday, March 02, 2007

Spring approaches

Today was my first day cycling to work, in beautiful clear sunshine in the morning — though the cloud had come up by the time I headed home.

From now, it's down to the weather and other committments.