Bug Report Fallout

It seems my bug report is causing a bit of a stir within Microsoft. As Georgeo Pulikkathara writes,

This has certainly gotten the attention of folks internally wondering how come Ken didn’t use the official bug reporting system.

It’s mostly because Ken is a lazy sot. Like I wrote before, I looked around the support website for a few minutes but I couldn’t find anything resembling an “official bug reporting system”.

When I typed “report bug” into the search box it returned a link to some tips for reporting bugs in FoxPro and a plethora of, what else, bug reports.

Amongst all the other links on the support page, I honestly didn’t notice the Contact Us link, but even if I had found the bug report page I very much doubt that I would have called the 800 number, which I can only guess (based on my experience with the call centres of other companies) would involve a 10 minute wait to get through to the operator, followed by 15 minutes of transfers to various people until I finally ended up at the person who can actually do anything about it. And besides, how am I going to send a screenshot over the phone?

I do realize there is a remote possibility that Microsoft has an exceptional customer support service and would get my report logged in less than a minute, but why take the risk? The bug is a mere nuisance. It has no effect on anybody but anal spelling-nazis like me. I could afford to have the report go ignored, though it would bother me in irrationally profound ways every time I saw the typo (but that’s my problem, not Microsoft’s)

So I guess it was the combination of the low importance of the bug, and the expectedly high cost of reporting it through the official channels that led me to post it here.

I’m genuinely surprised that nobody has reported a bug like this before. It seemed like a very natural choice to report it this way. I’m really not used to being the first to do something.

And my web server isn’t used to seeing the kind of traffic this has generated (Report Magic graphs increasing dates from right to left for some unfathomable reason):

Daily statistic

I hope Go Daddy will hold up after everybody returns from their long weekend getaways.

To Engineer Is Human

I just finished reading Henry Petroski’s To Engineer Is Human: the Role of Failure in Successful Design. I liked it.

One of the central themes of the book is that there is much more to learn from the failure of a design than from the success of one. When a structure collapses, the wreckage can be studied, and the cause identified, providing future designers with a definite mode of failure that they can plan to avoid and check for in their own designs.

Another major theme is an analogy of the design process as a scientific method. In science, a hypothesis can be disproved by experimentation, but it cannot be proven. If an experiment fails to disprove an hypothesis, it merely adds supporting evidence to it. The hypothesis may be incorrect, but no experiment has yet exposed its failure. Similarly, a design can be found lacking by analysis, but there is no guarantee that one which passes all the known analyses will, in fact, stand.

There is an oft-quoted saying among computer scientists from Dijkstra that makes a similar point: “Program testing can best show the presence of errors but never their absence.”

Ken’s Bug Reporting System

When I arrived at the office yesterday morning, I was greeted by the following message box.

Windows Update dialog with typo

Apparently our IT staff had applied some patches to my machine overnight and I needed to reboot. Fine. Whatever. I’m used to that with Windows. I’ve learned to accept that I occasionally have to waste 15 minutes of my day reconstructing my desktop after a reboot the I didn’t initiate.

What bothered me was the typo in the message box. Successfully is spelled with three Ss, not two. I noticed the typo ages ago and every time I see it I get more annoyed by it. When I saw it yesterday, I’d had enough. I decided I was going to do something about it.

So I went to the Microsoft Support site looking for somewhere that I could report a bug. I poked around on the website for a few minutes, but quickly gave up. This is a bug that is going to take a developer two minutes to fix. Why should I put more effort than that into reporting a bug?

I finally decided to report the bug here instead of Microsoft’s award-winning support site, in the hopes that some clueful Windows Update developer with a PubSub feed might happen by it and spend two minutes fixing it. Are you that developer? Please fix it.

Update: After PubSub founder, Bob Wyman, wondered whether anybody from Microsoft had seen this posting, Robert Scoble confirms that they have. Cool! It’s working!

Solution to SICP Exercise 1.23

Structure and Interpretation of Computer Programs

Solution to Exercise 1.23:

Here is the definition of a next procedure.

(define (next x)
(if (= x 2)
(+ x 2)))

To use it, we need to modify find-divisor like so:

(define (find-divisor n test-divisor)
(cond ((> (square test-divisor) n) n)
((divides? test-divisor n) test-divisor)
(else (find-divisor n (next test-divisor)))))

When I rerun the code from exercise 1.22, I get the following output:

1009 *** 0s 310000ns
1013 *** 0s 320000ns
1019 *** 0s 150000ns
(# # #)

10007 *** 0s 780000ns
10009 *** 0s 780000ns
10037 *** 0s 940000ns
(# # #)

100003 *** 0s 2500000ns
100019 *** 0s 7500000ns
100043 *** 0s 2500000ns
(# # #)

1000003 *** 0s 2190000ns
1000033 *** 0s 7810000ns
1000037 *** 0s 2190000ns
(# # #)

Compared to the results of exercise 1.22:

Number Ex 1.22 Time Ex 1.23 Time Ratio
1009 460000 310000 1.48
1013 470000 320000 1.47
1019 320000 150000 2.13
10007 1250000 780000 1.6
10009 1410000 780000 1.81
10037 1090000 940000 1.16
100003 5940000 2500000 2.38
100019 3910000 7500000 0.52
100043 4060000 2500000 1.62
1000003 7500000 2190000 3.42
1000033 1870000 7810000 0.24
1000037 2340000 2190000 1.07

If I throw away the top two and bottom two ratios, the average ratio is 1.54. This is close to but less than the expected speed up of 2. If the numbers are at all reliable — and I have my doubts — the extra 0.46 can be attributed to a combination of the procedure call to next (which could take longer than the call to + because it is user-defined versus built-in) and the additional if, with its test for equality to 2.

Bullies on Parade

Scientific American Mind has an story on schoolyard bullying and mobbing. Mechthild Schäfer, the author, was part of a study that aimed to discover why bullies bully. The results are discouraging, if not altogether surprising:

Likewise, we encountered eight-year-olds who, by their own statements and those of their contemporaries, had been the butt of mobbing for quite a while. They endured harassment and exclusion yet never put up resistance or informed adults about their situation. The consequences can be long-lasting. In earlier studies we had shown that children who are harassed by schoolmates over a lengthy period are often unable to defend themselves against hostility and react to attack with anxiety and helplessness. Such terrible experiences make it all the more likely that they will fall into the traps set by bullies.

When we asked the same questions six years later, the students’ answers bore this out. After asking the 13- and 14-year-olds which kids they liked and which they did not, we developed a preference profile that gave us a good sense of an individual’s social ranking in a class. The result was surprising. In contrast to the bullies’ relative lower standing during elementary school, they had actually become very popular with their classmates. Their victims, on the other hand, got few sympathy points.

The good news?

The one positive note was that [the] previous experience [of former mobbing victims] was not usually repeated in their work lives, although mobbing in the workplace–the ganging up of subordinates or superiors through rumor, innuendo, intimidation, humiliation, discrediting and isolation–does happen.

I’ve always been a bit of a nerd so, as a kid, I took my fair share of name-calling and teasing, though I avoided the worst of it by having some athletic talent.

If you are still in school and having a tough go of things, keep in mind that it won’t last forever. As Paul Graham writes:

It’s important for nerds to realize, too, that school is not life. School is a strange, artificial thing, half sterile and half feral. It’s all-encompassing, like life, but it isn’t the real thing. It’s only temporary, and if you look, you can see beyond it even while you’re still in it.

Solid State “Disk” Arrives

Are the days of hard disk failures soon to be a thing of the past? I hope so.

Yesterday, Samsung announced the development of Solid State Disk with a capacity of 16GB and no moving parts. It consumes 5% of the power, weighs half as much, and transfers data at 150% the speed of a traditional hard drive. Cool stuff!

Is Moralism an Evolutionary Maladaption?

Johnnie Moore has been reading Brad Blanton’s Radical Honesty, and applying some of Blanton’s ideas about moralizing to branding, marketing, and improvisation. As usual for Johnnie’s posts, it is well worth a read.

What caught my attention was a quote from Blanton on what he calls the Disease of Moralism:

The passing on of learning from one generation to the next is not a bad design, and as an evolutionary development it seems to have triumphed… The ability to act based on accumulated information, and to pass great quantities of new information on, is the primary survival characteristic of the strongest animal on earth.

But, paradoxically, our survival mechanism has proved to be ultimately suicidal.

So is moralism an evolutionary maladaption? It is an interesting hypothesis, and for all I know, could very well be true, but it seems suspiciously oversimplified to me. [I could also very likely be misrepresenting Blanton’s ideas, as I haven’t actually read the quote in context, so take this all with a grain… no, a bag of salt.]

Given how pervasive moralizing is in western culture, I would guess that it probably has some evolutionary advantage, much like what scientists are uncovering with altruism. In fact, I’d guess that moralizing is an enormously beneficial tool; so beneficial that it is often misapplied in situations where it doesn’t work, leading some observers, like Blanton, to believe it is always harmful.

So how could we test the hypothesis of moralism as a maladaption? There’s something to think about.

Solution to SICP Exercise 1.22

Structure and Interpretation of Computer Programs

Solution to Exercise 1.22:

DrScheme does not have a built-in runtime procedure that I could find, so I modified the code for timed-prime-test to use SRFI 19, like so

(require (lib "19.ss" "srfi"))

(define (timed-prime-test n)
(display n)
(start-prime-test n (current-time time-process)))

(define (start-prime-test n start-time)
(if (prime? n)
(current-time time-process)

(define (report-prime elapsed-time)
(display " *** ")
(display (time-second elapsed-time))
(display "s ")
(display (time-nanosecond elapsed-time))
(display "ns"))

I implemented seach-for-primes as follows:

(define (search-for-next-prime starting-at)
(if (prime? starting-at)
(search-for-next-prime (+ starting-at 2))))

(define (search-for-primes find-n starting-at)
(if (= find-n 0)
(let ((next-prime (search-for-next-prime starting-at)))
(cons next-prime
(search-for-primes (- find-n 1) (+ next-prime 2))))))

I could then run some tests:

(define (time-prime-tests primes)
(map timed-prime-test primes))

(time-prime-tests (search-for-primes 3 1001))
(time-prime-tests (search-for-primes 3 10001))
(time-prime-tests (search-for-primes 3 100001))
(time-prime-tests (search-for-primes 3 1000001))

This gave the following output:

1009 *** 0s 0ns
1013 *** 0s 0ns
1019 *** 0s 0ns
(# # #)

10007 *** 0s 0ns
10009 *** 0s 0ns
10037 *** 0s 0ns
(# # #)

100003 *** 0s 0ns
100019 *** 0s 0ns
100043 *** 0s 0ns
(# # #)

1000003 *** 0s 0ns
1000033 *** 0s 0ns
1000037 *** 0s 0ns
(# # #)

As you can see, all of the tests for prime took no time at all. This is obviously wrong.

I have a feeling that all these processes complete in less time than a single tick of the process clock (which, on Windows, appears to have a resolution in milliseconds).

Let’s magnify the results by calling prime? in timed-prime-test 1000 times instead of just once. Here’s the modified definition:

(define (timed-prime-test n)
(display n)
(start-prime-test 1000 n (current-time time-process)))
(define (start-prime-test i n start-time)
(if (prime? n)
(if (= i 0)
(current-time time-process)
(start-prime-test (- i 1) n start-time))))

Now I get the following output:

1009 *** 0s 460000ns
1013 *** 0s 470000ns
1019 *** 0s 320000ns
(# # #)

10007 *** 0s 1250000ns
10009 *** 0s 1410000ns
10037 *** 0s 1090000ns
(# # #)

100003 *** 0s 5940000ns
100019 *** 0s 3910000ns
100043 *** 0s 4060000ns
(# # #)

1000003 *** 0s 7500000ns
1000033 *** 0s 1870000ns
1000037 *** 0s 2340000ns
(# # #)

Alright! We have some numbers. Unfortunately, when I run the tests again, I get totally different numbers. Grr! I’m going to consider these numbers representative of many runs, but they probably aren’t. Let’s start with some analysis.

Let’s start by averaging the times for each group. We can multiply this by √10 to obtain an expected time for the following group, which we can compare against the measured time.

Group Average Time Expected time (based on lower group) Difference
~1000 416667
~10000 1250000 1317616 -5%
~100000 4636667 3952847 17%
~1000000 3903333 14662427 -73%

With a difference of over 70% on the final group, this data clearly does not support the √n hypothesis, but it doesn’t disprove it, either. For a definitive answer, we need a larger sample group. We need data for more values of n and for several runs. I’m not going to do that here because this post is already too long, and I’m sure you have better things to do.