April 2013

Death, Numbers, and Risk

Here are some numbers that many people don't know, or don't want to think about:

There are approximately 6.9 billion people in the world. On average,

  • about 55 million people die each year,
  • about 1.05 million people die each week,
  • about 151,000 people die each day,
  • about 6280 people die each hour, and
  • about 105 people die each minute.

Source: Wolfram Alpha

There are approximately 309 million people in the US. On average,

  • about 2.5 million people die in the US each year,
  • about 48,000 people die in the US die each week,
  • about 6860 people die in the US each day,
  • about 286 people die in the US each hour, and
  • more than 4 people die in the US each minute

Source: Wolfram Alpha

In round numbers, that's over 150,000 people dying every day, and almost 7,000 people dying in the US every day.

Many of these deaths are those of elderly people passing away in their sleep. Many are unmourned. But many are tragedies in the sense that a person has died too young, and grieving people are left behind.

So, when the news presents reports of people dying, ask yourself: Why is the news reporting these deaths, and not the 150,000 other deaths that happened today around the world, or the 7,000 other deaths that happened today in the US?

Is it because the reported deaths are more important than all the others, or is it because somebody found a way to make dramatic stories out of these particular deaths? Are the reported deaths indicative of larger patterns or important trends, or are they interesting because they happened in a public place and there is video available from several angles?

In fact, your chance of being killed by a terrorist or a mass shooter or an airplane crash or flesh-eating bacteria or a meteor or anything else reported by the media is almost equal to zero. These events are reported on the evening news because they are so rare.

So be careful about letting what you see on the news control your fears.

It is silly to worry about terrorists and mass shooters if you smoke cigarettes, eat a lot of fast food, or use your mobile phone while driving. The latter activities could kill you; the former just don't happen often enough for any reasonable person to worry about them.

You might want to turn your home into an armed fortress to protect your family from dangerous people. Before you do that, you should ensure that your family is eating healthy meals, getting lots of exercise, and getting regular medical checkups. You are more likely to save somebody's life by learning CPR and First Aid techniques than by learning martial arts or small-arms tactics. Make sure all the smoke detectors have fresh batteries before you worry about installing a high-tech security system.

When someone asks you to pray for the victims of some tragic event, ask why you should pray just for them, and not for the one million people who died in other ways that week, or for the million that died the previous week, or for the million who will die the following week.

When somebody tells you that thousands of people are killed every year by some disease or government policy or widespread moral failing, and insists that drastic measures are justified to prevent those deaths, think about the 2.5 million Americans who die of other causes every year. If someone claims that a new law or policy is worthwhile "even if it saves only one child", consider whether resources might be better devoted to policies that save hundreds, thousands, or millions of children instead of just one.

I'm not suggesting that we do nothing to try to prevent deaths, or that we should not care when strangers die. If you can save one person's life, you have done more good than most people will ever do. I'm just suggesting that you remember the bigger picture.

With billions of people in the world, it will always be easy to find instances of evil people doing horrible things, and of innocent people dying in tragic circumstances. But remember, while around 150,000 people die every day, a larger number are born, and billions of people just go on living.

Your chances of making it through the day are pretty good.

Home Depot Two-Year Replacement Plan Doesn't

When I bought a Yard Machines lawn mower from Home Depot last year, I paid for a 2-year repair/replacement plan. I'm pretty sure the plan was presented to me with language like "If it stops working, you just bring it back and we'll replace it." I've had some bad luck with lawn equipment, and the price wasn't high, so it seemed like a good deal.

This year, the mower won't start. So I try to get Home Depot to repair or replace it. Home Depot's response is that the product is covered by a manufacturer's warranty, so I must get service from the manufacturer. The website helpfully tells me that I can contact the manufacturer by calling "$MFR_PHONE$". (That's verbatim.)

So Home Depot's repair/replacement plan was literally worthless. Lesson learned.

I contact the Yard Machines warranty service. They say that their warranty doesn't cover the engine. The engine is covered by the engine's manufacturer (Briggs & Stratton).

Yard Machines provides a warranty that doesn't cover the engine? Isn't a lawn mower just an engine attached to a blade and wheels? It's as if a warranty for a computer didn't cover any of the electronics.

So I go to the Briggs & Stratton website. It says I can get warranty service by an Authorized Briggs & Stratton Dealer in my area. I enter my zip code. Results: No dealers found.

And so now I have to wonder how many more hours I want to spend trying to get this thing fixed. Probably easier to either hire a lawn-mowing service, figure out how to fix it myself, or buy a new mower. But not from Home Depot.

To sum up, here are recent additions to my Shit List:

  • Home Depot
  • Yard Machines
  • Briggs & Stratton

Finding the Answers

Episode #45 of the Stack Exchange podcast featured Eric Lippert, who got some great advice from his first manager at Microsoft:

I want you to be a recognized industry expert on something. ... But don't pick something that's too big. ... Find a source of questions, answer every question that you know the answer to that is in that domain, and if there is a question that you not know the answer to, make it your business to find out.

This is why Eric Lippert answers so many Stack Overflow questions.

This is why everyone should be answering more questions and sharing their expertise. It makes you better at what you do.

iOS and Android Icon Sizes

Every once in a while, I have to tell a graphic designer all the sizes needed for iOS and Android icons. So I'm putting together a summary here for easy reference.


For more details on requirements and guidelines for iOS app icons, see iOS Human Interface Guidelines: Icons and Image Sizes and Technical Q&A QA1686: App Icons on iPad and iPhone.

All icons must be in PNG format with 24-bit color.

App Icons

For an app for iOS 7 and later, we need icon image files in these sizes:

  • 1024 x 1024
  • 512 x 512
  • 228 x 228
  • 180 x 180
  • 152 x 152
  • 120 x 120
  • 87 x 87
  • 80 x 80
  • 76 x 76
  • 58 x 58
  • 40 x 40
  • 29 x 29
  • 144 x 144 (if supporting iOS 6.1 or earlier)
  • 114 x 114 (if supporting iOS 6.1 or earlier)
  • 100 x 100 (if supporting iOS 6.1 or earlier)
  • 72 x 72 (if supporting iOS 6.1 or earlier)
  • 57 x 57 (if supporting iOS 6.1 or earlier)
  • 50 x 50 (if supporting iOS 6.1 or earlier)

iOS icons are opaque. Note that iOS will automatically round the corners and add the glossy shine effect when it displays the icon. You may want to pre-render the shine effect if you want more control over how it looks.

Toolbar, Navigation Bar, and Tab Bar Icons

  • Use pure white and transparent regions
  • Do not include a drop shadow
  • Use anti-aliasing

For toolbar and navigation bar icons, create images with these sizes:

  • 22 x 22
  • 44 x 44 (high resolution)

For tab bar icons, create images with these sizes:

  • 25 x 25
  • 50 x 50 (high-resolution)

For each toolbar, navigation bar, or tab bar icon, you may provide a single image, which iOS will treat as a template to generate unselected and selected appearances, or you may provide two images: one for the unselected appearance and another for the selected appearance.

Note that the sizes given for toolbar, navigation bar, and tab bar icons here are approximate. Images may be slightly larger or slightly smaller than these sizes. Give all icons in a bar a similar visual weight.

Apple Watch Icons

If the iOS app includes an Apple Watch app, the following icons are needed:

Notification Center Icons

  • 29 x 29 (38mm watch)
  • 36 x 36 (42mm watch)

Long Look Notification Icons

  • 80 x 80 (38mm watch)
  • 88 x 88 (42mm watch)

Home Screen Icon and Short Look Icon

  • 172 x 172 (38mm watch)
  • 196 x 196 (42mm watch)

Menu Icons

  • 70 x 70, with content size 46 x 46 (38mm watch)
  • 80 x 80, with content size 54 x 54 (42mm watch)

Watch Companion Icons

  • 58 x 58
  • 87 x 87


App Icons

For an Android app launcher icon, we need PNG image files in these sizes:

  • 512 x 512 (Google Play)
  • 144 x 144 (xxhdpi)
  • 96 x 96 (xhdpi)
  • 72 x 72 (hdpi)
  • 48 x 48 (mdpi)

Note that Android app icons don't have to be square: the alpha channel can be used to create transparent areas, so an icon should have a distinct silhouette.

If the app generates notifications, then we need a 24 x 24 icon image. Notification icons must be entirely white except for transparent regions.

For more details on requirements and guidelines for Android app icons, see Launcher Icons and Iconography

Action Bar Icons

  • 96 x 96 (xxhdpi)
  • 64 x 64 (xhdpi)
  • 48 x 48 (hdpi)
  • 32 x 32 (mdpi)

Small/Contextual Icons

  • 48 x 48 (xxhdpi)
  • 32 x 32 (xhdpi)
  • 24 x 24 (hdpi)
  • 16 x 16 (mdpi)

Notification Icons

  • 72 x 72 (xxhdpi)
  • 48 x 48 (xhdpi)
  • 36 x 36 (hdpi)
  • 24 x 24 (mdpi)

REST Client Testing for Google Chrome

After years of using curl to test web interfaces, like cavemen did, I've finally started using more sophisticated tools.

There are a couple of applications for Google Chrome that I like:

They have similar feature sets. Postman is prettier and a bit easier to use, but Advanced Rest Client makes it easier to manipulate the response data.