Friday, February 17, 2006

Calculus Using Infinitesimals

I only recently became aware that it is possible to formalize the methods that Newton and Leibniz first used when developing calculus. In fact, not only is it possible, but it is quite easy to understand, and the notation is more elegant than those of limits.

I had always looked down on the pseudo-proofs I was shown in physics lectures, handwavy sloppy arguments that defied the rigour and precision that centuries of mathematics fought for. I tolerated them because I needed the results. But it seems with a few definitions, you can have your cake and eat it.

One introduction to this subject is a free online book: “Elementary Calculus: An Approach Using Infinitesimals” by H. Jerome Keisler.

Saturday, January 14, 2006

Unicode on Debian GNU/Linux

Unicode assigns each character a unique code [Wikipedia article]. My webserver now serves pages in UTF-8, and I have also switched my desktop to use Unicode.

There was no single compelling reason for this. Instead there were many minor advantages that together pushed me to adopt it. Small annoyances would arise. I wanted to add Chinese characters [Chinese characters dictionary] [English-Chinese dictionary] to some of my pages, and also Unicode curling quotes [ in HTML]. Some of the other characters look useful. Unicode is the rapidly becoming the dominant standard: even Windows uses it now. It is also far superior to the old way, i.e. dealing with a myriad of mutually incompatible character encodings. Every programmer ought to know about Unicode.

Migrating the server was easy. A minor tweak in a configuration file (AddDefaultCharset UTF-8 in srm.conf for Apache), and changing XML headers was all that was needed.

The desktop side was more involved. For an in-depth explanation, see a step by step guide to switching Debian to UTF-8 and a guide for Unix in general.

First I reconfigured the Debian locales package (i.e. dpkg-reconfigure locales) and selected en_AU.UTF-8.

Next I checked if the programs I frequently use can handle UTF-8. Unfortunately for me, Eterm does not support Unicode.

After a brief investigation I settled on rxvt-unicode (aka urxvt). I miss some of the Eterm eyecandy, and it took me a while to supply command-line options to get urxvt looking like Eterm. On the other hand, urxvt is leaner, especially when run in client-server mode.

One minor inconvenience is that "TERM=rxvt-unicode" is not entrenched as it should be. For example, the dircolors supplied in Debian does not know about it, so either a custom file has to be written, or dircolors has to be fooled.

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.

Monday, November 21, 2005

Ajax Puzzle, Firefox Extensions

Everyone seems to be talking about Ajax these days. By chance I was recently forced to learn Javascript, so I threw together a page that may count as using Ajax.

My page is a number crossword I encountered years ago. It might be too simple to be considered Ajax, but it is similar to the puzzles at Number-Logic.com, which do use Ajax. Anyway, dropping the word "Ajax" should get me a few extra hits at least!

I only checked the page in Firefox. It may look weird in other browsers. Speaking of Firefox, I like this list: Best Firefox Extensions

And speaking of my favourite number puzzles, I'm fond of the "Alice bit the white rabbit" cryptarithm:

A L I C E +
B I T
T H E
W H I T E
R A B B I T

I haven't been able to track down the source of this gem.

I renamed this page from "Insert Blog Name Here" to the backronym BL:OG. The "Openly Geeky" phrase was supposed to be a play on the words "openly gay", but they have more in common than I first thought: declaring yourself as either one discourages the opposite sex from pursuing you!