Jeremy Rayner on java and other stuff.

All | AudioDrama | Chatter | Fun | Groovy | Java | Life

London Puzzle Party
Posted on 04 Oct 2007

I went along to the London Puzzle Party at Camden Lock last night, which is an event run, once a month, by the wonderful little shop full of mechanical puzzles called Village Games.

I've never been along to these before, but I guessed I might like the community, after all I look with envy at the Gathering for Gardner and Burning Man events in the USA.

I arrived at the shop in Camden, to be greeted by Ray the owner, he very kindly showed me some of the most popular puzzles and took me on a tour of the books. Ray tells me that he cannot compete with the likes of ebay and amazon on the books, and therefore is not going to restock any of the shelves with books when these ones disappear.

Ray showed me where the evening event was taking place, and I took my place at the table.

Martin very kindly introduced me to all the people round the table, and he explained that his passion was the sliding block puzzles. Martin has some amazing pictures of his collection online.

John arrived soon afterwards, with his pockets full to bursting with little wooden blocks in odd configurations, his passions are the cube puzzles and number theory.

The owner of Grand Illusions shop arrived next, his name is Tim and he travels the world in search of interesting gadgets. This evening he had brought along

  • a yo-yo in the shape of a cone
  • a device that gives you the impression your eyes are over 10 inches apart
  • a smooth mirror, which when a light is shone upon it, reflects a picture onto the wall

Robert is the resident genius, he is a wonderful 81 year old chap who hasn't missed a single one of these events.

David Wells was there, author of some of my favourite books, I showed him a wonderful little thing on knot multiplication

Simon who is the resident Go expert talked to me about the London Open and a possible get together for kids who liked the game. When pressed, Simon recommended a book called In the Beginning which will have to be sought out.

I sat for most of the evening scratching my head over various interlocking 3-d puzzles that were thrust into my hand, I think I solved about 2/3 of them, but I wouldn't want to be in a competition against any of these chaps.

When time was finally called, I was accompanied back to the station by Frank, who explained to me that his passion was impossible objects. One of his favourites is the corkscrew opener (with cork) inside a bottle, as these objects go naturally together.

Suprisingly though, it isn't the puzzles themselves that seem to light up this room, it is the interest they all have in other people, how they solve the puzzles, what alternative solutions they might give, and any new ideas.

Thanks to Ray for organising this event, it was great fun, I recommend it highly to anyone who enjoys Recreational Mathematics and Puzzles.

04 Oct 2007 |

Lightning Groovy
Posted on 25 May 2007

My 6 minute elevator pitch for the Groovy language.

Recorded at Google offices in London on 24 May 2007,
as part of the Open Source Code Jam 3

 Presented and Edited by me ( Jeremy Rayner )

25 May 2007 |

Groovy at JavaOne 2007
Posted on 14 May 2007
Here is a round up of bloggers feedback about Groovy from JavaOne2007
Positive
Bernard Ng
Sausheong
Ben Teese [1], [2]
Charles Ditzel [1], [2]
Demian
Michael Kovacs
Andres Almiray [1], [2]
Peter Pilgrim
Chirag Mehta
Matt Stine [1], [2], [3]
Jason [1], [2]
Maryland Pok Guy
Lucas Jellema [1], [2]
Michael Yuan
Antoni Batchelli
Neutral
Keyur Shah
Tony
Cameron Purdy
Frank Coyle
Igor Minar
Brendon Humphreys

Negative
Ola Bini [1], [2]
Cay Horstmann [1], [2], [3]
Hani Suleiman
Friends
Geertjan Wielenga (Netbeans plugin)
Graeme Rocher [1], [2], [3], [4] (Grails Lead)
Jason Rudolph [1] [2] [3]
Ian Roughley (InfoQ)
JavaFx
Cedric Beust + comments
Danno Ferrin
Ron Hitchens
Steve Giovannetti
It looks like we managed to enthuse some people about Groovy and we even made it to the best seller list (#5)

Special thanks to Guillaume Laforge, Dierk König, Rod Cope, Vladimir Vivien Graeme Rocher and anyone else who talked about Groovy at JavaOne, either on stage, or in the corridors. Nice one.

14 May 2007 |

Third Groovy Developers Conference
Posted on 01 Feb 2007
01 Feb 2007 |

Groovy 1.0 released!
Posted on 03 Jan 2007
Groovy 1.0 has finally been released.

It has been a long road, lasting over three years, but at last I can recommend Groovy as a stable, production proven and well documented programming language for the Java platform. (not to mention a very helpful and large user community)

This release coincides with the launch of the Manning book Groovy in Action, which gives an in depth reference to Groovy 1.0

[Full Disclosure: I'm a core committer for Groovy and I was a technical reviewer for this book]

Groovy 1.0 Highlights:

  • A formal syntax based closely on Java 1.5, with added Groovy bits.
  • Groovy can easily run source from the command line, ant, embedded in code
        (simply place groovy-all-1.0.jar in your classpath)
  • Close ties with Spring, Lucene and other real world Java products.
  • Fantastic for reducing the verbosity of common tasks in Java

quick start: example installation to /usr/local

$ cd /usr/local
$ wget http://dist.codehaus.org/groovy/distributions/groovy-1.0.tar.gz
$ tar xvfz groovy-1.0.tar.gz
$ export GROOVY_HOME=/usr/local/groovy-1.0
$ export PATH=${GROOVY_HOME}/bin:$PATH
$ groovy -e "println 'hello world'"

To coincide with this release, I have also released version 0.0.2 of the JVM command line interpreter Grash.

I'll be giving a Talk about the Groovy Compiler on 25 Jan 2007 in London, please come along to that, and the pub afterwards, to discuss all things Groovy.

I will be at the Groovy Developers Conference in Paris (starts 29 Jan 2007) to discuss the future direction of Groovy, in particular enhanced IDE support.

In May 2007 there will be a three day Groovy and Grails conference at the Barbican, which will be perfect for anyone interested in this language to meet the core developers, and discover the cutting edge progress in Groovy.

But most of all, Groovy 1.0 would not be where it is today without the work of the open source community. I'd like to thank each person for their work in making Groovy a fantastic language:
Committers:
Guillaume Laforge (glaforge), Jochen Theodorou (blackdrag), Jeremy Rayner (jez), John Wilson (tug), Russel Winder (russel), James Strachan (jstrachan), Dierk Koenig (dierk), Christian Stein (cstein), Paul King (paulk), Joe Walnes (joe), Chris Stevenson (skizz), Jamie McCrindle (jamiemc), Matt Foemmel (mattf), Sam Pullara (spullara), Kasper Nielsen (kasper), Travis Kay (travis), Zohar Melamed (zohar), Bob McWhirter (bob), Chris Poirier (cpoirier), Christiaan ten Klooster (ckl), Steve Goetze (goetze), Bing Ran (bran), John Stump (jstump), Pilho Kim (phk), Mark Chu-Carroll (markcc), Alan Green (alang), Edward Povazan (emp), Franck Rasolo (fraz), John Rose (jrose), Graeme Rocher (graeme), Guillaume Alleon (galleon), Antti Karanta (akaranta), Dave Kerber (davekerber), Hein Meling (hmeling), Joachim Baumann (jbaumann), James E. Ervin (jervin), Scott Hickey (jshickey), Martin C. Martin (mcspanky), Marc Guillemot (mguillem), Aslak Hellesoy (rinkrank), Steven Devijver (sdevijver), Scott Stirling (sstirling), Yuri Schimke (yuri)
Contributors:
Joern Eyrich, Robert Kuzelj, Rod Cope, James Birchfield, Robert Fuller, Sergey Udovenko Hallvard Traetteberg, Peter Reilly, Brian McCallister Richard Monson-Haefel, Brian Larson, Artur Biesiadowski Ivan Z. Ganza, Arjun Nayyar, Mark Turansky, Jean-Louis Berliet, Graham Miller, Marc Palmer, Tugdual Grall, and many many many other contributors and organisations.

Thankyou All (and apologies if I missed anyone, so many people...) :-)

P.S. an improved java2groovy is now in the core distribution of groovy 1.0 :-)

03 Jan 2007 |

java2groovy
Posted on 29 Dec 2006
Having just finished the first full run through of a groovy pretty printer, I thought I'd flex it's muscles by creating a useful command line program...
 java2groovy [file ...]

Description:
    The java2groovy tool reads class and interface definitions, written in the
    Java programming language, and converts them into groovy source files.
to do this...
  • I took the original java.g grammar which groovy.g is based upon
  • amended it to remove Java features not implemented in groovy.g ("do" keyword, Array Initialisers etc)
  • Created a Java2GroovyMain which takes Java files and parses into a Java like source AST
  • Converted the Java like source AST into a one for one Groovy equivalant
  • Applied a Groovifier, which applies common simplification tasks to the AST (e.g. don't need public keyword if you have other modifiers)
  • Then the resultant groovy AST is output using the "pretty printer"
(not in subversion yet RC3? post 1.0?)

So... job done, what's next :-)

Seriously though...

  • java.g needs to be amended some more to use create() instead of #[], otherwise line/col nums are lost
  • Groovifier.java is an interesting step, lots of tiny refactorings, at the source AST level, very powerful...
    //----
    // (e.g. don't need public keyword if you have other modifiers)
    //
    if (t.getType() == MODIFIERS) {
       GroovySourceAST publicNode = t.childOfType(LITERAL_public);
           if (t.getNumberOfChildren() > 1 && publicNode != null) {
           // has more than one modifier, and one of them is public
               // delete 'public' node
               publicNode.setType(EXPR);
    }
    //----
    
  • some minor changes to things like string literals (get a double double-quote each time at mo...)
  • all pretty printer issues apply (no comments on AST etc)
java2groovy is now included in Groovy 1.0 (download here)
(very very beta) NO DOCS, NO WARRANTIES etc etc

Oh yes... a sample...

$ java2groovy src/test/groovy/lang/MockWriter.java

/*
 Automatically Converted from Java Source

 by java2groovy v0.0.1   Copyright Jeremy Rayner 2007

 !! NOT FIT FOR ANY PURPOSE !!
 'java2groovy' cannot be used to convert one working program into another
*/

package groovy.lang
class MockWriter

   {

   private String output

   String getOutput() {
       String answer = output
       output = null
       return answer
   }


   void setOutput(String
        output) {
   }


   void println() {
       setOutput(""println()"")
   }


   void println(Object
        object) {
       setOutput(""println("" + object + "")"")
   }


   void print(Object
        object) {
       setOutput(""print("" + object + "")"")
   }
}
29 Dec 2006 |

Tech Presentations for your ipod
Posted on 19 Sep 2006
Some excellent presentations to watch online or on your ipod
19 Sep 2006 |

Useful Java Stuff
Posted on 06 Jul 2006
Useful stuff
  • stomp is a cute protocol for working with messaging systems.
  • compass is an object-searchengine mapping tool, making lucene easier.
  • Many people suggest it is time to switch to subversion instead of cvs.
  • Also Trac is recommended for a project workbench, looks cool.
  • JAX-WS is the spec for Java and web services
  • JAXB 2.0 looks interesting [overview (old)]
  • but I still love XStream
  • JPA (Java Persistence API) is hot [walkthrough] and worth learning.
  • JPA is implemented by the FREE Oracle tool Toplink
  • as well as Open JPA which is based on the wonderful Kodo.
  • Jencks is a good implementation of JCA
  • Spring was of course implicitly wonderful, and Pitchfork appears to be adding EJB3 to Spring.
  • Glassfish is incubating lots of interesting side projects.
06 Jul 2006 |

Second Groovy Conference
Posted on 28 Nov 2005

Starting out on a chilly November morning, with just a Burger King breakfast for company, I found myself checking in for the Eurostar to Paris. I boarded the train, and found I had two hours of my own time (a rare thing these days) and therefore decided to bring some of my projects up to speed with the latest Groovy release (JSR-04)

First off was my pet wiki server called biscuit, which was a simple affair needing changes only to variables not initialized with a type or the 'def' keyword. As I finish this task before arriving at the channel tunnel I decided to sink my teeth into a meatier topic, and look into providing tab completion for my Groovy shell called grash. The excellent jline library hooks for completion, so I quickly hook this up to the 'ls' function in grash and feel great as I navigate my object tree using the same nifty functionality I know in my favourite unix shells.
I then started bringing grash up to the latest Groovy release, but after the initial 'def' updates, I quickly realise that something else is afoot. It appears that providing user defined commands and attaching them to objects has broken. A quick debugging session shows that for some reason the GroovyClassLoader is being told to load two versions of the reflector for the same script.
At this point I get a phone call from James Strachan, it appears that he caught the train by the skin of his teeth, and after fighting his way down the carriages we meetup, just as we pull into Paris.

As we stand in the queue for the taxis, James and myself discuss the xbean project and how to best integrate Groovy closures into Springs template callback mechanisms. In order to prevent writing wrapper classes over the top of every spring template, James suggests adding functionality to groovy to allow single method interfaces to be automatically implemented by Closures, in much the same way as Listeners are implementable by Closures today. As James pulls out his laptop and starts showing me where these hooks would reside, I can tell that this is going to be a good JSR meeting, and one which would justify using two days of my own holiday and the excessive eurostar fares which I paid for.

We arrive, after a hairy taxi ride around the 'Arc de Triumphe' at the Sun offices in Paris. Guillaume excitedly takes us up to the 'Jupiter' room on the third floor, where I finally get to meet blackdrag, our debugger extraordinaire, and Dierk who has been writing Groovy in Action. We are delighted to find that Sun have provided an internet connection, and Guillaume has already uploaded photos to flickr for the watching world to see.

Having missed the morning session due to our travel, we are quickly brought up to speed. Finally we will get to talk about name resolution and scoping. The topic for the first day appears to be name resolution, with most of the discussion centring around how best to cope with vanilla names.

After a lunch paid for, very kindly, by Dierk, the discussion soon turns into a heated debate over the treatment of vanilla names.

class MyScript {
  String toString(){
    return "foo"
  }

  void run() {
    myList.each{
      // does this call MyScript.toString() or myList.toString() ?
      println(toString())  
  }
}
I believe that... Tug argues the enclosing object instance should listen for and consume names prior to the lexical scope. (i.e. above example would call myList.toString())
James argues that the default should be lexically bound to the current context (i.e. above example would call myScript.toString()), and if the object instance was needed to be referred to that some form of syntax could be constructed to allow this, e.g. $toString() would be a dynamic name that could be interpreted differently.
At least, with my laptop pointing at the wiki, and up on the projector, I ensure that the examples and minutes are being captured in the wiki and not on the whiteboard.


We appear not to reach a resolution as Vincent Massol arrives to bring us to the Chinese restaurant for the evening. We all potter down to the Metro, Guillaume and tug have kindly arranged metro tickets for us delegates too laden with bags, and soon we arrive across town. There we meet Xwiki's Ludovic Dubost and Erwan Arzur and Benjamin Mestrallet from eXoPlatform.

A very entertaining evening ensues, with chatter ranging from XWiki through to 'flaming drunk prawns', and we all end up at Ludovics apartment nearby, where Erwan introduces us to a bottle of Calvados that he had stowed away for such occasions. At about 12:30 we stumble back on the last metro and finally check in to our sleepy hotel. I feel glad to find a towel in the room, and settle down to a restless Parisian slumber. (thanks so much to Bob at Codehaus for funding the room)

I awake 5 hours later to the sound of my Blackberry playing 'The Entertainer', and discover the delights of hot chocolate for breakfast (no sign of tea, I think coffee is more popular here). We stumble back to the Sun offices, again Guillaume and tug have the metro sorted.

Day Two starts out more productive, with discussion about opening up the DefaultGroovyMethods for the layman and we get some agreement about the 'use' keyword and my 'enhances' proposal. However the discussion soon gets round to the topic of Builders (a.k.a. Markup) and again the name resolution and scoping bear comes up to bite us again.

We have Tug and Guillaume firmly on the side of Builders being in charge of everything defined within the markup delimiters. James argues that markup is fundamentally broken and some kind of syntactic clue that we are suddenly entering a different 'markup world' where normal resolution and scoping doesn't apply. For some reason, that I cannot fathom, Tug and Guillaume both seem vehemently opposed to any indication in the code that we are in a Builder section. This includes both the suggestion of a 'with' keyword or .{ notation to indicate to the reader of the code that something different is about to occur.

String toString() {
  return "foo"
}
  
swingBuilder.frame() {
  panel() {
    button(toString())
  }
}
We were all fairly happy that the Builder could be responsible for name resolution inside it's own block (e.g. the swingBuilder instance would be responsible for how it treats toString() inside), but what seemed to really be a sticking point was the important fact that due to the dynamic nature of the name resolution/scoping within this block, some visual clue to the reader of the program was necessary.
James argued for, and I agree that, the use of some kind of syntactic indication was vital to ensure that the Groovy language was sane, predictable and maintainable. The above example would look something like this... (note the .{ syntax indicating a different lexical construct)
swingBuilder.frame().{
  panel() {
    button(toString())
  }
}
or the even clearer...
with (swingBuilder.frame()) {
  panel() {
    button(toString())
  }
}
Thus implying to any compiler, IDE, or human reader that the block of code was not a true lexical closure, but some other construct which was dynamic in it's very nature, and thus warnings, code completion and everything else specification related did not apply, as the responsibility would lie with the implementation of the builder.
I'm sad to report that no agreement was reached on this matter. Not so much which syntax would be useful, but actually whether we should have any syntax denoting the difference between a true lexical Closure and one of these Builder blocks. The historical reasons go back to Builder blocks looking just like Closures, and I'm afraid this long standing mistake must be removed from the language before any true progress can be made, as no sensible specification rules can be applied while the dichotomy exists.
I headed back to London with a very disappointed James Strachan, the language which has some of the finest minds, and most exciting ideas now faces a pivotal point in its life, and I'll do everything I can to ensure that clarity over dynamism wins the day.

My many thanks go to Guillaume for the meeting arrangements, to Sun for the facilities, to XWiki,eXoPlatform and Vincent Massol for the Chinese, Dierk for the Lunch, and Bob/GoogleAds for the hotel room.

28 Nov 2005 |

Nonograms
Posted on 14 Sep 2005
The object of the puzzle is to figure out which of the squares should be coloured in to make up a picture, which is the solution to the puzzle.
print out and solve this puzzle
  here is a more difficult one
Rules:
  • Numbers by each row or column form a 'clue'
  • Each clue tells you how many solid blocks there are on that column or row, how big they are, and in what order they appear
  • There must be at least one gap between two blocks
For example: A clue of "3,1" tells you there is a block of 3 consecutive solid squares on this row, and to the right of it is a single block of 1 solid square.
[more info]
Nonograms (a.k.a. Griddlers) in their current form, have a history going back about 20 years.

The theory behind these puzzles can get quite involved, and provides an interesting exercise in programming. Steven Simpson has provided some interesting nonogram solvers

There are also some interesting variants on this puzzle too.

More nonograms to play with are here, here and here.

update: Here is a nice tutorial on how to solve these puzzles.

14 Sep 2005 |

Lucene and Groovy example
Posted on 22 Apr 2005
Lucene in ActionI've just got hold of a copy of the Lucene in Action book by Erik Hatcher and Otis Gospodnetic and thought it would be fun to see what the examples of basic Lucene usage would look like in Groovy.

The Groovy code is used in the following manner, with my example using some free classic books from Project Gutenberg to search inside.

$ mkdir bookIndex
$ groovy -cp lucene-1.4.3.jar Indexer bookIndex ~/gutenberg
Indexing~/gutenberg/Bram Stoker/Dracula.txt
Indexing ~/gutenberg/H. G. Wells/The War of the Worlds.txt
Indexing ~/gutenberg/Mark Twain/Adventures of Tom Sawyer.txt
Indexing ~/gutenberg/Oscar Wilde/The Picture of Dorian Gray.txt
Indexing 4 files took 2320 milliseconds
$ groovy -cp lucene-1.4.3.jar Searcher bookIndex indefatigable
Found 1 document(s) (in 30 milliseconds) that matched query 'indefatigable':
/Users/j6wbs/gutenberg/H. G. Wells/The War of the Worlds.txt
$

The first example is a script that will build an inverted index from text files on your hard disc.

Usage: groovy -cp lucene-1.4.3.jar Indexer <index.dir> <text.files.dir>

Indexer.groovy (download)

import org.apache.lucene.analysis.standard.StandardAnalyzer
import org.apache.lucene.document.Document
import org.apache.lucene.document.Field
import org.apache.lucene.index.IndexWriter

/** * Indexer: traverses a file system and indexes .txt files * * @author Jeremy Rayner <groovy@ross-rayner.com> * based on examples in the wonderful 'Lucene in Action' book * by Erik Hatcher and Otis Gospodnetic ( http://www.lucenebook.com ) * * requires a lucene-1.x.x.jar from http://lucene.apache.org */

if (args.size() != 2 ) { throw new Exception( "Usage: groovy -cp lucene-1.4.3.jar Indexer <index dir> <data dir>") } def indexDir = new File(args[0]) // Create Lucene index in this directory def dataDir = new File(args[1]) // Index files in this directory

def start = new Date().time def numIndexed = index(indexDir, dataDir) def end = new Date().time

println "Indexing $numIndexed files took ${end - start} milliseconds"

def index(indexDir, dataDir) { if (!dataDir.exists() || !dataDir.directory) { throw new IOException("$dataDir does not exist or is not a directory") } def writer = new IndexWriter( indexDir, new StandardAnalyzer(), true) // Create Lucene index writer.useCompoundFile = false

dataDir.eachFileRecurse { if (it.name =~ /.txt$/) { // Index .txt files only indexFile(writer,it) } } def numIndexed = writer.docCount() writer.optimize() writer.close() // Close index return numIndexed }

void indexFile(writer, f) { if (f.hidden || !f.exists() || !f.canRead() || f.directory) { return }

println "Indexing $f.canonicalPath" def doc = new Document()

// Construct a Field that is tokenized and indexed, // but is not stored in the index verbatim. doc.add(Field.Text("contents", new FileReader(f)))

// Construct a Field that is not tokenized, but is indexed and stored. doc.add(Field.Keyword("filename",f.canonicalPath))

writer.addDocument(doc) // Add document to Lucene index }

The second example builds upon the first by providing a command line tool to search the index of text files.

Usage: groovy -cp lucene-1.4.3.jar Searcher <index.dir> <your.query>

Searcher.groovy (download)

import org.apache.lucene.analysis.standard.StandardAnalyzer
import org.apache.lucene.queryParser.QueryParser
import org.apache.lucene.search.IndexSearcher
import org.apache.lucene.store.FSDirectory

/** * Searcher: searches a Lucene index for a query passed as an argument * * @author Jeremy Rayner <groovy@ross-rayner.com> * based on examples in the wonderful 'Lucene in Action' book * by Erik Hatcher and Otis Gospodnetic ( http://www.lucenebook.com ) * * requires a lucene-1.x.x.jar from http://lucene.apache.org */

if (args.size() != 2) { throw new Exception( "Usage: groovy -cp lucene-1.4.3.jar Searcher <index dir> <query>") } def indexDir = new File(args[0]) // Index directory create by Indexer def q = args[1] // Query string

if (!indexDir.exists() || !indexDir.directory) { throw new Exception("$indexDir does not exist or is not a directory") }

def fsDir = FSDirectory.getDirectory(indexDir, false) def is = new IndexSearcher(fsDir) // Open index

def query = QueryParser.parse(q, "contents", new StandardAnalyzer()) // Parse query def start = new Date().time def hits = is.search(query) // Search index def end = new Date().time

println "Found ${hits.length()} document(s) " println "(in ${end - start} milliseconds) that matched query '$q':"

for ( i in 0 ..< hits.length() ) { println(hits.doc(i)["filename"]) // Retrieve matching document and display filename }

Further improvements to these scripts could be made in the future by providing groovy wrappers around common Lucene activities. This would allow you to supply the domain specific work inside a closure to convenience methods, e.g. lucene.write(dir) {...} Here is an idea of what it could look like (the following will not work... yet)

...
def index(indexDir, dataDir) {
    if (!dataDir.exists() || !dataDir.directory) {
        throw new IOException(
          "$dataDir does not exist or is not a directory")
    }
    def lucene = Lucene.newInstance()
    def numIndexed = lucene.write(indexDir) {writer->
        dataDir.eachFileRecurse {file->
            if (file.name =~ /.txt$/) { // Index .txt files only
                indexFile(writer,file)
            }
        }
    }
    return numIndexed
}
...

My thanks to Erik and Otis for allowing me to make their examples more Groovy.

22 Apr 2005 |

BCS Open Source Meeting - review
Posted on 15 Mar 2005
I popped along to the first open source meeting of the British Computer Society last night.

It began with a very entertaining talk from Sarah Ewen about Linux on the Playstation 2. The Playstation2 Linux distro is apparently a limited run, it was based on Redhat 6.2, and will soon be sold out in PAL regions. She then showed a previous VU coding contest entries. I would find it hard to recommend this as an entry level machine for anyone, as at £253 including PS2 it is quite a poorly spec'd machine. For only £86 more, you could get yourself a Mac mini, which would fly for desktop usage.

After the presentation, the usual BCS governance was ironed out, and the committee were voted in for the next six months. Amongst the aims of the BCS Open Source Specialist Group are reducing professional uncertainty around the subject of Open Source and to encourage serious debate & examination of Open Source.

One thing that is apparent is that people interested in being involved will not all be able to get to London. As such a wiki and discussion forum has been setup, where you can contact other professionals/academics who are interested in Open Source, and it's applications. You don't have to be a member of the BCS to be involved, and indeed from my viewpoint as an open source developer, I see an opportunity for us to show the decision makers in all aspects of professional computing, the real advantages of adopting open source at all stages of development.

My thanks to the committee for organising a good evening, and the particularly nice cakes.

15 Mar 2005 |

Installing HenPlus on OSX
Posted on 02 Feb 2005
I came across HenPlusa nice looking console based SQL-shell for database interaction, rather like SQL*Plus for Oracle, but this claims to work for any JDBC data source.

It wasn't straightforward to install HenPlus on Mac OSX, largely due to HenPlus needing java-readline which in turn requires the darwin ports version of readline.

Thankfully, the blogosphere has got there first, and a step-by-step guide to getting java-readline working has been provided by Brian. cheers.

02 Feb 2005 |

Too busy...
Posted on 15 Jan 2005
too busy hacking to blog...
15 Jan 2005 |

Turn your build.xml into a pretty picture using Groovy
Posted on 02 Dec 2004
Inspired by Sam Newman (magpiebrain), I decided to see if it was possible to do a quick XSLT style transform using groovy on an ant build.xml file, so that it could be loaded up in FreeMind.

The example diagram below is the result of running groovy antmap.g > build.mm over the build.xml for my groovy shell called grash

mindmap of grash build file

A code snippet is below, which I've added to the groovy examples bundle (which is full of cool stuff b.t.w.)

#!/bin/env groovy
# 
# convert an ant build file into a format 
#     suitable for http://sf.net/projects/freemind
#
# by Jeremy Rayner - 2 Dec 2004
# inspired by Sam Newman 
#    ( http://www.magpiebrain.com/archives/2004/12/02/antgui )
#
# usage:   groovy antmap.g > build.mm

import groovy.util.XmlParser
import java.io.File

buildFileName = "build.xml"  // default

// handle command line params
if (args.length > 0) {
buildFileName = args[0]
}

// header
println "<map version='0.7.1'>"
project = new XmlParser().parse(buildFileName)
name = project['@name']
println "<node TEXT='${name}'>"
level = 0

printChildren(project,level)



def void printChildren(node,level) {
level++
node.each {
name = huntForName(it)
if (name != null) {
if (level > 1) {
println "<node TEXT='${name}' POSITION='right'>"
} else if (it.name() == 'property' || it.name() == 'path' ) {
if (it.children().size() > 0) {
println "<node TEXT='${name}' POSITION='left' FOLDED='true'>"
} else {
println "<node TEXT='${name}' POSITION='left'>"
}
} else if (it.children().size() > 0) {
println "<node TEXT='${name}' POSITION='right' FOLDED='true'>"
} else {
println "<node TEXT='${name}' POSITION='right'>"
}
}
if (it.children().size() > 0) printChildren(it,level)
if (name!=null)println "</node>"
}
}

// footer
println "</node></map>"


def String huntForName(node) {
preferNodeNames = ["junitreport"]
if (node == null) return null
if (preferNodeNames.contains(node.name())) return node.name()
if (node['@name'] != null) return node['@name']
if (node['@todir'] != null) return node['@todir']
if (node['@dir'] != null) return node['@dir']
if (node['@refid'] != null) return node['@refid']
return node.name()
}

02 Dec 2004 |

Some more Groovy notes
Posted on 17 Nov 2004
Here are some more notes from GC1 (Groovy Conference no.1), some of them might be inaccurate, subsequently changed or just plain wrong, but I might as well share what notes I did take...

Ideas for the specification

whitespace?
whitespace is significant, but it is significant as it applies to 'no dumb expression statement (NDES)' rule

macros?
macros are going to be implemented under the covers, but may not be exposed to user in first syntax spec, indeed 'while' might even be implemented as a macro under the covers...

builders?
builders have turned into lovely things :-) builders are now intended to be included within the EBNF this seems to have been achieved by changing the words around :-)

with (MyBuilder) { myPanel { myThing }}
or something

parens?
parens are optional, but again before you leave the planet... only on simple statements, not on expressions

escaping nested closures?
escaping nested closures involved break / return keywords break without label would break out of tightest closure break with label would treat closure just like while statement break (+ same with continue) return would always return from the method (that the closure was called from?) not sure I remember discussions about breaking with a value..?

I have published jstrachan's scribblings here

here are a few of my favourite things...

'with' keyword

with myFoo.bar.mooky { wibble = 12; wobble = 13}
equiv to...
myFoo.bar.mooky.wibble = 12; myFoo.bar.mooky.wobble=13;
and reused for builder syntax
with myFoo { bar { mooky {new Weeble()}}}
(syntax probably not quite like that)

'?.' operator

foo?.bar
equiv to
(foo != null) ? foo.bar : null
the question mark indicates that foo is questionable, i.e. it could be null, it could be any type etc... (i.e. no compile time errors if property bar doesn't exist on foo)

Anyway, just gives you an idea of some of the topics under discussion, none of it is set in stone. Look forward to comments :-)

17 Nov 2004 |

First Groovy Conference
Posted on 16 Nov 2004
I've just got back from a very interesting two day conference held to discuss both the Groovy language and JSR 241 which is aiming to standardize the language.

jez, pmuellr, jstrachan, jrose, rob, guillaume

James spent the first morning outlining his original vision for Groovy and the direction in which he'd like to take it forward. ( mp3, powerpoint)

James Strachan Groovy is trying to provide a high level language (like Ruby, Python or Dylan) that maps cleanly to Java bytecode. It needs to works with Java objects, and the root of all the object trees is java.lang.Object. The syntax will be Java friendly, but doesn't have to be backwards compatible. Groovy will sit on top of J2SE

After lunch I walked everyone through the story so far, from the conception of Groovy back in Aug 2003, up till the present day. (powerpoint)

Guillaume then took us through the user feedback we collected, including the main issues of the moment (powerpoint) which appear to be optionals, documentation, visibility, scoping, debugging, class loading, speed and security.

We then dicussed the roadmap for the Groovy JSR, particularly which key deliverables are necessary to reach a community release of Groovy.

Key Deliverables for Groovy JSR Community Release

  • Specification
    • A formal grammar (using similar to EBNF)
    • GLS - semantic rules expressed as a diff of the Java Language Specification
    • Limited references to groovy.* interfaces
  • Reference Implementation
  • Test Compatiblity Kit
    • Test cases following the GLS chapter by chapter
    • A subset of the JCK:Java 'language' tests or similar (e.g. Jacks)

one of the discussions

We have so much material from the two days (I recorded 15 hours of audio), it's going to take a while for all the details to surface.

16 Nov 2004 |

grash: added a command history (jline)
Posted on 28 Oct 2004
Thanks to TheServerSide I have had significant interest in grash, for which I'm very grateful. It's great to see that after only two weeks from the initial idea, I have so many positive suggestions and enhancements to think about.

Marc Prud'hommeaux has directed me towards his wonderful wrapper for streams, called jline, that allows grash to provide line editing and command history.

I have released a new version (grash 0.0.0.5) which now includes this facility by default, both from the command line (java -jar grash.jar) and when embedded. If you have any security issues with this amendment when embedding grash, I have provided a new constructor that allows you to turn this facility off. Marc has very kindly relicensed jline as BSD, so grash is still fully available under an Apache2.0/BSD style license.

On Unix and MacOSX you can simply use the arrow keys to navigate round your most recent commands (on Windows you will have to use CTRL-N/CTRL-P due to an issue in jline). The commands you type are persisted (beyond the session) currently in your home directory in a file cunningly called "~/.grash_history".

I'm quite excited that jline also provides the potential for command line completion (a.k.a. tab completion), this would be a splendid addition which I must look into.

This new release also fixes an issue found by Dave Minter, thanks for the feedback Dave, hopefully you will find things a bit more bulletproof now.

Please keep your thoughts and ideas rolling in, cheers.

jez.

28 Oct 2004 |

grash: a unix-like shell for your JVM
Posted on 25 Oct 2004
"If everything in Unix is a file and everything in Java is an Object, wouldn't it be nice if you could explore your Objects in the JVM with the same powerful mechanisms you use in Unix."

My line of thought a couple of weeks ago has led to a small implementation of a shell for the JVM, which I have named grash. The name is derived from the fact that it is based in part on the externally observed behaviour of the bash shell, and that it is written in and exposes to the user the Groovy programming language. Hence 'GRoovy-Again SHell'

Using the concept of a 'current working instance' in place of a 'current working directory' some of the tools in a normal shell already make some sense.

what follows has been adapted from the wonderful Kernighan and Pike

What Objects are out there?

The ls command lists the names (not contents) of Objects:

/ grash$ ls
junk
main
temp                
/ grash$
The names are sorted into alphabetical order automatically.ls , like most commands, has options that may be used to alter its default behavior. The -l option gives a "long" listing that provides more information about each Object:
/ grash$ ls 
-------rw-  junk
--------x  main
------rw-  temp
/ grash$
The string - - - - - - r w - tells who has permission to read and write the Object; in this case there is a public getter and setter for the junk and temp objects.

Printing Objects - cat

Now that you have some Objects, how do you look at their contents? The simplest of all the printing commands is cat . cat prints the contents of the Object name by its argument:
/ grash$ cat junk
To be or not to be
/ grash$ cat temp
That is the question.
/ grash$

A handful of useful methods

Grash exposes the Java and Groovy Libraries to the command line user, providing
/ grash$ cat junk
To be or not to be
/ grash$ cat junk.length()
18
/ grash$ cat junk.tokenize()
[To, be, or, not, to, be]
/ grash$ cat junk.tokenize().sort()
[To, be, be, not, or, to]
/ grash$

Pipes

A pipe is a way to connect the output of one expression to the input of another. I have implemented pipelines in the simplest way at the moment.
/ grash$ ls -a | println size()
11
/ grash$
The expressions in a pipeline currently evaluate one after another, but in order to behave like Unix, concurrent evaluation of the commands in a pipeline would be desired.

The methods are currently called on the result of the previous evaluation, again this should perhaps be a different mechanism, using the current working instance and others.

NOTES

How do I embed grash in my own programs

  • put grash.jar in your classpath
  • include these lines somewhere in your code (note: you can pass your own input/output streams in the Grash constructor}
import com.javanicus.grash.Grash;
...
Grash grash = new Grash(myObject);
Thread consoleThread = new Thread(grash);
consoleThread.start();

Under the covers

  • 100% Groovy source, at the moment (although some unit tests on Java will be needed)
  • Object references are currently piped around, rather than streams.
  • The grash command line parser takes precedence over groovy, so any ; | > & symbol will be ignored by the time that groovy sees it.

What's left to do...

  • Everything...
  • I have implemented other features such as cd , ps , pipes, redirects and some advanced options on ls
    • Feel free to play with them.
  • Decisions over pipes:
    • object handles or serialized objects ?
    • Do the methods in the subsequent pipe commands call methods on the result of the former, or methods on the 'current working instance' ?

HEALTH WARNINGS

  • This project is just a baby (born 14 Oct 2004), and is an extrapolation from the concept of file/object equivalence.
  • This project uses Groovy which is still in Beta.
  • grash.jar contains all of groovy-all.jar, to help ease of setup. However a version without included groovy will be available upon request.
  • You won't be able to get STDIN (InputStream) to work if you are running your program from ant and it's derivates.

BIG DISCLAIMERS

  • "It's amazing what you can do when you're too stupid to realised that it is impossible to achieve"
  • I have no clue whether this will be useful, I'm just experimenting right now.

I'm looking forward to your comments and ideas

25 Oct 2004 |

London Souvlaki Meetup
Posted on 19 Oct 2004
This morning started as I fought my way against the commuters on London Bridge, into the Regis House (Sun training centre). Cameron gave a nice little talk explaining the concepts surrounding the scalable perfomance concerns of high end J2EE applications.

Jules and Cameron after the Tangosol seminar

Cameron very kindly managed to get at least six people from the seminar to then show their faces at the London Java Meetup.

People at SOS

Some new faces too

A great turnout at tonight's meetup, finally Carlos managed to make it along, yay.

Carlos and Cameron

I Managed to talk to Stuart Ervine who is tackling the task of creating a Swing frontend to his xwork actions, called Pendulum. If you look slightly beyond the coolness of being able to reuse your xwork actions in an app, Stuart is also looking very hard at providing an junit extensions for asserting that your swing application frames have all the right buttons and labels etc.

Stuart and Max

Jules managed to get the chance to explain that WADI is shaping up nicely.

The meetup moved out of SOS as the evening progressed, as Cameron suggested we find solace in a souvlaki bar.

A souvlaki bar in the heart of the city

For those that care, I rambled on about Groovy, grash, thinlets, gnudiff4java, xdelta in java, the freenet routing algorithm, xstream, sitemesh, BBC Emulation on MacOSX, JOGL, and redbook OpenGL examples.

Thanks to Cameron for increasing the fold, and thanks again for the prized Tangosol T-Shirt.

19 Oct 2004 |

London Java Meetup - tonight
Posted on 18 Oct 2004
It's the London Java Meetup this evening. If you haven't been before, then tonight is a good night to join us. Cameron Purdy should be able to make it, which is always fun :-) So if your near London, and want a cheap night out with geeks, look no further.

Hope to see you there

18 Oct 2004 |

Ninja Joe
Posted on 11 Oct 2004
After hearing that Joe would be attempting to backflip down finsbury pavement, like a ninja, I was to say the least a little skeptical.

But Joe persisted and as you can see from this blog entry, he did his research and attempted to raise lots of money for charity.

Did he do it?

Judge for yourself...

Quicktime Movie of Three Back Handsprings (2Mb) and other pics/movies

Well done Joe!

11 Oct 2004 |

London Pub Crawl - the results...
Posted on 28 Sep 2004
A very enjoyable pub crawl for the geeks last night. We attempted to find a suitable venue for the relocating geekspeek event, and also, seemingly, we attempted the world record for number of PowerBooks in a pub.

It all started at Ye Olde Mitre, a cute little pub in an old Dickensian alley. This looks like a nice hideaway, but a bit too hard to find for occasional geekspeekers. Rohan, Marco and Duncan find ye olde mitre
Simon, Simon, James, Dominic, Marco and Rohan enjoy ye olde mitre
Then we moved on to the Cittie of Yorke, this spacious pub seemed to suffer from communication issues between the staff, which led to delayed orders, and unhappy geekspeekers. Dominic and Duncan discuss the supper artifice at the cittie of yorke
Simon, Joe, Torgeir and Marco watch James stag video in the cittie of yorke James shows off his stag video.
The Princess Louise, it seemed a decent enough palace, but the various beverages obtained therein left something to be desired. Duncan and Simon discuss the needs of the modern male
Torgeir, Simon and Duncan find peace at the white hart Finally ended up at The White Hart on Drury Lane, a nice little pub, with a clean modern atmosphere. Will this pass the grade? Only Duncan knows...

28 Sep 2004 |

A Java Regular Expression...
Posted on 10 Sep 2004
For my own future reference, a hard fought Java regular expression.
foo(.*?)(?=foo)
This will match all the characters after the first expresion foo, up to but not including the second expression foo

The (.*?) has a lazy quantifier, and will only capture as much as it has to, to make the whole expression match.

The (?=foo) is a non-capturing lookahead, which will not exclude the next foo from being a valid anchor.

i.e. The bold text indicates each match.

   foowibblefoowobblefoojelly on a platefoo

10 Sep 2004 |

War of the Worlds
Posted on 17 Aug 2004

It is with great joy that I see Steven Spielberg is due to direct a new version of The War of the Worlds

It is clear, after directing Close Encounters and E.T., that this would be a fabulous story for Steven to bring to a modern audience.

My only hope is that Steven will make the right choice and get Jeff Wayne to do the score. His amazing soundtrack for the film already has 115 five star reviews on Amazon. You must let Jeff Wayne do the music.

War of the Worlds - music by Jeff Wayne
17 Aug 2004 |

Java on the Blackberry
Posted on 09 Aug 2004
Blackberry 7230 It seems that my shiny new Blackberry is pretty much stuffed to the gills with Java.
This all looks quite useful, although the netbeans IDE sticks in my throat a bit, a nice IDEA plugin would be much more appealing. It is also a shame that no Ant support is apparent, but they have provided a makefile generator, so I'm sure a build.xml wouldn't be too hard to rustle up...
One app that seems to stick out, for the Blackberry, is this lovely looking SSH client, drool...
09 Aug 2004 |

London Groovy Meetup - jez's review
Posted on 13 Jul 2004
Thanks to all of you who came along to last night's London meetup, I think the new venue worked out, apart from being a bit small for all of us.

It was great to finally meet and talk to John 'Tug' Wilson, and Zohar Melemed about their work on groovy. James wowed the crowd as usual.

I managed to take some photos

 

click for more piccies

Other interesting snippets I scribbled in the pub...

  • Met some chaps working on dspace.org, which is a project concerning the preservation of digital information, this stuff is fascinating to me
  • One chap has had great success in a recent Java/WebServices/C++ project using gsoap and webmethods glue
  • Joe again recommended SableCC to me, SableCC is a tool to create an Abstract Syntax Tree from a document parsed using a specified grammer, and it is definitely worth a look.
  • Joe was also showing off streamlets, which provides the ability for your web client to send and receive messages over JMS.
  • Mozilla apparently has a good Javascript debugger (Venkman), which sounds like a blessing for maintainence of the unobstrusive Javascript that peppers webapps.
  • Met a couple of chaps (Philip Milne and other [sorry forgotton your name]) who are working on a subproject of Open Adaptor, called Bhavaya which provides real-time equivalent of Hibernate.

I met lots of new faces, so apologies if I don't remember everything from tonight. It was fantastic to see the buzz alive in London. Please come along next month for more drinking and networking.

Thanks to all.

13 Jul 2004 |

London Groovy Meetup - this Monday
Posted on 09 Jul 2004
I'm rather looking forward to this month's java meetup. I've been playing with Groovy for the last month or so, creating a reference card as I explore.

The creators have agreed to come along to the pub and talk all things groovy, and Hani has agreed to come along and slate it in person :-)

Pop over to the java meetup blog, and sign up if you also would like to come too (newbies welcome).

09 Jul 2004 |

Build your own spacecraft
Posted on 09 Jul 2004
If you find yourself stuck indoors over the summer holiday's,
why don't you...
make your own Cassini-Huygens spacecraft out of paper and glue.

download illustrated assembly instructions (168K pdf).

...Teach the kids something new, or just take a look at the latest pictures being sent from 932 million miles away.

Saturn
09 Jul 2004 |

Local JMS for local people
Posted on 23 Jun 2004
It was only a matter of time, Somnifugi is a local implementation of JMS that sends messages between threads. It is a nice analogy for the useful Worker Pool of threads pattern, that will scale easily if you want to plug in a distributed JMS implementation later. Congrats to Dave
23 Jun 2004 |

Hitchhikers returns on 21 September
Posted on 22 Jun 2004
At last, after a long wait, The hitchhiker's guide to the galaxy returns with a new series at 6:30pm on 21 September on Radio 4.

The announcement also includes this great sounding trailer (mp3)

More info from mj simpson, slashdot

22 Jun 2004 |

my daily reading material...
Posted on 16 Jun 2004
I've changed the style of my home spun blog aggregator box, which I use to keep track of all things, see what you think of it here.
16 Jun 2004 |

wiki's and the UML
Posted on 15 Jun 2004
Stephan pointed me in the direction of SnipGraph, which looks lovely. Essentially it takes wiki style plain text, and creates graphs with layout. It can run independently of snipsnap (i.e. on its own, in a build), to produce many pretty views of the structure/relationships you might want to model.

It's all produced by a very clever lady called Elka Ehret.

another pretty graph

Other similar tools here and here

15 Jun 2004 |

...so last week
Posted on 15 Jun 2004
GMail must no longer be fashionable or cool, as the fools let me have an account...

Thanks to Carlos for the invite.
15 Jun 2004 |

sketching in the UML - Visual Thought
Posted on 15 Jun 2004
Visual Thought - Observer PatternI was just looking around again for a tool somewhere between Visio and my Whiteboard, and I might have found it. Visual Thought used to cost alot, but is now available as freeware, it seems to be quite good at UML as sketches, and may well find a little niche in my toolbox.
15 Jun 2004 |

I want one of those...
Posted on 15 Jun 2004
I don't normally go for PC case modifications, but this conversion into Orac looks beautiful. [from slashdot]click for more piccies
15 Jun 2004 |

London Java Meetup - Tonight
Posted on 14 Jun 2004
It's the London Java Meetup this evening. Another night of drunken chat about all things Java related, should be fun...
14 Jun 2004 |

Pick-and-Drop
Posted on 10 Jun 2004
It's about time something as useful as pick-and-drop came along. I wonder why most of these PC flatscreens aren't touch sensitive.
10 Jun 2004 |

I wanna rock...
Posted on 10 Jun 2004
Metallica
Heavy metal! You rock! It's mostly about the
music instead of lyrics for you...but you
channel most of the emotion through the lyrics!
Mosh pit for you! Just be careful you don't
give yourself a concussion with so much
headbanging...

What genre of rock are you?
brought to you by Quizilla
10 Jun 2004 |

Fun with Techie's (London,this.Sunday)
Posted on 04 Jun 2004
An exciting looking tech conference is taking place on Sunday, at my old university in London. NotCon '04 looks set to be full of people taking technology further than originally intended.

Discussions will range from Peer to Peer, Copyright, Blogging, through to hardware and wireless hacks. Looks like fun, and cheap (4quid) too :-)

04 Jun 2004 |

Cool Underground and Subway guide
Posted on 03 Jun 2004
If you're stuck on planning your next trip around London, Paris, New York, Brussels or Madrid, be sure to pop by my friend's new site that provides route planning using funky graph traversal algorithms. Pop by, and leave comments here so Simon can improve the service futher.
03 Jun 2004 |

BBC Model B
Posted on 01 Jun 2004
Stumbled across an excellent website homage to my second home computer, the BBC Model B, a chap called Ollie has put together Only the Best BBC Micro games
My favourites include:
Starship Command, Sphinx Adventure, Citadel, Repton, Thrust, Killer Gorilla, Ghouls, Imogen, Castle Quest, Frak, Chuckie Egg, Cholo, Knightlore, Sabre Wulf, The Sentinel, Dare Devil Denis, Doctor Who and the Mines of Terror, and of course Elite. The only ones I think that Ollie missed are Alien8, Starquake, Mallory Manor and Stardrifter.
Try Ollie's excellent Quick Start Guide, and play these games now...
01 Jun 2004 |

The British Computer Society
Posted on 29 May 2004
Got my details through from the British Computer Society this morning, I'm now an MBCS, which is the grade just before full chartered status.

They hold lots of "special interest" talks, such as the Advanced Programming SIG and the Computer Conservation Society as well as a monthly London meetup.

29 May 2004 |

Music to code to...
Posted on 28 May 2004
...this week I have mostly been listening to Savatage (esp.When the crowds are gone) and Run Lola Run. I must say that Simon has a good taste in music as most of his ones to watch, were tunes I stopped to listen to the artist for, off the radio.
28 May 2004 |

Jez's favourite feeds.
Posted on 28 May 2004
Most of my daily web reads are being collected onto one page now, and you can read it too if you like, all aggregated at my news digest. (using my little app box)
28 May 2004 |

Movies and Physics
Posted on 28 May 2004

Inspired by Simon, I have started a new blog category... small but regular chatter to be had at my chatter rdf feed. And here is the first random chatter...

The physics of well known movies is discussed here. Glad to see that Titanic fares much better than Armageddon. (from ntk)

28 May 2004 |

Massive London Book Clearance - £5 each - ends on Sunday
Posted on 30 Apr 2004
Just got back from Quinto Bookshop, 48a Charing Cross Road, London. They are shutting this particular shop, on Monday 3rd May, and have basically put a £5 price tag on every computer book in the shop. I think they have somewhere in the region of 15 floor to ceiling shelves of IT books, and not just rubbish either, some quite recent...

I've just purchased these titles:

  • Black Box Testing - Beizer [Wiley]
  • Learning Java - Niemeyer and Knudsen [O'Reilly]
  • Linux Multimedia Guide - Tranter [O'Reilly]
  • Java Cryptography - Knudsen [O'Reilly]
  • Mastering RMI - Oberg [Wiley]
  • Programming Web Graphics - Wallace [O'Reilly]
  • The Whole Internet - Conner-Sax and Krol [O'Reilly]
  • Managing projects with make - Oram and Talbott [O'Reilly]
  • 3D User Interfaces - Barrilleaux [Manning]
  • JXTA in a nutshell - Oaks, Traversat and Gong [O'Reilly]
  • Java Tools for Extreme Programming - Hightower and Lesiecki [Wiley]
  • Agile Modeling - Ambler [Wiley]
  • Extreme Programming in Action - Lipper, Roock and Wolf [Wiley]
  • Sonar 2 Power - Garrigus [Muska and Lipman]
  • The Accidental Project Manager - Ensworth [Wiley]
  • XPath Essentials - Watt [Wiley]
  • Java Distributed Computing - Farley [O'Reilly]
  • C# Essentials - Albahari, Drayton and Merrill [O'Reilly]
  • .NET Framework Essentials - Thai and Lam [O'Reilly]
  • Programming C# - Liberty [O'Reilly]
  • Data Structures and Algorithms in Java - Goodrich and Tamassia [Wiley]
All for the princely sum of £100, quite a saving!

I suggest if you are a techie, and you're around London this weekend, pop over to Leicester Square tube, just opposite the hippodrome, the old green bookshop on the corner, all the tech books are downstairs.

I'm in no way affiliated to the shop Quinto's, by the way, just a very happy customer :-)

Quinto's phone number is 0207 379 7669

Enjoy...

30 Apr 2004 |

Lecture, from chap who walked on the Moon, next Wednesday...
Posted on 26 Apr 2004
Saturn V lift off If you're in London on Wednesday 5 May, consider coming along to the Royal Society with me to a talk by Dr David Scott. Dr. Scott will be giving his unique views on the proposed manned mission to Mars.

Dr David Scott was an astronaut on the Gemini 8, Apollo 9 and Apollo 15 missions, which included the Lunar Lander 'Falcon'. He will give his views on the challenges for sending people to the red planet, and possibly bringing them back again.

This promises to be an entertaining evening, so if you're reading this and fancy coming along too, leave a comment on this blog and we'll arrange to meetup in Picadilly Circus for some food first.

26 Apr 2004 |

Netpad: a remote pair programming tool
Posted on 21 Apr 2004
I wanted something quite simple...

Last week I wanted to brainstorm with a colleague, on a new piece of source code, but we were not in the same physical location. So I did a quick google for some form of collaborative real-time text editor. However, from the applications I found, nothing quite fitted all of my needs.

  • small download
  • really simple to get up and running
  • works over our firewall
  • cross platform
  • free

So with all this in mind, I set about creating a tiny app that addressed my requirements.

screenshot of netpad in action [click to enlarge]

I called it netpad, and it is a very basic text editor, that uses http to synchronise between remote instances of itself. (Netpad is both an http client and http server)

It's still very pre-alpha, but I'd thought I'd share now, to get useful comments. I'm just working on the algorithms for conflict resolution at the moment. I think my main focus is towards the real-time edit protocol, rather than the editing vehicle.

basic instructions

Incidentally these are some of the best alternative collaboration tools that I've come across...

please have a play and let me know your thoughts....

21 Apr 2004 |

Strangers on a train...
Posted on 19 Apr 2004
A funny thing happened on the train to work this morning...
Chris White (English) - click for more pictures
Chris White
I bumped into Chris and Tony, who were teachers at my secondary school. They are still both at the school, and were catching the first train up to Catterick, Yorkshire to do a quick reccy for the school Combined Cadet Force. This is the home of the Queen's Royal Lancers, so it looks like the pupils are going to have a fun week.

It was very strange to enter the world of my old school again, if only for an hour. The school seems to have acquired and built new buildings, the pavilion has been burnt to the ground, and my old headmaster has only recently passed away.

So much, but so little has changed in the 13 years since I left...

Tony Holding (Chemistry) - click for more pictures
Tony Holding
19 Apr 2004 |

Hitchhiker's film production starts today.
Posted on 19 Apr 2004
The Hitchhiker's Guide movie begins principal photography at Elstree Film Studios today. There is an all new cast, including Warwick Davis (the little chap who played Wicket the Ewok) as Marvin.

The visual effects are being created by Asylum, who do the cute BBC2 logo's (amongst other things) and the whole thing is being directed and produced by Garth Jennings of Hammer and Tongs, who did the Blur - Coffee and TV video.

MJ Simpson has put together an interesting interview with the producer and director. It all looks like an interesting adapation of the book, so I'll be keeping an eye on the production with interest.

In the meantime, I'm eagerly awaiting the Third Radio series, with all the members of the original cast (who are still alive). It has all been recorded, we're just waiting for various legal matters to be sorted out before a Radio 4 broadcast slot can be allocated.

Thanks to MJ Simpson for all his research on this.

19 Apr 2004 |

megg: user defined project templates
Posted on 26 Mar 2004
Just added a new megg release that provides the ability to use your own project templates, this has been requested by a number of people, and hopefully is the hook that might get you using megg :-)

Rough guide to template writing

A project template is literally any directory that contains files you need for next project. The special bit comes when you go into one of your files and place the special parameters (velocity style) inside the source files and a controlling megg.xml in the root of the directory.

for example: put the text ${megg.foobar} in your source file, and add <arg name="foobar"/> to megg.xml in the root of the directory. megg will prompt user for this arg, then generate the project on this basis.

Just unpack megg.jar to look at the other templates for ideas...

The search strategy for templates is currently:

  • if you typed java -jar megg.jar foobar
  • megg will look in './foobar'
  • ...then '$MEGG_HOME/.megg/templates/java'
  • ...then '$user.home/.megg/templates/java'
  • ...then in the megg.jar file itself

Give megg a whirl today, and let me know your thoughts...

26 Mar 2004 |

megg: automatic downloading and unpacking
Posted on 26 Mar 2004
One issue when starting a new project, is getting hold of those pesky dependancies (jars/tld etc). I've updated megg to automatically grab them for you. megg will now take care of downloading a released file at any url, and unzipping or untaring the archive, and then copy the necessary into the right place for your project.

The best explanation is through an example.


java -jar megg-0.1.0.jar groovy

will create all necessary files for minimal groovy project and then unpack the three essential jar files needed in the lib dir from the auto downloaded groovy-1.0-beta-4.tar.gz


This is how this is declared, note use of ! to delimit url ! packedFile ! packedFile...
The dependancy declaration inside inherit the outer dependancy declarations
<dependancy from="http://dist.codehaus.org/groovy/distributions/groovy-1.0-beta-4.tar.gz!/groovy-1.0-beta-4/lib/"
  to="/lib/">
    <dependancy from="groovy-1.0-beta-4.jar"/>
    <dependancy from="asm-1.4.1.jar"/>
    <dependancy from="asm-util-1.4.1.jar"/>
</dependancy>

26 Mar 2004 |

Christopher Eccleston - new Doctor Who TV Series
Posted on 20 Mar 2004
dr who

I'm known as the Doctor [click for larger piccie]

It's official...

Christopher Eccleston has been cast as the Doctor in the new Doctor Who TV Series, due to air in 2005. Combined with the previously announced writer/producer Russell T. Davies, we can expect a much darker, deeper and dramatic Saturday evening hiding behind the sofa.

This is a very strong casting, one that may well upset people who like a multi-faceted Doctor. However if you want a tortured soul, and someone to drag the emotion from the pit of your stomach, Christopher Eccleston is probably able to deliver.

My only hope is the, as yet uncast, companion role, will go to Kelly Macdonald, mostly based on her work as Della Smith in State of Play

Shooting starts in Cardiff later this year, and the series will be on our screens in 2005. Meanwhile here are some clips of Christopher Eccleston...

The Doctor is coming back, and this time it's serious.

20 Mar 2004 |

Spaced - The Movie
Posted on 19 Mar 2004
...well nearly. If you're a fan of the channel 4 comedy series Spaced, you might be pleased to see the trailer [flash] for Shaun of the Dead due in your cinemas from 9th April.

It is just one of a number of cool looking movies coming from working title films this year. Others include ...

19 Mar 2004 |

megg updated
Posted on 18 Mar 2004
Just updated megg to version 0.0.9, adding support for jpublish project generation. JPublish is a web framework from Anthony Eden, and Anthony very kindly wrote this megg template himself, so if you want to give JPublish a whirl, you can't start better than this.

Also updated the webwork2, groovy and thinlet templates, to take into account the most recent release of each.

so download megg today! :-)

18 Mar 2004 |

LNE - my Robot strategist
Posted on 16 Mar 2004
... or how I applied the Strategy (315) pattern to Robocode.

Article about robocode and strategy pattern (HTML - 36Kb)

download source code for this article (3Kb)

16 Mar 2004 |

Monday's meetup review
Posted on 16 Mar 2004
Managed to chat briefly with David Gilbert of JFreeChart fame last night at the meetup. JFreeChart is one of those open source components that stirred my interest in the scene almost four years ago. David is a really nice guy, and his hard work and dedication to JFreeChart shines through in a very easy to use charting package. I was intrigued to hear that around 70% of JFreeChart's users were incorporating the charting into web applications, but then it is such an essential part of any serious (open sourced based) developers toolkit, I suppose it's a good measure of java developments. Thanks to David for coming along, it's good to see someone out there making a living direct from open source. pretty jfreechart image

3 turtles Had an interesting chat with Simon, about how the general population approach computing, and he pointed out that the largest barrier was not understanding the intricate nature of how it all fits together, but that fear of breaking the system was paramount. It seems that too many people in the world, when faced with a computing environment, are scared of what they might do, and often take the Luddite defense. I guess you need to provide an environment that has no social fear of failure (i.e. let them wander all around the system, they are far more likely to accidentally learn something than accidentally break it). Simon also reminded me to have another look at StarLogo

As for the robots, I made the final, but I'm sorry to say my robot was trounced by Sam's amazing gravity-based targeting robot. That sucker was mean, hopefully Sam will do a quick overview on his blog. And I'll put my robot in a future entry.

Thanks to everyone who joined us last night, another excellent meetup.

16 Mar 2004 |

Beagle 2 lecture - how to get to Mars on a shoestring
Posted on 08 Mar 2004

Went to a very entertaining lecture tonight given by Colin Pillinger of the planetary and space sciences research institute, at the Royal Society, on the topic of the Beagle 2 mission to Mars.

The Beagle 2 mission, which included a mass spectrometer inside the lander, that was hitchhiking aboard the Mars Express spacecraft. As you are probably aware, no contact has been made with the Beagle 2 since it left the Mars Express around Christmas 2003.

The Beagle 2 had no means of communication between leaving Mars Express and the craft completing its landing sequence on the surface. This is due to the extra weight this would have added to the craft, which means the log of actual events now lies with image recognition on images taken as Beagle 2 left Mars Express, spy images from the various Martian survey satellites, combined with new Martian data provided from all the other instruments about the atmosphere and conditions.

Colin Pillinger and Jez (picture taken by Andi Chandler)

The main lessons from this mission seem to be

  • reduce the number of sequential events in any landing, as no matter how small the risk of failure in each event (bouncing, rolling, blowing incendiary devices etc), the combined probabilities of failure in a chain of events is really too great.
  • together with better placement of the communications antenna [word doc] (provided by Qinetiq) in the next mission. In Beagle 2 the antenna was built from the existing structure of the space lander, to make it of zero mass, and therefore almost the last thing to happen was the enablement of the communications, much better would be to bring the communication antenna outside of the box, thus enabling each link in the chain of events to be controlled from external decisions.

This lecture really was a flag waving event for the European Space Agency (ESA), but moreover for British Space Science. Colin managed to claw his way aboard the Mars Express, with a mission that most funding sources seemed to be reluctant to join until it was a sure thing. It seems that the greatest battle we face in Space Exploration today is not with the physics and logistics of getting out there and doing it, but with the marketing, politics, sponsorships and bean counting that seems to be prevalent in today's introspective societies.

I guess Colin's gift has been to realise there is a human story in a robotic mission to Mars. The human story, quite rightly, is with the scientists, from inception, through fund-raising, and into the weeks of the mission itself. I think Colin showed that the mission had more viewers than 'Only Fools and Horses', which is quite an achievement, and shows that future missions may be able to leverage this vast audience. The British Space programme isn't setup for individual donations, but surely advertisers and other businesses will see that no matter what the outcome of future missions, it will be worth investing in immediately as the sizeable audience will be guaranteed.

The next mission window seems to be a 2007 launch (EVD), aboard the ESA mission to Mars, part of the Aurora programme. But the funding would have to be given early, as work would have to be seriously underway by the end of this year. And as Beagle 2 has proved it is possible to get great science into a minuscule lander, the 2007 mission will possibly have two or more landers on board, and hopefully this time the ESA can give a little bit more priority to the landers.

Let's hope in three years we can hear the immortal words 'The Beagles have Landed' coming from the bowels of Jodrell Bank.

Beagle 2 (picture taken by Jez)

Thanks to Colin and the Royal Society for another interesting evening.

08 Mar 2004 |

London Java Breakfast Meetup - review
Posted on 01 Mar 2004
Just got back from the breakfast meetup, another fun packed feast of Java, we discussed such items as whether the Rational Unified Process (RUP) is truely meaningful in the real development environment, Sam pointed me in the direction of Simon's blog entry on RUP pigeonholing developers, I guess I'm just curious as to how Agile and RUP fit together?

Also discussed was Spring's implementation of IoC, and how it compares to it's competitors, looks worth a look.

Thanks to the Fox and Anchor for a really hot cup of tea, sorted.

01 Mar 2004 |

Just met Gary Russell
Posted on 26 Feb 2004
I just metup with Gary Russell (producer, director, author and lovely chap).

It's wonderful to see such a passionate, intelligent man in his element. We managed to talk at length about the various outpourings of Big Finish over the last five years, as well as reminiscences of the Audio Visual days. I've taped about 90 mins of interview, which I'll try and transcribe at some point.

Thanks so much for your time Gary, let's hope we can meet again soon :-)

Gary Russell and friends...
26 Feb 2004 |

Carlos in London Baby!
Posted on 19 Feb 2004
Carlos stoops to conquer

Carlos has arrived in London, lock up your Databases, and make sure your objects are as naked as the day they were born... Welcome to London mate.

19 Feb 2004 |

Sun Tech Day - review
Posted on 19 Feb 2004
Went along to the second Sun Tech Day and I have to say I was uninspired. Apart from the usual freebie hunt, my feelings of the vendor circus were that not much innovative stuff was coming up at the moment. Some might say this was the sign of a mature platform, or that companies in general are more inward looking in these times, who knows...

However, a couple of snippets that look worth further investigation did come up:

  • JAX-RPC looked interesting approach to WebServices code generation although how this compares to Apache Axis I'll have to see.
  • kSOAP looks good for my mobile phone. [this is a solution waiting for a problem :-)]
  • This talk [pdf] was an entertaining rehash of the J2EE Pattern book with ebay as the examples.
  • I think I missed the most interesting talk. The Hotspot tips [pdf] talk showed ways to profile and streamline JVM performance.
  • jvmstat provides graphical views of JVM performance data.
  • GC Portal provides analysis and tuning of Garbage Collection
  • With JFluid, Sun have modified the JVM for what looks like a low level AOP implementation. cooooool ;-)

Anyways, thanks to Sun for the glowing pen, thanks to Adobe for the black t-shirt (they are doing an InfoPath by turning the acrobat reader into a simple XML form collection mechanism).

19 Feb 2004 |

Monday's meetup in review - prevayler, scala
Posted on 18 Feb 2004
Had a kickin' time at the London Java Meetup on monday, great to see so many there this time, was it because of the reappearance of Cam I wonder?

Cool stuff that came up, Tom pointed me in the direction of Prevayler, and what with Carlos being in town, I've actually gone and read the background on this now (where does my time go...)

  • If prevayler is basically persistent command pattern, can one have non-linear forward acting commands (like the photoshop non-linear history mechanism) ?
  • Can you go back in time (like cvs update -D "yesterday"), and live out an alternate reality (good for parse trees, and quantum simulations) ?
  • Can you plug in your favourite serialization mechanism, for the job in hand (xstream for readability and hackability [like hsqldb does for me now] or some super fast binary serialization thingmy)
  • Can prevayler Commands and xwork Actions all just turn into POJOs, with no implements neccessity...

Steve pointed me in the direction of an alternate (less blogged about) language to Groovy, that is the Scala programming language, it doesn't look at dynamic as Groovy, but it has some interesting ideas that I'll look into later when I get a mo. Also Steve, go and have a look at Robocode, it's a fun way to learn coding (just like the good ol' days), maybe the next meetup should involve pitting attendees robots against each other :-)

Simon recommended that I seek out some of Nick Drake's music, and I have to say I'm impressed, I like music with that bit of emotion to it.

It was a great evening, cheers chaps...

18 Feb 2004 |

Snow falls...
Posted on 28 Jan 2004
Shadow has been enjoying his first snowfall...
stoopid looking black puppy dog playing in the snow
28 Jan 2004 |

Halliwell's Hundred
Posted on 27 Jan 2004
As a film collector, Halliwell's Hundred is a goldmine of nostalgia and what used to be great about the cinema (1930s-1950s). The book is (unfortunately) now out of print, but I have put up a page containing a list of each of these wonderful films, I suggest you track down one of these films soon.

Classic Film List

27 Jan 2004 |

EasyContainer - a simple wrapper
Posted on 21 Jan 2004
All this PicoContainer stuff reminds me of the excellent article from DrDobbs Journal a couple of years ago called new Considered Harmful [ <-- good read]

With my foray into the Pico stuff, I thought it would be a good idea to simplify (for my lazy benefit) the bit that is basically doing the 'new', or the 'instatiation management' or some other term... that you can find at the core of any Type3 IoC framework.

I've put together a little wrapper around pico to start with, and possibly other containers that provide 'instatiation management', and at joe's suggestion (and fear of hecklers) I'll share the source to you lot to play with.

This wrapper is not breaking new ground, in fact is only putting simple method names round existing methods in pico, and removing the knowledge of container from your code (for the simple stuff). But it has got me thinking about the general case of 'instatiation management' as a replacement for new, and my next wander around the javaverse could include looking into The Java Syntactic Extender to provide a new syntax for making this as easy to use as new (irrespective of container)

JavaDocs,source code, and the prebuilt easy.jar

EasyContainer pico = new EasyContainer(new DefaultPicoContainer());
pico.reg(Boy.class);
pico.reg(Girl.class);
Girl girl = (Girl)pico.get(Girl.class);

Any thoughts...
P.S. My own critic inside says "Oh my god, he's written commons-logging generic wrapper equivalent for type3 containers" - but I might as well publish this anyways ;-)

21 Jan 2004 |

Sweet Panic (Free Theatre Performance)
Posted on 21 Jan 2004
From Anthony Keetch

There will be a free understudy performance of Stephen Poliakoff's SWEET PANIC
on January 27th at 2pm at the Duke of York's Theatre, St Martins Lane, London.

The cast includes Anthony Keetch, Louise Falkner, Lucy-Anne Holmes, Jacob Howe-Douglas & Sarah Mowat (Susan Mendes/Dalek Empire).

We will kindly be joined by Philip Bird of the main cast.

21 Jan 2004 |

Transported back to 1978
Posted on 21 Jan 2004
Amazing, I was transported back to being a six year old again, sat at our kitchen table, with coin in one hand and letraset in the other.

star wars on the back of cereal packet

Which reminded me to look for the Doctor Who cutout figures

doctor who on the back of cereal packet

Which were basically a load of Pollock's
Pollocks Theatre

They just don't make cereal freebies like they used too, sigh.

21 Jan 2004 |

Java in Space
Posted on 15 Jan 2004
With the most excellent moon/mars announcement here are some links for Java space exploration
  • Jitter - Java controlled robot in space (with built in garbage collection ;-)
  • Maestro - Explore Spirit Landing site with Java3D
  • J-Track 3D - monitor satellite positions in 3D [This ROCKS!]
  • Is there life on Mars? - Fantastic Photo of Mars that I unearthed (if you pardon the pun) a couple of years ago...

Hopefully one of you lot reading this will be writing code for the moon/mars missions over the next few years, can we persuade you to blog about the code...
Any other cool Java links for Space Exploration...?

15 Jan 2004 |

box: wrapped up in a webapp
Posted on 13 Jan 2004
I've wrapped up my rss aggregator (box) in a webapp. It is all designed for use on my mobile phone, so that after getting an email alert of a new blog entry, I can browse to the webapp for the full story. Here is the webapp in action and if you've got a capable browser, here is a simulation of web/box on my mobile phone.
[placed a link to these two on my right hand blog column]

Hope to see some of you tonight at the london java meetup.

13 Jan 2004 |

List of Java and Win32 stuff
Posted on 08 Jan 2004
My friend's Win32 PC has just died, so I've assembled a list of stuff that make a good start for installation with the Win32 platform:

geekspot: wrote list in this xml [ utils2004.xml ] and transformed with this xslt [ utils2004.xslt ]

Update: Moved long list off main page to HERE

What do you have on your PC? What cool stuff am I missing?

(see also Simon's List of Utils)

08 Jan 2004 |

box: source code available
Posted on 07 Jan 2004
Just a quickie, current source code snapshot for 'box' available here

These other 'feed to email' projects look cool too, fetchrss from crazybob and rss2email from yellowduck

07 Jan 2004 |

box: monitoring RSS/RDF feeds via email/SMS
Posted on 06 Jan 2004
Been working on a little project over christmas, to practise creation of picocontainer components (type3 IOC) and thought it would be good to share.

I've written a little tool (called 'box' after the funky device in Star Cops) that will monitor feeds described in an OPML file, and email you any changes since the last time the tool was run. I've hooked it up to scheduled tasks in Win98 at home, and I'm directing the emails to an o2.co.uk email account, as this free service will direct the emails to SMS on my mobile.

download 'box.jar' here

Just type java -jar box.jar to obtain usage statements

The following example would email foo@example.com with new blog/news items from the OPML listed at http://www.bloglines.com/export?username=boxopml


java -jar box.jar
   --recipient=foo@example.com
   --smtp-host=example.com
   http://www.bloglines.com/export?username=boxopml

I'd be grateful for feedback (in a comment on this blog)

I'll try and create a sourceforge/java.net style account for it if there is any interest, I've got lots of ideas for extending it.

06 Jan 2004 |

xwork: visualising flow of control with XSLT and SVG
Posted on 17 Dec 2003
 I've been fiddling around trying to visualize the xwork flow of control, and have come up with an XSLT based stylesheet which will transform your xwork.xml into a SVG graphic.

i.e.
xwork.xml
 XLST>  SVG

  • here is the XSLT stylesheet - xwork2svg.xslt
  • to use with Xalan: java org.apache.xalan.xslt.Process -in xwork.xml -xsl xwork2svg.xslt -out xwork.svg

I think lots of things could be improved with the stylesheet, such as:

  • arrows to indicate chained actions
  • standard order for success/error/input etc...
  • other transformations such as HTML

I think it is quite useful, as it allows the flow of control to be quickly groked, and can be generated as part of the build, for documentation purposes.
Let me know what you think...

17 Dec 2003 |

London Java Meetup - Xmas review
Posted on 16 Dec 2003
The LondonXMeetup.xmasParty was an entertaining night in the murky depths of the Shoreditch Electricity Showrooms.

It was great to see so many enthusiastic developers there, with a wide diversity being represented, java, perl, python, groovy etc...

Thanks especially to James who was mobbed by wannabe groovers and parrot hackers...

Anyways as my recollections are hazy, I'll let the pictures do the talking...

perl mongers meet java bloggers - yes that is a GPL tshirt! sam discusses his new book rohan is interrupted by pratik simon and pratik find out what it is like to be groovy from james small values of cool - captured in time - Simon Brunning and Steve

Thanks for the groovy get together guys, see you all in 2004.

P.S. Thanks to Sam and Simon for the book, I'll get your autographs later, yeah ;-)

16 Dec 2003 |

jsig - java user interfaces - seminar review
Posted on 12 Dec 2003
Popped along to the jsig seminar today:

The talk about Java Server Faces turned out to be a bit of a disappointment, with it essentially being a discussion of .net clients talking to J2EE servers using Janeva.

However the ILOG Jviews talk was fun and informative. To see how fun, have a quick play with this demo

The most interesting thing about this talk was their use of CSS jammed between your model (represented in xml) and their graphical rendering software (JViews). Being able to 'intercept' the model prior to reaching the view allowed all sorts of funky changes to be made in a very loosely coupled way. (reminds me of interceptor stack in xwork)

Thanks to jsig, borland and ilog for a fun lunch...

12 Dec 2003 |

Play with Groovy today
Posted on 12 Dec 2003
With the exciting announcement of groovy reaching its first release, I suggest you have a play. And what better way to get started than have megg generate a groovy project for you...

[i.e. I've just added a groovy template project to megg - go play ;-) ]

12 Dec 2003 |

The Great Fire of London
Posted on 10 Dec 2003
Andi and I enjoyed a stroll down to the monument at lunch today, hope you enjoy the pictures below...

10 Dec 2003 |

human metadata about british telly
Posted on 08 Dec 2003
Cool programme on (british) Sky TV - ch.277, called Flipside, basically four or so pundits on a sofa watching and gabblin about what's on TV at that moment.

So much more 'human' than rolling through the EPG, recommend you try and catch a couple of minutes, but after that you might just watch the other channel that they're chattin about...

cool concept, well executed...

08 Dec 2003 |

bloogmark: code in many ways
Posted on 08 Dec 2003
As a form of language cookbook, these are all handy examples of code: I'm sure there was a repository of HelloWorlds for Java technologies, i.e. simplistic implementations of MessageBeans, Servlets, JNI etc... any ideas where that was...?
08 Dec 2003 |

xwork/webwork2 logo contest
Posted on 03 Dec 2003
My initial entries into the logo contest are as follows:


I'll attach these to main competition page, when users such as myself get permission to attach pictures ;-)

03 Dec 2003 |

Lasers can be fun...
Posted on 03 Dec 2003
This is a really fun puzzle game

thanks to cal for the link.

cool game with lasers
03 Dec 2003 |

A day in the life of... jez
Posted on 01 Dec 2003
As an experiment I thought I'd keep a note of my normal working day, to see where time is being spent, and what my current 'process' is. This isn't an exhaustive list, as during the day, too many other things take precedence, but there should be enough for you to get the idea. Also blogging it is a great way to preserve this for future comparison and maybe seeing what you lot get up to...

0520 - alarm goes off
0530 - leave house and drive to the station, listening to the news headlines on Radio 4, but as soon as the shipping forecast comes on switch over to Radio 1 for some wake up tunes, this morning it appears to be Lifestyles of the Rich and Famous
0544 - arrive at station, parking car in an impossibly tight gap.
0549 - board the train to London, getting usual seat, with a table, so that my laptop can be used. My laptop is currently the oldest java development environment on the planet, with specs of (pII,300Mhz,4Gb,64Mb,SuSe8.2)
0552 - laptop booted, pink floyd - the wall on my walkman, ready to start the day.
- run 'ant test' to see where I got to the night before, five compilation errors come up.
- fix errors quickly (using microemacs'02)
- assertion failure during junit tests, turns out to be a null pointer exposed by a simple mock.
- build successful, yay.
- with that small victory, I change over and start blogging about the next java meetup.
- back to code, add another test checking what happens if not enough properties are set on my webwork2 action.
- add ability to my mock delegate, to simulate failure of data retrieval and add a test case that uses it.
0659 - arrive in London, walk to work listening to 99 code red
0727 - arrive at desk
- check my work email
- check for the latest EAP of IntelliJ, my preferred java development environment
- go to bloglines, to see what friends have been up to.
 - simon has added some more stuff to pebble (his blogging software)
 - joe is putting the finishing touches to xstream.
 - hani is discussing jboss and senior architects :)
- get the laptop connected, publish the earlier blog entry that I made on the train.
- cvs update/commit my laptop to the company cvs repository.
- cvs update on my desktop machine
- ant test on desktop, everything looks good.
- cvs repository maintanence, another branch needed.
- create more tests.
- with tests in place start to refactor, using such thing as extract method, this seems easy with IntelliJ.
- suddenly things become harder as the refactorings get more complicated, for instance, blocks of code to be extracted altering more than one variable, IntelliJ breaks down, and some hand refactoring comes into play.
- lots of meetings, code and other stuff which is too hard to log in an interesting way...
- preparing to go home again, cvs update/commit my desktop to the company cvs repository, and nag my work collegues to do the same.
- cvs update my laptop, with a quick ant test to ensure that all the new classes have been added to cvs during the day.
1600- squeeze onto the tube, not a good way to travel, I try to walk both ways to work, but sometimes catching the tube seems like a good idea...
1624- squeeze onto train, ever since they altered the timetable, this train has been a nightmare, so I usually spend the first twenty minutes home in the guards van, with my laptop keeping me company.
1630- start to write a website for megg, as people have begun to nag me that this tool should have a proper home, not just the project pages at sourceforge.
1731- arrive back at station car park.
1751- arrive back home.
family time- as a dad, husband and dog walker, I try never to code/work of an evening, life is too important to fritter away...
2230- set alarm, go to sleep.

Thanks for listening, I'll try and upgrade my life to something more interesting soon :)

01 Dec 2003 |

funny email humor
Posted on 27 Nov 2003
some fun screenshots here
27 Nov 2003 |

bloogmark: Unchecked Exceptions
Posted on 27 Nov 2003
Thanks to Sam I found this great article by Gunjan Doshi about Exception handling best practices.

I especially like best practice #1, as so often I see the logging and consumption of Exceptions cluttering up code, where a rethrow would have been so much more elegant.

(P.S. changed my blog 'skin', cool huh...)

27 Nov 2003 |

megg(site|thinlets|webwork2) updates
Posted on 20 Nov 2003
Thought you might like to know that I've just released a new version of megg, this time the highlights include:
  • A new website and mailing list
  • Add pretty gui template project with the wondeful looking thinlets API - looks sweet.
  • Updated the webwork2 template to bring in line with latest (beta2)

Go and have a play, let me know what you think...

20 Nov 2003 |

London Java Meetup - Nov 2003 review
Posted on 17 Nov 2003
  Met a cool chap called Tom White tonight, at the London Java Meetup, who works for a travel info feed company [kizoom].
  He raised the very interesting (to me) topic of long termism and it's impact in the software arena. Mostly the issues regarding long term storage of digital media, e.g. average CD-R lifespan around 20 years or so, but more interestingly the loss of code and data from only 40 years ago.
  Are we beginning to reach the time when the original babbage-like coders are starting to die off, and useful code from the 60s is degrading on magnetic tape in a locked filing cabinet somewhere. Is fashion and short-termism in software endangering useful lessons learned in the past? What is being done to archive everything in the long-long term?
  I myself have tried to remake Elite and rescued an Atari/400 game, but with everyone's obsession with little green bits of paper, should we look up a bit higher sometimes and think about the bigger things.
  Tom mentioned The Clock of the Long Now as being particularly relevant...

The Java Syntactic Extender was mentioned in passing, as Tom maintains this funky system for extending Java without tricky JSR requests, which I really must have a play with...

Simon mentioned TagUnit, which appears to be a test harness for use during development of your own jsp taglibs. Essentially providing a simple way to deploy your new tags into any J2EE compliant webapp container, without worrying about the specific platform details, cool.

Someone described the difficulties of using xml enumeration's as a non-type-safe style method of representation of xml schema, and the issues this brings into play with regard to future proofing the code that deals with these xml documents. i.e. it breaks down radically, a stark reminder to us all that the current trend towards flexibility/loose coupling at the cost of well declared structure comes at a long-term cost, which your replacement will eventually hate you for...

Mark Fowler (not a fowlbot) described the new Inline::Java stuff in Perl, and how easy it is to talk both ways between the two languages.

Perl6 is going all VM on us, but their VM [Parrot] will kick the donkey off the Java VM, particularly for targeting dynamically typed lingo's at it. Looking forward to having a play with that.

[JVM,CLR and Parrot, any more Runtime Environments I need to bulk my deliverables up with...]

Jeff Martin of xmlunit fame, talked about the holes in the mobile phone MMS specification and how it can reach up and bite ya, I feel your pain Jeff...

Pratik says JavaPolis on 3/4 Dec [Antwerp] is gonna rock, with Mr.Gosling himself in attendance...

The Xmas party venue was discussed, and will be scouted during the month by Sam, myself and others, so any suggestions for suitable venues capable of holding around 40+ people on 15 Dec would be appreciated [we have no money, but there was a lot of drinking tonight, so we should make some bartender happy...]

I'll put formative details up soon on the londonjava site for the Xmas party, and throw bits at it during the month, till it takes better shape. I'll try and send out the invites...

Anyways, thanks so much to all the people for poppin along, hopefully you can all make it on Dec 15th for a bit of festive cheer...

17 Nov 2003 |

London java meetup - oct 2003 review
Posted on 20 Oct 2003
This evening, the London java meetup went extremely well, thanks to all the tech-heads that turned up. I'll put some pictures up on the main page, all taken by Mr. Purdy, who delighted the crowd with his coherence after many beers. (isn't it a crime to blog from the pub Mr.P?)

Unfortunately because we hit double figures in attendance, I found myself timeslicing between most conversations and won't have my usual splurdge for you, but this is what I did pick up...

Pratik - (Raible's) AppFuse, and how he's gonna take it to the next level.
Richard - JFreeChart is really very, very useful.
Charles - SLEE is interesting to look at... (JAIN related, I'll google for this stuff later)
Sam - Has an irresistable urge to share anything he learns with the world.
Max - is going to have a look at blogmento, yay a potential user, now for the rest of ya...

The debate between web frameworks hotted up, with struts and webwork2 slugging it out, no idea who's winning... Has anyone out there actually used both, and can give an objective overview of the differences, mostly in regard to the code creation and ongoing code maintainence of these two?

I can't remember much more, but I had such a good time that it doesn't matter.

Cheers for turning up lads, maybe we'll do lunch sometime...

20 Oct 2003 |

London Java Meetup - tonight
Posted on 20 Oct 2003
Just a quick heads up, at least ten javabloggers (including myself) should be going to a London pub tonight to talk techie, it would be great if you, yes you lurking out there, were to come along too...

Details at the London Java Meetup site.

see you there...

20 Oct 2003 |

braindump("Java Properties are a faff")
Posted on 09 Oct 2003
Problem: Standard JavaBean properties
this is currently a bit of a faff!! (I told you I was lazy)

private String foo;
 
public String getFoo() {
return foo;
}
 
public void setFoo(String foo) {
this.foo = foo;
}

Most of the time I want to code this in one line (Java Language change!) so the above would become the succinct:

String -rw foo;

How: implement as a pre-processor...
Why Not:
is this in xdoclet/groovy/ant regexp task/generic pre processor already?
No point creating non-standard language features
Maintainence burden increased as yet another oddity introduced to your codebase
'cos I'd be biled for being silly :)

What modifiers do I propose?

 nonegetsetget+set
private--r-w-rw
protected##r#w#rw
package**r*w*rw
public++r+w+rw

Why not try to create solution in Valid Java
try for valid java?

String foo-rw; --> private String foo
String foo*rw; --> public String foo // this is probably not valid
 
foo-rw += foo-rw; --> setFoo(getFoo() + getFoo()); // hard transformation...

invalid java?

String -rw foo;
String +rw foo;
 
foo += foo; --> setFoo(getFoo() + getFoo()); // hard ...
 
setFoo(getFoo() +getFoo()); // no transformation, but won't compile/editors barf...
Either way we still have issue with usage of getters/setters, so assume that the usage of getters/setters is outside scope of preprocessor, the choice is between which looks nice and which will not be highlighted as a problem in editors.

Additional issues

  • Collection properties
  • boolean properties
  • Could also indicate that property is parameter to constructor

Suggested Implementation

  • Implement a preprocessor that takes a single java file from a URI as input and a destination URI as output.
  • Wrap ant task around preprocessor that basically does :-

    <target name="compile" depends="init" >
    <!-- This is the new ant task being called -->
    <jpp include="${src.dir}/**/*.java"
    outputdirectory="${pre.processed.src.dir}"/>
     
    <javac srcdir="${pre.processed.src.dir}"
    destdir="${build.classes.dir}"
    classpathref="project.classpath"/>
    </target>

But really, why bother?
so that this sort of thing...

package com.foo.bar;
public class FooBar {
private String foo;
protected boolean bar;
 
public String getFoo() {
return foo;
}
 
public void setFoo(String foo) {
this.foo = foo;
}
 
public boolean isBar() {
return bar;
}
}
becomes the lazy but readable...
package com.foo.bar;
public class FooBar {
String -rw foo;
boolean #r bar;
}
foo property has private access, has a getter and setter
bar property has protected access, only has getter

Questions to the reader of this braindump...

What do you people think?
Has this been done already?

09 Oct 2003 |

London:Apache J2EE (Geronimo):Free meetup this Thursday
Posted on 07 Oct 2003
On Thursday 9 October there is going to be a Geronimo meetup in High Holborn, London. This will be a session attended by (hopefully) at least four members of the Core Developers Network. (DainS, JeremyB, JulesG and JamesS)

The session will kickoff about 7pm, and will be your chance to meet the visionaries and discuss the existing Geronimo codebase. Details of how to get to the Mansfield Suite are at the CDN training page

Please try and come along, I'm sure it will be worth your while, if nobody else turns up you can go down the pub with some clever chaps, but if the session is oversubscribed you can scare residents of the Marriott hotel with your Jira t-shirts and Bileblog baseball caps.

07 Oct 2003 |

Interstella 5555
Posted on 01 Oct 2003
The full animated film Interstella 5555 from Daft Punk is coming out in December on DVD, yay.

This film was warmly received at this years Cannes film festival, and I've been itching to watch more myself since seeing the wonderful videos to 'One more time', 'Aerodynamic', 'Digital Love', and 'Harder, better, faster, stronger'.

This is going to look so good on DVD, but more than that,it is going to sound so good, Discovery is a kicking album, and the whole film is set to these tunes.

Roll on Christmas, and turn up the surround sound :)

 

01 Oct 2003 |

A cat joins the household
Posted on 30 Sep 2003
Our new kitten joined us on Thursday, her name is Pixel and she was born on 30 July 2003


pixel the cat
30 Sep 2003 |

webwork2 and maven added to megg
Posted on 24 Sep 2003
I've added both webwork2 and maven 'template projects' or seeds to megg, they are both a first pass. But they do work. So comments welcome...

j6wbs@justyce:~/projects> java -jar ~/megg.jar
templateDirectory : webwork2
...

templates included:

  • java - creates a simple ant based project, based on Hatcher and Loughran's recommended ant usage.
  • webwork2 - creates a 'hello world' style webapp in webwork2, with your prefered package name, action names etc... I've added details to the webwork2 wiki
  • maven - really simple maven project, any examples you can give of good practice in this arena gratefully received

Please download and take it for a spin, especially the webwork2 one, as it would be great to distill a good example for this interesting framework.

24 Sep 2003 |

An evening with Tim Berners-Lee
Posted on 22 Sep 2003
Just finished attending a lecture from the wonderful Tim Berners-Lee at the Royal Society in London.

[Tim's online slides and streaming video]

His main topic was the Semantic Web, with a particular focus on how the RDF would enable it to happen. Tim's pleasant personality came across in buckets, as the audience lapped up his gentle but accurate wit.

He is presenting his quest for the 'semantic web' in the same manner in which (with hindsight) one would present the world wide web to a bunch of people in Bletchley Park during the war. "It sounds nice Tim, but we've got a war/profit margin to fight"

The problem one faces on adoption of any new idea, is, if nobody else is doing it, it is not as useful, particularly when the true power comes from the automatic consolidation and merging of disparate data sources.

How can Java developers help in this endeavour of his? I guess our true potential is in implementing useful code that enables his (and others) vision, and in promoting more heavily the open standards than the usual proprietary solutions.

I have great respect for Tim's ideals, as he is surely as strong a proponent of open source and open standards as RMS or ESR.

My cynical eye (based on many human's I've met up till now) tells me that Joe Public have already had the 'head slappin' moment of wonderment at the world wide web, and probably don't want to relive the experience, as they were only just getting over the shock of how digital watches are (still) a pretty neat idea.

But I guess as the main audience for the semantic web is no longer the human mind consuming the html rendered view of content, but instead processing agents within our electron based devices. I'm just waiting my mobile phone to slap it's LCD, and exclaim 'O, wow, you mean I can actually call other phones on this thing, cool.'

I loved the way Tim presented the quaint old view of transferring data from one old system to another, via your pen and the back of napkin. Everyone burbling in the audience 'at least it's not like those bad old days', and bang Tim then gives a modern world example with events published on the web, which you then enter by hand into your own calendar of events. He's right, the old, bad days are still with us, and we're doomed to repeat the mistakes of the past. (some mangled quote in there :)

Anyways:

  • RDF is the biggie with all of this, it is the standard data space which Tim is promoting with all the power he can muster, and good luck to him in his crusade.
  • OWL is a language for publishing and sharing ontologies, which I have no idea about so leave here as an entry for me to google later update: What is an Ontology?
  • RDF should be your companies 'Enterprise Integration Hub', if you go in Tim's direction now, you won't be first up against the wall when the revolution comes.
  • The end result of the semantic web, as seen from this faraway location, is that of a simple 'proof checker' and 'trust mechanism' at the top of the application stack which combined will be able to prove that black is white, and that you should watch out on the next zebra crossing.
  • Dial 'F' for Frankenstein (Arthur C. Clarke - The Wind from the Sun) sounds like a cool short story that I need to read.
  • My old SoftEng lecturer asked the question about the lack of xlink and 'out-of-line' links in Tim's discussion, but I think Tim deftly showed that this was purely due to lack of time, and in fact the wonderful Amaya is not dead, but alive and well and living in Purley, with people at the w3c using the annotation server capabilities for useful stuff such as document reviews, cool. (I always liked the concept of Amaya, but as Tim suggests it can crash on ya)

The greatest concept that I think I'll take away from this evening is that not all data in the real world is always in the shape of a rectangle (db table) or a tree (xml), because the stuff outside of this dusty computer just isn't like that. Tim claims RDF can take us there, lets hope so...

Thanks to Tim and the Royal Society for a good presentation,

and thanks for the autograph :-)

update: All this reminds me that Jena looks like a cool java implementation of some of this semantic web stuff.

update: Slashdot examine 'Practical RDF' here, with a great overview of all the current implementations of RDF and OWL and a fun discussion on the semantic web in general.

22 Sep 2003 |

London java.meetup - sep 2003 review
Posted on 15 Sep 2003
Back from my holiday straight into another London java.meetup, a good showing with eight geeks in one London nightspot. (It was so good I even braved using the laptop in a public drinking establishment)
  • We had an academic with us discussing the intriguing Iceni project, which is a "level 2 grid computing" thingmy. All written in java. Seems to be like the distributed model you get with projects such as Seti@Home, but with authentication from the ground up. The eventual aim being to reduce number crunching tasks from years to hours, given enough hardware to throw at it.

    Sounds like it's worth taking around the block, but I'm sure the heavy clustering from various J2EE vendors is doing equivalent stuff.

    The current uses appeared to be the usual physics problems from Fourier transforms through to Meteorological studies.

    It is often funny to see the parallels between academic research, and real world (commercial) development problems, I can't quite figure from the description given whether grid computing is the next big thing, or something that has been done by another name for years before in clustering stuff.

    Oh well another download, play around, and file in my bitblog. (Also wonder if true Seda based nodes + Grid computing topology = top whack performance possible? [never a thread/node idle])

  • Asked around about the eternal Struts vs WebWork vs Tapestry vs JavaServerFaces vs RollYourOwn debate, and this time the view was Struts:2, RollYourOwn:1, JSF:-1, which was intriguing. As maintenance is an issue, the lure of Struts being a 'hirable skill' is very tempting, but we also have RollYourOwn solutions in house already (FrontController/Actions/ValueObjects/JSPs), I keep thinking that this is the promise of WebWork, but I must be missing something, as RollYourOwn still got the +1 over WebWork from one attendee...

    Dare I download Struts and be lured into the 'it only takes three days for something useable, and there is a book about it' siren song, or follow my heart (purity, simplicity, webwork1), or ditch frameworks altogether, and write my own seedwork using the wonderful megg [end shameless plug [jira]]

  • Xindice was discarded as no good for last months XML problem, due to the lack of transactional capability. Anyone know a database with performant XPath query language and full transactional aspects?.
  • Met bloke who likes to program in Scheme, but he seems a jolly nice chap. We'll do lunch soon Steve, yeah...
  • Worst of all I saw Sam Dalton, and didn't get the chance to have a proper chat, which we must address next time Sam... [p.s. Sam: upgrade your Pebble instance to the latest, greatest, or better yet try out the wonderful blogmento [shameless plug pt2], which will allow you to write blog entries on your laptop on your way home...]
  • And it looks like a wonderful new edition of the JSP 2.0 book is going to be released next week, from (formerly a Wrox title) Apress, cool.

Another fun java.meetup, lets hope we can get the numbers up to double figures (0x10) for next month...

15 Sep 2003 |

megg released
Posted on 28 Aug 2003
As promised megg is now available at sourceforge, so pop over to the project page to download and tinker.

I have uploaded the source into CVS, but sourceforge seem to be running the anonymous pserver 24 hours behind developer CVS access, so for people who want to, the current source bundle is released as a tar.gz file.

Let me know what you think of megg, I'm particularly interested in refining the template for the ant build file, with a view to adopting stuff from Hatcher and Loughran's excellent Ant book, as well as any other ideas.

go on, have a play...

28 Aug 2003 |

inconsistent gripe
Posted on 26 Aug 2003
Just a bit of bile about inconsistent API's:

Object[] o = new Object[] {"foo"};
String s = "bar";
List l = new ArrayList();

System.out.println("Array length :" + o.length);
System.out.println("String length :" + s.length());
System.out.println("List length :" + l.size());

grrrr, as if I don't have enough things to remember at my age...

26 Aug 2003 |

Funky tool coming your way soon...
Posted on 26 Aug 2003
out of my head comes 'megg' a sort of pre-project helper tool.
coming to sourceforge soon (well as soon as they approve it)

Here is an example of the (current) usage, note that the subdirectory called 'foo' didn't exist before these commands, i.e. a completely blank slate.

j6wbs@justyce:~/projects> java -jar ~/megg.jar
templateDirectory : java
domainName : com.javanicus
projectName : foo
mainClassName : Bar
 
generate:
[apply] Generating 4 file(s)
j6wbs@justyce:~/projects> find foo
foo
foo/src
foo/src/manifest.txt
foo/src/com
foo/src/com/javanicus
foo/src/com/javanicus/foo
foo/src/com/javanicus/foo/test
foo/src/com/javanicus/foo/test/BarTest.java
foo/src/com/javanicus/foo/Bar.java
foo/build.xml
j6wbs@justyce:~/projects> cd foo
j6wbs@justyce:~/projects/foo> ant
Buildfile: build.xml
 
init:
 
javac:
[mkdir] Created dir: /home/j6wbs/projects/foo/build
[mkdir] Created dir: /home/j6wbs/projects/foo/lib
[javac] Compiling 2 source files to /home/j6wbs/projects/foo/build
 
run:
[java] foo
 
BUILD SUCCESSFUL

Before you say, 'Code Generation is so last year', agreed, but I always start my little subprojects with the same step, so wanted a more efficient way to get to that starting point.

Hopefully, once in sourceforge, people could help me refine the java template, and add others (e.g. ruby/webapps etc), sort of like a 'HelloWorld' repository.

P.S. it is all powered by velocity

26 Aug 2003 |

Charging Pixies...
Posted on 21 Aug 2003
GeekSpeek was fun this week, chatting away about more cool technologies which I must make time to play with...

Keep an eye on these technologies as they are gonna be important:
Management (JSR77) and Deployment (JSR88) and the obvious picocontainer which I must play with soon...

Must also take a look at the staged event-driven architecture (SEDA)
Maybe a PicoSEDA would make a nice project for my train ride.

Also chatted about convergent arguments

...but the best bit is the revelation that pixies are inside my computer, I knew it, I knew it...

21 Aug 2003 |

JavaSpooks
Posted on 18 Aug 2003
A load of java developers piled into Smith's of Smithfield this evening, for another java.meetup, the place soon cleared as talk turned techie.

Discussion ensued on the problems of efficiently retrieving small snippets of XML from a large database of snippets.

Relational database implementations seem to slow down when the query you are doing against your datastore involves complicated (XPath) evaluations on a column, we guess because each row has to be retrieved/parsed/evaluated (a more expensive version of the like operator).

Some RDBMS vendors can provide speed up on this evaulation by creating temporary tables to represent your xml document, but this seemed to provide a maintainence overhead.

So if anyone reading this knows of a product that can search a large datastore of small XML documents with speed and ease of maintainability, let us know in a comment, ta.

Some other topics covered were:

Oh and star spotting turned up Tom Quinn (Matthew MacFadyen) from BBC's 'Spooks' but he didn't join us for a chat, obviously working on a very hush, hush java project for the government...

Another fun night out, from the java.meetup site, cheers all.

Obligatory photo of some geeks in a trendy bar

18 Aug 2003 |

A little game for lunchtime...
Posted on 14 Aug 2003
Over a lunchtime pint, Andy and I considered how easy it would be to create a virtual tour of city streets. Treating each junction as a vertex, and each road as an edge, you can apply basic graph theory to the problem.

The first results are viewable :London virtual tour (This is the route from my office to the local curry house)

Navigation is simple

  • Click on the picture to move forward
  • follow Left/Right links to rotate your viewpoint

Have a play, and let me know what you think in a comment.

14 Aug 2003 |

Free Pasta helps find bad smells
Posted on 07 Aug 2003
As I was poking around, getting familiar with the refactoring book again, I did a quick google for automatic detection of "Bad Smells" in code, and came up with the handy, and FREE tool from compuware called Pasta.

I downloaded the 1.3Mb jar, did the usual magic invocation java -jar pasta.jar and pointed it at some source of mine. It does a load of analysis and comes up with a rather pretty dependancy diagram, with all the classes/methods with no dependancies of their own at the bottom, and then other classes neatly layered on top based on their dependancies until the top of the diagram you can see the classes with no dependant classes.

funky screenshot of pasta
click to enlarge screenshot

If you look closer at the diagram, you can see that an 'acyclic dependancies principle' metric is being applied at the time, which basically means if you have arrows pointing up and down the diagram from/to any one class, then it is a bad thing. Which winds up saying my 'Cal' class smells bad.

The 'acyclic dependancies principle' or ADP is one of many metrics which you can find out more detail of in this pdf (A bit in depth really)

I like the simplicity of Pasta, things that smell bad are coloured in red, almost identical to the performance guides that JProbe gives me.

It then goes onto give this detail as to what offending dependancies it has, in this manner:

From "BlogState" to "Cal"
FromToDependency TypeLine
BlogState.getCalendarCalreturn type131
BlogState.setCalendar.cCalparameter type135
BlogState.calendarCalfield type185
 
From "Cal" to "BlogState"
FromToDependency TypeLine
Cal.setCurrentDate.stateBlogStateparameter type61
Cal.setCurrentDate.stateBlogStateparameter type67
Cal.setCurrentDate.stateBlogStateparameter type76
Cal.populateDaysBlogState.getEntriesmethod call204
Cal.populateDaysBlogState.getEntriesmethod call205
Cal.populateDays.stateBlogStateparameter type164

Not a bad tool, for a freebie, it won't refactor your code, but it will point you in some good directions. Go on download it now, whack it over your code and see what smells bad. I'd not see it before, and was pleasantly surprised. There is also another tool fresh on the scene called metrics over at sourceforge, not checked it out yet...

07 Aug 2003 |

My hour as a Martin Fowler groupie...
Posted on 31 Jul 2003
We all sat round in a circle and listened to the wise old bird, and much info was distributed amongst his followers.

Martin is over in blighty for a bit and popped into the geekspeak pub on City Road today, which was cool. He was basically sharing his own experiences...

  • FIT - Ward Cunningham has created a funky looking test tool, seems to merge the whole idea of documentation of your user acceptance tests and the tests themselves. A simple idea, which looks frighteningly powerful. Must unwrap the download and have a play in the next day or two, as documentation that is as alive as this looks like fun.
  • Domain Driven Design [Eric Evans] - Martin has reviewed and done the foward to this book, and is very excited about the content, i.e. Add it to your Amazon wish list now...
  • Mock Objects - a friendly exchange of viewpoints ensued between orthogonal Joe and Martin over the use of Mock Objects in your TDD. Martin prefering to use the real objects where possible (unless obvious problems getting an instance of the dependant object in question), and Joe likes the simplicity of a Mock. I guess the issue boils down to effectively coding the expected behaviour from your Mock. Martin, quite rightly, says that the Mock is tied to your implementation of the Object under scrutiny, rather than focusing on the job in hand, that of testing the interface and behaviour of that object.
  • Asked (off the top of his head) which five tools for a Java project he would take onto his desert island he came up with: JUnit, IntelliJ/Eclipse, Ant, CVS and Cruise Control
  • The most important aspect in coding for most of these guys seems to be the physical setup of the coding environment, for example, your business analyst accidentaly overhearing design decisions because he sits close to the developers, and feeding back on any misdirection early and often, can be a much bigger plus for a project than any tool/technique can.

It was another fun meet, nice to see some activity in London for a change, even if it is mostly the Agile Community beating the drum until we all see sense.

Kudos to Martin for his time today, much respect...

31 Jul 2003 |

london.java.Meetup.getReview()
Posted on 21 Jul 2003
Popped along to Smiths of Smithfield to meetup with a few java coders this evening, one of those fancy bars where a small coke will set you back £1.50 (almost as expensive as printer ink).

To me the most interesting topic revolved around the use of AOP, specifically with AspectJ.
The good point was made that although AspectJ has a good toolset support (Eclipse et all), the one thing in a real deployment environment that will always get in the way is maintainability. What is the point of having an amazing orthogonal experience with Aspects, when the next developer to look at your code comes along and scratches his head.
One of the main reasons we develop in Java is the 'portability of developers' across projects, so that a developer could get up and running in a short amount of time with anything assigned from above. I guess this places AspectJ onto the JavaCC/xDoclet/etc pile of amazingly useful, succinct technology but with 'immediate barrier to understanding' for the developer who has not jumped onto that particular lilypad of the Java quagmire. Now if only I could think of a useful reason to use AOP...
Let me know what wonderful/useful orthogonal aspect I can add to my code today in the comments...

Also... on the plus side for speedy xml transformations was the XSLT in firmware beauty of rack mounted box from datapower.com, although I think cost is the issue here (for me anyways).

For my loft/'broadband connection' a funky little motherboard with low noise for £70 didn't sound to bad from www.mini-itx.com, maybe this is the answer for my public cvs/blog/jira server (low noise a priority)

Java Meetup was a good laugh, and I'd recommend it to anyone who wants to get a different perspective on their java day. Thanks to Simon for organising it.

21 Jul 2003 |

Freeware Immersive Experience
Posted on 16 Jul 2003
This is an amazing setup for a flight simulator, using the freeware utility called WideView. It seems to work by allowing client PCs to connect to the master game machine over your LAN, and then farms out the appropriate viewpoints to each of the monitors connected to the client PC. I guess this means a 747 simulator like the ones at Farnborough Air Show are not so far off for the keen gamer, with a large garden shed. Now I wonder how I can get the garden shed to swoop and dive in time to the simulation...

[Thanks to Rex for the link]

16 Jul 2003 |

a bit of facetime with mike...
Posted on 10 Jul 2003
Managed to catch up with Mike on his way back from the TSS symposium.

some piccies from the london eye

I showed him the delights of London from the top of the big bicycle wheel, and we chatted about all things such as:

  • Atlassian's funky new project, which I'm looking forward to trying...
  • Dave's Quick Search Deskbar - which really is damn useful, with super-quick lookups on JDK api, ant tasks. It's like the google bar, only better. Just hit 'WindowsKey - S' and your there.
  • runtime AOP: adding behaviour on the fly sounds fun, but I'm trying to think of an useful application of it (beyond extending debuggers)
  • StatCvs - has already glammed up my cvs repositories at work, great way to see how your project has progressed, with nice charts from the ever useful JFreeChart
  • Jelly - been meaning to try this for a few months now, again need a useful reason to use it. I think it might be useful for draining data from one DB to another, I know the next release of Jira will have Jelly integrated as a form of Macro language for Jira,cool.
  • We even checked out javablogs from the top of the wheel, on my bottom of the range nokia mobile. Try it for yourself in this funky emulation of javablogs on a mobile phone
10 Jul 2003 |

blogs in space...
Posted on 07 Jul 2003
One of the {astro|cosmo}nauts on board the International Space Station is blogging whilst he watches the world go by. Quite fascinating, this is the sort of stuff we want to see, although some more hi-res piccies would be nice too...
07 Jul 2003 |

blogmento gets its own website
Posted on 04 Jul 2003
My little blogging software finally gets its own site, so why not pop along to www.blogmento.com and let me know what you think in a comment :-)
04 Jul 2003 |

3d view of my blog
Posted on 04 Jul 2003
As just a bit of fun, I tried to create a quick 3d vrml view of my blog, and came up with this

Each tower is a blog story, and each is clickable through to the story itself. Obviously very early days, but still proof that it works...

Here is the 3d view of my blog and here is a vrml plugin installation site so that you can play with it.

04 Jul 2003 |

My Radio and TV recommendations for this weekend...
Posted on 04 Jul 2003
BBC7 (sky922) - Sat 5th - 18:00 - 19:00
The Day of the Triffids pt 1 (John Wyndham)

BBC7 (sky922) - Sun 6th - 18:30 - 19:00
Fear on Four - Survival (Seeds of Time '56) (John Wyndham)

ITV (sky103) - Sun 6th - 22:00 - 22:30
The Sketch Show
Fantastic sketch show, visit fan site for some great examples...

04 Jul 2003 |

Web Services: If you can't change 'em, adapt 'em
Posted on 03 Jul 2003
Just been to a seminar in London on Web Services and the Financial Sector, interesting presentation which I'm sure wasn't aimed at someone as techie as myself. It shows that the strategy some companies are now adopting are along the lines of "We'll never persuade these companies to rewrite all their mainframe stuff into funky new containers, so lets create a marketplace out of writing adaptors/connectors into the legacy"

Ok,so it's not a particularly new strategy, but the energy and vigour in this seminar was apparent (at least from the presenters), and for some reason wrapping it all up in bulky SOAP packets was the right answer for speed and security. I remain sceptical of their claims, but admire the push for standards adoption. Trouble with standards is there are so many and these guys seemed to think that the few they were focusing on would eliminate everyones problems. I've been in the business long enough to see that, admirable and energetic as they are, the problem is still being moved around, but not yet tackled.

However the food was good, and the venue was excellent, the presentations well aimed and focused, and I might even look at the vendors products...

Patrice and I, in the heart of the city...
nice venue (I'm sure 'Trust' was filmed here)

03 Jul 2003 |

Think of a number...
Posted on 01 Jul 2003
This is a good bit of fun.

It isn't magic it seems to revolve around the 9 times table ;-)
[Your result will always be one of 9,18,27,36,45,54,63,72,81]

01 Jul 2003 |

The importance of avoiding regression
Posted on 30 Jun 2003
Now i've always been test infected, in fact I believe since working on my BBC micro I've been eager to prove code works during every stage of the development. However it was thrust home to me today how important regression testing actually is.
I won't go into the details but suffice to say, make sure your user stories actually cover every major activity before going ahead with a change. To be slack on the user stories will bite you in the end as regression can lead to sleepless nights, so test early, and test often...
30 Jun 2003 |

Hordes of the Things
Posted on 30 Jun 2003
Just finished listening to BBC7 repeat of Hordes of the Things, what a fantastic audio play it was, lovely to hear Paul Eddington (Jim Hacker:Yes, Minister) as the hapless king, and I'm sure that was Steven Pacey (Tarrant:Blakes7) in the last episode. This was one of the first audio plays I ever heard, from that golden age back at the start of the '80s, when men were men, women were women, and small furry creatures from alpha centuri were real small furry creatures from alpha centuri.
I managed to dub off a good recording at last for the archives, Sky+ is a wonderful thing, if you havent already spotted it BBC7 is doing good stuff once or twice a week, and with the manual recording facility on Sky+ you can grab some superb comedies and dramas. (Channel 922 i think, and the schedules are at www.bbc.co.uk/bbc7
I wonder if anyone has a transcription of the script for this play, it's got some real good quotes...
30 Jun 2003 |

Loving thinlets
Posted on 30 Jun 2003
I love thinlets, love them. I know there limitations, which is the best place to be, set the right expectation from your third party API, and you'll be happy. Thinlet's not only let me build a gui for my blogging editorial system, but is also one of the most logical ways to do a prototype GUI.
I've managed to knock up a working GUI, from scratch, in half an hour, ok so no back end to it, but it is wonderful for going back to the eventual user and getting early feedback on the direction a project should take, without eating into valuable hours on the train.
Now, I have to work out which the best place to submit my thinlet changes are, as thinlets do seem to have three forums, and they ignored my posting to the main website, perhaps a sourceforge development forum posting will do the trick, hmm..
Limitations, I guess the main thing is not being able to use regular swing controls inside of a thinlet JPanel, not a big issue for most, I guess, but it does sort of mandate the eventual layout I give to a GUI. Unless someone can correct me. Just means that top half of my screen will be a thinlet controlled panel, and the bottom half a JEditorPane, with funky looking search results.
30 Jun 2003 |

I was right...
Posted on 28 Jun 2003
Tania is out of the big brother house with 72% of the votes, not bad prediction powers huh!
28 Jun 2003 |

Scope creep at the dentists
Posted on 27 Jun 2003
Well after three days of tooth ache, I finally submit myself to the local dentist. Unfortunately although I have incredible shooting pain all down my right side, I'm unable to pinpoint the precise tooth that is causing all the trouble. A heated discussion ensues where we weigh up the facts of what we can see, with what the X-ray shows. I decide that, as we cannot tell which tooth is the culprit, she should do both just to be sure, but at a whopping £43 a filling I'm thinking it might be better to just eat my dinner through a straw...
27 Jun 2003 |

Blogmento is coming along nicely
Posted on 27 Jun 2003
The blogging tool that I'm writing (and this blog is generated by) is starting to shape up, and for those of you eager to see what it is going to look like, enclosed one screenshot of the editorial gui.

more details as I can get them to you...

27 Jun 2003 |

Java Gaming author without a publisher
Posted on 25 Jun 2003
Rather nice java gaming book covering Java3D and networking is in progress by a chap called Dr. Andrew Davison.

He has done lots already on this book, and he hasn't even got a publisher yet, what a bloke..! Over a dozen chapters ready to be downloaded for free, just make sure you let Andrew know about your opinions of this book.

25 Jun 2003 |

The trouble with timezones
Posted on 25 Jun 2003
It seems that if you create a value object on your server that contains a date in the default timezone for that server (GMT+0100), and then pop it over to the client with a different default timezone (GMT+0000), the date is quite correctly shown to be an hour earlier on the client than it was on the server.

This means using java.util.Date for storing just the date part of a timestamp will lead to issues as the time defaults to midnight, thus display -0100 on the client, i.e. midnight -0100 is 23:00 the day before. Solution: agree on a timezone and use the same one on both client and server. (only if your trying to store the date, the time element should not be relevent)

25 Jun 2003 |

Three girls up for eviction
Posted on 24 Jun 2003
All three of the UK Big Brother girls are up for eviction this week, I think due to the editing, internet chatter and newspapers it will be Tania to be evicted on Friday 27th, as although pleasant to look at she has been shown to be selfish and ditzy (not in a good way), and more shallow than most.

I guess she is quite young and inexperienced with the way of the world, but really - far too much money on handbags love. So Tania to go on friday 70%, with Steph and Nush getting a disinterested 15% of the votes each.

24 Jun 2003 |

 

 
October 2007
SunMonTueWedThuFriSat
  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 31
Prev | Today | Next

rss:subscribe (All)



What I'm reading
my feed aggregator ->box

My websites
London Java Meetups
Programming Projects
Elite in Java
megg
Blogmento
Jez's Photos
Fantasy Stock Market
Cool Saxophonist
Doctor Who Audios
Pisces Audios

Other Blogs
Mike Cannon-Brookes
James Strachan
Joe Walnes
Sam Dalton
Simon Brown
Cameron Purdy
Mike Roberts
Erik C. Thauvin
John Martin
Manfred Riem

B5 d++ t++ k s+ u- f
i+ o+ x-- e+ l- c--

powered by blogmento