Computer
Governments Call For Spyware Regulations In UN Security Council Meeting
Read more of this story at Slashdot.
Pastor Who Saw Crypto Project In His 'Dream' Indicted For Fraud
Read more of this story at Slashdot.
Sweden Starts Building 100,000 Year Storage Site For Spent Nuclear Fuel
Read more of this story at Slashdot.
CodeSOD: Halfway to a Date
Roger took on a contract to fix up a PHP website. During the negotiations, he asked some questions about the design, like, "Is it object-oriented or more procedural?" "No, it's PHP," said the developer.
Which about sums it up, I suppose. Have some date handling code:
function MnameToMnumber($mname) //takes month name 'January' and returns month number '01' { if($mname == 'January'){$mnum = '01';} elseif($mname == 'February'){$mnum = '02';} elseif($mname == 'March'){$mnum = '03';} elseif($mname == 'April'){$mnum = '04';} elseif($mname == 'May'){$mnum = '05';} elseif($mname == 'June'){$mnum = '06';} elseif($mname == 'July'){$mnum = '07';} elseif($mname == 'August'){$mnum = '08';} elseif($mname == 'September'){$mnum = '09';} elseif($mname == 'October'){$mnum = '10';} elseif($mname == 'November'){$mnum = '11';} elseif($mname == 'December'){$mnum = '12';} return $mnum; } function MnumberToMname($mname) //takes month number '01' and returns month name '01' { if($mnum= '01'){$mname = 'January';} elseif($mnum= '02'){$mname = 'February';} elseif($mnum= '03'){$mname = 'March';} elseif($mname == 'April'){$mnum = '04';} elseif($mnum= '05'){$mname = 'May';} elseif($mnum= '06'){$mname = 'June';} elseif($mnum= '07'){$mname = 'July';} elseif($mnum= '08'){$mname = 'August';} elseif($mnum= '09'){$mname = 'September';} elseif($mnum= '10'){$mname = 'October';} elseif($mnum= '11'){$mname = 'November';} elseif($mnum= '12'){$mname = 'December';} return $mname; }So, for starters, I "love" the use of Whitesmiths indenting. I don't think I've seen this in the wild. (I predict the comments section will be links to articles where I have seen this in the wild).
Beyond that, there's nothing terribly surprising here, in terms of bad date handling code, with a few small exceptions. First is their insistence on the conversion itself being stringly typed: January isn't month 1, but "01".
But more notable: MnumberToMname just doesn't work. They're using the assignment operator instead of the equality operator. At least, for all the cases where they're doing the correct comparison direction. A stray "name to number" conversion is lurking in April. Not that it matters- this will always return January.
[Advertisement] Keep the plebs out of prod. Restrict NuGet feed privileges with ProGet. Learn more.Startup Raises $200 Million To 'De-Extinct' the Woolly Mammoth, Thylacine and Dodo
Read more of this story at Slashdot.
FTC Says Refunds For Razer's False N95 Face Masks Are Going Out Now
Read more of this story at Slashdot.
Russia's Largest Platform For State Procurement Hit By Cyberattack
Read more of this story at Slashdot.
Comics Distributor Diamond Is Filing For Bankruptcy
Read more of this story at Slashdot.
Dead Google Apps Domains Can Be Compromised By New Owners
Read more of this story at Slashdot.
GOG Joins European Federation of Game Archives, Museums and Preservation Projects
Read more of this story at Slashdot.
Bluesky Is Getting Its Own Photo-Sharing App, Flashes
Read more of this story at Slashdot.
Telegram Shuts Down Z-Library, Anna's Archive Channels Over Copyright Infringement
Read more of this story at Slashdot.
UnitedHealth Hid Its Change Healthcare Data Breach Notice For Months
Read more of this story at Slashdot.
LinkedIn Wants You To Apply For Fewer Jobs
Read more of this story at Slashdot.
New Jersey Governor Pushes Phone Ban in Schools
Read more of this story at Slashdot.
FTC Sues Deere Over Farm-Equipment Repair Restrictions
Read more of this story at Slashdot.
'Mistral is Peanuts For Us': Meta Execs Obsessed Over Beating OpenAI's GPT-4 Internally, Court Filings Reveal
Read more of this story at Slashdot.
DJI Removes US Drone Flight Restrictions Over Airports, Wildfires
Read more of this story at Slashdot.
PowerSchool Data Breach Victims Say Hackers Stole 'All' Historical Student and Teacher Data
Read more of this story at Slashdot.
Microsoft Will Not Support Office on Windows 10 After October 14
Read more of this story at Slashdot.