Wednesday, March 30, 2005

Lessons from economics

Katie sent me an email a few months back that she thought I would enjoy. It is titled The Entrepreneur As American Hero.

Professor Walter E. Williams discusses how free market forces benefit the average consumer and finishes up with what he calls Williams' Law.
Whenever the profit incentive is missing, the probability that people’s wants can be safely ignored is the greatest. If a poll were taken asking people which services they are most satisfied with and which they are most dissatisfied with, for-profit organizations (supermarkets, computer companies and video stores) would dominate the first list while non-profit organizations (schools, offices of motor vehicle registration) would dominate the latter. In a free economy, the pursuit of profits and serving people are one and the same. No one argues that the free enterprise system is perfect, but it’s the closest we’ will come here on Earth.

I completely agree. It is time we start eliminating government run schools.

Saturday, March 26, 2005

Free Boxes from USPS

I'm visiting my folks and my mother just received a shipment of boxes that she ordered from the USPS. She has been selling items on eBay and needed some boxes to ship the items. Turns out she was able to order the boxes from the USPS for free with free delivery. The same boxes that you pay for at the post office you can get for free. Here is the link.

Update: Just noticed that the link does not work. To find the items just search for supplies.

Friday, March 18, 2005

if wallet || purse stolen then ...

I received an email from my Mortgage broker (Accutira) today. It had some good advice that I would like to share.

A number of years ago Misty was a victim of identity theft. Some lady in North County decided to use Misty's identity to buy a Sprint phone, go on a shopping spree at Home Depot (or maybe it was HQ, don't remember and it doesn't matter), and others. We found out about it when a collection agency called. It was a nightmare.

Anyway here is the advice...

We've all heard horror stories of fraud committed when a name, credit card, address, and/or social security number is stolen. Here's the information you need should it happen to you or someone you know.

First... photo copy everything you carry in your wallet. When the time comes and you do have to cancel your cards, you'll have the account numbers and phone numbers to contact immediately. Keep this in a secure place you can get access to easily.

Second... file a police report immediately in the jurisdiction where it was stolen. This proves to credit providers that you were diligent and is a first step toward any investigation if there is one.

Third (and most important)...Call the three national credit reporting agencies immediately and place a fraud alert on your name and social security number. The alert means that any company that checks your credit knows your information was stolen and they have to contact you by phone to authorize new credit.

The numbers to report fraud to the big 3 are:

Equifax 800.525.6285
Experian 888.397.3742
Trans Union 800.680.7289

The fraud line for the Social Security Administration is 800-269-0271.

Ansi C++ Spec Quote

I was looking up a question for Dan about explicit template specialization in the ANSI C++ Spec and noticed the following:

When writing a specialization, be careful about its location; or to make it compile will be such a trial as to kindle its self-immolation.

Tuesday, March 08, 2005

C++ Test Coverage

I've been working on additional functional tests this week for my current project. Dan was working with me this morning when he asked about C++ test coverage tools. I have never used one for C++, so we did the obvious thing and googled for it.

Turns out that gcc comes with gcov.

1) Add the following option to the environment.

export CPPFLAGS="-fprofile-arcs -ftest-coverage"

2) Compile as normal
3) Run your tests.
4) gcov -l -c FileName.cpp
5) vi FileName.cpp.gcov and search for "######"

"######" indicate lines that were never executed.

It is simple and easy to use.

Here is an example of the output of gcov:

11: 9: for (i = 0; i < 10; i++)
10: 10: total += i;
-: 11:
1: 12: if (total != 45)
#####: 13: printf ("Failure\n");
-: 14: else
1: 15: printf ("Success\n");

Line #13 above was never executed. Line #9 was executed 11 times. You can also have it output percentages.