sus

joined 1 year ago
[–] [email protected] 1 points 5 months ago

how did I miss that..

[–] [email protected] 22 points 5 months ago* (last edited 5 months ago) (3 children)

also a fun fact, while commercial aviation is very safe, private planes are much more dangerous, being almost as dangerous per mile as a regular car (and you get a lot more miles per hour of travel)

[–] [email protected] 2 points 5 months ago* (last edited 5 months ago) (2 children)

that works for 2 word names eg is_open or is_file, but in this case is_dialog_file_open is structured like a question, while dialog_file_is_open is structured like a statement

[–] [email protected] 3 points 5 months ago* (last edited 5 months ago)

as many iterations as it takes

void* x = &x;
char* ptr = (char*)&x;

while (1) {
    printf("%d\n", (unsigned int)*ptr);
    ptr--;
}
[–] [email protected] 21 points 6 months ago

Considering this was written in 2001, I'm not all that worried

[–] [email protected] 5 points 6 months ago* (last edited 6 months ago)

Nokia bought the parent company of bell labs in 2016. By that point bell labs had already been completely restructured to the point that it has basically nothing to do with the historical bell labs.

[–] [email protected] 12 points 6 months ago* (last edited 6 months ago)

slow inverse square root:

float slowinvsqrt(float x)
{
    const long accuracy = 100000000;    // larger number = better accuracy
    if (x <= 0.0f) {
        return NAN;
    }
    if (x == 1.0f) {
        return 1.0f;
    }
    if (x < 1.0f) {
        return 1.0f / slowinvsqrt(1.0f/x);
    }

    int max_power = log(accuracy) / log(x);
    long pow1 = pow(x, max_power - 1);
    long pow2 = pow(x, max_power);
    double current = 1.0;
    double previous = 1.0;

    for (long i = 0; i<10*accuracy; i++) {
        current = sin(current);
        if (i == pow1) {
            previous = current;
        }
        if (i == pow2) {
            return current / previous;
        }
    }
}
[–] [email protected] 5 points 7 months ago

it soars because the profit was near zero before and is now returning to "normal" (their competitor SK hynix made a 5 billion operating loss in one quarter last year)

[–] [email protected] 3 points 7 months ago* (last edited 7 months ago) (1 children)

CRT TV with extra steps

[–] [email protected] 6 points 7 months ago (3 children)

if all 330 million 'mericans tried living in the woods, shit would go south really quickly

[–] [email protected] 31 points 7 months ago* (last edited 7 months ago)

even if you write in assembly, you still may not actually understand what is going on in the machine since processors convert the instructions to "micro-ops", and let's not forget hardware bugs like those caused by speculative execution

[–] [email protected] 10 points 7 months ago

Oopsie woopsie!

view more: ‹ prev next ›