Archive for the ‘Programming’

XML Renderer in Clojure

September 08, 2009 By: Erik R. Category: Geeky, Programming, Reviews

clojure logoI’ve spent the past few days playing around with Clojure. Clojure is an implementation of Lisp, the most powerful programming language, that compiles to byte code that runs on the Java Virtual Machine. I won’t go into just how awesome that is, but there are many technical reasons why this platform decision is equivalent to standing on the shoulders of giants.

Clojure comes with a built-in library for parsing XML files into Clojure data structures, but, for the life of me, I could absolutely not find any implementations that went the other way, to render XML from the Clojure structure that the default parser creates. So I wrote one…in 25 lines of code.
(more…)

Bug in java.util.EnumMap.clone()

May 08, 2009 By: Erik R. Category: Complaining, Geeky, Programming

At work today we found ourselves totally confused by the behavior of one of our EnumMap instances. No matter what we did to it (setting new values, clearing, etc.), when we iterated through the entry set, the values were the same. After investigating the source code for java.util.EnumMap, it became clear that the problem was based on the fact that the EnumMap instance we were working with had been generated by calling EnumMap.clone() rather than using the constructor. I’ve written a test program to demonstrate this bug. It should NOT behave like this!
(more…)

Lisp Enlightenment and Emacs Frustration

July 06, 2007 By: Erik R. Category: Complaining, Geeky, Programming

I have recently had my interest piqued about Lisp. I learned a little Lisp back in college for some Artificial Intelligence classes that I took. It struck me as a rather awkward language.
(more…)

Javascript Gunner

May 21, 2007 By: Erik R. Category: Geeky, Programming

Welcome to the Javascript Gunner page. This little script that I wrote is an example of the kind of thing that can be done with the javascript <canvas> tag and a little imagination. Why should your drawings be confined to the <canvas> tag when the <canvas> tags themselves can be moved around the page?
(more…)

The Shadower – Realistic Drop Shadows in Javascript

December 04, 2006 By: Erik R. Category: Geeky, Programming, Wordpress

This has been done before, but not in such a simple and elegant way, in my opinion. This implementation has four important features that separate it from the rest: no images, no messy nested divs in your html code, no CSS, and realistic fading shadows!
(more…)

Multiple Inheritance in Java

October 23, 2006 By: Erik R. Category: Geeky, Musings, Programming

I have come up with a way to accomplish multiple inheritance1 in Java using interfaces with static inner classes, which I will now present to you.
(more…)