Computer
White House Says New Jersey Drones 'Authorized To Be Flown By FAA'
Read more of this story at Slashdot.
Boom Supersonic XB-1 Breaks Sound Barrier During Historic Test Flight
Read more of this story at Slashdot.
Apple Chips Can Be Hacked To Leak Secrets From Gmail, ICloud, and More
Read more of this story at Slashdot.
Hugging Face Researchers Are Trying To Build a More Open Version of DeepSeek's AI 'Reasoning' Model
Read more of this story at Slashdot.
FCC Will Drop Biden Plan To Ban Bulk Broadband Billing For Tenants
Read more of this story at Slashdot.
Pay Raises Are Shrinking in 2025, CFOs Say
Read more of this story at Slashdot.
LinkedIn Removes Accounts of AI 'Co-Workers' Looking for Jobs
Read more of this story at Slashdot.
Atomic Scientists Adjust 'Doomsday Clock' Closer Than Ever To Midnight
Read more of this story at Slashdot.
UK Considers Making Netflix Users Pay License Fee to Fund BBC
Read more of this story at Slashdot.
Garmin Users Say Their Watches Are Bricked With a 'Blue Triangle of Death'
Read more of this story at Slashdot.
Google To Cut Off Chrome Sync for Older Browser Versions
Read more of this story at Slashdot.
Cloud Services Market Is 'Not Working,' Says UK Regulator
Read more of this story at Slashdot.
Bookshop Takes On Amazon With E-book Platform For Independent Stores
Read more of this story at Slashdot.
DeepSeek Has Spent Over $500 Million on Nvidia Chips Despite Low-Cost AI Claims, SemiAnalysis Says
Read more of this story at Slashdot.
New FPGA-Powered Retro Console Re-Creates the PlayStation
Read more of this story at Slashdot.
HomePod With Screen 'Most Significant New Apple Product' of 2025, Says Gurman
Read more of this story at Slashdot.
Peeing Is Socially Contagious In Chimps
Read more of this story at Slashdot.
CodeSOD: Contains Bad Choices
Paul's co-worker needed to manage some data in a tree. To do that, they wrote this Java function:
private static boolean existsFather(ArrayList<Integer> fatherFolder, Integer fatherId) { for (Integer father : fatherFolder) { if (father.equals(fatherId)) return true; } return false; }I do not know what the integers in use represent here. I don't think they're actually representing "folders", despite the variable names in the code. I certainly hope it's not representing files and folders, because that implies they're tossing around file handles in some C-brained approach (but badly, since it implies they've got an open handle for every object).
The core WTF, in my opinion, is this- the code clearly implies some sort of tree structure, the tree contains integers, but they're not using any of the Java structures for handling trees, and implementing this slipshod approach. And even then, this code could be made more generic, as the general process works with any sane Java type.
But there's also the obvious WTF: the java.util.Collection interface, which an ArrayList implements, already handles all of this in its contains method. This entire function could be replaced with fatherFolder.contains(fatherId).
Paul writes: "I guess the last developer didn't know that every implementation of a java.util.Collection has a method called contains. At least they knew how to do a for-each.".
[Advertisement] Keep all your packages and Docker containers in one place, scan for vulnerabilities, and control who can access different feeds. ProGet installs in minutes and has a powerful free version with a lot of great features that you can upgrade when ready.Learn more.'AI Is Too Unpredictable To Behave According To Human Goals'
Read more of this story at Slashdot.
US Solar Boom Continues, But It's Offset By Rising Power Use
Read more of this story at Slashdot.