Feed aggregator
23andMe Requiring Potential Bidders To Affirm They Will Uphold Data Privacy
Read more of this story at Slashdot.
Kickstarter Introduces 'Tariff Manager Tool' To Add Charges To Already Fully Funded Projects
Read more of this story at Slashdot.
China's Huawei Develops New AI Chip, Seeking To Match Nvidia
Read more of this story at Slashdot.
Unauthorized AI Bot Experiment Infiltrated Reddit To Test Persuasion Capabilities
Read more of this story at Slashdot.
Dyson Founder Says He Has Lived a 'Life of Failure'
Read more of this story at Slashdot.
IBM Pledges $150 Billion US Investment
Read more of this story at Slashdot.
'Don't Make Google Sell Chrome'
Read more of this story at Slashdot.
Widespread Power Outage Is Reported in Spain, France and Portugal
Read more of this story at Slashdot.
America's Electric Vehicle Sales Have Jumped 10.6% Compared to 2024
Read more of this story at Slashdot.
AI Helps Unravel a Cause of Alzheimer's Disease and Identify a Therapeutic Candidate
Read more of this story at Slashdot.
CodeSOD: Objectifying Yourself
"Boy, stringly typed data is hard to work with. I wish there were some easier way to work with it!"
This, presumably, is what Gary's predecessor said. Followed by, "Wait, I have an idea!"
public static Object createValue(String string) { Object value = parseBoolean(string); if (value != null) { return value; } value = parseInteger(string); if (value != null) { return value; } value = parseDouble(string); if (value != null) { return value; } return string; }This takes a string, and then tries to parse it, first into a boolean, failing that into an integer, and failing that into a double. Otherwise, it returns the original string.
And it returns an object, which means you still get to guess what's in there even after this. You just get to guess what it returned, and hope you cast it to the correct type. Which means this almost certainly is called like this:
boolean myBoolField = (Boolean)createValue(someStringContainingABool);Which makes the whole thing useless, which is fun.
Gary found this code in a "long since abandoned" project, and I can't imagine why it ended up getting abandoned.
[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.Could a 'Math Genius' AI Co-author Proofs Within Three Years?
Read more of this story at Slashdot.
Nuclear Fusion Pioneer Abandons Plan for Prototype Reactor, Will License Reaction-Boosting Nuclear Fuel Capsule
Read more of this story at Slashdot.
To 'Reclaim Future-Making', Amazon Workers Published a Collection of Science Fiction Stories
Read more of this story at Slashdot.
Russian Satellite Linked to Its Nuclear Anti-Satellite Weapon Program Appears Out of Control, Analyst says
Read more of this story at Slashdot.
Starbucks Opens Its First 3D-Printed Store
Read more of this story at Slashdot.
Consumers Aren't Flocking to Microsoft's AI Tool 'Copilot'
Read more of this story at Slashdot.
Google's DeepMind UK Team Reportedly Seeks to Unionize
Read more of this story at Slashdot.
WSJ: Tech-Industry Workers Now 'Miserable', Fearing Layoffs, Working Longer Hours
Read more of this story at Slashdot.
Canadian University Cancels Coding Competition Over Suspected AI Cheating
Read more of this story at Slashdot.