Tuesday, April 4

Let the good times roll - part II

Despite its evident flaws (and the fact that my feminine side is highly exacerbated by their algorithm), I really like MyHeritage.
I uploaded Sunday's pictures to find out a bit more about my friends. It turns out they have a lot to explain...

Deanna's real name is Maggie Cheung, Jia and Zhang Ziyi have never been seen together in the same place (raising suspicions they're one and the same), Peter is a Nicolas Cage clone, and Rachel and Alyson Hannigan are twins separated at birth. [Click on the images to enlarge]


Jang Nara is no one but Rachel in disguise, Willo's part-time-job-we-were-never-allowed-to-know-about is modelling as Song Hye-Kyo, and my good friend Bo goes undercover as the philosopher John Dewey.

Sadly, the system didn't pick up my face :(

Let the good times roll

Dinner at my place: not enough plates, wine glasses, chairs, and cutlery (!), but still good fun. Great to see everybody and catch up with what they're doing.

Left to right: Rachel, Willo, Bo, and myself.

Left to right: Deanna, Jia, Peter, and Rachel

Friday, March 24

Thursday, March 23

David Allen vs Tom Peters

It seems David Allen

Even as late as the 1980s many professionals considered having a pocket Day-Timer the essence of being organized, and many people today think of their calendar as the central tool for being in control.
...
What you've probably discovered, at least at some level, is that a calendar, though important, can really effectively manage only a small portion of what you need to organize.
...
The real issue is how we manage actions.
[from Getting Things Done]

fundamentally disagrees with Tom Peters
You = Your calendar.
THIS IS MY #1 BELIEF ABOUT MANAGEMENT

(also: am I the only one to think they actually kind of look alike?)

Wednesday, March 22

Poor usability 2: Google Video


I find this one quite evil. If the chosen video "is not playable in my country", it shouldn't have been made available to me in the first place. Out of sight out of mind, right?
About Face 2.0 has something to say too:

Considerate software uses common sense


This one is a fundamental problem with navigation implementations using HTML frames. As you progress on the list and select an item after scrolling down, the scrollbar returns to the beginning of the list every time a refresh occurs. Thus, we're constantly scrolling up and down the list to go through all items. My favorite web aggregator, Bloglines, suffers from the same (quite annoying) problem.
Of course, there is an About Face 2.0 quote applicable:

Considerate software is perceptive
Software should watch our preferences and remember them without being explicitly asked to do so. If we always maximize an application to use the entire screen, the application should get the idea after a few sessions and always launch in that configuration. The same goes for placement of palettes, default tools, frequently used templates, and other useful settings.

Poor usability: Adobe


About Face 2.0 to the rescue:
Considerate software is self-confident
Are you sure? Are you really sure? Are you really, really sure?

And
Considerate software doesn't burden you with its personal problems
Software whines at us with error messages, interrupts us with confirmation dialog boxes, and brags to us with unnecessary notifications. We aren't interested in the program's crisis of confidence about whether or not to purge its recycle bin. We don't want to hear its whining about not being sure where to put a file on disk. We don't need to see information about the computer's data transfer rates and its loading sequence, any more than we need information about the customer service agent's unhappy love affair.

Well, I certainly won't like to reboot -not now, not later. Since I'm updating your software, all I need to know is: do I have to reboot to successfully update? Nothing more, nothing less.


Perhaps this is just me being anal but I find the label 'Quit' on the button rather annoying. The installation is complete, so what exactly am I quitting?
The only operation left seems to be close the window. Why not simply say that?

Tuesday, March 21

StringTokenizer

Note to self:
StringTokenizer is deprecated. Should use the split() method of the String class instead. Split() is faster and returns an array of tokens ready to be used.

Monday, March 13

My 2 cents

I know, The Daily WTF does a great job at doing this, but I really liked these error messages I was presented with recently.
Writely showed me this very funny pop-up dialog box:



Windows Movie Maker annoyed me with this one:

I'll make mine the words of Alan Cooper on About Face 2.0:

Considerate software is conscientious
If we rely on a word processor to draft a new MicroBlitz Contract and then try to [save it in the same folder as an existing, but older, MicroBlitz Contract], the program offers the choice of either overwriting and destroying the old contract or not saving it at all. The program not only isn't as capable as [a human assistant who saw
the name conflict and appropriately renamed the contracts], it isn't even as capable as [a human assistant who put the two contracts in the same folder]. It is stupider than a complete idiot. The software is dumb enough to make an assumption that because they have the same name, I meant to throw the old one away.


And my own 2 cents on WMM's error message:

  1. If there is such a thing as an invalid filename, tell me before hand what my valid options are. Don't wait until I use "invalid" options to let me know I've used them, right? It is worth mentioning that even after the input validation I was not told what those invalid names were. This inconsiderate application seems to want me to keep trying until I get it right.

  2. What happened to the option to overwrite an existing file, asking for my consent? That was actually what I wanted to do but was forced instead to save the file with a bogus name, delete previous one manually, and then rename bogus-named one with the intended name. There seems to be total lack of attention to detail and lazy programming here.

Friday, March 10

Wednesday, March 1

Still got it...

You Passed 8th Grade Math

Congratulations, you got 10/10 correct!

Thursday, February 23

Wednesday, February 22

2005 In Retrospect: Technology

These are the top 5 'technologies' that impressed me and/or saved my butt last year:

  • Scriptaculous, Rico, AjaxTags - AJAX made easy (the latest version of AjaxTags uses Scriptaculous).
  • Python - always reminding me why I chose computer science in the first place.
  • Ruby On Rails - very promising. I've only gone through their 15 minutes demo and wrote 1-2 small prototypes for myself, but I am impressed.
  • Spring rules. 2005 was 'The year of AOP' for me, and Spring made it a wonderful, productive experience.
  • iBatis - I've spent so much time with Hibernate doing things behind the curtains for me that I forgot how nice it is to manage SQL by myself at times.
Related post: 2005 In Retrospect: Music

Tuesday, February 21

Tomcat HTTP/1.1 GZip compression

I found out about Tomcat 5's built-in HTTP/1.1 GZip compression on this comment. This feature is off by default.
Having this feature off by default causes confusion and encourages people to reinvent the wheel, multiple times, with different flavors.
Bless.

Saturday, February 18

Celebrity match

The face recognition algorithm of MyHeritage matches this photo of mine (age 6?) with these celebrities [click on photo to enlarge]:


Yes, some are a bit disturbing, like John Woo?? Try yours at MyHeritage

Fearless: the music video is a great trailer

Thursday, February 16

"Found is the new search"


Cool (and not so cool) things about mag.nolia:

  • Great domain name.
  • Superb tag line (the title of this post).
  • Saved Copies of Web Pages - I've bookmarked many pages that now return 404's. This feature alone might be worth a business model.
  • Private bookmarks - Though why would a community oriented service encourage private stuff?
  • Bookmark rating system - We all love our lists, right?
  • Terrific design and they're rightfully proud of it.
  • Network with some well-known names - Ted Allen is there, Zeldman is there too.
They certainly did their homework and thought things through. However, as attractive as their service seems to be, I find no compelling reasons to move away from del.icio.us (and even less motivation to use two bookmarking services).
Really hope there is room for two in their segment.

[Update]: There is a great writeup here on their design/development process.

Tuesday, February 14

Adopt a comedian (the AAC needs you!)

ZeFrank has done it again. The 1/4 mile longcar bit kills me...

Monday, February 6

Python for experts - Shipping part 1

The last one of my previous series of posts on Python addresses the issue of shipping Python applications.
Simply put, if I ask people to help my research by using an application that I developed, I do not want to force them to:

  • read large manuals
  • unzip and fiddle with my 'distributed zipped folder' with executables, DLLs, and other helper files
  • install/uninstall stuff on their machine
  • waste their time
Ideally, I want to give them a small(ish), standalone file they can download, double-click to run, and delete when they're done.
On Windows, I could only find two tools that claim to accomplish that:

py2exe
PyInstaller

Both have options to deliver either a distribution folder or a standalone file executable. I was only interested on the latter option.

py2exe seems to have problems with applications using Tkinter for the GUI. For my server module, which does not have a GUI, the setup file below did the job.


# setup.py
from distutils.core import setup
import py2exe

setup(data_files=[("abbreviations.txt")],
   name = "Jiim Server",
   description = "Cross-Linguist Server Prototype.",
   version = "1.1",
   author='Jorge De Castro',
   author_email='jorge at bcs dot org dot uk',
   zipfile=None,
   console= [{"script": "server.py"}]
)


This yielded a server.exe standalone file with 4.5Mb.

PyInstaller hit the spot. It is simple to use (simpler than py2exe) and their documentation is very good. Furthermore, after I installed UPX as instructed on their homepage, the executable created was compressed to less than half(!) the size (1.85Mb) of the one created with py2exe. The command line options I used are shown below:

> python Makespec.py --onefile --name=server C:\Workplace\python\jiim\server.py
> python Build.py server\server.spec


It seems possible to have py2exe do the same (or most) things PyInstaller does, but the latter is much nicer and easier to use. Plus, it just works as expected.
Be prepared to struggle with py2exe's (lack of) documentation if you want slightly more complex setups.

Friday, February 3

My Reusable Advice - part 1

Logging and tracing are separate concerns of an application (except for applications where this is an explicitly specified requirement). Thus, I was becoming increasingly annoyed with the


import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
...



and corresponding logging calls all over core modules, business classes, and even POJOs that required occasional debugging.

Furthermore, any changes to logging policies/strategies required multiple changes across multiple classes and a rebuild.

AOP is the technology for separating crosscutting concerns into single units called aspects. An aspect is a modular unit of crosscutting implementation that encapsulates behaviors that affect multiple classes into reusable modules.
AOP is thus the best way to log & trace entry & exit methods on demand. My earlier reluctance was due to the slightly harder way to debug control flow, as exemplified below:


...
if (condition){
log("Doing X")
do X
}else{
log("Doing Y")
do Y
}
...


The scenario above is still possible but not so straight forward to do with AOP. But really, the gains outshone the limitations. Consider the advice below, using the SpringFramework:


import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class MethodExecutionTimeInterceptor implements MethodInterceptor {
private final Log logger = LogFactory.getLog(getClass());
public Object invoke(MethodInvocation methodInvocation) throws Throwable {
logger.info("intercepted method '" + methodInvocation.getMethod().getDeclaringClass() + "::" + methodInvocation.getMethod().getName() + "'");
long startTime = System.currentTimeMillis();
try {
Object retVal = methodInvocation.proceed();
return retVal;
} finally {
logger.info("method duration '" + (System.currentTimeMillis() - startTime) + "' msecs");
logger.info("resuming method '" + methodInvocation.getMethod().getDeclaringClass() + "::" + methodInvocation.getMethod().getName() + "'");
}
}
}


I can apply the logging unit above to any subset of classes in my application, or indeed to the whole application. The advice will automatically run whenever its pointcut matches a join point in my running program. Should logging requirements change or become redundant, I can remove the aspect without touching application code. The original code does not know of the logging aspect being applied to it.
This single aspect contributes to the implementation of a number of methods, modules, or objects, increasing both reusability and maintainability of the code.

For future reference, IBM DeveloperWorks as an extensive array of very useful articles on AOP.

A full logging example can be found here, many AOP resources can be found here, and a good introduction to AOP can be found here.

Thursday, February 2

2005 In Retrospect: Music

Here are the top 5 albums that were on heavy rotation on my iPod:

  1. Antony and the Johnsons, I'm a bird now - I first heard Antony & the Johnsons in 1999 (if my memory serves me well), when they opened for Current 93 at Sadler's Wells (I think). It was, together with David Byrne's "Monster in a Mirror Tour", one of the best and most intense live acts I have ever seen. Been a faithful fan ever since, and will never forget them.
  2. Bloc Party, Bloc Party - These Essex boys really rock! Keke, their frontman, has a quite a voice . Their sound has the rock'n'roll attitude of a Doolitle (I know, this is a bold statement!), the freshness of an early Blur, and can sometimes (Banquet) remind me of The Cure. "Like drinking poison, like eating glass" oh yeah!
  3. Coldplay, X & Y - Darnit. I admit I wasn't expecting much from this release but they certainly delivered. I give it up, Coldplay deserve to be right up there with the U2s and Radioheads: they simply have the talent.
  4. Royksopp, The Understanding - what a masterpiece, I love it! Karin Dreijer's voice in What else is there is unavoidably seductive!
  5. Zhou Hui - Something I brought from my trip to China in 2001. Just recovered my CD that was scratched due to overuse. She has got to have the most beautiful voice and sings like an angel. Can't even find an (non-Chinese) Internet link, that is how precious she is!

Runners up: dEUS - Pocket Revolution, Frank Black - Honeycomb, Gorillaz - Demon Days, Kings Of Leon - Aha Shake Heartbreak, Keane - Hopes and Fears, Sigur Ros - Takk

Wednesday, February 1

More WYSIWYG

In a previous post I referenced a few user-friendly, WYSIWYG editors for the Web. The good people at http://www.geniisoft.com compiled an extensive list with (all?) open-source and commercial WYSIWYG products in the market.
Nice one, thanks.