Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Visualizing Gzip Compression with Python (brennan.io)
79 points by brenns10 on Sept 23, 2020 | hide | past | favorite | 6 comments


You 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...

[2] https://gzthermal.now.sh/ (e.g. https://gzthermal.now.sh/?url=https%3A%2F%2Fgoogle.com%2F)


That 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!


> (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?


This 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/


Ah, that makes sense!


For 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: