Zip Files: History, Explanation and Implementation
hanshq.net
hanshq.net
We had to implement all the data structures from scratch and implement several compression schemes.
I got the simplest one, run length encoding, working but couldn't get the fancier LZ77 stuff to work correctly. Mostly because I had trouble implementing some of the data structures required in C++, from scratch.
The professor had a few of the better students present their programs and one of them demonstrated that not only could they make smaller files than WinZip, they did it faster too.
It absolutely blew my mind and that's probably the day I realized I needed to really step up my game and put in the work if I wanted to be successful in this field.
If you want an exhaustive LZ matchfinder, a trie, binary tree such as LZMA's bt4 or suffix array are more efficient algorithms, especially with window sizes larger than 32KB, and there are other better matchfinders past 64MB such as Rabin Karp for longer matches.
Zip is inefficient as a format on modern out of order CPUs. Modern replacements such as zstd have blocks of literals, lengths and decisions to decode an entropy coded table at once rather than conditionally branch.
Also, beating zip compression is quite easy: use a larger window size and a relatively quick (small number of tested slots) hash chain (or multiple e.g. 3, 4 and 7 bytes) can find better matches.
If decompression time and speed is not an issue, and you aren't limited to LZ based approaches, a bytewise model such as ppm or bitwise such as paq will provide much better compression without too much thinking.
Edit: forgot to mention, the parsing strategy is also important. Finding an approximately optimal lowest cost path through a block can often save 10%+ ratio with LZ + Huffman.
http://advsys.net/ken/utils.htm
Worth of note is also ZIPMIX that in a few cases is very useful.
The wikipedia page covers it briefly: https://en.wikipedia.org/wiki/Phil_Katz
One of my favorite coffee shops is right near the PKWARE building off Pittsburgh Ave.
First, access - I can think of twelve bars within walking distance of my apartment, four of which are on the same block, and a total of eight of which are within two blocks of my apartment. Almost every grocery store has a liquor store as a part (not separate store, just separate section with a register), and some stores, like WalMart, sell booze in the normal aisles. It's everywhere.
Second, culture - in Wisconsin, if you're under 21 but a parent, guardian, or spouse then you are allowed to be served, possess, or consume alcohol, so teenagers drinking at home as part of a party is completely legal in the state. Bars are so close to the house, and every area has their own, so social drinking, especially when the winter is cold and dark (in parts of the state in parts of the winter, the sun is set by 4:30 in the afternoon), is very popular. Many of the locals, if they're religious, come from a history of Catholic, Lutheran, and similar religions that were typically not parts of the temperance movement, and many of the cultures that settled the land - Scandinavian and German most commonly - are also known for their relationship to alcohol.
Third, recent developments - the part of Milwaukee I'm in was decimated when the manufacturing base was systematically hollowed out in the late 1980s through the current day. Desperation and escape are two motivators to drink, and there are parts of the community that I'm in that have been hit hard by that.
Lewis Black has a bit about drinking in Wisconsin. It is exaggerated, but only slightly so, in a way that I didn't quite understand before I moved here: https://www.youtube.com/watch?v=7WlwumGkSec