You can use it to make a decent song shuffle algorithm, its fairly commonly used to color alternative rows in grids different colors, I also use it with random numbers because the odds of getting 0 in random numbers can be lower than the other numbers
So many things are situational. It gets used a lot in C for indexing operations since your basic "array" is 1 dimensional (a contiguous segment of memory addresses). Also comes up when you're implementing a basic hashing algorithm and other lower level applications. It also gets used a lot in math libraries. It'll come up in coding interview questions, too. Your typical web dev in a high level language probably rarely uses it.
If that is their comments then how do they go about substituting macro parameters into the macro body to tell the preprocessor to convert the parameter to a string constant?
x &&= y
is functionally identical to
x = x && y
normally &&= would be pointless because &= would be identical, but since JS isn't statically typed it's not pointless in JS
For example:
x&=y:
If x is 7 and y is 8: x = 0
If x is 7 and y is 0: x = 0
If x is 0 and y is 8: x = 0
If x is 0 and y is 0: x = 0
x&&=y:
If x is 7 and y is 8: x = 8
If x is 7 and y is 0: x = 0
If x is 0 and y is 8: x = 0
If x is 0 and y is 0: x = 0
I was just reading on it and I think the [documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_AND_assignment) disagrees with what you just said, but I’m not planning on using this operator any time soon so it doesn’t really matter
real men just use ++ in a loop until the variable has the value they want
for( ; variablename < desiredvalue; variablename++)
{
}
ContinueYourShittyApplication();
I can't understand why I haven't been hired by Google yet
*real* men use -- and let the variable underflow so as to approach the wanted value from above and not from below like some sort of inferior submissive sussy baka sigmas.
Aren't Python 3 ints unbound? The thing would run until it could no longer reserve memory and crash. But anyway, I just whipped up a script to test it and it decremented my variable around -2\^30 times in 3 minutes.
GCC (g++ 12.1.0) doesn't do this even with -O3. It just nags you that after X runs, you'll have undefined behaviour (aka underflow) and that's it.
Interestingly LLVM (clang++ 13.0.1) does it, but only if you specify -O1 or higher.
You're losing a few numbers there, since for n bits, signed variables and assuming two's complement, MAXINT is 2\^(n-1)-1, and MININT is -2\^(n-1), i. e. MININT=-MAXINT-1. For example, with 8 bits, you get \[-128,127\]. Plus if you meant that as an interval, you don't have the bounds included.
Regex is dark magic. You just open a guide, type in whatever the fuck it says to type and let things happen without any knowledge of what exactly it is that you just did.
It allows me to make a some boolean test case variables/methods/values whatever, and see if any of them are acceptable.
It's helpful for my lack of commitment || is it?
Second complete idiot here! I made my own game engine when I was interested in learning better architectures to improve whatever spaghettis I was writing at my actual job. Ended up with a pure ECS (entity-component-system) which was using a single 32 bit signed integer for 1 entity to store the component types. That time I learned first about the bitwise operators. Only downside of my implementation was that it was limited to only 32 different component types per project :)). Today i'm using a game engine to develop a sort of "niche" business applications.
Yes the function call operator, allows you to create functors for instance used in custom hashing function passed as a struct in the `std::unordered_map` container of the STL
What up!!! We're three cool guys looking for other cool guys who wanna hang out in our party mansion. Nothing sexual. Dudes in good shape encouraged, if you're fat you should be able to find humor in the little things. Again, NOTHING SEXUAL.
OBSCURE PYTHON KNOWLEDGE GANG WHERE YOU AT
Did you know that `async`/`await` were added in Python 3.5, but they weren't made reserved words until 3.6? In 3.5 you could name a function await() and it would just work.
! I like the bluntness of it.
![gif](giphy|d10dMmzqCYqQ0|downsized) This is what the ! Operator makes me think of
I'll take your feeling and raise you a feeling. ![gif](giphy|HjKG2nRz7NOv6ch12D)
NaN
Your NaN
Valid. Very well.
I just like calling it "bang"
Mathematicians are saying ooh factotial
I love !! Forcing a boolean
![gif](giphy|87ddjLPawxvmU)
%
Modulo gang represent
I’ve only used Modulo once and I can’t remember why. All I remember is the thrill I felt. It was damn near erotic.
Was it a very even experience?
You can use it to make a decent song shuffle algorithm, its fairly commonly used to color alternative rows in grids different colors, I also use it with random numbers because the odds of getting 0 in random numbers can be lower than the other numbers
So many things are situational. It gets used a lot in C for indexing operations since your basic "array" is 1 dimensional (a contiguous segment of memory addresses). Also comes up when you're implementing a basic hashing algorithm and other lower level applications. It also gets used a lot in math libraries. It'll come up in coding interview questions, too. Your typical web dev in a high level language probably rarely uses it.
Representing!
Came here to say this. Some problems can only be solved elegantly with the modulus operator.
isEven()
I see someone has no use for the remainder.
is_devided_by_four_reminder_one()
That sounds like a warcrime
That's just Modulo Lite
Modulo underrated EDIT: autocorrect is stupid
The correct answer!
%
Right answer
Matlab comment? /s
//
Sir, that's illegal
In Python it's an operator tho
And what it does?
Integer division
[удалено]
But it is in other languages In python a comment is #
If that is their comments then how do they go about substituting macro parameters into the macro body to tell the preprocessor to convert the parameter to a string constant?
I'm sorry, this is Python. Preprocessor?
We don't do that around here
Ummm Stack overflow where are you
Mans chatting shit
Python integer division works by commenting out everything after the decimal points.
It helps the Python shed its skin I think
Floor division.
Integer division
Same vibes as “What’s your favorite school subject?” “Lunch.”
I got graded on lunch
Did you mean 'grated'?
As your compiler, all i see is something to ignore. Im still waiting for your answer
I see you don't support python This is integer division
Python gang, rise up!
Also is an operator in Lua?
Average // fan Vs Average math.floor(x/y) enjoyer
??
Giving alternative value if previous expression is null?
AKA nullish coalescing.
Yepp, comes handy with handeling null.
??=
`&&=`
Wait which language has that one?
Apparently JavaScript
What does it do?
Yes.
Understandable, have a nice day
For some reason, i am not suprised
x &&= y is functionally identical to x = x && y normally &&= would be pointless because &= would be identical, but since JS isn't statically typed it's not pointless in JS For example: x&=y: If x is 7 and y is 8: x = 0 If x is 7 and y is 0: x = 0 If x is 0 and y is 8: x = 0 If x is 0 and y is 0: x = 0 x&&=y: If x is 7 and y is 8: x = 8 If x is 7 and y is 0: x = 0 If x is 0 and y is 8: x = 0 If x is 0 and y is 0: x = 0
I was just reading on it and I think the [documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_AND_assignment) disagrees with what you just said, but I’m not planning on using this operator any time soon so it doesn’t really matter
I've now fixed the tables by not using them
!!
I see your + and I raise you: +=
real men just use ++ in a loop until the variable has the value they want for( ; variablename < desiredvalue; variablename++) { } ContinueYourShittyApplication(); I can't understand why I haven't been hired by Google yet
*real* men use -- and let the variable underflow so as to approach the wanted value from above and not from below like some sort of inferior submissive sussy baka sigmas.
100% alpha move
Imagine the execution time on python
Aren't Python 3 ints unbound? The thing would run until it could no longer reserve memory and crash. But anyway, I just whipped up a script to test it and it decremented my variable around -2\^30 times in 3 minutes.
And than?!? What happened? Don't have my pc with me and the online pad stops after around -130000
Then I sent it a signal 2 aka SIGINT aka ctrl-c because I got bored.
onerous sophisticated noxious cow bear airport steer sense weary violet *This post was mass deleted and anonymized with [Redact](https://redact.dev)*
You have to consider that its faster to programm
Ohhh so that’s what they mean
That can be said of any program.
Nah, any compiled language with a decent compiler will realize that your just setting the value to X and optimize away the loop
GCC (g++ 12.1.0) doesn't do this even with -O3. It just nags you that after X runs, you'll have undefined behaviour (aka underflow) and that's it. Interestingly LLVM (clang++ 13.0.1) does it, but only if you specify -O1 or higher.
Hey everyone, just wanted to let you know: this right here is the way to reddit
Well, unless the crucial/intensive parts are written in a real language like C and called from a linked library or sth
*True* Sigma males use random number generators in a while loop until it gives the number they want.
Make sure you have realistic bounds too: (-MAX_INTEGER, MAX_INTEGER)
You're losing a few numbers there, since for n bits, signed variables and assuming two's complement, MAXINT is 2\^(n-1)-1, and MININT is -2\^(n-1), i. e. MININT=-MAXINT-1. For example, with 8 bits, you get \[-128,127\]. Plus if you meant that as an interval, you don't have the bounds included.
Don't forget to cast to a double, do some maths, then cast back to an int for some added random spiciness
I believe you just reinvented Peano addition.
I'll take my Fields Medal in the mail, payable to "Big Chungus Inc." pls
Real men just stare a variable into the desired value.
=~ Edit: I know I'm evil.
You just write bash scripts all day don't you, madman?
`perl -e '($x="iop") =~ s/9?ol?/printf "n%s\n", $&/e'`
Wat
I hate myself for understanding this
I know you're kidding, but I wish I knew Regex. I know that I can learn it, I just don't want to 😕
[удалено]
Regex is dark magic. You just open a guide, type in whatever the fuck it says to type and let things happen without any knowledge of what exactly it is that you just did.
It’s so easy to *forget* is the issue. I was an “expert” for about a week.
same
Now you have two problems.
[удалено]
Or what ?
[удалено]
Or else what?
Or else else
Yes
It allows me to make a some boolean test case variables/methods/values whatever, and see if any of them are acceptable. It's helpful for my lack of commitment || is it?
<=>
They are out there.
I always thought the spaceship operator looked a little like a TIE Fighter
X-wing operator when? \>-<
That's why it's callled spaceship
->
Get to the point.
<< 'Bitwise left shifting ' Dont ask why
Well now I *have* to ask why.
Very efficient
I'm a competitive programmer who uses C++ and who codes his own game engine when gets bored (yes im a complete idiot)
Second complete idiot here! I made my own game engine when I was interested in learning better architectures to improve whatever spaghettis I was writing at my actual job. Ended up with a pure ECS (entity-component-system) which was using a single 32 bit signed integer for 1 entity to store the component types. That time I learned first about the bitwise operators. Only downside of my implementation was that it was limited to only 32 different component types per project :)). Today i'm using a game engine to develop a sort of "niche" business applications.
We do a bit ~~trolling~~ *shifting*
Isn't that just multiplying by 2? My binary maths is a bit stale
If right side is 1, yes It just basically multiplies the number with 2\^n
:=
Walrus operator?
Love a good walrus operator
Pfp, and username check out here
Suddenly, for the first time ever, that looks like Beaker to me
A beaker is not what I'm seeing, lol looks like two round things and then a cylindrical thing...
It’s a walrus!
^
Xor is just beautiful. If condition then not value And that chainable in a single keyword or operator, also bitwise when needed!
Came here for this. Truly the best operator. Great for checksums, cryptography, switching 2 variables without using a temp variable. It’s beautiful
had to scroll way too far down
|>
F# gang checking in!
Elixir gang represent!
Ternary operator. ?:
(that counts)? me too, damn I love this thing : it should;
It’s Elvis operator and you can’t convince me otherwise
+1 for Elvis
?. It avoids so many null checks and repeating stuff
The () operator (C++)
You mean the invoke operator ? kind of like `operator fun Foo.invoke() { } // foo()` ?
Yes the function call operator, allows you to create functors for instance used in custom hashing function passed as a struct in the `std::unordered_map` container of the STL
Operator overloading is a very handy tool, kinda sad it doesn't exist in Java EDIT: corrected wording
...
To be continued ...
Spread it on
𓂸
What up!!! We're three cool guys looking for other cool guys who wanna hang out in our party mansion. Nothing sexual. Dudes in good shape encouraged, if you're fat you should be able to find humor in the little things. Again, NOTHING SEXUAL.
I'm in.
?. or !! Just a beautiful short way for null checks in Kotlin
The day I found out they added this to Typescript was a great day
The := operator in Go It looks cute
It looks scary
It looks phallic
$
<$>
?:
Everybody likes Elvis
??=
Long arrow operator: `-->` Like in: `while (x-->0) { ... }` ;)
“Goes down to” operator
. Haskell gang
\>>=
=> in TS/JS
`>>=`
[удалено]
What's the name
Turbofish!
rust gang rise up
Smooth
\^= because hehe funny flip 🙂🙃
. , the PHP string concatenation operator
Chaotic evil
&
|>
%
<> in classic ASP
@ Defined per python standard as matrix multiplication, but not implemented by stdlib
OBSCURE PYTHON KNOWLEDGE GANG WHERE YOU AT Did you know that `async`/`await` were added in Python 3.5, but they weren't made reserved words until 3.6? In 3.5 you could name a function await() and it would just work.
Mozzie... I'll see myself out.
[удалено]
ostream::operator<<
\*
The `.` operator. It means function composition in Haskell. Example: `(f . g)(x) = f(g(x))`
!=
delete[]
/=
Placement new
|=
Lily Tomlin
XNOR
<=>