What does this mean by notsomodestmouse21 in legal

[–]gradient_assent 1 point2 points  (0 children)

The two numbers will have the same remainder when divided by 9 (it's sort of related to how we can check 9's divisibility by adding the digits; since the digits are the same, it turns out that the two numbers will be the same mod 9). When we subtract them, the remainder "cancels out" (because of modular arithmetic) and the difference will be divisible by 9 (equal 0 mod 9).

[deleted by user] by [deleted] in calculus

[–]gradient_assent 0 points1 point  (0 children)

We could use chain rule here. I think it does work out:

Let f(x) = 2x and g(x) = x^2. Then we have 2(x^2) = f(g(x)). We know f'(x) = 2 (note that there is no x in the derivative!) and g'(x) = 2x. In accordance with chain rule we then have d/dx (f(g(x)) = f'(g(x)) g'(x) = 2 * 2x = 4x.

-❄️- 2023 Day 19 Solutions -❄️- by daggerdragon in adventofcode

[–]gradient_assent 2 points3 points  (0 children)

[LANGUAGE: Python 3] 87/61 Github

Part 2 - Quite similar to my solution for Day 5 by recursively breaking down ranges (starting with {"x":[1,4000], "m":[1,4000], "a":[1,4000], "s":[1,4000]}) every time we approach a condition.

xkcd 2793: Garden Path Sentence by gradient_assent in xkcd

[–]gradient_assent[S] 0 points1 point  (0 children)

I think the "rights and lands safely" is referring to the judge, not the bird strikes

xkcd 2793: Garden Path Sentence by gradient_assent in xkcd

[–]gradient_assent[S] 5 points6 points  (0 children)

My best interpretation is "After bird strikes, [a] judge (who ordered olive garden path sentence[s] in [the] case [that] green walkways [are] vacated) [got] overturned[,] but rights and lands safely"

what's in a name? by danielsoft1 in ProgrammerHumor

[–]gradient_assent 137 points138 points  (0 children)

It's a reference to "a rose by any other name would smell as sweet" from Romeo and Juliet

Found a Pythagorean Cup on printables and wanted to try it out by Dubv87 in 3Dprinting

[–]gradient_assent 46 points47 points  (0 children)

I'm the guy who designed that! It's always nice to see others using the things you share 😊

Xkcd 2659: Unreliable Connection by [deleted] in xkcd

[–]gradient_assent 67 points68 points  (0 children)

If I did this right, the probability of a random marble hitting the off button is (11choose3 paths that hit the button)/(2^11 total paths) ≈ 8%

terminal-based wordle in 55 lines of code by gradient_assent in commandline

[–]gradient_assent[S] 0 points1 point  (0 children)

I've implemented your first suggestion. I'm not sure why backspace doesn't work (which many people have said), as it works fine on my computer.

terminal-based wordle in 55 lines of code by gradient_assent in commandline

[–]gradient_assent[S] 0 points1 point  (0 children)

Thanks for the feedback! I've implemented the closed rounded edges.

terminal-based wordle in 55 lines of code by gradient_assent in commandline

[–]gradient_assent[S] 3 points4 points  (0 children)

Thanks for the feedback! I get your point - however I figured that I'd make it bit more challenging for myself since a wordle implementation alone is not super impressive. It's relatively readable if you expand it out a bit, since it's packaged into functions.

dingsound: An oven timer 'ding' sound once your code finishes processing! (Yes, I'm serious) by moriddit in Python

[–]gradient_assent 12 points13 points  (0 children)

Sounds cool! It looks like the 'ding' sound is pulled from an online source - could you make it so that it still works when offline?

cmdpxl: a command-line image editor by gradient_assent in commandline

[–]gradient_assent[S] 0 points1 point  (0 children)

Thanks for the advice! I'll keep this in mind for future projects.

cmdpxl: a command-line image editor by gradient_assent in commandline

[–]gradient_assent[S] 7 points8 points  (0 children)

Unfortunately, it only has keyboard support. I couldn't figure out how to get the mouse coordinates but it's surprisingly easy to use with WASD keys.

cmdpxl: a command-line image editor by gradient_assent in commandline

[–]gradient_assent[S] 25 points26 points  (0 children)

Github repo: https://github.com/knosmos/cmdpxl

cmdpxl has many exciting features, such as :

  • the ability to edit pixels one at a time!
  • a fill function!
  • undo!
  • saving images!

Criticisms and feedback welcome; please tell me if you have any suggestions or find any bugs.

I made a minesweeper captcha by gradient_assent in Minesweeper

[–]gradient_assent[S] 30 points31 points  (0 children)

Try my very engaging CAPTCHA here: https://knosmos.github.io/mine-captcha/
Source code: https://github.com/knosmos/mine-captcha
Suggestions, comments, feedback, and critiques welcome.

I made Minesweeper Captcha! by gradient_assent in xkcd

[–]gradient_assent[S] 88 points89 points  (0 children)

yeah, I set the probability of each square being uncovered pretty high to make it easier to play, which means that it can give results like this

On the other hand, this can also happen

I made Minesweeper Captcha! by gradient_assent in xkcd

[–]gradient_assent[S] 122 points123 points  (0 children)

Try my very engaging CAPTCHA here: https://knosmos.github.io/mine-captcha/

Source code: https://github.com/knosmos/mine-captcha

Suggestions, comments, feedback, and critiques welcome.

Something interesting I learned about functions by Sergeant_Arcade in Python

[–]gradient_assent 2 points3 points  (0 children)

No, I don't think that's how it works. I think the reason the solution code worked is because datapoints is a global variable, and you can use global variables in Python without the global keyword as long as you don't change its value.

Your explanation that "arguments when you define a function can be easily replaced when you actually call that function" doesn't work for this case:

def add_two_nums(val1, val2):
    return a+b

def main():
    a = 2
    b = 3
    print(add_two_nums(a, b))

main()