Archive for March 2nd, 2007

Intelligent Design Sort

DM’s Esoteric Programming Languages - Intelligent Design Sort:

Intelligent design sort is a sorting algorithm based on the theory of intelligent design.

Algorithm Description

The probability of the original input list being in the exact order it’s in is 1/(n!). There is such a small likelihood of this that it’s clearly absurd to say that this happened by chance, so it must have been consciously put in that order by an intelligent Sorter. Therefore it’s safe to assume that it’s already optimally Sorted in some way that transcends our naïve mortal understanding of “ascending order”. Any attempt to change that order to conform to our own preconceptions would actually make it less sorted.

(Via Marc.)

Speed up Mail.app

Here’s a tip for speeding up Mail.app, in case it appears sluggish. Here’s how I did it on my MacBook Pro:

MaBi:~/Library/Mail ugocei$ ls -l Envelope Index
-rw-r--r--   1 ugocei  ugocei  84746240 Mar  2 17:08 Envelope Index
MaBi:~/Library/Mail ugocei$ cp Envelope Index Envelope Index.bak
MaBi:~/Library/Mail ugocei$ sqlite3 Envelope Index
SQLite version 3.1.3
Enter ".help" for instructions
sqlite> vacuum subjects;
MaBi:~/Library/Mail ugocei$ ls -l Envelope Index*
-rw-r--r--   1 ugocei  ugocei  75509760 Mar  2 17:11 Envelope Index
-rw-r--r--   1 ugocei  ugocei  84746240 Mar  2 17:09 Envelope Index.bak

Notice that the index didn’t shrink by much. Other people have reported much larger reductions, but starting from a smaller initial size.

I am also not sure Mail.app’s performance is much better now. It wasn’t particularly bad to start with, if not occasionally and when opening very large messages. I’ll have to use it for a while before I am able to tell the difference, if there’s any.