Profession-“Self Appraisal”

October 25, 2010

A little boy went to a telephone booth which was at the cash counter of a store and dialed a number.

The store-owner observed and listened to the conversation:

Boy : “Lady, Can you give me the job of cutting your lawn?

Woman : (at the other end of the phone line) “I already have someone to cut my lawn.”

Boy : “Lady, I will cut your lawn for half the price than the person who cuts your lawn now.”

Woman : I’m very satisfied with the person who is presently cutting my lawn.

Boy : (with more perseverance) “Lady, I’ll even sweep the floor and the stairs of your house for free.

Woman : No, thank you.

With a smile on his face, the little boy replaced the receiver. The store-owner, who was listening to all this, walked over to the boy.

Store Owner : “Son… I like your attitude; I like that positive spirit and would like to offer you a job.”

Boy : “No thanks,

Store Owner : But you were really pleading for one.

Boy : No Sir, I was just checking my performance at the job I already have. I am the one who is working for that lady I was talking to!”

This is called “Self Appraisal”

Source: Google

Think like a CEO- A reply from CEO of J.P. Morgan to a pretty girl seeking a rich husband

October 22, 2010

A reply from CEO of J.P. Morgan to a pretty girl seeking a rich husband

A young and pretty lady posted this on a popular forum:

Title: What should I do to marry a rich guy?

I’m going to be honest of what I’m going to say here.

I’m 25 this year. I’m very pretty, have style and good taste. I wish to
marry a guy with $500k annual salary or above.

You might say that I’m greedy, but an annual salary of $1M is considered
only as middle class in New York.

My requirement is not high. Is there anyone in this forum who has an income
of $500k annual salary? Are you all married?

I wanted to ask: what should I do to marry rich persons like you?

Among those I’ve dated, the richest is $250k annual income, and it seems
that this is my upper limit.

If someone is going to move into high cost residential area on the west of
New York City Garden(?), $250k annual income is not enough.

I’m here humbly to ask a few questions:
1) Where do most rich bachelors hang out? (Please list down the names and
addresses of bars, restaurant, gym)
2) Which age group should I target?
3) Why most wives of the riches are only average-looking? I’ve met a few
girls who don’t have looks and are not interesting, but they are able to
marry rich guys.
4) How do you decide who can be your wife, and who can only be your
girlfriend? (my target now is to get married)

Ms. Pretty

A philosophical reply from CEO of J.P. Morgan:

Dear Ms. Pretty,
I have read your post with great interest. Guess there are lots of girls
out there who have similar questions like yours. Please allow me to analyze
your situation as a professional investor.

My annual income is more than $500k, which meets your requirement, so I hope
everyone believes that I’m not wasting time here.

From the standpoint of a business person, it is a bad decision to marry you.
The answer is very simple, so let me explain.

Put the details aside, what you’re trying to do is an exchange of “beauty”
and “money” : Person A provides beauty, and Person B pays for it, fair and

However, there’s a deadly problem here, your beauty will fade, but my money
will not be gone without any good reason. The fact is, my income might
increase from year to year, but you can’t be prettier year after year.

Hence from the viewpoint of economics, I am an appreciation asset, and you
are a depreciation asset. It’s not just normal depreciation, but exponential
depreciation. If that is your only asset, your value will be much worse 10 years later.

By the terms we use in Wall Street, every trading has a position, dating
with you is also a “trading position”.
If the trade value dropped we will sell it and it is not a good idea to keep
it for long term – same goes with the marriage that you wanted. It might be cruel
to say this, but in order to make a wiser decision any assets with great
depreciation value will be sold or “leased”.

Anyone with over $500k annual income is not a fool; we would only date you,
but will not marry you. I would advice that you forget looking for any clues to marry a rich guy. And by the way, you could make yourself to become a rich person with $500k annual
income. This has better chance than finding a rich fool.

Hope this reply helps. If you are interested in “leasing” services, do
contact me.

J.P. Morgan CEO

Think like a CEO…:)

Microsoft’s Chief Software Architect, Ray Ozzie Resigns

October 19, 2010

Sad news for Microsoft as,Ray Ozzie, chief software architect of Microsoft and proponent of cloud computing, has resigned unexpectedly.

Mr Ozzie was a top member of the company’s management, having taken over the software role from Bill Gates.

Chief executive Steve Ballmer announced his colleague’s departure in an email to company staff.

He said Mr Ozzie would remain with Microsoft during a transitional period, and that the company was not looking for anyone to replace him.

Microsoft shares dropped 2.2% in after-hours trading on the news.

Unknown direction

“With our progress in services and the cloud now full speed ahead in all aspects of our business, Ray and I are announcing today Ray’s intention to step down from his role as chief software architect,” said Mr Ballmer in his email.

His email further states:

While Ray will be onboard for a while, I’d like to thank him today for his contributions to Microsoft, both as a leader and as a long-time Microsoft ISV. As an early ISV, Ray contributed significantly to the early success of Windows. Since being at Microsoft, both through inspiration and impact he’s been instrumental in our transition toward a software world now centered on services. He’s always been a ‘maker’ and a partner, and we look forward to our continuing collaboration as his future unfolds. Ray has played a critical role in helping us to assume the leadership position in the cloud, and positioned us well for future success.

He added that Mr Ozzie would focus on “the broader area of entertainment, where Microsoft has many ongoing investments”.

Nonetheless, his resignation may cast some doubt over the technological direction Microsoft will take next.

Mr Ozzie’s decision to step down also follows a number of other senior departures at the company.

Business head Stephen Elop left in September to head up Nokia, while entertainment and devices head Robbie Bach is also planning to leave.

Cloud computing

Mr Ozzie joined the firm in 2005 as chief technology officer after his own company was bought out by Microsoft.

A year after his arrival, he successfully pushed the software leviathan towards tackling the challenge of the internet, by adopting “cloud computing” technology.

Microsoft traditionally focused on desktop computers, but Mr Ozzie convinced management that in the future, processing power and functionality would be provided remotely via the web.

Previously, he also designed the Lotus Notes system, which allows groups to share documents and emails.


Software Architecture-Improving .NET Application Performance and Scalability

October 16, 2010

Improving .NET Application Performance and Scalability

Summary: This guide provides end-to-end guidance for managing performance and scalability throughout your application life cycle to reduce risk and lower total cost of ownership. It provides a framework that organizes performance into a handful of prioritized categories where your choices heavily impact performance and scalability success. The logical units of the framework help integrate performance throughout your application life cycle. Information is segmented by roles, including architects, developers, testers, and administrators, to make it more relevant and actionable. This guide provides processes and actionable steps for modeling performance, measuring, testing, and tuning your applications. Expert guidance is also provided for improving the performance of managed code, ASP.NET, Enterprise Services, Web services, remoting, ADO.NET, XML, and SQL Server.

Table of content

Part I, Introduction to Engineering for Performance

Chapter 1 — Fundamentals of Engineering for Performance

Part II, Designing for Performance

Part III, Application Performance and Scalability

 Part IV, Database Server Performance and Scalability

Chapter 14 — Improving SQL Server Performance

Part V, Measuring, Testing, and Tuning


This guide was produced by the following .NET development specialists:

  • J.D. Meier, Microsoft, Program Manager, patterns & practices
  • Srinath Vasireddy, Microsoft, Program Manager, patterns & practices
  • Ashish Babbar, Infosys Technologies Ltd
  • Alex Mackman, Content Master Ltd, Founding member and Principal Technologist


Software Achitecture-A-Z guide to being an architect-Good Read

October 16, 2010

Being successful Architect is very challenging. It requires vast skills in computer science, leadership and management.
Mark Bloodworth and Marc Holmes – two Architect Evangelist in the Developer and Platform Evangelism Team at Microsoft have compiled a handy A-Z guide to being an architect.
Enjoy read at:

Software Architecture-Silverlight 4.0-New Features Blog series

October 8, 2010

While exploring Silverlight 4.0. I have posted few new post on my blog.
Some of new posts are as:
Printing Option

Clipbaord Support

COM interop API changes

MouseRightButtonDown and MouseRightButtonUp events

FullScreenOptions property

Implicit Style

Flow for Arabic and Hebrew

Keep enjoying Silverlight 4.0

Related Post:
.Net /C# 4.0 Series

Software Architecture-Silverlight 4.0-New Feature-Printing Option

October 8, 2010

In Silverlight 4.0, new printing class is provided in named PrintDocument in namespace of System.Windows.Printing, which help to print any UIElement and its content (Childs) of Visual tree.

This class has three main events; First PrintPage which helps to identify what is the content to be printed via PrintPageEventArgs.PageVisual. Second BeginPrint helps to do some action before printing actually starts. Third EndPrint help to some action after printing actually ends.

A sample code will look like as:

  public partial class PrintPage : Page
        PrintDocument printD;
        public PrintPage()
            printD = new PrintDocument();
            printD.PrintPage += new EventHandler<PrintPageEventArgs>(printD_PrintPage);
            printD.BeginPrint += new EventHandler<BeginPrintEventArgs>(printD_BeginPrint);
            printD.EndPrint += new EventHandler<EndPrintEventArgs>(printD_EndPrint);

        void printD_EndPrint(object sender, EndPrintEventArgs e)
            MessageBox.Show("Printing Ended.......");

        void printD_BeginPrint(object sender, BeginPrintEventArgs e)
            MessageBox.Show("Printing Started.......");

        void printD_PrintPage(object sender, PrintPageEventArgs e)
            MessageBox.Show("Height: " + e.PrintableArea.Height + "Width: " + e.PrintableArea.Width);
            e.PageVisual = PrintArea;

        // Executes when the user navigates to this page.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        private void button1_Click(object sender, RoutedEventArgs e)
            printD.Print("Test Page");


XAML will look like as:

<navigation:Page x:Class="ImplicitThemeProc.PrintPage" 
           d:DesignWidth="640" d:DesignHeight="480"
           Title="PrintPage Page">
    <Grid x:Name="LayoutRoot">
        <StackPanel Name="PrintArea" Height="400" Margin="264,40,170,40">
            <TextBlock  Text="Hellllo Sarwar......." FontSize="16"></TextBlock>
            <TextBlock Text="Hellllo Sarwar......." FontSize="16"></TextBlock>
            <TextBlock Text="Hellllo Sarwar......." FontSize="16"></TextBlock>
        <Button Content="Print......" Height="23" HorizontalAlignment="Left" Margin="104,131,0,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" />

Printed page will look like as:

Software Architecture-Silverlight 4.0-New Feature-Clipbaord Support

October 8, 2010

While exploring new features of Silverlight 4.0, I discoivered that one of the new cool feature is Clipbaord support.

Text is written to Clipboard as:

Clipboard.SetText(" Data to be put Clipboard");            

Text is fetched from Clipboard as:

MessageBox.Show( Clipboard.GetText());

Clipboard access under partial trust (normal application) requires confirming access by via message box as:

The access details can be seen by right clicking the silverlight page in the permission tabs as:

Clipboard access under out-of-browser application (elevated rights), does not require permission confirmation message box.

Software Architecture-Silverlight 4.0-New Feature-COM interop API changes

October 8, 2010

COM interop API changes

In Silverlight 4, System.Windows.Interop name space is renamed as System.Runtime.InteropServices.Automation and main static class used for COM Factory is renamed from ComAutomationFactory to AutomationFactory.

Lets consider a small example to automate MS Word via Silverlight Project.

Add namespace as System.Runtime.InteropServices.Automation to Silverlight page. Add refeerence of Microsoft.CSharp for type dynamic.

COM interop is supported only in Out-of-Browser applications with ElevatedPermission.
Incase of normall silverlight application exception is thrown with details as” This operation is not supported in the current context.”

Consider some manipulation of word document as below.

            if (App.Current.IsRunningOutOfBrowser && App.Current.HasElevatedPermissions)
                if (AutomationFactory.IsAvailable)
                    dynamic wordFactory = AutomationFactory.CreateObject("Word.Application");
                    dynamic doc = wordFactory.Documents.Add();
                    wordFactory.Visible = true;
                    doc.Content.Font.Name = "Tahoma";
                    doc.Content.Font.Size = 24;
                    doc.Content.Font.Bold = true;
                    doc.Content.Font.Italic = true;
                    doc.Content = "Hello Shahzad Sarwar- Testing......Testing......Testing......";
                    dynamic tblNew = doc.Tables.Add(doc.Range(0, 0), 6, 8);
                    int intCount = 1;
                    foreach (var cell in tblNew.Range.Cells)
                        cell.Range.InsertAfter("Cell " + intCount);


For details about dynamic usage see here.

Software Architecture-Silverlight 4.0-New Feature- right click as MouseRightButtonDown and MouseRightButtonUp events

October 8, 2010

In Silverlight 4.0, Microsoft has 2 new events for right click as MouseRightButtonDown and MouseRightButtonUp events to the base UIElement class.

Let use these events to implement a right click menu on a button.

Assume a button with events MouseRightButtonDown as

<Button Content="Context Menu...." Height="23" HorizontalAlignment="Left" Margin="78,85,0,0" Name="button1" VerticalAlignment="Top" Width="148" MouseRightButtonDown="button1_MouseRightButtonDown"  />

Prepare Right click menu as

private void CreatePopup()

            /// Use StackPanel control as contianer control for context menu.
            StackPanel panel1 = new StackPanel();            
            panel1.Background = new SolidColorBrush(Colors.LightGray);

            // Style a border
            Border border = new Border();
            border.BorderBrush = new SolidColorBrush(Colors.Black);
            border.BorderThickness = new Thickness(5.0);
           // First Menu item
            TextBlock textblock1 = new TextBlock();
            textblock1.Text = "Popup Menu";
            textblock1.Margin = new Thickness(5.0);
            textblock1.FontSize = 16;
            textblock1.MouseLeftButtonDown += new MouseButtonEventHandler(MouseLeftButtonDownHandler);
            // Second Menu item
            TextBlock textblock2 = new TextBlock();
            textblock2.Text = "New window";
            textblock2.Margin = new Thickness(5.0);
            textblock2.MouseLeftButtonDown += new MouseButtonEventHandler(MouseLeftButtonDownHandler);
            // Third Menu item
            TextBlock textblock3 = new TextBlock();
            textblock3.Text = "Close";
            textblock3.Margin = new Thickness(5.0);
            textblock3.MouseLeftButtonDown += new MouseButtonEventHandler(MouseLeftButtonDownHandler);

            // Add menu item to panel
            border.Child = panel1;

            // Set the Child property of Popup to the border 
            // which contains a stackpanel, textblock and button.
            p.Child = border;

Call this method in constructor of page and declare pop in in page scope as:

// Create the popup object.
            Popup p = new Popup();

Event will look like that.

private void button1_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
            p.HorizontalOffset = e.GetPosition(null).X + 10;
            p.VerticalOffset = e.GetPosition(null).Y + 10;
            p.IsOpen = true;
            e.Handled = true;


The output of menu will look like that.