Wednesday, June 24, 2009

Seven Questions I Hate to Answer

1. What are you doing now?
A very ordinary question but while at the University I used to hate answering it, since my usual answer will be "I am at the university", which would 90% of the time lead to a question "Engineering?" and then when I answer "No Science" the look on the face of the questioner would turn sacastic and lead to a general discussion on the future of doing a Science degree. Later on I found a better answer to the first question itself, "I am doing a Science degree, since I was not good enough to get into Engineering" (full stop)


2. Your ID says that you were born in Jaffna, has a Kandy address and now you are in Colombo, Explain?
I need to write an autobiography and give it to them if I am to answer this question...lol

3. Where are you?
A question asked with genuine concern , but when woken up from the deep slumber in the bus can be quiet annoying when you know that even if I look out of the window I will not be able to identify where the bus is currently traveling through.


4. Are you busy?
For god sake do not ask me this question, I feel embarrassed since usually I am jobless..lol


5. How was the paper?
When ever I finish an exam and come out I want to forget about it and get on with something else which is more fun and positive. This question reminds me of all the horrors. So my usual answer will be either "Printed on quality paper" or "Done, do we have anything else which is interesting"


6. Why are you coming here?
Outright a very rude question , I need to have been trespassing to deserve this question. If I had been bugging some one, then of course I deserve it. But funnily I had been asked this question a few times at the airport. Specially when this question is asked from me when I get down from a midnight flight I always think that I should give an answer like "you dumb idiot, check my passport, I am coming back to my own country after a very short stay overseas and I don't need answer this question like a foreigner"..... attitude attitude attitude of some of our government officials cannot even be changed in their tombs.


7. What is your confidence level?
Started to hear this question more recently. When asked I have a big problem in giving a value, since at most times I cannot find any rationale to answer this question. Personally when asked in isolation as part of making a decision I used to think that it was a very dumb question. At least if this is asked along with an opportuity for the reasoning of the confidence level I feel a bit better in answering.

Sunday, June 21, 2009

Look who is talking about responsibility

While traveling around each day I bounce in to different people. Today while taking the taxi to the Changi I met up with an interesting taxi driver. He was a tall, Chinese, middle aged man. As soon as I got into the Taxi I said "I want to go to Changi" and then he asked "what was the terminal?" I replied, “I think Terminal 1...but let me check the ticket and confirm", so while I was digging my bag to get the ticket out. He told me “Tell me the air line la, I might be able to tell the terminal", as soon I had found the ticket and told him, “its Emirates Airlines and Terminal 1”. Then this guy started to explain to me about the airlines and the terminal relationships. I never new anything like that, although I had been to Changi a few times.

Then he explained to me why he asked for the airline, I was utterly surprised by this explanation. He told me even if the passenger has mistakenly told him a wrong Terminal number; it was the RESPONSIBILITY as the taxi driver to use his knowledge in the best possible way to help the passenger to get to the right terminal. Now I thought for a moment and was thinking was it “an extended self imposed responsibility” that this guy was talking about. Then I was trying to map to my job. If customer gives me a wrong requirement which will be a hindrance to him and he cannot foresee, isn’t it my professional responsibility to go that extra mile to make the relevant suggestion with the best of my knowledge?, so for my profession I thought the answer was an yes, This led me to analyze my own thinking process. I was thinking at least for a few minutes why did consider this was unnecessary RESPONSIBILITY of a taxi driver. Then I realized that the mistake that I made was that I did not consider that the taxi driving was a professional occupation, within myself I felt ashamed, after seeing the infamous three wheel drivers around this place , I had grown up never thinking that this was a profession which has a set of ethics and RESPONSIBILITIES.

This was the point at which I realized why the Singapore Taxi drivers stood out. A level of service I had never found in any of the other countries I had been to, it’s not about luxury but a service known for its highest level of trust and discipline.

Then he inquired from me whether if I was reading the paper while I was here. I said I didn’t get to read any local Singapore news papers and was only checking the international news websites last few days. He then related to me the story of a taxi driver who “threw” out two ladies from the taxi in the middle of the night in a jungle. This sounded weird, in Singapore standards by a jungle; I think he might probably be refereeing to a patch of road with trees on both sides of it. Still he was really angry with his fellow taxi driver to have done this and bought discredit to his profession. He explained to me that the taxi driver, when in a position where he is unable to find the place to drop the passenger, he should have called a friend to get the location information or at least should have dropped the two ladies at a safer location at a highway or a mall.

He was so proud of his company, when he said the taxi company sacked the driver and his license was removed. He then told me if this was not done people will start to assume “he can do, I can do, and we can do” and it will spread like a virus and become an accepted practice”!!! Then he hit the nail on the head when he told a Chinese proverb and translated it to English which was something similar to “Kill one to stop hundred”. I usually hate to hear proverbs talking about killing but in this context I should confess that I liked it.

Monday, June 8, 2009

MySQL Development Best Practices

I strongly believe that MySQL programming best practices need to be known and followed by each developer, since practicing query optimization from day one make everyone's life much more easier. So I present here a very simple MySQL Development check list.


Check List for General Best Practices

1. Checking for indexing

1.1 All columns in the 'WHERE' clauses indexed?
  • [Eg. select * from student where StudentId = '7986'; then column StudentId need to be indexed]
1.2 All columns in the 'ORDER BY' indexed?
  • [Eg. select * from student ORDER BY dob; then column dob need to be indexed]

1.3 All columns in the 'GROUP BY' indexed?
  • [Eg. select * from student GROUP BY Class; then column Class need to be indexed]
1.4 All columns used for joins indexed?
  • [Eg. select country.Name, city.Name where country.Id = city.CountryId; both country.Id and City.CountryId are better to be indexed]

2. Checking for over indexing

2.1 No redundant indexes?
  • when having composite indexes remember that the left most indexes can serve as indexing and does not require separate indexes.
  • [Eg. select * from student where house = 'YELLOWS' and class = '3E';
  • if student table has the following indexes a. index(house,class) b. index(house)The index(house) is a redundant index hence not required and better be removed.
2.2 No indexes that has been created and never used within the 'WHERE'or ORDER BY or GROUP BY or for joins?

2.3 No simple indexes created on column which does not have unique values?
  • [Eg. A simple index on a 'sex' column with a data set with a distribution of 45% Males and 55% Females will not be usually used for result pruning]

3. Check for data types

3.1 Has the appropriate shortest data type been chosen for each column?
  • [Eg. If a column can be defined as TINYINT do not have it as BIGINT]
  • [Eg. If a column can be defined as varchar(10) do not define it as varchar(255)]
  • [Eg. If a column can be defined as enum do not define it either as varchar, char or int]
3.2 Has the integer columns not taking minus values defined as 'unsigned'?

3.3 Has the columns which could never have NULL values explicitly defined as NOT NULL?

4. INNODB Specific Checks

4.1 No char columns in INNODB tables?
  • [ Do not use char columns in INNODB always have VARCHAR]
4.2 Does All the INNODB tables have primary key?

4.3 Are the columns in the Primary key of the minimal possible length?

4.4 Has all the statements like, select count(*) from innodbTable; statements eliminated?
  • [Specially do not use on critical tables with a huge dataset. As an alternative to the select count(*) use summary tables]

* NOTE: I had avoided complicated practices and included only the most simple practices.

Tuesday, June 2, 2009

panorama pics






I had become sort of addicted to taking panorama pics while I travel around. If I am to confess the reason why I bought this camera [Kodak M853] its actually because of three things(mainly),
1. Suits my limited budget
2. Has capability for night photography and shake free.
3. The talent of the sales person by showing me the panorama mode.

Now I feel that I had slowly staring to master it and here are some panorama pics taken in Singapore.