Getting Ready for CodeMash

Only one more day until CodeMash. I am really looking forward to my first one. I have heard nothing but wonderful things about this conference that brings together developers, geeks and their families for a week in January in Sandusky, Ohio. I am also looking forward to the opportunity of presenting my “Once Upon a Time in Clojureland” talk. It is an introduction to Clojure in a Fairy Tale format. I am hoping to share my enthusiasm for the language and inspire others to try it out for themselves. ...

January 10, 2012 · 1 min · Carin Meier

Sunday in the Park with George and Clojure

 White: a Blank Page or Canvas. As I spent a pleasant Sunday outside doing yard work, songs from one of my favorite musicals, “Sunday in the Park with George”, came to mind. While the songs were playing in my head, my thoughts again drifted to one of my favorite programming languages, Clojure. To my surprise, I was struck by similarities between the musical, which is about the artist Geroges Seuret and his creation of one of his famous painting, and that of the functional JVM language of Clojure. Granted, musicals, art and programming languages don’t generally get discussed together, but please humor me and let me elaborate. Following the thread of my inspiration, I will be using the first few opening lines from the musical as my headings and guides for my discussion. ...

September 13, 2011 · 5 min · Carin Meier

Super Easy Clojure Web Apps with Heroku Cedar

Deploying Clojure apps with a single command to the cloud is now possible with Heroku Cedar and let me tell you, it is pure joy. I experimented with this the other day by creating a Compojure web application that compares the followers that two twitter users have in common. Here is the secret sauce you need to push your apps to Heroku: **Procfile: ** You need to create a file in the root of your directory that contains the way to start up your application: ...

June 11, 2011 · 2 min · Carin Meier

Hacking JavaScript for the Love of Clojure

Lately, I have been working on the awesome open source project 4Clojure.com. The site helps you to learn Clojure by solving “koan” type problems in an interactive format. One of the enhancements that I was looking at putting in was a way to enter code in a text box and have it color highlight as type. I found the ACE project, which looked like exactly what I wanted. However, sad panda, they didn’t have a Clojure mode. Not deterred, I decided that I would try to take a crack at it. I ported most of the rules from the Clojure brush in Syntax Highlighter over and implemented some basic auto-indent. ...

May 1, 2011 · 1 min · Carin Meier

Yellow Belt Katas for Ruby and Clojure

I have put a couple projects out on GitHub to help people get started with Clojure and Ruby. The Katas are taken more or less from the Coding Kata site http://codingkata.org/katas/. The projects both include the basic project setup for you to get started with TDD beginner katas. The Ruby project has tests in the form of rspec-given, which is quite fun. The Clojure project has tests in the form of Midje, which has a lovely syntax. ...

April 16, 2011 · 1 min · Carin Meier

Knights Who Say Monad

(*Sketch By My Awesome Husband)

April 12, 2011 · 1 min · Carin Meier

On Thinking in Ruby and Clojure

Recently, I decided to work on a set of code Katas. I couldn’t decide whether to do them in Ruby or Clojure, so I decided to do them in both. I did the Kata in Ruby first and then immediately followed up with the same one in Clojure. It was an interesting exercise, not only for the learning of the languages, but to highlight how I thought about the problems differently depending on the language. ...

April 8, 2011 · 2 min · Carin Meier

Bowling Game Kata in Clojure with STM and defrecord

We took our kids bowling for the first time the other day. I have to admit, that I am not a great bowler. I had only been bowling two or three times in my life previous to that event and I was very thankful that those bumpers were up. The computer program malfunctioned in the final frames of our last game. I realized then, that I really had no idea how to score bowling. Later that night, in my surfing, I came across a reference to the Bowling Game Kata. ...

March 1, 2011 · 1 min · Carin Meier

Vampire Slaying in Clojure with STM - Part 2

In Part 1, we used defrecords to create a vampire slayer named “Buffy” and a few vampires for her to kick around. Today we are going to use Buffy and her vampires to explore STM (Software Transactional Memory) in Clojure for managing state. Recap (defrecord Vampire [name, health]) (def vampire1 (Vampire. "Stu" 50)) (def vampire2 (Vampire. "Vance" 100)) (def vampire3 (Vampire. "Izzy" 75)) (defrecord Slayer [name, weapon]) (def kungfu 25) (def buffy (Slayer. "Buffy" kungfu)) (defn hit [vampire, hitpoints] (- (:health vampire) hitpoints)) ;vampires don't fight back but it takes time to kill them (def combat-time 20) (defn hit-vampire [vampire, slayer] (Thread/sleep (* combat-time 10)) (assoc vampire :health (hit vampire (:weapon slayer)))) (defn kill-vampire [vampire, slayer] (if (> (:health vampire) 1) (recur (hit-vampire vampire slayer) slayer) (assoc vampire :health 0))) Let’s take our vampires and stand them up in a line for Buffy to fight. We are also going to create a function that just has Buffy killing a vampire, rather then a generic slayer. ...

January 18, 2011 · 3 min · Carin Meier

Vampire Slaying with Clojure - Part 1 defrecord

It’s time to learn more Clojure. This time, Buffy the Vampire Slayer* is going to help us. First things first, of course we need vampires! Let’s create a vampire data type with defrecord. Our vampires are going to have two attributes, their name and the number of health points that they have. This is of course, how Buffy is going to slay them. If a vampire’s health points goes to zero, then they are dead. Well, they already are undead… so let’s say they are slayed at that point and turn into dust. ...

January 12, 2011 · 4 min · Carin Meier