 |
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.
|
|
 |
|
|
 |
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.
|
|
 |
|
|
 |
Third Groovy Developers Conference
|
|
 |
 |
Posted on 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 :-)
|
|
 |
|
|
 |
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 + "")"")
}
}
|
|
 |
|
|
 |
Tech Presentations for your ipod
|
|
 |
 |
Posted on 19 Sep 2006
|
 |
|
Some excellent presentations to watch online or on your ipod
|
|
 |
|
|
 |
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.
|
|
 |
|
|
 |
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.
|
|
 |
|
|
 |
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.
|

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.
|
|
|
 |
|
|
 |
Lucene and Groovy example
|
|
 |
 |
Posted on 22 Apr 2005
|
 |
|
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 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])
def dataDir = new File(args[1]) def start = new Date().time
def numIndexed = index(indexDir, dataDir)
def end = new Date().timeprintln "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)
writer.useCompoundFile = false dataDir.eachFileRecurse {
if (it.name =~ /.txt$/) {
indexFile(writer,it)
}
}
def numIndexed = writer.docCount()
writer.optimize()
writer.close()
return numIndexed
}void indexFile(writer, f) {
if (f.hidden || !f.exists() || !f.canRead() || f.directory) { return } println "Indexing $f.canonicalPath"
def doc = new Document()
doc.add(Field.Text("contents", new FileReader(f)))
doc.add(Field.Keyword("filename",f.canonicalPath)) writer.addDocument(doc)
}
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 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])
def q = args[1] 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) def query = QueryParser.parse(q, "contents", new StandardAnalyzer())
def start = new Date().time
def hits = is.search(query)
def end = new Date().timeprintln "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"])
}
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.
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$/) {
indexFile(writer,file)
}
}
}
return numIndexed
}
...
My thanks to Erik and Otis for allowing me to make their examples more Groovy.
|
|
 |
|
|
 |
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.
|
|
 |
|
|
 |
Too busy...
|
|
 |
 |
Posted on 15 Jan 2005
|
 |
|
too busy hacking to blog...
|
|
 |
|
|
 |
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
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()
}
|
|
 |
|
|
 |
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 :-)
|
|
 |
|
|
 |
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.
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)
|
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)
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.
|
|
 |
|
|
 |
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.
|
|
 |
|
|
 |
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 - catNow 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 methodsGrash 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.NOTESHow 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
|
|
 |
|
|
 |
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.
Cameron very kindly managed to get at least six people from the seminar to then show their faces at the London Java Meetup.
A great turnout at tonight's meetup, finally Carlos managed to make it along, yay.
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.
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.
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.
|
|
 |
|
|
 |
London Java Meetup - tonight
|
|
 |
|
 |
Ninja Joe
|
|
 |
 |
Posted on 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.
|
 |
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.
|
 |
 |
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.
|
 |
 |
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... |
|
|
 |
|
|
 |
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
|
|
 |
|
|
 |
War of the Worlds
|
|
 |
 |
Posted on 17 Aug 2004
|
 |
|
|
 |
Java on the Blackberry
|
|
 |
 |
Posted on 09 Aug 2004
|
 |
|
 |
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...
|
|
 |
|
|
 |
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.
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.
|
|
 |
|
|
 |
Build your own spacecraft
|
|
 |
 |
Posted on 09 Jul 2004
|
 |
|
|
 |
Local JMS for local people
|
|
 |
 |
Posted on 23 Jun 2004
|
 |
|
|
 |
Hitchhikers returns on 21 September
|
|
 |
 |
Posted on 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.
|
|
 |
|
|
 |
wiki's and the UML
|
|
 |
|
 |
...so last week
|
|
 |
|
 |
sketching in the UML - Visual Thought
|
|
 |
 |
Posted on 15 Jun 2004
|
 |
|
 | I 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. |
|
|
 |
|
|
 |
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] |  |
|
|
 |
|
|
 |
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...
|
|
 |
|
|
 |
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.
|
|
 |
|
|
 |
I wanna rock...
|
|
 |
 |
Posted on 10 Jun 2004
|
 |
|
 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
|
|
 |
|
|
 |
Fun with Techie's (London,this.Sunday)
|
|
 |
|
 |
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.
|
|
 |
|
|
 |
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...
|
|
 |
|
|
 |
The British Computer Society
|
|
 |
 |
Posted on 29 May 2004
|
 |
|
|
 |
Music to code to...
|
|
 |
 |
Posted on 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)
|
|
 |
|
|
 |
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...
|
|
 |
|
|
 |
Lecture, from chap who walked on the Moon, next Wednesday...
|
|
 |
|
 |
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.
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...
- DocSynch - a plugin for JEdit, uses IRC plugin as transport
- Sangam - plugin for Eclipse, that keeps the driving seat analogy of pair programming.
- SubEthatEdit - Shared editing using MacOSX Rendezvous
- Groove - a commercial real-time collaboration suite, from Ray Ozzie
- VNC - great, cross platform tool, however, only one person in control, at a time.
- The Microsoft NetMeeting application 'Whiteboard' seems to have been deprecated
please have a play and let me know your thoughts....
|
|
 |
|
|
 |
Strangers on a train...
|
|
 |
|
 |
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.
|
|
 |
|
|
 |
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...
|
|
 |
|
|
 |
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>
|
|
|
 |
|
|
 |
Christopher Eccleston - new Doctor Who TV Series
|
|
 |
 |
Posted on 20 Mar 2004
|
 |
|
|
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.
|
|
|
 |
|
|
 |
Spaced - The Movie
|
|
 |
|
 |
LNE - my Robot strategist
|
|
 |
 |
Posted on 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.
|
 |
|
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.
|
|
 |
|
|
 |
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.
|
|
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.
Thanks to Colin and the Royal Society for another interesting evening.
|
|
 |
|
|
 |
London Java Breakfast Meetup - review
|
|
 |
 |
Posted on 01 Mar 2004
|
 |
|
|
 |
Just met Gary Russell
|
|
 |
|
 |
Carlos in London Baby!
|
|
 |
|
 |
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...
|
|
 |
|
|
 |
Snow falls...
|
|
 |
 |
Posted on 28 Jan 2004
|
 |
|
Shadow has been enjoying his first snowfall...
|
|
 |
|
|
 |
Halliwell's Hundred
|
|
 |
|
 |
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 ;-)
|
|
 |
|
|
 |
Sweet Panic (Free Theatre Performance)
|
|
 |
 |
Posted on 21 Jan 2004
|
 |
|
|
 |
Transported back to 1978
|
|
 |
|
 |
Java in Space
|
|
 |
|
 |
box: wrapped up in a webapp
|
|
 |
|
 |
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)
|
|
 |
|
|
 |
box: source code available
|
|
 |
 |
Posted on 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.
|
|
 |
|
|
 |
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...
|
|
 |
|
|
 |
London Java Meetup - Xmas review
|
|
 |
|
 |
Play with Groovy today
|
|
 |
 |
Posted on 12 Dec 2003
|
 |
|
|
 |
The Great Fire of London
|
|
 |
|
 |
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...?
|
|
 |
|
|
 |
xwork/webwork2 logo contest
|
|
 |
|
 |
Lasers can be fun...
|
|
 |
|
 |
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 :)
|
|
 |
|
|
 |
funny email humor
|
|
 |
 |
Posted on 27 Nov 2003
|
 |
|
some fun screenshots here
|
|
 |
|
|
 |
megg(site|thinlets|webwork2) updates
|
|
 |
|
 |
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...
|
|
 |
|
|
 |
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...
|
|
 |
|
|
 |
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:
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?
| none | get | set | get+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?
|
|
 |
|
|
 |
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 :)
| |  |
|
|
 |
|
|
 |
A cat joins the household
|
|
 |
|
 |
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.
|
|
 |
|
|
 |
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.
|
|
 |
|
|
 |
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...
|
|
 |
|
|
 |
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
|
|
 |
|
|
 |
Charging Pixies...
|
|
 |
 |
Posted on 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.
|
|
 |
|
|
 |
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.
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" |
From | To | Dependency Type | Line |
BlogState.getCalendar | Cal | return type | 131 |
BlogState.setCalendar.c | Cal | parameter type | 135 |
BlogState.calendar | Cal | field type | 185 |
|
From "Cal" to "BlogState" |
From | To | Dependency Type | Line |
Cal.setCurrentDate.state | BlogState | parameter type | 61 |
Cal.setCurrentDate.state | BlogState | parameter type | 67 |
Cal.setCurrentDate.state | BlogState | parameter type | 76 |
Cal.populateDays | BlogState.getEntries | method call | 204 |
Cal.populateDays | BlogState.getEntries | method call | 205 |
Cal.populateDays.state | BlogState | parameter type | 164 |
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...
|
|
 |
|
|
 |
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...
|
|
 |
|
|
 |
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.
|
|
 |
|
|
 |
Freeware Immersive Experience
|
|
 |
|
 |
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.
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
|
|
 |
|
|
 |
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...
|
|
 |
|
|
 |
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 :-)
|
|
 |
|
|
 |
3d view of my blog
|
|
 |
|
 |
My Radio and TV recommendations for this weekend...
|
|
 |
 |
Posted on 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...

nice venue (I'm sure 'Trust' was filmed here)
|
|
 |
|
|
 |
Think of a number...
|
|
 |
|
 |
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...
|
|
 |
|
|
 |
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...
|
|
 |
|
|
 |
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.
|
|
 |
|
|
|