Wednesday, December 28, 2005

Solving Sudoku

I cobbled together two programs to solve Sudoku puzzles. One employs tricks that people use, while the other is an implementation of Knuth's Dancing Links algorithm as described at Wikipedia. It seems the first approach is sufficient for solving mainstream Sudokus, even without implementing all the tricks.Type git clone http://cs.stanford.edu/~blynn/sudoku.git to fetch a copy.

Monday, December 12, 2005

Quinapalus

Mark Owen aka Quinapalus is the author of the number crossword I HTMLized (Ajaxed?) recently. His site contains many other puzzles, some of them also crossnumbers:

Wednesday, December 7, 2005

HTML Preprocessing

I replaced the PHP in wingchun.stanford.edu with static HTML. To avoid repeating code I used GPP, a generic
preprocessor.

I initially selected PHP for all my webpages because I had grandiose plans to build exciting dynamic sites. It never happened, but I kept the PHP in case I came up with some ideas. The development cycle is also one step shorter, and I don't get enough traffic for the performance hit to matter.

Tuesday, December 6, 2005

Disabling Links to the Current Page

According to Jakob Nielsen's list of The Ten Most Violated Homepage Design Guidelines, a link should never point to the current page.

I've seen high-profile sites that break this rule so I'd expect most users not to get too confused. Nevertheless, I whipped up some javascript to do disable links to the current page for this site. Ideally I'd like the links to be removed in the raw HTML and not require Javascript, but the way I've built my site makes this difficult.

A brief search revealed that some people do this by changing the onclick callback, and also the mouse cursor, but I prefer to replace the whole anchor tag with a span tag of a particular class.