• 0 Posts
  • 1.74K Comments
Joined 3 years ago
cake
Cake day: June 21st, 2023

help-circle


  • Well, to no surprise, Slay the Spire 2. Still in early access, and still an amazing game. The balance is a bit all over the place, but that’s expected with it in EA. Compared to the first game, it’s a direct improvement (save for the balance). The new characters are a lot of fun to play and bring new, interesting mechanics to the game. Heck, Defect has some new content as well, including a status build of all things.

    Otherwise, modded Terraria on a server I’m hosting with some friends. The new update is really good, but even 1.4.4 (which tModLoader is still on) has some awesome mods. Honestly, I’m excited for when tModLoader releases for the new update, though I know that will take some time.



  • I’ve mentioned the long-term effects I see at work in several places, but all I can say is be very careful how you use it. The parts of our codebase that are almost entirely AI written are unreadable garbage and a complete clusterfuck of coding paradigms. It’s bad enough that I’ve said straight to my manager’s face that I’d be embarassed to ship this to production (and yes I await my pink slip).

    As a tool, it can help explain code, it can help find places where things are being done, and it can even suggest ways to clean up code. However, those are all things you’ll also learn over time as you gather more and more experience, and it acts more as a crutch here because you spend less time learning the code you’re working with as a result.

    I recommend maintaining exceptional skepticism with all code it generates. Claude is very good at producing pretty code. That code is often deceptive, and I’ve seen even Opus hallucinate fields, generate useless tests, and misuse language/library features to solve a task.


  • If you’re interested in more DDoS-style attacks, Cloudflare has an article that goes over the topic as a whole as well as in-depth topics for different common attacks. They also have reports that cover the kinds of DDoS attacks they’ve seen through their servers. You’ll notice they mention SYN floods as one of the attacks they commonly see. Amplification attacks have also risen in popularity, generally speaking, where the request gets amplified by vulnerable DNS/NTP/etc servers.

    OWASP is an excellent learning resource as well, and covers many different topics in-depth around web security.


  • Okay wow, let’s break this down…

    1. Unrelated to your question, but I’d recommend FastAPI over Flask. But anyway…
    2. CSRF protections should not be disabled unless you need to. For local debugging, it can be fine, but there’s no real reason not to keep it enabled. “It’s annoying” is rarely a good reason to disable a protection.
    3. Now, to answer your question finally: based on the flask-wtf docs, the call to CSRFProtect(app) enables protections globally. Consider removing that call if you want to disable CSRF protection. Alternatively, @csrf.exempt can disable protection on a view, and setting WTF_CSRF_CHECK_DEFAULT to False disables it by default on all views (and you can selectively enable it per-view).
    4. Also, while you’re at it, make sure you’re using up-to-date versions of Flask and flask-wtf. If not, check the docs for the specific versions you’re using.

  • Pros: leadership wants to do your job. Chill out, let them do it, then laugh at them when it fails. You’ll at least have a relaxing job up until they either fire you in their idiotic confidence or beg you for help.

    Cons:

    it’s managed to blow up and nuke production

    You know, I remember reading a similar story about AWS recently…








  • By which I mean maybe the author enjoys different parts of coding than you do.

    It seems to me like the part of coding the author enjoys least is coding.

    Trying to wrangle AI into writing something decent is generally an exercise in frustration for me.

    This is my issue with it. The output of these tools, unchecked, evolves into something abysmal over time. I find it quicker to just rewrite the output than to try to prompt it over and over again to produce something good.


  • Ok, first, copying and pasting a paragraph to quote from this website fucking sucks. I know it’s a site that gets cited a lot, so I feel terrible for all the people out there who have to deal with that.

    NVIDIA says developers can fine-tune the result with controls for intensity and color grading, allowing artists to adjust blending, contrast, saturation, and gamma to match a game’s visual style. The system also supports masking, so specific objects or image regions can be excluded from enhancement when developers want to preserve the original look or avoid changes in selected areas.

    They seem to at least be giving devs the ability to tune the output to their specific creative style. At least they’re addressing that, otherwise this would make no sense whatsoever because the output looks nothing like the input.

    On that note, as long as I can turn it off, I really couldn’t care less about this. I’ll be leaving it off. Even better if my GPU just doesn’t support this I guess.

    My biggest concern is if game devs are going to get lazier and start requiring this for their games to be playable. That’s basically what happened with framegen.



  • The high-level directory structure looks reasonable, but every language and build tool has its own recommended structure that people should use instead. For example, by default, cargo looks for a src/main.rs or src/lib.rs as an entrypoint. uv expects one of a couple different project structures before you need to touch the pyproject.toml. C# will create namespaces for each of these nested subdirectories if you don’t carefully configure it in your .csproj file. And so on.

    It’s best to just use whatever’s recommended for your environment by your tools. Maybe this directory structure works well for Guile Scheme, but I wouldn’t touch it at all if I were writing Rust.



  • I was able to turn the string into a char iterator, but I could not figure out how to change elements of said iterator (this can be seen at line 55).

    You have a few options here, but the easiest is to collect into a Vec<char>, replace the character there, then do a String::from_iter(chars) to get it back as a string.

    You can also manipulate the original chars iterator directly through takes, skips, and so on and collect it into a string, but that’s more complicated.

    Also, “character” is such a complicated concept because unicode is not simple. If you can work directly with bytes though, you can convert the string to a Vec<u8> (which is the underlying type for String), manipulate that directly, then do String::from_utf8 (or the same method for str) to convert it back to a string.