Computer
AMD Overtakes Intel in Datacenter Sales For First Time
Read more of this story at Slashdot.
Degradation of Land is Threat To Human Life, Saudi Government Says
Read more of this story at Slashdot.
Apple Warns Investors Future Products May Never Be as Profitable as iPhone
Read more of this story at Slashdot.
Google's Big Sleep LLM Agent Discovers Exploitable Bug In SQLite
Read more of this story at Slashdot.
Delhi Wants Artificial Rain To Tackle Worsening Air Pollution
Read more of this story at Slashdot.
India Issues Notice To Wikipedia Over Concerns of Bias
Read more of this story at Slashdot.
Apple Explores Push Into Smart Glasses With 'Atlas' User Study
Read more of this story at Slashdot.
Meta Permits Its AI Models To Be Used For US Military Purposes
Read more of this story at Slashdot.
US Regulator Rejects Bid To Boost Nuclear Power To Amazon Data Center
Read more of this story at Slashdot.
Researchers Spot Black Hole Eating Stuff At Over 40x the Theoretical Limit
Read more of this story at Slashdot.
CodeSOD: Counting it All
Since it's election day in the US, many people are thinking about counting today. We frequently discuss counting here, and how to do it wrong, so let's look at some code from RK.
This code may not be counting votes, but whatever it's counting, we're not going to enjoy it:
case LogMode.Row_limit: // row limit excel = 65536 rows if (File.Exists(personalFolder + @"\" + fileName + ".CSV")) { using (StreamReader reader = new StreamReader(personalFolder + @"\" + fileName + ".CSV")) { countRows = reader.ReadToEnd().Split(new char[] { '\n' }).Length; } }Now, this code is from a rather old application, originally released in 2007. So the comment about Excel's row limit really puts us in a moment in time- Excel 2007 raised the row limit to 1,000,000 rows. But older versions of Excel did cap out at 65,536. And it wasn't the case that everyone just up and switched to Excel 2007 when it came out- transitioning to the new Office file formats was a conversion which took years.
But we're not even reading an Excel file, we're reading a CSV.
I enjoy that we construct the name twice, because that's useful. But the real magic of this one is how we count the rows. Because while Excel can handle 65,536 rows at this time, I don't think this program is going to do a great job of it- because we read the entire file into memory with ReadToEnd, then Split on newlines, then count the length that way.
As you can imagine, in practice, this performed terribly on large files, of which there were many.
Unfortunately for RK, there's one rule about old, legacy code: don't touch it. So despite fixing this being a rather easy task, nobody is working on fixing it, because nobody wants to be the one who touched it last. Instead, management is promising to launch a greenfield replacement project any day now…
[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.Sweden Scraps Plans For 13 Offshore Windfarms Over Russia Security Fears
Read more of this story at Slashdot.
visionOS 2.2 Beta Adds Wide and Ultrawide Modes To Mac Virtual Display
Read more of this story at Slashdot.
Netflix Is Removing Nearly All of Its Interactive Titles
Read more of this story at Slashdot.
Robinhood and Kraken Launch New Global Stablecoin Network With Paxos' USDG
Read more of this story at Slashdot.
Perplexity CEO Offers To Replace Striking NYT Staff With AI
Read more of this story at Slashdot.
Prime Video Will Let You Summon AI To Recap What You're Watching
Read more of this story at Slashdot.
FFmpeg Devs Boast of Up To 94x Performance Boost After Implementing Handwritten AVX-512 Assembly Code
Read more of this story at Slashdot.
Perplexity Will Show Live US Election Results Despite AI Accuracy Warnings
Read more of this story at Slashdot.
Windows 11 Continues To Creep Up Behind Windows 10
Read more of this story at Slashdot.