A Priceless Picture

September 4, 2006

A few days back, my friend Farhan Hafeez sent me a picture. This picture is priceless for me. It was taken on March 22, 2001 (Yes I still remember the date). It was our last day in Government College (Now Government College University) Lahore. Most of the people in the picture were 12 yrs old friends (10 yrs of School and 2 yrs of College). For me, this was a 4 yrs old friendship (2 yrs of Matriculation and 2 years of College). I was a relatively new one in the group but was so much well adjusted that most people now think that I was in their school (I had people asking me, “Hey, in which section of school were you? I remember you were there but cannot remember your section.”).

We all had a wonderful time together and then split up. Some went to Medical colleges, some to Engineering University and others to Computer and Business studies etc. Now some of these are in different cities and countries. All these people in this picture rarely meet but whenever any two of us meet, its an exciting day. 

 

There is an old adage – “Make new friends, keep the old. One is silver, the other is gold.”

These people and this picture reminds of a wonderful, carefree College life a.k.a “Those Were the Best Days of My Life“.

Here is the picture (Its not in a very good shape as it was probably scanned but who cares).

 


And I still need to learn some cooking

August 31, 2006

Oh ! When in December 2005, I got selected for Microsoft and I was told that I could join in October 2006 – I thought it is never going to come. However its almost coming and now I think I am unprepared. Finishing couple of projects is not the most problematic issue right now. Most problematic issue is perhaps SHOPPING (No, I don’t like shopping that much:P) and I have a HUGE list.

And I still need to learn some basics of cooking. I remembered this cooking stuff because I came across this site.

By the way, the followings web-sites have got a lot of Pakistani recipes. I must remember all of these and they will be handy once I am in Seattle.

http://www.contactpakistan.com/pakfood

http://www.desicookbook.com/categories.aspx

http://www.urdupoint.com/cooking (This website is in Urdu).

http://www.pakirecipes.com/recipes/recipes.php

http://www.nicepakistan.com/food.htm

There are many more 😛 but I have to do shopping as well .. hehe :D.


SpiralFrog – Free Music (AD Supported) .. Finally Coming!

August 30, 2006

I had wished and hoped that this should happen and now its going to happen. Universal Music Group, the world’s largest music company, has agreed to make its entire library of songs in collaboration with SpiralFrog. This is truly exciting. They would show a 90 second commercial for an audio song and 120 second commercial for a video. This should have been there earlier. We do see this on televisions. We watch commercials and we get dramas/movies etc (and we all know that TV commercials have a great impact).

This is probably the exact same model. This would bring new audience for the advertisers. Many people who use pirated music would shift to this. The songs would be ad-free and we can listen to them (as many times as we want) on any device (computer, portable music players, cell phones etc.). People who pay $1 for each download would also go for this.

Time is money and so obviously SpiralFrog’s Chairman Joe Mohen said, “The currency we’re using is time”. I did some interesting calculations for this “TIME IS MONEY” part for audio songs (you can do it for videos on your own ;)).

Time to download from iTunes at $1                 =    20 sec

Time to download from SpiralFrog a $0.00        =    90 sec

Time wasted in SpiralFrog (allegedly)                =    90 – 20 = 70 sec

Money Saved for spending extra 70 sec             =    $1 approx. 

For Back-of-the-envelope calculation, let say that we save $1 for each minute that we spend watching advertisements. 

So IFF you are earning more than $1/minute (i.e $60/hour) and you can work the whole day, only then you should go for $1 downloads as you will earn more in the saved 1 minute from paid downloads. Otherwise if you want to download something and have got extra 60 seconds that won’t earn you $1, go for these AD Supported downloads :P.

By the way, if you make $60/hour (and work for 16 hours, sleep for 8 hours), you make $960 a day. This makes 4800/week (5 days/week) and makes 19200/month (4 weeks/month) … which makes $230400/yr. If you are earning (and working) that much, probably this service was not for you 😛 – its targeted at teenagers (or other people) who spend a lot of time on music everyday.

Way to go SpiralFrog. I am excited about your December 2006 launch.


Probable Bug in Visual Studio

August 25, 2006

My friend Mohsin Saleem (no he doesn’t have a blog, so cannot link here) pointed out that he has seen a strange behavior on Visual Studio 6 for the following code.

  1. union u {
  2.     union u {
  3.         int i;
  4.         int j;
  5.     } a[20]; //Edit: Its not a[10]. Faisal, thanks for pointing it out.
  6.     int b[20]; 
  7. }u;
  8. int main()
  9. {
  10.     printf(“%d\n”, sizeof(u) );
  11.     printf(“%d\n”, sizeof(u.a));
  12.     return 0;
  13. }

Visual Studio returned

80
1600

Now that was amazing. I opened it in VS7. When made a .cpp file, it flagged a compile time error. When shifted to .c file, the same results 80, 1600.

Tried it on Dev-C++ and it worked according to what theory suggests. It returned

80
80

 

When change line 5 to “} a[10]”, Visual studio returned

40
400

Dev C++ Returned
40
40

With some other examples, I concluded that Visual Studio does this. sizeof(u) * (number of elements in a).

Don’t know whether this bug is reported or not. If it is, good. If not, the credit goes to Mohsin who first pointed this to me :).

 Edit2: Faisal also told me that he tried it on VS 2005 and its still a bug. Thanks to him in pointing out some blunders in my explanation as well.


How to Select Most recently updated Records in Access for each Person

August 24, 2006

Well. First Disclaimer. I am not very good at writing queries. So it might be an easy task for someone, but it wasn’t for me.

The problem was simple but I spent a considerable amount of time before I got the solution.

I have a table in Access called Designation_Person. It contains Person_ID, Designation_ID and Date_Updated. Now a person can have several designations over time and these are distinguished by Date_Updated.

e.g Records can be of this form 

  1. Person_ID = 1, Designation_ID = 100, Date_Updated = April 5, 2006
  2. Person_ID = 2, Designation_ID = 120, Date_Updated = May 9, 2005
  3. Person_ID = 1, Designation_ID = 150, Date_Updated = August 25, 2006

Now the problem was that I wanted to have only the CURRENT designation of a person i.e the record with the latest Date_Updated for each Person_ID.

This is how I achieved it

SELECT Designation_Person.*
FROM Designation_Person
WHERE (((Designation_Person.Date_Updated)=(SELECT MAX(Date_Updated)
FROM Designation_Person AS date_max
WHERE date_max.Person_ID = Designation_Person.Person_ID)));

 

Just posting this if someone else is trying to do similar thing, he would have to waste lesser time 🙂


My Celebrity Look-Alikes

August 20, 2006

This is really funny. Visit MyHeritage Face Recognition. It requires free registration. Upload your photograph and it will tell you that you resemble this and this celebrity (also displays the percentage of resemblance).

Now look at my results with different photographs.

Here is the first one

 

Here is the second one

 

Here is the third one

 

Here is the fourth one

 

Here is the fifth one.

 

I have tried different images of mine and the results have been stunningly different. It means the algorithm is still not very good. However, it might be the start of searching within the images (Web-based even).

Although I don’t know the names of the most of these people but some computer algorithm suggests that we look alike :P. Have Fun !

P.S. If anyone of my friend tries this, do send me the links to your resemblances as well.


KFC Run by Deaf

August 19, 2006

I went to a KFC branch today and saw that most of the staff at that outlet was deaf or probably had some other disability. There was a huge board as well that said that this restaurant has employees that are deaf or mute.

It was a pleasant surprise to see that some organization has started this. People with disabilities don’t get many jobs but its good when companies begin to accommodate them. Its a good business trick to attract customers but more important is the social service that they are providing to the society.

Now when I came back and searched on Internet, I realized that this concept is not new in KFC. May be its the first one in Pakistan but this has been done by KFC in other parts of the world.

Next time, when I have to go somewhere to eat, KFC will have an edge because they are trying to accommodate neglected people of our society.

This gives me another idea. Software is another industry where these people can work with proper training e.g. if we train those people how to design web sites, how to write programs etc – then they can work as a freelancer at least. There are many web sites like RentACoder and Kasamba etc. where one doesn’t need to talk/hear most of the times. Most of the communication is done through emails etc. These disabled people can earn a reasonable living through this.