All entries for June 2005

June 30, 2005

Karate graduation tonight :)

So I somehow managed to pass my grading with heatstroke to boot ;)

Got to go and pick up my nice new shiny yellow (or buttercup :)) belt.

BTW; check this out: link

June 27, 2005

Karate is going well ;)

So the academy I train at (EastWest karate in Leicester) has an unusual grading system; you basically grade every 2 months up to your brown belt, and then spend (I think) another year or so going from brown to black.

Works quite well because you get a sense of achievement very early on.

They also offer different programmes, including a "Certified Instructor Training" which develops you as an instructor. They do not believe that being a black belt + above qualifies you to instruct, rather instructing has it's own set of skills, and needs to be learnt alongside the "technical" aspects, which I am also on.

Anyways, the other day (Wednesday) the senior instructor singled me and another guy who I train with out and invited us onto the advanced grading cycle where you grade every month instead of every two! Yeah!

He did state that I would be expected to keep up my committment of 4 days (1 or 2 hour) training sessions a week. Fine I said, then I became ill (heat stroke) and missed Thursday and Saturday sessions :(

Wouldn't be so bad but I have to grade tonight and haven't done any preperation :( Got to pull something out of the bag as I have to justify my invitation on to the advanced grading programme.


Ladder 49; excellent film

Writing about web page

Also saw Ladder49 over the weekend.

Brilliant. Pretty much got everything; action, love (ah :)), tension etc.

Everyone should watch it, I love action movies and thought it was brilliant; my wife loves sloppy movies, and she loved it as well :)

Kung–fu histle: hmmmmm

Writing about web page

Went to see Kung-fu Hustle at the weekend with my (martial arts are so boring) wife :)

Didn't quite know what to make of it. I was expecting it to be a huge wind up of old martial arts films, but it wasn't. Not sure what it was really :) There were certainly some rib tickling moments, but then there was also some really gory, serious moments.

One thing is for sure; people will either love it or hate it. Probably the most unusual movie I have seen for a while.

June 09, 2005

Cool thing in eclipse!

So if you right click on a Unit Test in eclipse you can run it in the embedded test runner.

But I didn't realise that you can also click on a package and that will run all the unit tests in that package.

So, no more trying to figure out which unit test failed in ant and running one-by-one in eclipse!

Just right click on your unit-test package and run all your unit tests in eclipse :)

Hibernate one–to–one problems :(

So I have an object Content which has a ContentFetcher (strategy).

Ideally I would like to implement ContentFetcher as a dependant object of Content, but I can't for the following reasons:

– a Content's contentFetcher can change

– dependent objects cannot be polymorphic in hibernate

So I map it as a one-to-one (Content to ContentFetcher) with the primary key of ContentFetcher being the same as the primary key of Content.

Unfortunately when I try and assign a new ContentFetcher, Hibernate explodes because there are two instances of ContentFetcher with the same id, the old one and the new one. There seems to be no way to indicate to Hibernate (without explictly calling session.delete which I haven't tried) to ignore the old content.

In the end I mapped it as a many-to-one with a foreign key in Content :(

Oh well.

June 08, 2005

Interesting problem editing a "dynamic" object model

So I have the following object model:

ObjectA has an instance of ObjectB

There are multiple implementations of ObjectB, all with different properties.

How do you handle the binding when the implementation of ObjectB needs to be determined at run time?

I ended up having a Form which contains accessors for all possible values of all the implementations of ObjectB and an apply() method. Form is constructed with an instance of Object A and initialises itself based on the current implementation of ObjectB. Page is rendered, when introspected all values are introspected onto FormA, or FormA.getObjectA, and after introspection FormA.apply, and ObjectA = FormA.getObjectA is called.

All validators etc. work directly on ObjectA, not FormA, but the validators know how to validate the different implementations of ObjectB.

Not particularly nice or elegant, but how else can we do it?

I could implement my own Binder, but that doesn't help the problem of rendering the page, with all possible alternate properties. You cannot bind to attributes that don't exist, and I don't want chunks of jsp that are conditional on the implementation of ObjectB.

An example of what I am wittering on about is say you have a person who has a mode of transport. One implementation of transport is train, with platform, station, time etc. Another implementation is Car with make, model, year etc.

The page that edits Person allows you to specify the mode of transport.

June 06, 2005

Saw Sin City. Excellent! Go and see it!

Writing about web page

Went to see Sin City at the weekend. Unfortunately the Odeon only had "Premier" seats available which were twice as expensive as normal, but what the heck.

Turns out the premier seats actually involve your own dedicated loung with complimentary cheese and crackers, and a little box of chocolate including "waiter" service for your drinks etc. The permier seats are actually fanstastic, about the size of a two seater sofa for two people with arm rests and drinks tables either side.

Anyway, the film (Sin City) was absolutely fantastic. Quite complicated to follow, but the atmosphere, the casting, the photography (cinemaography?) was just brilliant.

5 out of 5 stars from me.

Be warned though, it is a bit gory ;)

June 03, 2005

Car drivers; should be banned from the road ;)

Why is that some car drivers still think they are faster than motorbikes?

Why, when waiting at a roundabout and they see a motorbike leaned over, indicating it is coming off at the next exit do they suddenly decide that in the fraction of a second it takes for the bike to exit the roundabout, they, in their ton of slowass metal can safely make it across?


This happened twice today! Do you have any idea how difficult it is to emergency brake when leaned over about to flip to the other side to exit the roundabout!

While I am ranting; what is the attraction of sitting in the outside lane on an empty dual carriage way? I don't get it. Why? As a rule, I never flash or undertake because it just winds the other person up and is never worth it. But when you are in a hurry and there are no right hand turns for about a mile, no other traffic that you can see and some plonker just sits in their shiny new BMW (usually) in the right hand lane refusing to move. What are you supposed to do?

Also; what is it about the typical middle aged salesman type driver who just cannot stick to their lane? They should rename *round*abouts to *straight*abouts. Again, I tend to religiously stick to my lane, and if anyone cuts me up, I tend to stick to my guns. I have only had to bang one window so far, most behave when you honk and glare :)

And inidicators! Why is it so hard to indicate? Is there a certain part of the brain that is responsible for indicating that suddenly sleeps when you get in a car? The number of times idiots just drift across lanes! Maybe 5 times in my 12 years I have come within inches of having a fatal accident because monkeys join the road I am on from a slip road without checking their shoulder as if they have right of way. Some even join and drift immediately to the outside lane, despite their being no need!


Ok, thats enough of a rant for today, and yes I realise that there are some insane motorbike riders who are just as bad, but honestly they are the exception. Stupidity, or rather laziness seems to be the norm for car drivers.

Ironically, you cannot ride a motorbike that badly because you die quickly. If you drive into someone's lane in a car, a quick swerve in a car is easy, doing the same thing on a bike requires a lot more effort and skill. There is no concept of balance in a car, on a bike it is a very different story.

June 02, 2005


Follow-up to My initial impressions from Colin's blog

So I worked around the request attributes problem by registering a FlowExecutionListener with the ServletFlowManager.

The listener actually does the following:

—— code ——
public void sessionStarting(final RequestContext context, final State startState, final Map input) {

public void requestSubmitted(final RequestContext context) {

private void copyAttributes(final RequestContext context) {
ServletRequest request = ((ServletEvent)context.getSourceEvent()).getRequest();
for (String name: names) {
context.getRequestScope().put(name, request.getAttribute(name));

—— code ——

I don't think this is something we should have to do though, and there is undoubtedly a "better way", but until I find it….

June 2005

Mo Tu We Th Fr Sa Su
May |  Today  | Jul
      1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30         

Search this blog



Most recent comments

  • Interesting… While I'm not completely convinced in such microbenchmarks, I'm pretty sure that 1ms … by Alexander Snaps on this entry
  • Hello. I bought the book yesterday. I was trying to find the source code for chapter 11 and chapter … by Suleman on this entry
  • by live mashup demo on this entry
  • Thanks mate ….. This blog was really helpful. by Maaz Hurzuk on this entry
  • Ty. Not directly helpful for my problem, but pointed me in the right direction. You will also get th… by Mike E. on this entry

Blog archive

Not signed in
Sign in

Powered by BlogBuilder