Spyke

Replies

Comment on

Me after I got fired

Reply in thread

That exact version will end up making "true" false any time it appears on a line number that is divisible by 10.

During the compilation, "true" would be replaced by that statement and within the statement, "__LINE__" would be replaced by the line number of the current line. So at runtime, you end up witb the line number modulo 10 (%10). In C, something is true if its value is not 0. So for e.g., lines 4, 17, 116, 39, it ends up being true. For line numbers that can be divided by 10, the result is zero, and thus false.

In reality the compiler would optimise that modulo operation away and pre-calculate the result during compilation.

The original version constantly behaves differently at runtime, this version would always give the same result... Unless you change any line and recompile.

The original version is also super likely to be actually true. This version would be false very often. You could reduce the likelihood by increasing the 10, but you can't make it too high or it will never be triggered.

One downside compared to the original version is that the value of "true" can be 10 different things (anything between 0 and 9), so you would get a lot more weird behaviour since "1 == true" would not always be true.

A slightly more consistent version would be

((__LINE__ % 10) > 0)
memes

Comment on

Pastas Assembled

Do you cook your pasta in a large pot, with plenty of boiling water, and a good amount of salt? Usually I just stir once just after putting the pasta in, and I never have noodles sticking together.

Comment on

Why do firms bullshit after interviews?

we think you'd be best with a bigger team with a better support network

Sounds like they think you're not independent enough for the position. If it is a small team, they might need someone who can immediately start being productive, while they think you will need more coaching to get up to speed.

No need to drag any disabilities into this.

memes

Comment on

Feels bad man

Reply in thread

It's not racism of you believe those people were born into a lower caste because of their actions in a previous life. It is their punishment and thus you should treat them like shit!

Comment on

Las Vegas' dystopia-sphere, powered by 150 Nvidia GPUs and drawing up to 28,000,000 watts, is both a testament to the hubris of humanity and an admittedly impressive technical feat | PC Gamer

Reply in thread

They say there are 16 screens inside, each with a 16k resolution. Such a screen would have 16x as many pixels as a 4k screen. The GPUs power those as well.

For the number of GPUs it appears to make sense. 150 GPUs for the equivalent of about 256 4k screens means each GPU handles +-2 4k screens. That doesn't sound like a lot, but it could make sense.

The power draw of 28 MW still seems ridiculous to me though. They claim about 45 kW for the GPUs, which leaves 27955 kW for everything else. Even if we assume the screens are stupid and use 1 kw per 4k segment, that only accounts for 256 kW, leaving 27699 kW. Where the fuck does all that energy go?! Am I missing something?

Comment on

Not mocking cobol devs but yall are severely underpaid for keeping fintech alive

Reply in thread

You want to translate COBOL to another language? That exists as a commercial product! The complexity is not the syntax though, it is the environment and subsystems surrounding the code. A lot of COBOL is designed for mainframe systems, and emulating a mainframe is complex.

You also end up with code that is still written as if it were COBOL. The syntax for COBOL is the easy part and that is all you can easily replace. Afterwards you're still stuck with the way of working and mindset, both of which are quite peculiar.

The company I work for recently looked at all of this, and we decided not to translate our code.

android

Comment on

[Rant] Cloud service is not a reason to have phones with only 128 GB

It sounds like you have a very specific set of requirements that requires a specific type of premium phone. Not everybody needs 128 GB of storage eon their phone (mine only has 64). I agree that a lot of storage and SD-card slots are good features to have on phones, but the truth is that not everyone needs those. Each feature will add cost and require more resources to build, and for a lot of people not having them will work just fine.

gaming

Comment on

There's simply no going back

Reply in thread

Our eyes and brains don't perceive still images or movement in the same way as a computer. There is no simple analogy between our perception and computer graphics.

I've read that some things can be perceived at 1000 fps. IIRC, it was a single white frame shown for 1ms between black frames. Of course most things you won't be able to perceive at that speed, but it certainly isn't as simple as 30 fps!

Comment on

Is driving a car this awful all the time?

It definitely gets easier in my experience. A lot of the things that take conscious effort right now are going to become reflexes and automatisms with more experience. Right now you are building that experience, and there isn't really a way to speed it up. You just need to do each action dozens and hundreds of times, until you do it without thinking.

Driving a manual car, for example, is definitely more complex than an automatic one. You literally need to manage one more thing. But do not worry about it, you will change gears a lot during your practice sessions and build a lot of experience quickly. In a few months you will probably not think much about gears, and in a few years you will be managing them without giving it a single thought.

Fun anecdote, I recently got a new car and it is an automatic one while I previously only drove manuals. For a few days I couldn't figure out how to start smoothly, and I was very confused... until I realized that starting mostly involved the clutch on my previous car. The first movements of my right foot used to be to keep the rpm under control while disengaging the clutch, which is just not needed on an automatic car. I was simply applying the same muscle memory to the new car without realizing it!

memes

Comment on

Is it truly unspeakable horrors or is it lazy writing that just lets the mind of the reader do the imagining of unspeakable horrors for you?

Reply in thread

Yeah that's what I thought too. The horrors are described well, they just typically don't get described through their physical form. As you say, because the human mind cannot comprehend it. There is a lot more focus on impressions, comparisons, and effects, rather than on a real physical description. Personally I thought it was quite neat!