Watching four channels of the olympics at once thanks to a list of TV NZ streams:
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.
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:
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.
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.
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: development
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?

