Sunny Chan blogs Can you see the Logic in my Madness?

Is Java really that slow? Does C# compiles to assembly code?

by Sunny Chan


Posted on Thursday April 24, 2008 at 05:07am in Anything


Last weekend I was having a chat with my friend, and they keep telling me "I thought all the banks are using .net". I asked why? They bring out the age old argument, "I thought Java is slow and C# generates native code"... Oh dear. This friend of mine is one of the cleverest guy I ever met, however he has been misinformed.

Java does not necessarily slower than C++. Yes, startup time maybe longer compare to a native application. However there are a lot of clever runtime optimization that can be done through a JIT that is not available to normal static compiler. For example, most of the JIT compiler would have generated fairly optimized assembler code, as well as using compilation techniques that can only be achieved by using run time profiling information. In the recent version of Hotspot it also contains technology like Biased Locking - this cannot be easily done using a normal static C++ compiler. In most case, Java is as fast as C++, and can be quite a bit faster in some circumstances.

C# does not compile into native code straight away, and it employs similar bytecode/JIT organisation similar to Java.

Java used to be pretty slow during the early days, but with the arrival of better runtime this is no longer the case. One of the problem that still need to resolved is the overhead of the garbage collector, especially using the large heap. There are a lot of clever people spending time solving this problem and hopefully we will get somewhere soon.

In the end, I can't be brothered to argue with him as he hold tightly to his beliefs, so we left it there. But I just wish people would take a look at the current state of the affair before dissing Java.

 







 


Love China - but do I have do agree with everything Chinese government does?

by Sunny Chan


Posted on Tuesday April 22, 2008 at 01:37am in Anything


I noticed that there has been a few people who has put up this "Love China" sign in the MSN. Fair enough I think one should be proud of their heritage and who they are. However, that does not means I have to agree with everything that the Chinese government does.

All the government over the world make use of propaganda. Does everyone remember the Iraq war and the 45-minute WMD claim? Silly me. I was so naive to believe the British Government on this. Same thing happens with Tibet - Chinese government would like you to think that Tibet has been "well-integrated" and the trouble has nothing to do with what the Chinese Government doing out there. Hm... does anyone see any parallel here?

Don't get me wrong. I am not saying I want to renounce my heritage. But do I want to associate with a country which supports Sudan and sell arms to Zimbabwe so that Robert Mugabe can whack once the bread basket of Africa? Maybe not.

So I love China because I am a Chinese and it's my heritage. However, I do not love the Chinese Communist Government.


Should I be doing something else?

by Sunny Chan


Posted on Wednesday April 09, 2008 at 07:49am in Anything


Well, being a JVM expert is quite fun, but then it seems like there are many other profession that is much more fun and gives you more perks! Take an example of a politican - all they do are talking hot air and they get perks like Second Home, and others expenses. Hang on a second - TV License for Tony Blair? Come on, he doesn't even like BBC!

As the credit crunch deepens, I am planning for my exit if the big enterprise that I am working for decided to lay people off and that I could find a job to do with computers:

  1. Be a plumber/electrician in London. Although the article is quite a few years old, I can confirm that there is still a shortage of plumber and electrician in London after the boiler fiasco.
  2. If I have got fed up with the city life, I don't mind going to Australia and be a beef farmer or even a miner or whatever they can do out there. You know. people from UK have a thing about Australia, and vice versa.
  3. Worse come to the worse, I can always go back to Hong Kong and teach English? Who cares about good tenses and stuff!

 Sounds like I am pretty sorted. Bring it on credit crunch.


The Beijing Olympics Torch Fiasco

by Sunny Chan


Posted on Tuesday April 08, 2008 at 09:12pm in Anything


Olympic Torch has been quite a big controversy recently with all these Tibet
independentists organised protest against the flame. I read in an article on The Independent today that the Olympic Torch was
first started by Nazi Germany as a part of their propaganda tool. Germany took
the torch from Athens to Berlin via Central and Eastern Europe to show off their glory. In the ancient Olympics they never had this torch ceremony
and it does not really serve any purpose other then the supposedly "showing it" as a symbol of the Olympic ideals.


If you look at the routes of Torch
Relay
from the previous Olympics, you will notice that most of them only
visit places in or near the hosting country (e.g. LA 1984, Seoul 1988, Barcelona
1992, Atlanta 1996 and Sydney 2000). Only the Beijing Olympics has its torch relay visiting pretty much half of the world. To me this feels like the PRC government is having
a ego (or "face") crisis and feel the need to show people who is running the greatest show on Earth. Nothing wrong with
that and if this makes them feel better then that's fine with me. However they
should not be surprised that people in the country the flame visits may not agree
with what PRC government is doing and would like to protest against it.PRC
government cannot blame anyone but themselves when there are so many
"embarrassing" incident along the route.


All this sounds like the
Emperor's New Clothes
to me you know....


Checklist of things I would love to do this year

by Sunny Chan


Posted on Wednesday April 02, 2008 at 01:47am in Anything


 Things that I would like before the year end:

  1. A road trip to Italy with Mini. Maybe an Italian Job
  2. Visit Scotland. Can you believe I have never been there, after 17 years I have been here?!!!!
  3. Surfing in Cornwall/Devon.
Anyone would like to join me for one of these adventures?


Has Sunny gone photo crazy?

by Sunny Chan


Posted on Wednesday April 02, 2008 at 01:40am in Anything


Not quite. If you are reading this blog entry over in Facebook, you might suddenly discover yourself tagged in some of my really old photos. You wonder what happened here? Let me explain.

I have been publishing a lot of my photos over in my website. I use it as a kind of my archive and let other people have an idea of what my life is like so far - my mom keep tabs of me on that photo site! :-) The site uses Gallery v1 and I highly recommend this if you ever need to build an online album website but don't want to use Flickr or something like that. When the Facebook API comes along people has been developing software that bridges Gallery to Facebook's Photo application. However, most of these solutions requires a newer version of Gallery.

As with most people I talk to at work, I am very reluctant to upgrade due to the fact that the new version of Gallery requires a proper SQL database, consider that I am only running on a 512MB Xen VPS provided by Slicehost. However last weekend I decided to take the plunge finally and upgrade my Gallery installation after all these years, and finally I can make use of Gallery Import and make those photos available.

There were some absolutely gems - including photos from my final few months in Felsted... I was so bloody slim! I blame those KFC I ate on my way back to halls in my first year......

Enjoy the picutres!

 

 



Comments on the cars that I have owned so far

by Sunny Chan


Posted on Monday March 31, 2008 at 05:28am in Anything


Well, I had owned three cars so far. Let me talk about my general feeling towards each of them.

 The first car that I drove was a Ford Escort. I bought it when I start working as a summer intern in IBM Hursley. That place is so remote and there is no way I can wake up early enough to catch a train and then a bus from Eastleigh. So, it was £1000 and it has done quite a few London and Eastleigh run on M3. Pretty good until near the end when the engine would cut out mysteriously. Althought the drive is not great it gets me from A to B pretty well, and people are impressed with it fitting 5 people. Don't miss this at all though.

 My second car was a Ford Puma. It's my graduation gift from my parent (thanks mom and dad) and it is the best car I have driven so far. Okay, a bit feminie on the outside but don't let it fool you - it's brilliant when you are doing 150% the speed limit on M27. It's quick, nimble, handle like a proper sports car and it still turn heads. I would have snap up another one if Ford decided to make another couple again. I have done plenty of Southampton to London runs as well as a few trips up to Liverpool, and it has done 40,000 in the 3 years that I owned the car, and boy did I enjoy every single minute of it. I would love to own a Ford Puma again at some point.

 Finally, the current Mrs. Chan, Mini Cooper. Well I got it because Ford has a reputation of going wrong when the warrantly runs out, and I cannot be borther to risk it. Anyway, I want a small and nimble car with 4 seats, and yet the Ford so call Puma replacement, the Ford StreetKa, is such a pile of bulls**t that I didn't even test drive it. So it was down to Mini then. Well, it wasn't as quick as the Puma and doesn't handle as well as the Puma, it is pretty good and I am quite happy to live with it. I have been to even more places with it, including the France driving trip to the south and Monaco. Though I have to say BMW really needs to improve on the build quality. Things are falling off my car - mostly the internal trims!

 So my firm favourite is still my Puma. Ford please make another brilliant car like Puma - I would buy one straight away.





 


Not been writing for a while

by Sunny Chan


Posted on Monday July 09, 2007 at 09:49pm in Anything


Well I haven't been writing my blog for a while - the reason is that I was using Apache Roller 3.0 and it has a few things broken in terms of the template and stuff, which I finally been managed to fix by diving into the Apache Derby Database that runs this blog. So I have upgraded to the latest version, and all it well again.


I will try to blog a little bit more now that all is fixed and we have a decent editor!


IT Volunteering in UK

by Sunny Chan


Posted on Friday January 12, 2007 at 09:07pm in Anything


Well, I don't know what kind of people who reads my blog :-)

But then if you are an IT person and would like to do some volunteering then here is a website for you: http://www.it4communities.org.uk. They allow people who have IT skills to donate their spare time to fix computers for charity around UK. I have signed up to this and trying to see whether there is an opportunty for me to do some voluteering work!



Wargames

by Sunny Chan


Posted on Sunday January 07, 2007 at 11:09pm in Anything


Today they showed Wargames on ITV this afternoon. Wow. The nostalgia is flooding back (I remember my first computer has two floopy drives and no hard drive, blah blah blah).. So I have been looking up on the net - You can still get a IMSAI 8080 computer (The one that kids used to hack into WORP) with a ATX motherboard in there.... I want that for Christmas!

Two observation: Why does all the computer geek always get the pretty girl, but they don't in the real life? And why is all the geek suppose to have that jittery movement? I don't!

Oh they are actually making a Sequel to Wargames this year. Can we have Scarlett Johanssen as the lead lady please? Well I suppose she is too "mature" for that :-)


RIP Steve Irwin

by Sunny Chan


Posted on Tuesday September 05, 2006 at 04:46am in Anything


I have enjoyed watching your program. So long for all the entartainment you have gave us



A quick status update

by Sunny Chan


Posted on Wednesday June 14, 2006 at 02:51am in Anything


I am back to UK after a nice and relaxing trip to Hong Kong - didn't really do a lot of interesting thing but I am now a proud owner of a new thinkpad (and 900 quid poorer)


I have already started working in certain big financial institution. It has been quite an experience for me and I have already working some interesting stuff. We will see what happens


My parents have arrived from Hong Kong last week and has been doing up my flat. The only stuff that is missing is my washing machine and the fridge - they tried to deliever them a few weeks ago but then they didn't have enough people and tools to move it up the stairs - I told them I live on the third floor and there is no lift! Nevermind.


So people in UK should expect a house warming invitation soon.



An old song

by Sunny Chan


Posted on Wednesday June 14, 2006 at 02:43am in Anything


For a friend of mine who is not having a great time


(Copied from http://supak.com/sunscreen.htm)


The lyrics to Everybody's Free to Wear Sunscreen, by Mary Schmich:


Wear sunscreen.

If I could offer you only one tip for the future, sunscreen would be it. The long-term benefits of sunscreen have been proved by scientists, whereas the rest of my advice has no basis more reliable than my own meandering experience. I will dispense this advice now.


Enjoy the power and beauty of your youth. Oh, never mind. You will not understand the power and beauty of your youth until they've faded. But trust me, in 20 years, you'll look back at photos of yourself and recall in a way you can't grasp now how much possibility lay before you and how fabulous you really looked. You are not as fat as you imagine.


Don't worry about the future. Or worry, but know that worrying is as effective as trying to solve an algebra equation by chewing bubble gum. The real troubles in your life are apt to be things that never crossed your worried mind, the kind that blindside you at 4 p.m. on some idle Tuesday.


Do one thing every day that scares you.


Sing.


Don't be reckless with other people's hearts. Don't put up with people who are reckless with yours.


Floss.


Don't waste your time on jealousy. Sometimes you're ahead, sometimes you're behind. The race is long and, in the end, it's only with yourself.


Remember compliments you receive. Forget the insults. If you succeed in doing this, tell me how.


Keep your old love letters. Throw away your old bank statements.


Stretch.


Don't feel guilty if you don't know what you want to do with your life. The most interesting people I know didn't know at 22 what they wanted to do with their lives. Some of the most interesting 40-year-olds I know still don't.


Get plenty of calcium. Be kind to your knees. You'll miss them when they're gone.


Maybe you'll marry, maybe you won't. Maybe you'll have children, maybe you won't. Maybe you'll divorce at 40, maybe you'll dance the funky chicken on your 75th wedding anniversary. Whatever you do, don't congratulate yourself too much, or berate yourself either. Your choices are half chance. So are everybody else's.


Enjoy your body. Use it every way you can. Don't be afraid of it or of what other people think of it. It's the greatest instrument you'll ever own.


Dance, even if you have nowhere to do it but your living room.


Read the directions, even if you don't follow them.


Do not read beauty magazines. They will only make you feel ugly.


Get to know your parents. You never know when they'll be gone for good. Be nice to your siblings. They're your best link to your past and the people most likely to stick with you in the future.


Understand that friends come and go, but with a precious few you should hold on. Work hard to bridge the gaps in geography and lifestyle, because the older you get, the more you need the people who knew you when you were young.


Live in New York City once, but leave before it makes you hard. Live in Northern California once, but leave before it makes you soft. Travel.


Accept certain inalienable truths: Prices will rise. Politicians will philander. You, too, will get old. And when you do, you'll fantasize that when you were young, prices were reasonable, politicians were noble and children respected their elders.


Respect your elders.


Don't expect anyone else to support you. Maybe you have a trust fund. Maybe you'll have a wealthy spouse. But you never know when either one might run out.


Don't mess too much with your hair or by the time you're 40 it will look 85.


Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia. Dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than it's worth.


But trust me on the sunscreen.


Flying again

by Sunny Chan


Posted on Tuesday May 09, 2006 at 11:23pm in Anything


Right now I am at the Heathrow Terminal 3 departure gate for CX252, waiting to get onto the plane. Well time flies it's nearly mid May and I am going to start my new job soon. It has been quite a breeze for me last few months!

Flat is progressing well. Hopefully once my kitchen has been installed and the carpet fitted, I can start moving myself in. I can't wait to get my own space again, and this time it is a place of my own! Thanks mom and dad for making it possible.

Quite looking forward to the new job - it will be a chanllenge but I am roaring to go. Shame that I will miss JavaOne this year but hoprelly there will be plenty of other conferences to go to!

The last game of the season was really good. The football is good and they are getting back to the winnings ways - even though they have been a bit wonky at the end they get the job done. I have a good feeling for the next season - hopefully I will be able to see them get back to the premiership next seasons!

Right. I am jumping on the plane now, so 7 hours later I will be back to Hong Kong!



The cat is out of the bag

by Sunny Chan


Posted on Thursday April 13, 2006 at 08:14am in Anything


Finally, the cat is out of the bag.

I have found myself a new job at an investment bank, which should remain nameless for now. I never thought I would end up in one of those, but the role feels like it is tailor made for me, with the opportunty to shine - plus the salary to match it! Well, I couldn't say no.

I can see this job is going to be tough and strench my ability, but it could be rewarding, in terms of job satisfication and monetary terms. So I think I need to put in 110% - hopefully I would achieve something great.

Anyway, I feel like this is a blessing from God... I don't feel like I deserve the job but now that I've got it I won't let it go easily (oh, unless I am burnt out of course) I am looking forward to the new challenge.

Thank you Ocado for giving me an opportunity to sharpen my Java skills - I have learnt a lot while I am there :-)

(It feels like I am writing an oscar acceptance speech!)