Feed aggregator
Apple Tags EU Apps Using Alternative Payments With Warning Symbols
Read more of this story at Slashdot.
Google Dominates AI Patent Applications
Read more of this story at Slashdot.
FTC Delays 'Click To Cancel' Rule Implementation To July
Read more of this story at Slashdot.
Coinbase Offers $20 Million Bounty To Catch Data Thieves After Extortion Attempt
Read more of this story at Slashdot.
ChatGPT Diminishes Idea Diversity in Brainstorming, Study Finds
Read more of this story at Slashdot.
Microsoft Layoffs Hit Coders Hardest With AI Costs on the Rise
Read more of this story at Slashdot.
CoreWeave To Spend Up To $23 Billion This Year To Tap AI Demand Boom
Read more of this story at Slashdot.
Trump Tells Apple CEO To Avoid Manufacturing in India
Read more of this story at Slashdot.
First US Hub For Experimental Medical Treatments Is Coming
Read more of this story at Slashdot.
CodeSOD: A Jammed Up Session
Andre has inherited a rather antique ASP .Net WebForms application. It's a large one, with many pages in it, but they all follow a certain pattern. Let's see if you can spot it.
protected void btnSearch_Click(object sender, EventArgs e) { ArrayList paramsRel = new ArrayList(); paramsRel["Name"] = txtNome.Text; paramsRel["Date"] = txtDate.Text; Session["paramsRel"] = paramsRel; List<Client> clients = Controller.FindClients(); //Some other code }Now, at first glance, this doesn't look terrible. Using an ArrayList as a dictionary and frankly, storing a dictionary in the Session object is weird, but it's not an automatic red flag. But wait, why is it called paramsRel? They couldn't be… no, they wouldn't…
public List<Client> FindClients() { ArrayList paramsRel = (ArrayList)Session["paramsRel"]; string name = (string)paramsRel["Name"]; string dateStr = (string)paramsRel["Date"]; DateTime date = DateTime.Parse(dateStr); //More code... }Now there's the red flag. paramsRel is how they pass parameters to functions. They stuff it into the Session, then call a function which retrieves it from that Session.
This pattern is used everywhere in the application. You can see that there's a vague gesture in the direction of trying to implement some kind of Model-View-Controller pattern (as FindClients is a member of the Controller object), but that modularization gets undercut by everything depending on Session as a pseudoglobal for passing state information around.
The only good news is that the Session object is synchronized so there's no thread safety issue here, though not for want of trying.
.comment { border: none; } [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.Klarna Pivots Back To Humans After AI Experiment Fails
Read more of this story at Slashdot.
Google DeepMind Creates Super-Advanced AI That Can Invent New Algorithms
Read more of this story at Slashdot.
Microsoft Cuts Off Access To Bing Search Data as It Shifts Focus To Chatbots
Read more of this story at Slashdot.
'Aggressive' Hackers of UK Retailers Are Now Targeting US Stores, Says Google
Read more of this story at Slashdot.
Netflix Says Its Ad Tier Now Has 94 Million Monthly Active Users
Read more of this story at Slashdot.
iPhone Shipments Crash 50% In China As Local Brands Dominate
Read more of this story at Slashdot.
Microsoft Is Open-Sourcing Its Linux Integration Services Automation Image-Testing Service
Read more of this story at Slashdot.
NordVPN Finally Gets a Proper GUI On Linux
Read more of this story at Slashdot.
Uber To Introduce Fixed-Route Shuttles In Major US Cities
Read more of this story at Slashdot.
Valve Takes Another Step Toward Making SteamOS a True Windows Competitor
Read more of this story at Slashdot.