Pages

Wednesday, July 30, 2008

Google maps gets better with camera - see the road before you drive


Click on the camera icon in the route map and play with the road!

Thursday, July 24, 2008

Tuesday, July 22, 2008

If not integrate then sync and vice versa

A lot of the technology companies are driving forces behind synchronization and integration these days.

Reason for synchronization and integration: We are clearing up the mess we generated by experimenting and developing ubiquitous things in the past decade(s). No, I didn't mean to say we should not have experimented or tried things. One part that lead us to the state is the human nature to create a unique footprint for themselves. (which resulted in many different devices doing exactly the same thing)And the other part is choice; which is very important, everyone needs variety and that is the reason for the so many flavors of the same products. We have hundreds and thousands of phone models, may be hundreds of TV models, and the list goes on. But what next?

When on the one side we are thinking to create new devices (I mean novel); on the other side we are trying to make the existing devices work better, predominantly making the existing devices works better amongst themselves and not as stand alone. (To me, the known devices are working well enough as a standalone)

So what does synchronization have to play here? Well synchronization is the way of making things look seamless and sharing the data across devices and platforms. Based on the situation a user chooses what to use, but would always want to stay updated. Meaning, if I receive a mail to my mail account and if I were at travel I want to see the message from my mobile phone.

The other part is integration, making things simpler in the front and adding complexities in the back. The devices that are built are integrating different form factors in to one and increasing their capabilities. Your TV is as intelligent as your PC, and your PC can do a lot of work as a phone and your phone can have a mini pc and a TV in it. So every device is adding a feature from other devices or the other and becoming SMARTER.

A good example for synchronization product is Apple TV and a good example of integration is smart phone.
But why two ways to solve the problem of many devices, well we like different flavors don't we? Part of the answer is yes, the other would be, we have done so many things that cannot be ripped off right away.

Things that cannot be integrated are being synchronized and things that cannot be synchronized are being integrated.

IT is a one world in many and many in one world.

Monday, July 21, 2008

Google shopping search - errors for WallE

Last week I had a chance to see Wall E, amazing movie from Disney Pixar duo. I enjoyed the movie and could not stop appreciating the creators.



I wanted to buy the WallE toy, and tried Amazon, Live and Google.

Live product search could not understand "WallE toy", it returned me two pages of search results that were not related to toys. It seems Live can only understand "wall e" or "wall-e", does not live up to expectations.
Then tried Google shopping search for "walle toy", obviously I saw huge set of search results. Then I sorted by price:low to high, waiting to see the affordable ones that I can pick. The search page started with $0.10, I kept naviagting to the next 10 pages at a time (Google also populated a set of new 10 pages at a time). When I was at page 73, I saw the link until 82nd page as below.

Then I tried to navigate to page 82, it resulted in a error. I tried the lower (< 82) pages and figured out the links were broken. It worked only until the 75th page that had the last item priced at $2.99. The first search without any sorting resulted in a $49 item, which I did not see in the sorted results. This was not just a one time issue, I was able to reproduce the same issue multiple times!


This kind off keeps me happy in a way, "software engineers still have work to do".

Thursday, July 10, 2008

"Brute force" as a last option.

Brute force is not a highly recommended method to solve a problem. But it comes handy at times, when you want to have a solution and do not care about the time and space complexity.

Often during interviews you would be asked for questions such as find the combinations, permutation, choices, etc for a given string/number. You are now being tested to think logically to get the combinations in a simple and effective way. An effective way is to split solution in to number of patterns for example: one pattern might have to do with reversing the locations of the previously considered number and the current number and continue to the next; another could be looping through only the positions that are even etc. Finally the combination of these patterns could give you the whole solution.

But even after thinking hard and if you are not very confident about the solution, then it is OK to ask the interviewer that does (s)he care about the solution or a solution with effective algorithm for time and space complexity. Often (99%) the answer would be yes give the solution first and I might ask you to improve the performance later. Remember you do not have plenty of time in an interview, so impressing the interviewer with a solution often would work. (But you must genuinely try for the best solution and only if not possible go to other options)

The easy way to apply brute force in a typical problem like permutation combination would be that,
step1:
Identify how many number of combinations would result first. For example: with the number 123 you can form 123, 132, 213, 231, 312, 321 are the possible combinations and it is as easy as 3! (Factorial -> 3*2*1 = 6). You must figure out the logic for the given problem to get the number of resultant combinations.

step2:
Build a dictionary (hash table) say a .NET dictionary, such that when the dictionary reaches the maximum limit of the number from step1 you are done with the combinations itself. Now how do you populate the key and values in the dictionary?
The key will be the combination itself; like 123/231/321 from the above example. To get that combination of numbers you can loop through a random number logic which will pick a random number each time, controlled by a limit. In this case it could be get three random numbers and if a random number is already obtained go and fetch another which is unique. After you keep repeating this and get the number, verify if that number is present in the dictionary or not, if not update the dictionary with the key and store a dummy value like 0 or 1 (unless you wanted some logic in the value field too).
At the end of iterations you will get the dictionary with all the combinations you need, but who knew off the CPU cycles that your algorithm consumed.

Applying brute force helps, but find a better way!