Monthly Archives: April 2010

Getting user input from the command line in Groovy

I was going through Chris Pine’s excellent “Learn to Program“, re-doing all of the exercises in Groovy (since it’s Ruby-centric). I ran across one where I need to get user input. Ruby’s got its easy “gets” method; what about Groovy? … Continue reading

Posted in Programming | Leave a comment

Drools MVEL eval() gotcha

We’ve got a Drools rule that contains this line in the consequence:eval(!StringUtils.containsAny((String)$rv, “neg”) )Uh uh. Can’t use the bang (!) to test for negation in the eval() statement. Won’t compile. Instead, we have to do this:eval(StringUtils.containsAny((String)$rv, “neg”) == false) This … Continue reading

Posted in Programming | Leave a comment

Setting the default window size for gvim

I still go back and forth between development in gvim and gedit. Until I finally settle, I’ve needed to figure out a way to change the default/startup window size of gvim.To do so, open up ~/.vimrc in a text editor. … Continue reading

Posted in Linux | Leave a comment

Gedit mods for Groovy

Sooner or later you know that I would weigh in on editors for Groovy and Grails. I’ve tried ’em all–heavyweight IDE’s like Intellij, Netbeans, and Eclipse (I’ve listed those in preferential order), specialized editors like python’s SPE, commercial offerings like … Continue reading

Posted in Uncategorized | Leave a comment

The power of Groovy closures

In the Java world, we don’t get closures until Java 7. Groovy already has them. Here’s what I’ve learned about these important programming structures, and why they’re powerful.

Posted in Uncategorized | Leave a comment

Groovy processing

Just something interesting I came across in Dierk Koenig et al.’s excellent Groovy In Action (Manning): Groovy is not like other scripting languages that are processed line-by-line. Groovy code is fully parsed and a class is generated from the information … Continue reading

Posted in Uncategorized | Leave a comment

Groovy MultipleCompilationErrorsException

Note: I’ve been learning Groovy of late. It helps me learn a concept if I can ‘splain it, so I’ll be posting things I come across in an attempt to explain it written form. Dig?

Posted in Uncategorized | Leave a comment