Bug Vanquisher

30 March 2007

An interesting presentation

Filed under: WPF — Tanveer Badar @ 12:12 PM

WFP3D team has posted a very interesting presentation on their blog. Have a look!

28 March 2007

The cost of friendship

Filed under: Personal — Tanveer Badar @ 11:10 PM

Dedicated to Faisal Nasim and Usman Ghani

One wonders what is the cost of friendship? Can it even exist?

Let me tell another story to show you there really is a cost associated with having friends. It began in mid 2001, when I encountered the most intriguing person in my maths class, named Usman Ghani. He is an absolute wonder; no one I have saw had achieved so many things and excels at so many things as him. In him, I found the force that taught me more than half of what I know today and helped me become what I am today. Our friendship started with mutually transfer of mathematical knowledge and very soon grew to include things like physics, chemistry and of course, computer science and hardware. He helped re-kindle the flame that had sparked in my life two years ago, when I saw in a cartoon what computers could do. It was he behind my back that taught me almost everything about computers and the reason how I knew things before 98% of my classmates. We discussed many things in the long summer afternoons on phone, sometimes forgetting altogether that we are really talking on phone, not sitting in the same room. Can you imagine we discussed Riemann geometry, Schwarzschild radii, tachyons, things like that?

Fast-forward 18 months, university started. Usman introduced me many of his college friends. One of them is Faisal Nasim. Another wonder of creativity. Nothing escapes his grasp, done things one has not heard of before. It was rumored that ShellExecute was his suggestion, the function that opens a file in correct program when you type its name in Run dialog box. Together, they formed the perfect dream team, much like Harry Potter, Ron Wesley and Hermione Granger. Their first year project, an RDBMS, written entirely in C++ threatened open source RDBMS systems. A blockbuster hit! Second year project, the popular snake game on a LED screen barely 25X25 using a microcontroller. Only shows their ability to achieve the goal no matter how limited the resources. Third year, wireless video broadcast. Fourth year, a robo-camera that can target interesting objects in field of vision and lock on to them.

All these achievements, not to mention many programming competitions they participated in and won one of the top three prizes, culminating in first position at Softec 2005. These things aside, both are very good at their academics too.

Faisal is leaving tomorrow for US for a job at that dreadful place, Microsoft. Usman’s visa is due in a few days. You see, I have depended almost entirely on them for technical stuff and the way to do things. They have been a source of knowledge for me. Usman is the only person whom I can call a close friend. The only compatible person who can understand my weird, crazy ideas and make them better. Almost same goes for Faisal, though the impedance matching is little lower. Sometimes, they are even the goals I set for myself.

Now, on to the cost thing. The cost I will have to pay is many faceted.

  • Seven seas (metaphorically) between us.
  • The only person whom I claim to understand my ideas will be too far away from me.
  • Two very good friends will no longer be there to shoulder me in time of need.

Note: In case someone laughs behind my back after reading this, they will be amused to know that I do not even care. It is my words, I choose the idea they convey.

23 March 2007

My rantings on Pakistani cricket

Filed under: Personal — Tanveer Badar @ 10:36 PM

Pakistani cricket team should be shot, stabbed in heart, hanged till death, burned alive and feed to hungry lions for the abysmal performance they continue to display at international one-day and test series.

Of course, I am talking about ICC World Cup 2007. This was one of those rare occasions where my team again managed to snatch defeat from the jaws of a possibility of victory. They lost to Scotts! Can you imagine, “The legendary Scotts”!, as in the jokes. :)

The coach managed to die and redeem some respect in the eyes of fellow nationals, I wish PCB itself dies of shame.

19 March 2007

A Chapter Closed

Filed under: Personal — Tanveer Badar @ 4:41 PM

Only an hour ago, I refused the last of still outstanding job offers, as I am not willing to let go my current one. That job was a good one, even much better than the current S/W development I am doing now, in the long run.

It remains to be seen what will be the effects of this decision on my career.

16 March 2007

The way to TLS in CLR

Filed under: Tips — Tanveer Badar @ 7:14 PM

I dug up something about TLS access methods in CLR. Don’t use Thread class’s accessor methods, instead apply ThreadStatic attribute because it takes app-domain, even processor level locks. Read yourself.

7 March 2007

The end of the end

Filed under: Personal — Tanveer Badar @ 8:13 PM

What began as lovely almost 20 years of education on 3rd May 1987 ends tomorrow at 12:45 PM, 8th March 2007. The journey which gave me knowledge, some priceless friends, countless tools, a “PR” and things which I cannot even put into words.

It starts on a warm summer day, May has just arrived and the year is 1987. I got admitted to nursery. Two or three years pass and I encounter chick-pox, no big deal, it gets cured in a couple of days. Results are always very good, for tests, exams, extra-curricular etc. Then, in class 2, I face a fiasco created by three gits as a result of which my section gets changed. Also, I am diagnosed of myopia and have to wear glasses till this day.

We enter 1993 and I skip class 3 to make for my lost year in KG-1. Nothing special happens in class 4 except that I got made head prefect and got second position in one exam instead of getting one.

Then, the most curious thing happens in class 5 and I fail to pass an English test. About time when I started paying attention to my languages. During this year, I also develop the habit of skimming any book I can get my hands on. This means mathematics, physics, chemistry, biology, anything at all. Also, I forgot to mention, during these past two years, I have learnt almost every kind of embroidery done in Pakistan, except one.

In class 6, we get a horrible English teacher who knows the only solution to every problem; beat the offender! This none the less improves my English by loads. I lose my father in a heart attack after fighting a losing battle of life and death for three days.

Next year, I get elected as the chief prefect over the entire school because of my spectacular performance and discipline. I also learn when to trust and whom to trust by learning a very good lesson. Two persons who were supposed to my best friends betray me in two entirely different ways and I close those holes in my defense wall forever.

Another year passes; I get top grades in 8th class, scoring 92% highest in entire school and choose biology as the elective subject in 9th class. It is “annus horribilis” for me. I get only “39” marks out of 75 in my Sindhi paper, ruining any hopes of getting into the best intermediate college and adversely affecting my aggregate percentage. Teachers prove to be worthless, I already know more than what they will ever learn in their life. I encounter typhoid, again no big deal, clears off in about a month, with the glorious comments by a class mate:

“Tanveer people usually look pale after recovery but you seem you were on your honey moon and look even healthier than before”.

This year, I finish completely Electrical Technology by B.L. Theraja and also some basic physics and chemistry books.

At last, it is the final year in my school where I recognize the true value of most friends and teachers. Only some prove to be worth remembering. On the academic side, I scrap off enough marks off Pakistan Studies to make up for abysmal Sindhi marks (39). I manage to get A-one grade almost by luck and only 5 marks missing the boundary on low side. This year the new book on my read books list is Human Physiology by Guyton. My mother dies of congestive heart failure, just six days before I could find out my marks.

I am faced with a choice. Having known almost everything subject offered at intermediate level by now, I find it impossible to select which field to pursue on my own. Should it be pre-engineering or shall I become a doctor. Why not choose ICS and go on to BCS? Select commerce and live life as a chartered accountant!

Now, it is time to severe old friendships and form new ones; Seek new teachers, take new subjects, live life in an entirely new universe, named: D.J. Sindh Government Science College. These two years in the college pass as a blur. I get 84% marks in first year, 5th position in my college. In the second year, again grades are deficient as usual and overall percentage falls to 82.58%, putting me at 167th rank in Karachi board.

These two years handed me four very good friends and a very knowledgeable person in the form of my physics teacher. By now, I have read enough mathematics to last a life time, already know how to program in C, C++, know many things about pharmaceutics, things as complicated as particle physics, biochemistry, molecular biology, plant physiology (more than my sister who has a PhD in it) and human physiology. These also teach me where the boundary of selfless friendship lies and if you cross it you are only hurting yourself.

The last act of this educational drama is about to unfold, the university. I am waiting for my intermediate result, hoping I manage to get enough marks to make into some computer-major department simply because private universities were off-limits and not at all up to my personal standard. 3rd August arrives and my aptitude test result tells me that I am getting one seat confirmed at NED. The best minds at college life score less than me because the test was objective, not something you could learn by repeated reading. Then, on 14th November, history repeats itself and I have to select between CISD and BCIT. I choose where all of my friends were going, CISD, a worthy choice now as I see it.

We enter first year of university, freedom in new shapes and unrecognizable forms. Almost all of my college friends are here, both in my department and loads of others too. Lots of new friendships to form, some of them enter my terminate friendship after university list in the first month. By now, there isn’t a new subject for me. C language course teaches me only two new things in the whole year:

Why compiler does not require passing dimension for one dimensional arrays in function declarations and some complications about function pointers.

I amaze my chemistry teacher by answering almost every question before anyone had the chance to even understand what was being said, which makes her ask me whether I spend my earlier years in Pakistan or was taught in some western country.

Results come out and I get 76.66% marks. Most of the teachers in the second year are ignorant of their subject to the point of being horribly wrong. A crucial course (data-structures) is taken up by an idiot who messes up it and some friends still blame it on him as being the reason they lost interest in programming in the first place. This does not affect me at all, because by now I have already read next year’s books too and data-structures were something of a worry only last year. I also perfect my skills in Computer Architecture and Organization in the first two months of this year and Parallel Processing by June.

Again the boring exams and waiting for results, which this time turns out to be exactly 76%. Third year of engineering is the second “annus horribilis” of my life. Every subject belongs to Electrical majors and we are treated like second degree citizens. Databases and Management Systems turns out to be a joke, taught by the same idiot who messed up DS. I have isolated myself by reading C.J. Date’s excellent book on DBMS earlier than he could affect my thinking process. Digital Electronics proves to be a thrilling subject taught by a very able teacher.

Waiting for the results of third year, we arrive at the final year. A year a whole realm unto itself. A project, grand one, 200 marks. Two subjects taught by our feeble chairperson. Third year results surprise me as I am the only one in 140 students who gets grace marks in microprocessor based system design. Whole 3 marks! What an honor! I pray for that teacher to rot in hell forever, for staining my career.

Final year project turns out to be the greatest fiasco I have faced so far. The project is an off-shore project. “Design and implementation of 64 bit SIMD microprocessor”. A project by Avieon. The person who invited us to this project bails out just two days before we have to submit our final project report, saying that he never intended verilog source code to be released. By the way, I still have an NDA about it that clearly says that whatever was acquired before signing it can be released without anyone permissions. Some of the interesting instructions implemented in that processor involved a dot product instruction, saturating arithmetic, special instructions to perform 2 point FFT, an instruction to permute data bytes. If anyone is interested, drop me a line and have that source code for free :)!

During all this hassle, I apply for a job at Microsoft, get through the usual process of phone interview and four interviews in a day by their PMs and get rejected with no apparent reason.

We manage to build our own processor within a month, barely meeting all the deadlines about project submission and presentation. Exams pass in a blur along with their accompanying viva.

Before project’s presentation, I apply for job at many places, receive some replies and select a few worthy ones, whom I give the signal for interview. Before entering January, 2007, I have three job offers waiting at my desk, one from well reputed Software house in Pakistan, Techlogix. Another from a hardware designing local company working in verilog and another from an air force mentored company. I select Techlogix, as their offer is the best, Software is my life and I would have to forget my life if I select that offer from air force mentored company. By the time I receive their offer letter, another company phones me and I refuse their offer by saying I have already been employed. Too late for them.

Now, it is 7th March 2007. The last day of my academic life. By noon tomorrow, I shall cease to be a student.

6 March 2007

Some corrections

Filed under: Bugz, C++ — Tanveer Badar @ 3:46 PM

There was a compilation error in my iterator code which I just found.

Instead of writing this

friend random_access_iterator operator + ( diff offset , const random_access_iterator& other )
{

#ifdef _SECURE_STL
if( c != other.c )
throw invalid_argument( );

#endif
return random_access_iterator( other ) += offset;
}

It should be written like this

friend random_access_iterator operator + ( diff offset , const random_access_iterator& other )
{

#ifdef _SECURE_STL
if( !other.c )
throw invalid_argument( );

#endif
return random_access_iterator( other ) += offset;
}

because being a friend function it does not have access to member c.

Also, I changed the definition of c from const cont* to cont*, because of compilation error in operator * ( ) and operator -> ( ). This change requires a const_cast< cont* > in the constructors where c is initialized.

Please check this code with and without the preprocessor symbol defined. Some more errors may have been hidden which I didn’t find. Do inform me to correct the code if you happen to find one.

1 March 2007

And we ride on wave of bugs

Filed under: Bugz, Windows Vista — Tanveer Badar @ 8:59 PM

I have to suspect that even with my OS build number of 6.xxxx, I have got an internal build with build number magically bumped up to 6000 due to the shear number of bugs I am encountering in my Windows Vista Enterprise Edition.

Have a look at how I am dying a death by a thousand cuts.

This beauty popped up when I tried to remove my USB Key from the computer. Can you guess what message of utter alien intelligence this dialog is conveying?

Despite repeated assurances from Microsoft that all drivers are strictly checked and video drivers “do not” cause screen artifacts, a triangle is clearly visible when I previewed Windows Energy screen saver.

Here is a million dollar question: To which program does this UAC prompt belong, if I remove the highlighted window hint? Does some Mr. Anonymous want to do some harmful action?

Here’s my favorite from Windows Server 2003.

Did you know the fact that Windows Server 2003 predates even the most ancient human civilizations ever recorded? A whole 58494.16 years older!

Even if you see the persian blue line at the bottom and right border, pretend you didn’t see anything and everything in Aero glass works fine.

A new law

Filed under: Personal — Tanveer Badar @ 5:30 PM

I discovered a new law while working on my team project yesterday. The law states very clearly:

Money can neither be created nor destroyed, but gets transferred from one account to another.

[Update: AKA, “The law of conservation of money”.]

Create a free website or blog at WordPress.com.