The Curious Dev

Various programming sidetracks, devops detours and other shiny objects

Jun 23, 2012 - 2 minute read - Groovy

Groovy Closures

One of my favourite parts of Groovy is the functionality that Closures provide. Basic Usage A Closure is kind of like an anonymous method in Java, or a little like a function in JavaScript, except with a lot more functionality in a very simple and clean syntax. def hello = { println 'Hello, World!' } hello() //prints "Hello, World!" The above isn’t very useful on its own, but it is this structure that can be applied to other problems.

Jun 16, 2012 - 1 minute read - Groovy

Upcoming goodness with Groovy 2.0

Guillaume Laforge has provided a recent update to what we can expect to see in the upcoming Groovy 2.0 release. I’m sure it’d be more enjoyable live at GR8Conf, but a great read all the same. Some things I’m interested in: Memoization - could have some interesting uses JSON - have used Jackson previously, but built-in is great! New AST Transformatons (@ToString, @TupleConstructor, @ThreadInterrupt) - even more syntactic sugar Multicatch - cuts out even more verbosity InvokeDynamic performance improvements Groovy 1.

Jun 10, 2012 - 2 minute read - Groovy

URL Status Check

Groovy is great for those little tasks where you probably can’t be bothered pulling out your Java tooling. While certainly more useful as part of a larger collection of tools, the script below lets you check if a website is up by simply downloading that page and confirming that there are greater than zero lines of content. //saved as URLCheckUtil.groovy def url = args[0] g = new URLChecker() def status = g.

Jun 1, 2012 - 1 minute read - General Podcasts

Podcasts For The Developer

I’ve currently got a commute that is somewhere near an hour each way, which leaves plenty of time to fill. While I love music, podcasts somehow make the time go quicker as I feel get embedded in the conversation rather than passively listening to music. So listed below are many of the podcasts I regularly listen to. Developer This Developer’s Life Hanselminutes Techzing Live The Java Posse The Grails Podcast Herding Code FLOSS Weekly IT Conversations mixed feed (conferences etc) Tech Entrepreneur Startups For The Rest Of Us The Startup Success Podcast Tech-related Twisted Wire Patch Monday Spark Security Now