• 5 Posts
  • 256 Comments
Joined 1 year ago
cake
Cake day: June 11th, 2023

help-circle



  • Formatted, so I can read it

    Exception in thread "main" java.lang.NullPointerException: 
     Cannot invoke "String.toLowerCase()" because the return value of 
    "com.baeldung.java14.npe.HelpfulNullPointerException$PersonalDetails.getEmailAddress()" is null
     at com.baeldung.java14.npe.HelpfulNullPointerException.main(HelpfulNullPointerException.java:10)
    

  • Damn, that’s a long list. Looks like a lot of work to collect and prepare.

    I was looking for more of an overview of it and selected them from the headlines:

    1. 2014: Completely broken IndexedDB implementation
    2. 2015: 100vh (100% viewport height) means a different thing in mobile Safari to everywhere else
    3. 2016: <body /> with overflow:hidden CSS is scrollable on iOS
    4. 2017: Safari incorrectly blocks localhost as mixed content when accessed from an HTTPS page
    5. 2018: OS 11.2.2 broke WebAssembly
    6. 2018: Safari 11.1 broke MessageChannels
    7. 2019: Audio stops playing when standalone web app is no longer in foreground
    8. 2019: PWA in iOS uses old assets after publishing new servicerWorker/assets
    9. 2020: Add Fullscreen API to iOS (& display fullscreen)
    10. 2021: Safari shipped blob.stream(), crashes with a NULL pointer exception
    11. 2021: Appending an element to the shadow DOM in many cases hard crashes the browser process
    12. 2021: LocalStorage is broken when a page is open in more than one tab
    13. 2021: IndexedDB APIs hangs indefinitely on initial page load
    14. 2021: Fetch request streaming is implemented just enough to pass feature detection, but it doesn’t actually work
    15. 2021: IndexedDB API information leaks
    16. 2023: Notifications API: support for the badge, icon, image and tag options
    17. 2024: On-screen keyboard does not show up for installed web apps (PWAs) when focusing a text input of any kind
    18. 2008: Focus events for non-input elements behave differently in Safari to every other browser
    19. 2012: Using border-image with border-style: none is rendered completely wrong
    20. 2014: WebKit doesn’t calculate padding-top/-bottom: n% correctly
    21. 2014: Pointer events should allow for device-pixel accuracy
    22. 2017: Support for 120Hz requestAnimationFrame
    23. 2018: Some Fetch requests incorrectly completely skip the service worker
    24. 2020: Safari 14 shipped a broken replaceChildren() method, which caused glitches in Construct.
    25. 2020: When leaving current scope of PWA, back button incorrectly reads “Untitled”
    26. 2020: Safe-area-inset-bottom still set when keyboard appears
    27. 2020: Support for background-attachment: local has suddenly completely disappeared
    28. 2021: IntersectionObserver and ResizeObserver fire in incorrect order
    29. 2021: Mousemove events fire when modifier keys are pressed, even if the mouse isn’t moved
    30. 2021: Scrolling in home screen apps incorrectly latches to document
    31. 2022: WebM Opus support is inconsistent in Safari
    32. 2022: Installed web app with viewport-fit cover causes overscroll issues, breaks position fixed and -webkit-fill-available
    33. 2023: iPadOS: Viewport doesn’t correctly restore after dismissing software keyboard for installed web apps
    34. 2023: iPadOS: window loses focus when dismissing the keyboard, breaks Page Lifecycle API
    35. 2024: Svh and lvh are incorrect on iOS in third party browsers
    DOM query
    let a = ''
    for (let x of document.querySelectorAll('h3 a[title]')) a += x.title + "\n"
    a
    




  • If you only care about contributing improvements, no, it doesn’t matter.

    If you want to at least be recognized as an author, and be able to say “I made this”, the license opposes that.

    Waiver of Rights: You waive any rights to claim authorship of the contributions […]

    I don’t know how they intend to accept contributions though. I guess code blocks in tickets or patch files? Forking is not allowed, so the typical fork + branch + create a pull request does not work.



  • I’ve been using TortoiseGit since the beginning, and it covers everything I need. Including advanced use cases. I can access almost all functionality from the log view, which is very nice.

    I’ve tried a few other GUIs, but they were never able to reach parity to that for me. As you say, most offer only a subset of functionalities. Most of the time I even found the main advantage of GUIs in general, a visual log, inferior to TortoiseGit.

    GitButler looks interesting for its new set of functionalities, new approaches. Unfortunately, it doesn’t integrate well on Windows yet. Asking for my key password on every fetch and push is not an acceptable workflow to me.









  • Using early returns and ternary conditional operator changes

    private boolean meetsRiderPreferences(Rider rider, Driver driver) {
        if (driver.rating >= 4.5) {
            if (rider.preferences.includes('Premium Driver')) {
                  return driver.isPremiumDriver;
            } else {
                  return true;
            }
        } else if (driver.rating >= 4.0) {
            return true;
        } else {
            return false;
        }
    }
    

    to

    private boolean meetsRiderPreferences(Rider rider, Driver driver) {
        if (driver.rating < 4.0) return false;
        if (driver.rating < 4.5) return true;
    
        return rider.preferences.includes('Premium Driver') ? driver.isPremiumDriver : true;
    }
    

    dunno if java has them, but in C# switch expressions could put more of a case focus on the cases

    private boolean meetsRiderPreferences(Rider rider, Driver driver) {
        return driver.rating switch {
            < 4.0 => false,
            < 4.5 => true,
            _      => rider.preferences.includes('Premium Driver') ? driver.isPremiumDriver : true,
        };
    }
    

    or with a body expression

    private boolean meetsRiderPreferences(Rider rider, Driver driver) => driver.rating switch {
        < 4.0 => false,
        < 4.5 => true,
        _      => rider.preferences.includes('Premium Driver') ? driver.isPremiumDriver : true,
    };
    

    The conditional has a true result so it can be converted to a simple bool condition as well.

    private boolean meetsRiderPreferences(Rider rider, Driver driver) => driver.rating switch {
        < 4.0 => false,
        < 4.5 => true,
        _      => !rider.preferences.includes('Premium Driver') || driver.isPremiumDriver,
    };