I found this amazing poem in a comment on Beyond Growth by a fellow known as jumping fish (see comment below).

[click to continue…]

{ 2 comments }

Fast Iterative List Subsequences in Java

by Tyler on April 6, 2008

Today on Ray Myers Blog, (cadr life), he posted about returning lists of n-sized subsequences of a larger list. He used Java and tried to implement the recursive solution that he would normally write in Lisp or Haskell. He also issued a challenge to write this function without recursion. Well, my implementation is certainly not clean, but it is iterative, and is significantly faster for large lists (up to 10x). You can download my Java source file (with a main setup to time my version vs. his recursive version) here.

[click to continue…]

{ 0 comments }

Problem: Spam-Egg List

July 12, 2007

So on Stoto’s Weblog Tuesday there was a little programming challenge called the Spam-Egg List Problem. Here is the problem: Write a function called dumpList that takes as its parameters a string and a reference to an arbitrarily complex nested list and prints the value of each list element on a separate line. The value [...]

Read the full article →

XKCD #287 Comic Solution

July 9, 2007

In today’s xkcd comic the joke was about using the knapsack problem at a restaurant. Just for fun, I solved it in scheme.

Read the full article →

Postfix to expression-tree in scheme

July 2, 2007

So today someone on a mailing list asked for help with a postfix to expression-tree converter. While he hasn’t responded to me yet, I thought I’d share my solution on here. It was surprisingly easy to write in Scheme. Please feel free to comment if you have suggestions.

Read the full article →

I’d like to welcome you with a little logic puzzle

July 1, 2007

So I’m trying to finally get around to starting and maintaining a blog. We’ll see how it works out this time. As a little welcome for ALL my many valued readers, I’ll present a logic puzzle that has supposedly been used by Microsoft for programming interviews.

You have a 3-quart bucket, a 5-quart bucket, and an infinite
“supply of water. How can you measure out exactly 4 quarts?

Read the full article →