Some rules of thumb and tips re: tipping:
Double the sales tax in most states to calculate tip.
Tip waiters who help you with takeout...they're not on significant salary regardless of how they're helping/serving you.
Tip delivery people a ton. You'll get your food faster (and hotter/fresher) next time.
Never stiff a waiter without explaining to a manager why you are doing so. And never stiff a waiter for a problem that was outside their control (kitchen problems, seating problems, etc). If you stiff waiters more than about once per year, the problem might be more with you than with them!
Corollary to above: if the manager or maitre d' is sympathetic and helpful to your complaint, tip HIM the amount you'd have tipped the waiter. It will add emphasis to your complaint against the waiter, showing you're not simply a cheapskate.
If the restaurant comps you on any item, include the value of that item in calculating your waiter's tip.
Always try to hand the tip personally to your waiter. Many places pool tips, but some do not, and this way you'll be sure they actually get it (rather than the busboy or manager).
Corollary to above: customers do steal tips. Don't leave a tip on the table unless you've made eye contact with the waiter as you go, so they know the money's sitting out.
Resist the urge to throw forks and knives at waiters who ask "do you you need change?" as they accept the twenty with which you pay your $12 check.