Andy’s Reader

Here is where I post reading material that I found interesting. I hope you find it interesting too.
Recent Tweets @andy_wrote

What a quote from JavaScript creator Brendan Eich: 

I had to be done in ten days or something worse than JS would have happened.

Cook continues: 

For a programming language designed in 10 days, he did an amazing job. Maybe he did too good a job: his first draft was good enough to use, and so he never got a chance to fix the language’s flaws.

Also, regarding Perl 6: 

Perl 6 really is a new language, compatible in spirit with earlier versions of Perl though not always in syntax. Damian Conway hassuggestedthat perhaps Perl 6 should have been developed under a completely different name…

If you think of Perl 6 as a new language, your expectations are quite different than if you think of it as an upgrade. If it’s a new language, it doesn’t matter so much how long it was in development. Perl programmers would be pleased with how similar the new language is to their familiar one, rather than upset about the differences. And people would evaluate the new language on its merits rather than being prejudiced by previous experience with Perl.

I learned Perl for my first year of work in 2005 and enjoyed it, but since then I haven’t had to use it and now I’d use Python for sure; can’t think of any instance where I’d use Perl instead. But it’s true about the name and the bias. Perl being out of favor now compared to Python and Ruby, people may be prejudiced Perl 6. 

Caching algorithms at Dropbox. I think the most important point is here:

LFU semi-intelligently made use of popularity data, but fared so much worse than LRU, which just made use of basic timing data. But, the cases that make LFU perform poorly are relatively real-world…

In fact, if you think about it, LRU does make some use of popularity information. If a file is popular enough to be used more often than once every k times, it will always be in an LRU cache. But by forgetting any information more than k files ago, the LRU algorithm prevents really old files from taking precedence over new ones.

The scenarios in which LFU fails are in regime changes. LFU gets “habituated” to its regime and will perform poorly when it changes until it has had the chance to re-habituate. 

After a long pause! Some more readings to share. Here is one about Arthur Conan Doyle’s father, Charles Doyle. Conan Doyle had a Fox Mulder-like belief in the supernatural. His father, an artist, was institutionalized and drew some pretty wild and fantastic sketches of monsters, which are reproduced here. 

Great article. I can’t believe a PDA (cell phone, any electronic device) would be permitted in tournaments? Make them write the game by hand and copy it afterwards. Someone could write an app to help with the copying, of course, or a referee could periodically copy handwritten moves into a computer while doing his duties. 

A massive blitz-tournament gap is a definite red flag. 

I don’t know much about computer-aided chess but I have come across one or two articles about it. If I recall correctly, I think a grandmaster playing chess with the assistance of a computer can still beat a computer regularly (but I can’t find the source so don’t quote me on that). So humans are still able to contribute something, even if machines are clearly the champions now. 

The BBC interviewed Linus Torvalds back in June when he won the Millenium Prize, which I believe is a sort of applied-science/technology equivalent to the Nobels. Really great stuff. 

When you posted about the original system kernel on Usenet in 1991 what did you think would happen to it?

I think your question assumes a level of planning that simply didn’t really exist. It wasn’t so much about me having any particular expectations of what would happen when I made the original kernel sources available: a lot of the impetus for releasing it was simply a kind of “hey, look at what I’ve done”.

And a really interesting response regarding the nature of open source and the GPL: 

…I do not see open source as some big goody-goody “let’s all sing kumbaya around the campfire and make the world a better place”. No, open source only really works if everybody is contributing for their own selfish reasons.

Now, those selfish reasons by no means need to be about “financial reward”, though. 

you don’t want to get involved if you feel like your contributions would be somehow “taken advantage of”, but with the GPLv2 [licence], that simply was never an issue.

The fundamental property of the GPLv2 is a very simple “tit-for-tat” model: I’ll give you my improvements, if you promise to give your improvements back.

It’s a fundamentally fair licence, and you don’t have to worry about somebody else then coming along and taking advantage of your work.

And the thing that then seemed to surprise people, is that that notion of “fairness” actually scales very well.

Sure, a lot of companies were initially fairly leery about a licence that they weren’t all that used to, and sometimes doubly so because some portions of the free software camp had been very vocally anti-commercial and expected companies to overnight turn everything into free software.

But really, the whole “tit-for-tat” model isn’t just fair on an individual scale, it’s fair on a company scale, and it’s fair on a global scale.

Another post from this rather fantastic Joel on Software blog I discovered the other day. This is from 2004 and is clearly dated in some aspects (see the comments on Mac users and the list of things Web applications “can’t yet” do), but the important points ring true. 

Was Borland that important to save? 

That’s why Steve Ballmer was jumping around the stage shouting “Developers, developers, developers, developers.” It’s so important for Microsoft that the only reason they don’t outright give away development tools for Windows is because they don’t want to inadvertently cut off the oxygen to competitive development tools vendors (well, those that are left) because having a variety of development tools available for their platform makes it that much more attractive to developers… Anything to encourage developers to build for the .NET platform, and holding just short of wiping out companies like Borland.

A fascinating anecdote on SimCity, of all programs, and Windows. 

…there was a critical bug in [SimCity]: it used memory right after freeing it, a major no-no thathappenedto work OK on DOS but would not work under Windows where memory that is freed is likely to be snatched up by another running application right away. The testers on the Windows team were going through various popular applications, testing them to make sure they worked OK, but SimCity kept crashing. They reported this to the Windows developers, who disassembled SimCity, stepped through it in a debugger, found the bug, andadded special code that checked if SimCity was running, and if it did,ran the memory allocator in a special mode in which you could still use memory after freeing it.

This was not an unusual case…

And a long segment at the end, demonstrating that the trend towards Web applications and away from desktop applications was clearly visible 8 years ago, not just in its incipient form, but in the “it’s already happening and it’s too late for Microsoft to react forcefully” stage. 

This is a much better article about Unicode than the Python one I shared earlier - written in a conversational style that I wish were more prevalent. (Programming documentation is actually not too bad about this compared to more abstract documentation such as mathematics papers. Hey, just pop out of the rigor every now and then and just write the way you’d write if explaining your idea to someone in the hallway.) 

Full of great historical anecdotes: 

[ASCII] could conveniently be stored in 7 bits. Most computers in those days were using 8-bit bytes, so not only could you store every possible ASCII character, but you had a whole bit to spare, which, if you were wicked, you could use for your own devious purposes: the dim bulbs at WordStar actually turned on the high bit to indicate the last letter in a word, condemning WordStar to English text only.

Wikipedia’s article on UTF-8 is good to read immediately after this. 

I understand scientists like to have fun now and then… what a song choice. 

…when the music played, it was converted into electrical impulses that triggered color changes on the squid’s skin, thereby creating the world’s first cephalo-iPod. Here’s a video of the squid’s skin pulsing along to Insane in the Membrane by Cypress Hill…

Via Jess. About how the Cheesecake Factory is incredibly efficient, and healthcare is not. 

A really great explanation of this statistical technique. It’s not often that you look up something technical and/or mathematical and immediately find something written as straightforwardly as this is. 

Interesting. I did not really understand what UTF-8 was until I read this (I would have given a hand waving definition of “character set,” I guess, which is wrong - Unicode is the character set and UTF-8 is a way to represent it). 

The most important tip is:

Software should only work with Unicode strings internally, converting to a particular encoding on output.
… A second tip… is:
Include characters > 127 and, even better, characters > 255 in your test data.

Another article about how Obama is not actually a socialist, from director Milos Forman, who actually lived under repressive Communism during his youth and knows first-hand how far left-wing politicians in the US are from totalitarian Marxist regimes. Has a “You’re no Jack Kennedy” ring to it, I think. (h/t @rogerebert)

It’s crazy that Republicans jump all over Obama for his big-government ways. 

Via Greg Mankiw’s blog. Statcan stuff used to flick across my radar from time to time when I was a trader. 

When the Harper government’s plans to toughen Canadian crime laws were critiqued using statistics showing low and falling crime rates, Justice Minister Rob Nicholson proudly asserted: “We don’t govern on the basis of statistics.”

If I were a prime minister and one of my ministers said this, I would have to suppress the desire to fire him or her immediately (I’m not sure how the Canadian system works and if this guy can be fired by the PM or not). Then I’d probably make a statement directly and publicly contradicting what was said. 

Via Li; discussion of the multi-armed bandit problem. 

One strategy that has been shown to perform well time after time in practical problems is the epsilon-greedy method. We always keep track of the number of pulls of the lever and the amount of rewards we have received from that lever. 10% of the time, we choose a lever at random.

Algorithms that try to find the global optimum sometimes have to randomly try strategies that don’t look favorable, so as to avoid getting stuck in a local optimum.