Sunday, 9 February 2014

Negotiate A Great Salary… Even In A Recession.

Work is just, that: work. Just getting or keeping a job these days seems like enough. The thing is, its not.
Starting salaries dictate how much you earn long-term.
In addition, benefits and job security are dwindling while taxes are rising. Today, employees need to earn more just to stand still in their careers.
Moreover, employers know they can get more work for less and everyone in management is jockeying for the best employees for the least amount of money.
The dirty little secret no one is talking about is many employers are still willing to pay a lot for good talent.
Here are a few tips on how to successfully negotiate a great salary or raise in today’s job market.

Make It Known You Don’t Need The Job

This doesn’t mean that you don’t want the job or don’t work hard; just make it known you have other options. In today’s job market, having back up plans and alternatives is essential for survival. If you haven’t engineered a back up plan, now is the time to start. Once it is in place you won’t have to bluff a nonchalant attitude.
The people being promoted and given raises these days are the valuable employees that have the right attitude and that attitude is: I don’t really need this job, I can get another (better) one.
Among a sea of employees who are absolutely desperate not to be fired, this type of attitude stands out like a bright light and it makes management pay attention.
Moreover, adopting an honest attitude about your job’s life expectancy can be very liberating. While everyone else is so petrified about losing their job that they are constantly emitting desperation and a bad attitude you will be emitting prosperity and hope. People around you will thrive and this will make you look even better to upper management.
Combine outstanding performance with the impression your company might lose you to the competition and you have a formula for a healthy raise and a promotion.
In the hiring arena competition for jobs is very fierce. No matter what your qualifications or background there is probably someone who is better qualified for the job. You can’t control that right now.
What you can control is your attitude. Successful job candidates are usually the people that get along well with the interviewers. Employers are looking for someone with excellent office etiquette and someone who will be a valuable addition to their team.
Once you are fairly certain they like you and you like them put a little nudge into the negotiations by hinting you are fielding several other offers. It’s best to actually be doing this rather than bluffing. Thanks to evolution people always want something more if they are afraid it might disappear.

Salary Isn’t Everything: Nail Great Benefits

Every contract can be reviewed, crossed-out, added to and rewritten. Always look to get valuable compensation added to your contract. Here is an example.
A real estate developer was just hired by a small firm. She nailed a six-figure salary. She then negotiated a valuable severance package before she took the new job. She told the company she wanted a full severance package immediately that matched the terms of her current job. Without it she couldn’t move.
Her argument was logical and brilliant. In her old job she had a valuable severance package.
Why should she give that up to work for a smaller (less stable) company? She neglected to mention the new salary was more than twice her old one. Double score.
Benefits negotiations can extend to anything and everything. Extra vacation time, an elevated bonus structure and the power to choose your own admin are all things that can be very important. Everyone’s values are a bit different. Add these extra benefits to the traditional fringe benefits like stock, life insurance, health insurance and retirement plans.
Don’t get too greedy and choose only two or three points of negotiation. Moreover, plan to let the employer “win” on one to two of these points.

Close The Sale

Part of the secret to good negotiating is momentum. This is true whether you are selling cars or selling yourself. Keep negotiations brief and always move the process along as quickly as possible. Once you have negotiated a salary or a raise verbally get it in writing and have everything summarized into a letter of agreement as soon as possible.
A simple, “Can your secretary write me up a quick summary this afternoon so that I can review it,” is a great nudge to getting that final contract signed and sealed. Unwritten promises aren’t worth the air they disappear into.

Additional Tips For Negotiating A Great Salary

  • Don’t start talking money until you have a job offer- ever!
  • Make them call the first number.
  • Do your research; know what you should be paid in the position.
  • Keep your salary strategies and negotiations to yourself. Don’t talk about money at the office.
  • Practice negotiating “for fun” at an open-air market.
  • Don’t take salary negotiations too personally.
  • Always ask about salary increases and raises at least once a year.
  • Remember even if you love your boss they aren’t going to pay to send your kids to college.

5 Tips For Handling Salary Requirements

Here are five tips that will make sure you get the best salary package:

1. Research Salaries

Three great sites that provide real-time salary information are Salary.com, Payscale.com, and Glassdoor.com. They have salary date by title and location, and offer some free searches. This is the place to start to see what typical compensation is for the kind of job you are seeking.

2. Research The Company

Before you enter discussions, check the company’s job postings and see if they indicate salary ranges there. This does not have to be for your specific position, as you just want to see if they are offering competitive salaries across the board.
So, if you see that they are offering $25,000-$30,000 for administrative assistants when typical salaries are higher for this position, it tells you they are at the low end of the spectrum.

3. Whoever Speaks First Loses

A common rule in salary negotiations is that whoever offers a number first loses. Personally, I do not believe this, but nonetheless, you can just turn the tables on them and just ask, “What have you budgeted for this position?”
You will be surprised how often they will respond.

4. Give A Good Generic Answer

If you must say something and do not want to indicate what you are currently making or have previously been paid, a good statement is:
“Although the job and the challenge are most important to me, you should know that I am considering positions in the XX to YY range.”
Note the subtlety of the “I am considering positions” statement as it makes you look like you have other opportunities and will cause them to think about making a competitive offer.

5. Negotiate Other Things

You may not be able to get all you want from the salary negotiations, but remember that there are other things that you can negotiate.
The most common is vacation time. If they offer two weeks for the first three years and you are used to more than that, just indicate that your family is used to 4+ weeks of vacation and can they start with three weeks. You will be surprised how often this works.
Consider other things that will make a difference for you such as a company-provided cell phone, car, laptop, and so on.
Use these tips and you will get the best compensation package they offer.

Read more at http://www.careerealism.com/handling-salary-requirements/#YS0R9Q5BO0ibY2MW.99

5 ways to ensure you hire the right talent

Make sure you take the right hiring decisions by following the checklist shared below.

Hiring decisions are the most painful part of an HR professional's job and they are equally taxing for the business, at large. A study published by the Society for Human Resource Management found that a poor hiring decision, which ended in termination, actually costs the company concerned around 38 per cent of an employee's salary. With so much at stake, how can one ensure that right person is hired for the right job? Ravi S Singh, founder, Insiders, shares a checklist which can help avoid horror hires...

Talent mapping

The success of hiring lies in talent mapping; if you have the right people on your mapping list, your job is almost done. The problem with most of the recruiters, even consultants, is that their search process ends as they find a suitable candidate, to get a closure. An extensive talent mapping gives you a holistic preview of the available talent and make sure that you are hiring the most suitable and best fit.

Strong pre-screening 

A right hire is not determined by the number of people interviewed but by meeting the right people. Hence, a strong and in-depth pre-screening of CV is highly recommended, so that you meet only the right people and when you are making a final decision you know you are choosing among the best. In today's social media-driven world, reviewing the online profile can be a very strong pre-screening criterion.

Non negotiable traits/behavior 

The technical aspect and achievements (IQ) are almost defined in the CV and while interviewing, it's all about cross checking them. But the major aspect which needs to be checked is behaviors, traits, and attitude; in short the EQ aspect. Hence, define your NNT (Non Negotiable Traits) this will definitely assure the stability of hire in your organisation.

Know your questions 

Have a checklist of interview questionnaire. Also, it's not only about preparing the right question but knowing them as well; i.e., what is the objective? What will it basically determine or how well can it give a prospective of the candidate?

Background and reference check

Effective reference check is one of the most important steps in the hiring process. Make sure and verify that all the credentials, experience and skills shared, are possessed by the candidate.

Besides, there are number of behavioural and personality assessment tests available, today, to evaluate the suitability and credibility of a candidate for the available job profile/position. "A little extra effort at the preliminary stages of hiring process can help in culling the good from bad. It is best to give an in-depth testing on the candidate's competencies rather than glide along on first impressions," advised Kevin Tan, principal consultant, Omni View Consultancy.

Sunday, 2 February 2014

C++ Constructor and Destructor

C++ Constructor:
Constructors are the special type of member function that initializes the object automatically when it is created Compiler identifies that the given member function is a constructor by its name and return type. 
  • It can have parameters like any member function.
  • Constructor functions are usually declared in the public section, but can also be declared in the protected and private sections, if the user wants to restrict access to them.
  • Constructor has same name as that of class and it does not have any return type and executed whenever we create new objects of that class.
  • The constructor has two parts:
      First is the initializer list which follows the parameter list and before the method body. It starts with a colon and entries are comma-separated. The initializer list is not required, but offers the opportunity to provide values for data members and avoid separate assignment statements. The initializer list is required if you have const or reference type data members, or members that do not have parameterless constructor logic. Assignments occur according to the order of the initializer list. 

    The second part is the body, which is a normal method body enclosed in curly brackets.


Constructor Types : means constructor can be over loaded like member function:

1. Default Constructor: A default constructor is a constructor that either has no parameters, or if it has parameters, all the parameters have default values.
Example:
class Cons{};

If no user-defined constructor exists for a class A and one is needed, the compiler implicitly declares a default parameterless constructor A::A(). 

This constructor is an inline public member of its class. The compiler will implicitly define A::A() when the compiler uses this constructor to create an object of type A. 
The constructor will have no constructor initializer and a null body.

The compiler first implicitly defines the implicitly declared constructors of the base classes and nonstatic data members of a class A before defining the implicitly declared constructor of A. No default constructor is created for a class that has any constant or reference type members. 

A constructor of a class A is trivial if all the following are true:

  • It is implicitly defined Cons has no virtual functions and no virtual base classes.
  • All the direct base classes of Cons have trivial constructors. 
  • The classes of all the nonstatic data members of Cons have trivial constructors
If any of the above are false, then the constructor is nontrivial.

2. Copy Constructor:  for a class Cons is a constructor whose first parameter is of type Cons&, const Cons&. Copy constructors are used to make a copy of one class object from another class object of the same class type. You cannot use a copy constructor with an argument of the same type as its class; you must use a reference.


3. Parametrized Constructor: A default constructor does not have any parameter, but if you need, a constructor can have parameters. 


The following code fragment shows two classes with constructors, default constructors, and copy constructors, initializer :

class Cons1

 {
int length, breadth;
public:
  // default constructor, no arguments
  Cons1();
  // Parametrized constructor, assign value using assignment operator
  Cons1(int x, int y)
 {
      length = x;
     breadth = y;
 }
// Parametrized constructor, assign value using Initializer list
//  Cons1(int x, int y) : length(x),  breadth(y) { }

  // copy constructor

  Cons(const Cons&);
};

class Cons2 {

public:
  // default constructor with one
  // default argument
  Cons2( int a= 0);

  // default argument

  // copy constructor
  Cons2(const Cons2&, int a = 0);

};


C++ Destructor: updated coming soon.

Thursday, 30 January 2014

LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt


Causes:
This error appear because you have installed Visual C++ 2012 after you
have actually installed Visual C++ 2010 in your system;
another cause is because .net Framework 4.5 replace .net Framework 4.0;
.net Framework corrupted files;
 
How To Solve:
Solution 1:
Either disable incremental linking, by going to
Project Properties
   -> Configuration Properties
       -> Linker (General)
          -> Enable Incremental Linking -> "No (/INCREMENTAL:NO)"

 
 
 
Solution 2:
If disabling incremental linking doesn't work for you, and turning off
"Embed Manifest" doesn't work either, then search your path for multiple
versions of CVTRES.exe.
 
By debugging with the /VERBOSE linker option I found the linker was
writing that error message when it tried to invoke cvtres and it failed.
It turned out that you had two versions of this utility in your path.
 
One at C:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\cvtres.exe and
one at C:\Windows\Microsoft.NET\Framework\v4.0.30319\cvtres.exe.
 
After VS2012 install, the VS2010 version of cvtres.exe will no longer
work.
If that's the first one in your path, and the linker decides it
needs to convert a .res file to COFF object format, the link will fail
with LNK1123.
(Really annoying that the error message has nothing to do with the
actual problem, but that's not unusual for a Microsoft product.)
 
Solution:
Just delete/rename the older version of the utility, or re-arrange your
PATH variable, so that the version that works comes first. I mostly use renamed the old version file.
 
Solution 3:
-> If Visual Studio 2012 RC and Visual Studio 2010 with SP1 are installed on the same computer then you will be re-install VS 2010 with SP1,
-> If you have Visual Studio 2012 RC  and Visual Studio 2010 then you will be install Visual Studio 2010 with SP1.
you can open the project in both of those versions of Visual Studio.
 
Solution 4:
Uninstall .Net Framework 4.5 from your system and re-install .Net Framework 4.0.

 
   

Wednesday, 15 January 2014

How to open a URL in the default web browser?


This is easily done by calling ShellExecute() HTTP and FTP URLs should be processed by both Netscape and IE: the "default" browser will handle them. Other protocols such as mailto and news may also handled by the browser. IE4 adds handlers for things like "Callto:" for Net Meeting contacts.

#include "windows.h"
 #include "shellapi.h"
 //link in the library
#pragma comment(lib,"shell32.lib")
 
int main(int argc, char *const argv[])
{
    ShellExecute(NULL,"open", "http://coderdreambook.blogspot.in/", "", "c:\\", SW_SHOWNORMAL);
    return 0;
}

Saturday, 11 January 2014

What is a pdb file?

A program database (PDB) file contains debugging and project state information that allows incremental linking of a Debug configuration of the program. This file is created when you compile a C/C++ program with /ZI or /Zi or a Visual Basic/C#/JScript .NET program with /debug.

When do you call copy constructors?

Copy Constructor:  It is a constructor, which initializes it's object member variable with another object of the same class. If you don't implement a copy constructor in your class, the compiler automatically does it.

Copy constructors are called in these situations: 

i.)when compiler generates a temporary object 
ii.)when a function returns an object of that class by value 
iii.)when the object of that class is passed by value as an argument to a function 
iv.)when you construct an object based on another object of the same class

Get the middle node in a given singly linked list?


struct node
{
   int info;
   struct node *next;
};

struct node* getMiddleNode(struct node **start)
{
  struct node *middle = *start;
  struct node *fast_ptr = *start;

  if(*start != NULL)
  {
       while((fast_ptr->next) !=NULL && (fast_ptr->next->next) != NULL)
       {
          fast_ptr = fast_ptr->next->next;
          middle = middle->next;
       }
  }

   return middle ;
}

Thursday, 19 December 2013

Polymorphism

When a message can be processed in different ways is called polymorphism. Polymorphism means many forms.
Polymorphism is one of the fundamental concepts of OOP.
Polymorphism provides following features: 
  • It allows you to invoke methods of derived class through base class reference during runtime.
  • It has the ability for classes to provide different implementations of methods that are called through the same name. 
Polymorphism is of two types:
 1.Compile time polymorphism/Overloading
 2. Runtime polymorphism/Overriding

Compile Time Polymorphism:
Compile time polymorphism is method and operators overloading. It is also called early binding.
 In method overloading method performs the different task at the different input parameters.

Function overloading in C++:


You can have multiple definitions for the same function name in the same scope. The definition of the function must differ from each other by the types and/or the number of arguments in the argument list. You can not overload function declarations that differ only by return type.
Following is the example where same function print() is being used to print different data types:

#include <iostream>
using namespace std;
 
class printData 
{
   public:
      void print(int i) {
        cout << "Printing int: " << i << endl;
      }

      void print(double  f) {
        cout << "Printing float: " << f << endl;
      }

      void print(char* c) {
        cout << "Printing character: " << c << endl;
      }
};

int main(void)
{
   printData pd;
 
   // Call print to print integer
   pd.print(5);
   // Call print to print float
   pd.print(500.263);
   // Call print to print character
   pd.print("Hello C++");
 
   return 0;
}
When the above code is compiled and executed, it produces the following result:
Printing int: 5
Printing float: 500.263
Printing character: Hello C++

Operators overloading in C++:

You can redefine or overload most of the built-in operators available in C++. Thus a programmer can use operators with user-defined types as well.
Overloaded operators are functions with special names the keyword operator followed by the symbol for the operator being defined. Like any other function, an overloaded operator has a return type and a parameter list.

Box operator+(const Box&);
declares the addition operator that can be used to add two Box objects and returns final Box object. Most overloaded operators may be defined as ordinary non-member functions or as class member functions. In case we define above function as non-member function of a class then we would have to pass two arguments for each operand as follows:
Box operator+(const Box&, const Box&);
Following is the example to show the concept of operator over loading using a member function. Here an object is passed as an argument whose properties will be accessed using this object, the object which will call this operator can be accessed using this operator as explained below:

#include <iostream>
using namespace std;

class Box
{
   public:

      double getVolume(void)
      {
         return length * breadth * height;
      }
      void setLength( double len )
      {
          length = len;
      }

      void setBreadth( double bre )
      {
          breadth = bre;
      }

      void setHeight( double hei )
      {
          height = hei;
      }
      // Overload + operator to add two Box objects.
      Box operator+(const Box& b)
      {
         Box box;
         box.length = this->length + b.length;
         box.breadth = this->breadth + b.breadth;
         box.height = this->height + b.height;
         return box;
      }
   private:
      double length;      // Length of a box
      double breadth;     // Breadth of a box
      double height;      // Height of a box
};
// Main function for the program
int main( )
{
   Box Box1;                // Declare Box1 of type Box
   Box Box2;                // Declare Box2 of type Box
   Box Box3;                // Declare Box3 of type Box
   double volume = 0.0;     // Store the volume of a box here
 
   // box 1 specification
   Box1.setLength(6.0); 
   Box1.setBreadth(7.0); 
   Box1.setHeight(5.0);
 
   // box 2 specification
   Box2.setLength(12.0); 
   Box2.setBreadth(13.0); 
   Box2.setHeight(10.0);
 
   // volume of box 1
   volume = Box1.getVolume();
   cout << "Volume of Box1 : " << volume <<endl;
 
   // volume of box 2
   volume = Box2.getVolume();
   cout << "Volume of Box2 : " << volume <<endl;

   // Add two object as follows:
   Box3 = Box1 + Box2;

   // volume of box 3
   volume = Box3.getVolume();
   cout << "Volume of Box3 : " << volume <<endl;

   return 0;
}
When the above code is compiled and executed, it produces the following result:
Volume of Box1 : 210
Volume of Box2 : 1560
Volume of Box3 : 5400

Overloadable/Non-overloadableOperators:

Following is the list of operators which can be overloaded:

+
-
*
/
%
^
&
|
~
!
,
=
<
>
<=
>=
++
--
<<
>>
==
!=
&&
||
+=
-=
/=
%=
^=
&=
|=
*=
<<=
>>=
[]
()
->
->*
new
new []
delete
delete []
Following is the list of operators, which can not be overloaded:
::
.*
.
?:

Operator Overloading Examples:

Here are various operator overloading examples to help you in understanding the concept.
S.N.
Operators and Example
1
Unary operators overloading
2
Binary operators overloading
3
Relational operators overloading
4
Input/Output operators overloading
5
++ and -- operators overloading
6
Assignment operators overloading
7
Function call () operator overloading
8
Subscripting [] operator overloading
9
Class member access operator -> overloading

When and why to use method overloading 
Use method overloading in situation where you want a class to be able to do something, but there is more than one possibility for what information is supplied to the method that carries out the task.
You should consider overloading a method when you for some reason need a couple of methods that take different parameters, but conceptually do the same thing.


Runtime Time Polymorphism

Runtime time polymorphism is done using inheritance and virtual functions. Method overriding is called runtime polymorphism. It is also called late binding.

When overriding a method, you change the behavior of the method for the derived class. Overloading a method simply involves having another method with the same prototype.

Caution: Don't confused method overloading with method overriding, they are different, unrelated concepts. But they sound similar.

Method Overriding:

Whereas Overriding means changing the functionality of a method without changing the signature. We can override a function in base class by creating a similar function in derived class. This is done by usingvirtual/override keywords.

Base class method has to be marked with virtual keyword and we can override it in derived class usingoverride keyword.

Derived class method will completely overrides base class method i.e. when we refer base class object created by casting derived class object a method in derived class will be called.


The word polymorphism means having many forms. Typically, polymorphism occurs when there is a hierarchy of classes and they are related by inheritance.
C++ polymorphism means that a call to a member function will cause a different function to be executed depending on the type of object that invokes the function.
Consider the following example where a base class has been derived by other two classes:
#include <iostream> 
using namespace std;
 
class Shape {
   protected:
      int width, height;
   public:
      Shape( int a=0, int b=0)
      {
         width = a;
         height = b;
      }
      int area()
      {
         cout << "Parent class area :" <<endl;
         return 0;
      }
};
class Rectangle: public Shape{
   public:
      Rectangle( int a=0, int b=0)
      {
        Shape(a, b); 
      }
      int area ()
      { 
         cout << "Rectangle class area :" <<endl;
         return (width * height); 
      }
};
class Triangle: public Shape{
   public:
      Triangle( int a=0, int b=0)
      {
        Shape(a, b); 
      }
      int area ()
      { 
         cout << "Triangle class area :" <<endl;
         return (width * height / 2); 
      }
};
// Main function for the program
int main( )
{
   Shape *shape;
   Rectangle rec(10,7);
   Triangle  tri(10,5);

   // store the address of Rectangle
   shape = &rec;
   // call rectangle area.
   shape->area();

   // store the address of Triangle
   shape = &tri;
   // call triangle area.
   shape->area();
   
   return 0;
}

When the above code is compiled and executed, it produces the following result:
Parent class area
Parent class area

The reason for the incorrect output is that the call of the function area() is being set once by the compiler as the version defined in the base class. This is called static resolution of the function call, orstatic linkage - the function call is fixed before the program is executed. This is also sometimes calledearly binding because the area() function is set during the compilation of the program.

But now, let's make a slight modification in our program and precede the declaration of area() in the Shape class with the keyword virtual so that it looks like this:

class Shape {
   protected:
      int width, height;
   public:
      Shape( int a=0, int b=0)
      {
         width = a;
         height = b;
      }
      virtual int area()
      {
         cout << "Parent class area :" <<endl;
         return 0;
      }
};

After this slight modification, when the previous example code is compiled and executed, it produces the following result:
Rectangle class area
Triangle class area

This time, the compiler looks at the contents of the pointer instead of it's type. Hence, since addresses of objects of tri and rec classes are stored in *shape the respective area() function is called.
As you can see, each of the child classes has a separate implementation for the function area(). This is how polymorphism is generally used. You have different classes with a function of the same name, and even the same parameters, but with different implementations.

Virtual Function:

A virtual function is a function in a base class that is declared using the keyword virtual. Defining in a base class a virtual function, with another version in a derived class, signals to the compiler that we don't want static linkage for this function.
What we do want is the selection of the function to be called at any given point in the program to be based on the kind of object for which it is called. This sort of operation is referred to as dynamic linkage, or late binding.

Pure Virtual Functions:

It's possible that you'd want to include a virtual function in a base class so that it may be redefined in a derived class to suit the objects of that class, but that there is no meaningful definition you could give for the function in the base class.
We can change the virtual function area() in the base class to the following:

class Shape {
   protected:
      int width, height;
   public:
      Shape( int a=0, int b=0)
      {
         width = a;
         height = b;
      }
      // pure virtual function
      virtual int area() = 0;
};
The = 0 tells the compiler that the function has no body and above virtual function will be called pure virtual function.

More discuss about virtual function in virtual blog.