java

Watch Directory For Changes in Groovy

One must-have feature in any modern web stack is the ability to automatically restart/refresh the development server when you edit the source code. It is critical for developer workflow that the feedback loop be as tight as possible. Here source code refers to actual class definitions, templates (JSPs, GSPs, haml files, etc…), static content (javascript, …

Watch Directory For Changes in Groovy Read More »

Haml For Grails

Writing a Grails app? Find out why so many Rubyists swear by Haml for writing views. Interested parties have created JHaml, a Java implementation of Haml, and a corresponding Grails plugin. (Patches welcome!) To try it out, just grab the plugin: grails install-plugin haml Then add this bean definition to your grails-app/conf/spring/resources.groovy. Now, you have …

Haml For Grails Read More »

Beyond web.xml

Another day paying the bills in Eclipse… public class HelloWorldServlet extends HttpServlet { private static final long serialVersionUID = 1L; @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { resp.getWriter().println(“Hello World!”); }} So you’ve just written yourself a spiffy little servlet and you want to test it out. That’s when it hits you… …

Beyond web.xml Read More »

Subsequences With BGGA Closures

Just a quick followup on Returning ‘(()) Considered Difficult. I just rewrote the “subsequences of length n” exercise yet again (surprise, surprise), this time using the Java BGGA prototype by Neal Gafter et al. I really like being able to abstract away the accumulation loop. import static com.cadrlife.ListUtils.*;…private static <T> List<List<T>> subn(int n, List<T> list) …

Subsequences With BGGA Closures Read More »

The Functional Programming Apologist

There do exist legitimate criticisms of functional programming (FP) concepts, just as there are reasonable criticisms of imperative style, procedural style, prolog-esk logic/constraint programming, and even our precious object-orientation. Still, as you might expect, the vast majority of the tomatoes hurled in the general direction of the FP community are totally absurd. Here are a …

The Functional Programming Apologist Read More »