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

Nice. I notice that the author has some other interesting posts. I like this one on the James–Stein estimator [0] and this one [1] on day length variations.

[0] https://joe-antognini.github.io/machine-learning/steins-para... [1] https://joe-antognini.github.io/astronomy/daylight

By the way I think there's a missing factor of rho in the numerator in [1] in the sample transformation section. Should be rho^2


Thank you for the kind words! Yes, I think you're right about the missing factor of rho. And rho^2 is being drawn from a chi-squared distribution, not a chi distribution. (But the mode I stated is correct for a chi-squared distribution --- I must have omitted the squares when typing this up.)

What's the status on that? Did the series ever get finished?


No word on whether it's finished or will ever be but already looks complete enough to me? I mean, the subject is endless and there are so many ways to do things. But as primer, it's pretty good as it is.


I want to like this. But... one has to write the answer in EXACTLY the same format, down to each variable name it seems?


I'd love to see that. Could you link me to an implementation or explain this in more detail please?


Here's a 3D version used in the creation of sparse voxel octrees:

https://forceflow.be/2013/10/07/morton-encodingdecoding-thro...

Here's an example from AWS, where lat/long pairs are put into a Z-index, which is used as a DynamoDB sort key, letting you efficiently query for items near a point.

https://aws.amazon.com/blogs/database/z-order-indexing-for-m...


I would like to know about this more, too. Is there a code anywhere, ideally with comments? But I am fine without comments, too, I would just like to see the code and possibly with an example usage.


Okay, I was intrigued and I did some digging. Morton / Z-order is all about interleaving the individual bits of the x and y coordinates. You end up grouping by quadrants. Python one liner:

    points.sort(key=lambda p: sum(((p[0]>>i&1)<<(2*i))|((p[1]>>i&1)<<(2*i+1)) for i in range(16)))


With a tiny tiny caveat of wanting to run Nvidia drivers instead of nouveau.


Nvidia's official drivers have supported Wayland quite well since the 550-series. If you haven't tried it in a few years, now is a great time to give it a spin.


I hate that very often my first reaction to Show HN posts like this is to cynically look for signs of blatant AI code use.

I don't think that's the case here though.


Indeed. To me it still looks kind of fishy, because the author doesn't have a single other C project on github. The blog post reference is the only thing that makes it somewhat legit, to me at least.


Wait, is `List` to be avoided now? I'm behind the times then. I figured it was still the preferred type hint over `list`.


Avoided? Rather, probably personal preference.

But it is outdated since 3.9+ over just `list` . Same for `tuple`, `dict`, and so on)[0].

[0]: https://peps.python.org/pep-0585/


I'm assuming epoll is covered implicitly by the section on kqueue. Are there any differences between the two besides the name?


epoll returns a single value for events, and kqueue returns a struct.

   typedef union epoll_data {
       void    *ptr;
       int      fd;
       uint32_t u32;
       uint64_t u64;
   } epoll_data_t;
vs

   struct kevent {
       uintptr_t  ident;       /* identifier for this event */
       short  filter;       /* filter for event */
       u_short  flags;        /* action flags for kqueue */
       u_int  fflags;       /* filter flag value */
       int64_t  data;        /* filter data value */
       void  *udata;       /* opaque user data identifier */
       uint64_t  ext[4];       /* extensions */
   };
For read/write events, ident is the FD and data is the number of bytes that can be read or written.


The A321 is an elongated/bigger version of the A320. Similarly to the B737 - which also went through this process a few times (e.g. compare the B737-400 vs B737-600 vs B737-MAX) - it means the engines are moving a heavier&bigger plane.


It'd be a new airframe and not an elongation of an elongation of an existing one... So we might be lucky this time.


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

Search: