Dumhuvud

joined 2 years ago
[–] Dumhuvud@programming.dev 1 points 4 months ago* (last edited 4 months ago)

I'm not protecting anyone, that is not my intent at all. Hell, I couldn't care less about American celebs or whoever this guy is.

My issue is literally in the first sentence. Watering down the term doesn't help victims of actual child sexual abuse. I'd argue it's actually harmful.

[–] Dumhuvud@programming.dev 6 points 4 months ago (2 children)

Keming? Who's Keming?

[–] Dumhuvud@programming.dev 4 points 4 months ago* (last edited 4 months ago) (1 children)

s/instead/also/

[–] Dumhuvud@programming.dev 8 points 4 months ago (1 children)

In typical C fashion, there's undefined behavior in turn_char_to_int. xD

[–] Dumhuvud@programming.dev 12 points 4 months ago (1 children)

"Earlier, people rarely lived to 70, but these days at 70 you are still a child," Xi told Putin according to the translator in Russian.

Hard to argue with that. Both of these cunts seem to lack any emotional intelligence whatsoever.

[–] Dumhuvud@programming.dev 32 points 4 months ago (3 children)

Oh wow, a security disaster. You know, you can temporarily escalate your privileges if you need to modify Program Files, right? It's just one UAC prompt away.

[–] Dumhuvud@programming.dev 1 points 4 months ago* (last edited 4 months ago)

I misremembered the whole thing. It was still related to cleaning up after a failure, but there was only one resource I had to deal with. That's how it looks like:

    sqlite3 *db;
    int r;

    r = sqlite3_open("./data.db", &db);
    if (r) {
        std::cerr << "Can't open the database: " << sqlite3_errmsg(db) << std::endl;
        return r;
    }

    r = sqlite3_exec(db, "CREATE TABLE IF NOT EXISTS foo(...);", nullptr, nullptr, nullptr);
    if (r != SQLITE_OK) {
        std::cerr << "Can't create a table called foo: " << sqlite3_errmsg(db) << std::endl;
        goto out;
    }

    // a few more sqlite3_exec calls;
    // some sqlite3_prepare_v2 calls combined with sqlite3_bind_* and sqlite3_step calls
    // for repeated queries.

out:
    sqlite3_close(db);
    return r;
[–] Dumhuvud@programming.dev 2 points 4 months ago (1 children)

You’re describing Secure Boot.

Secure Boot is literally configurable. You can create your own key and sign whatever you want with it. See sbctl.

[–] Dumhuvud@programming.dev 2 points 4 months ago (2 children)

I mean, in C too.

I used it when I wrote some throwaway C++ code working with SQLite. Since it had no RAII (and I had no intention of writing my own wrapper), I had to manually cleanup multiple resources somehow. If at least one resource failed to initialize, I had to deinitialize the ones that didn't fail. It was either goto or a bunch of flags to track what is initialized. goto looked more elegant.

[–] Dumhuvud@programming.dev 3 points 4 months ago (1 children)

May I suggest avoiding recursive functions where possible? They are usually the ones overflowing your stack, duh.

view more: ‹ prev next ›