• 0 Posts
  • 1.08K 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…





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



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


  • What happens when you import an library written in another language, and one of the functions is a reserved keyword in your language?

    This is already possible in Rust. You can import libraries written with different editions, and there are different reserved keywords across editions.

    The compiler just looks at what language the library was written in and switches internally based on that.

    In my C and C++ example, you’d pass different flags for that library during build time, although I’m not sure how this would work for header-only libraries.

    Edit: I see your reserved keywords example is an issue, and I raise you raw identifiers (r#if in Rust, @if in C#, etc)

    How would collaboration between people with different native languages work?

    Same way it currently does? It’s not like everyone who writes code knows English, but somehow they can all write it despite the keywords being in English.

    Who makes sure all language variant have equally good educational resources?

    The community around that programming language would be responsible for this, would it not? This is already a thing people do, though it’s impossible to translate all educational resources that exist into all languages. Fortunately we have services that can translate things for us though.

    There’s a reason why lingua francas change over time but always exist, and forgetting that will do more harm than good.

    It would do no harm here. People already write code in many languages. In most popular programming languages, you can already name things in Korean, French, Russian, and so on. Documentation for the languages exist already in all those languages. There is literally only one thing that would change: the keywords. It’s really not that complicated.


  • This might seem like an obvious question, but wouldn’t it be more effective for the README to be in Korean? Not that having it in English too is a bad thing, but people interested in a language with Korean keywords probably can read Korean more comfortably than English (if they can read English at all).

    Anyway, I don’t really see why PLs that support UTF-8 idents can’t just reserve multiple aliases in different languages for their keywords. Rust is mentioned here, so I’ll use that as an example, but Rust could just add a language field to Cargo.toml next to edition that defaults to English (which is what Rust currently uses), and that wouldn’t even need a new edition as far as I’m aware. C# could do a field in the csproj file, C and C++ can use compiler flags, and so on.






  • I’m left wondering what the profession is turning into for other people.

    All the code I review looks good at first glance and makes shit up as it goes once you read into it more. We use two different HTTP libraries - one sync, one async - in our asynchronous codebase. There’s a directory full of unreadable, obsolete markdown files that are essentially used as state. Most of my coworkers don’t know what their own code does. The project barely works. There’s tons of dead code, including dead broken code. There are barely any tests. Some tests assert true with extra steps. Documentation is full of obsolete implementation details and pointers to files that no longer exist. The README has a list of all the files in the repo at the top of it for some reason.

    I will admit that I’m more in the naysayers camp, but perhaps that’s from a fear of losing my livelihood?

    People are being laid off because of poor management and a shitty economy. No software devs are losing their jobs because AI replaced them. CEOs are just lying about that because it’s convenient. If software devs truly were more effective with these tools, you’d hire more.

    Am I predisposed to see how these tools are lacking? Have I not given them a fair chance?

    That’s up to you to decide. Try using them if you want. But don’t force yourself to become obsessed with them. If you find yourself more productive, then that’s that. If not, then you don’t. It’s just a tool, albeit a fallible one.