Monthly Archives: March 2010

I kinda have a crush on 37signals…

…for being willing to buck tradition, tell their lawyers to shut up, and explore ideas like abandoning employment contracts.

106,456,367,669 people have ever lived on Earth

And 5.8% of them are still alive.

From Bakadesuyo.

A Long List of Links

What I’ve been reading lately:

Tagged , , , , , , , , , , , , , , ,

A Long List of Links

What I’ve been reading lately:

  • Building a Better Teacher – NYTimes.com – “Teachers working in the same building, teaching the same grade, produced very different outcomes. And the gaps were huge. Eric Hanushek, a Stanford economist, found that while the top 5 percent of teachers were able to impart a year and a half’s worth of learning to students in one school year, as judged by standardized tests, the weakest 5 percent advanced their students only half a year of material each year.”

    Via Seth Roberts.

  • Latest MacHeist bundle brings even more software on the cheap – How can a company make money by bundling 5 applications together and selling the package for $19.95, when each app individually would cost more than that? They “make it up through volume”, as the saying goes. Of course it only works if the price is higher than your marginal cost, which is easy for downloadable software where your marginal cost is essentially zero.
    Bottom line: there are occasions where a bundle will be better for consumers than only having a la carte options. On the other hand, consumers in this case have the option of choosing whether to buy a bundle or an individual app. That’s not generally true of cable television, for example, which regulators regularly threaten to unbundle.
  • The Volokh Conspiracy » Utah May Try to Use Eminent Domain to Take Federal Government Land – Good luck with that.
  • The Volokh Conspiracy » Blog Archive » “Separation of Church and State” – At my high school, the most common shop class projects were cutting boards and various kinds of weapons (grappling hooks, shuriken … ours wasn’t the most attentive shop teacher really). I doubt that someone making a Wiccan altar would have even raised an eyebrow.
  • Marginal Revolution: Los Angeles fact of the day – Los Angeles’; murder rate is now lower than those of Columbus, Ohio, Tulsa, Oklahama, and Omaha, Nebraska.
  • When should sexting be illegal? – By Emily Bazelon – Slate Magazine – Attention parents, legislators and the local news: the sky is not falling. The most important sentence in this story is saved for the last paragraph. “We’ve been keeping consistent records in the U.S. since the 1960s, and they show that teens now are less violent, use drugs less, smoke less, and drink less. They stay in school more and take more AP classes. Their suicide rate is lower, and so is the teen pregnancy rate.”
  • There’s no room for The Idea Guy – (37signals) – Amen.
Tagged , , , , , , , , , , , , , , , , , , , ,

Random is Hard, Python is Awesome

So the EU ordered Microsoft to give European Windows users a randomized browser-picking screen instead of just railroading everyone into IE by default. Then the site DSL.sk did some digging and found that the ballot wasn’t really random at all. Naturally this was perfect ammunition for the anti-Microsoft conspiracy theorists, but a neat post from Rob Weir shows that the non-randomness of the ballot is due more to negligence than mendacity.

What got my geeky heart all aflutter though was learning the right way to randomly shuffle a list of things. Rob links to a Wikipedia article on the Fischer Yates shuffle. A lot of gibberish and formal algorithmic notation later, I still didn’t really understand how the shuffle worked. Then they got down to the code examples:

from random import randrange
 
def shuffle(items):
    n = len(items)
    while n > 1:
        k = randrange(n)  # 0..n-1
        n = n - 1
        items[k], items[n] = items[n], items[k]
    return

Perhaps the highest praise I’ve heard about Python is that it is “executable pseudocode.” I’ll take that over a formal college textbook notation any day. It makes me wonder why people bother with things like this:

To shuffle an array a of m elements:
   initialize a such that ∀ i . a[i] ← i
   for n from m - 1 downto 1 do
         j ← random (0 .. n)
         exchange a[j] and a[n]