Wednesday, October 31, 2007

AVIcode experience

I have been working on a project called "EarlyTrack" for the state of Ohio in the last 8 months, and the best thing I found is the "AVICode" monitoring tool installed on the production machine.

As a developer for the last 6 years, I understand that every application will have bugs in production no matter how much you test on your test environment. But when the user complains that they have ran into an issue, it is very hard to find what exactly goes wrong because of the challenge of recreating the exactly same issue. AVICode provides the exactly solutions for this kind of issue, it intercepts the exceptions thrown by the system and records very detailed information on what exactly happened in the cod when the bugs were triggered.

The most impressive thing is that if you installed the pdb(debugging database) file alongside the released binary file, every time a bug triggers, you can double click to get to the exact line of code which failed.

I'll take some screen shots later on..

C String.

There is a good article about C String,  basically, there are two ways of declaring a string, either statically or dynamically.

  1. To declared  a string statically, we can either declare an explicit number of string length or not. 
   1: char label1[]="I am a test!";


   2: char label2[100]="I am a test!";




The length of the first string is decided by the actual string length, while the second string is explicitly declared as having the length of 100. Both of ways declare a mutable string,  which is different with char* label3="I am a test!".  The later one are essentially the same with const char* label3="I am a test!" . If you try to do something like lable3[0]='i', you will encounter an access violation error.



Here is a good link about this problem: Basically, when you declare char* label3="I am a test!".   it will be a constant string in the data section, this string constant has always the same address and is constant. You should always consider const char* label3="I am a test!"  because the former is only for backward purpose.



   2.  To declare a string dynamically, the string length has to be passed in like this char* dynamicalString=new string[length+1]. The last character is reserved for '\0', the end of string. The string length (strlen) is length, not length+1.

Thursday, October 11, 2007

Enterprise Library configuration.

A very good post on how to change the configuration of the enterprise library.