compression

Using both chunked transfer encoding and gzip

I recently started using gzip on my site and it worked like a charm on all browsers except Opera which gives an error saying it can not decompress the content due to damaged data. From what I can gather from testing and googling it might be a problem with using both gzip and chunked transfer encoding. The fact that there is no error when...

Damaged data when gzipping

This is the script I have written for gzipping content on my site, which is located in 'gzip.php'. The way I use it is that on pages where I want to enable gzipping I include the file at the top and at the bottom I call the output function like this: print_gzipped_page('javascript') If the file is a css-file I use 'css' as the $type-a...

Do most shared hosts handle gzipped files?

I get them theoretically, but I'm grappling with gzipping files in practice. How should I go about gzip compressing my files, and what needs to be done in order to use them on a shared host? Would the following work? RewriteEngine On RewriteBase / RewriteCond %{HTTP:Accept-Encoding} .*gzip.* RewriteRule ^/(.*)\.js$ /$1.js.gz [L] Rewrit...

Oracle output: cursor, file, or very long string?

First, the setup: I have a table in an Oracle10g database with spatial columns. I need to be able to pass in a spatial reference so that I can reproject the geometry into an arbitrary coordinate system. Ultimately, I need to compress the results of this projection to a zip file and make it available for download through a Silverlight ...

mod_deflate Supported Encodings for Compression

It seems to me, that mod_deflate in Apache 2.2 will always return: Content-Encoding: gzip and never: Content-Encoding: deflate It was explained to me, that although there may be a deflate algorithm, mod_deflate is named after a file-format, in which the algorithm could be any of: gzip, bzip. pkzip Of those three, mod_deflate provid...

searching within a compressed sorted fixed width file

Assume I have a regular fixed width file that is sorted on one of the fields. Given that I know the length of the records, I can use lseek to implement a binary search to find records with fields that match a given value without having to read the entire file. Now the difficulty is that the file is gzipped. Is it possible to do this wi...

I need Shannon–Fano Algorithm in C#

I need Shannon–Fano algorithm in C# is there any body can help me ? ...

Compile/use unrar C++ source for iphone app?

Writing an app that will include the ability to decompress zip and rar files. I think I'm OK on how to handle the .zips but .rars seem a little more trouble. I noticed that rarlabs has source available but it's C++. Is there a way to compile, wrap or otherwise use this code within an iPhone app? Reference: http://www.rarlab.com/rar_add....

How can I tell if a byte array has already been compressed?

Hi, Can I rely on the first few bytes of data compressed using the System.IO.Compression.DeflateStream in .NET always being the same? These bytes seem to always be the 1st bytes: 237, 189, 7, 96, 28, 73, 150, 37, 38, 47 , ... I'm assuming this is some kind of header, I'd like to assume that this header is fixed and isn't going to ch...

How do I create a type of compression that my software can read / write? My software only.

I am working on a project that requires programmatically distributing a compressed file that in a format that is associated with my software. I am writing the software in Python. I would use .zip, but I don't want to overwrite any previouse filetype associations. ( with zip utilities ) ...

how to compress a PNG image using Java

Hi I would like to know if there is any way in Java to reduce the size of an image (use any kind of compression) that was loaded as a BufferedImage and is going to be saved as an PNG. Maybe some sort of png imagewriteparam? I didnt find anything helpful so im stuck. heres a sample how the image is loaded and saved public static Buffer...

Compressing three individual jpeg pics containing temporal redundancy?

I am interfacing an embedded device with a camera module that returns a single jpeg compressed frame each time I trigger it. I would like to take three successive shots (approx 1 frame per 1/4 second) and further compress the images into a single file. The assumption here is that there is a lot of temporal redundancy, therefore lots of ...

Disabling compression for IE pre SP2 with Apache mod_rewrite

I am trying to replicate this fix ( http://sebduggan.com/posts/ie6-gzip-bug-solved-using-isapi-rewrite ) with Apache mod_rewrite, but with no success... Can somebody help me translate those ISAPI rules to APACHE mod_rewrite? I don't know how to 'translate' those rules... My objective is to avoid sending compressed css and js when the us...

GZIP Java vs .NET

Using the following Java code to compress/decompress bytes[] to/from GZIP. First text bytes to gzip bytes: public static byte[] fromByteToGByte(byte[] bytes) { ByteArrayOutputStream baos = null; try { ByteArrayInputStream bais = new ByteArrayInputStream(bytes); baos = new ByteArrayOutputStream(); GZIPOu...

Compressing as GZip WCF requests (SOAP and REST)

I have a .NET 3.5 web app hosted on Windows Azure that exposes several WCF endpoints (both SOAP and REST). The endpoints typically receive 100x more data than they serve (lot of data is upload, much fewer is downloaded). Hence, I am willing to take advantage from HTTP GZip compression but not from the server viewpoint, but rather from t...

iPhone Image Resources, ICO vs PNG, app bundle filesize

My application has a collection of around 1940 icons that are used throughout. They're currently in ICO and new images provided to me come in ICO format too. I have noticed that they contain a 16x16 and 32x32 representation of each icon in one file. Each file is roughly 4KB in filesize (as reported by finder, but ls reports that they v...

What is the VInt in Lucene ?

I want to know what is the VInt in Lucene ? I read this article , but i don't understand what is it and where does Lucene use it ? Why Lucene doesn't use simple integer or big integer ? Thanks . ...

Minimizing MySQL output with Compress() and by concatening results?

Hi all. It is crucial that I transfer the least amount of data possible between server and client. Therefore I thought of using the mysql Compress() function. To get the max compression I also want to concatenate all my results in one large string (or several of max length allowed by MySql), to allow for similar results to be compressed,...

IIS 7.5 compression ratio

Hi, How can I determine compression ratio for a specific web page in IIS 7.5? Thank you ...

Can you use gzip over SSL? And Connection: Keep-Alive headers

I'm evaluating the front end performance of a secure (SSL) web app here at work and I'm wondering if it's possible to compress text files (html/css/javascript) over SSL. I've done some googling around but haven't found anything specifically related to SSL. If it's possible, is it even worth the extra CPU cycles since responses are also...