# The Daily WTF

Curious Perversions in Information Technology

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## CodeSOD: Extremely One Line

DevFeed: [CodeSOD: Extremely One Line](<https://devfeed.tech/articles/codesod-extremely-one-line-31464.md>)

Original publisher: [Read original article](<https://thedailywtf.com/articles/extremely-one-line>)

Author: Remy Porter

Published: 2026-09-16T06:30:00Z

Content type: opinion

Language: en

Sources: [The Daily WTF](<https://devfeed.tech/sources/the-daily-wtf.md>)

Topics: [ASP.NET](<https://devfeed.tech/topics/aspnet.md>), [Code](<https://devfeed.tech/topics/code.md>), [Visual Studio](<https://devfeed.tech/topics/visual-studio.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>), [browser](<https://devfeed.tech/topics/browser.md>), [HTTP](<https://devfeed.tech/topics/http.md>)

Tags: [asp-net](<https://devfeed.tech/tags/asp-net.md>), [browser](<https://devfeed.tech/tags/browser.md>), [cli](<https://devfeed.tech/tags/cli.md>), [code](<https://devfeed.tech/tags/code.md>), [codesod](<https://devfeed.tech/tags/codesod.md>), [http](<https://devfeed.tech/tags/http.md>), [studio](<https://devfeed.tech/tags/studio.md>)

### AI overview

This CodeSOD commentary examines an ancient ASP .Net application containing a function written on one line, Safari user-agent detection, and a mysterious "uplevel" value. It criticizes the confusing style and notes that the same pattern appears on multiple pages.

### Source excerpt

Autoformatting your code is a standard thing to do these days. And in those days past, if we're being honest. There's no excuse to not use some kind of autoformatter. Whether you configure your editor to do it or are a weirdo like me who runs a formatter from the CLI as a build step, you've got an easy way to format your code so it looks neat and readable. And some IDEs, like Visual Studio, are pretty insistent about doing this for you. Which makes today's code sample a bit more perplexing. This comes from an ancient ASP .Net application that Austin has the misfortune to work with: protected void Page_PreInit(object sender, EventArgs e){if (Request.ServerVariables["http_user_agent"].IndexOf("Safari", StringComparison.CurrentCultureIgnoreCase) != -1)Page.ClientTarget = "uplevel";} protected void Page_Load(object sender, EventArgs e) { Logic(); } Which function is Logic() called from? The fact that I'm asking probably is enough to get you to scroll over. The entire Page_PreInit function is on a single line, followed by the declaration of the Page_Load function. A confusing and annoying choice. The real bonus is that if the browser has "Safari" in its user agent, we set a field to a mysterious "uplevel" value. A mix of user agent sniffing, strings as enums/flags, and wonderfully unclear names. And yes, this particular pattern appears in more than one page in Austin's application. Someone thought this was not just a good idea, but good enough to do over and over again. [Advertisement] Picking up NuGet is easy. Getting good at it takes time. Download our guide to learn the best practice of NuGet for the Enterprise.

## CodeSOD: An Odd Sort

DevFeed: [CodeSOD: An Odd Sort](<https://devfeed.tech/articles/codesod-an-odd-sort-28504.md>)

Original publisher: [Read original article](<https://thedailywtf.com/articles/an-odd-sort>)

Author: Remy Porter

Published: 2026-09-15T06:30:00Z

Content type: opinion

Language: en

Sources: [The Daily WTF](<https://devfeed.tech/sources/the-daily-wtf.md>)

Topics: [Code](<https://devfeed.tech/topics/code.md>), [PowerShell](<https://devfeed.tech/topics/powershell.md>), [Script](<https://devfeed.tech/topics/script.md>), [Sorting](<https://devfeed.tech/topics/sorting.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [codesod](<https://devfeed.tech/tags/codesod.md>), [csv](<https://devfeed.tech/tags/csv.md>), [excel](<https://devfeed.tech/tags/excel.md>), [powershell](<https://devfeed.tech/tags/powershell.md>), [report](<https://devfeed.tech/tags/report.md>), [script](<https://devfeed.tech/tags/script.md>), [sorting](<https://devfeed.tech/tags/sorting.md>)

### AI overview

The article critiques a PowerShell script that queries Active Directory for users and their last logon times. It explains that the script's alphabet-based approach does not correctly sort names, performs unnecessary searches and property loading, and generates a CSV report for Excel despite these inefficiencies.

### Source excerpt

Let's say we wanted to query Active Directory and print out a report of all of our users, and their last logon time. That seems like a pretty normal task for a Powershell script. It'd probably be short and easy to read, at least if it were written by a normal person. Alice sends us one that wasn't. She's already done us a favor, as she writes: "Code cleaned up and indented for the whitespace-missing-impaired." ##################################### # lists accounts and selected attributes alphabetically ##################################### foreach( $letter in "a", "b", "c"......"z") { $strfilter = $letter + "*" $objdomain = New-object System.DirectoryServices.DirectoryEntry $objSearcher = New-object System.DirectoryServices.DirectorySearcher $objSearcher.SearchRoot = $objdomain $objSearcher.Filter = $strFilter $objSearcher.PropertiesToLoad.Add("name"); $colResults = $objSearcher.FindAll() foreach($result in $colResults) { $name = $result.Properties.Name $searcher = New-Object DirectoryServices.DirectorySearcher([adsi]"") $searcher.filter "(&(objectCategory=User)(sAMAccountName=$name))" $users = searcher.FindAll() foreach($user in $users) { Write-Output $user.properties.item("name") + "," + $user.properties.item("lastLogon") } } } This accomplishes sorting alphabetically by iterating across the alphabet. Which, I suspect, isn't going to actually get them in alphabetical order; it makes sure that albert and alice appear before bob, but doesn't enforce that albert must come before alice. In any case, we iterate across the alphabet, and then create a searcher that finds a*, then b*, etc. We explicitly tell the searcher that the only property we care about is the name field, so that we don't load unnecessary fields, like the ones we want to report on. We then iterate across the list of names, construct a new searcher, and search for the account with the username we fetched. That lets us get all of the fields we need, including the ones we aren't going to use. Now, we sea

## A File Existence Bug Caused by Checking Its Timestamp

DevFeed: [A File Existence Bug Caused by Checking Its Timestamp](<https://devfeed.tech/articles/codesod-i-exist-28510.md>)

Original publisher: [Read original article](<https://thedailywtf.com/articles/i-exist>)

Author: Remy Porter

Published: 2026-09-14T06:30:00Z

Content type: article

Language: en

Sources: [The Daily WTF](<https://devfeed.tech/sources/the-daily-wtf.md>)

Topics: [bug](<https://devfeed.tech/topics/bug.md>), [Development](<https://devfeed.tech/topics/development.md>), [Windows](<https://devfeed.tech/topics/windows.md>)

Tags: [bug](<https://devfeed.tech/tags/bug.md>), [code](<https://devfeed.tech/tags/code.md>), [codesod](<https://devfeed.tech/tags/codesod.md>), [development](<https://devfeed.tech/tags/development.md>), [files](<https://devfeed.tech/tags/files.md>), [function](<https://devfeed.tech/tags/function.md>), [time](<https://devfeed.tech/tags/time.md>), [windows](<https://devfeed.tech/tags/windows.md>)

### AI overview

A Pascal system library implements FileExists by checking whether FileAge returns -1. Because FileAge depends on a valid last-write timestamp, files without that timestamp are incorrectly reported as missing. The underlying failure is also not checked for its error code.

### Source excerpt

In addition to using an ancient development environment, with terrible UX, Greta also has the misfortune of working in Pascal. Recently, she was diagnosing a bug. The program was reporting that files didn't exist when they definitely existed. She traced the problem down into the system library. Let's see if you can spot what's wrong: { Delphi / Kylix Cross-Platform Runtime Library } { System Utilities Unit } { } { Copyright (c) 1995-2001 Borland Softwrare Corporation } ... function FileAge(const FileName: string): Integer; {$IFDEF MSWINDOWS} var Handle: THandle; FindData: TWin32FindData; LocalFileTime: TFileTime; begin Handle := FindFirstFile(PChar(FileName), FindData); if Handle <> INVALID_HANDLE_VALUE then begin Windows.FindClose(Handle); if (FindData.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY) = 0 then begin FileTimeToLocalFileTime(FindData.ftLastWriteTime, LocalFileTime); if FileTimeToDosDateTime(LocalFileTime, LongRec(Result).Hi, LongRec(Result).Lo) then Exit; end; end; Result := -1; end; {$ENDIF} function FileExists(const FileName: string): Boolean; {$IFDEF MSWINDOWS} begin Result := FileAge(FileName) <> -1; end; {$ENDIF} The first function here is FileAge, which returns the last modified timestamp on a file. Note the use of FileTimeToDosDateTime, which is a Windows API function. It converts LocalFileTime and stores the date part in the first output parameter (LongRec(Result).Hi) and the time part in the second output parameter (LongRec(Result).Lo). Result, in this case, is our return value. If anything goes wrong, we return -1. The FileExists function then, simply calls FileAge. If it doesn't return a -1, there must be a file there. That's an awkward, weird solution to the problem. There has to be a system call that can answer that question more obviously. But it doesn't seem like it should be blowing up- it looks like it should work. But note that FileTimeToDosDateTime also returns a boolean value. If it succeeds, great, but if it fails, it returns false

## CAA DNS Issuer-Critical Flags Are Confusing to Configure

DevFeed: [CAA DNS Issuer-Critical Flags Are Confusing to Configure](<https://devfeed.tech/articles/a-bit-of-dns-28502.md>)

Original publisher: [Read original article](<https://thedailywtf.com/articles/a-bit-of-dns>)

Author: Remy Porter

Published: 2026-09-10T06:30:00Z

Content type: opinion

Language: en

Sources: [The Daily WTF](<https://devfeed.tech/sources/the-daily-wtf.md>)

Topics: [certificates](<https://devfeed.tech/topics/certificates.md>), [domain](<https://devfeed.tech/topics/domain.md>)

Tags: [bits](<https://devfeed.tech/tags/bits.md>), [boolean](<https://devfeed.tech/tags/boolean.md>), [certificates](<https://devfeed.tech/tags/certificates.md>), [documentation](<https://devfeed.tech/tags/documentation.md>), [feature-articles](<https://devfeed.tech/tags/feature-articles.md>), [flag](<https://devfeed.tech/tags/flag.md>), [https](<https://devfeed.tech/tags/https.md>), [readability](<https://devfeed.tech/tags/readability.md>)

### AI overview

The article examines confusion around the issuer-critical flag in DNS CAA records. It explains that the flag is defined as a bitmask, while many users interpret the documentation as requiring the integer 1 instead of the value representing the specified bit, creating a dilemma for certificate issuers such as LetsEncrypt.

### Source excerpt

I'm not a DNS person, in that I appreciate that it exists but am not up on the inner workings. It solves a lot of problems with dark magic I don't fully understand, and fortunately don't need to. But Lucio noticed something that I do think is interesting, within the scope of the CAA record type. The CAA record started with RFC6844, which was obsoleted by RFC8659. Both RFCs lay out the same core idea: you can add a CAA record to your DNS entries to say, "hey, this domain over here is allowed to issue certificates for me". That's the sort of thing that enables LetsEncrypt to hand out certs, and is an important part of why we can run HTTPS everywhere these days. Now, RFC6844 has this in it: Issuer Critical: If set to '1', indicates that the corresponding property tag MUST be understood if the semantics of the CAA record are to be correctly interpreted by an issuer. Issuers MUST NOT issue certificates for a domain if the relevant CAA Resource Record set contains unknown property tags that have the Critical bit set. The issuer critical flag means that the certificate issuer needs to validate your CAA record before it issues a certificate for you. There's more in the RFC about what exactly that means, but we don't care about those details for right now. The rule here is "set a flag to 1". A little later in the RFC, the flag is described in more detail- as a bitmask. Specifically, bit 0 is the issuer critical flag. Bits 1-7 are reserved for future use. Now, here's where we get into trouble, because programmers don't understand bits, and because the CAA record expects you to put an integer in this field. So, if you want issuer critical enabled, what value to you put in this field? 128, obviously. That's 10000000. Except, if you don't understand bits, that's not obvious. A lot of people read this and decided that the documentation meant they needed to put 1 in the field- aka 00000001. This is wrong. The updated RFC tries to explain it a bit more clearly: Bit 0, Issuer Critic

## CodeSOD: Asynchronous Directories

DevFeed: [CodeSOD: Asynchronous Directories](<https://devfeed.tech/articles/codesod-asynchronous-directories-28505.md>)

Original publisher: [Read original article](<https://thedailywtf.com/articles/asynchronous-directories>)

Author: Remy Porter

Published: 2026-09-09T06:30:00Z

Content type: article

Language: en

Sources: [The Daily WTF](<https://devfeed.tech/sources/the-daily-wtf.md>)

Topics: [Vala](<https://devfeed.tech/topics/vala.md>), [async/await](<https://devfeed.tech/topics/async-await.md>), [Library](<https://devfeed.tech/topics/library.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [async](<https://devfeed.tech/tags/async.md>), [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [await](<https://devfeed.tech/tags/await.md>), [codesod](<https://devfeed.tech/tags/codesod.md>), [exceptions](<https://devfeed.tech/tags/exceptions.md>), [filesystem](<https://devfeed.tech/tags/filesystem.md>), [writing-code](<https://devfeed.tech/tags/writing-code.md>)

### AI overview

This article examines implementing an asynchronous version of Vala's directory-creation method when the core library provides only a synchronous version. The proposed function walks up the directory tree, then creates missing directories in reverse order, using exceptions for control flow.

### Source excerpt

Eri has a mix of a "true confession" and a "wait, really?" today. The programming language Vala bills itself as a C# like language that compiles into something pretty close to C performance, designed specifically for writing code against Gnome and its associated libraries. One of the C#-isms in brings in is async/await type semantics. You can yield someAsyncFunction(), which returns control to the caller, allowing it to proceed until the yielded function returns an actual value. Because it has asynchronous functions, many library functions for handling I/O are already async. So you can make_directory_async, which yields control so you can keep executing while waiting for the filesystem to make your directory. There are also synchronous versions of those methods. And then there's create_directory_with_parents, which will create a chain of directories for you. That's the synchronous version, and Vala's core library has decided not to provide an asynchronous version of it, which is my "wait, really?" I suspect it's really about the race conditions involved and the risks of things going wrong while doing it asynchronously; all solvable problems, but tricky ones to solve. But it's the problem Eri had, and this is their solution: /// Note: does not throw if target already exists async void create_directory_with_parents_async(File file, Cancellable? cancellable = null) throws Error { var to_create = new File[0]; var? current_target = file; while(current_target != null) { try { yield current_target.make_directory_async(Priority.DEFAULT, cancellable); } catch(IOError.NOT_FOUND e) { to_create += current_target; current_target = current_target.get_parent(); continue; } catch(IOError.EXISTS e) { break; } break; } for (int i = to_create.length - 1; i >= 0; --i) { try { yield to_create[i].make_directory_async(Priority.DEFAULT, cancellable); } catch(IOError.EXISTS e) { // Created by another process } } } If I'm reading this correctly, we start by trying to create the full path to

## A Software Contractor Is Ignored After a Key Employee Dies

DevFeed: [A Software Contractor Is Ignored After a Key Employee Dies](<https://devfeed.tech/articles/a-mortal-blow-28503.md>)

Original publisher: [Read original article](<https://thedailywtf.com/articles/a-mortal-blow>)

Author: Ellis Morning

Published: 2026-09-08T06:30:00Z

Content type: opinion

Language: en

Sources: [The Daily WTF](<https://devfeed.tech/sources/the-daily-wtf.md>)

Topics: [Software](<https://devfeed.tech/topics/software.md>), [Development](<https://devfeed.tech/topics/development.md>), [coding](<https://devfeed.tech/topics/coding.md>)

Tags: [analysis](<https://devfeed.tech/tags/analysis.md>), [development](<https://devfeed.tech/tags/development.md>), [feature-articles](<https://devfeed.tech/tags/feature-articles.md>), [software](<https://devfeed.tech/tags/software.md>)

### AI overview

An anonymous software contractor describes being hired to analyze a company's core program, then being largely ignored for about 18 months after the employee who hired them died. During that time, the contractor built a development environment and was eventually dismissed.

### Source excerpt

From our anonymous submitter: Having reached the end of the road at a company increasingly swallowed up companies further east which you'd never believe were still afloat, I found myself headhunted for certain specialty software skills. I was reaching the final few years of my expected working span, so I jumped at the chance. The money was (to me at that time) spectacularly good, so I jumped into it. It started when my first day was spent by me being sent home for the weeks it was still going to take to onboard me. Not bad, engaged to wait, as it were, and the first 6 months was thus and so. The man who had interviewed me, call him Fred, was intelligent and urbane, and was a joy to meet. He and I clearly hit it off, and lo and behold I was in. It was he who gave me my first assignment, which was mathematical analysis of their core milk-cow program because they needed to find out what it did, and how it did it, so they could perhaps implement it in a more contemporary language. So I did that, and was just about to publish my findings with him, when Fred inconveniently dropped dead suddenly. In the what-are-we-going-to-do-now-our-key-man-is-no-more confusion, we contractors were forgotten. For the next 18 months or so (may have been more, may have been less) I was more or less ignored. I spent the time writing a development environment to work on any part of the program conveniently, all the while sitting next to a man who was constantly, forcefully and repetitiously speaking ill of the managers in his line structure. The ridiculously garrulous boss who inherited me thought little of me, and handed me the little work that came my way with active hostility. One or two good guys, but mostly a cabal of elderly men trying to preserve their little money-spinner as long as they could, and a johnny-come-lately trying to increase (and even introduce) automatic processes was less than welcome. During that time I spent quite some time on TDWTF, submitting a gem or two here and

## A Failed XML-Based DSL Design Using a Large Regular Expression

DevFeed: [A Failed XML-Based DSL Design Using a Large Regular Expression](<https://devfeed.tech/articles/best-of-classic-wtf-a-dumbain-specific-language-28506.md>)

Original publisher: [Read original article](<https://thedailywtf.com/articles/classic-wtf-a-dumbain-specific-language>)

Author: Remy Porter

Published: 2026-09-07T06:30:00Z

Content type: opinion

Language: en

Sources: [The Daily WTF](<https://devfeed.tech/sources/the-daily-wtf.md>)

Topics: [XML](<https://devfeed.tech/topics/xml.md>), [Structured-data](<https://devfeed.tech/topics/structured-data.md>), [bug](<https://devfeed.tech/topics/bug.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [best-of](<https://devfeed.tech/tags/best-of.md>), [bug](<https://devfeed.tech/tags/bug.md>), [code](<https://devfeed.tech/tags/code.md>), [documentation](<https://devfeed.tech/tags/documentation.md>), [domain-specific-languages](<https://devfeed.tech/tags/domain-specific-languages.md>), [dsls](<https://devfeed.tech/tags/dsls.md>), [regex](<https://devfeed.tech/tags/regex.md>), [xml](<https://devfeed.tech/tags/xml.md>)

### AI overview

The article revisits a failed attempt to build a domain-specific language with XML schemas and a 1,310-character regular expression. It describes a bug in the expression and criticizes the resulting design as an unsuccessful effort to save labor.

### Source excerpt

It's a holiday here in the US, a celebration of labor, so we're reaching back through the archives for a story about an attempt to be labor saving that was not successful. Original. --Remy I've had to write a few domain-specific-languages in the past. As per Remy's Law of Requirements Gathering, it's been mostly because the users needed an Excel-like formula language. The danger of DSLs, of course, is that they're often YAGNI in the extreme, or at least a sign that you don't really understand your problem. XML, coupled with schemas, is a tool for building data-focused DSLs. If you have some complex structure, you can convert each of its features into an XML attribute. For example, if you had a grammar that looked something like this: The Source specification obeys the following syntax source = ( Feature1+Feature2+... ":" ) ? steps Feature1 = "local" | "global" Feature2 ="real" | "virtual" | "ComponentType.all" Feature3 ="self" | "ancestors" | "descendants" | "Hierarchy.all" Feature4 = "first" | "last" | "DayAllocation.all" If features are specified, the order of features as given above has strictly to be followed. steps = oneOrMoreNameSteps | zeroOrMoreNameSteps | componentSteps oneOrMoreNameSteps = nameStep ( "." nameStep ) * zeroOrMoreNameSteps = ( nameStep "." ) * nameStep = "#" name name is a string of characters from "A"-"Z", "a"-"z", "0"-"9", "-" and "_". No umlauts allowed, one character is minimum. componentSteps is a list of valid values, see below. Valid 'componentSteps' are: - GlobalValue - Product - Product.Brand - Product.Accommodation - Product.Accommodation.SellingAccom - Product.Accommodation.SellingAccom.Board - Product.Accommodation.SellingAccom.Unit - Product.Accommodation.SellingAccom.Unit.SellingUnit - Product.OnewayFlight - Product.OnewayFlight.BookingClass - Product.ReturnFlight - Product.ReturnFlight.BookingClass - Product.ReturnFlight.Inbound - Product.ReturnFlight.Outbound - Product.Addon - Product.Addon.Service - Product.Addon.ServiceFeatu

## Examples of Calendar and Date-Validation Errors in Websites

DevFeed: [Examples of Calendar and Date-Validation Errors in Websites](<https://devfeed.tech/articles/error-d-good-time-28507.md>)

Original publisher: [Read original article](<https://thedailywtf.com/articles/good-time>)

Author: Lyle Seaman

Published: 2026-09-04T06:30:00Z

Content type: opinion

Language: en

Sources: [The Daily WTF](<https://devfeed.tech/sources/the-daily-wtf.md>)

Topics: [User interface design](<https://devfeed.tech/topics/ui-design.md>), [Website](<https://devfeed.tech/topics/website.md>)

Tags: [error-d](<https://devfeed.tech/tags/error-d.md>), [ui](<https://devfeed.tech/tags/ui.md>), [ui-design](<https://devfeed.tech/tags/ui-design.md>), [website](<https://devfeed.tech/tags/website.md>)

### AI overview

A humorous commentary on reader-submitted examples of website calendar, time, date-calculation, and date-validation errors, including contradictory form requirements and confusing temporal interfaces.

### Source excerpt

Astute readers noticed last week that this editor (that is to say, me) had his own error'd failure to remember what day it was. Thank you for pointing it out promptly, and then proceeding to send in a bunch of examples of other sites calendar failures. Misery loves company! Traveler's travails, from C_Chell "Trying to complete the form on https://www.ihg.com to tell when I plan to arrive at the hotel, I can't complete the form because of this little time problem." "You Have -1 Month(s) To Order!" announces dragoncoder047. "Ah, GradImages... the company that told all graduates that they'd get a free 5x7 but tried to charge me for it, then refused to honor my "unsubscribe" request and is *still* emailing me to this day... Can't do date math? Par for the course." "Stansted Temporal UI design" shared by Michael R. "While waiting for a friend to arrive at Stansted I see this. I better fire up the DeLorean to pick her up at 00:06 tomorrow." While he was hunting through the website, Michael R. also found that "The Stansted airport website seems to suffer from Directional Confusion." Nothing wrong with the calendar here, but Slaoput simply opposes mandatory existence. "I was filling out a form that said the Birthdate is optional, but when I hit submit I found out it was required. (I guess technically you have to be born to fill out the form.)" NOT TO BE! [Advertisement] Picking up NuGet is easy. Getting good at it takes time. Download our guide to learn the best practice of NuGet for the Enterprise.

## An Incorrect Temperature Conversion Lookup Table in Home-Automation Code

DevFeed: [An Incorrect Temperature Conversion Lookup Table in Home-Automation Code](<https://devfeed.tech/articles/codesod-heating-up-28508.md>)

Original publisher: [Read original article](<https://thedailywtf.com/articles/heating-up>)

Author: Remy Porter

Published: 2026-09-03T06:30:00Z

Content type: opinion

Language: en

Sources: [The Daily WTF](<https://devfeed.tech/sources/the-daily-wtf.md>)

Topics: [Code](<https://devfeed.tech/topics/code.md>), [floating-point](<https://devfeed.tech/topics/floating-point.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [codesod](<https://devfeed.tech/tags/codesod.md>), [errors](<https://devfeed.tech/tags/errors.md>), [floating-point](<https://devfeed.tech/tags/floating-point.md>), [open-source](<https://devfeed.tech/tags/open-source.md>)

### AI overview

The article examines home-automation code that uses a floating-point lookup table to convert Celsius to Fahrenheit. It explains that several mappings are incorrect and that using floating-point values as map keys can also cause lookup failures because of rounding errors.

### Source excerpt

A common option for retrofitting heating and cooling into older homes is a mini-split, frequently tied to a heat pump. They're (relatively) cheap to install, energy efficient, and can be added without substantial modifications to the home. They also, annoyingly, are mostly controlled via IR remotes, making them challenging to wire up to home automation or even a household thermostat. People have made solutions, and today's code comes from one of those solutions. Which, I want to stress, this code comes from an open source project for home automation, so it's not the code that's wrong, here. At first I thought it was, and had a moment of, "I'm not going to pick on some hobby project," but then I realised the hobby project points at a deeper issue. // temperature helper these are direct mappings based on the remote float toFahrenheit(float fromCelsius) { // Lookup table for specific mappings const std::map<float, int> lookupTable = { {16.0, 61}, {16.5, 62}, {17.0, 63}, {17.5, 64}, {18.0, 65}, {18.5, 66}, {19.0, 67}, {20.0, 68}, {21.0, 69}, {21.5, 70}, {22.0, 71}, {22.5, 72}, {23.0, 73}, {23.5, 74}, {24.0, 75}, {24.5, 76}, {25.0, 77}, {25.5, 78}, {26.0, 79}, {26.5, 80}, {27.0, 81}, {27.5, 82}, {28.0, 83}, {28.5, 84}, {29.0, 85}, {29.5, 86}, {30.0, 87}, {30.5, 88} }; // Check if the input is in the lookup table auto it = lookupTable.find(fromCelsius); if (it != lookupTable.end()) { return it->second; } // Default conversion and rounding to nearest integer return roundf(fromCelsius * 1.8 + 32.0); } Okay, I am going to pick on their code a little bit; using float as a key in a map is asking for trouble, because rounding errors are going to surprise you. But honestly, failing to find the key you're looking for is better than the opposite, since that actually does the correct thing. Because if you look carefully at the table, you'll see that it's wrong. 18C, for example, should be 64F. Well, 64.4F, but we're rounding to an integer. The choice here is to roughly map every 0.

## Why Output Metrics Can Miss Problems in Complex Production Systems

DevFeed: [Why Output Metrics Can Miss Problems in Complex Production Systems](<https://devfeed.tech/articles/what-you-measure-28516.md>)

Original publisher: [Read original article](<https://thedailywtf.com/articles/what-you-measure>)

Author: Remy Porter

Published: 2026-09-02T06:30:00Z

Content type: opinion

Language: en

Sources: [The Daily WTF](<https://devfeed.tech/sources/the-daily-wtf.md>)

Topics: [Monitoring](<https://devfeed.tech/topics/monitoring.md>), [dashboards](<https://devfeed.tech/topics/dashboards.md>), [robot sense of touch](<https://devfeed.tech/topics/robot-sense-of-touch.md>), [Embedded Software Dev](<https://devfeed.tech/topics/embedded-software-dev.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [Computer vision](<https://devfeed.tech/topics/computer-vision.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [computer-vision](<https://devfeed.tech/tags/computer-vision.md>), [databases](<https://devfeed.tech/tags/databases.md>), [embedded](<https://devfeed.tech/tags/embedded.md>), [feature-articles](<https://devfeed.tech/tags/feature-articles.md>), [manufacturing](<https://devfeed.tech/tags/manufacturing.md>), [metrics](<https://devfeed.tech/tags/metrics.md>), [monitoring](<https://devfeed.tech/tags/monitoring.md>), [robotics](<https://devfeed.tech/tags/robotics.md>), [widget](<https://devfeed.tech/tags/widget.md>)

### AI overview

This commentary examines a metrics-driven manufacturing team whose automated production line combines robotics, embedded firmware, web-based monitoring tools, and PLC code. It argues that tracking output and limited performance metrics does not adequately explain how such a complex system behaves or why bottlenecks occur.

### Source excerpt

Rachel joined a new team which was proudly "metrics driven". When she first met with her boss, Zane, he explained his thinking. "We need to be data-driven to make good decisions, right? We're a manufacturing company. We make widgets. At the end of the day, we need to make the most widgets for the lowest cost of goods sold. So we track that, and that feeds into every decision." The team oversaw an automated production line, which meant the software was a mix of robotics, embedded firmware, high-level web based monitoring tools, and thickets of dreaded PLC code. And because you can't build an entire factory for test purposes, they only way they could test real-world scales with real-world data was to roll changes out to production. They could simulate, they could run tests on subsets of the system, but a change in the production line software couldn't truly be validated until it rolled out into the real world. Rachel's first task on the new team involved making some changes to their metrics dashboard. It was viewed as a good way to get her feet wet with the new team. As it turned out, the metrics dashboard was a Google Sheet, with a complex series of formulas that involved multi-level INDEX functions- essentially querying the spreadsheets like they were a database. Why not use an actual database? Oh, they did -- six actually -- but the company obeyed Remy's Law of Requirements Gathering: "no matter what the requirements the users ask for, what they really wanted was Excel". The database data was pulled into the spreadsheet for reporting. Now, a complicated sheet pulling in data from not one, but six different databases, they must have a pretty complex model to explain how changes to their software would impact productivity. And since they needed to model the software to make predictions about how it'd behave in production, that model must be extremely useful. Of course it wasn't. The only metrics they tracked were output metrics, variations on "widgets produced per unit

## Representative Line: So Much Room

DevFeed: [Representative Line: So Much Room](<https://devfeed.tech/articles/representative-line-so-much-room-28512.md>)

Original publisher: [Read original article](<https://thedailywtf.com/articles/so-much-room>)

Author: Remy Porter

Published: 2026-09-01T06:30:00Z

Content type: article

Language: en

Sources: [The Daily WTF](<https://devfeed.tech/sources/the-daily-wtf.md>)

Topics: [audit](<https://devfeed.tech/topics/audit.md>)

Tags: [audit](<https://devfeed.tech/tags/audit.md>), [representative-line](<https://devfeed.tech/tags/representative-line.md>)

### AI overview

A representative comment was truncated because its audit text field was sized too narrowly, with the missing content apparently lost during a careless merge.

### Source excerpt

Today's representative comment ran out of room. int maxLen = getColumnSize(session, "audit", "text_value1") - 16; // Leave some room for No, it isn't continued on the next line and just got trimmed out, except perhaps by a careless merge. This is the entire comment. Clearly, written by David Chase, the creator of "The Sopranos". There are so many things we might be leaving room for. We could leave some room for dessert. Leave some room for activities. Leave some room for the holy spirit. Leave some room for improvisation. [Advertisement] ProGet's got you covered with security and access controls on your NuGet feeds. Learn more.

## A World Cup-Era Police Software Project Faced Severe Staffing and Infrastructure Constraints

DevFeed: [A World Cup-Era Police Software Project Faced Severe Staffing and Infrastructure Constraints](<https://devfeed.tech/articles/tales-from-the-world-cup-28513.md>)

Original publisher: [Read original article](<https://thedailywtf.com/articles/tales-from-the-world-cup>)

Author: Ellis Morning

Published: 2026-08-31T06:30:00Z

Content type: opinion

Language: en

Sources: [The Daily WTF](<https://devfeed.tech/sources/the-daily-wtf.md>)

Topics: [Software](<https://devfeed.tech/topics/software.md>), [systems](<https://devfeed.tech/topics/systems.md>), [Website](<https://devfeed.tech/topics/website.md>), [App](<https://devfeed.tech/topics/app.md>), [servers](<https://devfeed.tech/topics/servers.md>), [incident](<https://devfeed.tech/topics/incident.md>)

Tags: [app](<https://devfeed.tech/tags/app.md>), [brazil](<https://devfeed.tech/tags/brazil.md>), [bugs](<https://devfeed.tech/tags/bugs.md>), [feature-articles](<https://devfeed.tech/tags/feature-articles.md>), [hiring](<https://devfeed.tech/tags/hiring.md>), [onboarding](<https://devfeed.tech/tags/onboarding.md>), [real-time](<https://devfeed.tech/tags/real-time.md>), [server](<https://devfeed.tech/tags/server.md>), [software](<https://devfeed.tech/tags/software.md>), [systems](<https://devfeed.tech/tags/systems.md>), [website](<https://devfeed.tech/tags/website.md>)

### AI overview

An anonymous submitter recounts a rushed 2014 project in Brazil to build a police system before the World Cup. The project combined public websites, police-car location tracking, automated reporting, and real-time incident submissions, but faced severe staffing, scheduling, infrastructure, and software bug problems.

### Source excerpt

All I can say in response to our anonymous submitter's story is, ALMOST?! With the World Cup being hosted in North America this year, I remembered this story that happened back in 2014. At the time I was working in Brazil, for a company that builds software systems for public services. And, with the World Cup being hosted there, in came the opportunity for local agencies to invest in modernization, with pretty much a blank check to get new services, so long as it was deployed before the end of the World Cup. And so the sales people did what they did best, and went around trying to upsell whoever would be willing to buy -- no matter our actual capacity for developing the things. So it was that I was pulled into this new fancy digital system for the police force of a state capital. However, we had only about 4 engineers available, and what they sold was a project estimated for a team of 20, to be delivered in 3 months, with no room for delay. And it wasn't just our core C&D product, but this massive thing with customized public-facing websites, live tracking of the position of different police cars delivered to a tablet in each car, automated reporting, etc. First thing: We received a pile of 24 resumes, and were told to choose 16 of those. Maybe 3 were acceptable, but we had to waste 1 month hiring and onboarding 13 other people who were worse than useless. Classic man-month problem. We eventually had to tell management that nothing would be delivered this way, so they did the very best next thing: fly us to this other city, so we could work embedded there, in full crunch mode for the delivery. We pretty much worked 12+ hours a day, 7 days a week, for those next 2 weeks. Another situation: they wanted this system where people could take a photo of an incident in progress, and submit via this app + website, to be verified by an operator in real-time. We nicknamed it the "dick-pic encyclopedia." Even worse, we only had the budget to run a single server, so this thing re

## A humorous roundup of software and website errors involving Google, Microsoft, and the New Mexico DOT

DevFeed: [A humorous roundup of software and website errors involving Google, Microsoft, and the New Mexico DOT](<https://devfeed.tech/articles/error-d-hello-new-mexico-28509.md>)

Original publisher: [Read original article](<https://thedailywtf.com/articles/hello-new-mexico>)

Author: Lyle Seaman

Published: 2026-08-28T06:30:00Z

Content type: opinion

Language: en

Sources: [The Daily WTF](<https://devfeed.tech/sources/the-daily-wtf.md>)

Topics: [ordering](<https://devfeed.tech/topics/ordering.md>), [Google](<https://devfeed.tech/topics/google.md>), [Microsoft](<https://devfeed.tech/topics/microsoft.md>), [Website](<https://devfeed.tech/topics/website.md>)

Tags: [error-d](<https://devfeed.tech/tags/error-d.md>), [google](<https://devfeed.tech/tags/google.md>), [microsoft](<https://devfeed.tech/tags/microsoft.md>), [ordering](<https://devfeed.tech/tags/ordering.md>), [web](<https://devfeed.tech/tags/web.md>), [website](<https://devfeed.tech/tags/website.md>)

### AI overview

This opinion piece presents a humorous roundup of software and website mistakes. It discusses an ordering error, Google's apparent counting mistake, Microsoft Outlook account and contact-form problems, a pricing-unit misunderstanding, and a New Mexico DOT website.

### Source excerpt

Peter G. shared with us yet another ordering bungled example of. "Should really say "please engage in an Easter egg hunt to find your language"." "Google can't count" claimed Peter S.. It adds up. "Yet another proof that 0=1, this time from Google." "Thanks, Microsoft" groused Ivan "Ever since Microsoft ate university e-mail services worldwide and became responsible for major free software mailing lists, quality of service has been steadily dropping. In order to report delivery problems to Outlook, you need a Microsoft account. You're prevented from creating it at first because of "suspicious activity". Once you're in, the contact address is pre-filled for you with an invalid email. Once you fix that in the web developer toolbar, fuck you anyway! I think the form isn't actually expected to work; the fact that the request was submitted is an error. The only thing missing from the experience is the "beware of the leopard" sign." "Mango Math" needs a bit of money math for the rest of the world to understand. Michael R. muttered "I will buy it by the slice then." The joke here is on the tip of my tongue. Explainer: the new pence is one hundredth of the decimal pound. No shillings no more, decreps! At that ratio, 3p per slice of cheesecake would indeed be far less dear than four pounds for the whole thing, barring translucent slices. Alas, the reality is simply the boring fact that the price is 3p per gram. Not as funny but I'm chuckling imagining Michael's transparent serving of diet cheesecake. I'll leave it up to you to decide if a gram really counts as an "item". Clint clucked "Got this email from Bigbadtoystore. Lots of links available for preorder!" I think the talented website builders behind the New Mexico DOT have been busy. [Advertisement] Picking up NuGet is easy. Getting good at it takes time. Download our guide to learn the best practice of NuGet for the Enterprise.

## CodeSOD: The Big Family

DevFeed: [CodeSOD: The Big Family](<https://devfeed.tech/articles/codesod-the-big-family-28514.md>)

Original publisher: [Read original article](<https://thedailywtf.com/articles/the-big-family>)

Author: Remy Porter

Published: 2026-08-27T06:30:00Z

Content type: opinion

Language: en

Sources: [The Daily WTF](<https://devfeed.tech/sources/the-daily-wtf.md>)

Topics: [PHP](<https://devfeed.tech/topics/php.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Code](<https://devfeed.tech/topics/code.md>), [data](<https://devfeed.tech/topics/data.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [Localization (l10n)](<https://devfeed.tech/topics/localization.md>), [formatting](<https://devfeed.tech/topics/formatting.md>), [HTML](<https://devfeed.tech/topics/html.md>), [Parsing](<https://devfeed.tech/topics/parsing.md>)

Tags: [array](<https://devfeed.tech/tags/array.md>), [code](<https://devfeed.tech/tags/code.md>), [codesod](<https://devfeed.tech/tags/codesod.md>), [fetch](<https://devfeed.tech/tags/fetch.md>), [formatting](<https://devfeed.tech/tags/formatting.md>), [html](<https://devfeed.tech/tags/html.md>), [humor](<https://devfeed.tech/tags/humor.md>), [php](<https://devfeed.tech/tags/php.md>), [programming](<https://devfeed.tech/tags/programming.md>), [sql](<https://devfeed.tech/tags/sql.md>)

### AI overview

This commentary examines a large, generalized PHP code sample that builds hierarchical output from a presumed database source. It highlights probable SQL injection risk, unused array keys, dynamic localization fields, extensive number formatting and HTML string manipulation, string-based date-time parsing, and repeated code for child and sibling records.

### Source excerpt

Some time ago, Charles shared with us some awful PHP, aka the most common sort. Today's code sample is maybe a little too big to sum up, but I'll let Charles take a crack at it. It's so bad that even analyzing and laughing at it feels impossible. But it's so bad, I couldn't not share it. I'm the only one handling all the IT-related tasks at my company, and I don't have anyone here to vent or laugh about this kind of thing with. So, I figured, why not share it here? I'm hoping it'll provide at least a little bit of catharsis or some dark humor. To make sure the confidentiality of the codebase was respected, I took the liberty of generalizing it. You might notice some inconsistencies, but that's just me trying to keep things neutral while protecting the original structure and functionality. Apologies if it looks a bit patchy - the goal was to avoid revealing any specific details or sensitive code. The whole block is north of 400 lines, and it's doing a lot. Or well, maybe it's not, as you'll see. Let's star with the outermost layer. $resm_data = $data_source->fetchData("group=" . $item_id); foreach ($resm_data as $key => $value) { // rest of the code here } We fetch data from a data source, presumably a database, passing our condition as a string, which reeks of probable SQL injection, but I don't know what library they're using. I also note they're using the key/value style of array iteration, but never actually check the key. $option_id = $value->option_id; $resm_details = $detail_source->fetch($option_id); if ($resm_details) { $label = $resm_details->{"label$lang"}; $description = $resm_details->{"description$lang"}; $category = $resm_details->category; Nice little bit of "meta" programming to get their localization working, it'll fetch labelen or labelde as needed. Definitely not a horrible, dangerous way to solve that problem. We use that again to get our currency figured out. That lets us do number formatting. So much number formatting code. if ($category == 0)

## A C++ Exception Handler Retries Without Releasing Deadlock Resources

DevFeed: [A C++ Exception Handler Retries Without Releasing Deadlock Resources](<https://devfeed.tech/articles/codesod-lock-em-dead-28511.md>)

Original publisher: [Read original article](<https://thedailywtf.com/articles/lock-em-dead>)

Author: Remy Porter

Published: 2026-08-26T06:30:00Z

Content type: opinion

Language: en

Sources: [The Daily WTF](<https://devfeed.tech/sources/the-daily-wtf.md>)

Topics: [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Deadlock](<https://devfeed.tech/topics/deadlock.md>), [Exception](<https://devfeed.tech/topics/exception.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>)

Tags: [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [code](<https://devfeed.tech/tags/code.md>), [codesod](<https://devfeed.tech/tags/codesod.md>), [deadlock](<https://devfeed.tech/tags/deadlock.md>), [exception](<https://devfeed.tech/tags/exception.md>)

### AI overview

The article examines a C++ exception handler that retries after detecting a deadlock. It explains that the retry mechanism appears to jump back to the start of the block without releasing resources, so it can leave the deadlock unresolved and potentially add more deadlocks.

### Source excerpt

Kevin sends us an exception handler from C++. Let's see if we can spot what's going wrong: catch (Exception::Deadlock) { retry; } When we catch a deadlock happening, we retry. That's not a keyword in C++, and looking at how it's used, it has to be some kind of macro, and I suspect that the macro is hiding a goto underneath it. The real problem, though, is that we suspect we're in a deadlock situation. That means this thread is waiting on a resource held by another thread which is waiting for a resource held by this thread. Neither train may continue until the other has passed. So this retry only works if it releases the resource held by this thread (letting the deadlocking thread proceed). But does it? Not according ot Kevin. The code already had a pile of deadlocks in it, so they brought in a highly paid consultant to try and fix them by reordering access and tracing where mutexes were causing issues. This retry just jumps back up to the top of the block, without releasing any resources. It "seems the consultant wanted to add some deadlocks of their own," Kevin says. [Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!