Tuesday, September 25, 2007

Making a career choice

While growing up, many people will give you generic advice that sound like this: “chase your dreams”. This seems to imply that you are looking at the goal-point and deciding what you should do now. This is potentially so disastrous that it should come with a disclaimer - "Chase your dreams* - Terms and conditions may apply".

Dreams

First of all, what is a dream? If your life goal is something transient like “I want to be rich”, or, horrors, “I want to be a PhD”, then what happens after you have attained that objective? You have achieved the purpose of your life. That's a mean feat to beat, but I suppose once you are rich, you are able to pursue other interests and engage in philanthropist activities like funding the cure for cancer, or saving the world. Or once you are conferred a PhD, you can, uhm, well, that's not go there.

The point is that if your satisfaction is achieved only at the endpoints, that means you spend most of your time unsatisfied while you are working. Instead of evaluating your life based on what you have achieved, view life as a journey - enjoy the ride.

I think the solution is to move generally towards your goal. This is in reference to one particular trekking exercise when I was training in the army. I was lost and asked the leader where exactly we were on the map. "Well, I'm not sure where we are too. But the end-point is at the North, so I am moving generally Northwards". I thought he was crazy back then, but in retrospect, I would have been consumed by the inane need to know exactly where we were and would have wasted time by stopping whereas his decision to simply proceed towards the goal was the most sound decision. We got to our destination ahead of schedule.

In other words, you pursue the things which you are interested in. As long as you are not wasting your time, you can worry later about what actual paths you take. However, taking up scholarships in Singapore is particularly noteworthy and there is a specific question students considering to take up scholarships which have bonds (like those in Singapore) need to ask themselves. Are you truly interested in the work that the institution will assign you after graduation? I am not talking about faint interest like "oh yeah, I find health policies to be important and 'interesting'. Working at the Ministry of Health will be a breeze!" I am talking about the fire and the passion to work on something even if you are not going to be paid. Are you as eager to start work as Rambo is to dash into the battlefield? Yes, that's the kind of dedication I am referring to.

Many, in fact, most people have a resigned view on this. Oh, it is impossible to be working on things that you love. Seeing them work is almost like clockwork, start at 9, perform work, end at 5. It does not mean that they are not good at what they do, but it does mean that when things become difficult, they will be the first to leave. Motivation, that's the key. Even the misguided individuals (IMHO) who are working for the pot of gold at the end will persevere longer than unmotivated people. But, only the truly passionate people are deriving any sense of satisfaction from the work.

The Almost Non-Job

Undoubtedly the most amazing fact is that almost everyone knows this, and yet so many choose the daily grind of going to work doing things they do not like. Going to Google is a fantastic opportunity - one that I think few would hesitate to take up. But it almost never came to be because I never actually wanted to apply.

My wife had found out that one of her friends knew someone in Google, so she requested her friend to forward my resume without asking me. And I got angry. I got angry because I did not think I was ready to apply. It's too soon, too early. What if they reject me? That would ruin my chances in the future.

But guess what, what if it's not too soon? Maybe the time is now, and you never know. That's why I am on a crusade to encourage people to venture out of their comfort zone. I openly ask people if they want to apply to Google, and if so, they should get me to refer. Cynical people like to retort and ask, "There must be a catch - There has to be employee referral bonus". And why yes, there is a $2000 referral for each successful referral. But that's not the point. Getting a Google employee to refer you vastly improves your chances of being noticed by recruiters because Google is on track to receive more than two million resumes in 2007.

If you do not dream big, you will not do big things. I hope your life can be shaped by your own dreams and curiosity. Just remember you do not have to wait to start - take the first step now.

Labels: ,

Sunday, September 23, 2007

I love DHS!

Last friday I returned to my high school alma mater, Dunman High School, to give a career guidance talk about computer science. The invitation gave me some pause and allowed me to reflect heavily on career/life choices, which I hope to consolidate into an essay later.

However, I have to discuss these adorable 50th anniversary dolls that were presented as tokens of appreciation for, uhm, talking about ourselves. It was initially all, Ohh AHHHH look at the cute dolls in school uniform.

However, upon close inspection the dolls seem to be have been created by someone very, uhm, zealous of Dunman High. I wonder if I can buy real-life replicas of the ... attires.

DHS Dolls

Look - Dunman High Socks!

Love those socks



And ... Dunman High underwear for girls, that say, "I love DHS"!

I love DHS!


Edit 24 Sept: In other news, Dunman High has a Sakae Sushi store in its canteen. Don't believe me?

Sakae Sushi Store in Dunman High

The store is also listed in Sakae Sushi's website. As it turns out, the founder of Sakae Sushi is an alumni of the school.

Labels: , ,

Thursday, September 20, 2007

Not Doctor Doctor

I received the official notification for the conferment of the PhD degree yesterday, and my parents, a family friend and my wife were commenting and joking how it is so nice to have a fake doctor in the house.

Because you know, I'm not a Doctor Doctor. :)

The Fake Doctor -- Useful only for service and reservations.

Labels: ,

Friday, September 14, 2007

Moving to California

As I prepare to move to Mountain View, California to work at Google, I have come to the realization that working in USA starts with a flowchart of applications and the unfortunate conundrum of cyclic requirements.

Of utmost importance, one needs a social security number to start work, but you are advised to wait 10 business days after stepping foot in US before applying. That practically means you have to arrive two to three weeks at least before commencing employment.

Do not kick off your shoes and relax until the 10 days are up. You can take your time to open bank accounts, which typically require a local mailing address. The local mailing address that you do not have because you have only just arrived.

No problem, you seek out a rental apartment, which often have landlords that want to see your credit history and bank account, that you do not have because (1) you do not have a social security number so you do not have a credit history, (2) no bank will allow you to open an account because you do not have a mailing address (that you are currently negotiating to get) and (3) heck! you have not even started working in the US yet!

Speaking of credit history, as first-time worker in US, you have zero credit history even after getting your social security number. As it turns out, this interesting omission means you cannot apply for credit cards. Well, not the usual ones in Singapore at least, where the bank gives you a credit limit without any collateral based on salary information. No, you got to earn that right. You start with a level 1 weenie credit card - a secured credit card.

However, I am sure I will get by as countless of individuals have. Here's my plan:
1. Open Citibank Singapore CitiAccess - this US$ checking and saving accounts gives me access to my (pathetic) US funds without having to resort to Traveler's Cheques (1% commission + conversion commission!) or carrying hordes of cash into US.

2. Go to US.

3. Find a rental apartment, show Citibank account and pay cash upfront for security deposit and first month rent.

4a. Apply for bank account, most likely from Citibank USA.

4b. Apply for driving license from your state (in my case, California DMV) - you need an address for this

5. Apply for SSN

6. Kick off shoes and relax for 30 minutes before heading out for first day at work.

Labels: , , ,

Thursday, September 6, 2007

Liquid Resize

One of the talking points of SIGGRAPH has been Liquid Resizing, also known as seam carving/removal or content aware image resizing.

Check out the YouTube video demonstration, and then read the paper [http://www.faculty.idc.ac.il/arik/imret.pdf]. While the effect is visually impressive, the mathematics and concept are surprisingly simple and easy to explain.

There are "uninteresting" parts of an image - these occur when nothing in particular is present at a pixel. There are numerous measures we can use to detect this, but one simple function is edge detection. If there are no edges (i.e. transitions to other objects) around a pixel, that means nothing is there! This is easily computed using the intensity gradient, which is a fancy way of saying I(x) = 0.5*I(x+1) - 0.5*I(x-1), where I(x) is the intensity of the pixel at location x. Using dynamic programming, it is computationally tractable to find the minimum energy seam where energy is just the intensity gradient, and a seam is a 1-pixel width line from one edge of the image to the other edge (can be vertical or horizontal). This minimum energy seam can be thought of as the most "uninteresting" single-pixel line in the image.

To downsize the image by width, delete the most "uninteresting" vertical seam. We surely will miss it the least of all the vertical seams present in the image. Likewise, to reduce the height of an image, remove the minimum energy horizontal seam. We repeatedly remove such seams until the desired dimensions are reached.

The word "easy" is thrown around too often

It's really simple. I spent one morning coding it up in Python using PIL and numpy, and the source code is available here. (Disclaimer: It's slow.)

To resize an image to width 100 pixels and height 200 pixels and preview it:

import liquid
liquid.resize("test.jpg",100,200).show()


An example

Let's see an example. Start by using an image from flickr - "a man, a whale, a beach"
a man, a whale, a beach - medium

We can take a look at some of the low energy seams, which seem roughly correct.
a man, a whale, a beach - seams


We now proceed to remove seams to resize from 373x500 pixels to 249x249 pixels.
a man, a whale, a beach - resized


Not bad not bad - The man, most of the cloud and the wave on the right are largely preserved. This is all the more surprising because the algorithm has no concept of "man", "cloud", "whale" or "wave"! It's simply looking for seams with as few "edges" as possible (in a manner of speaking).

It's also possible to resize the image larger. We do this by inserting averages of pixels beside minimum energy seams instead of removing them.

1. Find minimum energy seam. (Horizontal or Vertical depending on which dimension to lengthen)
2. Insert a 1-pixel seam beside (left or right is fine) minimum energy seam and set the pixel value to be the average of the adjacent pixels.

Let's try that on our man, whale, beach picture:
a man, a whale, a beach - resized

Ah well. I really should be getting back to work.

Labels: , , , ,