26 Jul 2010

The true color of IT projects

Can you imagine someone placing you on a cockpit of a plane. Then you are asked to fly and the plane.

You have been selected as pilot based on your physics degree and understanding of aerodynamics.

You have also flown a plane before but not like this plate and the controls on that plane were very much different. For example, the throttle control on previous plane is same as landing gear in current plane.

There is no manual defining your controls. Your manager asked just to operate each lever, switch and discover what it is used for.

Will you be a passenger on that plane? Probably not.

This situation analogous to what happens in thousands of complex IT projects. There are no documentations and code which was supposed to be an agile testing proof of concept, becomes live version. The original developers left the company with the knowledge in their heads.

The passengers (end users/customers) are still being served (flown) by pilots (developers) who don't really understand what they are doing.

The IT projects still seriously lack any standardization. People still expect adding wings to a car will make it a plane.

16 Jul 2010

What is driving pleasure?

My following discussion is purely for driving on normal roads and does not include track racing!

I often hear people say "this car is dull to drive, that car is thrilling, that road is boring" etc.

Then I start to wonder, what exactly makes a driving enjoyable?

So, I prepared a list of attributes that required for driving enjoyment. This is my personal list so others may differ.

Driving pleasure often associtated with psychology of driver. Same road in same car, one might find interesting while others may find it boring. Once mind must be in a state of good mood to enjoy driving. Seldom people enjoy their daily drive to work!

I think driving pleasure is a combination of following parameters

1. The state of mind of driver
2. The road
3. The car

Let's talk about roads. Nobody, as I am aware of, enjoys driving on a congested stop-start traffic in large town. But nearly everyone enjoys a scenic drive along country side. People tend to like twisty country roads more than straight motorways.

So, we can rank roads like this - town (worst), motorway/long straight roads (medium) and twisty country roads (best)

However, I get panicked if I have to drive thru a single track road, with bushes both sides. So, just a sceneic route is not enough. The road itself should encourage relaxed drive.

Next the car, probably the most important bit. Same route, driven in an expensive and luxurious car will feel different (at least for first time). As soon as you start to drive a better (in your mind) car, your mind automatically climbs up a higher level of achievement.

But you can have fun in same car which you drive daily. I noticed that body and mind feel thrilled when the car producing high power, which happens at lower gears with high RPM. The sound of engine roaring and feel of power along the road gives rise to thrill in mind. That is why it is often said a drive in sports car is thrilling.

A sports car offer following features over most standard cars

* A powerful engine
* A lower seating position - where you sit lower to ground which gives a feeling of high speed ride (compare a video shot at car's bumper level compared with that of in normal windscreen level)
* A high RPM engine experience (as stated above)
* The mental feeling of driving something special

However, as I already mentioned, one can have driving pleasure in normal car too. Provided it is driven to spawn thrill.

An off road driving is also very thrilling with a good 4x4. I was quite spellbound in my first ever off road experience with Land Rover.

Surprisingly, I did not find any difference in driving pleasure between manual and automatic cars!

1 Jul 2010

Black Swan Event

How did Black Swan name came into picture?

For a long time, people used to think all swans are white only. It was only when black swans were found in Australia, a long-time notion was changed!

Taleb tries to explain how Black Swan events happen in real life and what are the impacts of it.


Identifying a black swan event

Based on the author's criteria:

1. The event is a surprise (to the observer).
2. The event has a major impact.
3. After the fact, the event is rationalized by hindsight, as if it had been expected.

Taleb suggests that since most Black Swan events are without any precedence, it is almost impossible to predict such events.

So, one can only accept the events after they have happened.
The main idea in Taleb's book is not to attempt to predict Black Swan Events, but to build robustness against negative ones that occur and being able to exploit positive ones. Taleb contends that banks and trading firms are very vulnerable to hazardous Black Swan Events and are exposed to
losses beyond that predicted by their defective models.

See Wikipedia for more.

30 Jun 2010

Types of Oracle joins

Just as a brush up of Oracle join understanding.

Suppose we are joining two tables in Oracle.

SELECT T1.X, T2.Y
FROM T1 JOIN T2 ON T1.X = T2.X

Assume, T1 is driving table (i.e. more rows than T2)

Nested Loop join
------------------

for each record in T1
find matching record in T2 where T1.X = T2.X
fetch that record into result set

Now if there is no index on column X in T2, Oracle will perform full table scan for each record in T1.

Hash join
---------

Oracle will load create an in-memory index (knowns as hash table) for T2 (i.e. smaller table)

It will still perform similar operation

for each record in T1
find matching record in T2 where T1.X = T2.X
fetch that record into result set

But even if there is no index on T2.X, Oracle will use the hash table which works similar to index!

Clearly this is suitable only when T2 is small otherwise [1] hash table may not fit in memory [2] creation of hash table may involve a long time (then we could have created the index on T2 in first place!)

Sorted Merge join
-------------------

If both tables are very big, hash join is not suitable due to memory/time requirement and nested loop will be slow or will result in full table scan.

The alternative way to speed up performance is to use sorted merge join.

In this case, both tables are sorted by Oracle (using temporary tablespace) by joining key (X in this case).

The advantage is, when joining two tables, Oracle just needs to scan only a small part of the table (e.g. as they are sorted, to find a record in T2 when T1.X = 15 will require Oracle search just from X=10 to X=20 in T2 as it cannot be beyond this range and so on).

The trade off is, it will take some resource (space/time/memory) to sort the tables.

Usually Oracle chooses best method of join based on statistics avaialble. However, user may force using a different type of join using hints like use_hash(T1,T2) etc.

25 Jun 2010

Data Protection Act summary


As applicable in EEA/EU
Personal Information is data which relates to a living individual who can be either:
  • Identified directly from that information or
  • Identified indirectly from that information combined with any other data that is in the possession of the organisation holding the information.
The law requires that personal information provided to an organisation is,
  • Managed fairly and lawfully
  • Recorded accurately and kept secure.
  • Kept up-to-date
  • Used solely for the purposes agreed to.
  • Kept no longer than necessary.
An individual has the legal right to:
  • ask an organisation if they hold personal information about them
  • ask an organisation that does have their personal information:
  • what the information recorded is
  • what it's used for
  • a copy of all their personal information on record
  • receive a copy of all their personal information within 40 days
An individual has the legal right to:
  • Take action to rectify, block, erase or destroy inaccurate information.
  • Take action for compensation if damage is suffered by any contravention of the Act.
  • Take any complaint to the Office of the Information Commissioner, an independent body responsible for ensuring that the rules of the Data Protection Act are complied with.
The First Principle
Personal information must be processed fairly and lawfully.
For sensitive information to be processed an organisation must obtain an individual's explicit consent.
Sensitive personal data is information about an individual's,
  • racial or ethnic origin
  • political opinions
  • religious opinions
  • trade union membership
  • physical or mental health
  • sexual life
  • alleged or actual legal offences
  • legal proceedings or judgements.
The Second Principle
Personal information must be obtained and used for specified and lawful purposes.
We must make sure that an individual knows and understands why we want to use information about them.
We should make it clear to the individual what the information will be used for and who else it may be passed on to.
The Third Principle
Personal information must be adequate, relevant and not excessive.
We should only collect and keep personal information that allows us to do our work.
We should not hold any unnecessary personal details.
The Fourth Principle
Personal information must be accurate and kept up-to-date.
It is important for us to make sure that the personal information we hold is correct, up-to-date, and not misleading.
When collecting this information we should take reasonable steps to make certain that personal details are accurate.
The Fifth Principle
Personal information must be kept for no longer than necessary.
We should only keep on record a person's details for as long as it takes for us to do our work and no longer.
The information should be regularly updated and disposed of securely when we no longer need to use it.
The Sixth Principle
Personal information must be processed in accordance with the rights of the individual.
While we are working with a person's details we should make sure we do not use the information in a way which could cause them damage or distress.
We must also remember that an individual has the legal right to be given a copy of all their personal information recorded.
The Seventh Principle
Personal information must be kept secure.
We need to make sure that personal details held by us are safe from damage, accidental loss, destruction or unlawful access.
We should consider the harm or damage that could be caused through a breach in security and provide appropriate levels of,
  • security vetting to ensure the reliability of personnel
  • physical security
  • technological security
The Eighth Principle
Personal information must be properly protected when transferred overseas.
Personal information should not be transferred outside European Economic Areas to countries that do not ensure adequate levels of data protection for data subjects.
Adequate security measures should be taken to make certain information is not violated either in transit or at its destination.
Areas of Exemption
There are a number of areas of exemption provided for within the Data Protection Act. Although it is not the objective of this course to cover these in any detail, an awareness of them is valuable.
Different levels of exemption apply to different areas. Other examples of areas where exemptions apply are those involving,
  • National Security
  • Crime and Taxation
  • Credit Reference Agencies
  • Health, Education and Social Work
  • Journalism
  • Legal, Professional Privilege
  • Public Information, information made available to the public by law.

6 Jun 2010

The McKinsey Way

Recently I read this book. I thought of writing down the salient points so that I do not forget.

Building the solution

  • Fact based
  • Rigidly structured
  • Hypothesis driven

The problem is not always the problem.

Don’t reinvent wheel but every client is unique.

Follow 80/20 rule. Work smarter not harder.

Find key drivers in business.

Know your solution so that you can precisely explain to your client in 30 seconds.

Break the problem into small bits and try to solve each part instead of trying to solve whole thing in one go. But don’t lose focus from big picture.

Say “I don’t know” if necessary.

A little team bonding goes a long way. Make your boss look good.

When you go for an interview, be prepared. During an interview, listen and guide.

Display data with charts.

A good business message will have – brevity, thoroughness and structure.

Maintain confidentially whenever appropriate.

Keep client team on your side. Work around liability client team members.

Engage client in solution process.

Be rigorous about implementation steps of your solution.

A good assistant is a lifeline.

If you want a life, lay down some rules.

22 Apr 2010

Diminishing era of desktop applications

During 1990s, there was a craze for developing desktop applications (i.e. applications like EXE files which are run locally from personal computers).
There was a reason, PC market was just catching up and 95% computers were using Windows! So, once you develop an application, it could potentially run on 95% of computers in the world. Also, broadband internet was not widespread at that time and dial up speed was abysmal at today's (2010) standard.
But after 2005 or so, Windows lost a good deal or market share to Apple and Linux. Broadband became cheaper and speed went up exponentially.
As a result, cloud or internet based applications started to prosper.
Just ask yourself, how many local applications you use in your computer now? Unless you a technical user (engineer, IT professional etc.) chances are you just use File Explorer, Browser and Office suite applications (or may be few games for your kid/s to play).
Then came smart phones! A lot of small apps are now available in phones. Who needs a computer to calculate compound interest anymore? Modern smart phones are as powerful as computers of 5 years back!
So, the reward (not just monetary) for developing desktop applications is diminishing.
The only future desktop applications will be mostly server based like databases, engineering applications etc.
As more and more operating systems will become popular, developers will try to create applications which will be used by many. So, web based apps will be natural choice.