Category: Programming

Permutations of Iteration

Ah, the loop, so fundamental to programming it’s hard to imagine a single program without one. After all, what’s the use of calculating just one thing? Usually you have a big pile of things you want to calculate, which is why you need a computer in the first place. I think one of the quickest…

Read the full article

Ruby: Python for Lisp Programmers

A popular game on comp.lang.lisp is comparing Lisp with Python. Lispers complain that Python has a crippled lambda and no lexical closures, and they hiss and boo whenever Python’s development tends in a non-functional direction. I’ve recently been playing with Ruby. Lo and behold, it has real lambdas, closures, and a generally more functional style.…

Read the full article

Broken Binary Searches Oh My!

So it turns out that nearly every binary search algorithm is broken. Why? Fixed-sized integers, a holdover from machine programming that still lingers in supposedly modern languages like Java. LtU’ers are haggling to decide if it’s a type error, a bad data structure, a language defect, a failure of correctness proofs, or just a bug.…

Read the full article

Static-Dynamic Pages

Despite all of the AJAX/Web 2.0 hype, the fact remains that most web pages are mostly static. The most efficient way to serve static pages is unquestionably to store them as static files on a file-based web server such as Apache. I add new pages to this site once every few days at most, but…

Read the full article

Pushing to Lists

Fiddling with some Common Lisp code a few weeks ago, I needed to push items onto the end of a list. After thinking for a moment, I wrote this: (defun push-end (object place) (nconc place (list object)) Since I was fiddling in LispWorks at the time, I discovered that LispWorks already defines its own push-end…

Read the full article