Mar 2005

I'm 100% smart!

(Warning: formatting is borked. Sue me for being lazy with copy’n’paste.)

Your brain: 25% interpersonal, 15% visual, 25% verbal, and 35% mathematical!

Congratulations on being 100% smart! The above score breaks down what kind of thinking you most enjoy

doing. It says nothing about how good you are at any one, just how interested
you are in each, relatively. A substantial difference in scores between two people means, conclusively, that they are different kinds
of thinkers.

Matching Summary:
Each of us has different tastes. Still, I offer the following advice, which I think is obvious:

  1. Don’t date someone if your interpersonal percentages
    differ by more than 50%

  2. Don’t be friends with someone if your verbal percentages
    differ by more than 60%

  3. Don’t have sex with someone if their math percentage
    is over 50%

Update, April 2005:
Try my new test, the 3-Variable Purity Test

My test tracked 4 variables How you compared to other people your age and gender

You scored higher than 70%
on interpersonal

You scored higher than 11%
on visual

You scored higher than 70%
on verbal

You scored higher than 48%
on mathematical

Link: The 4-Variable IQ Test written by chriscoyne on Ok Cupid

Coding Fonts

I’m frequently surprised whenever I see veteran coders whittling away in Windows using Courier New or some equally horrible monospace font. (Yeah, I know this is all subjective, so if you don’t like my opinions, go back to using Comic Sans MS, OK?) Considering how much you can stare at the screen all day if you’re a professional coder, a readable pleasant font could actually improve your productivity and lifestyle, in every Dilbertesque sense.

Windows actually comes with a great monospace font that unfortunately seems to be reserved for use by its console windows only. Macintosh folks have been lucky to have had an excellent monospace font (Monaco 9) since its inception in 1984, and UNIX/X11 people have been blessed with truly excellent monospace fonts (schumacher-clean and good ol’ fixed, whoever made that.)

So, if you’re never thought about your choice of a coding font, check out the following fonts which were made for heavy-duty programmers (complete with slashed zeros; long live the IBM PS/2!). Most of them are available for Windows, the Mac and Linux, too.


A Short History of Nearly Everything

This book has received a hell of a lot of praise from a hell of a lot of people: all I can say is that it greatly deserves it. Bill Bryson manages to make the book both educational and entertaining. I wish this was a textbook that I had to read for high school (in addition to more in-depth textbooks on the particular topic being studied, of course): it’s the only book I’ve read that made geology seem non-boring. (I wouldn’t quite say that it stirred an interest in geology for me, but it at least made me appreciate it as a science, which I never did before.) Even if you do know quite a lot about the Stars and the Earth, it’s worthwhile reading this just to get an idea of the personalities who were behind all the discoveries.

Best of all, many of the topics it discusses, such as life and the galaxy, gave me back that sense of wonder I had about science and discovery when I was a younger lad. Every time it got me thinking about the beauty of nature and the universe, it brought a smile to my face — and I think it’s worth reading just for that. Highly recommended!


An alternative PDF viewer for Windows

Welp, I finally got sick of Adobe Acrobat Reader 6.0 for Windows. Rather than downgrade to Acrobat Reader 5.0, which definitely sucks less (but still sucks), I Googled around and found an alternative PDF viewer for Windows called Foxit PDF Reader. Wow, double-click on a PDF and a viewer window opens in half a second. It can render fonts using ClearType, and you can select text too. Lightweight goodness.


reduce() in Python

There’s been a reasonable amount of publicity about Guido van Rossum’s comments on the usefulness of the reduce function in Python, but there’s quite an interesting comment on Lambda the Ultimate about how reduce() in Python is quite, well, broken:

Heh. reduce() is broken in python (in that it’s not actually a fold function), so I don’t blame Guido for not being able to figure it out in his head. Rather than handling the zero- and one-element list cases properly, it (a) doesn’t take a basis element, (b) raises an error on empty lists and © RETURNS THE SINGLE ELEMENT WITHOUT CALLING A FUNCTION ON IT in the one-element case (true even in recursion). … The way it’s defined, reduce is not fold, it’s a broken fold.

Folding an empty list results in an error? If that is the case, well, it’s no wonder it wasn’t used in Python very much. I’d very much rather Python rip out a half-arsed fold function altogether rather than trying to make it semi-functional (pun intended). That only gives a bad impression about functional programming, and doesn’t benefit anyone. (Disclaimer: I haven’t double-checked the above claim myself, so I don’t know if what Jacob says it’s true. The Lambda the Ultimate folks usually have their heads screwed on very right when it comes to anything to do with programming language semantics, though …)

For the record, I also disagree with Guido’s assertions that map() and filter() should go away just because list comprehensions exist. map and filter have single purposes: to transform lists, and filter lists. Since list comprehensions can do the job of both map and filter, it’s not immediately obvious what they do, because they now give you more choice, and more choice means less immediate obviousness. If you see a map or filter, you know it’s just doing a list tranformation or a list filter, and that’s it. If you see a list comprehension, you have to read its innards to understand what it’s doing. Or (using Haskell syntax) do you really think [ x | x <- [1..10], isEven x ] more immediately obvious filter (isEven) [1..10]? Considering Python’s heavy emphasis on code readability, that sounds like a step backwards to me.

Update: As pointed out, if you use an initialiser with reduce(), you get sane behaviour back. That’s good. However, I find it a bit odd that an initialiser is optional, rather than mandatory. (It’s managed to fool at least one user into thinking fold is broken — how many more people had the same misconception?)

Update #2: Shane Stephens points out that the optional-initialiser-version of reduce() is actually quite useful. Rather than try to repeat it abysmally, I’ll just clag in a part of Shane’s email here:

… there’s a very good (but possibly non functional-programming-oriented) reason for the optional lack of a basis in python’s reduce function: sometimes you don’t WANT to run the function on a single element. A good example is concatenating strings: reduce(lambda a, b: a + ", " + b, some_array).

Indeed, this is 100% analagous to the foldl1 function in Haskell, which is the same as a fold, but doesn’t take an initialiser element. So, it looks like half of this article of mine is full of crap. :)



I just found a little gadgety program for Windows named Y’z Shadow: all it does is add a little shadow effect to your windows (similarly to Mac OS X’s window shadow). While it sounds gimmicky, it’s amazing just how much difference a little shadow makes in distinguishing one window from the next. Try it out and see if it makes window management just that little bit easier for you!

Update: It looks like the YzShadow link above is dead, but you can appear to download it from at least one other website.


Paul Graham on Usability

Paul Graham has a new article titled How to Start a Startup, which is an excellent article for hackers who are interested in business. There’s lots of gems in there, but I particularly liked this one:

It’s worth trying very, very hard to make technology easy to use. Hackers are so used to computers that they have no idea how horrifying software seems to normal people. Stephen Hawking’s editor told him that every equation he included in his book would cut sales in half. When you work on making technology easier to use, you’re riding that curve up instead of down. A 10% improvement in ease of use doesn’t just increase your sales 10%. It’s more likely to double your sales.

Maybe Graham can get through to hackers where Jakob Neilsen and other usability experts have failed. That one paragraph is a concise summary of a point that Neilsen has been trying to advocate for years: spend the time and money on improving your software’s usability, and it’ll turn out to be a net profit.