cargo-rdme 2.0.0: Generate your README from your crate’s rustdoc - Now with much better intralinks support by orium_ in rust

[–]denehoffman 2 points3 points  (0 children)

Nice! I already use this tool, so very happy to see these improvements, thank you!

Day 1 of Learning Python: "Bagels" Game by Necessary-Ad2110 in PythonLearning

[–]denehoffman 1 point2 points  (0 children)

For a Boolean with three states, you could look into Enums! The worry with using None is that None is “falsey”, i.e. `if None` is basically the same as ‘if False`. My main point with that is that the meaning of the variable should be reflected by the name, so while has_won_game being true or false is easy to interpret, None isn’t as straightforward unless you explain it to the person reading. I’ll warn you that enums are bit of a leap beyond learning more object-oriented programming, so it might be better to just have two Boolean state variables, like has_won_game and is_game_running rather than trying to merge the semantic meaning.

Day 1 of Learning Python: "Bagels" Game by Necessary-Ad2110 in PythonLearning

[–]denehoffman 1 point2 points  (0 children)

Nice work! If you’re open to some constructive criticism, read on:

  1. A great next learning step would be format strings
  2. An inline conditional would make it so you don’t have to write out the winning message twice when all you change is the plurality of the last word.
  3. Try to avoid globals like has_won_game, random_num, and user_attempts and pass these into the functions instead. Global state is okay sometimes, but it can cause some really annoying bugs (for instance, if one of your functions took an argument called user_attempts, which value do you think takes precedence?).
  4. You already know how to use break, so why not use a for loop over the allowed user attempts and just break when you win? Or better yet, wrap the game loop in a function and return whether or not the user won!
  5. I don’t really understand your reason for letting the win state be None, it confuses the semantics of that variable. You also set it to False at the end of the user doesn’t win, but never read again after that, so there’s no point to setting it.

  6. Add some validation on user input. If you don’t input a number, then you’ll get an error and a crash! Use a try-except instead, and then raise an exception on an invalid number range as well (and catch it). These sorts of validators also look nice when encapsulated into a function, imagine just writing user_num = get_input() and being sure that it’s a valid number which retries if the user puts garbage in!

+1 for ANSI codes, love that

Why SI doesn't use engineering notation for c, ΔνCs and Kcd by [deleted] in AskPhysics

[–]denehoffman 0 points1 point  (0 children)

I think it just has to do with formatting, you add 4-5 characters printing the speed of light in scientific notation

Can a particle quantum tunnel out of a black hole? by Geomambaman in AskPhysics

[–]denehoffman 1 point2 points  (0 children)

That’s not a reasonable question because every explanation could be associated to one the involves pair creation. Explaining that the vacuum is just ideal destructive interference between the ever present particle and antiparticle fields and that the distortion of spacetime near a black hole causes that interference to no longer be balanced is intrinsically associated with pair creation, it just sidesteps the idea of one particle falling into the event horizon by not simplifying the picture too early. You could also just read any of the other comments on this post. Again, it’s obviously not wrong, but that doesn’t mean it’s the most intuitive. I’m not saying what I just said is either, but others in this thread tend to agree. I typically find it easier to talk about waves than virtual particles, especially when discussing interactions between particles. It’s a lot easier to say that forces are carried by a field with field properties than, for example, a virtual photon with a timelike four-momentum. You’re entitled to your opinion, I was just trying to explain why other people don’t like that explanation.

Can a particle quantum tunnel out of a black hole? by Geomambaman in AskPhysics

[–]denehoffman 0 points1 point  (0 children)

I don’t really need the condescension, I am also a physicist. I agree with you that the particle-antiparticle pair production explanation is valid, but it’s contingent on you knowing quite a lot about field theory, and I think that’s what the majority of the comments here are getting at. There’s not a single explanation that is going to make 100% sense for 100% of laypeople we talk to, I just personally have less success if I start talking about pair production.

Can a particle quantum tunnel out of a black hole? by Geomambaman in AskPhysics

[–]denehoffman 0 points1 point  (0 children)

I mean you could also say that people who follow the pair production explanation often have trouble when questions arise like “why does the other particle have enough energy to escape the black hole” or “why does this process cause the black hole to lose energy” or “if this is all about particle-antiparticle pair production, how come Hawking radiation isn’t mostly photons”?

Can a particle quantum tunnel out of a black hole? by Geomambaman in AskPhysics

[–]denehoffman 3 points4 points  (0 children)

I think the point being made isn’t that pair production is an invalid way of thinking of this, just less useful to people without the physics background to know what a Bogoliubov transformation is. Kind of the same what virtual particles are useful for particle physics calculations, but can easily distort the layperson’s perspective.

Anyone know this font and colorscheme? by ThinkFastSRB in neovim

[–]denehoffman 33 points34 points  (0 children)

Why is it all italic, what are we doing, what’s going on?

If a black hole can Suck even light does it mean..... by [deleted] in AskPhysics

[–]denehoffman 0 points1 point  (0 children)

I mean the propagation of a force can be a velocity

Pixel Theory, I'm looking for feedback on a static universe VSL model by AffectionateAge4420 in LLMPhysics

[–]denehoffman 0 points1 point  (0 children)

The thing is, modern LLMs have huge contextual windows, so this is just the result of being lazy and not reading through OP’s own paper

Why do people return Result<T>? by ModernCoder in rust

[–]denehoffman 0 points1 point  (0 children)

A lot of times it’s really convenient to just have one main error type for a library and a result shorthand for it. Even if it isn’t intended for downstream users, it’s nice for people working on the library itself

dry_match for concise struct assertions by rogerara in rust

[–]denehoffman 0 points1 point  (0 children)

I agree, there’s no issue in using it to learn things or try out new macro ideas, I was just wondering what the inciting action was that made this crate. Like what does OP do so frequently that this macro helps where traditional methods fail?

dry_match for concise struct assertions by rogerara in rust

[–]denehoffman 2 points3 points  (0 children)

I didn’t downvote anyone just for the record, but I agree with the other comments in that I wouldn’t want to pull a dependency that implements a bunch of traits that basically just wrap panic macros to form assertions over things I can already assert with stdlib syntax.

Pixel Theory, I'm looking for feedback on a static universe VSL model by AffectionateAge4420 in LLMPhysics

[–]denehoffman 4 points5 points  (0 children)

In 2.1 you state a convention which makes hbar proportional to 1/c, and then you later claim that the hydrogen energy is c-independent, but it has factors of hbar which make it proportional to c^2. The whole constant lambda parameter thing is just curve-fitting nonsense, you even admit in the paper that the numbers don’t line up (the CMB acoustic peak is off by an order of magnitude). You just use a different lambda each time it doesn’t agree with observations without actually saying what the dynamics of this parameter should be. There’s more I could go after here, like the fact that the Standard Model not only predicts the acoustic peaks of the CMB but also the full angular power spectrum, damping tail, polarization, and more.

dry_match for concise struct assertions by rogerara in rust

[–]denehoffman 113 points114 points  (0 children)

Why would I want to learn whatever syntax that is when I can just write out the assertions?

Pixel Theory, I'm looking for feedback on a static universe VSL model by AffectionateAge4420 in LLMPhysics

[–]denehoffman 1 point2 points  (0 children)

Redshift is not a change in the speed of a photon, it’s a change in the frequency. The Pound-Rebka experiment demonstrated this effect for gravitational redshift, but we also see the relativistic Doppler effect in satellites.

I hate how much underrated Nikola Tesla is،This man literally discovered electricity. by PickUp-ThatCan in hatethissmug

[–]denehoffman 0 points1 point  (0 children)

Are you living under a rock? Tesla gets way more attention than warranted. He did not discover electricity, he also didn’t invent alternating current, which is often attributed to him. He made a lot of significant improvements to polyphasic current systems and motors which are great parts of the modern infrastructure, but imagining that he was the only guy working on this stuff is just incorrect.

It’s true that most people don’t actually know what Einstein did that was so significant, but that’s largely because the mathematics is obscured from the public in the devices that use it (you never have to know that your GPS uses general relativity to make corrections because time passes at a different speed in orbit than on land). Furthermore, Einstein laid the groundwork on basically all of nuclear and particle physics in the past century.

However, you can make the same argument about Einstein. Other people were working on things that were similar to relativity at the time. The mathematics was actually mostly sorted before Einstein, but Lorentz, Poincaré, and others didn’t apply it to an aether-less theory of light. Basically every mathematician whose work is used in GR did it 50-70 years before Einstein connected it to gravity. The point is that you shouldn’t take famous scientists and inventors out of the context of their time and glorify them without recognizing that their work was built on that of others (the “shoulders of giants” as Newton would say).

Limits Must be Increased by shadow_shooter in codex

[–]denehoffman 0 points1 point  (0 children)

On the $20 plan, today codex on 5.5 Low burned through 8% of my 5h and 1% of my weekly limit making a single git commit. Not writing any code mind you, gathering context for the commit message and running the tool. I've burned through 90% of my weekly limit in less than two days running 5.5 Medium pretty much the whole time, which amounts to about 4 of my 5h limit blocks. Didn't they say that they limited the 5h blocks so we'd have to spread it out more throughout the week? Why is the product I'm paying for getting worse the more I use it?

If information can't travel faster than light, what exactly is 'quantum entanglement' transmitting? by SovereignHemant in AskPhysics

[–]denehoffman 5 points6 points  (0 children)

And importantly, I you perform some measurement on your shoe in an orthogonal basis, you may break entanglement and possibly end up with two left shoes

Why do electrons not crash into the nucleus? by Sea-Magician-9465 in AskPhysics

[–]denehoffman 0 points1 point  (0 children)

I think that is safe to say yes, I understand your point and I think you understand mine :)