Live data from Hacker News

How are zlib, gzip and Zip related? (2013)

stackoverflow.com

51–60 of 145 posts

Re: How are zlib, gzip and Zip related? (2013)

#51
post #48
post #45

Earlier quoted context omitted.

I wonder how their API degrades when the stream doesn't support seeking (as is often the case over HTTP, or like in gp's example of using pipes). The whole doc you linked to, and the feature of on-the-fly decompression, seems to assume that the stream is seekable.

InputStreams are not seekable (see https://developer.android.com/reference/java/io/InputStream.... ). You can also have a look at a zip file spec to see that they can be streamed: https://users.cs.jmu.edu/buchhofp/forensics/formats/pkzip.ht...

OK, makes sense. The headers at the end of the file are only required if you want to extract specific files out of order. Love the clarity of that spec, btw.

Re: How are zlib, gzip and Zip related? (2013)

#52
post #31

It's kinda bad-ass when he said: you can use this text on Wikipedia, I'm the primary reference.

Wikipedia mostly doesn't allow primary sources though. It needs to be corroborated by a reliable secondary source.

Which is why he actually said it could be cited:

>I am the reference, having been part of all of that. This post could be cited in Wikipedia as an original source.

His post on SO is the reliable secondary source.

Re: How are zlib, gzip and Zip related? (2013)

#54

Not only is this a great read, but the follow up for citations is replied with "I am the reference". If this were reddit I'd post the hot fire gif. Eh, here it's anyway: http://i.imgur.com/VQLGJOL.gif

I thought he was joking. Then I read the name: Adler: as in Adler-32 (the checksum function that zlib uses). Then I knew it was real. The darn author of zlib answered the question. That's as close as you're gonna get to "primary source" folks!

>> That's as close as you're gonna get to "primary source" folks!

Yes it is. Whenever I think of PKzip I am reminded of the sad tale of Phil Katz death - partly because I share his first and last initials, and now reading his Wikipedia page I see we had more in common. Fortunately alcoholism is not my thing.

https://en.wikipedia.org/wiki/Phil_Katz

Re: How are zlib, gzip and Zip related? (2013)

#55
In other compression news, Apple open sourced their implementation of lzfse yesterday: https://github.com/lzfse/lzfse. It's based on a relatively new type of coding - asymmetric numeral systems. Huffman coding is only optimal if you consider one bit as the smallest unit of information. ANS (and more broadly, arithmetic coding) allows for fractional bits and gets closer to the Shannon limit. It's also simpler to implement than (real world) Huffman.

Unfortunately, most open source implementations of ANS are not highly optimized and quite division heavy, so they lag on speed benchmarks. Apple's implementation looks pretty good (they're using it in OS X, err, macOS, and iOS) and there's some promising academic work being done on better implementations (optimizing Huffman for x86, ARM, and FPGA is a pretty well studied problem). The compression story is still being written.

Re: How are zlib, gzip and Zip related? (2013)

#56

Earlier quoted context omitted.

>> Just read the old header, append new files, append new header. This was important back in floppy disk days Don't forget 'overwrite old header' Important for floppy disks in two ways, one because of space constraints and two, because of how slow floppies were.

Don't forget 'overwrite old header' Why? The new one will become the 'real' one since it will be at the end of the modified file. So it doesn't really matter if you delete the old one. If you're really trying to squeeze file sizes down, you could reference the old 'header' from the new one, so that you do not have to list the entire archive's contents again.

Why not? Isn't the purpose of a file compressor to squeeze file sizes down?

Re: How are zlib, gzip and Zip related? (2013)

#57

Not only is this a great read, but the follow up for citations is replied with "I am the reference". If this were reddit I'd post the hot fire gif. Eh, here it's anyway: http://i.imgur.com/VQLGJOL.gif

The list of methods looks exactly like this

https://users.cs.jmu.edu/buchhofp/forensics/formats/pkzip.ht...

Re: How are zlib, gzip and Zip related? (2013)

#58

Not only is this a great read, but the follow up for citations is replied with "I am the reference". If this were reddit I'd post the hot fire gif. Eh, here it's anyway: http://i.imgur.com/VQLGJOL.gif

Reminds me of the time I took my friend to play D&D up in Lake Geneva with the Gygax family whom I had been gaming with for a bit.

He ended up getting into an argument with Gary about why dwarven women would have beards (of all things). I remember having to kick him under the table and quickly whisper "This is Gary Gygax, he made the game. If he says they have beards they have beards!"

Re: How are zlib, gzip and Zip related? (2013)

#59
post #42

Wow a stackoverflow question that hasn't been closed or removed for some trivial reason--thought I'd never see something like that again.

That's funny; it was on hold when I saw it last, a few hours ago. Apparently whoever happens to be around with mod powers decided to hate fun a little less than usual. I'm sure it won't last.

Re: How are zlib, gzip and Zip related? (2013)

#60

Not only is this a great read, but the follow up for citations is replied with "I am the reference". If this were reddit I'd post the hot fire gif. Eh, here it's anyway: http://i.imgur.com/VQLGJOL.gif

Reminds me of the time I took my friend to play D&D up in Lake Geneva with the Gygax family whom I had been gaming with for a bit. He ended up getting into an argument with Gary about why dwarven women would have beards (of all things). I remember having to kick him under the table and quickly whisper "This is Gary Gygax, he made the game. If he says they have beards they have beards!"

I'd imagine the simplest answer would be "because Tolkien said so".
Post reply on HN