AI 摘要This article is a day-by-day development journal documenting the author's creation of 'Lemming,' a side-scrolling platformer for the PyWeek #12 competition, in which players lead a stampede of lemming-like clones and strategically sacrifice themselves so the next clone can survive. The journal chronicles technical hurdles such as pyglet bugs, frame rate struggles, and a display engine rewrite, as well as implemented features like power-ups, animation, sound effects, a title screen, and level progression. By the end of the week, the author submitted a working game with 9 levels and roughly 2,021 lines of Python, and in the postmortem admitted the difficulty curve was too steep, offering a save-file editing tip and a speedrun video so players could see all the levels.
AI 摘要This article explains how to create a self-reproducing zip file—one that contains itself, echoing the 'turtles all the way down' idea—building on the classic computer science exercise of writing quines (self-reproducing programs). The author first derives a Python quine, then constructs a Lempel-Ziv compressed data stream that decompresses to itself using only literal and repeat opcodes, including a variant that reproduces itself with arbitrary prefixes and suffixes. Finally, the article addresses the practical challenge of translating this simplified program into the DEFLATE format used by gzip and zip, whose Huffman-coded variable-length opcodes break the fixed-size encoding assumption.
AI 摘要The article explains that UTF-8 encodes Unicode code points (0 through 10FFFF) into byte streams and, by examining the encoding table directly, shows it is far simpler than many people assume. Its design yields convenient properties: full ASCII compatibility and self-representation of ASCII bytes, self-synchronization, byte-based substring search, code point ordering, and no byte-order issues—meaning most 8-bit-safe programs and Unix tools can handle UTF-8 without modification. The main trade-off is the loss of random access by code point index, but since UTF-8 is steadily becoming the standard encoding, the author encourages embracing its well-designed properties.
AI 摘要This article presents a transcription of Doug McIlroy's 1997 retirement talk on the history of computing at Bell Labs, tracing its evolution from the mathematics department and George Stibitz's relay calculators through early transistorized machines like TRADIC and successive IBM computers such as the CPC, 650, and 704. It highlights memorable anecdotes including the bi-quinary relay calculator that ran unattended for years without undetected errors, the struggles of card-based programming, and Bell Labs' development of the BESYS operating system. The author also notes that the original audio was recovered as MP3 files and includes corrections supplied by McIlroy in 2015.
AI 摘要The article describes a decades-old programming trick, detailed in Briggs and Torczon's 1993 paper, for representing sparse sets using a 'dense' array paired with a 'sparse' array that maps elements to their indices, allowing arbitrary uninitialized values to remain in the arrays without breaking correctness. This representation performs membership checks, additions, and clearing in constant time and iterates in time proportional to the set size rather than the universe size, making it faster than bit vectors for sparse data at the cost of extra memory. It is especially useful in contexts like compiler register allocation and work-queue-based graph traversal, where sets are small and cleared frequently.
AI 摘要Section 7.1.2 of Knuth's The Art of Computer Programming (Volume 4, pre-fascicle 0A) describes nine boolean functions that encode the optimal next move in tic-tac-toe. In a footnote, Knuth recalls how, as a boy, he so baffled a tic-tac-toe machine at Chicago's Museum of Science and Industry that it 'cheated' by making two winning moves at once, giving him a moral victory despite officially losing. A quotation from Charles Babbage's 1864 autobiography reveals Babbage encountered the same paradox—an automaton attempting two contradictory winning motions—more than a century earlier.
AI 摘要The article reflects on the early era of bitmap screen user interfaces, when conventions such as windows being self-contained, protected worlds were still being established. It describes programs that deliberately violate these window protection rules, classifying them as useful (screen printing, magnifying lenses, pen scribbling) or pointless (a magnet that distracts the cursor). The author's first pointless and destructive violation was 'crabs,' a program in which crabs walk across the screen, erasing the applications beneath them.
AI 摘要The passage describes an empire where cartography became so perfected that a map of a single province filled an entire city, culminating in a 1:1 scale map of the Empire that coincided with it point for point. Later generations, less devoted to the study of cartography, deemed this vast map useless and abandoned it to the ravages of sun and winter. It serves as an allegory about the absurdity of representations that perfectly mirror reality.