HNHacker News
TopNewBestAskShowJobs

ursusmaritimus

7 karma · joined September 25, 2022

https://mj.ucw.cz/
submissionscomments
ursusmaritimus··on American flag sort
Lexicographic encoding of UTF-8 byte sequences matches lexicographic order of the sequence of Unicode code-points. So you can sort UTF-8 strings as byte strings. Not that sorting by code-points has much meaning, but you can use the Unicode collation algorithm first.
ursusmaritimus··on SI Units for Request Rate
Maybe we can generalize the becquerel to mean the average number of events per second of an arbitrary Poisson process? (The number requests per second and the number of decayed particles per second usually follow Poisson distribution.)
ursusmaritimus··on Show HN: Integer Map Data Structure
Interesting, but the summary does not mention an important fact: the data structure can contain at most 67108864 items, which is a quite low limit.
ursusmaritimus··on Tagged PDF Funsies
I don't think that it's silly - it's just over-engineered :)

What the author describes is a general data structure called a "number tree", which is a general mapping from integers to arbitrary objects, represented as a tree of PDF objects. It is used in the standard at many places; in some cases, the keys are not consecutive.

The advantage over a plain dictionary or array is that the whole structure need not fit it memory at once. It's questionable if this is ever needed, but in early days of the PDF standard machines were much smaller and the authors decided to plan for documents with millions of pages processed by small machines. This style of thinking permeates the whole standard: see for example the page tree.

Still, it's unnecessarily complex for all but a tiny fraction (possibly zero) of uses. I would really appreciate if it were possible to use dictionaries instead of number trees whenever the tree is small.

ursusmaritimus··on Someday aliens will land and all will be fine until we explain our calendar
There is an old Slavic word "vtorý" for "second" (not sure about spelling, but it is documented for example in old church Slavonic). Russian still uses "vtoroj" for "second". Several other Slavic languages have a word for Tuesday based on this root, even though their usual word for "second" follows a systematic derivation based on "dva" (two). Examples includes Czech and Slovak ("úterý" for Tuesday in both) and Polish ("wtorek").