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

      This week in AI dev tools: Gemini 2.5 Pro and Flash GA, GitHub Copilot Spaces, and more (June 20, 2025)

      June 20, 2025

      Gemini 2.5 Pro and Flash are generally available and Gemini 2.5 Flash-Lite preview is announced

      June 19, 2025

      CSS Cascade Layers Vs. BEM Vs. Utility Classes: Specificity Control

      June 19, 2025

      IBM launches new integration to help unify AI security and governance

      June 18, 2025

      One of World of Warcraft’s deadliest entities makes a world-shattering return after nearly 20 years — and he’s city-sized

      June 20, 2025

      It feels like Blizzard has abandoned Diablo 2: Resurrected — but there’s one way to keep it alive for years to come

      June 20, 2025

      Steam’s performance tracking tool is becoming more like the Steam Deck’s — you can try it out right now

      June 20, 2025

      Borderlands 4 is killing off a tired “FOMO” trend — I hope other developers follow suit

      June 20, 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

      Dr. Axel’s JavaScript flashcards

      June 20, 2025
      Recent

      Dr. Axel’s JavaScript flashcards

      June 20, 2025

      Syntax-Highlight – Custom Element For Syntax Highlighting Content

      June 20, 2025

      WelsonJS – Build a Windows app on the Windows built-in JavaScript engine

      June 20, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      One of World of Warcraft’s deadliest entities makes a world-shattering return after nearly 20 years — and he’s city-sized

      June 20, 2025
      Recent

      One of World of Warcraft’s deadliest entities makes a world-shattering return after nearly 20 years — and he’s city-sized

      June 20, 2025

      It feels like Blizzard has abandoned Diablo 2: Resurrected — but there’s one way to keep it alive for years to come

      June 20, 2025

      Steam’s performance tracking tool is becoming more like the Steam Deck’s — you can try it out right now

      June 20, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»News & Updates»CodeSOD: Objectifying Yourself

    CodeSOD: Objectifying Yourself

    April 28, 2025

    “Boy, stringly typed data is hard to work with. I wish there were some easier way to work with it!”

    This, presumably, is what Gary‘s predecessor said. Followed by, “Wait, I have an idea!”

    public static Object createValue(String string) {
    	Object value = parseBoolean(string);
    	if (value != null) {
    		return value;
    	}
    
    	value = parseInteger(string);
    	if (value != null) {
    		return value;
    	}
    
    	value = parseDouble(string);
    	if (value != null) {
    		return value;
    	}
    
    	return string;
    }
    

    This takes a string, and then tries to parse it, first into a boolean, failing that into an integer, and failing that into a double. Otherwise, it returns the original string.

    And it returns an object, which means you still get to guess what’s in there even after this. You just get to guess what it returned, and hope you cast it to the correct type. Which means this almost certainly is called like this:

    boolean myBoolField = (Boolean)createValue(someStringContainingABool);
    

    Which makes the whole thing useless, which is fun.

    Gary found this code in a “long since abandoned” project, and I can’t imagine why it ended up getting abandoned.

    [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.

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleDual Booting CachyOS and Windows
    Next Article CVE-2025-4006 – Youyiio BeyongCms Unrestricted File Upload Vulnerability

    Related Posts

    News & Updates

    One of World of Warcraft’s deadliest entities makes a world-shattering return after nearly 20 years — and he’s city-sized

    June 20, 2025
    News & Updates

    It feels like Blizzard has abandoned Diablo 2: Resurrected — but there’s one way to keep it alive for years to come

    June 20, 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-47291 – Containerd CRI Kubernetes Cgroup Bypass Denial of Service

    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-37789 – OpenvSwitch Netlink Attribute Length Validation Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Gemini Robotics brings AI into the physical world

    Artificial Intelligence

    100,000+ WordPress Sites Exposed to Privilege Escalation Attacks via MCP AI Engine

    Security

    Highlights

    CVE-2025-1416 – Proget MDM Password Retrieval Vulnerability

    May 21, 2025

    CVE ID : CVE-2025-1416

    Published : May 21, 2025, 1:16 p.m. | 1 hour, 34 minutes ago

    Description : In Proget MDM, a low-privileged user can retrieve passwords for managed devices and subsequently use functionalities restricted by the MDM (Mobile Device Management). For it to happen, they must know the UUIDs of targetted devices, which might be obtained by exploiting CVE-2025-1415 or CVE-2025-1417.

    This issue has been fixed in 2.17.5 version of Konsola Proget (server part of the MDM suite).

    Severity: 0.0 | NA

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

    Nomic Open Sources State-of-the-Art Multimodal Embedding Model

    April 2, 2025
    Linux Mint Introduces More Regex Filters to Nemo

    Linux Mint Introduces More Regex Filters to Nemo

    April 9, 2025

    Optoma Projectors for Home & Business | Dealer & Reseller in India

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

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