1,269 karma · joined Jan 30, 2020 (6y ago) · 444 submissions
comment 4y ago · link · parent
There are some problems of the spec though, and navigation is not the most pressing one. The spec is huge, support for less used parts is spotty in various PDF readers. It also has inaccuracies (not corrected in errata) and underspecified parts.
4.
Tell HN: Adobe took down the PDF 1.7 specification from their site
114 points · by steerablesafe · 4y ago · 36 comments
comment 4y ago · link · parent
comment 4y ago · link · parent
An other commenter linked to some papers for asymptotically optimal entropy generation, I wonder if there is more of a streaming method there. It feels like there has to be, even maybe after a slow start. My naive intuition is that after 1000000 coin flips you have a good idea what p is, and then you can basically do arithmetic coding from there. Of course a theoretically correct method can't do exactly this, but it might asymptotically approach it.
comment 4y ago · link · parent
edit: On second thought this is probably a bijection and you can call it "arithmetic coding" in either direction.
comment 4y ago · link · parent
log_2(sqrt(1/(2*pi*p*(1-p))) - 1000*log_2(p^p * (1-p)^(1-p))
bits of entropy from 1000 coin flips, where "p" is the probablity of flipping heads.Neumann's method generates 1000/(p(1-p)) bits of entropy from 1000 coin flips. The theoretical maximum is
-1000*log_2(p^p * (1-p)^(1-p))
but it requires knowing "p" exactly. This method is close to the theoretical maximum. I didn't plug in numbers, or analyise further, but it's far better than Neumann's method.One obvious drawback is that you have to flip the coin a 1000 times to produce the first unbiased random bit, while Neumann's method starts producing bits much earlier.
comment 4y ago · link · parent
In this case I think it's on sass to introduce the awkward workaround on the syntax clash.
comment 4y ago · link · parent
How can you know if it's a single `T` or an array of `T` objects? You can memcpy into an array of `T` through a `T*` with no limitation on the size. I don't see anything inherently wrong with that either.
comment 4y ago · link · parent
edit: It's under "Bit-Fields" in [1]. I'm not entirely happy with the wording, but it's there.
[1] https://raw.githubusercontent.com/wiki/hjl-tools/x86-psABI/x...
comment 4y ago · link · parent
comment 4y ago · link · parent
At work we sidestep this by building the new C++ standard library implementation against an old libc, and ship it with our product. I can imagine that this could be problematic for other software though, especially ones that normally ship with the disto.