Friday, January 15, 2010

Path to Microsoft Certification for programmers

Path-To-Microsoft-Certification-MCTS
In university days I once tried to follow path to Sun Java Certified Programmer. On their web site I found very nice flow charts. For Microsoft's certification I could not find anything of this sort therefore I decided to collect data from Microsoft's web and create my own Microsoft Certification Tree diagram.










Everything seems to be starting from Exam 70-536: TS: Microsoft .Net Framework, Application Development Foundation. We will get MCTS after passing two exams, and MCPD after passing third exam of next stage.
Update: Everything still starts from Exam 70-536.

History of vendor certifications

Once upon a time these certification were the thing of the day. Small institutes would show sweet dreams to jobless young people and tell them that an MCSE can get them a job, or a visa to the USA.
The certifications became pretty useless with the introduction and popularity of dums, people would just spend a couple days learning the dumps by rote and pass certification exams with excellent score.

The certifications were not made to withstand such abuse(but Indians you know rape anything feminine they come across, or at least they try to). Various international bodies shut their certification and examination tracks in many countries. Comptia A+ for example, was a hardware professional certification which was sacked despite its popularity from many developing countries.

Certifications are totally useless?

The short answer is No. If someone prepares well for a certification and studies well; passing a certification will result in significant increase in knowledge about specific technology(ies).
There are still several great certifications out there by top companies like Cisco, Microsoft, Oracle, Zend.
Technology certifications are not an alternative to proper bachelors degree, they augment your graduate studies instead. Just like FCPS is not an alternative to MBBS, it is an additional qualification that makes medical professionals better in their job.

Tuesday, June 9, 2009

std::ostringstream AKA String Streams...

Want to share a few bits about a very important and useful feature of standard library today. std::ostringstream can come in handy in many situation. You know we often need to concatenate strings. And often it becomes tedious, usually this is done using strcat funtion in C and + operator in C++  std::string class . For example

// C style

char * szFullName = strcat("First Name ", " Last Name");


//C++ style
std::string strFirstName = "First Name";
std::string strLastName = "Last Name";
std::string strFullName = strFirstName + " " + strLastName;

std::ostringstream gives us a convenient way to build strings conveniently.
std::ostringstream provides functionality very much similar to sprintf function of C language.

Like for example you got names, ages, and heights of a few kids stored in arrays and you want them to be printed nicely on screen. Perhaps you could use a std::string and + operator to join string but I think using ostringstream will be a better approach.

Preview (hint: you can copy and paste the preview into Microsoft Word):
const int CONST_ARRAY_SIZE = 3;
std::string aryStrNames[CONST_ARRAY_SIZE] = {"Ali", "Jason", "Shiv"};
int aryNAges[CONST_ARRAY_SIZE] = {5,9,11};
float aryFHeight[CONST_ARRAY_SIZE]={3.2,4.0,4.4};
std::ostringstream outBuffer;
for(int i = 0; i < CONST_ARRAY_SIZE; i++){
outBuffer<<aryStrNames[i]<" is " << aryNAges[i] << " years old, and his height is "<< aryFHeight[i] << endl;
}// end for i
cout<< outBuffer.str();

Here's a link to ostringstream on C Plus Plushttp://www.cplusplus.com/reference/iostream/ostringstream/



Tuesday, March 17, 2009

Working with std::string::substring() method

Though it is a very simple function, but sometimes people(me too) make a mistake when coding thing up. For example we have a std::string strHello

int nPositoinOfSemiColon = strHello.find(";", 0);

find method will find the fist parameter ";" in strHello, starting from second parameter i.e. 0.
Now the nPositoinOfSemiColon will contain either string::npos which means the string provided to find method was not found in strHello. Or in our case, 5 which is the location of ";".

strHello.substr(0, nPositoinOfSemiColon );

will return "Hello", i.e. 5 characters starting from location 0 in strHello.
Now consider

int nPositionOfSecondSemiColon = strHello.find(";", nPositionOfSemiColon);

Well... writing following line of code will... wonder what...

strHello.substr(nPositionOfSemiColon, nPositionOfSecondSemiColon);

CAUSE AN ERROR!!! FOLKS!!! ERR GRR ERROOORRR... a vicious cruel ugly error... heh heh heh...
Poor baby programmers will asK "But why Uncle why???"
Because, of the values in variables at this time are...

nPositionOfSemiColon = 5
AND
nPositionOfSecondSemiColon = 11
That means
strHello.substr(5, 11);

i.e. extract 11 characters starting from location 5 in strHello.
Whereas, 11 is total length of strHello...

The right way to go is

strHello.substr(nPositionOfSemiColon,
nPositionOfSecondSemiColon - nPositionOfSemiColon);

That means
strHello.substr(5, 6); // That means ";WORLD"

Cheers folks... have fun... remember... coding is a noble pursuit... so just keep hitting it hard... savor the wonders and joys of turning real world into programming language codes, and bear the tensions with enough tolerance...

More C/C++ Interview Questions

I was keeping this post on hold for almost a month, so that I will post the questions along with the answers... but due to some reasons, I was unable to post the answers...
Will do it some time later in future...
For the time being, the C/C++ interview questions are given below...
If anybody finds out an answer, feel free to write it in comments...

1. What is the difference between a pointer and array?
2. Is it possible to find out the size of an array?
3. What is NULL?
4. How can we find if a pointer contains a valid value or not?
5. We have a circular linked list, and its tail -> next is not pointing to List -> Head. How can we diagnose such an error condition?

Monday, March 9, 2009

A tricky error, when using std::string with *printf funtions

All of us know what this code (listing 1)will do...

char * szName = "Ex";

printf("%s", szName );

Will anybody tell what will be the result of these lines(listing 2)...


std::string strName = "Zed";
printf("%s", strName);

Ladies and gentlemen... listing two will cause your program to crash. This is a very common mistake made by programming newbies... though an experienced pro may also do the same...

The right way to print the string is

std::string strName = "Zed";

printf("%s", strName.c_str());

such errors are very difficult to spot... Because when reading the code, one often unconsciously considers these lines are correct...

Now people will ask that why in the world will someone create such a ridiculous blend of C and C++... The answer is... I don't know why... But anybody is absolutely free to mix the two compatible languages into a cocktail... I myself did this... when I was new into the dark realm of C/C++ programming... I had my own reasons... others will have their own...

note: *printf means any of the following funtion calls {printf, sprintf, fprintf}