Author Archives: Jacek Laskowski

Today’s a palindrome – how to check palindromes in Clojure

s

There’re countries like Poland that use dates in the format ‘dd.mm.YYYY’, so today’s 21.02.2012. As pointed by @KevlinHenney on twitter it’s a palindrome and I was pleasantly surprised to find it out. I came up with the idea of writing a Clojure function to check if a given string is a palindrome. I remember the [...]

Languages Tagged 4 Comments

AOT-compile all namespaces in a Clojure project – :aot :all in project.clj (leiningen)

s

It’s been a couple of times when I ran across a compilation issue while starting up the librarian-clojure project. I guess refactoring in Clojure or any dynamic programming language is not as easy to achieve as in static languages, and perhaps Ahead-of-time (AOT) Compilation could be a solution. I’m yet to join a project with [...]

Languages Tagged 1 Comment

clj-time and Joda Time to pretty-print my son’s age in Clojure

s

In Clojure’s lein and clj-time to calculate my son’s age I wrote about clj-time to help me calculate my son’s age. What I missed was how to display weeks, days and hours and such in a format like: 4 months and 4 days and 5 hours and 10 minutes. Konrad Garus pointed out at org.joda.time.format.PeriodFormatterBuilder [...]

Languages Tagged Leave a comment

(clojure.java.browse/browse-url “http://clojure.org”)

s

While reviewing the sources of RESTful Clojure webapp skeleton w/Compojure, Ring, Enlive, and ClojureQL I found the clojure.java.browse namespace with the browse-url function I was looking for for some time. By a complete chance I stumbled upon this function which I happily incorporated in the librarian-clojure project. The function requires a URL to be open, [...]

Languages Tagged Leave a comment

How I learnt git pull requests

s

That was an amazing experience that ultimately turned into a git pull request into Midje – a test framework for Clojure. I’m working on a side project – librarian-clojure – which aims at providing a CRUD-like web application to manage books and when a colleague Konrad Garus cloned it to his own repo where he [...]

Frameworks, Languages Tagged , Leave a comment

Mastering lein run

s

In hangman with lein run, Incanter, and opencsv – Counterclockwise is here, too I mentioned the hangman project in which I’d come across lein run. I decided to use it in a side project of mine – librarian-clojure. I ran lein run to see what would happen. Ouch, but not much. The error message said [...]

Languages Tagged 1 Comment

hangman with lein run, Incanter, and opencsv – Counterclockwise is here, too

s

It was just yesterday when I once again listened to the presentation of Stuart Halloway – Clojure in the Field and was reminded about supercsv and his arguments to expect a csv parser in the Java SDK distribution. While scanning Clojure mailing list I stumbled upon [ANN] Clojure Hangman from Jozef Wagner and hoping to [...]

Languages Tagged 5 Comments

Clojure’s lein and clj-time to calculate my son’s age

s

It’s not as easy as I initially thought to calculate the exact age of my son when the days fly by quickly and the time interval is usually measured in weeks or (less often) months, or hardly thus far – years. That’s why I thought about setting up a Clojure project with lein‘s help to [...]

Languages Tagged 3 Comments

From lein’s sources – standalone repl, LEIN_REPL_PORT, (exit), .lein-classpath, and still no Clojure 1.3.0

s

I knew there were some changes to fire up Clojure‘s REPL with lein repl outside a project, so it brought no surprise when I ran lein repl in a directory and the REPL was ready. What I was however concerned with was that the Clojure’s version was merely 1.2.1 (the latest version is 1.3.0). I [...]

Languages Tagged 5 Comments

Helping daughter and myself with Clojure

s

Right on time when I needed an idea for an application to work on with Clojure, my daughter asked me to run an assessment of her skills to memorize countries and their capitals. It was her home assignment for geography at school. And we were running quizes where I was picking the countries and capitals [...]

Languages Tagged 7 Comments