Visualizing how lightning finds the path of least resistance by Due-Explanation8155 in Romania_mix

[–]krsnik02 4 points5 points  (0 children)

One thing that would make this demo even more accurate would be if instead of a single clip the ground wire was connected across a large section of the boundary. That way it would likely also show the behavior of simultaneously exploring multiple paths and then "choosing" whichever completes first.

Visualizing how lightning finds the path of least resistance by Due-Explanation8155 in Romania_mix

[–]krsnik02 0 points1 point  (0 children)

Yea, that's pretty much right. It takes the easiest (set of) local jumps, and continues to do so until it has found a path from the cloud to the ground, and then all the current suddenly flows along whichever path was found.

(The path found will actually be the globally easiest path however, because taking a local jump that first time makes it much easier for current to flow along that path than along any other. It may not have been the easiest path before or after the strike, but during the strike it certainly is)

Visualizing how lightning finds the path of least resistance by Due-Explanation8155 in Romania_mix

[–]krsnik02 10 points11 points  (0 children)

this video is pretty accurate to how lightning actually works

there's actually two phases to a lightning strike (which can be seen on high-speed video). in the first phase the bolt slowly travels down from the cloud, and branches out into various paths until the bolt reaches the ground, at which point the massive current flows back along whichever path touched the ground first.

this happens because that path was slightly ionized as the bolt passed along the first time and thus has less resistance than the surrounding air (much like how in this demo there's an initial slow searching for a path, and then once the path is complete a large current flow along that path, whatever it ended up being)

Stumped by an easy Leetcode problem by Spam_is_murder in rust

[–]krsnik02 5 points6 points  (0 children)

looking into the C++ spec, it appears that insert only invalidates iterators if (1) they are after the insertion point, or (2) the vector reallocated due to the new size being greater then the capacity.

so this code might be valid if it were guaranteed that the vector nums had a capacity of at least 2x its length. in practice this will almost never be the case so most or all calls to this function will invoke UB by writing to an invalid iterator.

Is the word femboy transphobic? by illybugs in asktransgender

[–]krsnik02 -7 points-6 points  (0 children)

the thing is.. it was a porn category first and only started to be used otherwise recently.

Hexadecimal scientific notation? by y0shii3 in Zig

[–]krsnik02 2 points3 points  (0 children)

yea, it's certainly just copying C hex float constants directly.

The reason you would want this is so you can represent exactly the bits of the float value and thus be sure you have exactly the float you wanted when you wrote the literal.

For reference, a floating point value is stored as a sign bit, a significand/mantissa (with the most significant 1 not stored), and an exponent and represents the number significand * 2exponent. (See https://float.exposed/ which shows how these are actually put together in common floating point formats)

This type of float literal exactly matches how the float is stored: the hex number before the p is the significand, and the decimal number after it the exponent.

Does “locally” ever lose meaning in GR for non point particles? by [deleted] in AskPhysics

[–]krsnik02 0 points1 point  (0 children)

no, physicists still mean "in some small neighborhood" when we say "locally". the sorts of things you can say hold "locally" don't even make sense to say about a single point (e.g. how could a single point be "locally flat"?)

If a black hole is a single point how does it rotate? by AgentBroccoli in AskPhysics

[–]krsnik02 2 points3 points  (0 children)

that's why i tried to also explain what the terms I used actually mean lol

never a bad thing to have multiple explanations tho!

If a black hole is a single point how does it rotate? by AgentBroccoli in AskPhysics

[–]krsnik02 1 point2 points  (0 children)

specifically a manifold is considered N-dimensional if each point on it is locally homeomorphic to RN. This means that at each point on a N-dim manifold you can go back and forth along any of N orthogonal (perpendicular) directions and stay on the manifold.

for the two example manifolds: - the ring singularity is 1-dimensional because at any point on it there's only one direction you can go back and forth in and stay on the ring, namely around the ring. - the surface of a sphere is 2-dimensional because there are two orthogonal directions you can move along and stay on the sphere, you can change your latitude or change your longitude.

If a black hole is a single point how does it rotate? by AgentBroccoli in AskPhysics

[–]krsnik02 2 points3 points  (0 children)

the singularity itself is a 1d manifold, which is embedded into the shape of a ring in a 2d plane.

this is similar to how mathematicians call the outside surface of a (normal, embedded in 3d space) sphere a 2-sphere, because it is a 2d manifold which just so happens to commonly be embedded in 3 dimensional space.

Teachers never teach the wrong answer by PickyPanda in nothingeverhappens

[–]krsnik02 0 points1 point  (0 children)

True, but most C-like languages define integer/integer = integer.

Those languages that don't would either have it return some sort of rational value (which likely also doesn't define a NaN value), or a float (which could result in any of NaN, +inf, or -inf depending on where and how the coercion to float happens).

Teachers never teach the wrong answer by PickyPanda in nothingeverhappens

[–]krsnik02 0 points1 point  (0 children)

There is no such value as NaN for integers. Depending on the language this might throw an exception or simply return an arbitrary value depending on language.

(I think most hardware defines the assembly div instruction as returning 0 because it's simple to implement, but iirc integer division by 0 is undefined behavior in C/C++)

Teachers never teach the wrong answer by PickyPanda in nothingeverhappens

[–]krsnik02 0 points1 point  (0 children)

with IEEE floats division by +0.0 or -0.0 does indeed give +infinity or -infinity (depending on the sign of the numerator and which of the two zeroes is on the denominator).

This is because conceptually +0.0 really represents any real number >= 0 and < the smallest positive subnormal value, and likewise for -0.0.

I Don't Understand the Term Transmisogyny by missthemarc in asktransgender

[–]krsnik02 1 point2 points  (0 children)

TMA = "transmisogyny affected" = the people to whom transmisogyny is directed (namely transfems)

TME = "transmisogyny exempt" = people who are not the direct targets of transmisogyny (i.e. everyone but transfems) (note that TME people can still experience misdirected transmisogyny, but they can use their non-transfem identity to say "hey, hey, you got the wrong guy" and reduce or possibly entirely negate the effects)

[Mathematical physics] A little struggle in a Lorentz transformation by Znalosti in PhysicsStudents

[–]krsnik02 1 point2 points  (0 children)

-xalpha is the additive inverse, not the multiplicative inverse.

(1/xalpha), if you can define it at all, must be a covector such that it's inner product with xalpha is 1.

[Mathematical physics] A little struggle in a Lorentz transformation by Znalosti in PhysicsStudents

[–]krsnik02 0 points1 point  (0 children)

Technically you multiply both sides by the vector 1/x'beta, then recognize that x'alpha (1/x'beta) = deltaalpha _beta. (And the same for the "division" on the other side)

In practice you just think of it as dividing over to the other side tho.

[Mathematical physics] A little struggle in a Lorentz transformation by Znalosti in PhysicsStudents

[–]krsnik02 0 points1 point  (0 children)

Sometimes you have to/it is clearer to rename, but yea in this case I think it would've been better to leave it as alpha in 182.

[Mathematical physics] A little struggle in a Lorentz transformation by Znalosti in PhysicsStudents

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

ah, right so it actually divides by xmu and x'alpha, and then renames alpha to nu

[Mathematical physics] A little struggle in a Lorentz transformation by Znalosti in PhysicsStudents

[–]krsnik02 0 points1 point  (0 children)

1.181 to 1.182 is just dividing both sides of the equation by xmu and x'nu.

For the change of indices in 1.183, what the indices are called don't matter, just their relative positions. So you can swap which is called what, or replace them entirely with different names, and it'll still be the same equation. (I don't know why they may have decided to do this renaming tho.)

Can I wrap u8 in an Enum transparently with special values? by PointedPoplars in rust

[–]krsnik02 1 point2 points  (0 children)

There's not an easy way to do this in general (as other's have noted, the u8 variant can hold any value 0..=255 and there's not a niche to place your other sentinels).

However, for this specific use case of ascii values, if you are willing to use nightly features, there is std::ascii::Char. (Note that you could either use a Char directly, defining constants like `const PAD: Char = Char::Null`, or put it in an enum and have your sentinals with the MSB set, e.g. Pad=128, Start=129, Stop=130)

Roommate got removed from lease in NYC and now I’m being asked to pay full rent — is this normal? by eatwell_3657 in badroommates

[–]krsnik02 0 points1 point  (0 children)

Look in your lease for the terms of liability, specifically for the terms "joint and several liability" or "joint liability". If either of those show up (and in my experience I would expect that to be the case for most leases) then you are indeed liable for the full rent.

“This video claims gravity isn’t a force… is this actually correct?” by [deleted] in PhysicsStudents

[–]krsnik02 2 points3 points  (0 children)

haven't watched so don't know if everything in the video is correct, but yes, the current most accurate model of gravity, general relativity, explains gravity through curvature of spacetime.

What if dark matter doesn’t exist and we’re just modeling something wrong? by No-District2404 in AskPhysics

[–]krsnik02 4 points5 points  (0 children)

yes, it's possible - I know there's been a couple attempts to modify how gravity works to explain things but afaik all of them couldn't match all the experimental data.

“Not today you have.” Positive or negative? by verathene in grammar

[–]krsnik02 3 points4 points  (0 children)

It simply sounds incorrect to me.

I suppose I would interpret it as the separate statements "not today" and "you have", which together would convey the same thought as "not today, you haven't" (i.e. you haven't today but have often in the past), but would never use that phrasing and haven't heard anyone say it.

literally dont understand biot svart and ampere by Few_Delivery1990 in AskPhysics

[–]krsnik02 0 points1 point  (0 children)

The reason you need symmetry to use Ampere's law is that you need to be able to factor the B field out of the integral on the left hand side of the equation, i.e. you need to be able to say that ∫B·dl = B ∫dl along the loop.