Hacker Newsnew | past | comments | ask | show | jobs | submit | ape4's commentslogin

Pretty big loophole!


And inertial guidance too?


I don’t know what airbus uses I only looked into the schematics of commercial avionics like Garmin. I doubted though IMU drift and calibration introduce more error than they can provide in useful signal, old school pressure sensors + gps adjusted manually or automatically for regional pressure settings (pilots get these numbers through radio when they enter a new pressure area) is accurate enough (~1m). I’ll let a real avionics engineer correct me here, I’d be curious if that signal is worth the hassle + I can imagine such tiny SMD sensors ARE the biggest victims of radiation hallucination.


Perhaps nicer to avoid the comment and write:

    const C1 = 505054698555331      // floor(2^64*4/146097)
as

    constexpr int C1 = floor(2^64*4/146097);


std::floor was made constexpr in C++23, which is pretty recent as far as C++ standards go. It's possible the author didn't think using C++23 was worth the constraints it places on who could use the code.


That's a mathematical expression, not a C++ expression. And floor here isn't the C++ floor function, it's just describing the usual integer division semantics. The challenge here is that you need 128-bit integers to avoid overflowing.


Ah, you're right. I saw that the expression in the comment and in the code was the same and assumed that the commented bit was valid C++ code. You got me to look again and it's obvious that that isn't the case. I had even gone looking through the codebase to see if std::floor was included, and still missed the incorrect `^`.

I guess in that case as long as the 128-bit type supports constexpr basic math operations that should suffice to replace the hardcoded constants with their source expressions.


    const C1 = 505054698555331      // floor(2^64*4/146097)
is faster

How about the immutable OSes like Fedora Silverblue


Might be nice if the ligature of != was ≠


Probably personal preference, but I prefer != not be smashed into one character.


as i mention in the description, Myna doesn't use ligatures. the Unicode sure looks very much like that in the font, though.


echo face | lpr


As long as the uninstaller can find it


Well the problem with that is that the past few generations of laptops have taken a page from chromebooks and only give you 128GB of storage, maybe 256GB if you're lucky, unless you add more, assuming that's even possible. Storage has never been cheaper, yet most laptops ship with barely enough storage for a base Windows install.


Same here. I don't care where the application goes; I care where the data goes. One of my initial annoyances when I started using PlatformIO was that it assumes a default workspace directory and as a new user, it took me forever to figure out where it was putting my files. I have a standard directory structure that I use and this was really messing me up.


>I care where the data goes

I used a Win10 debloater last year about 2 weeks after install. It deleted Minecraft, which is apparently a UWP too, and it deleted my world, because UWPs apparently store userdata in program directory.


I don't want an uninstaller to be required by default.


I think that ship has sailed. As soon as software uses more than one custom path to store its crap, I can no longer be sure I've deleted everything.


Almost like you might need some system-wide registry of application configuration...


I would be nicer if you gave x1 and x2 meaningful names


What would those names be in this example?


In a real application meaningful names are nearly always possible, eg:

    const pi = 3.1415926
    const 2pi = 2 * pi
    const circumference = 2pi * radius


Calling tau 2pi is the most cursed thing I've seen all day. Appropriate for Halloween.


If you call a variable tau in production code then you're being overly cute. I know what it means, because I watch math YouTube for fun, but $future_maintainer in all likelihood won't.


Where do you draw the line then? Stopping at `tau` just because `$future_maintainer` might get confused feels like an arbitrary limit to me.

What about something like `gamma`? Lorentz factor? Luminance multiplier? Factorial generalization?

Why not just use the full sentence rather than assign it to an arbitrary name/symbol `gamma` and leave it dependent on the context?

And it's not that hard to add an inline comment to dispel the confusion

  const tau = 2*pi; // Alternate name for 2pi is "tau"


Agree in real life you can come up with meaningful names (and should when the names are used far away from the point of assignment), but it doesn’t make sense for GPs example, where the whole point was to talk about assignments in the abstract.


Perhaps they could set the time to when it really started after executive approval.


Or maybe paste the essay into the question and ask what prompt was used to produce it.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: