Tag: Groovy
-
Using Groovy to determine Unicode characters
(Technically speaking, this post doesn’t require Groovy. You could do the same thing in Java. Still, as usual, Groovy is easier.) I’m teaching a Groovy course this week and having a great time doing it. One of the exercises I put together is to create a concordance, which is a map relating individual words to…
-
Turning Java enums into Groovy ranges
It turns out that it’s easy to turn a Java enum into a type that can be used in a Groovy range. Consider a simple enum representing the seasons: public enum Season { WINTER, SPRING, SUMMER FALL } Since enums implement the Comparable interface, they have a compareTo() method. Despite that, however, you can’t use…
-
Nothing makes you want Groovy more than XML
I’m in Delaware this week teaching a course in Java Web Services using RAD7. The materials include a chapter on basic XML parsing using Java. An exercise at the end of the chapter presented the students with a trivial XML file, similar to: <library> <book isbn=”1932394842″> <title>Groovy in Action</title> <author>Dierk Koenig</author> </book> <book isbn=”1590597583″> <title>Definitive…
-
A few 2GX notes
Late last night I returned home from the Groovy/Grails Experience (2GX) in Reston, VA. I met many wonderful people and learned tons of new things, which I’m sure will spawn blog posts over the next few weeks. Just to get started, though, I thought I’d mention a few random observations from the conference. Buy Scott…
-
“How Groovy Helps” presentation now available
Last night I gave a presentation at my local CT Java User’s Group on Groovy. Rather than present a laundry list of Groovy features, I took a somewhat different approach. Instead, I selected three relatively small, self-contained problems that I’d worked on over the past few months and showed how using Groovy simplified my work.…
-
Simple Google Chart with Groovy
Google has a nice little chart plotting capability at Google Chart API. It’s a web service that generates images based on supplied parameters in a URL string. I think of it as a RESTful web service, despite the fact that the return values aren’t, strictly speaking, XML. I thought I’d use it to create a…
-
All I know I learned from GinA (and DGG)
Okay, maybe that’s an exaggeration, but I’ve been digging into Groovy in Action (GinA) and the Definitive Guide to Grails (DGG) more lately and keep finding nuggets that I apparently missed on my first few readings. (I’m trying not to be annoyed about that, btw. By this stage in my career, I know all too…
-
Looking forward to 2G X
Saturday my RSS reader brought a message saying that registration was now open for the Groovy/Grails Experience (called 2G Experience on the website, but I like the shorthand 2GX). Since it’s in the DC area, and I live in CT, I hesitated for a couple of hours. After all, I’m a one-person company, so even…
-
Groovy Dates are Ranges too
I have a Grails application that I use to keep track of training courses that I teach. For each course, I enter the start and end dates, among other information. It’s a pretty straightforward application that I’ve described here in several previous posts. I’ve gotten to the point now where I want to do more…
-
Moving My Google Maps Mashup to Grails, part two
I made a few improvements to my Google Maps mashup, and though they’re not as significant as the changes made in my previous posts, I still wanted to make a record of them. I discussed in my last post the problem I had exposing my domain objects as JSON strings. To summarize the problem: In…