3 ms·
Visualizing Gzip Compression with Python
- kzrdude 6y agoFor a more interesting graph, you could make a combination of the last graph and an overlay with filename or filetype for each section of the curve. For example colored by filetype.
- lifthrasiir 6y agoYou can also use something like gzthermal [1] (also available online [2]) to visualize smaller archives. [1] https://encode.su/threads/1889-gzthermal-pseudo-thermal-view-of-Gzip-Deflate-compression-efficiency https://encode.su/threads/1889-gzthermal-pseudo-thermal-view... [2] https://gzthermal.now.sh/ https://gzthermal.now.sh/ (e.g. https://gzthermal.now.sh/?url=https%3A%2F%2Fgoogle.com%2F https://gzthermal.now.sh/?url=https%3A%2F%2Fgoogle.com%2F)
- pjc50 6y agoThat was .. less interesting than I was expecting. I was hoping for something which would overlay the source text with different colours for each coding block from the Huffman table, or similar. Edit: another comment mentions gzthermal, which is what I was looking for!
- spurgu 6y ago> (Note that code prefixed by ‘!’ is executed via bash - everything else is executed in Python). Isn't it almost standard to prefix by "$ " (regular unprivileged user) and "# " (root) for shell commands?
- blackbear_ 6y agoThis is because the post was originally written as a Jupyter notebook [1] and exported as markdown. These notebooks allow you to mix markdown and code which is executed interactively, and use `!` as a special syntax to denote bash commands instead of Python statements. [1]: https://jupyter.org/ https://jupyter.org/
- spurgu 6y agoAh, that makes sense!