Lea Verou has a wonderful talk about various techniques we can use to create a pie chart purely in HTML/CSS. The techniques are clever and interesting, but pie charts are a little boring. So let's modify one of her ideas and create Pacman instead. ...
You and a friend are imprisoned but have a chance for freedom. To earn it, you must walk alone into a separate room where a chess board is laid out with a coin per square randomly showing heads or tails. You are shown a particular square on the chess board, and are then allowed to touch one coin to flip it. Then you must leave without making any contact with your friend. Your friend enters the room and must pick the square which was pointed out to you. You and your friend may discuss a strategy before you enter the room. ...
iter() method in Python 2.2 and later hides a neat trick which is not
iter() is used to return an iterator from an iterable object: ...
The Python language has some useful flexibility when it comes to exceptions. Programmers
want as much relevant information as we can get when our code does something unexpected.
Python's default behavior for an unhandled exception is to print a stack trace, the error
type, and the error description. This is sent to
sys.stderr (typically, the console),
like this: ...
Followers, you may be familiar with the scenario where you dance with one leader, and receive feedback that your embrace is too firm, but when you dance with another leader, the same embrace is too light. So, which is it? ...