Computer
Are Warnings of Superintelligence 'Inevitability' Masking a Grab for Power?
Read more of this story at Slashdot.
CodeSOD: Duplicate Reports
Today's anonymous submitter sends us a short snippet. They found this because they were going through code committed by an expensive third-party contractor, trying to track down a bug: every report in the database kept getting duplicated for some reason.
This code has been in production for over a decade, bugs and all:
if (reportStatuses.indexOf(newStatus > -1)) { // add report to database }This is server-side JavaScript running in NodeJS. The mistake here is easy to make, it's a simple transposition error. But it's also easy to catch. Any sort of testing at all would find it.
The specific problem, if you haven't spotted it, is where the comparison operator happens: we're passing newStatus > -1 into indexOf as a parameter: this is a boolean value. Now, neither true nor false are in the reportStatuses array, so indexOf returns -1. But -1 is a truthy value, so the condition evaluates to true, adding the report to the database, even if it's already there.
Our submitter writes:
How has no one noticed this? How is the company still in business? How does the world not come down crashing around us more every day?
How is the world not crashing down? Have you looked outside, recently? Tis the season to quote Clark Griswold:
Worse? How could things get any worse? Take a look around here, Ellen. We're at the threshold of hell.
[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.SpaceX Alleges a Chinese-Deployed Satellite Risked Colliding with Starlink
Read more of this story at Slashdot.
Roomba Maker 'iRobot' Files for Bankruptcy After 35 Years
Read more of this story at Slashdot.
Like Australia, Denmark Plans to Severely Restrict Social Media Use for Teenagers
Read more of this story at Slashdot.
CEOS Plan to Spend More on AI in 2026 - Despite Spotty Returns
Read more of this story at Slashdot.
'Investors in Limbo'. Will the TikTok Deal's Deadline Be Extended Again?
Read more of this story at Slashdot.
Podcast Industry Under Siege as AI Bots Flood Airways with Thousands of Programs
Read more of this story at Slashdot.
Podcast Industry Under Siege as AI Bot Flood Airways with Thousands of Programs
Read more of this story at Slashdot.
Entry-Level Tech Workers Confront an AI-Fueled Jobpocalypse
Read more of this story at Slashdot.
Polar Bears are Rewiring Their Own Genetics to Survive a Warming Climate
Read more of this story at Slashdot.
America Adds 11.7 GW of New Solar Capacity in Q3 - Third Largest Quarter on Record
Read more of this story at Slashdot.
Purdue University Approves New AI Requirement For All Undergrads
Read more of this story at Slashdot.
Repeal Section 230 and Its Platform Protections, Urges New Bipartisan US Bill
Read more of this story at Slashdot.
Time Magazine's 'Person of the Year': the Architects of AI
Read more of this story at Slashdot.
Trump Ban on Wind Energy Permits 'Unlawful', Court Rules
Read more of this story at Slashdot.
New Rule Forbids GNOME Shell Extensions Made Using AI-Generated Code
Read more of this story at Slashdot.
Is the R Programming Language Surging in Popularity?
Read more of this story at Slashdot.
System76 Launches First Stable Release of COSMIC Desktop and Pop!_OS 24.04 LTS
Read more of this story at Slashdot.
'Free Software Awards' Winners Announced: Andy Wingo, Alx Sa, Govdirectory
Read more of this story at Slashdot.
