Jeremy Rayner on java and other stuff.

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

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

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

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

go on, have a play...

28 Aug 2003 |

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

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

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

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

26 Aug 2003 |

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

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

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

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

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

P.S. it is all powered by velocity

26 Aug 2003 |

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

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

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

Also chatted about convergent arguments

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

21 Aug 2003 |

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

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

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

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

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

Some other topics covered were:

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

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

Obligatory photo of some geeks in a trendy bar

18 Aug 2003 |

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

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

Navigation is simple

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

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

14 Aug 2003 |

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

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

funky screenshot of pasta
click to enlarge screenshot

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

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

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

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

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

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

07 Aug 2003 |

 

 
August 2003
SunMonTueWedThuFriSat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
Prev | Today | Next

rss:subscribe (All)



What I'm reading
my feed aggregator ->box

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

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

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

powered by blogmento