Computer
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.
Software Flaw Exposes Millions of Subarus, Rivers of Driver Data
Read more of this story at Slashdot.
UK Council Sells Assets To Fund Ballooning $50 Million Oracle Project
Read more of this story at Slashdot.
Anthropic Builds RAG Directly Into Claude Models With New Citations API
Read more of this story at Slashdot.
Facebook Flags Linux Topics As 'Cybersecurity Threats'
Read more of this story at Slashdot.
2025 Will Likely Be Another Brutal Year of Failed Startups, Data Suggests
Read more of this story at Slashdot.
Dangerous Temperatures Could Kill 50% More Europeans By 2100, Study Finds
Read more of this story at Slashdot.
Google Has Open-Sourced the Pebble Smartwatch OS
Read more of this story at Slashdot.
Microsoft Takes on MongoDB with PostgreSQL-Based Document Database
Read more of this story at Slashdot.
Nvidia Dismisses China AI Threat, Says DeepSeek Still Needs Its Chips
Read more of this story at Slashdot.
DeepSeek Piles Pressure on AI Rivals With New Image Model Release
Read more of this story at Slashdot.
Meta's AI Chatbot Taps User Data With No Opt-Out Option
Read more of this story at Slashdot.
JD Vance Says Big Tech Has 'Too Much Power'
Read more of this story at Slashdot.
Meta Sets Up War Rooms To Analyze DeepSeek's Tech
Read more of this story at Slashdot.
DeepSeek Says Service Degraded Due To 'Large-Scale Malicious Attack'
Read more of this story at Slashdot.