« first day (3909 days earlier)      last day (1117 days later) » 

3:40 PM
How’s the election going?
 
3:58 PM
Was just getting ready to post an update, actually. 😉
Today is the last day for nominations before the election starts tomorrow. So if folks have been waiting to throw their hat in the ring, now's your last chance!
3
There's currently just one nominee, so your odds of success are very good. 😁
 
I would like to try, but I don’t have the best history of good questions or answers.
But, I have learned a lot, and feel like I could help contribute to the site.
@DMGregory How good?
 
4:14 PM
I think you might want to wait a bit. You're still quite new to the site, and you have a lot of moderation powers still to look forward to by earning reputation normally.
 
Yes, I suppose that is true. And 400 something reputation doesn’t look the best compared to Phillips 103K.
Or your 100K~
 
Haha, don't worry too much about rep. It's mostly just a tool to stage-out introduction of user moderation powers, so that we don't get too much spam/chaos from drive-bys and low-investment users.
 
Oh yeah, is that why they don’t allow comments until you get to a certain rep?
 
Exactly.
 
That’s a pretty smart move.
 
4:19 PM
It has its pros and cons.
 
How have you folks been doing today? I’ve been a bit busy lately.
 
Doing alright... procrastinating on some grading.
 
I procrastinate a lot unfortunately.
 
I think I need some blood sugar. Gonna make up some omurice. 😊
 
Cool, what’s that?
 
4:35 PM
Tomato fried rice wrapped in an omelette.
I like making it with leftover Japanese curry rice, and I had some kicking around.
 
 
2 hours later…
6:29 PM
I just reached 2,000 rep on Arqade. Now it appears I can instant edit?
Does that mean I would still get +2 rep for every edit?
 
Congratulations.
 
Thank you!
 
22
A: How does editing affect reputation?

CatijaYou only get the +2 when editing a post that is not your own. "Post" means question or answer. You can not edit even your own comments after a certain window and you can never edit someone else's without being a diamond moderator. The most reputation you can earn for edit suggestions is 1000 r...

> The most reputation you can earn for edit suggestions is 1000 reputation - and you don't earn any reputation for submitting post edits after you earn the edit privilege at 2000 reputation. So, unless all someone does is edit, they usually reach 2k long before they hit that 1k rep cap for suggested edits.
 
Ah. That makes sense, as it would cause quite a bit of trouble if people just spammed edits for more rep.
 
 
2 hours later…
8:54 PM
Hey, can someone please help me with this animation problem in my game? I'm using an isGrounded bool, and I'm using that to decide whether or not to play the animation. The issue is, I can't figure out how to order the animations to work properly. Here is the portion of my code:
        // Finds whether the character is grounded
        isGrounded = Physics2D.OverlapCircle(groundCheck.position, checkRadius, whatIsGround);

        // This is the jumping method
        if (Input.GetKeyDown("space") && (isGrounded == true))
        {
            rb.velocity = new Vector2(rb.velocity.x, (jumpsystem.middleness * 4f));
            animator.SetBool("jumping", true);
        }
I figured out how to make it start, but I can’t figure out how to make it stop.
 
Would something like "if isGrounded and velocity is not pointing up, set Jumping to false" work for you?
 
Yes, but I’m not sure how to do that.
 
9:12 PM
if (isGrounded && rb.velocity.y <= 0f) { animator.SetBool("jumping", false); } ?
 
Works perfectly. Thank you. 👍
 
That's a pretty direct translation of that sentence into code - can you clarify which part was giving you trouble?
 
I was just running into the issue where if I made the exit requirements “isGrounded == false” I ran into the issue where it would cancel out everything else. And, if I made it “isGrounded == true”, it canceled out again. I kinda ended up in a loop of sorts.
 
9:27 PM
FWIW: in most languages (including C#) you can evaluate a boolean directly.
For instance: if (isGrounded) is the same as if ( isGrounded == true)
Logically it doesn't matter, but when you say them out loud, one tends to more naturally follow how you think about it.
 
Oh. I didn’t know that. Could you use !isGrounded in replacement of “isGrounded != false”?
 
Almost
Sorry, just noticed you have a double negative in there.
!isGrounded is the same as isGrounded == false is the same as isGrounded != true
 
There's also the "Yoda conditional" phrasing, if (true == isGrounded) 😜
 
Oops. I didn’t notice it either.
 
Folks used to use that Yoda style to guard against accidentally writing an assignment instead of a comparison. I think with modern compilers/linters warning about that, these have fallen out of style.
 
user92578
9:36 PM
I actually use assignment in if statements quite a lot
 
Well, if to explain it Dagobah style I were,
I would say makes no logical difference it does.
Yet, have a preference, some programmers do.
 
user92578
It nicely reduces the scope of the variable into the if statement, making it hard to use for an example a null-thingy outside of the existence check
 
@DMGregory I've seen the similar if ( null == someRef), but I never really adopted it myself.
 
The big difference is that if you accidentally leave out an = sign, if (2 = myVar) fails to compile, because you can't assign a new value to the concept of 2 (in any sensible language)
 
cough smalltalk cough cough
 
9:43 PM
Whereas if (myVar = 2) is legal code that just does nothing like what you wanted it to do.
 
user92578
Fair
 
Not sure if I understand the scope reduction angle - can you walk me through that?
 
user92578
const auto value = getMaybeSomethingNullable()
if (value) {
    value->setup();
}
value->print(); // ... Whoops! Runtime crash

// VS

if (const auto value = getMaybeSomethingNullable()) {
    value->setup();
}
value->print(); // ... This won't compile, as the scope if 'value' is restricted to the if-block
 
user92578
Basically it's the same as wrapping the initialization & if-statement inside extra curly braces
 
Ahhh, I see what you mean.
 
9:51 PM
Well that's slick.
Plenty of times I've wanted something similar, but didn't want to { } a bunch of code just to get it.
 
The "difference" here is that you also declare the variable in the if, you don't only assign to it.
 
user92578
C++ also has initializer support inside if statements to extend this, basically you can do if (const auto value = getValue(); value->isModifyable) { value->modify(); }
 
user92578
Same scope reduction, but the if-statement doesn't have to check the truthyness of the assignment itself
 
That makes sense.
 

« first day (3909 days earlier)      last day (1117 days later) »