Computer
Ghost Jobs Are Wreaking Havoc On Tech Workers
Read more of this story at Slashdot.
Chinese Attackers Accessed Canadian Government Networks For Five Years
Read more of this story at Slashdot.
Zoox Custom Robotaxis Are Finally Coming To San Francisco, Las Vegas
Read more of this story at Slashdot.
Over 500 Amazon Workers Decry 'Non-Data-Driven' Logic For 5-Day RTO Policy
Read more of this story at Slashdot.
Microsoft Delays Recall Again
Read more of this story at Slashdot.
OpenAI Launches ChatGPT Search, Competing With Google and Microsoft
Read more of this story at Slashdot.
Amazon is Shutting Down Its Kindle Vella Serialized Story Platform in February 2025
Read more of this story at Slashdot.
Meta's Next Llama AI Models Are Training on a GPU Cluster 'Bigger Than Anything' Else
Read more of this story at Slashdot.
Video Game Veterans Are Abandoning Big Studios For Smaller Teams
Read more of this story at Slashdot.
'I'm Not Just Spouting Shit': iPod Creator, Nest Founder Fadell Slams Sam Altman
Read more of this story at Slashdot.
Amazon Delays AI-Powered Alexa Upgrade Amid Technical Challenges
Read more of this story at Slashdot.
300% Price Hikes Push Disgruntled VMware Customers Toward Broadcom Rivals
Read more of this story at Slashdot.
Weight-Loss Surgery Down 25% as Anti-Obesity Drug Use Soars
Read more of this story at Slashdot.
Meta AI Surpasses 500 Million Users
Read more of this story at Slashdot.
Arecibo Collapsed Because of Engineering Failures That Inspectors Failed To Spot
Read more of this story at Slashdot.
Record Levels of Heat-Related Deaths in 2023 Due To Climate Crisis, Report Finds
Read more of this story at Slashdot.
Nintendo Made a Music Streaming App For Video Game Soundtracks
Read more of this story at Slashdot.
CodeSOD: All the Rest Have 31
Horror movies, as of late, have gone to great lengths to solve the key obstacle to horror movies- cell phones. When we live in a world where help is a phone call away, it's hard to imagine the characters not doing that. So screenwriters put them in situations where this is impossible: in Midsommar they isolate them in rural Sweden, in Get Out calling the police is only going to put our protagonist in more danger. But what's possibly more common is making the film a period piece- like the X/Pearl/Maxxxine trilogy, Late Night with the Devil, or Netflix's continuing series of R.L. Stine adaptations.
I bring this up, because today's horror starts in 1993. A Norwegian software company launched its software product to mild acclaim. Like every company, it had its ups and downs, its successes and missteps. On the surface, it was a decent enough place to work.
Over the years, the company tried to stay up to date with technology. In 1993, the major languages one might use for launching a major software product, your options are largely C or Pascal. Languages like Python existed, but weren't widely used or even supported on most systems. But the company stayed in business and needed to update their technology as time passed, which meant the program gradually grew and migrated to new languages.
Which meant, by the time Niklas F joined the company, they were on C#. Even though they'd completely changed languages, the codebase still derived from the original C codebase. And that meant that the codebase had many secrets, dark corners, and places a developer should never look.
Like every good horror movie protagonist, Niklas heard the "don't go in there!" and immediately went in there. And lurking in those shadows was the thing every developer fears the most: homebrew date handling code.
/// <summary> /// /// </summary> /// <param name="dt"></param> /// <returns></returns> public static DateTime LastDayInMonth(DateTime dt) { int day = 30; switch (dt.Month) { case 1: day = 31; break; case 2: if (IsLeapYear(dt)) day = 29; else day = 28; break; case 3: day = 31; break; case 4: day = 30; break; case 5: day = 31; break; case 6: day = 30; break; case 7: day = 31; break; case 8: day = 31; break; case 9: day = 30; break; case 10: day = 31; break; case 11: day = 30; break; case 12: day = 31; break; } return new DateTime(dt.Year, dt.Month, day, 0, 0, 0); } /// <summary> /// /// </summary> /// <param name="dt"></param> /// <returns></returns> public static bool IsLeapYear(DateTime dt) { bool ret = (((dt.Year % 4) == 0) && ((dt.Year % 100) != 0) || ((dt.Year % 400) == 0)); return ret; }For a nice change of pace, this code isn't incorrect. Even the leap year calculation is actually correct (though my preference would be to just return the expression instead of using a local variable). But that's what makes this horror all the more insidious: there are built-in functions to handle all of this, but this code works and will likely continue to work, just sitting there, like a demon that we've made a pact with. And suddenly we realize this isn't Midsommar but Ari Aster's other hit film, Hereditary, and we're trapped being in a lineage of monsters, and can't escape our inheritance.
.comment {border: none;} [Advertisement] Utilize BuildMaster to release your software with confidence, at the pace your business demands. Download today!Boston Dynamics' Atlas Robot Executes Autonomous Automotive Parts Picking
Read more of this story at Slashdot.
Mark Zuckerberg Says a Lot More AI Generated Content is Coming To Fill Up Facebook and Instagram Feeds
Read more of this story at Slashdot.