Live data from Hacker News

In defense of 'flicks' (or how I learned to stop worrying and love 705600000)

mux.com

31–40 of 66 posts

Re: In defense of 'flicks' (or how I learned to stop worrying and love 705600000)

#31
post #15

> The number result is 0.008333333333 with the 3 repeating forever. For a computer to store a number that repeats forever would require an infinite amount of memory This is very much not true, as I'm sure other HN readers will notice. The number is rational (it's equivalent to 1/120). Now, it is true that a floating point number may not be able to represent it exactly, but by no means does this number require "infini…

I wish you had kept reading. In the end, you nitpicked about precisely the thing which the author ended up explaining.

The point about using infinite memory to store an irrational number is just a rhetorical device / presentation style to keep the novice reader engaged, and following along. And then you say, "Next we will explain how to solve this impossibility...," and such.

It's a good technique for writing, and presenting, but doesn't work if your audience already knows where you're going and gets impatient with you!

Re: In defense of 'flicks' (or how I learned to stop worrying and love 705600000)

#32
post #28

Earlier quoted context omitted.

> Its comparing 1 dimensional space to 2 demential space Although I love the coinage "2 demential space", I think you mean "comparing one-dimensional space [audio] to three-dimensional space [video]". A two-dimensional signal might be a still image or a temporal sequence of samples from a one-dimensional array of sensors, such as those in a single slice of a CT machine or a linear MIMO antenna array. A video signal i…

Including pixel intensity, you are correct. Infact it has thee planes, so you could even call it 9 demential If you break it down that way.

No, wavelength is just one more dimension along which intensity may vary (in addition to X, and Y, and time), not five or six more dimensions, so a multi-band image is only three-dimensional, regardless of whether there are three wavelength bands (like RGB or YCbCr), four (like RGBA), 8 (like Landsat), or 210 (like HYDICE, AVIRIS, and other imaging spectrometers).

Re: In defense of 'flicks' (or how I learned to stop worrying and love 705600000)

#33
post #32

Earlier quoted context omitted.

Including pixel intensity, you are correct. Infact it has thee planes, so you could even call it 9 demential If you break it down that way.

No, wavelength is just one more dimension along which intensity may vary (in addition to X, and Y, and time), not five or six more dimensions, so a multi-band image is only three-dimensional, regardless of whether there are three wavelength bands (like RGB or YCbCr), four (like RGBA), 8 (like Landsat), or 210 (like HYDICE, AVIRIS, and other imaging spectrometers).

My point is, I am comparing temporal dimension to temporal dimension regardless of how many special dimensions there are. And I don’t understand the argument that an audio sample is more analogous to a pixel that it is a frame on a time line.

Re: In defense of 'flicks' (or how I learned to stop worrying and love 705600000)

#34
post #15

> The number result is 0.008333333333 with the 3 repeating forever. For a computer to store a number that repeats forever would require an infinite amount of memory This is very much not true, as I'm sure other HN readers will notice. The number is rational (it's equivalent to 1/120). Now, it is true that a floating point number may not be able to represent it exactly, but by no means does this number require "infini…

Thanks for the comment. For the record, I am very aware of iee 754, And I am aware that some numbers that have infinite repetition in decimal can have an exact representation. I actually thought about pointing that out. However I decided that it didn't add much to the post. It was written for more of a general audience and diving into those details, while would make the post more technically correct, would not actual…

[deleted]

Re: In defense of 'flicks' (or how I learned to stop worrying and love 705600000)

#35
post #31
post #15

> The number result is 0.008333333333 with the 3 repeating forever. For a computer to store a number that repeats forever would require an infinite amount of memory This is very much not true, as I'm sure other HN readers will notice. The number is rational (it's equivalent to 1/120). Now, it is true that a floating point number may not be able to represent it exactly, but by no means does this number require "infini…

I wish you had kept reading. In the end, you nitpicked about precisely the thing which the author ended up explaining. The point about using infinite memory to store an irrational number is just a rhetorical device / presentation style to keep the novice reader engaged, and following along. And then you say, "Next we will explain how to solve this impossibility...," and such. It's a good technique for writing, and pr…

I did keep reading the article, as I say in my edit. I differ from you in my interpretation of this facet of the essay. To me, it reads as internal contradiction — the author says that it is impossible to represent 1/120 in memory and then goes on to describe a strategy for doing just that.

The author does not present this conflict as "it may seem impossible…" but rather as "is is impossible." That's an inaccuracy, not a writing technique.

Re: In defense of 'flicks' (or how I learned to stop worrying and love 705600000)

#36
post #15

> The number result is 0.008333333333 with the 3 repeating forever. For a computer to store a number that repeats forever would require an infinite amount of memory This is very much not true, as I'm sure other HN readers will notice. The number is rational (it's equivalent to 1/120). Now, it is true that a floating point number may not be able to represent it exactly, but by no means does this number require "infini…

You can represent most useful irrational numbers on computers via programs that calculate them to the required degree of precision:

You can represent pi:

  4*atan(1)
e:

  log(1)
Now I feel like you could make arguments about non-computable numbers, although I feel like you could still “represent” them.

Re: In defense of 'flicks' (or how I learned to stop worrying and love 705600000)

#37
post #18

Earlier quoted context omitted.

The issues of "repeating decimal" and exact representation as a floating point number are orthogonal. Because the mantissa in a floating point number (which is fixed width) is in base 2, only fractions with denominators that are powers of two can be exactly represented. This means that simple base-10 decimals like 0.1 cannot be exactly represented by a float. For this reason it's at least a bit misleading to talk abo…

Thanks again for the refresher. But again I am keenly aware for how floating point works. As for audience, this is not a hacker new exclusive. It just happens to be here rite now. It will probably make rounds in other forums as well. If you want to write an post an article on how floating point works. I’ll be happy to read it!

I know this sort of criticism can be annoying, but despite commenting on HN I would surely qualify as a 'lay reader' in this context, and I have a strong preference for authors taking care to either tell the whole truth or flag that a potentially misleading simplification has been made -- even if the falseness seems like a technicality to the author. If I notice it then I lose faith in the author's credibility, and if I don't then now I've 'learned' something false.

Re: In defense of 'flicks' (or how I learned to stop worrying and love 705600000)

#38
post #7

Earlier quoted context omitted.

Yep. The algorithm is: there is a leap day for every year divisible by 4, unless the year is also divisible by 100. But if the year is divisible by 400, then there is a still leap day.

Oh shit, it’s FizzBuzz!

Yeah, you really dont want to be implementing a date/time library yourself. It is a far more complex problem than Fizzbuzz. There is so much nuance and easy to overlook details. Just determining whether or not a year is a leap year is about discuss complexity.

I wrote a friendlier abstraction over top Boost DateTime in C++ at a previous employer. Adding things like cross platform support of using the Olson database for historical timezone info, a friendlier interface (more akin to Python's datetime lib, which is probably the friendliest datetime lib Ive used across any language) and cross platform strptime. So, didn't do the heavy lifting myself, but rather supplied the timezone info.

There were so many subtle details. Like, what does it mean to add 1 day to a timestamp? Do you increment year/month/day as needed to be the next day? Or do you add 24 hours? This matters because if you increment the date only, you can end up with an invalid or ambiguous time. I also appreciate the author mentioning how many hours are there in a day. 23, 24 and 25 are most common for jurisdictions observing daylight saving time, but arbitrary shifts are possible. It depends on the jurisdiction. Take the US for example. It depends not just on the state, but sometimes even the county within a state. Some states dont observe DST (Arizona and Hawaii, maybe others). Parts of Indiana do, some don't (maybe this has changed).

Compound this with changes to when DST starts/ends. Its entirely political and can change on a whim. I know there are clocks that are still wrong 12 years later for 6 weeks of the year because of the 2007 US DST change, because of embedded rules for when to change.

Sorry for the rant. Spent over 18 months on that project, and I know there are bugs in there nobody bothered to fix after I left that company (fractional seconds handling in strptime I ported from NetBSD, I'm looking at you).

Re: In defense of 'flicks' (or how I learned to stop worrying and love 705600000)

#39
post #15

> The number result is 0.008333333333 with the 3 repeating forever. For a computer to store a number that repeats forever would require an infinite amount of memory This is very much not true, as I'm sure other HN readers will notice. The number is rational (it's equivalent to 1/120). Now, it is true that a floating point number may not be able to represent it exactly, but by no means does this number require "infini…

Cripes, you're clearly smart enough to understand that the author meant "to [literally] store [all the digits/bits of] a number that repeats forever [in the given base] would require an infinite amount of memory."

Talk about splitting hairs.

Re: In defense of 'flicks' (or how I learned to stop worrying and love 705600000)

#40
post #31
post #15

> The number result is 0.008333333333 with the 3 repeating forever. For a computer to store a number that repeats forever would require an infinite amount of memory This is very much not true, as I'm sure other HN readers will notice. The number is rational (it's equivalent to 1/120). Now, it is true that a floating point number may not be able to represent it exactly, but by no means does this number require "infini…

I wish you had kept reading. In the end, you nitpicked about precisely the thing which the author ended up explaining. The point about using infinite memory to store an irrational number is just a rhetorical device / presentation style to keep the novice reader engaged, and following along. And then you say, "Next we will explain how to solve this impossibility...," and such. It's a good technique for writing, and pr…

Thank you.
Post reply on HN