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

      Droip: The Modern Website Builder WordPress Needed

      July 8, 2025

      Last week in AI dev tools: Cloudflare blocking AI crawlers by default, Perplexity Max subscription, and more (July 7, 2025)

      July 7, 2025

      Infragistics Launches Ultimate 25.1 With Major Updates to App Builder, Ignite UI

      July 7, 2025

      Design Guidelines For Better Notifications UX

      July 7, 2025

      There’s a massive 42% Amazon Prime Day discount on the Razer DeathAdder V3 Pro — One of the best gaming mice we gave a near-perfect score to

      July 8, 2025

      This 360Hz QD-OLED monitor is more than magnificent — and it’s $280 off right now

      July 8, 2025

      Diablo 4, one of Blizzard’s best Xbox games, is now 64% off — a devilish Anti-Amazon Prime Day discount that’s worth taking over Amazon’s deals

      July 8, 2025

      “One of the best and most premium charging accessories” — Razer Universal Quick Charging Stand for Xbox is 40% off

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

      AI and Digital Trends Marketing and IT Leaders Need to Know

      July 8, 2025
      Recent

      AI and Digital Trends Marketing and IT Leaders Need to Know

      July 8, 2025

      Blade Authorization Directives for View Security

      July 8, 2025

      Laravel AI Chat Starter Kit

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

      There’s a massive 42% Amazon Prime Day discount on the Razer DeathAdder V3 Pro — One of the best gaming mice we gave a near-perfect score to

      July 8, 2025
      Recent

      There’s a massive 42% Amazon Prime Day discount on the Razer DeathAdder V3 Pro — One of the best gaming mice we gave a near-perfect score to

      July 8, 2025

      This 360Hz QD-OLED monitor is more than magnificent — and it’s $280 off right now

      July 8, 2025

      Diablo 4, one of Blizzard’s best Xbox games, is now 64% off — a devilish Anti-Amazon Prime Day discount that’s worth taking over Amazon’s deals

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

    There’s a massive 42% Amazon Prime Day discount on the Razer DeathAdder V3 Pro — One of the best gaming mice we gave a near-perfect score to

    July 8, 2025
    News & Updates

    This 360Hz QD-OLED monitor is more than magnificent — and it’s $280 off right now

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

    DeepMind’s latest research at ICLR 2023

    Artificial Intelligence

    CVE-2025-3815 – WordPress SurveyJS Stored Cross-Site Scripting

    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-47851 – JetBrains TeamCity Stored XSS Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Deploy Qwen models with Amazon Bedrock Custom Model Import

    Machine Learning

    Highlights

    CVE-2025-6706 – MongoDB Server Use After Free Vulnerability

    June 26, 2025

    CVE ID : CVE-2025-6706

    Published : June 26, 2025, 2:15 p.m. | 49 minutes ago

    Description : An authenticated user may trigger a use after free that may result in MongoDB Server crash and other unexpected behavior, even if the user does not have authorization to shut down a server.
    The crash is triggered on affected versions by issuing an aggregation framework operation using a specific combination of rarely-used aggregation pipeline expressions. This issue affects MongoDB Server v6.0 version prior to 6.0.21, MongoDB Server v7.0 version prior to 7.0.17 and MongoDB Server v8.0 version prior to 8.0.4 when the SBE engine is enabled.

    Severity: 5.0 | MEDIUM

    Visit the link for more details, such as CVSS details, affected products, timeline, and more…

    Experiment with Gemini 2.0 Flash native image generation

    May 27, 2025

    5 things to do with the Linux terminal on your Android phone – including my favorite

    April 14, 2025

    DistroWatch Weekly, Issue 1121

    May 11, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

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