Older blog entries for apenwarr (starting at number 363)

2008-01-07: More biases

More biases

I've written several times before about different kinds of statistical biases. I care a lot about that since, next to actual incorrect facts, the most common source of wrong decisions seems to be a misguided use of so-called statistics.

Here are two great articles about bias. The first is about the Anchor Bias:

    They spun a roulette wheel and when it landed on the number 10 they asked some people whether the number of African countries was greater or less than 10 percent of the United Nations. Most people guessed that estimate was too low. Maybe the right answer was 25 percent, they guessed.

    The psychologists spun their roulette wheel a second time and when it landed on the number 65, they asked a second group whether African countries made up 65 percent of the United Nations. That figure was too high, everyone agreed. Maybe the correct answer was 45 percent.

Isn't that amazing?

I claim, by the way, that people like Ayn Rand and Richard Stallman *have* to exist simply because they help de-anchor-bias others. "100% of software should be free?! Holy cow, you're crazy. Maybe more like 90%."

Meanwhile, Peter Norvig, who is (if I understand correctly; I'm offline as I write this) one of the Google researchers working on their PageRank statistics, wrote a great article about different kinds of bias in both experimental design and the interpretation of results.

It's long, but scroll down to section I4 and find the surprising answer to this question (via Eliezer Yudowsky):

    1% of women at age forty who participate in routine screening have breast cancer. 80% of women with breast cancer will get positive mammograms. 9.6% of women without breast cancer will also get positive mammograms. A woman in this age group had a positive mammography in a routine screening. What is the probability that she actually has breast cancer?

It is not a trick question, but my answer was completely wrong. Think about it, then follow the link and check your answer in section I4.

Syndicated 2008-01-03 23:19:36 from apenwarr - Business is Programming

2008-01-05: Welcome to 2008, Part 3: Environmentalism Update

Welcome to 2008, Part 3: Environmentalism Update

Please note the following changes in environmental terminology. Remember, if you get these mixed up, you'll look old-fashioned.

We used to refer to "the hole in the ozone layer." This hole was reputedly caused by certain chemicals (like our dear departed otherwise-non-toxic freon, now replaced by mildly toxic alternatives) which, when released into the atmosphere, would bind with ozone particles and take them out of circulation. The ozone layer is responsible for "absorbing" certain kinds of dangerous radiation from the sun and turning them into "harmless" heat.

At the same time, there were warnings about an excess of "greenhouse gases" and the related problem of acid rain. At the time, the majority of activism was toward reducing emissions of various nasty particles like carbon monoxide, methane, and sulphur. Natural Gas was described as the "clean alternative fuel", because all it releases (when burned efficiently) is carbon dioxide.

Greenhouse gases work like this: the sun's radiation is partly absorbed by the earth, and partly reflected back. Greenhouse gases tend to absorb more of the reflected light, trapping it in the atmosphere instead of letting it escape, thus increasing the temperature.

Ironically, ozone is a greenhouse gas. The "hole in the ozone layer" prevents certain types of radiation from being absorbed and safely converted into harmless heat. Other greenhouse gases absorb other wavelengths of radiation, converting it into dangerous heat. Got it? Good.

We don't talk about the ozone layer or greenhouse gases anymore. Instead, we talk about "carbon emissions," by which we mostly mean "carbon dioxide emissions." Carbon dioxide is what you produce when you breathe. After you clean up your artificial pollution-spewing devices, carbon dioxide is pretty much all that comes out. Other than its contribution as a greenhouse gas, it is harmless.

So the question is: why do we hear so much now about "carbon emissions" instead of "greenhouse gases" in general, or acid rain, or the ozone layer? Is it good news, and the other problems are mostly solved? Or do we as a society just fixate randomly on the most recent problem that someone famous has made a movie about?

Syndicated 2008-01-03 23:19:35 from apenwarr - Business is Programming

2008-01-04: A thinly veiled rant

A thinly veiled rant

Some of the best advice I've ever heard was ostensibly to women about dating, but applies equally to everybody and all their relationships.

If you want to know how a person will treat you once he gets to know you, look at how he treats other people. If you want to know how someone talks about you behind your back, look at how he talks to you about other people.

It's really as simple as that, in life or in business. Don't ignore the signs. Sometimes understanding people is so easy that you can't believe what's obviously true is true.

Syndicated 2008-01-03 22:57:48 from apenwarr - Business is Programming

3 Jan 2008 (updated 3 Jan 2008 at 19:03 UTC) »

2008-01-03: Welcome to 2008, Part 2: Dietary Information

Welcome to 2008, Part 2: Dietary Information

Please note the recent important changes in dietary advice.

Red meats, which were previously associated with high blood pressure leading to heart conditions, are now okay. It's carbohydrates that are bad. Eat meat, but leave the potatoes at home.

Note that milk no longer "does a body good." In fact, it is now widely believed that people over the age of about 5 years lack the enzymes to digest it properly.

Corn syrup is not, apparently, at the heart of the American obesity problem. This and other exciting "facts" ("Contrary to its name, high fructose corn syrup is not high in fructose") can be found at the Corn Syrup Website.

Saturated fats, the so called "bad" fats that are found in various greasy things like the no-longer-evil red meat, are no longer anything to worry about. Well, maybe they are, but we don't worry about them, because...

"Trans" fats must certainly be much worse, as evidenced by the large number of food packages which now proclaim that they don't contain any. Nobody knows what trans fats are or if they even exist, but because your favourite foods don't contain them, you should feel secure. Phew.

Update: My dad sends this critical additional information:

Syndicated 2007-12-30 20:02:43 (Updated 2008-01-03 19:03:36) from apenwarr - Business is Programming

2008-01-01: Welcome to 2008

Welcome to 2008

I am now officially part of the "previous" generation of programmers. I know this because the new generation no longer has "vi vs. emacs" editor wars, while mine still does.

The new generation's wars are vi/emacs vs. IDEs.

Carry on then.

Syndicated 2007-12-28 20:21:10 from apenwarr - Business is Programming

2007-12-21: Thread-free coroutines in C# 3.0

Thread-free coroutines in C# 3.0

As I suspected, C# 3.0 has everything we need to accomplish a clone of WvCont from WvStreams in C++. It took a bit of fiddling to figure it out, but the final answer is simple and elegant.

The code below shows a ToAction() extension method that lets you convert any iterator into an Action, so that anywhere a "normal" callback is expected, you can provide a coroutine instead.

We do some non-obvious tricks with variable scoping in ToAction(), but that only has to be written once. The syntax for *using* it is simple.

using System;
using System.Collections;
using System.Linq;

public static class Example { public static Action ToAction(this IEnumerable aie) { bool must_reset = false; IEnumerator ie = aie.GetEnumerator(); return new Action(delegate() { if (must_reset) ie = aie.GetEnumerator(); must_reset = !ie.MoveNext(); }); }

static IEnumerable demofunc(string prefix, int start, int end) { for (int i = start; i

And the output looks like this:

 *   : 1
   * : 100
 *   : 2
   * : 101
 *   : 3
   * : 102
   * : 103
 *   : 1
   * : 104
 *   : 2
   * : 105
 *   : 3
   * : 106
   * : 107
 *   : 1
   * : 108
 *   : 2
   * : 109

The above program requires Mono 1.2.6 or higher (compile with "-langversion:linq") in Linux, or .NET 3.5 or higher in Windows.

Syndicated 2007-12-21 03:59:23 from apenwarr - Business is Programming

2007-12-19: On the efficiency of using auto-refactoring IDEs

On the efficiency of using auto-refactoring IDEs

    Imagine that you have a tool that lets you manage huge Tetris screens that are hundreds of stories high. In this scenario, stacking the pieces isn't a problem, so there's no need to be able to eliminate pieces. This is the cultural problem: they don't realize they're not actually playing the right game anymore.

    -- Steve Yegge

Syndicated 2007-12-20 01:20:40 from apenwarr - Business is Programming

2007-12-15: In which I learn the true meaning of "unbelievable"

In which I learn the true meaning of "unbelievable"

It's after midnight. I arrive home in Montreal after a few weeks absence, to find the cheesy-overpriced fingerprint lock on my condo's door has been replaced with a hotel-style card reader lock.

I investigate more fully. *Every* lock on *every* door in the building has been replaced with a hotel-style card reader lock.

I have some problems with this:

  • It's not a rental. It's *my* @#$!#$ lock that they stole. I actually paid *extra* for the cheesy-overpriced fingerprint lock, which is precisely how I know it's overpriced.

  • The card reader lock does not have a keyhole nor a fingerprint reader, and I do not have a card to read.

  • In my mailbox, I find no notice whatsoever that this operation had been planned or executed.

  • The new lock is very poorly installed, in keeping with the shoddy construction work that has characterized this building all along. (Luckily, the contractor who *built* the place has high standards, and repeatedly sent each worker back until they did it right. So it's great work in the end. But he obviously hasn't seen this new crap yet.)
Naturally I break in (to my own home) through my *other* door, which has a perfectly normal easily pickable lock that completely defeats the purpose of the cheesy-overpriced lock I no longer have. I didn't have to pick it; since the last time, when my cheesy-overpriced lock decided it didn't want to let me in anymore, I make sure to carry a key for the perfectly normal lock with me at all times.

I come in.

Everything inside is normal.

It's the middle of the night.

I don't even know the superintendent's name.

I've lost his phone number.

It's time for bed now.

Syndicated 2007-12-15 06:14:09 from apenwarr - Business is Programming

2007-12-06: Canada: SRED Tax Credits

Canada: SRED Tax Credits

2008 may be the year when I personally change from a "cost center" to a "profit center" at my company as I help with our R&D tax credits report.

Basically, when a Canadian company employs a Canadian worker to do SR&ED - a strictly defined but wider definition than R&D - the government will pay you back somewhere around 48%-70% of the salary you paid out.

The government web site about this is a little confusing, indicating credits of more like 20%-35%, but what they *don't* say is that you weight wages by about 165% to include non-salary overhead for that employee. There are also province-specific parts that add to the total. The end result is *much* more than 20%.

Think about that. If you're a privately-held Canadian company, you can be getting back something like 70% of your R&D employee wages. It doesn't matter if you don't even turn a profit; "tax credits" means "free money," not tax writeoffs. It means that hiring Canadian developers has roughly the same cost as outsourcing development to India.

IANA (I Am Not an Accountant), please don't sue me, etc. But if you're a Canadian software company, do yourself a favour and apply for those tax credits.

Syndicated 2007-12-05 22:06:15 from apenwarr - Business is Programming

2007-12-05: Bruce Schneier on the future of security

Bruce Schneier on the future of security

Wow, it reads like sci-fi but isn't.

Syndicated 2007-12-05 21:53:02 from apenwarr - Business is Programming

354 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!