Bug Vanquisher

28 October 2009

How Not To Blog

Filed under: S&G — Tanveer Badar @ 11:07 PM

Beginning your post with something like

Whenever I pick up a new technology I must admit that I feel kind of stupid, like a dummy or a complete idiot.

sends the wrong message to your readers in my books. You are implying that they are inherently stupid, imbeciles and morons. And your unearthly piece of work is too complex for mere mortals to understand.

Here’s a tip, get a life and get off your high horse people. No one wants to be like you. You may be an idiot, we are not. We like our own wits, thank you very much.

23 September 2009

Amazing Trace

Filed under: Funnier — Tanveer Badar @ 11:33 PM

3    39 ms    34 ms    42 ms  203.99.170.110
4    42 ms    42 ms    42 ms  221.120.251.9
5    41 ms    42 ms    42 ms  202.125.128.131
6    43 ms    42 ms    41 ms  221.120.250.254
7   174 ms   179 ms   178 ms  166.49.170.17
8   184 ms   178 ms   179 ms  166.49.135.139
9   175 ms   179 ms   178 ms  166.49.208.125
10   269 ms   272 ms   264 ms  166.49.164.65
11   414 ms   417 ms   418 ms  206.223.115.17
12   415 ms   408 ms   409 ms  209.240.199.162
13   422 ms   426 ms   434 ms  207.46.43.3
14   419 ms   417 ms   418 ms  207.46.43.39
15   432 ms   434 ms   443 ms  207.46.43.117
16   441 ms   443 ms   443 ms  207.46.43.184
17   439 ms   435 ms   434 ms  207.46.43.172
18   438 ms   435 ms   434 ms  10.22.8.50

Have you ever seen 10.x.y.z appearing on tracert output before?

16 September 2009

The Off-by-1 Game

Filed under: Bugz, S&G, Tips — Tanveer Badar @ 7:54 PM

Consider this:

for( int i = list.Count – 1 ; i >= list.Count – 50 ; –i , )
.     array [ i ] = list [ i ];

Intention was the get the last 50 terms from list. Ignoring the facts that it will throw a null reference exception if the list is null and an index-out-of-range exception if it contains no elements it also fails to copy all 50 elements. The condition is to be blamed.

Correct way is not to invent your own logic and use what the framework offers.

if( list != null && list.Count > 50 )
    list.RemoveRange( 50 , list.Count – 50 );

For added bonus, consider this paging code.

for( int i = 0 , index = 0 ; i < some_huge_number ; ++i )
{
    page.Results.Add( results [ i ] );
    if( index == 10 )
    {
        pages.Add( page );
        page = new Page( );
        index = 0;
    }
    ++index;
}

This code strives to divide results into pages each with 10 results. Can you imagine what this will do if there were only 9 results?

It will proceed to add those results to page, then, do nothing. Because of the incorrect if condition. Again, the correct way is divide-and-remainder approach as demonstrated here.

4 March 2009

Yawn

Filed under: S&G — Tanveer Badar @ 10:51 PM

.

2 February 2009

From The Forgotten Mail

Filed under: Funnier — Tanveer Badar @ 10:27 PM
Muhammad Usman Ghani

to me, Raza, Faisal, Mehroz

Reply

2026: Microsoft manages to do the impossible by cloning Tanveer Badar
thus paving the path for its own demise.

Tanveer Badar

to Muhammad, Raza, Faisal, Mehroz

Reply

Such modesty. You should have said:
Beginning in the summer of 2019, Microsoft sponsors a project that seeks to unravel the enigma underlying the phenomenon of "The Tanveer Badar" syndrome. For the next two years, they make little progress as the disease symptoms elude them, much like the old world AIDS (Remember, we have colonized far away galaxies. This experiment is being carried on in an alternate reality.). Then, suddenly, in year 2024, they recognize the signs and relate it to an anomaly which happened on 3rd June, 1984. After that, within the next 2 years they achieve the near impossible, a working clone of Usman Ghani who wreaks havoc resulting int he ultimate destruction of human race.

19 January 2009

General Public Notice

Filed under: S&G — Tanveer Badar @ 12:55 AM

I do not entertain business calls after office hours.

2 October 2008

— — .-. … . -.-. — -.. . .- -. -.. …. — .– .. .- — -. — – .- -… .. –. ..-. .- -.

Filed under: Computer Theory, Funnier — Tanveer Badar @ 3:59 PM

– …. .   -.- . -.–   .. …   .. -.   – …. .   – — .–. .. -.-. .-.-.-   — .-.   …. . .-. . .-.-.-  -… ..- -   -.– — ..-   .– .. .-.. .-..   -. . . -..   – —   -.. . -.-. .. .–. …. . .-.   – …. .   -.- . -.–   – —   -.. . -.-. .. .–. …. . .-.   – …. .   -.-. .. .–. …. . .-.   – . -..- – .-.-.-   —… -.–.-

– …. .   -.-. — -.. .  -.. . … .. –. -.  … …. — .– …   .. -   — .-. .. –. .. -. .- – . -..   -… . ..-. — .-. .   .. -. ..-. — .-. — .- – .. — -.   – …. . — .-. -.–   .– .- …   . …- . -.   ..-. — .-. — ..- .-.. .- – . -.. .-.-.-   .— ..- … -   – —   … …. — .–   – …. .   …. — .-. .-. — .-. …   — ..-.   .– …. .- -   .- -.   .- .– ..-. ..- .-..   -.. . … .. –. -.   .. -   .. … –..–   -.-. — -. … .. -.. . .-.   .– …. -.–   .. -   -. . . -.. …   .-.. . – – . .-. -..-. .– — .-. -..   … . .–. .- .-. .- – — .-. … .-.-.-   -… -.–   – …. .   .– .- -.– –..–   — -.–   .-. .- -. -   .. -.   -. —   .– .- -.–   ..- -. -.. . .-. — .. -. . …   – …. .   … .. –. -. .. ..-. .. -.-. .- -. -.-. .   — — .-. … .   -.-. — -.. .   … . .-. …- . -..   -.. ..- .-. .. -. –.   .– .– ..   .- -. -..   .– .– .. .. .-.-.-   .. -   .– .- …   … – .. .-.. .-..   – …. .   -… . … -   – …. .. -. –.   ..- -. -.. . .-.   – …. — … .   … .. – ..- .- – .. — -. … –..–   -.-. . .-. – .- .. -. .-.. -.–   – …. .   -.. . … .. –. -.   — ..-.   . -..- – .-. . — .   .– .. – .-.-.-

-. — .– –..–   -… .- -.-. -.-   – —   – …. .   – — .–. .. -.-.   .- -   …. .- -. -.. .-.-.-   .. ..-.   -.– — ..-   –. —   – —   – …. .   .– .. -.- .. .–. . -.. .. .-   .–. .- –. .   ..   .-.. .. -. -.- . -..   – —   . .- .-. .-.. .. . .-. –..–   -.– — ..-   .– .. .-.. .-..   … . .   …. — .–   … — .- .-.. .-.. . .-.   -.-. — -.. . …   .- .-. .   …- .- .-.. .. -..   .–. .-. . ..-. .. -..- . …   — ..-.   .-.. .- .-. –. . .-.   -.-. — -.. . … .-.-.-   .-.. . – – . .-.   .   .. …   . -. -.-. — -.. . -..   .- …   .-.-.-   .- -. -..   — .- -. -.–   — – …. . .-.   .-.. . – – . .-.   -.-. — -.. . …   -… . –. .. -.   .– .. – ….   .-.-.- .-.-.-   – …. .. …   -. . -.-. . … … .. – .- – . …   – …. .- -   … — — .   — – …. . .-.   .-.. . – – . .-.   -… — ..- -. -.. .- .-. -.–   — .- .-. -.- . .-.   — ..- … -   -… .   ..- … . -..   -… . -.-. .- ..- … .   -. —   .-.. .-.. -.–.- -.- -.–.-   .–. .- .-. … . .-.   -.-. .- -. –..–   ..- -. .- — -… .. –. ..- — ..- … .-.. -.– –..–   .- .-.. .– .- -.– …   -.. . -.-. — -.. .   .. .-.-.-  

— -.   – …. .   — – …. . .-.   …. .- -. -.. –..–   …. ..- ..-. ..-. — .- -.   .- -. -..   .- .-. .. – …. — . – .. -.-.   . -. -.-. — -.. .. -. –.   …. .- …- .   – …. .   -. . -.-. . … … .- .-. -.–   .–. .-. — .–. . .-. – -.–   … …. — .-. – . .-.   -.-. — -.. . …   .- .-. .   -. — -   …- .- .-.. .. -..   .–. .-. . ..-. .. -..- . … .-.-.-   .- -. -..   .-.. . – …   -. — -   ..-. — .-. –. . -   – …. .   — .- –. -. .. ..-. .. -.-. .- – .. — -.   — ..-.   … -.– — -… — .-.. …   .-. . –.- ..- .. .-. . -..   – —   .-. . .–. .-. . … . -. -   – . -..- – .-.-.-   .-.. . – – . .-. …   .   .- -. -..   -   …. .- …- .   – …. .   … …. — .-. – . … -   -.-. — -.. . …   .- -. -..   – …. . -.–   .- .-. .   .- -   .-.. . .- … -   .—-   … -.– — -… — .-..   .-.. — -. –. .-.-.-   .-. . … -   — ..-.   – …. .   .-.. . – – . .-. …   –. . -   ..- .–.   – —   ..-. — ..- .-.   … -.– — -… — .-..   .-.. — -. –.   -.-. — -.. . … –..–   … —   .– .   .- .-. .   – .- .-.. -.- .. -. –.   .- -… — ..- -   — .- –. -. .. ..-. .. -.-. .- – .. — -.   — ..-.   .- -   .-.. . .- … -   ..— -….- ..— .-.-.- ….. -..- .-.-.-

8 September 2008

I (heart) Firefox

Filed under: Funnier — Tanveer Badar @ 6:59 AM

And nothing is going to change that, whatsoever!

28 July 2008

Dear God, Why Brits?

Filed under: Dev inside!, Funnier, Rant vs Vent — Tanveer Badar @ 8:50 PM

Why do they have to talk about something when they don’t know anything? Just the hype. Just the news they get from CNet/ZD Magazine/w-e. Just the little, tiny bits of information their minds retain.

Case in question:

Moore’s Law in relation to manycore

Today, July 28, 2008, 8 hours ago | noreply@blogger.com (The Moth)Go to full article

When most people’s brains first light up on why parallelism is the next BigThing, some jump to the conclusion that Moore’s law is over. Let’s clear that up below.
All of you know Roger Moore’s law which boils down to the prediction of

"the number of transistors on a chip will double about every two years"

clock speed increases and that is what has tricked most of us to associate Moore’s law with CPU speed.
So, now that chip manufacturers cannot make single CPUs any faster (well, they can, but they can’t cool them down enough to make them useful), they are resorting to having chips with multiple cores, which we are terming the manycore shift. The manycore shift has a profound impact on developers (especially those programming for the desktop client) in that their software now has to learn how to take advantage of parallelism.
So if you followed the logical flow so far, you’ll conclude that Moore’s law is still alive: we are still getting more silicon, but it does not translate to increased linear speed, but rather to parallel "engines" that your software must learn to utilise.
I am glad we cleared that up :)

Please read the funny stream of comments. And a bit unleashing of my own wrath.

I am glad you don’t actually do anything in hardware industry.

First off, it is Gordon Moore not Roger Moore. Get your facts right before you post.

Second, holy parallelism has its own nemesis, the Amdhal’s Law. You cannot go faster than 1/[portion of serial work] even with infinite processors.

Third, the problem isn’t even cooling. They can’t make the a transistor’s channel short enough.

[Update: 30/07/08 As expected, my comment wasn’t approved.]

[Update: 15/07/08 I just found out, he is also a PM at Microsoft. Yikes!]

19 July 2008

Memorable

Filed under: Funnier — Tanveer Badar @ 4:11 PM

Server Error
The server encountered an error and could not complete your request.

If the problem persists, please mail error@google.com and mention this error message and the query that caused it.

That is all.

Older Posts »

Create a free website or blog at WordPress.com.