Programming

2010 01 17
Recently read: Clearing out the Backlog Edition


Posted by in: Books, Brooklyn, Math, Programming

Peter Siebel. Coders at Work: Reflections on the Craft of Programming

This superb book is a collection of fifteen interviews with well-known and highly-regarded programmers (Norvig, Armstrong, Knuth, etc). Siebel (author of Practical Common Lisp) is a professional programmer with a keen sense of the (brief) history of the profession. This gives the interviews a depth and a richness that even a clever journalist could never have matched. Siebel is a consistently thoughtful interviewer who asks just the right mix of questions. In any one interview, the questions range from practical ones concerned with how the subjects debug code to more general questions about whether the nature of programming has changed over time. Across interviews, Siebel asks enough of the same questions that we can start to view the answers in comparative perspective, while also allowing what is special about the careers and interests of the subjects to emerge.

In short, if you’re interested in programming, this book is wildly engrossing. A word of warning: If you don’t have any experience programming, and some background knowledge of the field, you’re probably not going to be able to get much out of the book. Some passages were certainly over my head, as I’ve only been a professional programmer since June, when I got my green card, and if I recall correctly, only really got started teaching myself Python about a year and a half ago. But most of it was accessible and inspiring to this junior programmer.

Amy Sohn. Prospect Park West

We lived briefly in (very South) Park Slope when we first moved to Brooklyn, and although we’ve since moved out to Flatbush, we’re back in the Slope all the time. We eat at Al Di La whenever we can afford to. We’ve been members of the infamous Park Slope Food Coop for several years now, and we’re set to have a baby in the Spring. So although my expectations weren’t all that high, I pretty much had to check Prospect Park West out of the Brooklyn Public library, after waiting patiently for my turn in a queue that was over 250 holds long. Prospect Park West is set against this familiar background. The plot follows the ill-considered affair of a Park Slope mother, whose life is connected to a few other characters by a string of coincidences that I would have found far-fetched ten years ago, before I started to notice equally striking coincidences in my own life. (Always remember that odds are that life will be filled with the improbable, since there are an enormous number of possible improbable events—so many that it would be highly improbable for us to go long without another improbable event occurring. This is one reason, among several, that life is filled with strangeness and magic, if you keep an eye out for it.)

Prospect Park West is not a great work of literature, but it’s readable enough. The book’s basic outlook is misanthropic without much in the way of compensating insight. I get that some Park Slope mothers can be a bit much, but so can the author when she (in the mouths of her characters) gets going about them. The author gets points, though, for her depiction of the strange, confusing, prickly racial tension you run across in Brooklyn all the time, and which I struggle to explain to my friends back in Canada. This too was perhaps also a bit overdone, but unfortunately not by much.

One correction: A check out line at the Coop that stretches back to the bread section does not count as long. I don’t know when Sohn shops, but that’s pretty routine in my experience. Long is when it goes all the way along the produce aisle as far back as the milk section.

Charles Dickens. Oliver Twist

This is only the second Dickens novel I’ve read, the other being A Tale of Two Cities. I found A Tale of Two Cities pretty silly, but against my better judgment found the ending weirdly sublime. I didn’t have as much luck with Oliver Twist, which I read for the sole reason that we’re naming our kid “Oliver” and I figured I should at least read the book that helped make his name famous. (On my to do list: Who the hell is Oliver Cromwell?) I found the social commentary in the first part of the book entertaining enough, if heavy-handed. But as the plot advanced, the melodrama and the general absurdity of it all started to suck the fun out of it. Also, I know the book is a product of the early nineteenth century, but the fact that one of the characters is usually referred to simply as “the Jew” and even gets to be the butt of a big nose joke was driving me nuts. What’s that? Dickens was a child of his era, so cut him some slack? Well, I’m a child of my era, so take your own advice and cut me some slack while you’re at it.

Vivant Denon. Introduction by Peter BrooksNo Tomorrow

Vivant Denon was, among other things, the first director of the Louvre Museum, in charge of sorting and cataloging all the goodies that Napoleon stole from the Egyptians. A wing of the Louvre bears his name to this day. Denon was also “maybe, probably,” in the words of Peter Brooks, the author of No Tomorrow a thirty odd page long erotic masterpiece. The New York Review of Books has recently published a fine bilingual edition of the story with an introduction by Peter Brooks. The intellectual imprimatur provided by the publisher and the scholarly introduction makes it totally not skeevy that I’m writing about erotica on my blog.

There’s a lot to admire in Denon’s story and the way he tells it. As for the tale, a woman seduces a man, for pleasure, without negative consequence for either. As for the telling, Denon is delicate without ever being prudish, erotic without ever being explicit. It’s good clean fun for the adults in the family.

Surendra Verma. The Little Book of Maths, Theorems, Theories, and Things

This book covers a very wide variety of mathematical and logical puzzles and problems and more. The author even throws in a discussion of the Body-Mass Index*, presumably because it’s . . . expressed in numbers? Because it’s a little book, and because it’s trying to get to so many subjects, and because the author also likes to throw in limericks and factoids and anecdotes willy-nilly, this book treats each of its subjects in an extremely superficial way. I like limericks and factoids and anecdotes as much as the next guy, but there really wasn’t room for a lot of math in this book, or much opportunity for the author to make the case that mathematics is intrinsically interesting.

Let me also take a moment to plead with the publisher to fix the typos in this book before reprinting, if the book ever gets another shot at life. You know you’re in bad hands when you read the sentence: “No one has ever found an even number that can be expressed as the sum of two prime numbers” (p. 76). Oh, really? Cause I think I might be about to make mathematical history!

* Verma tells us that knowing your BMI “can give you an idea of how healthy your weight is.” He doesn’t note that a lot of researchers think the BMI is misleading or useless.


Howls of outrage (6)

2009 02 04
A very rough proxy for anger at the Pope


This morning brought the news that Angela Merkel has decided to add her voice to the chorus of criticism directed at Pope Benedict for his decision, on January 21, 2009, to lift the excommunication of holocaust denying bishop Richard Williamson. Pope Benedict was himself a member of the Hitler Youth as a young man, which obviously complicates matters for him when he starts ex-excommunicating holocaust deniers.

I figure a very rough proxy for anger about the issue has to be the number of Google hits for “Nazi Pope” in a particular period of time. Of course, we should expect a baseline number of hits as a result of the controversy surrounding Pope Pius XII, and there’s bound to be a lot of noise (people angrily objecting to the term “Nazi Pope” for example). Anyway, this chart is rough and crappy, but it gives you an idea.

Graph of google hits for nazi pop over time.

It’s even more remarkable if you assume that the vast bulk of the increase comes from the period after January 21, 2009. I wonder what February will look like.

Description of how I made the chart is below the fold, in case anyone wants to check its accuracy.

Continue Reading »


Howls of outrage (13)

2008 08 08
Recently read: “Learning Python”


Posted by in: Books, Programming, Python

Mark Lutz. Learning Python

When I was studying philosophy, I didn’t bother to review philosophy books here. Likewise, I don’t now intend to write much about computer books. But I’ll make an exception for Mark Lutz’s Learning Python. I was told a while back by several people that Python is a great programming language to get started with. It’s elegant, powerful, free, easy to pick up, and currently in fairly widespread use. As far as I can tell, this was good advice. I’ve certainly enjoyed the time I’ve spent playing around with Python, and I’ve found the experience strangely empowering. There are all kinds of uses for simple programs in daily life, and it’s wonderful to be able to whip them up yourself. Picking up a little programming is something that I recommend to just about anyone, including people who never thought of themselves as likely programmers. If, then, you want to dabble a bit, and you take the advice given to me to begin with Python, go get yourself Lutz’s book. It is readable, extraordinarily clear, and patient. I suspect that at times the pace is slow enough to drive someone with an actual programming background nuts, but this turns out to be very handy if you’re new to programming. Highly recommended.


Comments Off

2008 07 27
The Monty Hall Problem


Posted by in: Math, Programming, Python

Thanks to a friend, this morning I learned about the Monty Hall Problem. As she remarked, it is counter-intuitive in the extreme. But I see from the Wikipedia article that even Paul Erdos got it wrong the first time, so I don’t feel too bad about being initially stumped. (If you’re having trouble getting it, I found it very helpful to step back and think about the related N doors puzzle discussed in the Wikipedia article.)

One of the wonderful things about picking up even the slightest bit of programming is that you can test and play around with things like this. The Python programming language makes it especially easy for a beginner to muddle through to a test very quickly:

import random

remainingchoice = []
carcount = 0.0
trials = 100000

for i in range(1, trials):
    possibilities = ['goat', 'goat', 'car']
    random.shuffle(possibilities)
    if possibilities[1] == 'goat':
        remainingchoice.append(possibilities[2])
    else:
        remainingchoice.append(possibilities[1])
                                   
remainingchoice.sort()
for item in remainingchoice:
    if item == 'goat':
        pass
    else:
        carcount +=1    

print (carcount * 100) / trials

Somehow makes it all seem more solid. Except when I changed the trials variable to 100000000 and my computer was all like “What the fuuuu?” and then Python crashed hard.


Howls of outrage (24)