If you have a great idea, don’t tell it to a standards body

Another quote from Douglas Crockford’s talk The State and Future of JavaScript:

If you have a great idea, don’t tell it to a standards body. They are the last people in the world who should hear about it. What you should do instead is implement it and show it to the world, and if the world likes it then the world will say yeah, that should be a standard. I’ve seen too many cases where people try to do this in the reverse order, and you don’t want to do it that way. Prove it first, prove the need, and then we should put it in the standard.

Related post: The virtual machine of the Internet

The virtual machine of the Internet

From Douglas Crockford’s talk The State and Future of JavaScript:

There’s pressure to make it [i.e. JavaScript] a better compilation target. Now, this is a big surprise. Everybody thought that the Java VM was going to be the VM of the Internet, but it turns out that JavaScript language is the VM [ virtual machine ] of the internet. People are writing in Java, and Python, and lots of other languages, and then translating it into JavaScript because JavaScript, for all of its security problems, actually has a much better security model than everybody else.

Related posts

Twelve Days of Christmas and tetrahedral numbers

How many gifts are there in the song Twelve Days of Christmas?

Day 1: 1 gift
Day 2: 1 + 2 = 3 gifts
Day 3: 1 + 2 + 3 = 6 gifts

Day 12: 1 + 2 + 3 + … + 12 = 78 gifts

The number of gifts on day n is the nth triangular number. The total number of gifts up to and including day n is the sum of the first n triangular numbers, known as the nth tetrahedral number. In the image below, the total number of balls is the fifth tetrahedral number. The number of balls in each layer are triangular numbers. (Image credit: Math is Fun.)

tetrahedron of glass balls

I’ll develop a formula for tetrahedral numbers and continuations of the pattern  such as the sum of tetrahedral numbers etc.

First, let T(n, 1) = n.

Next, let T(n, 2) be the nth triangular number. So T(n, 2) is the sum of the first n terms in the sequence T(i, 1).

Next, let T(n, 3) be the nth tetrahedral number. So T(n, 3) is the sum of the first n terms in the sequence T(i, 2).

In general, define T(n, k) to be the sum of the first n terms in the sequence T(i, k-1). You could think of T(n, k) as the nth k-dimensional triangular number. (A tetrahedron is a sort of 3-dimensional triangle. It’s a pyramid whose base is a triangle. T(n,4) would count balls arranged in a sort of 4-dimensional triangle, a simplex in 4 dimensions.)

Theorem: T(n, k) = n(n+1)(n+2) … (n+k-1)/k!

Corollary: There are T(12, 3) = 12*13*14/6 = 364 gifts in the Twelve Days of Christmas.

See these notes for a elementary proof by induction.

Update: Here’s more advanced proof that uses calculus of finite differences.  The more advanced proof requires more background, but it also gives a better idea of how someone might have discovered the formula.

Related posts

Word frequencies in human and computer languages

This is one of my favorite quotes from Starbucks’ coffee cups:

When I was young I was mislead by flash cards into believing that xylophones and zebras were much more common.

Alphabet books treat every letter as equally important even though letters like X and Z are far less common than letters like E and T. Children need to learn the entire alphabet eventually, and there are only 26 letters, so teaching all the letters at once is not bad. But uniform emphasis doesn’t scale well. Learning a foreign language, or a computer language, by learning words without regard to frequency is absurd. The most common words are far more common than the less common words, and so it makes sense to learn the most common words first.

John Miles White has applied this idea to learning R. He did a keyword frequency analysis for R and showed that the frequency of the keywords follows Zipf’s law or something similar. I’d like to see someone do a similar study for other programming languages.

It would be interesting to write a programming language tutorial that introduces the keywords in the approximately the order of their frequency. Such a book might be quite unorthodox, and quite useful.

White points out that when teaching human languages in a classroom, “the usefulness of a word tends to be confounded with its respectability.” I imagine something similar happens with programming languages. Programs that produce lists of Fibonacci numbers or prime numbers are the xylophones and zebras of the software world.

Related posts

Breast cancer stem cells identified

From the article Proverbial new “Twist” in Breast Cancer Detection:

… scientists at Johns Hopkins … have shown that a protein made by a gene called “Twist” may be the proverbial red flag that can accurately distinguish stem cells that drive aggressive, metastatic breast cancer from other breast cancer cells.

Related posts

Creativity and faith

From Eugene Peterson:

Creativity is difficult. When you are being creative, you’re living by faith. You don’t know what’s next because the created, by definition, is what’s never been before. So you’re living at the edge of something in which you’re not very confident. You might fail: in fact, you almost certainly will fail a good part of the time. All the creative persons I know throw away most of the stuff they do.

Related posts

41 dumb things to check

A list of dumb things to check when troubleshooting computer problems from Tom Limoncelli, author of Time Management for System Administrators. A few examples:

  • Make sure CapsLock is off. (Same for ScrollLock and NumLock)
  • Are both ends of the (power/network/video/etc.) cable plugged in?
  • Use cut-and-paste to copy that variable name to see if it was entered correctly.

Listen to an interview with Tom Limoncelli from the StackOverflow podcast.

New daily tip feeds: RegexTip and ProbFact

A few weeks ago I started a Twitter account @SansMouse with daily tips on Windows keyboard shortcuts. That’s gone well, so I decided start two more daily tip accounts: @RegexTip and @ProbFact. If you don’t use Twitter, you can follow these tip via your blog reader. Here are the RSS feeds for RegexTip and ProbFact.

RegexTip will give one tip per day on using regular expressions. I’ll sometimes post more than once a day, but I’ll only give one tip. Other posts might be housekeeping notes etc. The idea is that people who have intended to learn regular expressions but don’t have the time can make time to absorb one tip per day.

ProbFact will give one fact per day from probability. I’ll often have a link with each fact for more details. Many of these facts will be theorems, but some will be statements about applications or history.

The SansMouse and RegexTip posts are loosely arranged in order of familiarity, starting with the most basic and most widely used material. ProbFact posts will be more random. Some will be elementary, some more advanced.

I have scheduled tips to come out at regular times starting tomorrow. SansMouse will post at 9 AM, RegexTip at 10 AM, and ProbFact at 11 AM. These times are Central Standard Time (UTC-6).

Related links: