Author Archives: hedleyproctor

Cool Groovy features 3 – ConfigSlurper

In Java configuration properties can only be key-value pairs e.g. Wouldn’t it be nice to be able to group configuration properties? This is exactly what you can do in Groovy using the ConfigSlurper class. It allows you to write config … Continue reading

Posted in Groovy | Tagged | Leave a comment

Using group by without an aggregate function

It is interesting to find that in MySQL, you can write the following: This doesn’t really make sense, since the purpose of “group by” is to group records when you are using an aggregate function, such as sum. e.g. If … Continue reading

Posted in MySQL | Tagged | Leave a comment

Coffeescript – improved javascript

An interesting attempt to create a more powerful syntax for javascript: http://jashkenas.github.com/coffee-script/  

Posted in Javascript | Tagged | Leave a comment

Groovy – real life example

In my job we often have spreadsheets of data that we want to quickly turn into SQL scripts. (Yes, I know there are plenty of ways of importing spreadsheets into databases, but our DBAs want SQL scripts!) This is fairly … Continue reading

Posted in Groovy | Tagged | Leave a comment

Spring MVC versus Struts

This question is often asked, but tends to be answered by people who have a strong allegiance to Spring and tend to give a massive list of advantages, which often boil down to a much smaller list of actual advantages. … Continue reading

Posted in Spring | Tagged | Leave a comment

Cool Groovy features 2 – closures

A closure is a block of code (i.e. a function). In Java, to define a block of code, you would have to write a method or a class, but in Groovy you can write a closure and assign it to … Continue reading

Posted in Groovy | Tagged | Leave a comment

Cool Groovy features 1 – no need for getters and setters

Consider the following Java code: public class Customer{ private int id; private String firstName; private String lastName; public void setId(int id){ this.id = id; } public void setFirstName(String firstName){ this.firstName = firstName; } public void setLastName(String lastName){ this.lastName = lastName; … Continue reading

Posted in Groovy | Tagged | Leave a comment

Groovy

One of the technologies I’ve been playing around with recently is the Groovy language. It’s an interesting language as it offers a number of features not found in Java. Some of the these are features of the language itself, some … Continue reading

Posted in Groovy | Tagged | Leave a comment

Hiding table columns with jQuery

A nice example of hiding a table column using jQuery is here: http://www.devcurry.com/2009/07/hide-table-column-with-single-line-of.html That example shows how to hide a single column. How might you do it if you have a row of tickboxes, one for each column? Here is … Continue reading

Posted in jQuery | Tagged , | Leave a comment

Printing Ant classpaths

Debugging Ant classpaths can be a bit of a pain, but the following link shows you how to print them out: http://www.javalobby.org/java/forums/t71033.html Even better, you can do a pretty version using: http://blog.andrewbeacock.com/2005/08/pretty-printing-java-classpaths-using.html

Posted in Ant, Java | Tagged , | Leave a comment