Computer
AI Models Are Starting To Crack High-Level Math Problems
Read more of this story at Slashdot.
Warhammer Maker Games Workshop Bans Its Staff From Using AI In Its Content or Designs
Read more of this story at Slashdot.
Britain Awards Wind Farm Contracts That Will Power 12 Million Homes
Read more of this story at Slashdot.
CodeSOD: A Sudden Tern
Matthias sends us what he calls the "tern of the century". Which, before I share it with you: bad news, it's just a regular bad ternary. But it remains bad in interesting ways, so it's definitely worth talking about. But let's not oversell it.
private static String getOrderTypeCode(CreateOrderRequest order) { return !StringUtils.isBlank(order.getOrderParams().getReceivingCompanyFoo()) && ORDR_TP_DQQ_FOO.equals(order.getOrderParams().getOrderType()) ? ORDR_TP_DQQ_BAR_CDE : order.GetOrderParams().getOrderType().getOrderTypeCode(); }This function takes an order, and inspects it to figure out the type of order it represents. The logic is this: if the receiving company has the "foo" property set, and the order is already set to type "Foo", then we return the "bar" code (not a bar code- Matthias is using "foo" and "bar" as anonymous placeholders), otherwise we return whatever order type code that was set on the order type.
Now, I've left this all on one line, as it is in the codebase, which certainly helps with the WTF feeling of the whole thing. Protip: don't write ternaries that need to wrap across three lines to be readable.
This is messy and unreadable, but by ternary standards it's just regular bad. No, the thing that is driving me up the wall is the code-golfy constant names. ORDR is short for ORDER. CDE is CODE. I have no idea what TP or DQQ stand for. But I see no good reason to turn every constant into the name of some droid loitering around Jabba's Palace in Star Wars just to save a few keystrokes.
I'd be less bothered if the abbreviations were more cryptic, but just dropping a middle vowel from "ORDER" sits in this bizarre half-point between "exists as meaningless jargon, good luck" and "I wrote something readable". I'd be less annoyed if it were more of a WTF.
[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.The Swedish Start-Up Aiming To Conquer America's Full-Body-Scan Craze
Read more of this story at Slashdot.
Are QWERTY Phones Trying To Make a Comeback?
Read more of this story at Slashdot.
Digg Launches Its New Reddit Rival To the Public
Read more of this story at Slashdot.
Cerebras Scores OpenAI Deal Worth Over $10 Billion
Read more of this story at Slashdot.
DoorDash and UberEats Cost Drivers $550 Million In Tips, NYC Says
Read more of this story at Slashdot.
US Approves Sale of Nvidia's Advanced AI Chips To China
Read more of this story at Slashdot.
Bandcamp Bans AI Music
Read more of this story at Slashdot.
House Sysadmin Stole 200 Phones, Caught By House IT Desk
Read more of this story at Slashdot.
UK Scraps Mandatory Digital ID Enrollment for Workers After Public Backlash
Read more of this story at Slashdot.
Dell Tells Staff To Get Ready For the 'Biggest Transformation in Company History'
Read more of this story at Slashdot.
NASA Acknowledges Record Heat But Avoids Referencing Climate Change
Read more of this story at Slashdot.
Widespread Verizon Outage Prompts Emergency Alerts in Washington, New York City
Read more of this story at Slashdot.
Beijing Tells Chinese Firms To Stop Using US and Israeli Cybersecurity Software
Read more of this story at Slashdot.
Coal Power Generation Falls in China and India for First Time Since 1970s
Read more of this story at Slashdot.
McKinsey Asks Graduates To Use AI Chatbot in Recruitment Process
Read more of this story at Slashdot.
Bezos's Vision of Rented Cloud PCs Looks Less Far-Fetched
Read more of this story at Slashdot.
