Monthly Archives: November 2007

How to make money from telemarketers (or just annoy them)

My father-in-law is absolutely fed up with telemarketers calling. But rather than just hang up on them, why not try to get some money out of them? So he made a recording, to be played next time he gets a call:

Listen to this recording he made.

Ok, it’s a long shot, but I think it’s hilarious. If it works, he can take himself off the Do Not Call Registry!

Technorati Tags: ,


Check out my latest book, the essential, in-depth guide to performance for all .NET developers:

Writing High-Performance.NET Code, 2nd Edition by Ben Watson. Available for pre-order:

Cell phones, water and wireless mice

I’m embarrassed to say that the link took me a long time to figure out. If you’re wireless mouse or keyboard is having connection problems, signal weaknesses, or similar signs of problems, make sure your cell phone isn’t anywhere around them!

I did this at work for a long time–it screwed up the signal strength, and caused weird problems like dropped keys, stuck CAPS, and more.

I have also noticed signals getting screwed up when I had a Nalgene bottle full of ice water sort-of between the keyboard and wireless receiver.

Technorati Tags: , , , ,


Check out my latest book, the essential, in-depth guide to performance for all .NET developers:

Writing High-Performance.NET Code, 2nd Edition by Ben Watson. Available for pre-order:

Easily Getting Last Two Digits of Year

This is an easy one, but some people don’t know it: if you need the last two digits of a year, say 2007, it’s very easy to get, without converting to a string and getting the last two characters:

 

int lastTwo = year % 100;

Now that you know, it’s obvious, right?

And if you want the last three digits? number % 1000. In general:

int lastN = number % (pow(10, digitsRequired));

What about first N digits? similarly easy:

 

int firstTwo = number / 100;
int firstN = number / pow(10,digitsRequired);

 
Now  you know, and knowing if half the battle.

Check out my latest book, the essential, in-depth guide to performance for all .NET developers:

Writing High-Performance.NET Code, 2nd Edition by Ben Watson. Available for pre-order:

The War on Being Different

Bruce Schneier has a wonderful essay on his site today about how our culture of fear of harmless people and objects is being propagated. I think this is my favorite essay of his.

I really like this paragraph about how this happens:

Watch how it happens. Someone sees something, so he says something. The person he says it to — a policeman, a security guard, a flight attendant — now faces a choice: ignore or escalate. Even though he may believe that it’s a false alarm, it’s not in his best interests to dismiss the threat. If he’s wrong, it’ll cost him his career. But if he escalates, he’ll be praised for “doing his job” and the cost will be borne by others. So he escalates. And the person he escalates to also escalates, in a series of CYA decisions. And before we’re done, innocent people have been arrested, airports have been evacuated, and hundreds of police hours have been wasted.

Please go read the full article and digg it, spread it around, especially to influential people you may know. It’s ridiculous, the things people are harassed for these days.

Technorati Tags: , ,


Check out my latest book, the essential, in-depth guide to performance for all .NET developers:

Writing High-Performance.NET Code, 2nd Edition by Ben Watson. Available for pre-order: