Little Man


Here's little man Grant himself smiling for the camera!
Posted by Picasa

Introducing Grant Dawson Stine

So I haven't blogged in quite awhile. I've been rather busy - here's one VERY important reason why. Grant was born Friday, May 16, 2008, weighing in at 9 pounds 4 ounces and 22 inches long. Mom and baby are doing wonderfully, but as you can see, Dad is in a bit of shock!





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");

publication.setPublicationType(fields[0]);
...
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() {
$('p3').removeClassName('winner');
participantBo.chooseWinnerForEvent(eventId, function(data) {
people = $A(data);
updateDivs();
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!


Practical JRuby on Rails Web 2.0 Projects

Are Java's days numbered as a web development technology? With buzzwords like Ruby, Rails, and Web 2.0 zipping around the web development community, one may begin to wonder. Could Java's lifespan be extended by finding synergy between Java and Ruby? On the scene comes JRuby, the definitive implementation of Ruby for the JVM. In his new book from Apress, Ola Bini guides the reader through the development of four Web 2.0 projects using JRuby on Rails. I think that Bini does a masterful job of always using the right tool for the right job. Read my review for complete details.

Mid-Year Review: My Professional Development Goals for 2007-2008

Back in July I posted my professional development goals for the year (My performance review is annually in July, so it's a good time to set goals.), and it seemed like a good idea to take a look at my progress while doing the "New Year's Resolution" thing.

  1. Learn Groovy and Grails

    Andy and Dave suggest learning a new language every year, so this seemed like a good goal for me. I can't say that I've truly learned Groovy and Grails in depth, but I did learn them enough to do a presentation on them (as well as Ruby, JRuby, and Rails) at our Java User Group meeting in October, so I've effectively touched on two languages and two frameworks for those languages. I've since gotten interested in Scala as well. At any rate, I'd like to go deeper w/ Groovy and Grails as I have time, which is scarce!

  2. Release HallKeeper v1.0 as part of #1

    This project seems destined to fail. I haven't worked on it in any meaningful way since the summer. I've thought about it in the past week, and I'd actually like to try doing it in straight Java POJOs with Spring and Hibernate since I'm more well-versed in that area. At any rate, it really is my lack of spare time that keeps this one on the perpetual back burner.

  3. Read and LEARN the following books:

    • The Definitive Guide to Grails - Rocher
    • The Pragmatic Programmer - Hunt, Thomas
    • Computer Algorithms: Introduction to Design & Analysis - Baase, Van Gelder
    • Concepts of Programming Languages: Sebesta
    • Groovy in Action - Konig

    I've pretty much finished #1, got started on #2, and haven't really touched the last three. Again, the needs of the moment have necessitated I focus on other areas, particularly other books. Recent projects have pointed me to three additional books I'd really like to cover this year, so I may not get to my original list. Here are the titles:

    • Working Effectively with Legacy Code - Feathers
    • POJOs in Action - Richardson
    • Domain Driven Design - Evans

  4. Review two books for the JavaLobby/DZone book review team

    This is one I've hit the nail on. I just completed my second book review, which will be published some time in the next few weeks. My first review, Ajax Construction Kit: Building Plug-and-Play Ajax Applications, was published in October 2007. These have been rather time consuming and have kept me from other projects, so I don't plan to take any more reviews this year.

  5. Pass the Sun Certified Programmer for the Java 2 Platform, Standard Edition 5.0 Exam

    Haven't touched this one yet. Preparing for this will be one of my foci in the coming weeks.

  6. Write one Java/software development blog article per week

    I haven't done so hot on this one. OK, let's be really honest. I haven't come close. However, my recent flurry of entries on The Spring Experience 2007 have gotten me into a bit of a groove. I'm going to try to keep up the momentum and finish this year strong.

  7. Attend JavaOne 2008 or similar conference

    I've actually traveled twice since my original post. My first trip was to the Northeast Life Sciences Core Directors Meeting last November at Cornell University in Ithaca, NY. The purpose of this trip was to present and generate interest around our open source shared resource management system for core facilities, STJUDE-SRM. The trip was a great success. My second trip really fulfills this goal, as I attended The Spring Experience 2007 in Hollywood, FL. This proved to be one of the best technical conferences I've ever attended, and also one of the most fun!

  8. Start a Memphis/Mid-South Area Java User Group

    I don't think this goal could have gone any better than it has. In late July I started a Google Group and a small Google Page Creator website to attempt to drum up interest in a Java User Group for the Memphis, TN and surrounding Mid-South area. On July 23, 2007, along comes Diane Tabulog, a technical recruiter with local company Vaco Technology, who convinces her company to throw its support behind our JUG. All of a sudden we have an offer for a meeting location, food budget, giveaways, etc. Later, Clayton Naeve, our CIO at St. Jude, agreed to let us use our awesome conference room at our division's new offices at 160 Shadyac Avenue to meet, as Vaco's facilities were a bit small. On August 15, Carol McDonald, a Java Technology Evangelist from Sun Microsystems, offered to speak at our JUG, and we signed her up for the first meeting. Little by little, all of the necessary pieces started to fall into place, including additional free giveaways from Sun, O'Reilly, Atlassian, and JetBrains. The first meeting was a great success, and since then we've had two more successful meetings. Our next meeting is Thursday, January 17, 2008. Find out more at http://www.memphisjug.org.