Monday, 18 April 2011

python-insertion sorting

Created on 17-Apr-2011

@author: Ananth Durai
Algorithm - Insertion Sort

#Define an Array say A
for j <- 2 to >= A[n]
do key <-A[j]
i <- j-1
while i > 0 and A[i] > key
do A[i+1] <- A[i]
i <- i -1
A[i+1] = key
print A

a = [4, 2, 1, 9, 8,12, 9,10, 6]
print "unsorted list::::%s" , a
for j in range(1, len(a)):
key = a[j]
i = j-1
while(i > -1 and a[i] > key):
a[i + 1] = a[i]
i = i - 1
a[i + 1] = key
print "sorted list::::%s" , a

Friday, 18 February 2011

why I think Android is a crap

There is lots of buzz going around Android operating systems. The popularity increasing day by day. In fact it is the number one operating system on mobile over taking IOS. Well it is well and good and why its a crap.??? The model which Google uses to develop Android makes its a crap all together. It is following "Closed Source Development" and "Open Eco System".
Now what that mean closed source development. Many people thinking and saying Android is an open source. Well it is not. It is free for implementation but the code is not open sourced. Which means the any third party developers can't commit their codes and contribute in to Android development. The feature Google going to release is also a closed group one, which means you don't know what it going to come on v2.4 or next to that.
What really goes wrong here. You need to integrate your software and hardware to produce the mobile phone. Suppose Samsung implement v2.4 OS and found not supportive or need improvement to match its hardware they can't simply wait and request Google to do that. Ideally they want to go and change the v2.4 code and implement the feature. They can't commit the change back and the consumers can't upgrade it to the next version and they have to wait until Samsung integrate their changes, which obviously create a closed system.
The open Eco system means you could implement any version of Android in your mobile phone and you could control the Apps market place or you can have your own Android Market Place. For instance Virgin mobiles has its Android market place, Amazon has its own market place which never contribute to the Android development.
The developer has to deploy his App across all the Eco System adopting different terms and policy, different price cuts. The publishers need to publish his content different systems with different subscription fee. Obviously Virgin will force users to access their own Market place and indirectly create a closed model which Apple so success on it.
The result of this model developers get confused, publishers get tired and consumers will have no clue what to update and where to purchase. I think it is time for Google to think of a "Open Source Development" and "Closed Eco System", Allow all these third party developers to contribute to the development, trigger innovation and create a closed Eco System so that there should be one place to purchase things.

Friday, 9 April 2010

Product Development 2.0

Hmmm.. yes, The 2.0 is a buzz word around the internet world. People start to do web 2.0, gov 2.0, education 2.0 etc etc. So why can't PD2.0?

These are my opinions about Product Development. We can define it as Product Development is all about marrying available technologies in to market needs. Now there comes two parts,

1. Available Technologies - where your software developers knows about.
2. Market Needs - Where your sales team and customer care team knows about.

As a developer and involved lots of start up and product development companies, I can clearly see there is no coordination or combine development strategy exist between these departments. Developers don know what is the market need of their product and sales person don know what are the technologies available. End of the day the product going to suffer.

A market winning product can came out of a team which is strong in technologies and good in sales. Neither one lag, you are out of your business. Now how we can use develop a team of developer and sales team? Do you wanna sit them together? Sharing lunch & beer? That wont do any good at all. how we can use technology?

Here you go. Twitter like tool is a perfect interaction tool to get co ordinated along with your team. It is simple way of expressing yourself. From their expression itself one would easily understand what kind of person he is and the way of thinking. It is more of knowing each others thought and ideal mind naturally close together and who know they may be your steve jobs & whizz.

Another way of expressing your self is blogs where one can express about their experience on sales and ideas, his daily life. A developer can blog about new findings and technologies, you could see all of the sudden there will be match among ideas and technology. there by developers can know the strength of their sales team and vice versa.

Most of the developers even don know about their company strategy, how they performing, what is their strength, where they lagging and who are their competitor. This is where blogging and twitting from the top level management is so important(Like from CEOs). A team with unique goal in their mind, a team which knows its strength and weakness can go miles.

This is where i strongly believe how the product development should be and companies should enable intra company bloggers and twitters (Not the public bloggers & Twitters) and encourage them to use it.


Wednesday, 7 April 2010

Traffic Rules and regulations.

I had a chance to spend some six months in London. I just saw the roads and traffic regulations and kind of public transport system they got is really excellent. (Though the British used to complain about delay in metro train). It is an state of the art infrastructure they developed.

Well it is almost 5 years since i have been here in Chennai. Like most of the IT guys, coming from far remote area almost to the south end of India, The temple city Tiruchandur.(Which I always proud about). I am driving in Chennai roads in almost 4 years now. What all I could see is corrupted traffic police, impatient people with lots of traffic violations, dusty roads. I had traveled on buses and trains with full of crowds and school kids& elders are struggling to get in to the bus.

What i could do? Now my first focus will be on developing infrastructure. But how far you can do? Building more fly-overs? Though i like fly overs concept it wont be a permanent solution for the crises. more and more fly overs more and more traffic. Now what is the solution??

The solution is really to establish a mass transport systems like metro train. I feel it should be done 10 years before itself. For instance if you could able to connect T-Nagar RS to Pondi bazzar station, it is really an easy way of transport. We need connect each and every corner of the city via metro train. Not just beach to tambaram. It will directly reduce the use of buses and that will reduce the load of roads with buses. If we can provide better rail transport means we could reduce the use of cars and bikes that saves the environment also.

Now we reduce the load on roads, How we can restrict corrupted traffic police and signal violations. I noticed on the UK roads all the signals covered with cameras and inter connected with a control room. I recently studied an article it says an australian cum indian company find a solution to read bike license numbers. I would install a camera along with the number board reader. Now if any one find violated of the traffic rules automatically a point will be reduced from his licence. If he lost 5 points his licence will be canceled and can't take again.

That can be used to monitor the performance of the traffic police and their bonus will be integrated along with that. If these things are automated people can't take anything easy that they can corrupt police and escape.

:) ---- Ananth.P

endeca enterprise search engine

Endeca is a enterprise wide search engine that supports navigational search and make search faster, Quicker and efficient manner. The Endeca operate like all our relevant data with different tables are mapped together and cooked up by endeca in a single flat file.

Endeca has three major components. They are like,
1. Endeca Information Transformation Layer (ITL)
2. Endeca MDEX Engine
3. Endeca presentation API.

The diagram below explains how different components interact together.

The ITL has an Content Acquisition System (CAS) which is responsible for reads your raw source data and manipulates it into a set of Endeca MDEX Engine indices.

The MDEX Engine loads the indices generated by the indexing
component of the Endeca Information Transformation Layer. After the
indices are loaded, the MDEX Engine receives queries from the Endeca
Presentation API, executes them against the loaded indices, and returns
the results to the client Web browser.

The Endeca Presentation API provides the interface to the MDEX Engine.
The API is responsible for querying the MDEX Engine and manipulating the
results. Endeca Presentation API has their own .NET and JAVA client libraries and it all so have supports web services based queries so that it can be implemented in anu languages.

Friday, 2 April 2010

java object creation static factory method

Many of you aware of static factory method which is a simple static method returns an instance of the class. An example like public static Boolean valueOf(boolean yourVal). No let me explain some of the advantages of using static factory method.

Some of the advantages:

1. When ever we invoke a constructor like Emp emp = new Emp() it creates an object. But using static factory method like Emp emp = Emp.getInstance() (Consider getInstance() is a static method which return type is EMP object) will always returns single Emp object no matter how many times we called them.

2. We could create any number of static methods with different names like getCar() return car object, getBreak() returns break object, But constructors have the constraints like should have the class name as their name. So we might need to differentiate using the parameter (using method overloading) which is good but on the readability point of view it will confuse.

So all good what about disadvantages. yah it has a main disadvantages,

Since we have all static methods naturally the constructor will be private. So we can't really extends the class. Some of the object orientations might me lost.

Tuesday, 29 September 2009

kalaivanan anna death

In life we come across so many people.Some one really stand in your memory lastlong. kalaivanan anna is one among them for me.

He is my neigbour in my village. I was shocked last week when i heard he passes away. He is about 50+ a widower, a drunker living lonely in his house.The sad part is that no one noticed him died for around 2 days :(. It is really hurted me a lot.

I just recalling his memories. I really start to watch him in my 10th standard. Before that i felt he is just another drunken guy.One day in drunk he spoke for some 10 minutes in english and i couldn't found any gramatical mistake. it is as fluent as an english guy.I bet he will get in to any call centers now a days with that fluency.

Later one day he spoken to me about his life. He was educated in loyala college chennai back in early 1980s. Grown up from a rich family background he get everything he wish. unfortunatly he got adicted with drugs and drinks. As soon as he finished
degree he got job in chennai. But due to the addiction and enough money he wasted everything. When he start to realize everything it is too late for him. He lost his wife and mother. He told me this advice on my house warming function day."You did great job Ananth but Never take life too easy even though you got enough money. Don't settle down". I will always remember his words.