HackerTrans
TopNewTrendsCommentsPastAskShowJobs

svalorzen

no profile record

comments

svalorzen
·2 anni fa·discuss
The problem with this is that it will not actually parse double in IEEE 754, as you will accumulate inaccuracies at every step of the loop. In theory, when parsing a float, you are supposed to return the floating point that is closest to the original string number. Your code will not do that. Even if you accept the inaccuracy, if you for some reason load the JSON using a runtime library, you'll get different numbers and consequently and result that depend on those numbers. For my use-case this was not acceptable unfortunately..
svalorzen
·2 anni fa·discuss
I recently actually tried to do a very similar thing, although a bit tighter in scope. What stopped me what that actually deserializing floating points cannot currently be done at compile time; the only utility available to do so is `from_chars` and it is only constexpr for ints.

I did not see any mention of this in the post; so are you actually simply extracting the string versions of the numbers, without verifying nor deserializing them?
svalorzen
·2 anni fa·discuss
I mean, surely if you are doing something that requires this level of precision, you could just ask the user to input its current known location? I doubt that even if the user misdialed by ten or twenty meters the difference in compensation would matter (or even if the camera was actually moving around).
svalorzen
·3 anni fa·discuss
Also, in case anyone is interested, the uninformative Jeffreys prior for this in Bayesian statistics (meaning it does not assume anything and is invariant to certain transformations of the inputs) is Beta(0.5, 0.5). Thus the initial guess is 0.5, and it evolves from there from the data.
svalorzen
·3 anni fa·discuss
There is a Vim plugin called EasyMotion, which I absolutely love, which when invoked creates a simple 1 or 2-key "checkpoint" at the start of every word on your screen, and super imposes them on the text. Then it's only a matter of looking at the point where you wanted to move, and press the two keys written there, and there you are!

It's also fairly customizable in that you can specify which characters are actually allowed (so you don't end up with very weird keys to press), and some other stuff. So every time I need to move somewhere I can't be bothered to figure out the standard keys it would take me to get there, it saves me.
svalorzen
·4 anni fa·discuss
> No, not necessarily. Several studies have shown that different people can get different amounts of energy out of the same food, depending amongst others on their gut micro biome, though stress also seems to play a role. It’s never going to be that simple.

Sure, so they just need to compute their at-rest calorie consumption differently, and from there the rest is the same.

> Conventional thermodynamics don’t work when you consider a full human, which is a very out-of-equilibrium and not-isolated system. Conservation of energy does not tell you anything about the efficiency of the energy extraction process.

This is like saying that even if you don't refuel your car it will never stop, because different cars have different mpg ratings. A human is indeed a closed system when you consider the works it outputs and the calories it ingests, unless I somehow missed a newfound capacity for photosynthesis. The fact that it might be a bit harder to compute calorie requirements than what might be naively done does not allow you to just dismiss everything else.
svalorzen
·4 anni fa·discuss
Hasn't your bet already been beat in concept by https://en.wikipedia.org/wiki/L%C3%A1szl%C3%B3_Polg%C3%A1r ?

He is a chess teacher who decided to train his daughters in chess from a very young age. What do you know, two of them became the first and second best players, with the best being considered the best woman chess player of all time. Unlikely that they somehow just all got chess genius "genes" from him.

It really does seem that heavy investment from a young age by a good teacher can work wonders.
svalorzen
·4 anni fa·discuss
I thought about this for a bit, and I have a feeling that as long as everything is touching the ground, then making covering loops is impossible, and so there exist a simple ordering you can compute.

The ordering is as follows: I'm assuming the isometric rendering of a map as a 45 degrees tilted square, and I'm only considering tile ordering just for simplicity but it should generalize fine. The uppermost tile is where you want to start rendering. From there, you render following the two 45 degree diagonals until you are done (so you don't only look at the y axis). Once this is done, you restart the process from the tile just below the uppermost corner, and so on. This ordering makes sure that all rectangular objects that are aligned with the 45 degree diagonals are rendered correctly.

Now you need an additional trick to render rectangular objects that are transversal to those diagonals correctly. What you do is you keep track of the boundaries of all such objects, so that the rendering loop described above can tell when it encounters one. Once it encounters it, it pauses rendering the current diagonal and considers it temporarily complete. The diagonal on the other side still needs to be rendered fully though --- or at least as far as possible with the same stopping condition. The next rendering pass will likely at some point re-encounter the same transversal object, just at a further point. Stop again, start the next diagonal. Once the rendering encounters the lowest and last part of the transversal object, then that object can be rendered, and the first stopped diagonal can be resumed (and after this resume all the paused diagonals in order).

This should always give you the correct order to render everything without errors. Let me know if this made sense, otherwise I can try to clarify.