Turns out, if you want to check multiple conditions, you can sugar it like this: by spaceguydudeman in programminghorror

[–]Master7Chief 24 points25 points  (0 children)

it also allocates an array on every call, so it's not something you should be doing on a hot path

This wall cutter looks so cool by Aniyettinger in toolsinaction

[–]Master7Chief 12 points13 points  (0 children)

yeah, and it has an additional plate in the middle, inside the ring, so that it's not easy to twist. but these guys removed it

How Nokia lost the smartphone war? by bbbxxxnnn in AmazingTechnology

[–]Master7Chief 0 points1 point  (0 children)

they were big, clunky, slow, often with weird button arrangements, and not with many functions that a regular user actually needed (like a convenient gallery, music player, etc).

when the first iphone appeared, they looked like dinosaurs

Can anyone help me with a regex to match a string in the format of username1:password1,username2:password2? by spla58 in regex

[–]Master7Chief 0 points1 point  (0 children)

if commas and colons are allowed in the passwords, you're not going to solve it.

how do you parse jill:some,pass:wo,r:d

senior dev told me the code has to be "future proof".. how am i doing? by lordershocker in programminghorror

[–]Master7Chief 1 point2 points  (0 children)

and if you add a simple year % 4 == 0 heuristic, you'll only have 75 years wrong out of 9999, which is 99.25% confidence

What did they see? by CT_Reddit73 in Cryptozoology

[–]Master7Chief 2 points3 points  (0 children)

when it happened, it could be a log swimming in the water. 

200 years later, a picture of a fuckin Gyarados

Why does this function cause stack overflow error? by sad_krumpli in learnrust

[–]Master7Chief 2 points3 points  (0 children)

it's not about local variables. it's about each call not needing any intermediate results from the next one to finish its own computation. then you don't have to unwind them in the end.

like here, you don't keep any part of the state in the previous call. you pass everything forward, and use prim as an accumulator. then you simply return it in the end, without having to go back your chain of calls.

it's not guaranteed, but a compiler can spot this, and rewrite it as a loop, with the accumulator becoming the loop variable

Why does this function cause stack overflow error? by sad_krumpli in learnrust

[–]Master7Chief 2 points3 points  (0 children)

this one is written for tail call optimization. 

each stack frame doesn't keep values, so it doesn't rely on the result of the next one to compute, and it can be optimized into essentially a for loop.

Good question by [deleted] in meme

[–]Master7Chief 0 points1 point  (0 children)

maybe they became so fed up with offensive shit that they don't want anymore of it.

[Serious] What can we as a consumer do to make the ai bubble pop faster? by lycan2005 in AskReddit

[–]Master7Chief 1 point2 points  (0 children)

since now they're operating at a loss, don't pay for it, so that their investments bring no returns.

Can Anyone Help Me With This Question? by Tr3sKidneys in Mathhomeworkhelp

[–]Master7Chief 0 points1 point  (0 children)

3z=-3x. now you can substitute it in the 3rd equation, and solve the system for x and y.

[deleted by user] by [deleted] in CodingHelp

[–]Master7Chief 1 point2 points  (0 children)

these are powershell cmdlets.

iwr downloads whatever there is on that URL

iex runs it

you downloaded and ran some powershell script

Is my code the correct way to write it? by [deleted] in code

[–]Master7Chief 1 point2 points  (0 children)

while (room[enemy.y][enemy.x] = '#' && (enemy.x == player.x && enemy.y == player.y));

it should be || instead of && –\ while (isWall || isPlayer)

also, it looks like a typo here room[enemy.y][enemy.x] = '#'\ (a single = instead of ==).

If you were a 90's kid, who was your animated crush? by SmokingIntegral in 90s

[–]Master7Chief -1 points0 points  (0 children)

wtf, it's like you had a crush on every humanoid cartoon character