Archive for September, 2007


The puzzle came first:


The answer followed:


Don’t click on the answer if you don’t want it spoiled. You have been warned.

I don’t believe that posting the answer ruins anything. Nobody else can claim this as their own because they would still have to explain how they achieved this result.

Believe me when I say that I can go into excruciating details. :)

Also, in my case, it was an excellent way to practice Erlang. Nothing beats solving a “real” problem to imprint a programming language in your head.

Read Full Post »

7998 Romans

Daniel and I were discussing how to test candidates before hiring them. You can push the requirements further when the candidates get a “take-home” test. So, what would such a test look like?

It must be easy enough so that the candidates don’t discourage. However, it must be challenging enough to test their problem solving skills and be able to produce some code we can discuss. Ideally, I’d like to see a code portfolio: a set of interesting problems and accompanying solutions. My take is that the following problem will be able showcase the attributes I’m looking for:

  • ability to research
  • flexible solution
  • good coding style

Given a file with roman numbers and their integer values in the following format:

1442 -> MCDXLII
MCCXCVII -> 1297
211 -> CCXI
MCLXIV -> 1164

Find the lines where the roman and integer values don’t match. How many lines are there? Which ones?

Read Full Post »

The Mac Mini and the Soldering Iron

I had been planning to buy a Mac Mini for a while now. I wanted to turn it into a web application server. I was going to install Gentoo on it and drop it somewhere/anywhwere in the house. These plans came to fruition 3 weeks ago when I dropped by the Apple store.

I took my time and configured everything just the way I like it. I rebooted it a few times to check that all services just started by themselves. When I brought it to the living room and pressed the ON button, I sat back in the couch and kept an eye on a “ping” to see how long it would take to boot up. The ping never was answered.

I brought the monitor and the keyboard to the living room (read: hassle) and booted the Mini. It booted without problems. I took out the keyboard and rebooted: no problem. I took out the screen and rebooted: no dice.

I knew the answer before google came back: the Mac Mini was never designed to run headless—the firmware wants a monitor.

This is not for the faith of heart but I found a few links with the same solution: a VGA dummy.

I resisted the idea at first, I knew my soldering skills were not excellent. I had never understood the explanations from the books I had read. I recruited youtube on this one, here are the good videos I found:

“how to solder”

How did we ever get anything done before the Internet?

The soldering itself is a long story: wrong solder, bad soldering iron, soldering cup technique and all. I managed to get it done, however.

Then came the moment of truth. I held my breath and closed my eyes and pressed ON again. Imagine the sweat rolling down my face as I waited to see if it would burst into flames OR have ping print “64 bytes from icmp_seq=141 ttl=64 time=1.255 ms”.

Yes, it worked.

Read Full Post »