Feed aggregator
Amazon To Shut Down Android Appstore
Read more of this story at Slashdot.
Canada Announces First High-Speed Rail Between Toronto and Quebec City
Read more of this story at Slashdot.
Palantir CEO Calls for Tech Patriotism, Warns of AI Warfare
Read more of this story at Slashdot.
CodeSOD: Every Day
There are real advantages to taking a functional programming approach to expressing problems. Well, some problems, anyway.
Kevin sends us this example of elegant, beautiful functional code in C#:
//create a range of dates List<DateTime> dates = Enumerable.Range (0, 1 + settings.EndDate.Subtract (settings.BeginDate).Days).Select (offset => settings.BeginDate.AddDays(offset)).ToList(); foreach (DateTime procDate in dates) { /*.snip.*/ }If you're not sure what this code does, it's okay- Kevin rewrote it and "ruined" it:
DateTime procDate = settings.BeginDate; while(procDate <= settings.EndDate) { /*.snip.*/ procDate= procDate.AddDays(1); }The goal of this code is simply to do something for every day within a range of dates. These two approaches vary a bit in terms of readability though.
I guess the loop in the functional version isn't mutating anything, I suppose. But honestly, I'm surprised that this didn't take the extra step of using the .ForEach function (which takes a lambda and applies it to each parameter). Heck, with that approach, they could have done this whole thing in a single statement.
[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.Microsoft Declutters Windows 11 File Explorer in the Name of Euro Privacy
Read more of this story at Slashdot.
China's Electric-Vehicle-To-Humanoid-Robot Pivot
Read more of this story at Slashdot.
Historic Ocean Liner Departs Philadelphia On Voyage To Become the World's Largest Artificial Reef
Read more of this story at Slashdot.
Murena Released a De-Googled Version of the Pixel Tablet
Read more of this story at Slashdot.
Valve Releases Team Fortress 2 Full Client and Source Code
Read more of this story at Slashdot.
Palo Alto Firewalls Under Attack As Miscreants Chain Flaws For Root Access
Read more of this story at Slashdot.
Microsoft Shows Progress Toward Real-Time AI-Generated Game Worlds
Read more of this story at Slashdot.
US Army Soldier Pleads Guilty To AT&T and Verizon Hacks
Read more of this story at Slashdot.
France Runs Fusion Reactor For Record 22 Minutes
Read more of this story at Slashdot.
Nikola Files for Bankruptcy With Plans To Sell Assets, Wind Down
Read more of this story at Slashdot.
Apple Launches the iPhone 16E, With In-House Modem and Support For AI
Read more of this story at Slashdot.
Microsoft Reveals Its First Quantum Computing Chip, the Majorana 1
Read more of this story at Slashdot.
All of Humane's AI Pins Will Stop Working in 10 Days
Read more of this story at Slashdot.
Microsoft Puts Notepad's AI Rewrite Feature Behind Paywall
Read more of this story at Slashdot.
Apple Says UK Regulator's Remedy Options on Mobile Browsers Will Hit Innovation
Read more of this story at Slashdot.
Google Builds AI 'Co-Scientist' Tool To Speed Up Research
Read more of this story at Slashdot.