-
Abbreviating the descendant axis in XSLT
Say we have the following XML: The question is, what does the XPath expression //para[1] return? I originally expected it to select all the para elements and then return just the first one. In fact, what it returns is This is because what the expression actually means is, “return all the para elements that are…
-
Dragons roar, cough, and sputter in Dayton
Tim Kurkjian says you should never miss the chance to go to a ballgame, because you might see something you’ve never seen before. On Tuesday I got the chance to go to see the Dayton Dragons play in their charming stadium, Fifth Third Field (seriously, that’s the name) in downtown Dayton, Ohio. (I’m here this…
-
O’Reilly screencasts coming
A few weeks ago, I got an email from a “digital content director” at O’Reilly. He said he was building up O’Reilly’s catalog of screencasts on technical subjects and wanted to know if I wanted to participate. The plan would be for me to come to California, where a camera crew would record me teaching…
-
Making Java Groovy, an upcoming book from O’Reilly
Recently there was a discussion on the Groovy User’s list about Groovy books, in which it was noted that there are currently no books involving Groovy from O’Reilly. I responded to that post, announcing for the first time in a public forum that Scott Davis and I are working on a Groovy book from O’Reilly,…
-
Making a Groovy class a range
In a recent post, I used the Date class in a range. This always jumps out at Java developers, who aren’t used to seeing it. It’s really cool you can do that in Groovy. That example illustrates both the concept of a range as a collection of values, and that Groovy can add methods to…
-
Links from my GroovyMag article
I’m really happy to have an article in the current issue of GroovyMag, but after it appeared I realized something. When I submitted the article I added several links in the text, thinking that they would still be active in the resulting PDF. That, as they say, turned out not to be the case. I…
-
Groovy Groundhogs
So the groundhog saw his shadow today, implying six more weeks of Winter. Let’s settle this nonsense once and for all. The output is In other words, there are six weeks and six days between Groundhog Day and the first day of Spring. So we’re already going to have an early Spring. 🙂
-
Making Swing Groovy, Part III: EDT
In this entry in my “Making Swing Groovy” series, I want to talk about threading issues. Specifically, how to work with the Event Dispatch Thread. As a step along the way, let me first respond to a comment made about my first post in this series. Kirill Grouchnikov collects interesting Swing-related links every week. He…
-
Making Swing Groovy, Part II: Binding
In my previous post in this series, I presented a trivial Echo GUI written in Groovy. By using SwingBuilder and closures, the code for the GUI was dramatically simplified compared to the Java version. But Groovy can go beyond that. In this post, I’ll talk about the bind method and the @Bindable annotation, which help…
-
Making Swing Groovy, Part I
I’ve been spending a lot of time lately trying to understand how much Groovy improves Swing user interfaces. Like so many Java developers, I rarely write client-side programs. Almost all of my time and effort with Java over at least the last five years has been on the server side, mostly with frameworks like Struts,…