What is the difference between tar and zip?

tar in itself just bundles files together (the result is called a tarball), while zip applies compression as well. Usually you use gzip along with tar to compress the resulting tarball, thus achieving similar results as with zip. For reasonably large archives there are important differences though. A zip archive is a collection of compressed files. A gzipped tar is a compressed collection (of uncompressed files). Thus a zip archive … Read more

How to compress a String in Java?

Compression algorithms almost always have some form of space overhead, which means that they are only effective when compressing data which is sufficiently large that the overhead is smaller than the amount of saved space. Compressing a string which is only 20 characters long is not too easy, and it is not always possible. If … Read more

Java compressing Strings

I need to create a method that receives a String and also returns a String. Ex input: AAABBBBCC Ex output: 3A4B2C Well, this is quite embarrassing and I couldn’t manage to do it on the interview that I had today ( I was applying for a Junior position ), now, trying at home I made … Read more

Serving precompressed content with Brotli on Apache

I have installed mod_brotli on my WHM server via easyapache 4 – html, css, js files etc are all being compressed. I then came across this in the offocial docs – https://httpd.apache.org/docs/2.4/mod/mod_brotli.html#precompressed I have since added this to my Post VirtualHost include file in WHM (post_virtualhost_global.conf) instead of htaccess as I want this to be server … Read more