AI Helps Unravel a Cause of Alzheimer's Disease and Identify a Therapeutic Candidate
Read more of this story at Slashdot.
Inside the story of Britain's messiest garden: How recluse's overgrown jungle engulfed his home and TWO vans... but what does it look like now?
Three-bedroom family home on sale for £310,000 mocked for tiny 'standing living room'
Revealed in a new book on the Prime Minister's first months in power, a bombshell claim from senior Labour insiders... Why even Keir Starmer's inner circle want to see Wes Streeting in Number 10, writes LORD ASHCROFT
Liverpool won this title for one very good reason - they deserved it, writes GRAEME SOUNESS
What the **** did you put in that code? The client thinks it's a cyberattack
Who, Me? Welcome to another Monday morning! We hope your weekend could be described in pleasant terms. That's what The Register strives for at this time of week in each installment of "Who, Me?" – the column that shares your stories of making decidedly unpleasant mistakes and somehow mopping up afterwards.…
New York lawmakers take brutal U-turn on Tesla in stunning blow to Elon Musk
Bombshell new report reveals who made fatal mistake that caused Black Hawk to collide with jet and kill 67
Google admits depreciation costs are soaring amid furious bit barn build
Google says the mega capital splurge on datacenters in recent years is putting more strain on its balance sheet due to rising depreciation costs, yet it still plans to splash $75 billion on bit barns in 2025.…
Freed From Desire! Trent Alexander-Arnold leads the Liverpool dressing room celebrations as newly-crowned champions sing and dance, smoke cigars and drink non-alcoholic beers
The truth behind viral video of Darwin Nunez pouring beer over stunned Mohamed Salah which infuriated some Liverpool fans during title celebrations
Paula Radcliffe shares emotional clip of her daughter, Isla, 18, crossing the London Marathon finishing line after battling ovarian cancer age 13
Vogue Williams makes heartbreaking admission about struggling with disordered eating from the age of 16 during her early modelling days
The killer women of Shakespeare's era and the torturous methods they used to murder the men (and women) who crossed them
Why the CCTV control room was unmanned for the 100 seconds when crazed killer stabbed six people at Westfield Bondi Junction
Joel Dommett reveals he woke up in an ambulance after FAINTING at mile 17 during London Marathon - following the exhausted star sharing glimpse of his hectic pre-race schedule
JoJo Siwa's heartbroken ex Kath Ebbs likes cryptic comment about Dance Moms star 'falling in love' with Chris Hughes on Celebrity Big Brother
The Sydney restaurant Nigella Lawson can't wait to visit as she prepares to return - and it's a firm favourite with Australia's top chefs
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.