Tag Archives: C++

My view on Credit Cards: from both sides

(Update 23Apr09) It seems Obama administration is going to make credit card more consumer friendly (marketWatch). So are they going to socialize the credit card: I mean, you and me (i.e., honest guys) pay the credit cards on time each month, will bail out the deadbeats, after we bailed out the Wall Street ??? We know the credit card companies (the wall street) are not charities. This thing looks more like dumber and dumber.

(Original) Yesterday I mentioned credit card when talking about recurring revenue. Credit card is the live blood of our consumer society. Like commerical paper for business, we (consumers) use (more precisely borrow from) credit card for our daily purchases. At the end of each billing period, we either pay off the whole balance or pay the minimum payment (not recommended from personal finance perspective, but so many people do this nowadays. The customers who carry balance (and pay >10% interest) also contribute the profit of credit card companies. But it appears now credit card companies started to upset their best customrers, amid the credit crisis.

Business
American Express (NYSE: AXP) and Citibank (NYSE: C) pay customer to go away

JP Morgan Chase (NYSE: JPM) charged monthly fee to customers, then gave refund under pressure from NY AG Cuomo (CNN Money story).

Continue reading My view on Credit Cards: from both sides

Dumb C++ Mistakes

It seems like I don’t have anything to do with C++ because I have not touched C++ much in this blog. I am a software engineer by trade; programming and debugging is a large part of what I do during the day. I was a little frustrated last two days by a memory problem shown only on UNIX. The program ran fine on Windows, except one or two instances slightly weird results which I tend to ignore. But I could not pass the UNIX test and obviously something is wrong. By looking at the trace back I can tell it’s a memory problem. Memory problem is kind of problem everyone hates. Because it’s usually hard to find the root cause. Dev Partner made the process a little easier because it will show all potential memory overrun and leaks. To my surprise, I made a mistake like the following (very basic C++ mistakes):

char *temp_str = new char[length]; 

for(int ii = 0; ii < length*2; ii++){

    // do something with temp_str[ii]

}

It is a typical memory overrun problem because I only allocate "length" number of char, but I was trying to use "length*2" number of char. It's like use twice the credit limit?

But I am still very puzzlled that my program ran on Windows (without Dev Parter) before the fix. No wonder we see "Windows crash" from time to time 🙂

Seriously, in software development we want the problems being uncovered the earlier, the better. Because we don't want our customer run our program and crash.