• 1 Post
  • 4 Comments
Joined 2 years ago
cake
Cake day: June 5th, 2023

help-circle
  • This Fehr guy has all the same talking points I’ve seen German politicians use as well. And that’s essentially across all relevant political parties.

    For example, Interior minister Faeser called the Palästina-Kongress, which they shut down last year, and which was organized by secular left-wing groups and a Jewish group, “Islamist”. And the press loves to just repeat this stuff. And it’s great propaganda. The average German is afraid of Islamists, hates Muslims in general, and will applaud when the authorities suppress anyone labeled as such, and never look into if it’s actually true.

    Foreign minister Baerbock claimed she personally saw, on video, evidence of rape on Oct 7, even though actual investigations by the UN and others have found no footage like that. She was being heckled at the time by pro-Palestine activists and just made that up, so it looks to an misinformed audience like they’re booing rape victims. And people believe this because the press never pushes back on these false claims.

    Just straight up inventing blatant lies to cover for the genocide they’re committing. How tf can these people sleep at night?


  • Yeah sorry then. It would be good to not use ls in your example though, someone who doesn’t know about that might read this discussion and think that’s reasonable.

    As for your original question, doing the foreach as a personal alias is fine. I wouldn’t use it in any script, since if anyone else reads that, they probably already know about xargs. So using your foreach would be more confusing to any potential reader I think.


  • Don’t use ls if you want to get filenames, it does a bunch of stuff to them. Use a shell glob or find.

    Also, because filenames can have newlines, if you want to loop over them, it’s best to use one these:

    for x in *; do do_stuff "$x"; done # can be any shell glob, not just *
    find . -exec do_stuff {} \;
    find . -print0 | xargs -0 do_stuff # not POSIX but widely supported
    find . -print0 | xargs -0 -n1 do_stuff # same, but for single arg command
    

    When reading newline-delimited stuff with while read, you want to use:

    cat filenames.txt | while IFS= read -r x; do_stuff "$x"; done
    

    The IFS= prevents trimming of whitespace, and -r prevents interpretation of backslashes.


  • SDL3 has a new “GPU” API, which is some kind abstraction over Vulkan/DirectX12/Metal. I imagine it hides a bunch of boilerplate as well. With this, I think, one could do a 3D render engine without having to directly use the Vulkan API (or OpenGL, …). However, the shaders need to be in whatever format the backend expects it seems.