Polyomino puzzle solver

January 1, 2013

Last year’s MIT Mystery Hunt had a fun puzzle called Caterpillars which involved fitting together a bunch of polyomino pieces (laser cut by the fine folks at danger!awesome, by the way). So naturally I decided to write a program to solve it, and I was successful in that endeavor. After the Hunt ended, I cleaned […]

Comments Off on Polyomino puzzle solver

Debugging a strange iTunes permissions problem with DTrace

November 27, 2011

The other day, I noticed that one of my media files wouldn’t play in iTunes because it decided that my computer wasn’t authorized to play it. I could not authorize my computer to play that song, however, because the iTunes account name associated with that song no longer existed—I had changed the email address of […]

1

Algebraic Crosswords

April 24, 2011

A blogger by the name of T Campbell recently posted an interesting read about Algebraic Crosswords. And at the end, T posts a $100 bounty for a computer program to help crossword constructors construct such crosswords. That’s right up my alley as both a programmer and a puzzle solver, so I threw together a quick […]

5

The tricky inline specifier in C99

March 21, 2011

Try to compile the following simple C program in C99 mode with GCC: The results may surprise you: $ gcc test.c -std=c99 /tmp/ccWN4GRh.o: In function `main’: test.c:(.text+0xa): undefined reference to `foo’ collect2: ld returned 1 exit status Huh? The function’s right there! Well it turns out that this is not a bug in GCC, but […]

Comments Off on The tricky inline specifier in C99

The Unkillable Window

September 8, 2010

I recently ran into a very strange occurrence on my Windows box: an unkillable window. I was rebooting after installing some software that required a reboot (*sigh*) and noticed that the restart didn’t quite happen—most of my processes were killed, but there was this leftover window that wouldn’t go away. Further attempts to reboot did […]

2

Kakuro Solver

July 1, 2010

Kakuro (also known as Cross Sums) is a popular number-based logic puzzle. It resembles crossword puzzles, except instead of clues made up of words, you have clues made up of numbers indicating the sum of the digits in the indicated cells, with the additional constraint that no entry contain the same digit more than once. […]

1

I’ll take Pwtent Pwnables for 400 please, Alex

May 26, 2010

This past weekend, I participated in my first ever DEF CON Capture the Flag Qualifying Tournament. CTF is a contest at the aforementioned annual hacker conference where the goal is to keep your team’s network services (which are on a closed intranet) up and running for as much as possible, while simultaneously trying to bring […]

Comments Off on I’ll take Pwtent Pwnables for 400 please, Alex

One more note about exit statuses

May 19, 2010

Last week, I mentioned in passing that Windows allows the full range of 32-bit exit codes. That’s true, but only if you directly call ExitProcess() (or its less-friendly kin TerminateProcess()). If you just call exit() (or return from main(), which implicitly calls exit()), then like in the *NIX world, you only get the bottom 8 […]

Comments Off on One more note about exit statuses

So what’s in an exit status anyways?

May 13, 2010

Last time, we saw how we can capture a process’ core dump. The astute reader will have noticed that we seem to be pulling bits out of thin air: We’ve got a 32-bit exit status, and yet we seem to getting two more useful bits of information out of it from the WIFSIGNALED() and WCOREDUMP() […]

Comments Off on So what’s in an exit status anyways?

Dumping core

April 23, 2010

Your program just crashed, and you didn’t have a debugger attached. You can’t reproduce the crash after many attempt. How you do debug the problem? Well, if your program had left a core dump, you could easily attach a debugger postmortem and get some kind of idea what state the program was in before it […]

1