Computer
Fintech Founder Charged With Fraud After 'AI' Shopping App Found To Be Powered By Humans in the Philippines
Read more of this story at Slashdot.
Data Centres Will Use Twice as Much Energy By 2030
Read more of this story at Slashdot.
OpenAI Expands ChatGPT Memory To Draw on Full Conversation History
Read more of this story at Slashdot.
Meta Says Llama 4 Targets Left-Leaning Bias
Read more of this story at Slashdot.
China To Restrict US Film Releases
Read more of this story at Slashdot.
Meta's New Tech Wants You Using Phones in Theaters
Read more of this story at Slashdot.
Gas Boiler Fittings Outnumbered Heat Pumps By 15 To One in UK Last Year - Report
Read more of this story at Slashdot.
Amazon CEO Urges 'Startup' Mentality in Shareholder Letter
Read more of this story at Slashdot.
Trump: Apple Building in China is 'Unsustainable,' Could Exempt Some Companies From Tariffs
Read more of this story at Slashdot.
Bank of England Says AI Software Could Create Market Crisis For Profit
Read more of this story at Slashdot.
CodeSOD: A Steady Ship
You know what definitely never changes? Shipping prices. Famously static, despite all economic conditions and the same across all shipping providers. It doesn't matter where you're shipping from, or to, you know exactly what the price will be to ship that package at all times.
Wait, what? You don't think that's true? It must be true, because Chris sent us this function, which calculates shipping prices, and it couldn't be wrong, could it?
public double getShippingCharge(String shippingType, bool saturday, double subTot) { double shCharge = 0.00; if(shippingType.Equals("Ground")) { if(subTot <= 29.99 && subTot > 0) { shCharge = 4.95; } else if(subTot <= 99.99 && subTot > 29.99) { shCharge = 7.95; } else if(subTot <= 299.99 && subTot > 99.99) { shCharge = 9.95; } else if(subTot > 299.99) { shCharge = subTot * .05; } } else if(shippingType.Equals("Two-Day")) { if(subTot <= 29.99 && subTot > 0) { shCharge = 14.95; } else if(subTot <= 99.99 && subTot > 29.99) { shCharge = 19.95; } else if(subTot <= 299.99 && subTot > 99.99) { shCharge = 29.95; } else if(subTot > 299.99) { shCharge = subTot * .10; } } else if(shippingType.Equals("Next Day")) { if(subTot <= 29.99 && subTot > 0) { shCharge = 24.95; } else if(subTot <= 99.99 && subTot > 29.99) { shCharge = 34.95; } else if(subTot <= 299.99 && subTot > 99.99) { shCharge = 44.95; } else if(subTot > 299.99) { shCharge = subTot * .15; } } else if(shippingType.Equals("Next Day a.m.")) { if(subTot <= 29.99 && subTot > 0) { shCharge = 29.95; } else if(subTot <= 99.99 && subTot > 29.99) { shCharge = 39.95; } else if(subTot <= 299.99 && subTot > 99.99) { shCharge = 49.95; } else if(subTot > 299.99) { shCharge = subTot * .20; } } return shCharge; }Next you're going to tell me that passing the shipping types around as stringly typed data instead of enums is a mistake, too!
[Advertisement] Utilize BuildMaster to release your software with confidence, at the pace your business demands. Download today!Lawmakers Are Skeptical of Zuckerberg's Commitment To Free Speech
Read more of this story at Slashdot.
Microsoft Windows 95 Reboot Chime and Minecraft Soundtrack Inducted Into National Recording Registry
Read more of this story at Slashdot.
US Army Says It Could Acquire Targets Faster With 'Advanced AI'
Read more of this story at Slashdot.
Anthropic Launches Its Own $200 Monthly Plan
Read more of this story at Slashdot.
WordPress Launches AI Site Builder Amid Company Restructuring
Read more of this story at Slashdot.
Google DeepMind Has a Weapon in the AI Talent Wars: Aggressive Noncompete Rules
Read more of this story at Slashdot.
Google Maps is Launching Tools To Help Cities Analyze Infrastructure and Traffic
Read more of this story at Slashdot.
Scientists Recreate Brain Circuit in Lab For First Time
Read more of this story at Slashdot.
The AI Therapist Can See You Now
Read more of this story at Slashdot.