Thursday, July 8, 2010

Roo Investigations (Part 1)

This is the first post on a series of post that I plan on making. Roo is a new productivity product from SpringSource. Why do they need another rapid application development tool? I am not totally sure but that is one of the reason's I have started looking into it. One thing I have learned over the past few years is that the folks at SpringSource know what they are doing. When the rest of the industry was going nuts over J2EE Rod Johnson was making stuff work.

What initially brought me back to look at Roo again is the fact that Bruce Johnson the lead developer for GWT (Google Web Toolkit) and Ben Alex the creator of Roo was on stage at the Google IO keynote this year and announced a partnership between the two teams. Well I am already sold on GWT for building RIA style applications and this meant I needed to pull up the Roo home page and give it a second look.

The point that I want to make today is that the whole download of Roo is around 5MB. That is impressive. I checked the Grails download and it sits around 41MB. For someone that likes to keep there code lean and mean as possible this is very cool!

A little closer look at the spring-roo distribution reveals that they are using Apache Felix for their platform. From my 10 seconds of research on Felix it looks like an OSGi container.

The last thing of note for me about Roo is the fact that the samples come as scripts that get executed in the shell. The shell actually generates the applications on the fly. I like the fact that you can potentially write a script that will generate scaffolding for the application and the application itself. I know, I know grails create-app... but that only creates a default application and then you need to run additional commands to create domains, controllers, views, etc... granted that can all be in a single .bat or .sh but that is not the standard procedure for Grails. Roo is designed to handle this kind of generation and provides commands for creating the fields and restraints.

Loving the tab completion too!

Thursday, July 1, 2010

Chrome features

Google's new browser Chrome, or not so new now, has some great features that I have just started to explore. Pinning tabs. While I had seen folks do this I had never really thought much about it. Well today there are several windows that I keep open all the time. Gmail happens to be one of them. Why take up the full amount of tab room for something that is always there and I don't need to think about it. So if you right click on the tab and select Pin it will shrink the tab down and stack it nicely off to one side. Very cool.




Then for the next level of coolness is the Gmail extension for Chrome that allows you to turn on Desktop notification. That is one feature of Outlook that I tend to like because it helps me respond promptly to important messages. Now my Gmail can have those features too.







Chrome is a crazy fast, extremely cool browser. Thanks Google!

Creating Unix scripts with Groovy

I ran across a need to write some scripts that could run on my Mac or any Linux box. I don't regularly keep up with Groovy changes but last night I ran across this article and thought it was very cool. I know very little about writing Unix shell scripts but I have been playing in Groovy and Java for a long time. So the fact that I can create a Unix like script but in Groovy makes me very happy.


#!/usr/bin/env groovy
println("Hello world")
for (a in this.args) {
println("Argument: " + a)
}


Name your file something like "project" and execute a chmod +x project. You are now good to go and can execute the Groovy code by typing ./project. Any parameters that are passed to this file will be passed to the Groovy script using the implicit args parameter.

Wednesday, June 30, 2010

Open Wonderland

Just wanted to take a few minutes to blog about the virtual world I learned about yesterday through the FLOSS weekly podcast, Open Wonderland. I am not a gamer and I have never spent more then 5 minutes of my day thinking about games or gaming technology. On the other hand, having worked for a virtual company for several years, I find myself intrigued with the possibility of being able to create virtual 3D work environments. As I am told you can do in the popular online game Second Life, you can create an avatar and maps for your workday encounters. It seems very real and there are dynamics that can only be captured by recreating this type of environment or meeting in person. The latter can be rather expensive and time consuming.

I spent 30 minutes yesterday evening and was able to get a small environment setup using Open Wonderland. This will definitely stay on the list of things to investigate. One idea would be to create an AMI with the Open Wonderland server pre-installed and ready to use. Then by executing a command a virtual workplace could be brought online. The attendees would receive a link to the workplace which would launch a Java Webstart application to provide them with entrance.

Several things I haven't looked into yet, sound, land-line connections, and video chat.

Friday, June 11, 2010

Java Date Parsing down to the millisecond

Today I ran into a problem where a String needed to be converted into a java.util.Date. The String looked like this:


String date = "16MAR2010:09:08:27.126000";


So the code to parse the date was originally written like this:


String date = "16MAR2010:09:08:27.126000";

SimpleDateFormat format = new SimpleDateFormat("ddMMMyyyy:HH:mm:ss.SSSSSS");
Date value = format.parse(date);

System.out.println(value);



The problem was that the value printed out was several minutes ahead, 9:10 instead of 8:27. The problem turns out to be that the date parsing format does not allow more then 3 values of "S" in the milliseconds placeholder.

Solution
Strip off the last 3 zeros and change the parse pattern to


SimpleDateFormat format = new SimpleDateFormat("ddMMMyyyy:HH:mm:ss.SSS");

Wednesday, June 9, 2010

Syntax Highlighter for Bloggers

Just so I don't forget and I can easily find it again I decided I would make a blog entry on where to find Alex Gorbatchev syntax highlighter. Adding the appropriate CSS and javascript references to the HEAD of my blog on blogspot allows me to use the simple syntax of this library anytime I need to show a code snippet in my blog. Thanks Alex!!

Syntax Library

A good example of using this library on blogspot can be found here

Blogger Instructions

The basics is to click on Edit Posts > Layout > Edit HTML and add the following to the header section.



Friday, June 4, 2010

Skillcaster uses GWT

For those folks that missed my talk last night on Skillcaster here is the video that I was going to show. One of the things covered last night was why GWT was chosen to build Skillcaster. The video does a nice job of explaining some of the interesting parts of GWT and does it in a way that is more interesting them me yammering at the front of a room.



I went over the application and then technologies used to build the tool.


  • GWT - Rich UI Framwork

  • Guice - Server side injection

  • Gin - Client side injection (Javascript)

  • gwt-dispatcher - Command pattern RPC

  • gwt-presenter - MVP framwork

  • gwt-log - logging framework

  • gwt-pectin - binding framework



I will be working on getting the project moved to Google Code soon and I will send out links for everyone that may be interested in learning more or contributing to the development of Skillcaster.