Monday, February 13, 2006

Launch event tonight

There's another launch event tonight at LUMS. I'll again be talking about ASP.NET master pages, login controls and data controls. The other presenter is Rai Yawar. Let's see how the event goes. The demo source code is already uploaded.

Friday, February 10, 2006

Blind justice

Well, the SCP has lifted ban of kite flying (if any such thing was in effect) for 15 days. So, killing people has been made legal for 15 days. Thank you, so much.
Indian sugar mills have raised the prices of sugar after news of Pakistan importing sugar from India. Well, I guess they're not much different from us.

Thursday, February 09, 2006

Profit

A few weeks ago, while my car was at the automotive mechanic workshops, I went to buy some gear oil from a nearby shop. The shop owner is a seemingly nice person, has a long beard, always carries a tasbeeh and never misses a prayer in the mosque, which I notice whenever I have been to the workshop.
I gave the oil to the mechanic and went to the university. A while later, when I returned to the workshop, the workshop owner asked me where I had bought the oil from. I told him I bought it at the neighboring shop. I had bought those cans for Rs. 190 each. The owner told me that he had learnt from the mechanic how much I had bought them for and he bought the same oil at the gas station for Rs. 120 each for me and asked me to return the cans to the shop owner if possible.
What a shock! Something that is retailing for Rs. 120 carries sufficient margin for the shopkeeper, yet he'd love to sell it for as much as possible. Cant trust anything in Pakistan, can you. And to think that he seems so religious, and is selling something for about 50% more than necessary. What is all his religious practice teaching him?
At least in the land of the infidel, I could go to WalMart and rest assured that whatever I buy, I buy it for what it is worth. I can find things of various quality on the same shelf, and the best quality is expensive and the compromise is cheaper. The choice is mine. But here, I am confused. I buy expensive, yet low quality.

Tuesday, February 07, 2006

Cloud number nine(teen)

Well, well, strange things happen, dont they. I was coming from the masjid a few minutes ago when I saw my algo teacher approaching. Just as I was about to say salam to him, he said, "Tumhari first assignment achchee thee." Now that's a very interesting course and with the size of the class, it is not easy to impress him. I am so excited!
The fun part is that he recognized and rememberd me by face, name and roll number, which in such a class is remarkable.

Monday, February 06, 2006

Spring cleaning

Two things. First, I saw PM Shortcut on TV today as he was supposedly condemning the cartoon affair. Well, his body language didnt look like it. He looked more to be apologizing than condemning. I guess it is justified with the kind of economic and moral debts that we are under, we are basically sold. And slaves dont complain. See how the condemnation from the government has come almost a week after the incident.
Second, there's news of reforms in jails on, like, not putting restraints in the feet and stuff. Lots of reforms. Well, those who are planning and executing it belong there, so I call it spring cleaning. Starting at the home, so to speak.

Saturday, February 04, 2006

Presentation

Alright, so here I am at Khorsheed Mahal Avari Towers, Lahore, yet again. This time around, I am at the other end of the hall in the speakers' area, where I will be giving a presentation on VSTS 2005 and ASP.NET 2.0. I had a class at 2 pm, which ended at 3:20 pm and getting to Avari before 4 pm was almost impossible given the traffic and the traffic lights. Fortunately, I got here a couple of minutes before 4 pm. Also, Vaqar Khamisani is still giving his presentation, so my presentation will start a few minutes late, which will given me time to catch my breath after almost running all the way from the car parking to the hall.
Wish me luck. As I mentioned, the presentation and demo source code are already uploaded here. Enjoy!
Now, after the presentation I have run back to LUMS because I have another class at 6:40 pm in which I also have a quiz.

Friday, February 03, 2006

Website updated

I just updated my website. The special occasion is Microsoft ISV Community Days, 2006 tomorrow. Since I'd like to offer the source code and presentations on the website for download during the presentation, I decided to do the much delayed update to the website.
Now, the thing here is that I have a quiz tomorrow afternoon in the class from 2 pm to 3:30 pm, then I have to rush to the presentation which is scheduled to start at 4 pm, and then I rush back to another class where there is another quiz. The best part is, I havent prepared for either quiz and I also have to do some work on the demo for tomorrow's presentation.
Let's hope for the best.

Monday, January 30, 2006

Managed Instant Messenger

Many students asked me at various times on how to integrate their own application with MSN Messenger or to import the contacts from the MSN Addressbook. My answer was that this would need to be done on the socket level, connecting to the MSN Messenger Service and a lot of hacking would be needed to figure out the request response possibilities. Well, there is a sample application that does IM through MSN. Check it out. I hope you find that useful. It is a command line based application and there is a link to another application developed using the same code but is richer. I had been wanting to blog about this for months, so I finally succeeded in doing it tonight.

Sunday, January 22, 2006

Merchandise

Recently, I ordered the merchandise from Microsoft company online store for the gift voucher that I got for my MVP award. The merchandise just arrived. Here's a glimpse of it.

Hooded shirt.


Geek T-shirt.


Bag and books.


Microsoft mouse keyring.


Mouse keyring was in this case.Posted by Picasa

Tests on random numbers

If someone (such as a random number generator) claims a set of numbers to be random numbers, following some probability distribution, most commonly, uniform, there are certain tests that can be performed on these random numbers to ascertain or deny this claim. Such tests include Kolmogorov-Smirnov test, Chi-square test, Poker test, Gap test, Runs test. There are also some batteries of tests such as the Diehard battery of tests, that can be performed on the set of random numbers. The results of these tests can be analyzed to accept or deny the claim.
We were asked to perform these tests on the random numbers generated through Microsoft Excel and Matlab. Here is everything, including the Excel workbook to perform the tests on Excel random numbers as welll as a workbook to perform the tests on Matlab random numbers. Different worksheets correspond to each test. Macros have been written to perform and repeat these tests on 100 sets of 100 random numbers. Matlab includes a command called xlswrite() to export some Matlab variable to excel.
Also included is the C# program to export random numbers from Excel to a binary mode file for the DieHard battery of tests using Office Interop. Apart from that, there is a Visual C++ program to export random numbers from Matlab into a binary mode file for the same purpose. Test results from the Diehard battery are also included, as is an MS Word document that summarises and analyzes the results.

Shepherds

"I didn't know shepherds knew how to read," said a girl's voice behind him.
"Well, usually I learn more from my sheep than from books," he answered. The shepherd told her of the Andalusian countryside, and related the news from the other towns where he had stopped. It was a pleasant change from talking to his sheep.

But when he thought to complain about the burden of its weight (his jacket), he remembered that, because he had the jacket, he had withstood the cold of the dawn.
We have to be prepared for change, he thought, and he was grateful for the jacket's weight and warmth.
The jacket had a purpose, and so did the boy. His purpose in life was to travel, and, after two years of walking the Andalusian terrain, he knew all the cities of the region.

Ethan

"Ethan do you copy?"
"No, but I do scan, email and print."

Sunday, January 15, 2006

We failed again

Once again we let our masters down. If we had bombed the shit out of that house in Bajor agency ourselves, they wouldnt have been troubled to do it themselves. What are here for anyway?
And dont you go talking about violation of sovereignty. Sovereignty is violated when one armed force attacks another country's territory. In this case, the attackers were conducting an operation within their own land.
Never forget: we'd sell our mother if the price were right.

New Islamabad police

So, they've set up a new Police force for the federal capital. My argument is, can any police force act against Brigadier Blah Blah, or Secretary Blah Blah, or son of Minister for Waste Management? When the so-called elite considers itself above the law, and the police has no abiliy to enforce the law, you can continue inventing new police forces, which we've been seeing non stop in Karachi for two decades, without any results. Bottom line is, they're spending the tax payers money to get better looking protocol.

Saturday, January 14, 2006

A shepherd and his sheep

He swept the floor with his jacket and lay down, using the book he had just finished reading as a pillow. He told himself that he would have to start reading thicker books: they lasted longer, and made more comfortable pillows.
He arose and, taking up his crook, began to awaken the sheep that still slept. He had noticed that, as soon as he awoke, most of his animals also began to stir. It was as if some mysterious energy bound his life to that of the sheep, with whom he had spent the past two years, leading them through the countryside in search of food and water. "They are so used to me that they know my schedule," he muttered. Thinking about that for a moment, he realized that it could be the other way around: that it was he who had become accustomed to their schedule.
He had always believed that the sheep were able to understand what he said. So there were times when he read them parts of his books that had made an impression on him, or when he would tell them of the loneliness or happiness of a shepherd in the fields. Sometimes he would comment to them on the things he had seen in the villages they passed.
Quoted from The alchemist by Paulo Coelho

Thursday, January 12, 2006

Adams

A while ago I was watching the movie Stepmom on TV. I've seen it before, but I hadnt noticed that old boy Bryan Adams' song was in there, too. And a smashing one at that. Bryan Adams is definitely reputed to be the world's best ever live singer. I've listened to him studio recorded, I've listened to him MTV Unplugged, and I've listened to him recorded from a live performance. He's truly awesome. Summer of 69 is so amazing, it never misses hitting the spot whenever you listen to it.
But then I quite listening to music a long time ago. This particular song that I heard in this movie, brought back old fond memories. The song is called When you love someone. It's one of my favorites and I absolutely loved the MTV unplugged version of it. Here are its lyrics.

When you love someone - you’ll do anything
You’ll do all the crazy things that you can’t explain
You’ll shoot the moon - put out the sun
When you love someone

You’ll deny the truth - believe a lie
There’ll be times that you’ll believe you can really fly
But your lonely nights - have just begun
When you love someone

When you love someone - you’ll feel it deep inside
And nothin else can ever change your mind
When you want someone - when you need someone
When you love someone...

When you love someone - you’ll sacrifice
You’d give it everything you got and you won’t think twice
You’d risk it all - no matter what may come
When you love someone
You’ll shoot the moon - put out the sun
When you love someone

And then there's Jon Bon Jovi that I like very much. They had a soundtrack for a movie, which I think was called Young guns. That soundtrack, by the way, was the first thing I ever listened to on a compact disc on our first ever Aiwa CD player. It belonged to a friend of mine and he leant it to me. Billy get your guns, Blaze of glory, Blood money, absolutely awesome songs. I also used to enjoy Def Leppard. These guys were great.
I was also watching The terminal starring Tom Hanks and I loved it very much. Tom Hanks is truly the best actor ever born. I've seen him do all sorts of characters and he does them like no other and leaves you feeling short of nothing. Mel Gibson is cool, too, with his emotional scenes, but this guy, Tom Hanks is a maestro.
In this movie, towards the end (advance apologies to the ladies), when Tom Hanks is about to kiss Catherine Zeta Jones (cant blame him for that, by the way), my brother switched the channels to Geo, where nothing short of pornography was being played in terms of a hindi song, but that channel stayed put. I wonder why more is acceptable in a more recognizable language.

Check this out

This might be a surprise to some of the readers, but this is no news and there's a lot more going on in our society than meets the eye. Now, though, it has started to meet the eye a lot more and those who dont like it have been ordered vide what you could call an ordinance to keep their eyes shut if they dont like what they see. Daily Times published a feature article recently, a reference to which was made at this blog.
I wouldnt comment on the contents of the article, you can form your own opinions.

Phuns gaay

Now, our big guy is really proud of himself. And how can one get to the top of the (not so) pak foj without having good propaganda and public dealing skills. A couple of days ago we saw him pitted against Karan, an Indian origin journalist on a CNN interview. Karan won hands down. He flattened our big guy very quickly, who wasnt able to get up. Our big guy started talking to him as if he were talking to the Indian government. DUH, even if he were an Indian, he was representing an American (friend?) news channel. Karan, why dont you take over? Our big guy was teaching everyone about leadership and how the leader should dictate his "ideas" onto others and not be dominated by theirs, yet, somehow mysteriously enough, be open to their ideas. Now, I'm an engineer, basically, and I like precise stuff, and this sounds a self-contradictory statement. Karan kept calling him quite rightly, like all other foreign visitors by his military rank instead of Mr. Pres or something.
One analyst earlier on pointed out on the topic of public consensus on Kalabagh that the consensus was not sought on issues like LFO and District Governments, steps that changed everything, and are supposedly in the greater national (we know which nation we are talking about) interests. Kalabagh also being in national (in this case, this nation, if there is such a thing) interests, why do you need consensus now? Yea, Mush boy, lay down the foundation stone baby. Or should I say, cast the stone?

Tuesday, January 10, 2006

Diehard battery of tests

There is a battery of tests that assess the randomness of a sequence of (pseudo-)random numbers, called the Diehard battery of tests. We have been assigned a task to run this battery of tests on random numbers generated by MS Excel and Matlab. It's a strange set of tests in the sense that it requires an input file of 10 to 11 MB, containing nothing but random numbers and the file needs to be in binary format.
I used C++ to generate such a number (2867200 to be precise) of random numbers and dumped it to a binary file of 11.2 MB. I'll upload the code to do that soon.
The squeeze test always failed. I tried to increase and decrease the size of the file but to no avail. Ultimately, I stumbled onto the fact that the random numbers were not in the range from 0 to 2^32 - 1. What I was generating were 0 to 2^16 - 1. This is just so if someone stumbles into this problem and does a search, hopefully they would bump into this.
Now I am working to generate such a file from within Excel.

So, what is the problem?

OK, so we've been pointing out deficiencies, and we've been saying how Pakistanis behave abroad and make it a point to misbehave when not. Why is that? Well, if I were to talk of the US, if I were to skip a red light, or stop at a traffic light beyond the zebra crossing, or stop in the middle of two lanes and the list goes on, it is entered to my record by the policeman whom I can not bribe. The result is not merely a few dollars fine, the result replicates itself into my houserent, my loan interest rates, my insurance premiums (which are mandatory by law) and so many other things, that you can not even imagine doing any of that stuff.
So, it is fear of punishment that makes us behave. Down here, though, there is no fear. When President of the United States of Pakistan, General George W. Mush took over, I thought that he has an opportunity at a critical point in the nation's lifetime. It's now or never. If he puts just a few thousand corrupt people in front of the firing squad, without courts, without lawyers, just shoot, then a few hundred good men would die, but their blood would not go in vain and everyone else would learn the lesson they defie. But no, he wasnt there for that. He is there for other reasons, which are becoming obvious with time.
So, who or what, if ever, will erect those hangman's in the roundabouts of our towns?