Friday, May 1, 2026

If this page is useful, please consider your support

Thursday, April 30, 2026

_Adventure:_ Is there light in the cobble crawl?The original _Colossal Cave Adventure_ consists basically of a Fortran source file and a textual data file. These files would often travel from one installation to another via paper printouts: printed out at one site, typed in by hand at another. The lines of WOOD0350's Fortran source (intentionally or not) never exceed 80 columns regardless of your tab stop. But the data file fits within 80 columns only with a tab stop of four. With an eight-space tab stop, four lines of the data file exceed 80 columns:📝Arthur O’Dwyer

Wednesday, April 29, 2026

My 7-min “lightning talk” is online: Why C++ is growing, and why C++26 will likely be adopted quicklyAt the London C++ meetup last month, I participated on a panel where each panelist gave a short introductory presentation. My 7-minute intro (aka “lightning talk”) just got posted — you can view it here. The one-sentence blurb: “C++ is accelerating, and C++26 is built for what developers need now.” Also check out the longer … Continue reading My 7-min “lightning talk” is online: Why C++ is growing, and why C++26 will likely be adopted quickly →📝Sutter’s Mill
Figma to Qt 1.0 Is Here: The Most Reliable Way to Bring Your Design From Figma to DeviceWhen a perfectly crafted design leaves Figma and enters a development pipeline, things often get compromised. Spacing shifts, colors change, and details deviate through multiple layers of interpretation and unexpected limitations. You will see timelines lagging, design becoming unclear, and user experience losing priority. Figma to Qt is built to ensure your GUI designs get from Figma to device . Version 1.0 is now available for free download in the Figma Community .📝Qt Blog
One Map Key, One Lookup@media only screen and (max-width: 600px) { .body { overflow-x: auto; } .post-content table, .post-content td { width: auto !important; white-space: nowrap; } } This article was adapted from a Google Tech on the Toilet (TotT) episode. You can download a printer-friendly version of this TotT episode and post it in your office. By Roman Govsheev Can you spot the wasted CPU cycles in the map usage? if employee_id in employees: mail_to(employees[employee_id].email_address) The redundant lookup caused the waste by performing a check ( in ) and a fetch ( [] ) as two separate operations when one is sufficient. Every lookup involves a cost —whether it's computing a hash and scanning buckets or performing an O (log n ) traversal. These costs add up quickly. But avoiding them isn’t just “premature optimization”—it’s about writing cleaner, more robust code that stays efficient at scale and prevents potential race conditions. Instead of paying this cost twice, perform the lookup once and reuse the result: if ( employee := employees.get(employee_id)) is not None: mail_to( employee .email_address) Assigning the search result to a variable avoids a second lookup. This efficiency is native to Go via the “comma ok” idiom ( val, ok := map[key] ) and C++ using map.find(key) , both handling retrieval and existence in a single pass. The same inefficiency applies when counting or initializing default. Stop checking for presence; instead, use idioms that handle missing keys automatically at the container level : The redundant way The efficient way If key not in counts: counts[key] = 1 else: counts[key] += 1 counts = defaultdict(int) # Initializes 0 automatically # ... other logic ... counts[key] += 1 Here are some details depending on which language you use: C++: operator[] returns a reference to the value—automatically inserting a default (like 0) if the key is missing—allowing the increment to happen in place. Java: Use map.computeIfAbsent() to perform retrieval and updates in a single call. This is more concise and, on concurrent collections, has the potential to be thread-safe—preventing the “check-then-act” race conditions common with separate contains and put calls. Python: Use collections.defaultdict to handle defaults at the container level, which pushes the logic into optimized C code for better performance and robustness. Note that the += operation (shown later in the above code sample) still involves both a read and a write operation. Go: Use val, ok := map[key] to handle retrieval and existence in one memory access.📝Google Testing Blog

Tuesday, April 28, 2026

_Adventure:_ Walking on the ceilingOn 2012-12-01 I wrote to Don Woods (in a postscript to a production update on [_Colossal Cave: The Board Game_](https://boardgamegeek.com/boardgame/121751/colossal-cave-the-board-game)): > By the way, I just noticed last week that in "Adventure", in the Hall > of the Mountain King, the directions NORTH and LEFT are synonyms, as > are SOUTH and RIGHT... as are WEST and FORWARD! West being forward > makes sense, if the Hall of Mists is back to the east; but for the > rest I suppose the adventurer must be walking on the ceiling. :) This > little mixup is present all the way back to > [Crowther's code](https://github.com/Quuxplusone/Advent/blob/master/CROW0005/advdat.77-03-11#L249-L253). > I just thought it was funny that nobody had commented on it before, as > far as I know.📝Arthur O’Dwyer

Monday, April 27, 2026

Sunday, April 26, 2026

Saturday, April 25, 2026