Tanveer's profileBug VanquisherBlogListsGuestbook Tools Help
Thanks for visiting!
Please wait...
Sorry, the comment you entered is too long. Please shorten it.
You didn't enter anything. Please try again.
Sorry, we can't add your comment right now. Please try again later.
To add a comment, you need permission from your parent. Ask for permission
Your parent has turned off comments.
Sorry, we can't delete your comment right now. Please try again later.
You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
Complete the security check below to finish leaving your comment.
The characters you type in the security check must match the characters in the picture or audio.
Tanveerwrote:
I'll tell you when time comes. Keep guessing for the moment.
Dec. 23
Usman Ghaniwrote:
IT is Orion?
Dec. 21

Bug Vanquisher

June, 2009

Silver Jubilee Week

Its Silver Jubilee Week people. Get ready!!!

May, 2009

Destroy

Destroy pakistan, save a child.
World relief foundation
April, 2009

Tales From Interviewer’s Desk

Part 1:

How to reverse a string in-place?

Take 1: (Fresh)

string reverse( string str )
{
    char ch = str [ 0 ];
    foreach( int i = 0 ; i < str.length ; ++i )
        Response.RedirectWrite( str [ str.length - i ] ) + ch.tostring( );
}

Take 2: (Big words, no knowledge)

string reverse( object obj )
{
    string str = TypeCaste.tostring( obj );
    stack< ch > s;
    for( int i = 0 ; i < length ; ++i )
        s.push( str.charat( i ) );
    for( i = 0 ; i < length ; ++i )
        str.insertat( 0 , s.pop( ) );
}

Take 3: (2.5  year experience in C#)

string reverse( object obj )
{
    if( typeof( obj ) == "string" )
    {
        for( int i = 0 ; i < obj.length ; ++I )
        {
            char ch = str [ i ];
            str [ i ] = str [ length - i ];
            str [ length - i ] = ch;
        }
    }
    return obj.tostring( );
}

Take 4: (Fresh)

string reverse( object obj )
{
    if( obj == "string" )
    {
        char ch = str [ 0 ];
        for( int i = 0 ; i < obj.length ; ++I )
            str [ i ] = str [ length - i ];
        str [ str.length ] = ch;
    }
}

April, 2009

Bilkamism Syndrome :OR: How to Kill a Product

[Edit: Even the genius couldn't catch sarcasm, well perhaps he's sleepy right now.]

[Edit # 2: Corrected two typos.]

Symptoms:

  1. Oracle locks entire table for a single select. And entire database is unavailable while update/delete happen. You must unplug database server from network for create table to succeed.
  2. Create 500 threads in one process to bog down a server, and end up blaming vendor for any resulting slow downs.
  3. Get a degree in Physics and end up working as a manager for a software product. :) Isn’t it simply cute?
  4. This one’s a bit longer so we’ll have to resort to an analogy. Suppose, a cell phone provider allows you to transfer credit to someone else through some crafted command. Now, there are clearly two types of monetary transactions. One when you recharge your own account, one where someone transfers credit to someone else.
    You must have two different tables for these transaction types because “I” doubt Oracle will handle such loads. When generalizing, each transaction type must reside in its own table. This concept is spliheritence.
  5. Requirements. What heavenly entity is that? Why! Just drag up 50 lines of code to get the job done at its face value and everyone is happy.
  6. Edge cases are a Microsoft/Sun/Google conspiracy to kill everyone’s productivity. If it happens in 1 out of 10000000…000 cases, it never happened.
  7. Change requirements mid project and later on deny everything till the exact communication is reproduced. :D
  8. Users are responsible for any race conditions, it is not our duty to insert locks anywhere. Screw you!
  9. Every single class must follow singleton pattern. World ends otherwise and we turn into green Martians.
  10. For bonus fun, copy live customer data to test systems without overwriting actual pins and other personal customer information.
  11. VSS > SVN. Enough said!
  12. Why. Now that is the question. Shakespeare’s “To be or not to be” is ancient.  Question everything, even those which are working perfectly and then blame others for their correct functioning. We understand you must appear doing something to justify your existence in the first place. And NO! The answer is NO.
  13. log ex != x

Keep checking here, I’ll post more as I remember them. 

April, 2009

Enough!

Facebook is becoming an information disclosure nightmare. People are too stupid to be handed a public social network for their own good. For example, this just crossed my ridiculously crafted homepage few minutes ago.

"Muhammad just added the birthdays of 15 friends to their MyCalendar.
Muhammad has requested to add the following birthdays to their MyCalendar:"

[more blah blah blah with actual dates]“

My comment:

Tanveer Badar at 14:31 on 05 April
[noun], you should know better. It is information disclosure, and about other people's personal information you have no right to publish in public.
Please don't add mine to this application.

What amuses me is that the guy is supposed to be specializing in networking, and security by implication (I think). I shudder to think whose data rests in the hands of such and likes.

Those who take time to read this blog might have noticed there is very little information about me here. You won’t find much about me online because I don’t want you to. But how are you supposed to prevent others leaking information about you online.

March, 2009

Work Efficiency

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current Dload  Upload   Total   Spent    Left  Speed
109   219  109   219    0     0    438      0 --:--:-- --:--:-- --:--:—   438

I like this downloader, given how it built redundancy by downloading 109% of a 219 byte long file.

March, 2009

From ntddk.h

//
// This section is specified/returned if the
// ContextFlags word contians the flag CONTEXT_FLOATING_POINT.
//

FLOATING_SAVE_AREA FloatSave;

//
// This section is specified/returned if the
// ContextFlags word contians the flag CONTEXT_SEGMENTS.
//

ULONG   SegGs;
ULONG   SegFs;
ULONG   SegEs;
ULONG   SegDs;

//
// This section is specified/returned if the
// ContextFlags word contians the flag CONTEXT_INTEGER.
//

ULONG   Edi;
ULONG   Esi;
ULONG   Ebx;
ULONG   Edx;
ULONG   Ecx;
ULONG   Eax;

//
// This section is specified/returned if the
// ContextFlags word contians the flag CONTEXT_CONTROL.
//

ULONG   Ebp;
ULONG   Eip;
ULONG   SegCs;              // MUST BE SANITIZED
ULONG   EFlags;             // MUST BE SANITIZED
ULONG   Esp;
ULONG   SegSs;

.
.
.

volatile ULONG DismountCount;

//
// This field indicates the status of the 64-bit COM+ package on the
// system. It indicates whether the Itermediate Language (IL) COM+
// images need to use the 64-bit COM+ runtime or the 32-bit COM+ runtime.
//

Bhahaha!

March, 2009

Life As We Know It

Misery… Hopelessness… Unreliability… Non-dependable… Chaos… Unfairness… Dismay… Mayhem… Sufferings… Retribution… Evils… Accidents

To

Happiness… Trust… Order… Joy… Rewards… Surprises…

We cling to life for dear life.

March, 2009

Yawn

.

February, 2009

The Impossible Task

image
+
image
= Impossibility of minimizing multiple windows

Welcome to Windows 7.

[Edit 08/03/09: It is possible to right click on a thumbnail, usual window context menu appears there. But I still think it is very undiscoverable.]

image

February, 2009

From The Forgotten Mail

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.

January, 2009

Java Loves You

People don’t like to read. If you can’t think of anything to say, maybe you should just shut up. This whole damn dialog could read

Java Loves You—Please Wait

No, I don’t think so. And People agree. Why hog my computer with “Java Quick Start” by the way? I never complained to anyone that applet start-up time was slow. Why run yet another program to optimize (questionable!) 1% of the cases? As if reader_sl.exe wasn’t enough! (You won’t find any useful information for this program on Google.)

And I had almost forgotten that the rant wasn’t over yet. Java web start is yet another such program (javaws.exe) which keeps running on and on. And jusched.exe which checks for updates when we are perfectly capable of manually invoking the program ourselves.

As a side note, install Gmail Voice and Video chat to include two more such monstrosities in the mix, GoogleUpdate.exe and GoogleTalkPlugin.exe.

[Placeholder for Windows Live praise.]

When the platform is moving towards minimizing startup costs, cutting back on services, making more and more of them to start as late as possible or never if not needed, crappy companies move to feast in the open land.

New Goodies in Windows 7

To do any development work in Windows 7, you must first get the latest Windows SDK.

Upon reading, things will reveal themselves in the native land enough to cause this (and very few technical things invoke this reaction in me). I am talking about the Ribbon and Animations and Web Services for Windows. And more goodies.

[Edit: Few hours later… I had forgotten to mention Direct2D and DirectWrite.]

Try this stuff!

January, 2009

Save Your 5 Minutes Installing AVG on Windows 7

By reading here….

Free edition of AVG has a dependency on MFC 8.0. However, they fail to ship the msp files with their program and Windows 7 doesn’t come with MFC 8.0 pre-installed either.

AVG will install successfully but will fail to run any of the UI components I had to install VS anyway, hence problem solved for me.

Choose your poison.

The Definition

"Terrorism," the professor had lectured, "has a singular goal. What is it?"
"Killing innocent people?"
"Incorrect. Death is only a byproduct of terrorism."
"A show of strength?"
"No. A weaker persuasion does not exist."
"To cause terror?"
"Concisely put. Quite simply, the goal of terrorism is to create terror and fear. Fear undermines faith in the establishment. It weakens the enemy from within . . . causing unrest in the masses. Write this down. Terrorism is not an expression of rage. Terrorism is a political weapon. Remove a government’s faзade of infallibility, and you remove its people’s faith."
January, 2009

General Public Notice

I do not entertain business calls after office hours.

December, 2008

CCXML Meets ASP.NET

Oh! Not this:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CallManager.aspx.cs" Inherits="VoiceSite.CallManager" %>
<ccxml version="1.0" xmlns:voxeo="http://community.voxeo.com/xmlns/ccxml">
</ccxml>

But this:

CCXML.CCXMLControl control1 = new CCXML.CCXMLControl( );
control1.Controls.Add( new CCXML.Transition( CCXML.CCXMLEvents.Alerting , "evt" , "init" ) );
System.IO.StringWriter sw = new System.IO.StringWriter( );
control1.RenderControl( new HtmlTextWriter( sw ) );

which results in

<ccxml version="1.0">
<eventhandler>
  <transition name="evt" state="'init'" event="connection.CONNECTION_ALERTING"></transition>
</eventhandler>
</ccxml>

A work in progress. :)

November, 2008

It Bit You In The Butt

new Guid( )

Fact 1: Guid is a value type.
Fact 2: Values types are initialized to all zero upon construction.
Fact 3: Value types cannot have default constructors.
Conclusion 1: new Guid( ) should earn you lots of spanking.
Conclusion 2: Guid.NewGuid( ) is the right thing to do.

November, 2008

Happy Birthday Windows

.

November, 2008

Bring It On

‘I am Pakistani because I live in Pakistan which is a place where Pakistanis live.’

October, 2008

C++: Another Love Story

After many moons, the story is like this:

Given,

    int array [ 12 ] = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 };

The sequence of function calls

    // reflexive returns true, is_prime is true for primes (hard-coded for now) and is_even returns true for even numbers.
    abc = query::as_query( abc ).where( reflexive( ) ).where( is_prime( ) ).where( is_even( ) ).to_array( );

    for( int i = 0 ; i < abc.size( ) ; ++i )
        std::cout << abc [ i ] << ' ';

prints 2. Btw, there was a serious bug in the implementation of where( ) which is fixed now.

Additionally,
>    Query.exe!query::queryable<
                            query::filter_iterator<
                                query::filter_iterator<
                                    std::_Vector_iterator<int,std::allocator<int> >,
                                                        reflexive>,
                            is_prime> >::
                    where<is_even>(const is_even & fn={...})  Line 240    C++

This should prove delayed execution I believe. Now, all I have to do is wait for lambda expressions in C++, coming sometime next year.

October, 2008

Offenses Of The Highest Order

  1. Blocking on the thread processing a request for configurable time period.
  2. Modifying an existing service contract instead of creating a new one and inheriting the old one (/me is guilty).
  3. Not protecting static initializers with try { … } catch { … } blocks.
  4. Using open-source persistence layer.
  5. Being forced to work with twits who: do not know how to boot into safe mode; give a blank stare when presented with virtual; get confused when asked about many-to-one and many-to-many relationships. [Update 25/10/08: He quit last Monday. (party)]
  6. Management which throws n people at a task to get it done in 1/n time (n may be arbitrarily large).
  7. Keep getting interrupted by one person or another every 3 minutes.
  8. And I almost forgot. Expect files to be replaced when you send an email “the files which contain just the functions you will need to add to corresponding classes”.
  9. Having no replace (let alone replace all) in Windows Live Writer.

October, 2008

Tidbit 2

This one pertains to CLR.

Please, please, please make sure your static constructors do not throw exceptions. Having static state in a class is already asking for trouble in the case of multiple threads, if that reason wasn’t enough proceed below.

For example,

class A
{
      static DataType1 member1 = new DataType1( );
      static DataType2 member2 = DataType2.GetDefaultInstance( );
}

If there is even the remotest chance that either DataType1’s constructor or DataType2.GetDefaultInstance will throw an exception you are better off with this version:

class A
{

    static DataType1 member1;
    static DataType2 member2

    static A( )
    {
        try
        {
            member1 = new DataType1( );
        }
        catch( Exception ex )
        {
            // do some logging
        }
        try
        {
            member2 = DataType2.GetDefaultInstance( );
        }
        catch( Exception ex )
        {
            // do some logging
        }
    }
}

The only reason for all this hassle is the avoid throwing uncaught exceptions from .cctor of a type.

Because, for a type whose static constructor throws an exception, EE ensures that no instance of that type will ever be instantiated in that appdomain.[Update 11/03/09: Many moons after the original post, I come across this. The exact same problem happens in native world.]

Tidbit 1

Whenever you write an optimizer for a compiler/assembler/HW synthesizer, anything in general which will try to optimize expressions please ensure you special case a(b+c).

There is no need to do ab + ac, unless you want to split hairs.

[Disclaimer: I am allergic to memory models for the next 30 minutes.]

October, 2008

The Legacy of Javid Iqbal

I don't know why this particular thought crossed my mind, perhaps when I came across this:
http://www.billoreilly.com/outragefunnels.

Does anyone even remember now the horrors convicted serial killer/pedophile Javid Iqbal unleashed during 1999-2001? Whole host of parents and families who are stranded from their beloved sons and daughters.

How no one was able to track him down for over an year and no one cared to find out what motives were behind all those killings? How he died a mysterious death in police custody?

What really amazes me is that there is no information available on internet about those brutal murders. Nothing at all. Except for this little piece on BBC's website:
http://news.bbc.co.uk/2/hi/south_asia/549787.stm, which tells one very little about what happened in the, then, past and coming future.

Why didn't we wonder then and question authorities how he died? What veiled hand was behind him which was protected from coming to light by his unexplained death? Why no one explored the possibility that he was never a sociopath? Why isn't there any documented data in readily accessible way after 8 years? Why aren't there any laws yet which establish strictest punishments for such felons?

Lots of questions which will remain unanswered till no one remembers the atrocity which was once roamed amongst us safe and free, the oddity which left his legacy for God knows how many to peruse.