Computer
Posthumous AI Avatars Shift From Memorial Tools To Revenue Generators
Read more of this story at Slashdot.
Citi Executive Warns Stablecoin Yields Could Drain Bank Deposits
Read more of this story at Slashdot.
Korean Air Inks Record $50 Billion US Aviation Deal
Read more of this story at Slashdot.
Workplace Jargon Hurts Employee Morale and Collaboration, Study Finds
Read more of this story at Slashdot.
CodeSOD: The HTML Print Value
Matt was handed a pile of VB .Net code, and told, "This is yours now. I'm sorry."
As often happens, previous company leadership said, "Why should I pay top dollar for experienced software engineers when I can hire three kids out of college for the same price?" The experiment ended poorly, and the result was a pile of bad VB code, which Matt now owned.
Here's a little taste:
// SET IN SESSION AND REDIRECT TO PRINT PAGE Session["PrintValue"] = GenerateHTMLOfItem(); Response.Redirect("PrintItem.aspx", true);The function name here is accurate. GenerateHTMLOfItem takes an item ID, generates the HTML output we want to use to render the item, and stores it in a session variable. It then forces the browser to redirect to a different page, where that HTML can then be output.
You may note, of course, that GenerateHTMLOfItem doesn't actually take parameters. That's because the item ID got stored in the session variable elsewhere.
Of course, it's the redirect that gets all the attention here. This is a client side redirect, so we generate all the HTML, shove it into a session object, and then send a message to the web browser: "Go look over here". The browser sends a fresh HTTP request for the new page, at which point we render it for them.
The Microsoft documentation also has this to add about the use of Response.Redirect(String, Boolean), as well:
Calling Redirect(String) is equivalent to calling Redirect(String, Boolean) with the second parameter set to true. Redirect calls End which throws a ThreadAbortException exception upon completion. This exception has a detrimental effect on Web application performance. Therefore, we recommend that instead of this overload you use the HttpResponse.Redirect(String, Boolean) overload and pass false for the endResponse parameter, and then call the CompleteRequest method. For more information, see the End method.
I love it when I see the developers do a bonus wrong.
Matt had enough fires to put out that fixing this particular disaster wasn't highest on his priority list. For the time being, he could only add this comment:
// SET IN SESSION AND REDIRECT TO PRINT PAGE // FOR THE LOVE OF GOD, WHY?!? Session["PrintValue"] = GenerateHTMLOfItem(); Response.Redirect("PrintItem.aspx", true); [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.Pig Lung Transplanted Into a Human In Major Scientific First
Read more of this story at Slashdot.
Canada's Tech Job Market Has Gone From Boom To Bust In Last Five Years
Read more of this story at Slashdot.
Google Improves Gemini AI Image Editing With 'Nano Banana' Model
Read more of this story at Slashdot.
Dish Gives Up On Becoming the Fourth Major Wireless Carrier
Read more of this story at Slashdot.
Cupertino Must Stop Calling Apple Watches 'Carbon Neutral,' German Court Rules
Read more of this story at Slashdot.
Hosting.com Acquires Rocket.net To Expand Global WordPress Hosting Business
Read more of this story at Slashdot.
Apple Discussed Buying Mistral AI and Perplexity
Read more of this story at Slashdot.
Parents Sue OpenAI Over ChatGPT's Role In Son's Suicide
Read more of this story at Slashdot.
Anthropic Settles Major AI Copyright Suit Brought by Authors
Read more of this story at Slashdot.
Michigan Supreme Court Rules Unrestricted Phone Searches Violate Fourth Amendment
Read more of this story at Slashdot.
Air Pollution From Oil and Gas Causes 90,000 Premature US Deaths Each Year, Says New Study
Read more of this story at Slashdot.
Scientists Unlock Secret To Thick, Stable Beer Foams
Read more of this story at Slashdot.
Google is Building a Duolingo Rival Into the Translate App
Read more of this story at Slashdot.
LibreOffice Stakes Claim as Strategic Sovereignty Tool For Governments
Read more of this story at Slashdot.
Video Platform Kick Investigated Over Streamer's Death
Read more of this story at Slashdot.