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

      CodeSOD: A Unique Way to Primary Key

      July 22, 2025

      BrowserStack launches Figma plugin for detecting accessibility issues in design phase

      July 22, 2025

      Parasoft brings agentic AI to service virtualization in latest release

      July 22, 2025

      Node.js vs. Python for Backend: 7 Reasons C-Level Leaders Choose Node.js Talent

      July 21, 2025

      The best CRM software with email marketing in 2025: Expert tested and reviewed

      July 22, 2025

      This multi-port car charger can power 4 gadgets at once – and it’s surprisingly cheap

      July 22, 2025

      I’m a wearables editor and here are the 7 Pixel Watch 4 rumors I’m most curious about

      July 22, 2025

      8 ways I quickly leveled up my Linux skills – and you can too

      July 22, 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

      The Intersection of Agile and Accessibility – A Series on Designing for Everyone

      July 22, 2025
      Recent

      The Intersection of Agile and Accessibility – A Series on Designing for Everyone

      July 22, 2025

      Zero Trust & Cybersecurity Mesh: Your Org’s Survival Guide

      July 22, 2025

      Execute Ping Commands and Get Back Structured Data in PHP

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

      A Tomb Raider composer has been jailed — His legacy overshadowed by $75k+ in loan fraud

      July 22, 2025
      Recent

      A Tomb Raider composer has been jailed — His legacy overshadowed by $75k+ in loan fraud

      July 22, 2025

      “I don’t think I changed his mind” — NVIDIA CEO comments on H20 AI GPU sales resuming in China following a meeting with President Trump

      July 22, 2025

      Galaxy Z Fold 7 review: Six years later — Samsung finally cracks the foldable code

      July 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

    The best CRM software with email marketing in 2025: Expert tested and reviewed

    July 22, 2025
    News & Updates

    This multi-port car charger can power 4 gadgets at once – and it’s surprisingly cheap

    July 22, 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

    10 Best Free and Open Source Linux Satellite Tools

    Linux

    CVE-2024-13931 – ASPECT Relative Path Traversal File Access Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    The Human Heart Behind Great UX

    Web Development

    The impressive pocket-sized projector casts an 80-inch video – and it’s on sale

    News & Updates

    Highlights

    The AI Fix #45: The Turing test falls to GPT-4.5

    April 8, 2025

    In episode 45 of The AI Fix, our hosts discover that ChatGPT is running the…

    Microsoft brings Copilot Notebooks to OneNote for enterprise users

    June 15, 2025

    CVE-2025-2987 – IBM Maximo Asset Management SSRF

    April 21, 2025

    CVE-2025-5939 – Telegram for WP WordPress Stored Cross-Site Scripting Vulnerability

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

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