Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      A Week In The Life Of An AI-Augmented Designer

      August 22, 2025

      This week in AI updates: Gemini Code Assist Agent Mode, GitHub’s Agents panel, and more (August 22, 2025)

      August 22, 2025

      Microsoft adds Copilot-powered debugging features for .NET in Visual Studio

      August 21, 2025

      Blackstone portfolio company R Systems Acquires Novigo Solutions, Strengthening its Product Engineering and Full-Stack Agentic-AI Capabilities

      August 21, 2025

      I found the ultimate MacBook Air alternative for Windows users – and it’s priced well

      August 23, 2025

      Outdated IT help desks are holding businesses back – but there is a solution

      August 23, 2025

      Android’s latest update can force apps into dark mode – how to see it now

      August 23, 2025

      I tried the Google Pixel Watch 4 – and these key features made it feel indispensable

      August 23, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Building Cross-Platform Alerts with Laravel’s Notification Framework

      August 23, 2025
      Recent

      Building Cross-Platform Alerts with Laravel’s Notification Framework

      August 23, 2025

      Add Notes Functionality to Eloquent Models With the Notable Package

      August 23, 2025

      How to install OpenPlatform — IoT platform

      August 22, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Basics of Digital Forensics

      August 22, 2025
      Recent

      Basics of Digital Forensics

      August 22, 2025

      Top Linux Server Automation Tools: Simplifying System Administration

      August 22, 2025

      Rising from the Ashes: How AlmaLinux and Rocky Linux Redefined the Post-CentOS Landscape

      August 22, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»News & Updates»CodeSOD: Off Color

    CodeSOD: Off Color

    July 8, 2025

    Carolyn inherited a somewhat old project that had been initiated by a “rockstar” developer, and then passed to developer after developer over the years. They burned through rockstars faster than Spinal Tap goes through drummers. The result is gems like this:

    private void init(){
    	ResourceHelper rh = new ResourceHelper();
    	for ( int i = 0; i < 12; i++) {
    		months[i] = rh.getResource("calendar."+monthkeys[i]+".long");
    		months_s[i] = rh.getResource("calendar."+monthkeys[i]+".short");
    	}
    	StaticData data = SomeService.current().getStaticData();
    	this.bankHolidayList = data.getBankHolidayList();
    	colors.put("#dddddd", "#dddddd");
    	colors.put("#cccccc", "#cccccc");
    	colors.put("#e6e6e6", "#e6e6e6");
    	colors.put("#ff0000", "#ffcccc");
    	colors.put("#ffff00", "#ffffcc");
    	colors.put("#00ff00", "#ccffcc");
    	colors.put("#5050ff", "#ccccff");
    	colors.put("#aa0000", "#ff9999");
    	colors.put("#ff8000", "#ffcc99");
    	colors.put("#99ff99", "#ccffcc");
    	colors.put("#ffcc99", "#ffffcc");
    	colors.put("#ff9966", "#ffcc99");
    	colors.put("#00c040", "#99cc99");
    	colors.put("#aadddd", "#ccffff");
    	colors.put("#e0e040", "#ffff99");
    	colors.put("#6699ff", "#99ccff");
    }
    

    There are plenty of things in this function that raise concerns- whatever is going on with the ResourceHelper and the monthkeys array, for example. But let’s just breeze past that into that colors lookup table, because boy oh boy.

    There’s the obvious issue of using server-side code to manage colors instead of CSS, which is bad, sure. But this translation table which converts some colors (presumably already used in the display?) to some other colors (presumably to replace the display colors) is downright mystifying. How did this happen? Why did this happen? What happens when we attempt to apply a color not in the lookup table?

    I want to say more mean things about this, but the more I stare at the original colors and what they get translated to, I think this lookup table is trying to tell me I should…

    …
    …

    lighten up.

    [Advertisement]
    Keep the plebs out of prod. Restrict NuGet feed privileges with ProGet. Learn more.

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous Articledano – hashdeep/md5tree for media files
    Next Article CISA Adds 3 Flaws to KEV Catalog, Impacting AMI MegaRAC, D-Link, Fortinet

    Related Posts

    News & Updates

    I found the ultimate MacBook Air alternative for Windows users – and it’s priced well

    August 23, 2025
    News & Updates

    Outdated IT help desks are holding businesses back – but there is a solution

    August 23, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    CVE-2025-36506 – RICOH Streamline NX V3 PC Client File Path Traversal

    Common Vulnerabilities and Exposures (CVEs)

    Vertiv KVM IP Switch 8 Port Dealer & Price in Delhi, India

    Web Development

    CVE-2025-53489 – Wikimedia Foundation Mediawiki GoogleDocs4MW Extension Cross-Site Scripting (XSS)

    Common Vulnerabilities and Exposures (CVEs)

    Cloned Phones, Stolen Identities: The eSIM Hack No One Saw Coming

    Security

    Highlights

    How Voice AI Elevates Retail: Creating Consistent, Seamless Customer Experiences🛍️

    July 2, 2025

    Post Content Source: Read More 

    Lazarus APT Attacking Organizations by Exploiting One-Day vulnerabilities

    April 25, 2025

    U.S. Sanctions Funnull for $200M Romance Baiting Scams Tied to Crypto Fraud

    May 30, 2025

    Microsoft Targets ‘Critical AI Talent’ from Meta to Dominate Next AI Breakthroughs

    August 13, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.