US Copyright Office found AI companies sometimes breach copyright. Next day its boss was fired
The head of the US Copyright Office has reportedly been fired, the day after agency concluded that builders of AI models use of copyrighted material went beyond existing doctrines of fair use.…
CodeSOD: Would a Function by Any Other Name Still be WTF?
"Don't use exception handling for normal flow control," is generally good advice. But Andy's lead had a PhD in computer science, and with that kind of education, wasn't about to let good advice or best practices tell them what to do. That's why, when they needed to validate inputs, they wrote code C# like this:
public static bool IsDecimal(string theValue) { try { Convert.ToDouble(theValue); return true; } catch { return false; } }They attempt to convert, and if they succeed, great, return true. If they fail, an exception gets caught, and they return false. What could be simpler?
Well, using the built in TryParse function would be simpler. Despite its name, actually avoids throwing an exception, even internally, because exceptions are expensive in .NET. And it is already implemented, so you don't have to do this.
Also, Decimal is a type in C#- a 16-byte floating point value. Now, I know they didn't actually mean Decimal, just "a value with 0 or more digits behind the decimal point", but pedantry is the root of clarity, and the naming convention makes this bad code unclear about its intent and purpose. Per the docs there are Single and Double values which can't be represented as Decimal and trigger an OverflowException. And conversely, Decimal loses precision if converted to Double. This means a value that would be represented as Decimal might not pass this function, and a value that can't be represented as Decimal might, and none of this actually matters but the name of the function is bad.
The astonishing sum Liam Payne's son Bear could inherit at age 18 when he is entitled to his father's £24m fortune - and why the taxman WON'T be happy
Long-awaited health centre in Chelmsford estate planning for summer opening 'at last'
Meghan Markle's half-brother reveals he is penning new tell-all book about his famous sibling after relocating to the Philippines with their father
King George's overwhelming realisation following Edward VIII's departure - which got him sobbing on his mother's shoulder for an hour
Girl, 6, had routine appendix op - she died weeks later
Three arrested after 'altercation' at Essex restaurant left man with head injury
All the savings rates that have been slashed since base rate cut, including Chip and Plum
Justin Baldoni breaks social media silence with emotional post amid ongoing Blake Lively legal war
Ben Affleck visits ex-wife Jennifer Garner on Mother's Day two months after THAT sexy clinch
Trump to accept $400 million 'flying palace' from Qatar royal family to use as Air Force One and will KEEP it after leaving office
50 Cent's rapper friend Bang Em Smurf is staying in a taxpayer-funded UK asylum hotel - after being jailed over a shootout in the US
Weight loss jabs like Ozempic 'could prevent the risk of cancers' as British researchers plan major trial to see if drugs can provide a new 'weapon' in fight against soaring rates of the disease
Kelly Osbourne on the 'horrible' agony of 'being fat' while famous
Labour's immigration crackdown criticised for not containing cap on numbers as Keir Starmer set to unveil plan in full that will mean arrivals will have to 'earn the right to stay' in Britain
Jaw-dropping moment New Mexico cops shoot at boys, aged seven and nine, after they refused to drop handgun
Demand for student digs and plush offices helping buoy commercial property 'revival'
Videogame's Players Launch Boycott Over Bugs, Story Changes, Monetization
Read more of this story at Slashdot.