Computer

CodeSOD: I Am Not 200

The Daily WTF - Tue, 2025-08-19 08:30

In theory, HTTP status codes should be easy to work with. In the 100s? You're doing some weird stuff and breaking up large requests into multiple sub-requests. 200s? It's all good. 300s? Look over there. 400s? What the hell are you trying to do? 500s? What the hell is the server trying to do?

This doesn't mean people don't endlessly find ways to make it hard. LinkedIn, for example, apparently likes to send 999s if you try and view a page without being logged in. Shopify has invented a few. Apache has added a 218 "This is Fine". And then there's WebDAV, which not only adds new status codes, but adds a whole bunch of new verbs to HTTP requests.

Francesco D sends us a "clever" attempt at handling status codes.

try { HttpRequest.Builder localVarRequestBuilder = {{operationId}}RequestBuilder({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}headers); return memberVarHttpClient.sendAsync( localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { if (localVarResponse.statusCode()/ 100 != 2) { return CompletableFuture.failedFuture(getApiException("{{operationId}}", localVarResponse)); } {{#returnType}} try { String responseBody = localVarResponse.body(); return CompletableFuture.completedFuture( responseBody == null || responseBody.isBlank() ? null : memberVarObjectMapper.readValue(responseBody, new TypeReference<{{{returnType}}}>() {}) ); } catch (IOException e) { return CompletableFuture.failedFuture(new ApiException(e)); } {{/returnType}} {{^returnType}} return CompletableFuture.completedFuture(null); {{/returnType}} }); }

Okay, before we get to the status code nonsense, I first have to whine about this templating language. I'm generally of the mind that generated code is a sign of bad abstractions, especially if we're talking about using a text templating engine, like this. I'm fine with hygienic macros, and even C++'s templating system for code generation, because they exist within the language. But fine, that's just my "ok boomer" opinion, so let's get into the real meat of it, which is this line:

localVarResponse.statusCode()/ 100 != 2

"Hey," some developer said, "since success is in the 200 range, I'll just divide by 100, and check if it's a 2, helpfully truncating the details." Which is fine and good, except neither 100s nor 300s represent a true error, especially because if the local client is doing caching, a 304 tells us that we can used the cached version.

For Francesco, treating 300s as an error created a slew of failed requests which shouldn't have failed. It wasn't too difficult to detect- they were at least logging the entire response- but it was frustrating, if only because it seems like someone was more interested in being clever with math than actually writing good software.

[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.
Categories: Computer

US Spy Chief Gabbard Says UK Agreed To Drop 'Backdoor' Mandate for Apple

Slashdot - Tue, 2025-08-19 06:30
The UK government has agreed to withdraw its order requiring Apple to create backdoor access to encrypted iCloud data following intervention from the Trump administration. Vice President JD Vance negotiated the agreement during his recent UK holiday after the January order issued under the UK Investigatory Powers Act prompted Apple to pull its iCloud Advanced Data Protection service from Britain in February. Director of National Intelligence Tulsi Gabbard said the UK agreed to drop demands for access to "the protected encrypted data of American citizens." Apple had filed a complaint with the Investigatory Powers Tribunal scheduled for hearing early next year.

Read more of this story at Slashdot.

Categories: Computer, News

OpenAI Launches $4.6 Budget AI Subscription Tier in India

Slashdot - Tue, 2025-08-19 05:33
OpenAI has launched ChatGPT Go, a $4.57 monthly subscription tier initially available only in India. The service provides, compared to the free tier, extended access to GPT-5, image generation, file uploads, advanced data analysis, longer conversation memory, and custom GPTs at Rs 399 per month. ChatGPT Go excludes features found in the $20 ChatGPT Plus tier including legacy models like 4o, Sora video generation, deep research, agent mode, and connectors. OpenAI said "other countries and regions may be eligible in the future" for ChatGPT Go. India has emerged as a key market for American technology firms looking for users. In the past 15 years, firms like Amazon, Google, and Meta, alongside venture capitalists and private equity, have poured more than $200 billion into the country, all chasing its vast pool of users and the businesses serving this population. India is the second largest market for OpenAI, startup's chief executive Sam Altman said in a podcast recently. Perplexity partnered with Indian telecoms giant Bharti Airtel last month to provide its premium Pro service to 360 million customers for free for an entire year.

Read more of this story at Slashdot.

Categories: Computer, News

Intel is Getting a $2 Billion Investment From SoftBank

Slashdot - Tue, 2025-08-19 04:02
Intel and SoftBank announced on Monday that the Japanese conglomerate will make a $2 billion investment the embattled chipmaker. SoftBank will pay $23 per share for Intel's common stock. The investment is a vote of confidence in Intel, which has not been able to take advantage of the AI boom in advanced semiconductors and has spent heavily to stand up a manufacturing business that has yet to secure a significant customer. "Masa and I have worked closely together for decades, and I appreciate the confidence he has placed in Intel with this investment," Intel CEO Lip-Bu Tan said in a statement. Intel shares lost 60% of their value last year, their worst performance in the company's more than half-century on the public market.

Read more of this story at Slashdot.

Categories: Computer, News

Why Did Hollywood Stop Making Comedies? A Statistical Analysis

Slashdot - Tue, 2025-08-19 03:01
Hollywood comedy production has declined 27% since 1990 despite audience demand ranking the genre second among those viewers "want to see more of," according to Letterboxd genre data and a 68,000-consumer survey. Comedy films average $26.5 million production budgets and double their investment returns at 102%, yet represent just 9.3% of sequel releases compared to action's 27.6%. The shift reflects studios prioritizing internationally marketable franchises over domestically-focused comedies, which earn most revenue from US and Canadian audiences. Films like 1984's Beverly Hills Cop ($977 million inflation-adjusted) and Ghostbusters ($882 million) remain unmatched by contemporary releases -- with half of Letterboxd's most popular 2020s "comedies" being either non-comedic films like Saltburn or IP-driven movies like Barbie.

Read more of this story at Slashdot.

Categories: Computer, News

Fujifilm Announces Second US Price Increase in August

Slashdot - Tue, 2025-08-19 02:01
Fujifilm will increase prices on most of its US camera lineup starting August 30, marking the second price adjustment this month following retailer-announced increases two weeks earlier. The company cited "volatile market conditions" in its official statement. The recently released X half and X-E5 cameras will maintain their launch prices, while the backordered X100 VI faces price changes. The company characterized the adjustments as a long-term solution to uncertainties including tariffs and manufacturing circumstances.

Read more of this story at Slashdot.

Categories: Computer, News

How Can England Possibly Be Running Out of Water?

Slashdot - Tue, 2025-08-19 01:23
England has declared a "nationally significant" water shortage as reservoirs dropped to 67.7% capacity, their lowest levels in at least a decade. The UK Centre for Ecology and Hydrology warned of exceptionally low river flows while groundwater continues dwindling across the country. Hosepipe bans now affect all of England, with additional restrictions probable in coming months. Water companies lose approximately one trillion litres annually through leaky pipes -- 20% of all treated water -- while the annual pipe replacement rate remains at 0.05%. No new reservoir has been built in 30 years despite population growth. Government forecasts project England's public water supply could fall short by 5 billion litres daily by 2055 without urgent infrastructure investment. The economic cost of water scarcity could reach $11.48 billion over this parliament, according to thinktank Public First.

Read more of this story at Slashdot.

Categories: Computer, News

AI 'Business Agents' Will Kill SaaS by 2030, Says Microsoft

Slashdot - Mon, 2025-08-18 20:01
Traditional business applications will become the mainframes of the 2030s - functioning but obsolete systems replaced by AI agents, predicts Microsoft corporate vice president Charles Lamanna. AI agents featuring generative AI interfaces, goal-oriented processing, and vector databases will supplant today's form-driven, workflow-based enterprise software within five years, said Lamanna, who leads Microsoft's business applications and platforms division. The executive projects industry patterns for agent-based systems will solidify within 6-18 months. Microsoft MVP Rocky Lhotka called the 2030 timeline "very forward-looking and optimistic," noting that capital-intensive industries cannot readily replace existing infrastructure with virtual agents.

Read more of this story at Slashdot.

Categories: Computer, News

Pages