Posts by Peter

What are comments for?

Comments in code that I have to edit, particularly comments at the beginning of a function or class, have exactly one purpose: convincing me that this code is important enough that I shouldn’t delete it. Tell me what the class does, tell me what the function does, and do it all in convincing enough language [...]

Google Buzz

Google Buzz launched, and it seems to do some fun stuff, but it also broke a lot of peoples’ privacy assumptions and privacy models. That was bad. But for me, the most disappointing thing was that Google never said “oops, my bad”. Instead, every post on the official Google blogs has been in the chirpy [...]

Computer Engineer Barbie

In the words of Tracy: “Oh Internet, is there anything you can’t do?” Thanks to an Internet vote, coming this December you will be able to buy Computer Engineer Barbie! I generally loathe Barbie, but am extremely interested in broadening participation in CS. So, instead of a vague uncaring feeling, I instead feel very very [...]

Why version control?

You should have version control. For everything. Not because you’ll ever go back and look at old revisions, but so that you’ll know that you can go back and look at old revisions. Armed with that knowledge, you can now freely throw away bits and pieces, secure in the knowledge that if you actually want [...]

Error installing Postgresql on Ubuntu?

I just tried installing Postgresql on a pretty standard/untweaked Ubuntu installation, and I got: Setting up postgresql-8.4 (8.4.1-1) … * Starting PostgreSQL 8.4 database server * The PostgreSQL server failed to start. Please check the log output. [fail] invoke-rc.d: initscript postgresql-8.4, action “start” failed. dpkg: error processing postgresql-8.4 (–configure): subprocess installed post-installation script returned error [...]

Algorithms questions are hard, but that’s inherent in the subject

Hello Hacker News and Reddit!  Holy crap there are a lot of you… There are two approaches to teaching a class entitled “Algorithms”. One is to teach a survey course where you are told about a bunch of algorithms and how they work. Tests in such a class could be passed with brute force memorization [...]

Code fast

Students simply cannot code fast enough to express themselves. When confronted with a problem, particularly a small algorithms problem, my first instinct is to write a little snippet of code for every solution I dream up. I can do this, because I write code very quickly. My students can’t. They simply do not have the [...]

iPhone not the problem. AT&T is the problem. (probably)

A week or so ago there was an article in the New York times asserting that the reason the iPhone kinda’ sucks when used in large cities (New York and San Francisco especially) was that the iPhone’s antennae were poorly designed. This was kind of a publicity coup for AT&T who are generally viewed as [...]

Causation is not (necessarily) Correlation

Correlation has a dictionary meaning (two things are related to one another) and a math meaning (having to do with a mathematical relationship between two variable being well-approximated by a line). It is important to note that two variables may be perfectly correlated in the dictionary sense, but be mathematically completely uncorrelated. Consider . There [...]

The 24 Puzzle

The 24 puzzle asks “Given the numbers A, B, C, and D, is there a way to combine the numbers using arithmetical operations +,-,*, and / so that the whole equation evaluates to 24?” I got curious about what inputs to the 24 puzzle had a solution and what ones did not. So I wrote [...]