Examples and exercises from Programming Collective Intelligence, O'Reilly