The Horrors of Adopting Standards

Note: In order to not waste your time, I have decided to present the morals of the story before the actual story.

Morals of the story

  • Do the simplest thing that works;
  • Adopting a standard is not necessarily the simplest thing that works, depending on how you do it;
  • Look for reference implementation(s);
  • Look for intelligible documentation;

The actual story

Some of you know that I have been working on the capstone project since September 2005. We’re 10 people in the team and our project is about creating an extensible, web-based, software project management system, using Java Servlet and JSP technology. Eliott and I have been in charge of the task scheduler component since the very beginning.

Being the 2nd biggest standard-compliance freak in the team, I have decided that the task scheduler needs to support some existing calendar format. After some research, Eliott and I have agreed that the RFC 2445 iCalendar format would be the way to go for a few reasons:

  • It was already supported by major calendar programs (e.g. Mozilla Sunbird, Microsoft Outlook, and Apple’s iCal);
  • There was already a Java library (iCal4j) for working with iCalendar files;
  • The specifications for the format were publicly available.

We were quite excited because iCalendar seemed like a “big thing”, so we quickly grabbed the iCal4j library and started experimenting with it, while it was still at version 0.9.16. Soon though, we began running into problems.

First of all, learning to use the library was a disaster. We had no clue where to start and none of us knew the iCalendar format very well. The only documentation that the library had was some semi-complete JavaDoc. There was no tutorial and the introduction page on the official iCal4j website had some strange sample code that didn’t make much sense (e.g. one example involved creating an event, but then the sample code never showed how to insert that newly created event into the calendar object). This was our first mistake: to believe that the iCal4j library would be as good as an official reference implementation. This, combined with our inability to decipher the RFC 2445 specifications, made our life pretty miserable. Actually, I suspect the IETF is to blame for not writing intelligible specifications. =P

Once we began to get the hang of iCal4j, we produced some rough design, by deciding what functionality we needed and hence the classes for datasource and domain logic. We started coding and soon realised something fishy going on. Because the iCalendar file does not function like a database, everytime a single event needs to be read or added to the calendar, the whole iCalendar file needs to be read from disk, converted to a Calendar object, and once the event is added to the Calendar object, the iCalendar file is completely overwritten. This operating scheme is, of course, extremely inefficient and cannot be used with our system, where we expect hundreds of concurrent users. The fact that Mozilla Sunbird had switched its main storage from the iCalendar format to a simple database system confirmed our suspicion. Our solution was then to create a CalendarRegistry, which manages the reads and writes of iCalendar files, and at the same time provides protection against the concurrency issue of lost update.

The solution was far from perfect, however, as we found out soon after that the Java Virtual Machine has a limit on the amount of memory it can use, which seems to be 64 MB by default. Having the CalendarRegistry keep too many Calendar objects in memory was therefore also a bad idea.

In the end, we realised that the simplest thing to do was to just use a database for storage and add the functionality of importing from and exporting to iCalendar files. A few months of development time were lost, and we were sent back to the sketch board.

My Coffee Table

After reading Kathy Sierra’s post about her coffee table, I have decided to show off my coffee table, too. Ok, I don’t exactly have a coffee table, but I’ll show you what I have on my desk anyway.


  • Romance of the Three Kingdoms – one of the Four Great Classical Novels in Chinese literature;
  • Book of Han;
  • The Art of War – the original by Sun Zi; probably the best known of the Seven Military Classics; I also have another version with annotations by eleven Chinese historical figures, including the ambitious Cao Cao from the period of the Three Kingdoms;
  • Kong Ming’s Art of War – Kong Ming (Zhuge Liang‘s courtesy name) is a great politician, strategist, and tactician of legendary fame from the Three Kingdoms period; many people’s favourite character in The Romance of the Three Kingdoms, mostly for his wit, sense of honour, and loyalty;
  • Wei Liao Zi’s Art of War – Wei Liao Zi is not as famous as Sun Zi or Kong Ming, but still a great strategist and political theorist; another one of the Seven Military Classics;
  • Questions and Answers between Emperor Taizong of Tang and Li Jing – another one of the Seven Military Classics;
  • Four Booksthe reference for Confucianism;
  • The Heavenly Sword and the Dragon Saberwuxia novel by Jinyong;
  • The Deer and the Cauldron – another wuxia novel by Jinyong;
  • The Legend of the Condor Heroes – another one by Jinyong;
  • Three Hundred Poems of the Tang Dynasty;
  • Le Petit Prince – (finally some non-Chinese stuff, haha);
  • Technology & the Future – this is actually a required textbook of one of our engineering core classes; I kept it because it is an interesting read;
  • Invitation au latin, 4e – Highschool textbook to learn the Latin language and Roman history; written in French;
  • Invitation au latin, 3e – Despite the number, it is actually more advanced than the 4e.

Please note that I would rather read the Jinyong novels than watching any of these movies: Crouching Tiger, Hidden Dragon, Hero, or House of Flying Daggers. I consider the Hollywood effect dangerous and harmful to the proper development and preservation of the authentic wuxia genre.


I have so much music that I can’t make an exhaustive list of it, so I’ll just list my favourite artists and albums in general.

Concordia – Leaving Impressions – #1

I figured my friends should not suffer too long for my depression; so in an attempt to find something hopefully interesting to talk about, I have decided to write about some of my leaving impressions as I’m graduating from Concordia in a few months.

The feature of this first post is the 7th floor of the Hall building, the so-called cafeteria. Any student who has been at the Hall building in the past 2 or 3 years must remember how horrible the place used to be. The tables were dirty, the microwaves were filthy and frequently out of order, and the chairs were so out of balance that just putting a jacket at the back of one would tumble it.

Last summer, renovation work started on the 7th floor, so we basically lost the cafeteria for a good period of time. Students were forced to eat at the little Tim Horton’s snack shop, though they still provided microwave ovens. Renovation lasted until the end of Fall semester, when the 7th floor was gradually re-opened.

The change was enormous. Effective eating area got almost doubled, and there is even room with nice couches and low tables for students to chill at. We got all new tables and solid chairs, if only a bit awkward looking. For the moment, the tables and chairs are still clean. I hope Concordia keeps up with the maintenance.

Also, the renovation on the washrooms just finished around a week ago, though I must say that the washrooms of the 9th floor could have benefitted much more from a renovation.

At this point, something was still missing from the equation. I went to eat at the cafeteria two weeks ago and the first thing I noticed was a huge line up for two microwave ovens. Boy, was that amusing. I could not understand what was going on. Enlarging the cafeteria and then removing microwave ovens simply did not make sense. It turns out that we were getting 8 brand-new microwave ovens, in addition to the two old ones that were kept. These new ones even come with braille. I’m happy for the new students who get to enjoy the new facilities, but sorry for the graduating students who had to put up with a crappy cafeteria for the past 3 to 4 years.

What’s Wrong, K?

Warning: May contain traces (or an abundant amount) of blatant lies. Reader discretion is advised.

The up-front answer to the question above is: I don’t know.

The night before last night I had a dream. In the dream, I was about to graduate from high school. I was riding on a yellow school bus. I was actually happy and looking forward to something as I was riding on the bus. And then the scene suddenly changed and I felt I had gone to the graduation ball; almost immediately the scene changed back to the yellow school bus. Something really weird happened in the middle of the ride: a bunch of guys, armed with baseball bat and still in their highschool uniform, tried to rush in from the rear end of the bus. I somehow managed to grab the first guy’s baseball bat and swinged it at him. I was aiming for his chest but the hit somehow landed on his forehead. For some reason, the hit didn’t break his skull; he only got a scratch. I don’t know what happened afterwards but the invasion seemed to have died off. I was hoping the bus ride would never end and then I spotted this girl who was about to get off the bus. I felt like I knew her and rushed to the front of the bus to ask her for her phone number. She promptly gave me her number and then disappeared. I don’t remember exactly if the dream stopped here or if the bus ride continued on indefinitely.

And then I woke up.

It was time for breakfast so I fumbled my way down the stairs. I looked down on the floor the whole time. At the dining table, mom asked why I’m frowning all the time. And then my dad put in the remark that “nephews resemble their uncles” and that I’m like my eldest uncle (the head of our family business), who frowns all the time and brings down the morale of everybody working around him. Dad said I should not be like him if I want to become a leader. I didn’t know what to say, so I remained quiet and avoided eye contact, as always. And then my parents drove me to the Autoparc (read “bus terminal”), and mom said I should show up more often instead of locking myself in my room, since dad is here on Chinese New Year vacation. (Note to the reader: my dad works in Hong Kong.) Then my dad said that it’s not about whether I lock myself in my room, but rather that it’s about me not telling them anything when things go wrong. Dad proceeded to remark that I seemed to have lost the self-confidence that I had in highschool. During the whole ride I was just looking blankly down at the asphalt road through the side window. What confidence? Stop saying shit about things you don’t know, old man.

As I got out of the car, I could feel the tears at my eyes. I was suddenly reminded, once again, that I have been hating my life ever since the end of highschool. I had to hold my tears back, particularly since I bumped into people I know on the bus. I remained silent during the ride. The story of the day is over at this point. I had nothing to look forward to, and as I expected, nothing special happened, just like every damn day. I went to class and went back home, and proceeded to lock myself in my room like I do everyday.

Now, it’s time to respond to questions and propositions that my friends have posed in the past few weeks, the things that I never responded to on the spot because I simply could not:

Question 1, at Les Deux Pierrots

Chris: “K, talk to her.”

Answer: Talk about what? I have nothing to talk about. Do you want me to just go through the standard routine of “Hey, what’s up,” “how was work,” etc? I have nothing interesting to talk about and I can’t tell what is interesting about other people anymore. The fact that I have ADD doesn’t help either.

Question 2, at McKibbin’s

Kat: “K, why are you so quiet?”

Answer: Pretty much the same as above. Unlike you, Danny, and Matt, I have nothing to say that may interest anybody at the table. I assure you that you don’t want to hear me talk about how Apache Tomcat is troublesome, or how ridiculous the Windows set-up is at Concordia. In fact, the reason I drink beer even though I say I don’t like drinking is because I need a means to keep myself quiet, otherwise I would start talking about things that would bore the hell out of you.

Question 3, at Second Cup

Danny: “K, you should try to go out more, even on your own. Try going to a coffee shop to study instead of staying home.”

Answer: Wonderful suggestion, but my parents want me home.

Question 4, unknown place

Chris: “K, how can you not know about <such and such> series/singer/band?”

Answer: I don’t watch television here. My mom doesn’t understand oral English or French well enough to enjoy it. In fact, even I don’t understand half of what they say on television, though I look like I can speak English and French fluently. I watch Japanese drama and anime instead because they have subtitles that are actually large enough for mom to read. Watching Japanese drama and anime led me to listen to Japanese music instead of English and French, and that’s why I don’t know music around here in Montreal.

Question 5, follow up on Question 4

“Why don’t you watch Hong Kong television instead?”

Answer: Hong Kong television and music in the recent years is pure crap. The acting is bad, the themes are unoriginal, and we have bad composers, bad singers, and bad lyricists.

Hello world!

Hello everybody,

Welcome to the new home of SwordAngel and Friends. As I announced yesterday, my Xanga blog is no longer suitable for my needs and I need a full-fledged website. However, I will not remove the old content from the Xanga blog, nor will I bother migrating it here for another two or three months.

I just got the hosting set up for me a few hours ago, so please be patient while I try to customise and expand the site in the next two weeks. The layout and content may change drastically.