Archives for languages

Clojuratica announced

Life is sweet. Yesterday a friend came by. He had purchased a Macbook Pro, and wanted to me his Levovo T60 that he no longer needed. Today Garth Sheldon-Coulson announced Clojuratica, an interface between Clojure and Mathematica. This is the stuff that software dreams are made of.

Clojure bowling problem

ObjectMentor’s Uncle Bob posted about learning Clojure via a bowling challenge. The challenge is to write a program to compute bowling scores. I decided to give it a go.
I’m not a bowler, so my first step was to try to understand how bowling scores are computed. Once I did that, it [...]

My road to Clojure

I’ve been studying Clojure, using my standard approach of solving Project Euler problems. I am very much impressed. Here’s why.
Functional Programming
Short of speech itself, mathematics is humanity’s most powerful and influential symbolic technology. Mathematics makes possible the science that shapes our world-view, and the technology that shapes our world. The central abstraction in [...]

The wait is over

Daniel Weinreb is a man with impeccable Common Lisp credentials. Wikipedia cites him as one of the authors of the original language spec, Common Lisp: The Language, First Edition, and as a cofounder of Symbolics, Inc., makers of legendary lisp machines. Here is what Weinreb had to say in a comment on Stuart Sierra’s [...]

A problem I ran across

I was chasing links concerning the lack of tail recursion optimization in ruby and ran across a math problem:
Find the smallest positive integer n such that n % x = x-1 for x from 2 to 18
i.e. The remainder is one less than the divisor for all integral divisors from 2 to 18.

The [...]

Erlang surprises me.

I recently wanted to calculate some binomial coefficients in Erlang, and so needed an implementation of the factorial function. No problem. The factorial function is the canonical illustration of how to define a recursive function in Erlang. It goes something like this:
fac(0) -> 1;
fac(N) -> N * fac(N-1).

I have to confess that definition has always [...]

installing gem on ubuntu ibex

Installing ruby and gem on Ubuntu (Intrepid Ibex) is somewhat problematic because of differences of opinion between the apt folk and the gem folk. If you want a working version of gem on Ubuntu Ibex, the RailsOnUbuntu site has the instructions. Worked for me.

Intro to gen_fsm and gen_server

Emacs

erl process handling commands

Note to self: some handy erlang shell commands for dealing with processes.
process_info(Pid)
i()
erlang:processes(), or better yet, rp(erlang:processes()). Sometimes long lists show “…” to represent the tail elements. Wrapping in rp() shows the whole list.
Finally, exit(Pid, kill) to kill the process represented by Pid. For a while I thought that exit(Pid) sufficed, but some experimentation [...]

leo font rendering woes

It has been months since I converted my work machine from Windows XP to Ubuntu Hardy. There is only one program I miss, the fabulous Leo text editor. Leo is not just a text editor. If it were only that I would have little use for Leo, since I already use Emacs, the one true [...]