On our way to the Gateway Software Symposium

We're taking most of our team to the St. Louis, Missouri, edition of the No Fluff Just Stuff 2008 tour. This will be my first actual NFJS event. I attended the Spring Experience in 2007, which was put on by the NFJS guys, so I expect this event in St. Louis to be great. Since we're based in Memphis, St. Louis is only about a 4 1/2 hour drive. We're all going to pile in a van and road trip. It should be a great time.

I'm going to have a hard time choosing sessions: Neal Ford, Scott Davis, David Geary, Jeff Brown, and Bryan Sletten all have sessions that I'd like to attend, several of which are in conflict. I hope they do post-conference video delivery of these sessions just like they're doing for the Spring Experience.

If anyone's going to be there, let's do dinner one night and you can meet some of the St. Jude team.

Set Conditional Breakpoints in IDEA

So yesterday I was attempting to debug an issue in a batch processing module within one of our applications. In short, an assertion was failing deep within Hibernate as it attempted to flush the session. Using a combination of various log statements, I had isolated the problem down to a particular record that the batch process was attempting to update. (BTW: I know you shouldn't be using Hibernate for batch processing - however, we're talking about batches of at most 1000 records here, not millions!) What I really wanted to do was set a breakpoint and examine the state of the objects at runtime; however, I dreaded the thought of clicking through the breakpoint time and time again until I got to the particular record that was causing the problem. "Surely," I thought, "there must be a way to tell the debugger to only break under certain conditions."

So, here's the code I wanted to examine:

public Publication parsePublication(String inputLine)
throws ParseException {
Publication publication = new Publication();

String[] fields = inputLine.split("\t");

return publication;

Essentially, I wanted to break after inputLine.split("\t"); if and only if fields[35] existed and was equal to "PM:16732581." After examining IDEA's Breakpoint dialog, I noticed a section in the bottom right-hand corner that I'd never played with before:

As it turns out, this is exactly what I needed. If you click on the ellipsis next to the drop menu, you get a context-sensitive editor equipped with code completion:

Enter the desired conditions and voila! A conditional breakpoint. It worked like a charm the very first time, and I only had to inspect the breakpoint when the problematic record came up.

Another nice feature of the conditional breakpoint is that if some sort of exception (such as a NullPointerException) occurs while attempting to evaluate the conditional expression, IDEA pops up a dialog informing you what happened and asking if you want to stop at the breakpoint or continue. Nice.

Grails 1.0 Released!

Grails, by far my favorite of the JVM dynamic language frameworks, was released this morning, with a snazzy, new, "Web 2.0 style" website to boot. Congratulations Graeme and company on all of your hard work!

A Javascript Code "Prettifier"

I came across a link today that would allow you to post "pretty" code in any HTML page. I've had plenty of problems (as have others) posting well-formatted source code to my Blogger-based blog. I've wanted to correct this problem for some time, and this project appears to be a decent solution. Here's an example:

function chooseWinner() {
participantBo.chooseWinnerForEvent(eventId, function(data) {
people = $A(data);
intervalId = setInterval(doShift, 500);

Now that isn't too bad is it? There seems to be a bit of a delay as the Javascript is loaded, but I think that's more a symptom of my connection than it is a problem with the script.

Here's how you can take advantage of this solution (quoted from http://google-code-prettify.googlecode.com/svn/trunk/README.html):

  1. Download a distribution
  2. Include the script and stylesheets in your document
    (you will need to make sure the css and js file are on your server, and
    adjust the paths in the script and link tag)
    <link href="prettify.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript" src="prettify.js"></script>

  3. Add onload="prettyPrint()" to your
    document's body tag.
  4. Modify the stylesheet to get the coloring you prefer

  5. Put code snippets in
    <pre class="prettyprint">...</pre>
    or <code class="prettyprint">...</code>
    and it will automatically be pretty printed.

The Spring Experience 2007 - Videos on the way!

I got an awesome email today...

We are happy to announce that the video/audio streaming from TSE 2007 will be available online the week of February 11th for you. You will have the opportunity to see/hear the TSE 2007 presentations you were not able to make at TSE 2007 due to all of the great sessions available per time period. We have captured the entire session length including any demos/live coding. Please look for the email from us next Monday, February 11th with the details about viewing the session content online.
I'm extremely excited about this. For two reasons:
  1. I didn't get to finish my reviews of the sessions that I attended. Now that it has been several weeks since the conference, I don't feel like my memory of them is good enough to do a fair review. Now I can do a refresh and write!
  2. There were several sessions that I wanted to attend that I couldn't - now I get to attend...and write!
Look forward to some more reviews from The Spring Experience 2007 in the coming weeks!