Sunday, January 23, 2011

Double faced Veena Malik's new publicity Stunt

http://www.youtube.com/watch?v=xIwYTOG9Wgs
http://journeyallover.blogspot.com/2011/12/veena-malik-did-it-again.html

Pakistani actress Veena Malik, who was an inmate in season four of Indian TV reality show 'Big Boss', has said she has perform her role as muslim by motivating, a non muslim towards NAMAZ...

Actress was condemned not following the Islam and due to her activities Pakistan gets the bad name, outside Pakistan.

She said she has not done anything wrong in India.

It's quite amazing, even a little things about neighbouring country, create a great news in Pakistani media. Knowing this fact very well, a low profiled actresses  like Veena Malik try to take full advantage, to boost up their career.
This is not happening first time. There are\were many artists from Pakistan who had tried to in-cash this weakness of Pakistani media's and Pakistani public.
Being closely associated with paki-media and entertainment, Veena Malik herself; knows it very well, and trying to reap maximum benefits of this.

She has already drawn a lot of media attention in whole Indian-Sub Continent. Due to her relations with one of the Pakistani cricketer and with cricket bookies.

Her recent act and shameless activities in Big Boss , shows her real character.

In her interesting interview with the Express TV Friday night; she talked so boldly and shamelessly. Rather confessing her deeds, she exposed a lot of drama in the TV show.

When an Islamic cleric, Mufti Abdul Baqi, who also participated in the interview, said: 'Veena had shamed all Pakistanis and Muslims with her immoral acts during the show.'

She started with all her scripted dialogues about women and man dominating society. She bursted into crocodile tears during the interview.

Being pressurized to answer and give justification about her deeds; she started changing the colors saying that she was performing Islam and performed all times NAMAZ, inside the show.
She also said she has done a Islamic deed by making one non-Islamic to perform NAMAZ. She brought one DVD with her as an evidence.

According to her, Asmit Patel is the person whom she motivated to perform Namaz. Ashmit  also participated in the interview . This is the same Ashmit Patel who already was in controversy after circulating sexual MMS of his girl friend to gain cheap publicity, couple of years ago.

Veena Malik who seems to be desperate to get an opportunity in Indian booming entertainment Industry and has been saying that she wants to be Indian bride as Indian males always attracts her.

Today sounds to be complain about the inmates in Big Boss; naming couple of other inmates of  house, she was complaining about the intolerable behaviour what she faced in Big Boss house.

It seems she want to have all the things in life, Bollywood life , working in Indian entertainment Industry and  good in front of Paki- media. And pakistani media appreciation.

She also said she should be appreciated for performing non-muslim a NAMAZ and she tried to teach Urdu to hindi speaking nation.

During the interview she become quite hostile and furious; and talking very impolitely to Islamic cleric. She also heard saying "She dont want to talk this man" about Islamic cleric.

The interview was really interesting in many senses, Veena Malik tried to opt all  the stunts. And if you really go thru the whole program and interview, It went quite intsrumental and rythmic.
Actress showed all the human emotions in a quite a routine sequence.
Rythms of shades of her acting went like this.
Interview start with some nice words, the cleric  Mufti Abdul Baqi mentioned that she is a beautiful lady in Urdu he addressed as by the Allah's grace she has got a lot of  " Husn-o-Jamal"
1. Hearing, her beauty's  appreciation, she tried to blush, a little bit.
2. Then she become quite defensive and apparantly offered the evidence in the form of DVD, which she handed over to Mr. Kamraan
3. Then next level she become quite aggressive.
4. Another level she tried to put her words, saying she is dealing with male dominating society.
5. At end when nothing wok, she started brust with tears.

She commented and said that she is not only single actress who went to Indian  to act and wearing short clothes.
She also said that Pamela (Hollywood actress) recognized her social work and would like to contact her further and Veena Malik would be the point of contact to Pamela in Pakistan.

Also read:
http://journeyallover.blogspot.com/2011/01/veena-malik-become-bread-and-butter-for.html

http://www.youtube.com/watch?v=xIwYTOG9Wgs
http://journeyallover.blogspot.com/2011/12/veena-malik-did-it-again.html


Friday, January 21, 2011

OOPS concept: Difference between Composition and Aggregation

Composition:


As we know, inheritance gives us an 'is-a' relationship. To make the understanding of composition easier, we can say that composition gives us a 'part-of' relationship. Composition is shown on a UML diagram as a filled diamond

Let's take a simple example of a car, it would make sense to say that an engine is part-of a car. Within composition, the lifetime of the part (Engine) is managed by the whole (Car), in other words, when Car is destroyed, Engine is destroyed along with it. So how do we express this in C#?

C# Example:
public class Engine
{
   . . .
}

public class Car
{
   Engine e = new Engine();
   ......
}
As you can see in the example code above, Car manages the lifetime of Engine.

Aggregation:

If inheritance gives us 'is-a' and composition gives us 'part-of', we could argue that aggregation gives us a 'has-a' relationship. Within aggregation, the lifetime of the part is not managed by the whole. To make this clearer, let's see an example.
The CRM system has a database of customers and a separate database that holds all addresses within a geographic area. Aggregation would make sense in this situation, as a Customer 'has-a' Address. It wouldn't make sense to say that an Address is 'part-of' the Customer, because it isn't. Consider it this way, if the customer ceases to exist, does the address? I would argue that it does not cease to exist. Aggregation is shown on a UML diagram as an unfilled diamond

Concept of Aggregation by Example using C#   in C#? Well, it's a little different to composition. Consider the following code:

public class Address
{
  . . .
}

public class Person
{
    private Address address;
 
  public Person(Address address)
  {
    this.address = address;
}
    . .
}

Person would then be used as follows:

Address address = new Address();
Person person = new Person(address);
or
Person person = new Person( new Address() );

As you can see, Person does not manage the lifetime of Address. If Person is destroyed, the Address still exists. This scenario does map quite nicely to the real world.

Conclusion:
Making the decision on whether to use composition or aggregation should not be a tricky. When object modelling, it should be a matter of saying is this 'part-of' or does it 'have-a'?

Association:
1. A relationship between 2 objects that is not whole-part i.e. A contains a reference of B and uses B through the reference

2. Generally implemented as a public property of A, where B may be set in to A by an external party (say Spring)

Dependency:

1. A week association, where A doesnt contain a reference of B but uses B
2. Generally implemented as method parameter in A

Another definations for composition and aggregation.

Composition:
1. A strong whole-part relationship, i.e. B (child) has no existence outside A (parent)
2. A creates and contains B but B can not contain A

2. B must not be visible outside of A since if A dies, B must die

Aggregation:
1. A week whole-part relationship, i.e. B (child) may exist exist outside A (parent)
2. A contains B but B can not contain A
3. B must be visible outside of A since B may still exist when A dies
4. Generally 1-many relationship

Difference Between Composition and Aggregation in Object Oriented Programming?

In a composition relationship, the whole has sole responsibility for the disposition of its parts, or as you put it above, the whole "controls the lifetime of" the part. In order for the whole

to have "sole disposition" or "control the lifetime" of its parts, the whole must be the only object that knows of the parts existence.

C++ Code Example:

class Whole {
                     Part* part;
                   public:

                 Whole(): part( 0 ) { }

               ~Whole() { delete part; }

};

Part is created inside Whole class constructor and it is destroyed when whole is destroyed.

Let's take an Real Life Example:

University and Departments have a composition relationship. When University is created all the departments are created with it. When University is removed departments will not have the existance of their own.

In aggregation relationship, the part object reference can be re-used. Usually creation of part object is not the responsibility of the ‘whole ‘ object. It would have been created somewhere else, and passed to the ‘whole’ object as a method argument. Whole object will not have control on the lifetime of the part object.

class Whole {
Part* part;

public:

Whole() { }

~Whole() { }

};

Let's take a Real Life Example:

University and Professors are in aggregation relationship. When University is formed professors will come and join the University. But, when University is removed Professors will still exists and they can work in other Universities.

Let's have more definations so that you'll remember it life time.
Composition is composite aggregation, which means one object is a whole, none of its parts are shared with another part to create a similar object. To create a similar/matching object duplication of the whole object is necessary. Compostion, which is composite aggregation is a relationship in which, the parts of an object can belong only to the whole object. If one object lives the whole lives, if one object dies the whole dies.

Example: A stack of dominoes remains intake (alive) until one domino is moved, then the entire stack collapes (dies).

Aggregation is shared aggregation. The best example of which is a two rooms side-by-side share a common wall. If one room is damaged the other room remains intact because of the shared wall. Shared aggregation is one object, which is common to two similar objects.

Composition : Defines a strong-coupled relationship between  two entities, where the one entity is part of another, and  both need each other for their existence.
e.g. Human body  and the Heart.

Aggregation : Defines a weak-coupled relationship between two entities, where one entity could be part of another, but either can exist without the other, independently.
e.g.    School and teacher.

Composition can be used to model by-value aggregation which  is semantically equivalent to an attribute. In fact  composition was originally called aggregation-by-value in an earlier UML draft with “normal” aggregation being thought of  as aggregation-by-reference. The definitions have changed  slightly but the general ideas still apply. The distinction  between aggregation and composition is more of a design  concept and is not usually relevant during analysis.

Thursday, January 20, 2011

Dada's Crazy Fans :: Humble Request to Mr. SRK...

Today, lately at morning I was going thru "The Times of India" as I mostly do first thing in the morning.
The headline on the top of the timesofindia.com catches my eyes..
Headline was like "IPL: Will Sourav Ganguly play for Kochi?

Below the head lines I found a link quoting SRK comments on Ganguly's ->
"KKR cricketing brains behind Ganguly ouster: SRK "

I usually do enjoy reading, the public comments below the topics, as always I tempted to read people's reaction about the news and found various funny and emotional comments below the news.

I started thinking how loyal these fans are; they are supporting Sourabh Ganguly like anything. They didnt like SRK's  purely materialist approach to thrown Ganguly out from KKR.

Thinking about it; it's pretty normal decision to choose a team, dropping the player who is not performing  and picking up the better players who are in better form.

But here the things worked differently . Sarauv Ganguly is well known and most popular player of West Bengal. He  better known as Prince of Bengal, lately. People of Bengal love him  and appriciate each and every move of their Hero. He  has been treated as a God in Bengal Cricket.

Truely and sincerely, Dada is a person who is a craze and hot property of Bengal; right from his entry into International cricket.

He was the most successful captain of his times, who has given a new height to Indian cricket or people also say he laid the foundation of India's new top notch position in cricket. India is being greeted as Number one team today due to the foundation which Ganguly kept.

He has the most aggressive persona; He was a package of aggressive player ,intellligent and dominating captain.
He was the real tiger; he created history many times , by making strong come back in Indian team. Every times his come back was so impressive but every time he never able to retain his position in team.
So his future in cricket was kind of on-off - off-on.

But Bengalis and a specific cricket followers still love him , accept him and support him in every way.

Ganguly himself was\is strong personality. Ganguly grew as aggresive batsman to dominating captain . He was having strong capability to take full-flash decisions and perform dominatingly as a team captain.

Now the time changed,  we're in 2011. Gangualy is not a  "Tiger Ganguly" any more.
Age has always been curse for any sports person. Ganguly is not an exception.

For Ganguly ,  what matters is to earn money , as a last chance. Last chance meaning is so simple, he is getting older as a sportman, already retired from the International cricket. So, if the sport person is not playing, then it's obvious ; there'll be no media,  no endorsements, no earnings.
This may be one of the reason for Ganguly to raise his base price in auction.

Money Matters. More over the things has not been as favourable as earlier . But Ganguly might not have ever imagine about this insult and that too in his home state and home city .
Prince of  Calcutta become Insulted sport person of Calcutta.

His home state team is owned by some purely money minded persons. For the team owner's money is more important. For them Ganguly's  State, Ganguly Kingdom , Ganguly's emotions, Ganguly's fans emotions and people's workship for their Hero does not matters. 

Most unfortunate thing is,  owners dont understand the sports they see money all over.
So (himself) called King of Bollywood, the owner of KKR, has done it once again. He did it again in terms of insulting others by his acts and verbals.

This time he exceeds all the limits and kick out Tiger Ganguly from his own den. Just because SRK is rich enough to buy all the rights to humiliate and insult all the ICONS, whether they belongs to his community or not, he can do, any thing. He can say, anything to any body. He can make any comment or statement to any body. He is having all the rights reserved , because (he) himself so-called King of  Bollywood.

Since Bollywood and cricket are two more religions in the country. So this time cricket lost and some team owner win the dirty game of politics.

Definaitely any sensible person won't  like the way, Dada has been treated this time.

In-between all the discussion above, I forget from where I've started the topic; I was discussing about the  comments of the fans in TOI comments sections.
that reflect they still love Dada as they do love cricket....

I like couple of comments .. I'm pasting them as it is ......................

Rama Praveenkumar (chennai) wrote:
" Srk, i have been ur fan but ur decision of dropping sourav from kkr has hurt me a lot... Do u mean to say that by dropping sourav kkr will win?
U urself have accepted that u have chosen wrong team during past season, then how can u say that just by dropping sourav kkr will win?
U r asking dada's wishes also for ur stupid decision!
Remember that no one in ur past team was performing consistently as dada did. Every other team had atleast a single player for the captain to depend upon, except ur kkr.
Can u name a player of past kkr team who performed consistently in atleast one season except sourav? When u have removed sourav from ur team better remove kolkata also from ur team name."

Subhamita (Hyderabad) wrote :

"Wah...great acting by you Mr.Khan.Appluads!!!but sadly it didnt work again like bunch of flop films comes to the industry every year.How could you dump most successful player of KKR.KKR should never forget Sourav and what he did for the team.
And regarding your team,you only wanted to drop the same Kolkata in IPL session 2,didnt you?You made decision to remove Dada from the position of captain..did that work?
Now please stop insulting Sourav using your acting skills.May it be you and anyone,entertainment business goes ahead with public demand.and Public of Kolkata is not supporting you.Please be informed...."


Jibz (Kolkata) wrote:
"How can you drop the most successful player of KKR.... He did not only score runs..... he also took stunning catches, and looked very much in shape.....Everyone in Kolkata should boycott KKR matches. The funniest thing is that no one even bothered to bid for Ganguly...seems like the whole thing has been driven by SRK as he could not digest DADA being the USP of KKR and not himself for the last three years "

KAUSHIK (Bhubaneswar) wrote:

KKR team management should not forget Saurav's contribution to the team. He was the backbone of the team and majority of the people used to visit EDEN to see SAURAV roaring. Now, Saurav is not in the team, we will not see the game. We will certainly miss the DADA charisma in the field. "


 Jitesh (Bangalore) wrote:
"Do not make us fool you stupid fellow. I make sure that non from my friends and relatives watches your movies and we are not going to KKR at any time now onwards. Dada has redefined the Indian Cricket Team and he does not need any team in which the owners are like you."


palashuddin (Guwahati)  wrote:
"firsr SRK should drop the K of KKR then he use his cricketing brain . actually he is a businessman n politician. he is a ACTOR n now also doing acting. now he understand he will have no profit ipl4 without DADA n Dada's supporter, no one want to go the match at eden. so now SRK showing his acting n makes all emotional. actually he is a "DANAB". why he dont understand the feelings of bengal people.?  "


maratha (mumbai) wrote:
"sharukh khan is a big politician basically dropping ganguly in the team was his own decision to gain publicity in media bi cheap manner by insulting great indian icon...."


Vivek (USA)  wrote:
"Excluding Ganguly from Calcutta team is stupid from cricketing as well as business perspective. Ganguly may not be in his prime form but he will still figure in top 160 cricketers available for IPL. Now SRK is realizing his stupidity and pleading with fans to let the show go on..."

Another crazy fan wrote letter to SRK :

                                                   Humble request to Mr SRK

"Humble request to Mr SRK "
Can you stop barking ... and keep your mouth shut, Mr SRK. Now we (majority of Indians ) dont want to listen you, anymore.
We are just fed up of your self-obsessions, self appraisals and interference anywhere you like... You jump any where like frog.. you belongs to film community stay there ...
You dont have any right to comment anything or anyone.. Sometimes you talk about Salman, sometimes you talk about Amir, sometimes about Mr. Bachchan.
Crossing the limits you talk about detaining Angelina Jolie and US security procedures.... Going more forward... you satrt talking about pakistani players in IPL...
Crossing it further.. you insult icon like Gavaskar.. then remove Dada as captain and now
it's beyond the horizon .. you remove DADA from team... that too from his own city, own state...


Enough is Enough man.
Who do you think you're.. you dont know..how to act.. you look like frog..
You just got alot by God's grace.. Thank HIM and keep your ugly mouth shut now. Just being successful does mean you got every right to insult ICONs and talk any thing.
STOP your cheapness for cheap publicity....now you starts irritating us.
Learn something from Sachin, Lataji, Amitji , you nerd. Be humble and learn to respect ppl's emotions.
Wish SRK somehow able to read this... "  "

Satya (Mumbai) wrote:

" What a joker this SRK...! "
 Heads of you fans... that's a true unconditional love, devoted to their real hero.

MFC Assertions

MFC defines the ASSERT macro for assertion checking. It also defines the MFC ASSERT_VALID and CObject::AssertValid for checking the internal state of a CObject-derived object.


The MFC ASSERT macro halts program execution and alerts the user if the argument (an expression) evaluates to zero or false. If the expression evaluates to a nonzero, execution continues.

When an assertion fails, a message dialog box displays the name of the source file and the line number of the assertion. If you choose Retry in the dialog box, a call to AfxDebugBreak causes execution to break to the debugger. At that point, you can examine the call stack and other debugger facilities to determine the cause of the assertion failure. If you have enabled Just-in-time debugging, the dialog box can launch the debugger if it was not running when the assertion failure occurred.

The following example shows how to use ASSERT to check the return value of a function:

int x = SomeFunc(y);
ASSERT(x >= 0); // Assertion fails if x is negative

You can use ASSERT with the IsKindOf function to provide type checking of function arguments:
ASSERT( pObject1->IsKindOf( RUNTIME_CLASS( CPerson ) ) );

The ASSERT macro catches program errors only in the Debug version of your program. The macro produces no code in the Release version. If you need to evaluate the expression in the Release version, use the VERIFY macro instead of ASSERT.

We are discussing about assertions; first we need to know what's Assert in basic.

An assertion statement specifies a condition that you expect to hold true at some particular point in your program. If that condition does not hold true, the assertion fails, execution of your program is interrupted, and the Assertion Failed dialog box appears.

This is a CObject class method; and can be used like,
AssertValid(): This method is used to check your class. Because an inherited class is usually meant to provide new functionality based on the parent class, when you create a class based on CObject, you should provide a checking process for your variables. In this case you should provide your own implementation of the AssertValid() method. You can use it for example to check that an unsigned int variable is always positive.


CObject::AssertValid

virtual void AssertValid( ) const;


Defination  :  AssertValid performs a validity check on this object by checking its internal state. In the Debug version of the library, AssertValid may assert and thus terminate the program with a message that lists the line number and filename where the assertion failed.

When you write your own class, you should override the AssertValid function to provide diagnostic services for yourself and other users of your class. The overridden AssertValid usually calls the AssertValid function of its base class before checking data members unique to the derived class.

Because AssertValid is a const function, you are not permitted to change the object state during the test. Your own derived class AssertValid functions should not throw exceptions but rather should assert whether they detect invalid object data.

The definition of “validity” depends on the object’s class. As a rule, the function should perform a “shallow check.” That is, if an object contains pointers to other objects, it should check to see whether the pointers are not null, but it should not perform validity testing on the objects referred to by the pointers.


Example
See CObList::CObList for a listing of the CAge class used in all CObject examples.

// example for CObject::AssertValid
void CAge::AssertValid() const
{
     CObject::AssertValid();
     ASSERT( m_years > 0 );
     ASSERT( m_years < 105 );
}


Visual C++ supports assertion statements based on the following constructs:
•MFC assertions for MFC program.
•ATLASSERT for programs that use ATL.
•CRT assertions for programs that use the C run-time library.
•The ANSI assert function for other C/C++ programs.

You can use assertions to:
•Catch logic errors.
•Check results of an operation.
•Test error conditions that should have been handled.

MFC and C Run-Time Library Assertions

When the debugger halts because of an MFC or C run-time library assertion, it navigates to the point in the source file where the assertion occurred (if the source is available). The assertion message appears in the Output window as well as the Assertion Failed dialog box. You can copy the assertion message from the Output window to a text window if you want to save it for future reference. The Output window may contain other error messages as well. Examine these messages carefully, because they provide clues to the cause of the assertion failure.

Through the liberal use of assertions in your code, you can catch many errors during development. A good rule is to write an assertion for every assumption you make. If you assume that an argument is not NULL, for example, use an assertion statement to check for that assumption.

_DEBUG
Assertion statements compile only when _DEBUG is defined. When _DEBUG is not defined, the compiler treats assertions as null statements. Therefore, assertion statements have zero overhead in your final release program; you can use them liberally in your code without affecting the performance of your Release version and without having to use #ifdefs.

Side Effects of Using Assertions

When you add assertions to your code, make sure the assertions do not have side effects. For example, consider the following assertion:

ASSERT(nM++ > 0); -- Don't do this!

Because the ASSERT expression is not evaluated in the Release version of your program, nM will have different values in the Debug and Release versions. In MFC, you can use the VERIFY macro instead of ASSERT. VERIFY evaluates the expression but does not check the result in the Release version.

Be especially careful about using function calls in assertion statements, because evaluating a function can have unexpected side effects.

ASSERT ( myFnctn(0)==1 ) –- unsafe if myFnctn has side effects

VERIFY ( myFnctn(0)==1 ) –- safe

VERIFY calls myFnctn in both the Debug and Release versions, so it is safe to use. You will still have the overhead of an unnecessary function call in the Release version, however.

Some generall questions and solution about Assertions.
(I've collected this from various resourses and MSDN ..... )

Prob One:  In MFC, why do I get an assertion when my thread calls a function in the main thread?


Solution and Explanation :The MFC message processing code is not thread-safe. So when a secondary thread calls anything in the main thread that affects a CWnd-derived object there is a danger of data corruption within MFC. To guard against this MFC uses thread local storage and liberal ASSERTs to warn you that what you are trying to do can't work reliably. There are two safe alternatives for updating a main thread window from a secondary thread.

In simple cases you can bypass MFC and take advantage of the fact that the Win32 API is thread-safe. Your secondary thread can safely use an hwnd passed from the main thread and call a Win32 function to force many kinds of updates:

// force repaint of a window in the main thread
::InvalidateRect(hwnd, NULL, TRUE);

// change the text in any control
::SetDlgItemText(hwnd, IDC_CONTROL, "Hello Bro");

When you want to force complex actions such as UpdateAllViews or UpdateData you need the involvement of the main thread's MFC code. In such cases you can "call" the main thread from your secondary thread in a safe and synchronized fashion by sending or posting a user-defined message to the main thread.

Assertion in managed code

An assertion, or Assert statement, tests a condition, which you specify as an argument to the Assert method. If the condition evaluates to true, no action occurs. If the condition evaluates to false, the assertion fails. If you are running under the debugger, your program enters break mode.


•The Debug.Assert Method
•Side Effects of Debug.Assert
•Trace and Debug Requirements
•Assert Arguments
•Customizing Assert Behavior
•Setting Assertions in Configuration Files

In Visual Basic and Visual C#, you can use the Assert method from either the Debug class or the Trace class (part of the System.Diagnostics namespace). Debug class methods are not included in a Release version of your program, so they do not increase the size or reduce the speed of your release code. For more information, see Debug Class and Trace Class.

Managed Extensions for C++ does not support the Debug class methods. You can achieve the same effect by using the Trace class with conditional compilation (#ifdef DEBUG... #endif).

The Debug.Assert Method

Use the Debug.Assert method freely to test conditions that should hold true if your code is correct. For example, suppose you have written an integer divide function. By the rules of mathematics, the divisor can never be zero. You might test this using an assertion:

[Visual Basic .NET]
Function IntegerDivide(ByVal dividend As Integer, ByVal divisor As Integer) As Integer
Debug.Assert(divisor <> 0)
Return CInt(dividend / divisor)
End Function

[C#]
int IntegerDivide ( int dividend , int divisor )
{ Debug.Assert ( divisor != 0 );
return ( dividend / divisor ); }

When you run this code under the debugger, the assertion statement will be evaluated, but in the Release version, the comparison will not be made, so there is no additional overhead.

Let's look at another example.
 Suppose you have a class that implements a checking account. Before you withdraw money from the account, you want to make sure that the account balance is sufficient to cover the amount you are preparing to withdraw. You might write an assertion to check the balance:

[Visual Basic .NET]
Dim amount, balance As Double
balance = savingsAccount.balance
Debug.Assert(amount <= balance)
SavingsAccount.Withdraw(amount)

[C#]
float balance = savingsAccount.Balance;
Debug.Assert ( amount <= balance );
savingsAccount.Withdraw ( amount );

Note that calls to the Debug.Assert method disappear when you create a Release version of your code. That means that the call that checks the balance will disappear in the Release version. To solve this problem, you should replace Debug.Assert with Trace.Assert, which does not disappear in the Release version:

[Visual Basic .NET]
Dim amount, balance As Double
balance = savingsAccount.balance
Trace.Assert(amount <= balance)
SavingsAccount.Withdraw(amount)

[C#]
float balance = savingsAccount.Balance;
Trace.Assert ( amount <= balance );
savingsAccount.Withdraw ( amount );

Calls to Trace.Assert, unlike calls to Debug.Assert, add overhead to your Release version.

Side Effects of Debug.Assert

When you use Debug.Assert, make sure that any code inside the Assert does not change the results of the program if the Assert is removed. Otherwise, you may accidentally introduce a bug that only shows up in the Release version of your program. Be especially careful about Asserts that contain function or procedure calls, such as the following example:

[Visual Basic .NET]
Debug.Assert (meas(i) <> 0 )  //unsafe code


[C#]
Debug.Assert (meas(i) != 0 );  // unsafe code

This use of Debug.Assert may appear safe at first glance, but suppose the function meas updates a counter each time it is called. When you build the Release version, this call to meas is eliminated, so the counter will not get updated. This is an example of a function with a side effect. Eliminating a call to a function that has side effects could result in bug that only appears in the Release version. To avoid such problems, do not place function calls in a Debug.Assert statement. Use a temporary variable instead:

[Visual Basic .NET]
temp = meas( i )
Debug.Assert (temp <> 0)

[C#]
temp = meas( i );
Debug.Assert ( temp != 0 );

Even when you use Trace.Assert, you might still want to avoid placing function calls inside an Assert statement. Such calls should be safe, because Trace.Assert statements are not eliminated in a Release build. However, if you avoid such constructs as a matter of habit, you are less likely to make a mistake when you use Debug.Assert.

Trace and Debug Requirements

For Trace methods to work, your program must have on of the following at the top of the source file:
•#Const TRACE = True in Visual Basic
•#define TRACE in Visual C# and Managed Extensions for C++

Or your program must be built with the TRACE option:
•/d:TRACE=True in Visual Basic
•/d:TRACE in Visual C# and Managed Extensions for C++

If you create your project using the Visual Studio .NET wizards, the TRACE symbol is defined by default in both Release and Debug configurations. By contrast, the DEBUG symbol is defined by default only in the Debug build.

If you need to use the Debug methods in a C# or Visual Basic Release build, you must define the DEBUG symbol in your Release configuration.

Managed Extensions for C++ does not support the Debug class methods. You can achieve the same effect by using the Trace class with conditional compilation (#ifdef DEBUG... #endif). (You can define these symbols in the Property Pages dialog. For more information, see Changing Project Settings for a Visual Basic Debug Configuration or Changing Project Settings for a C or C++ Debug Configuration.)

Assert Arguments
Trace.Assert and Debug.Assert take up to three arguments. The first argument, which is mandatory, is the condition you want to check. If you call Trace.Assert or Debug.Assert with only one argument, the Assert method checks the condition and, if the result is false, outputs the contents of the call stack to the Output window. The following examples show Debug.Assert and Trace.Assert used with one argument.

[Visual Basic .NET]
Debug.Assert(stacksize > 0)
Trace.Assert(stacksize > 0)

[C#]
Debug.Assert ( stacksize > 0 );
Trace.Assert ( stacksize > 0 );

The second and third arguments, if present, must be strings. If you call Trace.Assert or Debug.Assert with two or three arguments (one or two strings), the Assert method checks the condition and, if the result is false, outputs the string or strings. The following examples show Debug.Assert and Trace.Assert used with two or three arguments:

[Visual Basic .NET]
Debug.Assert(stacksize > 0, "Out of stack space")
Trace.Assert(stacksize > 0, "Out of stack space")

[C#]
Debug.Assert ( stacksize > 0, "Out of stack space" );
Trace.Assert ( stacksize > 0, "Out of stack space" );

[Visual Basic .NET]
Debug.Assert(stacksize > 0, "Out of stack space. Bytes left:" , Format(size, "G"))
Trace.Assert(stacksize > 0, "Out of stack space. Bytes left:" , Format(size, "G"))
Trace.Assert(stacksize > 0, "Out of stack space. Bytes left:", "inctemp failed on third call" )

[C#]
Debug.Assert ( stacksize > 100, "Out of stack space" , "Failed in inctemp" );
Trace.Assert ( stacksize > 0, "Out of stack space", "Failed in inctemp" );

Customizing Assert Behavior
If you run your application in user-interface mode, the Assert method displays the Assertion Failed dialog box when the condition fails. The actions that occur when an assertion fails are controlled by the Debug.Listeners or Trace.Listeners property. You can customize the output behavior by adding a TraceListener object to the Listeners collection, by removing a TraceListener from the Listeners collection, or by overriding the Fail method of an existing TraceListener to make it behave differently. For example, you could override the Fail method to write to an event log instead of displaying the Assertion Failed dialog box. For more information, see TraceListener Class. To customize the output in this way, your program must contain a listener, and you must inherit from the TraceListener and override its Fail method. For more information, see Debug.Fail or Trace.Fail.

Setting Assertions in Configuration Files
If you prefer, you can set an assertion in your program configuration file instead of in your code. For details, see Debug.Assert Method (Boolean) or Trace.Assert Method (Boolean).




Saturday, January 15, 2011

Vision : World By 2050.....Third World turning to First World and vice versa

One week before; after publishing my previous article as titled "Vision  : World By 2025..."
Yesterday I was going through one interesting article on GDP and economical growth of the countries.

Article published on United Kingdom's one of the leading newspaper "The Guardian" talks about the GDP projection from PwC. I just get motivated to write something after reading the article on Guardian.

Article says :
              "GDP projections from PwC: How China, India and Brazil will overtake the West by 2050.."

What will the world look like in 2050? For a number of years, the economists at PwC have been charting the rise of the big emerging countries and seeking to calculate the moment when the G7 industrial nations will be surpassed by an E7 (E for Emerging) of China, India, Brazil, Russia, Mexico, Indonesia and Turkey.


To do this, they used World Bank data for growth up until 2009, PwC's short-term projections for the years up until 2014 and their long-term growth assumptions for 2015 to 2050, which rely on assumptions about population growth, increases in human and physical capital, and the rate at which poorer countries can catch up with the more advanced technologies used in developed nations.

Inevitably, the results of the study involve guess work, however well-informed. But the trends appear to be clear; the emerging nations have grown far more rapidly than their counterparts in the west and will continue to do so.


At present, nine out of the ten biggest economies in the world when measured by market exchange rates are developed nations; by 2050, according to PwC, that number will be down to just four - the US at number two behind China, Japan at 5, Germany at 8 and the UK at 9. PwC also make comparisons using purchasing power parities - which take account of different price levels between countries.

Using this yardstick, the eclipse of the west happens more quickly, although the broad trends are similar, with the US falling to third behind China and India by 2050.

Guardian also mentioned about one data list which clearly and inevitably displays ..
Data summary

GDP projections -GDP at PPPs (constant 2009 international dollars), $bn.

Country                        2011                          2025                            2050
US                             15,051.17                21,010.83                  38,060.89
China                         10,656.45                25,501.22                  57,784.54
India                           4,412.91                 10,721.09                  41,373.68
Japan                          4,322.31                 5,535.43                    7,641.40
Russia                         2,948.64                 4,635.98                    7,422.46
Brazil                          2,265.08                 3,950.27                    9,771.54
UK                             2,338.80                 3,208.02                    5,616.50
Germany                     3,108.00                 3,834.14                    5,629.18
France                         2,235.54                3,046.22                     5,339.13
Italy                             1,962.14                2,557.97                     3,805.81
Spain                           1,495.61                2,036.10                     3,198.53
Canada                        1,362.20                1,892.54                     3,348.14
(Source: Guardian and PwC main scenario model projections for 2010-50)

Now look at the grphical representation of the GDP projections and up-placement and displacement of the countries positions. This is a serious note and really interesting thing to be happen in near Future.. Is in real , the Third World will become the First world and First will not be no more First World.....

(Source: Guardian and PwC main scenario model projections for 2010-50)

Saturday, January 8, 2011

10 worst office manners which irritate bosses

Most of the time it is the employees who are seen unhappy with their bosses, sometimes bosses start smirking in their nightmares.
But being an employee, have you ever thought that some of your irritating manners might also be the source of strife for your boss as well?

The boss-employee story has two sides. While one side tells about the bitter experiences of the employees with their bosses, the other side says that the employees are not the only ones having a beef about their bosses. Bosses too get sick of their employees at times. 

Please have a look into points below:

Arrive late and leave early:

If you one of those who arrive late at the last second, but leave early or first at the end of the day, you're not certainly in your boss's good book. It'll only show your disinterest in your job which your boss doesn't like.


Abuse of sick leave:
You are sick and taking leave, that's fine. You are not sick, but you are taking leave telling that you are sick - a really annoying thing that your boss simply hates. As per recent studies, one out of three employees who calls in sick really isn't. About 32 percent of U.S. employees called in sick when they really weren't in 2009, as per CareerBuilder's annual absenteeism survey of 4,700 workers.


Intolerable cell phone behavior:

You are in a meeting and your cell phone rings again and again. It can be the major contributor to your boss's dislike towards you. Adding to it, receiving multiple phone calls at work is never appropriate. Bosses also hate employees peeping on their cell phones while at work.

Not communicating things properly:
Proper communication between the bosses and employees is the key to success for every organization. Employees should have good communicating skills otherwise chances are there for the boss to get irritated. If you are not able to complete your task within the deadline, rather than ignoring your bosses reminder mails communicate the reason why you are not able to meet the deadline.

Lousy table manners:
Bosses obviously develop a dislike to those employees who display poor table manners during a luncheon meeting with a client. Always be very careful while you are in a meeting as a lousy table can cause embarrassment in front of your clients.

Over eagerness:
Bosses don't like those employees who are overeager. Very often people think that by showing over eagerness they can attract their boss's attention and can impress them with their new ideas. But on the contrary it is likely to generate disliking in their boss's mind towards them.

Unreliable:
Employees who say one thing, but end up doing the other and those who cannot complete the assigned task and give excuses are certainly not in their boss's good book. Very often they create headaches for bosses.

Argumentative to the boss:
If you think you should argue for your right with your boss, think twice. This could be a good incentive for disliking you. Even arguing with your co-workers can also create trouble for you. Being argumentative is a big no-no.

Clumsy appearance:
Always maintain a good hygiene while coming to office. Dress up yourself properly. Bosses don't like those employees who don't maintain proper hygiene.

Talk about personal problems:
Bosses tend to hate employees talking endlessly about their person problems to them or even to the co-workers. Stop doing that or it will create disliking in your boss's mind towards you.


(Above article is inspired by some online stuff as per [ SiliconIndia did a survey to know what the boss's biggest complaints about staff are.])

Vision : World By 2025...............

Within two decades or less, a rapidly rising India will very likely become the world's third largest economy - after China and the US.
It would be appropriate to start speculating now on what kind of a superpower India will be or could be when it becomes one.


Complex adaptive systems cannot change their stripes once theyhave evolved. How a system evolves determines its end-state. In short, how India becomes a superpower will predefine its structure, its mindset and its behaviour.



1. India's emergence as a superpower will show that it is possible to lift millions of people out of poverty within one generationwhile embracing pluralism, a free press and a vibrant multiparty democracy. Mostanalysts predict that, over the next two decades, India's GDP will grow at a faster pace than China's.


As the world's fastest-growing large economy on asustained basis, India's rise will put to rest the idea that acommand-and-control political system is the only viable route to rapid economicgrowth and that democracy is some how anti-thetical to rapid economic growth.


2.  India has the potential to serve as a leading example of how to combine rapid economic growth with fairness towards and inclusion of those at the bottom rungs of the ladder.


In a democratic system such as India's where even the poorest people exercise their political rights actively, fairnessand inclusion will be even more critical for social stability than in China. A sit becomes a great power, these values will likely become an enduring part of the country's DNA.


3. The prospects are high that, by 2025, India will likely emerge as one of the world's least corrupt developing economies.


While widespread corruption is a reality in almost all developing economies (as well as some of the developed ones), India is one of the very few developing economies with a free press that continues to be vigilant and merciless in exposing the corruption.


It is very likely that a vigilant and free press willensure that the likelihood of getting away with corruption will decline rapidly- with salutary deterrent effects.


4. India will likely emergeas one of the world's leaders in leveraging information technology (IT) to boost the effectiveness and efficiency of its institutions - the corporations, the government and as well as civil society organisations.


As 3G and 4G wirelessconnectivity becomes widespread over the next five years, it is a near-certainty that we'll see a rapid diffusion of low-cost tablet computers along with free ornear-free applications aimed at self-learning, mobile banking as well ascommercial productivity.

India in 2025, could well emerge as one of the world's most connected and IT-savvy societies.


5. India will almost certainly become a leading example of efficient resource utilisation, especially in energy.
India relies on imports for a bigger proportion of its oil and  gas needs than any other large emerging economy. The situation is likely to get worse, with sustained growth. The consequences are clear. One possible outcome is that India hits a resource-scarcity wall and economic growth comes to a screeching halt.


Moving forward; here's a PWC comments and predictions about global economy by 2050..
India is poised to overtake the USA and emerge as the World's second largest economy on purchasing power parity basis by 2050 and has the potential to supersede China to the top spot, says a report published by PwC.


China is expected to overtake the US as the world's largest economy sometimes before 2020, according to the report.

Health Benefits of Cashews

  Benefits of Cashews. Healthy food is an integral part of healthy body. Regular exercises such as Yoga and healthy diet is important to...