Deflate compression browser compatibility and advantages over GZIP

UPDATE: Browsers have been dropping support for raw deflate. zOompf has completed some very thorough research on this very topic here. Unfortunately, it appears that raw deflate is NOT safe to use. Check http://www.vervestudios.co/projects/compression-tests/results for more results. Here are the browsers that have been tested: /* Browser DEFLATE ZLIB */ XP Internet Explorer 6 PASS … Read more

python zipfile module doesn’t seem to be compressing my files

This is because ZipFile requires you to specify the compression method. If you don’t specify it, it assumes the compression method to be zipfile.ZIP_STORED, which only stores the files without compressing them. You need to specify the method to be zipfile.ZIP_DEFLATED. You will need to have the zlib module installed for this (it is usually … Read more

How do I gzip compress a string in Python?

If you want to produce a complete gzip-compatible binary string, with the header etc, you could use gzip.GzipFile together with StringIO: try: from StringIO import StringIO # Python 2.7 except ImportError: from io import StringIO # Python 3.x import gzip out = StringIO() with gzip.GzipFile(fileobj=out, mode=”w”) as f: f.write(“This is mike number one, isn’t this … Read more

With Mercurial, how can I “compress” a series of changesets into one before pushing?

The histedit extension is exactly what you are looking for. hg histedit -o or hg histedit –outgoing will bring up a list of the outgoing changesets. From the list you can Fold 2 or more changesets creating one single changeset Drop changesets removing them from the history Reorder changesets however you like. histedit will prompt … Read more

How do I enable gzip compression when using MVC3 on IIS7?

You can configure compression through your web.config file as follows: <system.webServer> <urlCompression doStaticCompression=”true” doDynamicCompression=”true” /> </system.webServer> You can find documentation of this configuration element at iis.net/ConfigReference. This is the equivalent of: Opening Internet Information Services (IIS Manager) Navigating through the tree-view on the left until you reach the virtual directory you wish to modify Selecting … Read more

How do I create 7-Zip archives with .NET?

EggCafe 7Zip cookie example This is an example (zipping cookie) with the DLL of 7Zip. CodePlex Wrapper This is an open source project that warp zipping function of 7z. 7Zip SDK The official SDK for 7zip (C, C++, C#, Java) <—My suggestion .Net zip library by SharpDevelop.net CodeProject example with 7zip SharpZipLib Many zipping