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.