Jon Aquino's Mental Garden

Engineering beautiful software jon aquino labs | personal blog

Saturday, September 29, 2007

Simplicity and Difficulty are Orthogonal

Simplicity is beautiful. But simplicity is orthogonal to difficulty. Easy things are often simple, and hard things are often complicated. But making a hard thing simple takes skill. It also carries a risk: because it looks simple, it may seem easy to modify or work with, when in fact it is hard, fraught with dangers. An example would be a terse equation from higher mathematics, such as


from Einstein's explanation of covariant tensors. Beautifully simple but formidable to comprehend. Or Haskell code:


defining Fibonacci numbers as an infinite lazy list. Again, elegantly simple but hard to understand for the uninitiated.

Nevertheless, this is far better than the alternative, which is complicatedness. As C.A.R. Hoare remarked, "There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult."

October Challenge: Reading Knuth's "The Art of Computer Programming"

Attention all owners of Donald Knuth's book "The Art of Computer Programming" volume 1. bakert at has challenged me to consistent reading of this weighty tome for the month of October. I extend this challenge to all who own tAoCP but who, like most, have failed to make progress in it. Let us gather up our courage and resolve to read it consistently for 1 month.

Tuesday, September 25, 2007

Copy Title bookmarklet

Here's a Copy Title bookmarklet that puts the page title in a box that you can copy to your clipboard. Copying the title of the current page can be useful, e.g., pasting the title of a bug-tracker page into your version-control system, etc. I'm using it to paste JIRA bug titles into Subversion log messages.

Drag it into your Firefox Bookmarks menu!

Friday, September 21, 2007

PHP's static keyword

I quite like PHP's static keyword (C has the same thing). It lets you create a persistent variable that is local to a function, without having to add an instance variable. Useful for lazy loading:

private function getInvitation() {
static $invitation = null;
if (! $invitation) {
... create invitation ...
$invitation = ...;
return $invitation;

Tuesday, September 18, 2007

Steve Maguire on a management question he asks himself every morning

Steve Maguire: "The habit I've developed and used successfully for more
than a decade is to spend the first 10 or 15 minutes of each day making
a list of answers to the question: 'What can I do today that would help
keep the project on track for the next few months?'"

Monday, September 17, 2007 an experiment in the social construction of poems

I would like to announce an experimental website for the easy creation of collaborative poetry: (pronounced like "worsening"):

It's easy to start new poems and, more importantly, contribute lines to poems that other people have started. As shown in the screenshot above, there's a line editor that follows your mouse around, letting you insert verses wherever you like. You can also type in your name if you want to be credited for your work.

Saturday, September 15, 2007

Firefox extension: Vertigo: Vertical tabs

Vertical tabs are better than horizontal ones. Check out the Firefox Vertigo extension.


Thursday, September 13, 2007

Jon's Continuous WebCam Project: 3 months later

On July 4, I posted about using FlickrWebCam to snap a picture of myself every 6 hours, just as a way for me to see how my appearance changes over the coming decades.

Here are the results so far. There are some mildly embarassing shots, but nothing too outrageous.


Here are some I found interesting:

Night Vision Jon:

Bad Hair Jon:

Psychotic Jon:

Perplexed Jon:

Dazed Jon:

[Windows] AutoHotKey for fast window positioning

You can do some neat things with AutoHotKey (Windows scripting program). This morning I assigned some scripts to my numeric keypad to position the current window in vertical slots:

7 - left half of screen A
8 - right half of screen A
9 - left half of screen B
+ - right half of screen B

These next ones position the current window in horizontal slots:

4 - top half of screen A
5 - top half of screen B
1 - bottom half of screen A
2 - bottom half of screen B

Two keys for full screen:

/ - full screen A
* - full screen B

Here's the AutoHotKey code (tweak the numbers for your screen size):

WinGetActiveTitle, Title

WinGetActiveTitle, Title

WinGetActiveTitle, Title

WinGetActiveTitle, Title

WinGetActiveTitle, Title

WinGetActiveTitle, Title

WinGetActiveTitle, Title

WinGetActiveTitle, Title

WinGetActiveTitle, Title

WinGetActiveTitle, Title

Wednesday, September 12, 2007

[Outlook/Windows] Adding 5-minute delay to outbound emails, giving you a chance to change your mind

I love this tip: How to introduce a 5 minute delay when you send email from Outlook, so you can cancel it if you change your mind:

Use Outlook Rules to Prevent "Oh No!" After Sending Emails

Sunday, September 09, 2007

Calculating your "Life-Time": the current time when your life is scaled down to 1 day

Wouldn't it be neat to figure out, if your life were scaled down to 1 day, what time it would currently be? Well, you might not think it neat, but I do. I wrote a little script to calculate it:

     What time do you wake up?

     What time do you sleep?

     When is your birthday?


For me, it's currently 1:38pm.

Friday, September 07, 2007

Subversion: Quick test to check that all branch commits have been merged into trunk

In Subversion, here's a quick way to check that all branch commits have been merged into trunk:

- check out trunk into two folders: trunk1 and trunk2
- re-merge all branch commits into trunk2
- diff trunk1 and trunk2. They should be the same. Ignore conflicts. Anything new in trunk2 hasn't been merged into trunk.

And someone should really write a Perforce-style Time-Lapse View tool for Subversion. This is basically a 2-pane visual diff tool with a slider that you drag to scroll through all revisions of a file, to see what changed at each commit. The left side shows revision N, the right side shows revision N+1.

Monday, September 03, 2007

Switching from CoComment to

For tracking my comments around the blogosphere I'm switching to from CoComment, because it works. I haven't received a new comment notification from CoComment in weeks; with co.mments, I've started getting them a day after I signed up.

Also the co.mments bookmarklet is 1-click, unlike CoComment's bookmarklet which requires a click, then a wait, then a frantic click on a dialog box that disappears after two seconds.