Man left needing emergency treatment after Essex assault
Man left needing emergency treatment after Essex assault
CodeSOD: Historical Pads
Tim inherited a fairly antique Visual Basic application some time back. Yes, Visual Basic, not VB .Net. The application is old enough that we might consider it "vintage" or "historical"; it certainly dates from before the millennium. But it has its own unique approach to handling historical dates:
mnYear% = CInt(Year(vntDate)) If mnYear% < 1000 Then msYear$ = "0" & Trim$(CStr(mnYear%)) Else msYear$ = Trim$(CStr(mnYear%)) End IfInsert obligatory complaints about Hungarian notation. What even is vnt.
Now, one important thing about this program: it didn't have to handle dates back into the middle ages, or honestly, historical dates at all. But someone decided they wanted to make sure that if someone wanted to track the founding of the Tang Dynasty in here, you could make sure it was padded out to four digits.
Unfortunately, if you wanted to track, say, the death of Caesar Augustus in 14AD, that'll only pad out to "014", which raises the question: what even is the point of this padding? And how many pre-1000 dates did the program handle? The answer to both questions is "none". Later code reformatted the date anyway, using the built in date types, even.
'I'm not doing it for the money': Wayne Rooney reveals why he is pursuing punditry career after impressive World Cup BBC stint - and admits he may never return to the dugout again
Landowner refuses 'hideous' road to be built in 2850 new home plan for Halstead
Rogue OpenAI Agent Tried to Breach Government Site in May When Prompted for Simple Data-Retrieving Tasks
Read more of this story at Slashdot.