Mark Derricutt's Disturbing Thoughts

My Top Tags

                                       

My Jaiku

The BGGA myth - Functional Java | Google Groups

Wednesday, 20 August 2008 7:33 A GMT+12

Spock's Beard – On A Perfect Day (live)

Wednesday, 20 August 2008 5:57 A GMT+12

Ola Bini: JtestR 0.3.1 Released

Tuesday, 19 August 2008 10:00 P GMT+12

Enslaved – Violet Dawning

Tuesday, 19 August 2008 6:14 A GMT+12

Distributed Messaging with Jetlang and Terracotta

Monday, 18 August 2008 10:17 P GMT+12

The Music of 2008 - week 33

Monday, 18 August 2008 8:57 A GMT+12

There Can Be Only One

Monday, 18 August 2008 8:10 A GMT+12

Silent Force – Point Of No Return

Monday, 18 August 2008 6:30 A GMT+12

In Relation To...  Hibernate Core 3.3.0 goes GA

Saturday, 16 August 2008 7:03 P GMT+12

Search Box

 

Latest Entries

The Music of 2008 - week 33

Sunday, 17 August 2008 10:05 P GMT+12
  • The Choir - Let It Fly
  • Deuteronomium - From the Midst of the battle
  • Enslaved - Isa
  • The Human Abstract - Midheaven
  • Mastedon - Lofcaudio / It's a Jungle Out There
  • Neal Morse - One / Sola Scriptura / Testimony / ?
  • Nevermore - Dead Heard, In a Dead World / Enemies of Reality / In Memory / Nevermore / This Godless Endevour
  • One-way Mirror - One-way Mirror
  • John Schlitt - The Grafting
tags:    
Category: music

The Music of 2008 - week 32

Monday, 11 August 2008 12:36 A GMT+12
  • inExordium - inExordium
  • My Dying Bride - The Dreadful Hours / The Light At The End Of The World / A Line Of Deathless Kings / Songs of Darkness, Words of Light / 34.788%... Complete
  • Naglfar - Harvest
  • Narnia - Enter The Gate / The Great Fall
  • Neaera - Armamentarium
  • Scars on Broadway - Scars on Broadway
tags:    
Category: music

Olympic Streaming

Sunday, 10 August 2008 8:04 P GMT+12

Watching four channels of the olympics at once thanks to a list of TV NZ streams:

Olympic Streaming

I'd love a TV specific application that handled these streams for me with a bit more ease than simply having multiple Quick Time players open.

As I've not yet found any compelling reasons to get Freeview, and my normal TV reception is nothing more than snow this is the best way to see the coverage.

tags:    
Category: technology

Google XML Pages

Monday, 4 August 2008 12:14 A GMT+12

In the original incarnation of my simple time tracker application I had used freemarker as a template engine for the email report. For this new incarnation I thought I'd take the newly open sourced Google XML Pages (GXP) for a spin.

Unlike JSP pages which generate and compile .java files on the fly, GXP generates .java files up front as part of your build process and forms a type safe API to the rest of your application to use. Just as Apache Wicket brings type safety to your web applications Session and Pages, GXP brings it the same power to your templates.

A short example is the Work Item Summary template:

<gxp:template name='com.theoryinpractice.timetrackr.gxp.WorkItemSummary'
              xmlns='http://www.w3.org/1999/xhtml'
              xmlns:gxp='http://google.com/2001/gxp'>
  <gxp:import package="java.util"/>
  <gxp:import package="com.theoryinpractice.timetrackr.vo"/>
  <gxp:import package="com.theoryinpractice.timetrackr.pages"/>
  <gxp:param name="reportForDate" type='String'/>
  <gxp:param name="formattedTimeFor" type='String'/>
  <gxp:param name="activities" type='List{ActivityReport}'/>
  ...

Once generated and compiled, this is called in java with:

List<ActivityReport> activities = new ArrayList<ActivityReport>();
...
StringBuilder buffer = new StringBuilder();
WorkItemSummary.write(
  buffer, new GxpContext(Locale.getDefault()),
  reportForDate,
  TimeFormat.format(userManager.calculateTimeForUser(user, Boolean.FALSE)),
  activities
);

The generated API is clean and simple to use, a single method to call with the required parameters and you're away laughing. Comparing this with how I've used velocity and freemarker in the past, I can already see several benefits:

  • You break your template, you break your build.
  • If you add/remove parameters to a template without changing the code, you break your build (I'd rather have a build broken in 5 places, than have a deployment break in the 1 that was used by QA guy #3)
  • Templates are now first-class citizens in your application
  • Templates can easily be bundled/modularized (and safely used across class loaders - OSGi I'm thinking of you!)

The GXP template may be a little bit more wordy than the original freemarker version, but the safety it brings to the build is well worthy the XML.

tags:      
Category: technology

Simple time tracker code published

Sunday, 3 August 2008 10:23 P GMT+12

Following on from last weeks post about my simple wicket based time tracker, the code has been published to github.

The more I revisit the projects code the more semi-broken pieces I find which will be patched up and improved over the coming weeks.

tags:      
Category: technology

The Music of 2008 - week 31

Sunday, 3 August 2008 8:39 P GMT+12
  • Alice Cooper - Along Came A Spider
  • Glenn Hughes - First Underground Nuclear Kitchen
  • Ministry - The Dark Side Of The Spoon / Houses of the Mole / The last sucker / Rio Gande Blood
  • Moonspell - Darkness And Hope / Irreligious / Memorial / Sin/Pecado
  • Mortal - Fatham / Lusis / Nu-En-Jin / Pura
  • Morte Macabre - Symphonic Holocaust
  • Mortification - EnVision EvAngelene / Erasing The Goblin / Hammer Of God / Blood World / Post Momentary Affliction / Primitive Rhythm Machine / Relentless / Scrolls of the Megilloth / The Silver Cord Is Severed
  • Motorhead - Inferno
  • Mullmuzzler - Keep it to Yourself / Mullmuzzler 2
  • My Chemical Romance - Three Cheers For Sweet Revenge
  • One Day As A Lion - One Day As A Lion
tags:    
Category: music

The Music of 2008 - week 30

Sunday, 27 July 2008 11:35 P GMT+12
  • Beardfish - Sleeping in Traffic Part 1 / Sleeping In Traffic Part 2
  • Daylight Dies - Lost To The Living
  • Grand Magus - Iron Will
  • Earworm - Serious Ear
  • Equilibrium - Sagas
  • Hillsong - This is our God
  • Mercy Fall - For The Taken
  • Meshuggah - Catch Thirtythree
  • Metallica - Black Album
  • Michael W. Smith - Healing Rain
  • Midnattsol - Where Twilight Dwells
  • Obituary - Left for Dead EP
  • Spock's Beard - Live
  • The Red Chord - Prey For Eyes
  • War of Ages - Arise and Conquer
tags:    
Category: music

Simple Time Tracker redux

Sunday, 27 July 2008 11:28 P GMT+12
Since originally writing my Simple Time Tracking application I've been meaning to migrate the project away from version 2.0 of the wicket framework (which was ultimately scrapped) to the current 1.4 milestone releases and publically release the code. On a cold and wet evening I spent a few hours pulling the code out of storage and updating it, as it's been ages since I've used wicket I thought it'd also be good to document what changes I'm making.
  • Change imports from wicket.* to org.apache.wicket.*
  • Replace ISessionFactory getSessionFactory() with Session newSession() on the Application class.
  • Revert component constructor changes - Wicket 2.0 took the parent in the constructor where as 1.4 uses the original scheme.
  • Add generics to Model instances.
Outside of changing the imports and constructors used in the project there was little to change really - to me this is a huge win in Wickets' favour (I don't think Tapestry users can say such a thing), however I did run into one problem with generic models. The Model interface expects its generic argument to extend Serializable which is quite understandable - however it did mean I had to change my API to start using ArrayList instead of List, a minor inconvenience but one I can live with for now.

For some reason the screen cast above only plays in Safari for me and not in Firefox, hopefully it works for other people.

I should have the initial code-drop up on google code or somewhere else in the next few days after a few more regression bugs have been sorted.

Technorati Tags:

tags:    
Category: technology

Pascal gets closures before java - why hasn't the world ended?

Friday, 25 July 2008 11:09 P GMT+12

So I see Delphi now has generics and closures in its upcoming "Tiburon" release:

type
  // method reference
  TProc = reference to procedure(x: Integer);               

procedure Call(const proc: TProc);
begin
  proc(42);
end;

Use:

var
  proc: TProc;
begin
  // anonymous method
  proc := procedure(a: Integer)
  begin
    Writeln(a);
  end;               

  Call(proc);
  readln
end.

I'd have loved have had both of these features back in the day when I was still doing Delphi. As much as I no longer like the Pascal syntax, I love how cleanly the anonymous method declaration sits within the natural flow of things (although I'm not sure an inline method directly on the call to Call() would sit well).

My only question is, if Pascal can evolve why can't java?

Sure the Tiburon release can do this because the underlying .NET VM now supports the functionality, but thats not the point. Ok?

tags:      
Category: technology

The Music of 2008 - week 29

Sunday, 20 July 2008 11:27 P GMT+12
  • Blackfield - Blackfield II
  • Martriden - Unsettling Dark
  • Masterplan - Aeronautics / Mk II
  • Mastodon - Blood Mountain
  • Megadeth - Countdown to Extinction / Hidden Treasures / The System Has Failed / United Abominations
  • Mercenary - Architect of Lies
  • Nachtmystium - Assassins: Black Meddle Pt. 1
  • Raunchy - Wasteland Discotheque
  • The Rotted - Get Dead or Die Trying
  • Sever Your Ties - Safety In The Sea
  • Sonic Syndicate - Only Inhuman
  • Soulfly - Conquer
tags:    
Category: music