Monday, October 6, 2008

jQuery - Creating Modal Dialogs

I am still working my way through the jQuery in Action book and I still need to write a review on it...soon....
Well, this weekend I was checking out several jQuery plugins - In my home project I needed to replace a few old-school/legacy JavaScript confirmation boxes with something more stylish looking. While jQuery by itself is very nice, its plugin mechanism and consequently its plugin repository is simply impressive. There is almost too much choice ;-) Anyway, there were several plugins for creating modal dialogs. I finally settled on SimpleModal - So far it worked quite well and the documentation is helpful, too.

The next plugin I have to look at is Live Query. I use a few Ajax driven data grids that return DOM nodes to which I would like to attach events. Live Query watches out for those node changes and applies some magic to make it work.

Friday, September 26, 2008

Creating Excel Files with POI - Issue

HSSF (Horrible SpreadSheet Format) is a great library for creating Excel spread-sheets using Java. It is part of the larger Apache POI project. Yesterday I hit an interesting issue while creating an Excel file with a modestly large collection of elements.

The Excel file was generated fine by HSSF but when opening it, Excel greeted me with the following message:

"some text formatting may have changed in this file because the maximum number of fonts was exceeded"

As it turns out, Excel only allows for a limited amount of styles/fonts to be used. Thus, the good advice when dealing with Excel files is to reuse styles and fonts wherever possible. It also results in substantially smaller Excel files. I was able, in my little example, to reduce the file-size from 54kb to 17kb, just by refactoring my usage of styles.

On last interesting observation: Once you hit that popup error in Excel, it does not simply suffice to close the Excel file, but you must restart Excel in order for the message not to popup again.

Friday, September 12, 2008

Flex and Maven First Steps

I finally decided to take the plunge and started learning Flex last night. First I wanted to setup my environment. As I don't have a Flex Builder License (My Evaluation License Expired before I had a chance to actually use it...arrgh...) I started creating a simple build environment that works with a plain Eclipse setup.

As far as I see there are 2 options out there:

http://www.israfil.net/projects/mojo/maven-flex2-plugin/
http://code.google.com/p/flex-mojos/

After some Googling the there seemed to be a preference for flex-mojos. So I decided to go with it.

Getting my first hello-world compile using flex-mojos was a bit tricky. The issue is that flex-mojos is under heavy development and seems to change a bit. E.g. the location of their Subversion repository and Maven repository changed which however is not necessarily reflected in their examples. Nevertheless there is a very helpful blog and a useful wiki available.

In order to keep up with the project, I decided to also check-out the latest flex-mojo trunk from Subversion and build it locally. Well, it turns out that my local Maven version on my MacBook Pro was not up-to-date but finally I got everything running.

Thus, after some fiddling around I got my first Maven-based Flex-Hello-World running.

In my next post I blog about some further progress and also some of the configuration that was necessary.

As it got really late last night I came across good read about building Flex applications using Maven and Flex-mojos:

http://www.adobe.com/devnet/flex/articles/fullstack_pt1.html
http://www.adobe.com/devnet/flex/articles/fullstack_pt2.html
http://www.adobe.com/devnet/flex/articles/fullstack_pt3.html

Upgrading Maven on Apple's Leopard

Today on my MacBook Pro I needed to upgrade the pre-installed Maven version 2.0.6 to the latest Maven version 2.0.9.

This gave me a good reason to install MacPorts. The took a little bit of time, especially since as a pre-requisite I also needed to install Apple's Xcode which comes along as a hefty 1GB download.

Once it was downloaded and installed, I installed MacPorts. For some reason after the MacPorts installation successfully finished, executing sudo port -v selfupdate did not work. The port command was not found... Well, it turns out that I needed to add the path to my .profile which is located in the home directory:
  • export PATH=/opt/local/bin:/opt/local/sbin:$PATH
  • export MANPATH=/opt/local/share/man:$MANPATH
That did the trick.

Lastly, all I needed to do in order to install the latest Maven version was to execute:

sudo port install maven2

Maven 2.0.9 was immediately available thereafter:

mvn -v

Wednesday, September 10, 2008

Effective Java @ Parleys - Presentation

I loved reading Effective Java Second Edition by Joshua Bloch - At Parleys they have a presentation by Joshua Bloch on some of the issues discussed in the book. It is really a great presentation and I can only highly recommended it (e.g. for understanding PECS when dealing with generics (producer extends, consumer super)).

Tuesday, September 9, 2008

jpwgen - Password Generator for Java

If you ever have the requirement to auto-generate passwords that must meet certain security guidelines such as having at least one number, a special character etc. then take a look at jpwgen. It is written in Java and is based on pwgen (unix).

What is nice about it is that you can use it both as a command line program and/or as a library within your applications.

By the way, if you need a GUI tool for Windows to generate passwords, check out pwgen-win

Monday, September 8, 2008

A Life-Changing Event...

On August 27, 2008 our daughter Leah Annarose was born. As I am posting this, she is already almost 2 weeks old.

Time is racing by, to say the least - The last 2 weeks were really amazing and having a child is a truly new experience; a great one.

For the years to come, it's now time to be a dad.

Thursday, August 21, 2008

Adobe Flex in Atlanta

Our yesterday's AJUG meeting has been awesome. James Ward delivered a great presentation on Adobe Flex and the room was packed (100+ attendees). I just hope Sun can still pull off Java FX and make it truly rock solid because Adobe Flex looks cool and very polished to say the least. Also the integration with Java backends also looked very nice (Adobe's BlazeDS or Granite Data Services). One of the demo's James showed can be found here.

Additionally, here in Atlanta there are more and more Flex projects going on...I wonder if it starts reaching a tipping point.

Finally, I think I need to check out the Atlanta Flash and Flex User Group, especially since it is just around the corner from where I live :-)

Wednesday, August 20, 2008

AJUG DevCon 2009 - Planning

At the Atlanta Java User Group, we are in the middle of planing the 2009 Java DevCon conference. As of now the conference will take place from March 10-11 in Atlanta. We are planning for around 400 attendees. Thus, over the coming couple of weeks we need to finalize our list of speakers. If you're interested in presenting at DevCon feel to contact AJUG at info at ajug dot org or you can also contact me directly at gunnar at hillert dot com.

Tuesday, August 5, 2008

Spring does not like IBM's Java Runtime Environment

I had to learn the hard way that Java JVMs from from different vendors may behave slightly differently - As it turn out, one of my little apps was running fine on Sun's JVM but was causing a weird NPE on IBM's Java Runtime Environment (1.6 64bit)

As it turns out, this was already a reported issue in Spring's Jira. Even better - it was already fixed and after updating Spring from 2.5.3 to 2.5.5 everything is running smoothly again.