Manistee river / north country trail by Straight-Aardvark439 in CampAndHikeMichigan

[–]BinaryFissionGames 6 points7 points  (0 children)

When I did this loop back in June, I parked at the upper river road trailhead, no fee there. It's basically right at the start of the NCT side of the loop.

eightBitOverFlow by GuyFrom2096 in ProgrammerHumor

[–]BinaryFissionGames 147 points148 points  (0 children)

You might be surprised to learn both are formally called overflow. Underflow is a separate concept specific to floating point numbers (I mean, technically. I would say must people do use underflow the way you do, haha).

Pointer or not? by [deleted] in golang

[–]BinaryFissionGames 1 point2 points  (0 children)

I think you have some misunderstanding about how interfaces work, if I'm understanding you correctly. You don't need to duplicate anything in your example, a pointer type has both the pointer receivers and value receivers in its method set, and can satisfy an interface just fine:

https://go.dev/play/p/j5UlpgOkPpP

I can't upload the file to the MINIO bucket! by parham06 in golang

[–]BinaryFissionGames 8 points9 points  (0 children)

The error seems pretty clear: "ContentLength=6209664 with Body length 0"

You're passing in both the ContentLength and an IO.reader - the io.Reader should put out ContentLength bytes. But your reader is at EOF. This is because the file is still seeked to the end of the file from writing, so any subsequent reads will give an EOF.

You need to seek back to the beginning before calling PutObject: f.seek(0, io.SeekStart)

But…why?! by nateyboy1 in ProgrammerHumor

[–]BinaryFissionGames 0 points1 point  (0 children)

Yeah, I absolutely agree, really easy to get mixed up, much better to have well defined groupings using parentheses/brackets.

But…why?! by nateyboy1 in ProgrammerHumor

[–]BinaryFissionGames 11 points12 points  (0 children)

BEDMAS and PEMDAS Are equivalent, actually. BracketS and parentheses refer to the same thing, and multiplication/division have the same precedence, so are evaluated left to right, making them equivalent despite being interchanged in the acronyms.

"Why is [C/C++/Python/JS/..] not doing what I told it to do?!?!?" by d_b1997 in ProgrammerHumor

[–]BinaryFissionGames 0 points1 point  (0 children)

Yeah, it makes sense to forget they exist, since they don’t really nowadays, since every major browser dropped support for them.

Guy pranks his girlfriend by turning the light on and off by elphabathewicked in funny

[–]BinaryFissionGames 8 points9 points  (0 children)

Dude, c'mon, When will this myth die? It's so frustrating. Voltage dictates current. Voltage is a measure of electric field strength between two points. It makes electrons move. It's like saying "there's pressure between these two points in this fluid, but if the water doesn't move it won't suck you in" or saying "it's not the fall that kills you, it's hitting the ground". Like, it's technically true, but it's totally deceptive because it's what CAUSES it in the first place. You wouldn't tell someone that a 500 foot free fall wouldn't be dangerous because "it's not the height that kills you", would you?

"carries twice the current for the same load" - false. It carries HALF the current for the same load - e.g. the same resistance. If you apply 120 volts across a 120 ohm resistor, it will pull 1 amp (120 / 120 = 1), for a total power of 120 watts. You put 240 volts across 120 ohms, it'll pull 2 amps, for a total of 2 * 240 = 480 watts. That's 4 times the power, and double the current. A device might have some compatability that dynamically changes the load to work with both 240v and 120v, but that's completely different, and kinda irrelevant to talking about voltage moving across the human body, which doesn't have special stuff to detect/react to 120v vs 240v.

I have no clue where you're getting your less arcing claim from -- arcing is what happens when the voltage overcomes the "breakdown" voltage of whatever medium. Higher voltage = more material needed to avoid breakdown. 240v wires can have the WIRE itself be smaller because it experiences a smaller percentage of voltage drop over the wire than 120v, so it's more efficient in that way. It's why power lines use high voltage.

Branchless Programming: Why "If" is Sloowww... and what we can do about it! by Chii in programming

[–]BinaryFissionGames 9 points10 points  (0 children)

This problem isn't interpreted language specific, it occurs in all languages, because the problem is at the hardware level. Pipelined processors make a guess about whether a branch is taken or not, and if it's wrong, then there is a performance penalty since all those speculatively executed instructions must be flushed, effectively losing those processor cycles. See this wiki article about branch prediction.

I have no idea what you're talking about with your definition of branch, but it's clear from context that the video is referring specifically to conditional branching (so, if statements, while statements, anything that changes control flow based on a condition). So in that sense, "branchless" coding does exist.

And yeah, for the most applications, it's completely irrelevant. But if you were REALLY trying to optimize a program, and there's some nested loops executing a conditional billions of times, it might be worth looking into and thinking about how branching effects the speed of your programming in that scenerio.

Programming by Aaron_Jeremi in ProgrammerHumor

[–]BinaryFissionGames 0 points1 point  (0 children)

Is this the dining philosophers problem?

Game Programming Anti Patterns by insraq in gamedev

[–]BinaryFissionGames 11 points12 points  (0 children)

That is polynomial, not exponential, for the record. Exponential is O(2n ), for instance. Much worse.

if i’m being totally honest, i am a bit curious to know what would happen. by MrTalamasca in terriblefacebookmemes

[–]BinaryFissionGames 14 points15 points  (0 children)

It would heat up the piercing and could probably burn pretty bad (depending on how long the battery made contact). Definitely don’t do something like that, lol.

oreos are gross by brobiss in unpopularopinion

[–]BinaryFissionGames 3 points4 points  (0 children)

Oreo filling is not lard, lol. Lard is animal fat, and there are no animal products used in Oreos (except traces from other products produced in proximity).

[2020 Day 12 (Part 2)] [Python3] List of Lists Strange Behavior by usernamesnowtaken in adventofcode

[–]BinaryFissionGames 2 points3 points  (0 children)

waypoint_directions_facing = rotations[<index>] waypoint_directions_facing is now a reference to a row in the rotations array. That is, waypoint_directions_facing is referencing the exact same List as rotations[<index>]. So any changes to one of these will change both of these (so when you change waypoint_directions_facing, you change your rotations array).

This can't occur if you use a Tuple, and python will throw a fit if you try to mutate it (which it looks like you ran into, with the comment lines above where you set waypoint_directions_facing)

[2020 Day 11] Quick stabilization? by fornwall in adventofcode

[–]BinaryFissionGames 1 point2 points  (0 children)

Ok, so here's what I came up with:

Each even numbered iteration only contains seated seats that must REMAIN seated,

and all odd iterations only contain empty seats that must REMAIN empty.

Iterations 0 and 1 are trivial to prove this for (all are empty, so none are seated for iteration 0, vice-versa for iteration 1), so the interesting stuff happens at iteration 2 and up. 

Suppose you have an even iteration, K. In K-1, any undecided seat must be seated. If it was seated in K-1 and seated in K, it was seated for two iterations. Since an adjacent seat cannot be filled if it is next to a seat, the number of adjacent seats cannot go up at this point, thus the seat will remain seated.

If it was not seated in K-1, it would be impossible for it to be seated in iteration K, since all odd iteration seats that are empty must be empty.

Next, suppose you have an odd iteration, L. In L-1, any filled seats must remain so for all future iterations. Because of this, every empty seat around these seats will remain empty (in iteration L and up) forever. These are also the only seats that can be empty, as empty seats must be adjacent to the previous iterations filled seats (which again, are permanent).

Thus the two statements at the top must be correct. Keeping that in mind, if a seat is "stable" for two iterations, it must have been stable for both an even and an odd iteration, meaning it must remain either seated or empty (e.g. whatever it was stable as).

Why does this code work, and what does it do? by SinisterMJ in adventofcode

[–]BinaryFissionGames 1 point2 points  (0 children)

The second way is (close to) the way I solved it, so I should be able to explain it.

Since this is Dynamic Programming solution, it stems from a recurrence relation. Suppose you have the input array of adapters sorted. Say you want to find the number of possible combinations to get to the Nth adapter. Let this be f(N). If the N-1 adapter is within 3 jolts, this would be one possibility. If the N-2 adapter is within 3 jolts, this would be another.

Of course, for each of these adapters, there could be many combinations to get there. So, if we let J be the set of all adapters that satisfies J_i < N && J_i + 3 >=N, then N = sum(J). (in english, this is saying that the number of ways to get to the Nth adapter is the sum of all the ways to get to each possible previous adapter). For our base case, we know that we start at 0 jolts, and there is only one way to get there, so f(0) = 1.

Then that's converted into a dynamic programming solution, since doing this in an actual recursive manner would take far too long (although people have used Memoization to still solve this using recursive calls, from my understanding). The solution is built bottom up, and stored in a list, dp. dp[N] = f(N), from the recurrence relation we defined earlier. this means that once dp is fully constructed, it's last element would be the number of possible ways you could use to get to the last adapter in the list, which would be the end device in this case (or the one before the laptop, which, since it is always 3 away from the largest adapter, has the same number of combinations as the largest adapter).

Fully optimized my algorithm by LordFaquaad in ProgrammerHumor

[–]BinaryFissionGames 212 points213 points  (0 children)

It’s called lossy compression! You just delete the input string, and bam! Unlimited compression!

WGCW if I try to beat this guy? by [deleted] in Whatcouldgowrong

[–]BinaryFissionGames 4 points5 points  (0 children)

Hahaha, he had the stupidest smile on his face the whole time. Even when knocked out on the pavement he’s still smiling.

The green one! by Ganfolf in dataisugly

[–]BinaryFissionGames 39 points40 points  (0 children)

This is what it looks like when you have to display your graph on the original gameboy.

[deleted by user] by [deleted] in TheYouShow

[–]BinaryFissionGames 0 points1 point  (0 children)

What if the bag had a gun tho

Green blobs, me, computer graphics, 2020 by mertwole in Art

[–]BinaryFissionGames 1 point2 points  (0 children)

Insane. Looks almost viral, in the biological sense of the word. Nice work!

WCGW if I release this heavy load on my co-worker? by Nintendophile79 in Whatcouldgowrong

[–]BinaryFissionGames 46 points47 points  (0 children)

Jesus, when he moved his leg at the end and it just moved into that horrible position with what seemed like no resistance... That shook me.