I had the pleasure of using the .NET port of the very popular and powerful log4j library called log4net. I’ve found it as powerful and enjoyable as log4j and it has greatly simplified my logging needs for this C# project. At some point I found myself needing to create a...

Continuing the series of enhancing Groovy’s core language classes, here is a snippet that allows a String to be hashed using the SHA1 algorithm. Let’s look at the code first. import java.security.* def source = "Hello. This is my secret message. That should be hashed." String.metaClass.toSHA1 = { salt =...

Here is another example of using Groovy’s metaClass abilities to extend the language. In this scenario I have a need to convert a standard Map to a key-value pair, such as what would be used in an HTTP POST. Continuing from my previous post about extending String to have the...

I’ve talked before about enhancing the Groovy language through the metaclass extension abilities. Here’s a short post that adds a handy snippet to the Groovy String class to URL encode strings. Normally this is done through the java.net.URLEncoder class, but we are going to add it to the string class...

The other day I blogged about generating XML from domain classes in Grails. Today I want to show how to do the same thing but with JSON instead. JSON is widely used and accepted as a great way to exchange information in AJAX and RESTful applications, and Grails makes it...

If you’ve ever worked at a company that uses a corporate proxy you may have run into this little issue. Some command line tools such as CURL or Grails make calls out to the internet to do their jobs, and some corporate proxies just get in the way. Grails has...

I was doing a little work in a project that spans a rather broad spectrum of the technology scale. One application in Groovy, the other is a Grails app, while another piece is ColdFusion. Overall a very interesting project. One of the things I was working on is a sort...

Notice: The opinions expressed on this blog entry are mine alone and do not necessarily represent the views of my employer. Now that the employer notice is out of the way I can actually start talking about what I wish to talk about. At work we have a big initiative...

I am happy to announce I have released CFBarbecue version 1.0 on RIAForge! CFBarbecue is a ColdFusion wrapper for the Barbecue Barcode Java library, and provides the ability to generate and display barcodes on your web application pages. It also makes scaling and rotating barcodes easy too. Visit the RIAForge...

Although the title suggests something specific to Groovy the concept demonstrated in this example will work in good old Java too, with a couple of tweaks of course. In this blog entry we will look at what a priority queue is, and how we can use Java to implement one....