2011-01-01

I'm a lazy lazy man.

Despite so many ideas I'd ever have during the last year, I posted only two entries on this blog. Why is it so difficult to write something down?

Here're some excuses I've been used not to post:
  • I'm too busy! (yet still spent plenty of time before TV and playstation)
  • I'm too tired! (then spend two hours hanging on the Internet)
  • I just don't want to write ...
  • Writing is so difficult ...
  • Err, my English is rubbish ...
Or, I'm just a really lazy man.

2010-05-19

Javascript Array Length

Try the following code in different browsers:

var array = [1,2,3,4,]; //note the trailing ','

alert(array.length);

IE gives 5, Firefox and Google Chrome gives 4. Guess who gives the correct answer? It may be a little surprise. Congrats IE. Here's the spec from ECMAScript standard:

Array elements may be elided at the beginning, middle or end of the element list. Whenever a comma in the element list is not preceded by an AssignmentExpression (i.e., a comma at the beginning or after another comma), the missing array element contributes to the length of the Array and increases the index of subsequent elements. Elided array elements are not defined.

2010-02-18

I speak computer languages

It has been a long time since this blog is created. Finally, I come into a mood to put something on it.

About 12 months ago, a very brilliant idea (of cause, that's about programming) just came into my mind and I was eager to share with my friends (of cause, programmer friends). But when logged into my IMs, I just discovered none of them were online. It was a little frustration and then, I realized I need to start blogging.

As the next step, I spent several hours to find and compare online blogging sites, and finally settled down with blogger -- simply because I already had a Google account and didn't want to remember another password. Stupid, ah.

As the next next step, I spent another couple of hours to customize the header, footer, layout, and time format. Finally when it looked like what it is right now, I couldn't find a single trace of my brilliant idea in my mind any more! Very stupid, ah.

That's the story of this blog. That's the first post, I hope it won't be the last.

The brilliant idea has never been back, and I miss her.