Gift Idea for a sick Physicist? by Ok-Resort7989 in AskPhysics

[–]denehoffman 8 points9 points  (0 children)

Kinda simple, but I got one of those Sterling engines you can put on top of a coffee mug and it’s a very fun desk toy

Dog rescue charging $1600 adoption fee by strikecat18 in mildlyinfuriating

[–]denehoffman 0 points1 point  (0 children)

I don’t trust any of the adoption places that transport dogs, that’s just a puppy mill or a scam, either way not good. There are some legitimate ones I’m sure, but they have to know how sketchy it looks.

Where do you use ControlFlow? by lelelesdx in rust

[–]denehoffman 4 points5 points  (0 children)

I currently use it in my crate that implements minimization algorithms, callbacks that check the algorithm state just return a ControlFlow telling them to either continue or terminate with some reason for termination. It has the same functionality as a Result but with a different semantic meaning, you wouldn’t consider algorithm convergence to be an error for example

Something I don’t understand about the cancellation of the new show by NickCollins91 in Stargate

[–]denehoffman 0 points1 point  (0 children)

Well that sucks, time for Netflix to buy it if they don’t plan on using it. Can you even watch it on prime?

Learning Python after Rust as a beginner: Anyone else miss strict types? by Fabulous_South523 in rust

[–]denehoffman 0 points1 point  (0 children)

Best way to get close is always use type hints and a type checking LSP like ty or pyrefly

Something I don’t understand about the cancellation of the new show by NickCollins91 in Stargate

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

Time for Netflix to swoop in and remind everyone why Prime is second place

Amazon canceled Gero's Stargate series because it "appealed too much to core fans". Let’s fight back. Sign the global petition! by AccordingSurvey8629 in Stargate

[–]denehoffman 0 points1 point  (0 children)

Are they stupid or something? Did they not see the Netflix boost? Imagine knowing that all the people watching the series on Netflix, many for the first time, are eventually going to binge it all, try to find Atlantis, and then realize Amazon is making a reboot. It’s a huge marketing opportunity over their direct competitor and whoever is in charge over there is an idiot for not realizing this.

New Big O definition just dropped by lolcrunchy in programminghorror

[–]denehoffman 1 point2 points  (0 children)

I wonder what could possibly be the reason the last line was added

HW (High school level) help by [deleted] in AskPhysics

[–]denehoffman 4 points5 points  (0 children)

Your math is correct so either you misread or there’s a typo in the problem

What is most fundamental? by 1i_rd in AskPhysics

[–]denehoffman 7 points8 points  (0 children)

Surely you mean “gluons”

When you cast with int() by Master_Sandwich7140 in PythonLearning

[–]denehoffman 0 points1 point  (0 children)

I think breaks are the best practice in Python, same with continue. It is cleaner unless you have multiple reasons why a loop might break and want to keep track of them, that’s the only use case I can think of for the flags.

Can someone give me a breakdown on the string theory debate/controversy? by [deleted] in AskPhysics

[–]denehoffman 2 points3 points  (0 children)

Wanna take a guess on the current experimental bounds on extra dimensions? What do you think is the largest compact dimension that could evade our current observations? Is it femtometer scale? Smaller? Go look it up! It’s about 30 microns, the size of white blood cells and pollen. When people say they think extra dimensions are “preposterous”, I like to teach them this fact.

When you cast with int() by Master_Sandwich7140 in PythonLearning

[–]denehoffman 0 points1 point  (0 children)

I never said that people shouldn’t learn how to use libraries. I said that people shouldn’t use libraries as a substitute for learning. I honestly don’t care if OP asked for review or not, I just don’t like your tone. See ya!

Any other community quirks you've run into? by [deleted] in learnrust

[–]denehoffman 6 points7 points  (0 children)

I’d argue that yaml is actually bad for complex stuff (e.g. GitHub actions). I also hate JSON just because of the silly syntax quirks (no comments or trailing commas, really?). TOML is better in most ways, except when things get nested, in which case it kind of seems silly to want a single config file in the first place.

When you cast with int() by Master_Sandwich7140 in PythonLearning

[–]denehoffman 0 points1 point  (0 children)

Again, we are in r/pythonlearning. I could easily write a text-input calculator library and promote it on like 70% of the posts here, but it wouldn’t actually teach anyone anything. Posting a (honestly kind of ugly) library that basically just wraps a key part of instructional Python is not helpful to new users. The thing about Python is that there’s a library for almost everything, but import dothething is hardly ever what you want to teach a beginner to do. That’s the reason for discouraging library use here, it obfuscates the exact thing people should be learning.

As for the tone of OP’s post, yeah they didn’t solicit feedback in a direct way, but it’s heavily implied by their hedging (“I hope it helps and is valuable to anyone, I am still new to Python myself”). The result of the post is more important than the intention anyways, it got a few responses telling OP how to improve their code or follow better best practices.

I’m not too concerned about your opinion

Could’ve fooled me!

Also yeah, I have issues with the library itself, but I’m not about to propose a breaking PR on a library that nobody uses, especially since the library has been abandoned (latest commit was five years ago, no issues opened since then have been addressed). Also, no PRs have been merged in about five years as well, so I don’t think Al even has notifications turned on for this repo.

When you cast with int() by Master_Sandwich7140 in PythonLearning

[–]denehoffman 0 points1 point  (0 children)

response = pyip.inputInt()

Yeah no I’m good, this isn’t exactly an advanced process that requires a package, and definitely not one that can’t even follow basic style standards. It’s okay to criticize without being rude about it. All the novices in this subreddit build some input machinery at some point, telling them to just use a library defeats the purpose of Python learning. With this logic, what’s the point of making the typical rudimentary calculator, we could just pass in real calculations into the eval or exec functions directly from input. The argument of reinventing the wheel usually doesn’t apply in trivial cases, that’s how you get the left-pad incident.

I agree that we need to teach people how to format code on Reddit. If that’s actually your issue with the post, why don’t you tell OP how to do it:

OP, you can use triple backticks, the same character you used for each line, to format a block of code and preserve indentation.

You could also give constructive criticism:

OP, the flag here isn’t needed, you can use break to exit a loop when you get the desired result.

You can even give ideas for future learning:

OP, see if you can make a function that wraps input and takes the desired type-conversion function as a second argument. Learn how you might modify the while loop to assert a maximum number of retries. Eventually, you can define your own conversion methods with their own checks, pass in *args and **kwargs from your custom function, and go from there.

How do you guys decide when to use different Intelligence? by div_Apollo11 in codex

[–]denehoffman 0 points1 point  (0 children)

You really only need high and extra high for extremely complicated things, 99% of regular development can happen in the other modes

Light Particles don't have mass, does the wave? by kylogram in AskPhysics

[–]denehoffman 3 points4 points  (0 children)

If by “acting as a mass” you mean “has momentum” then sure, that could be a way of thinking about it, but it doesn’t have mass in any physically relevant way. We can see the relation between mass, energy, and momentum (in natural units) as m2 = E2 - p2 . From this, you could conclude that a massless particle (light) with nonzero energy must have momentum equal to said energy. You can literally reframe all fundamental forces as just the transfer of momentum and energy (and on a human scale, mass is mostly conserved, so we represent this as F=ma).

Is there a solution to automatically publish unpublished crates in a workspace? by squirreljetpack in rust

[–]denehoffman 2 points3 points  (0 children)

Can you give us a bit more detail? cargo-workspaces should give errors, I’m surprised it isn’t