More servicesWindows Live
HomeHotmailSpacesOneCare
 
MSN
Sign in
 
 
Spaces home  Bug VanquisherProfileFriendsBlogMore Tools Explore the Spaces community
Thanks for visiting!

Bug Vanquisher

August, 2008

To Celebrate

The 61st independence day in exactly 2 hours and 34 minutes.

To reflect the colors of our flag as closely as possible.

August, 2008

Farewell IE

I finally decided to change system’s default browser from IE to FF. About time, it is.

July, 2008

Dear God, Why Brits?

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)

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.]

July, 2008

Deep Dive into WPF Graphics-The Lost One

Just a (minor) revival to the forgotten series I was supposed to write.

With service pack 1 for .netfx 3.5, milcore.dll no longer provides the low level rendering primitives for WFP. Instead to preserve compatibility with DWM, all new APIs are provided in wpfgfx.dll, which has some minor inclusions (yet unknown to the world, because WPF team refuses to disclose any information).

This blog post reasons about the decision as:

“The reason is that WPF 3.5 SP1 now uses a new graphics DLL (wpfgfx.dll) and certain changes could not be made to Vista’s existing graphics DLL (milcore.dll) that is also used by DWM.”

Features include things like new Effects framework (H/W accelerated this time, not the weenie S/W rendered loonies), integration with DirectX surfaces [all I can remember right now :)].

Apart from that, all DllImports which used to be like DllImport( “milcore.dll” ) now reference the new wpfgfx.dll.

P.S.: I SO hate this post. I don’t do this sort of news aggregator things! Especially when it is so late.

July, 2008

Firefox Updated, Close First Window

Aspect ratio distorted to fit page

Why should I close gmail for instance?

Memorable

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.

July, 2008

Someone Please Fix ASLR!

Not the feature but what it means. I have heard/read over 3 different expansions for the abbreviation.

ASLR: Address space layout randomization.
ASLR: Address space load randomization.

And some more which I forgot. Its just a mass confusion over what the term actually means while the implementation is simple to explain.

One boot, you get dlls loaded like A B C D E F
Second boot, you get dlls loaded like D E C B A F

And that's it.

July, 2008

What Spring Had!

And I thought ASP.Net didn't have it. And yes, I am talking about this Spring. And the feature in question in Spring's DWR or direct web remoting.

A feature similar in functionality exists in WCF 3.5 incarnation, namely, "AJAX Integration and JSON Support". This also allows an ASP.Net AJAX (or w/e it is called these days) client side to call a WCF service endpoint.

June, 2008

Catch the Mistakes

Hot off facebook's profile home...

What are the reasons that prevent you from reading Urdu Magazine? Pakistan Sponsored Poll

Create a Poll »

I don't like the magazine

I can't read Urdu

I prefer reading in English

I live outside Saudi Arabia/I never heard of it

I don't like to read at all

Now, this is SO horribly wrong.

1- Urdu is/was never spoken in KSA. Even the immigrants don't make up much.

2- There is no positive option.

3- It is impossible to answer for a blind person.

4- Not wanting to read is no one particular language's fault, perhaps the individual is real dumb, stupid moron. For all we know.

June, 2008

Prophecy

It will happen at mid-night.....

 

 

 

 

I'll be 24 in just an hour.

May, 2008

C++ - The Power of Templates

Do you read Ian Griffiths? If not, please start reading. Belongs in the group of smart people (by my classification).

But smarties don't know everything either, nor do I. However, there is one thing Ian gets wrong in one of his articles. He specifically writes,

The fact that there is no implied type becomes even more striking when you consider some more interesting Python examples. Because Python performs its type checks even later than C++, you have even more flexibility:

def speak(speaker, mood):
    if mood == "verbose":
        speaker.WaxLyrical()
    elif mood == "shy":
        speaker.Whisper()
    else:
        speaker.Talk()

yada yada yada...

Note that in C++ we'd see a different result here. Python defers its type checking until the point at which you try to use a member. In a C++ template, the check is done when the template is instantiated. So C++ would actually require all three methods to be present, despite the fact that only one will be used for any given execution of the speak method. So in C++ the constraints a template can impose on its parameter are less dynamic than in Python.

However, the part about "C++ would actually require all three methods to be present" is wrong assertion. It is entirely possible to have the same behavior like Python in C++. Never, ever, underestimate the power of compile time Turing-complete templates available. :)

The code given below requires only one function at a time. My only humble request is to compile it on a sane compiler (implicitly exclude MSVC 7 and earlier).

#ifdef _MSC_VER && _MSC_VER <= 1300
#error Can't you read English. THIS STUFF REQUIRES MSVC 8 OR HIGHER!!!
#endif

struct A { void whisper( ) { } };
struct B { void shriek( ) { } };
struct C { void snarl( ) { } };

template< typename T > struct invoker
{
    static void invoke( T )
    {
    }
};
template< > struct invoker< A >
{
    static void invoke( A obj )
    {
        obj.whisper( );
    }
};
template< > struct invoker< B >
{
    static void invoke( B obj )
    {
        obj.shriek( );
    }
};
template< > struct invoker< C >
{
    static void invoke( C obj )
    {
        obj.snarl( );
    }
};
template< typename T > void f( T obj )
{
    invoker< T >::invoke( obj );
}
void g( )
{
    f( A( ) );
}

Hopefully, a little more C++ will bring peace and harmony in the world :). One can only hope.

Flat Perspective

Not mine, about some stupid movies.

As a rule of thumb if the thing you are watching (in other words, wasting time) does not have a flat perspective, something like spherical projection or, even more obtusely, oblong, then, its simply not worth the time.

There will be no story, just stupid flash backs (strong analogy to 'Lost'). And it will end so suddenly, you'll scratch your head longer than the time it took you to watch it figuring out what just happened.

May, 2008

Who said Mac was horrible

Apparently, you don't have to walk to a Mac to see those abominations like bitmap graphics, fixed DPIs and no anti-aliasing. You can have these in Windows if you get to work on Eclipse.

image  Yummy vector graphics at 6x zoom.

image Super anti-aliased edges

May, 2008

Previous Versions

They don't exist in Windows Vista Enterprise Edition, or do they? For me they do and this is how.

Woes and Worries

I wonder why people cry of the sucky video drivers pushed out by NVidia. The monsters Intel rolls out for their D946 GZ chipsets must be on par. I have had more GPU resets from them than power failures!

Even new yahoo messenger causes the graphics stack to crash weirdly.

[Update-After five minutes]

Here's the most charming, updated EULA of the driver I downloaded.

This file should be replaced by the current license file when built.

I mean what they are playing at?

May, 2008

Male vs. Female

[Notice: If you are not male, proceed with caution.]

A new sign in the Bank Lobby reads:
'Please note that this Bank is installing new Drive-through ATM machines enabling customers to withdraw cash without leaving their vehicles.
Customers using this new facility are requested to use the procedures outlined below when accessing their accounts.
After months of careful research, MALE & FEMALE Procedures have been developed. Please follow the Appropriate steps for your gender.'
*******************************
MALE PROCEDURE:
1. Drive up to the cash machine.
2. Put down your car window.
3. Insert card into machine and enter PIN.
4. Enter amount of cash required and withdraw.
5. Retrieve card, cash and receipt.
6. Put window up.
7. Drive off.
*******************************
FEMALE PROCEDURE:
1. Drive up to cash machine.
2. Reverse and back up the required amount to align car window with the machine.
3. Set parking brake, put the window down.
4. Find handbag, remove all contents on to passenger seat to locate card.
5. Tell person on cell phone you will call them back and hang up.
6. Attempt to insert card into machine.
7. Open car door to allow easier access to machine due to its excessive distance from the car.
8. Insert card.
9. Re-insert card the right way.
10. Dig through handbag to find diary with your PIN written on the inside back page.
11. Enter PIN.
12. Press cancel and re-enter correct PIN.
13. Enter amount of cash required.
14. Check makeup in rear view mirror.
15. Retrieve cash and receipt.
16. Empty handbag again to locate wallet and place cash inside.
17. Write debit amount in check register and place receipt in back of checkbook.
18. Re-check makeup.
19. Drive forward 2 feet.
20. Reverse back to cash machine.
21. Retrieve card.
22. Re-empty hand bag, locate card holder, and place card into the slot provided!
23. Give dirty look to irate male driver waiting behind you.
24. Restart stalled engine and pull off.
25. Redial person on cell phone.
26. Drive for 2 to 3 miles.
27. Release Parking Brake.

May, 2008

Storm or Strom?

EarthStorm's (probably a sucky movie because I don't like William Baldwin) name is written EarthStrom on HBO. :)

P.S. I should add "sarcastic" to the categories, soon. :) :)

April, 2008

Threat Levels

[Disclaimer: No intended offense to any English, French, Italian, German, Belgian, Spanish or Aussie reader who happens to come across this post.]

The English are feeling the pinch in relation to recent terrorist threats and have raised their security level from "Miffed" to "Peeved." Soon, though, security levels may be raised yet again to "Irritated" or even "A Bit Cross." Londoners have not been "A Bit Cross" since the blitz in 1940 when tea supplies all but ran out. Terrorists themselves have been re-categorized from "Tiresome" to "A Bloody Nuisance." The last time the British issued a "Bloody Nuisance" warning level was during the great fire of 1666.

Also, the French government announced yesterday that it has raised its terror alert level from "Run" to "Hide." The only two higher levels in France are "Surrender" and "Collaborate." The rise was precipitated by a recent fire that destroyed France's white flag factory, effectively paralyzing the country's military capability.

It's not only the English and French that are on a heightened level of alert. Italy has increased the alert level from "Shout Loudly and Excitedly" to "Elaborate Military Posturing." Two more levels remain: "Ineffective Combat Operations" and "Change Sides."

The Germans also increased their alert state from "Disdainful Arrogance" to "Dress in Uniform and Sing Marching Songs." They also have two higher levels: "Invade a Neighbor" and "Lose."

Belgians, on the other hand, are all on holiday as usual, and the only threat they are worried about is NATO pulling out of Brussels.

The Spanish are all excited to see their new submarines ready to deploy. These beautifully designed subs have glass bottoms so the new Spanish navy can get a really good look at the old Spanish navy.

The Australian's level has increased from "What the f#ck?" to "Who the f#ck?". The next level for Australia will be "Well, f#ck me" all the way up to "Enough is a f#ckin nuff".

April, 2008

Horribilus Totalus

I can't properly write anything from Live Writer if I have IE8 installed. For some weird reason, mshtml.dll seems to decide that an AV is in order at some random instant whenever playing with tables or particularly (read pretty) formatted text.

April, 2008

The Myth Called Overloading

There is no such thing as function overloading in this world! Period. Whatever you see in HLLs is the compiler lulling you into the false sense that function overloading exists. Cases in point:

1- C++: Most major compilers (at least from Microsoft) use name mangling. Here is dump of four constructors on std::bad_cast from msvcrt.dll

Mangled mode

Pretty mode

??0bad_cast@@AAE@PBQBD@Z bad_cast::bad_cast(char const * const *)
??0bad_cast@@QAE@ABQBD@Z bad_cast::bad_cast(char const * const & )
??0bad_cast@@QAE@ABV0@@Z bad_cast::bad_cast(class bad_cast const &)
??0bad_cast@@QAE@PBD@Z bad_cast::bad_cast(char const *)

2- CLR:Everything compiles down to IL, whether you like it or not. And here's IL for typical function calls:

call class System.ServiceModel.Channels.Message System.ServiceModel.Channels.Message::CreateMessage( class [System.Runtime.Serialization]System.Xml.XmlDictionaryReader, int32, class System.ServiceModel.Channels.MessageVersion)

from System.ServiceModel.Channels.Message.

That's it, you get the whole nine yards. Return type + fully qualified function name + fully qualified parameter types. It does not matter whether you use call, callvirt or calli. If its a call, its going to use everything fully qualified.

3- You may want to argue about operator overloading. But that's just syntactic sugar. Here is >> from std::basic_istream.

Mangled mode


Pretty mode

class std::basic_istream <wchar_t,struct std::char_traits<wchar_t> > & std::operator>> <float,wchar_t,struct std::char_traits<wchar_t> > (class std::basic_istream <wchar_t,struct std::char_traits<wchar_t> > & ,class std::complex<float> &)
??$?5M_WU?$char_traits@_W@ std@@@std@@YAAEAV?$basic_istream @_WU?$char_traits@_W@std@@@0@ AEAV10@AEAV?$complex@M@0@@Z

4- In CLR, the case is even simpler. You get op_Add straight away, then, its off to fully qualified function calls in IL. End of story.

It does not exist. Anywhere. Ever.

April, 2008

Stick Your Leg [Here]

LINQ and SQL Server: Good or Bad Addition to the Database World?

While SQL Server 2008 has introduced many new features and improved many existing ones, one of the newer database features that has recently started taking the development world by storm is Language Integrated Query or LINQ. There are many different varieties of LINQ, including: LINQ to XML, LINQ to Entities, LINQ over Dataset (VB and C#), and LINQ to SQL.

This is what you get when someone who is no programmer tries to stick their leg into matters no one in their ancestors ever understood.

By the looks, it seems that T-SQL itself natively supports LINQ. :)

April, 2008

It is coming

int array [ ] = { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 };
std::vector< float > v( query::as_query( array , array + 12 ).select( 5.3f ).to_array( ) );
std::copy( v.begin( ) , v.end( ) , std::ostream_iterator< double >( std::cout , " " ) );
std::cin.get( );

The first revision is here!

Compare the above to this. Almost all the clutter is gone.

exit( 0 );

I upgraded [it]s project to VS 2008 format, only three days before the semi-official end (on Wednesday, if I remember correctly) of development. Only to find that VS 2008 does not play too well with only 1 GB memory.

View more entries