Archive for the ‘Groovy’ Category

MailSlurper, Now with Paging and Sorting!

Posted: 3rd September 2010 by Adam Presley in Development, Groovy
Tags: , , ,

A super quick update: I have updated MailSlurper’s administrative interface to now have paging and column sorting!! And in Grails this was super easy to do. I totally need to blog about this later. Meanwhile check it out and go download it. Cheers!!

Grouping Structures in Groovy

Posted: 10th June 2010 by Adam Presley in Development, General, Groovy
Tags: ,

A useful tidbit for those interested in playing around with Groovy. I had need recently to take a structure, or more Groovy-like, a Map, and group by a particular key, and iterate over the grouped items. Turns out to be quite easy in Groovy. Let’s see an example of such a structure and how one [...]

Parsing XML in Groovy

Posted: 3rd June 2010 by Adam Presley in Development, Groovy
Tags: ,

I’ve been doing a little more work with Groovy lately, and it still continues to impress me on how expressive and easy some things are to do in this language. Last night I was working with a web service that returns XML and I needed to parse this XML response and do some work with [...]

Today I had to work on a bit of code that dealt with trying to tie in merchandising promotions against a shopping cart. This code I’m working with is pretty old, so it’s kind of like trying to make a paper airplane out of the Constitution. :/ My boss is working on one part of [...]

Today I had a small situation where there is a structure in the session scope that, when a form is submitted with address information, put this address data into that session scoped structure. However, there is a checkbox and a submit button on the form that get sent along with the form scope. I did [...]

ColdFusion 8 introduced the ability to serialize data structures, arrays, and queries to JSON notation, making building AJAX-enabled applications even easier. There are a couple of annoyances, however, that still persist, and simply drive me nuts. Take the following query as an example. 1 2 3 4 5 6 7 8 9 10 <cfquery name="qryStates" [...]

Count Lines of Code in a Directory using Groovy

Posted: 9th September 2009 by Adam Presley in Development, Groovy
Tags: ,

So here’s a tasty morsel. I wrote a quick little script to count the number of lines of code in a ColdFusion project. Why? To make stuff look impressive, or course! So here we make use of Groovy’s very powerful extensions to the Java File object, and its ability to easily iterate. Take a look. [...]