Feed aggregator
Employee Monitoring App Leaks 21 Million Screenshots In Real Time
Read more of this story at Slashdot.
Microsoft Brings Native PyTorch Arm Support To Windows Devices
Read more of this story at Slashdot.
AMD Publishes Open-Source GIM Driver For GPU Virtualization, Radeon 'In The Roadmap'
Read more of this story at Slashdot.
New Android Spyware Is Targeting Russian Military Personnel On the Front Lines
Read more of this story at Slashdot.
South Korea Says DeepSeek Transferred User Data, Prompts Without Consent
Read more of this story at Slashdot.
Apple To Strip Secret Robotics Unit From AI Chief Weeks After Moving Siri
Read more of this story at Slashdot.
India's Delhi Plans To Curb Gasoline Car Sales, Ban Gas-Guzzling Bikes To Shed Polluter Tag
Read more of this story at Slashdot.
11-Year-Old GTA V Dominated Twitch in 2024
Read more of this story at Slashdot.
Google AI Fabricates Explanations For Nonexistent Idioms
Read more of this story at Slashdot.
Young Men in US Abandoning College Education at Record Rates
Read more of this story at Slashdot.
AI Tackles Aging COBOL Systems as Legacy Code Expertise Dwindles
Read more of this story at Slashdot.
AI Compute Costs Drive Shift To Usage-Based Software Pricing
Read more of this story at Slashdot.
Even the US Government Says AI Requires Massive Amounts of Water
Read more of this story at Slashdot.
New Smartphone Labels For Battery Life and Repairability Are Coming To the EU
Read more of this story at Slashdot.
Microsoft Offers Underperformers Cash To Quit
Read more of this story at Slashdot.
Hackers Can Now Bypass Linux Security Thanks To Terrifying New Curing Rootkit
Read more of this story at Slashdot.
Scientists Say They Can Calculate the Cost of Oil Giants' Role In Global Warming
Read more of this story at Slashdot.
Hubble Celebrates 35th Year In Orbit
Read more of this story at Slashdot.
Quantum Messages Travel 254 km Using Existing Infrastructure For the First Time
Read more of this story at Slashdot.
CodeSOD: Tangled Up in Foo
DZ's tech lead is a doctor of computer science, and that doctor loves to write code. But you already know that "PhD" stands for "Piled high and deep", and that's true of the tech lead's clue.
For example, in C#:
private List<Foo> ExtractListForId(string id) { List<Foo> list = new List<Foo>(); lock (this) { var items = _foos.Where(f => f.Id == id).ToList(); foreach (var item in items) { list.Add(item); } } return list; }The purpose of this function is to find all the elements in a list where they have a matching ID. That's accomplished in one line: _foo.Where(f => f.Id == id). For some reason, the function goes through the extra step of iterating across the returned list and constructing a new one. There's no real good reason for this, though it does force LINQ to be eager- by default, the Where expression won't be evaluated until you check the results.
The lock is in there for thread safety, which hey- the enumerator returned by Where is not threadsafe, so that's not a useless thing to do there. But it's that lock which hints at the deeper WTF here: our PhD-having-tech-lead knows that adding threads ensures you're using more of the CPU, and they've thrown threads all over the place without any real sense to it. There's no clear data ownership of any given thread, which means everything is locked to hell and back, the whole thing frequently deadlocks, and it's impossible to debug.
It's taken days for DZ to get this much of a picture of what's going on in the code, and further untangling of this multithreaded pile of spaghetti is going to take many, many more days- and much, much more of DZ's sanity.
[Advertisement] Picking up NuGet is easy. Getting good at it takes time. Download our guide to learn the best practice of NuGet for the Enterprise.