compression

Why do real-world servers prefer gzip over deflate encoding?

We already know deflate encoding is a winner over gzip with respect to speed of encoding, decoding and compression size. So why do no large sites (that I can find) send it (when I use a browser that accepts it)? Yahoo claims deflate is "less effective". Why? I maintain HTTP server software that prefers deflate, so I'd like to know if ...

Fast, free tool to unarchive any compression format?

I've been using (Ubuntu's) file-roller to compress a range of files, e.g. .gz, .zip, .rar, .tar.gz, etc. It's nice because it provides a simple, uniform interface to de-compressing files in particular folders. However, it's pretty slow, apparently because it pops open a GUI window to tell you its uncompressing the file. So I am wonderin...

Twitter image encoding challenge

If a picture's worth 1000 words, how much of a picture can you fit in 140 characters? Note: That's it folks! Bounty deadline is here, and after some tough deliberation, I have decided that Boojum's entry just barely edged out Sam Hocevar's. I will post more detailed notes once I've had a chance to write them up. Of course, everyone shou...

Where are the headers for libbz2.dylib for the iPhone?

The headers for libbz2.dylib on the iPhone are missing, or contained in a less than obvious location. I've looked for bzlib.h, bz2lib.h, bz2.h, etc., grepped for patterns, and found nothing - are they included with the SDK, or do I need to just pull the header from the main libbz2 distro and use that instead? ...

Compress TComponents while writing them in a TStream

Hello, Some application we're using depends on TComponent descendants to easily save/load the state of its internal objects, with the help of Write/ReadComponentResFile function TSomeClass.SaveState: boolean; begin ... try ... WriteComponentResFile(self.f_path, TComponent(self)); result := true; except result :...

JS/CSS include section replacement, Debug vs Release

I'd be interested to hear how people handle conditional markup, specifically in their masterpages between release and debug builds. The particular scenario this is applicable to is handling concatenated js and css files. I'm currently using the .Net port of YUI compress to produce a single site.css and site.js from a large collection of...

How to compress a directory with the built in .net compression classes?

Using the System.IO.Compression namespaces classes GZIPStream and DeflateStream I successfully can compress and decompress individual files. However, if I pass a directoryname as target for compression I get a security exception. Do I have to (recursively) enumerate all files and subdirectories to be able to compress a directory? (Proba...

Huffman compression algorithm.

I've implemented file compression using huffman's algorithm, but the problem I have is that to enable decompression of the compressed file, the coding tree used, or the codes itself should be written to the file too. The question is: how do i do that? What is the best way to write the coding tree at the beggining of the compressed file? ...

Is there any way to read the properties of a Compressed Archive?

Are there any tool / simple method to read the properties (Ex : Compression level, Dictionary size, word size etc)? ...

Can PHP decompress a file compressed with the .NET GZipStream class?

I have a C# application that communicates with a PHP-based SOAP web service for updates and licensing. I am now working on a feedback system for users to submit errors and tracelogs automatically through the software. Based on a previous question I posted, I felt that a web service would be the best way to do it (most likely to work pr...

I am using rails appln with Ext-JS as frontend and require help for compression

I have a rails appln which uses ext-js for front end. I have no problem in running the application. But since ext-all.js is bulky, it takes more time to load. I tried to build a custom ext-js but did not make much of a difference in size of the ext js script. I was trying with rails cache since i use rails 2.x. For normal js files, it...

What are the different zlib compression methods and how do I force the default in Java's Deflater?

I am using DeflaterOutputStream to compress data as a part of a proprietary archive file format. I'm then using jcraft zlib code to decompress that data on the other end. The other end is a J2ME application, hence my reliance on third party zip decompression code and not the standard Java libraries. My problem is that some files zip and...

Get size of uncompressed data in zlib?

I'm creating something that includes a file upload service of sorts, and I need to store data compressed with zlib's compress() function. I send it across the internet already compressed, but I need to know the uncompressed file size on the remote server. Is there any way I can figure out this information without uncompress()ing the data...

How to Decompress the data using GZIP in java if the data is compressed with the same in BlackBerry

I have written a sample program to compress and decompress data using GZIP in blackberry. This program works fine. I have written a sample program to compress and decompress data using GZIP in Java. This program also works fine. But if I compress the data using BlackBerry. I am unable to decompress the data in java. How to overcome fr...

How should I extract compressed folders in java?

I am using the following code to extract a zip file in Java. import java.io.*; import java.util.zip.*; class testZipFiles { public static void main(String[] args) { try { String filename = "C:\\zip\\includes.zip"; testZipFiles list = new testZipFiles( ); list.getZipFiles(f...

How do I ZIP a file in C#, using no 3rd-party APIs?

I'm pretty sure this is not a duplicate so bear with me for just a minute. How can I programatically (C#) ZIP a file (in Windows) without using any third party libraries? I need a native windows call or something like that; I really dislike the idea of starting a process, but I will if I absolutely have to. A PInovke call would be much ...

How to reclaim space after turning on page compression in SQL 2008?

I have just turned on page compression on a table (SQL 2008 Ent) using the following command: ALTER TABLE [dbo].[Table1] REBUILD PARTITION = ALL WITH (DATA_COMPRESSION = PAGE ) The hard drive now contains 50GB less space than before. I'm guessing that I need to run a command to reclaim the space. Anyone know it? ...

How can I compress jpeg images in Java without losing any metadata in that image?

I want compress jpeg files using Java. I do it like this: Read the image as BufferedImage Write the image to another file with compression rate. OK, that seems easy, but I find the ICC color profile and the EXIF information are gone in the new file and the DPI of the image is dropped from 240 to 72. It looks different from the origi...

Using libtar to compress a directory

Hi I have this code that I found somewhere on stackoverflow that uses libtar and libbz2 to compress a directory: #include <libtar.h> #include <bzlib.h> #include <fcntl.h> #include <string> #include <iostream> using namespace std; int main(int argc, char **argv) { TAR *p_tar; char extract_to[] = "."; char *dst_path = arg...

Compress Page to Make it load faster.

Is there any way to compress an html page or html output of asp.net page to make them load faster. I heard that Google is using that technology someway. Thanks in advance. ...