compression

Javascript string compression

Hi All, I'm trying to enter a javascript competition where the script has to be <= 1kb in size. Minifying and eval is allowed, so I've run it through google's closure compiler (which does slightly better than any others I've tried). But I've found that if I convert the script to a string, and replace long words like 'function' and 'ret...

Heuristics for estimating the efficiency of Reduced Ordered Binary Decision Diagrams?

Reduced Ordered Binary Decision Diagrams (ROBDD) are an efficient data structure for boolean functions of multiple variables f(x1,x2,...,xn). I would like to get an intuition for how efficient they are. For instance, for data compression, we know that data with low entropy (some symbols appearing more often than other, many repetitions)...

Transforming a url into a unique 32 character token

I am writing an affiliate system, and I want to generate a unique 32 character wide token, from the url. The problem is that a URL can be up to 128 chars long (IIRC). Is there a way that I can create a unique 32 char wide key/token from a given URL, without any 'collisions'? I am not sure if this is an encoding, encryption or hashing p...

How to determine WCF message size at the encoder level

I am building a custom encoder that compresses WCF responses. It is based on the Gzip encoder in Microsoft's WCF samples and this blog post: http://frenk.wordpress.com/2009/12/04/gzip-compression-wcfsilverlight/ I've got it all working, but now I would like to apply the compression only if the reply is beyond a certain size, but I am...

Compression types for a specific use in Python

I actually partially asked this in this thread http://stackoverflow.com/questions/3494020/organizing-files-in-tar-bz2-file-with-python But it mad eme rethink what I was doing. Now I think it might be a good idea to change the compression method I am using. I am currently using tar.bz2 compression. What I need to be able to do is access ...

Optimizing the website with .htaccess

I've tried to optimize my website using YSlow for directions. However, even though I have added the DEFLATE code at .htaccess to gzip the files, YSlow still doesn't show the files as gzipped. I tried testing my website using this: http://www.gidnetwork.com/tools/gzip-test.php and it shows that my webpages are not gzipped or compressed. H...

In NTFS Compressed Directory, How to read Files compressed and uncompressed size?

In our application, we are generating some large ASCII log files to an Windows NTFS compressed directory. My users want to know both the compressed and uncompressed size of the files on a status screen for the application. We are using Rad Studio 2010 C++ for this application. I found this nice recursive routine online to read the siz...

Is there terminology for flat dictionary, tree dictionary, etc. compression schemes?

I'm trying to learn more about compression. Suppose we have the following string: double, double toil and trouble; fire burn, and caldron bubble. The notation I use below is similar to that used for formal grammars. Capital letters are nonterminals, lowercase letters are terminals, and S is the start symbol. Example of encoding wi...

high compress Image

Hello, I'm trying to do a "remote desktop viewer". For this I need to send the user's desktop - and it's alot of infomation for sockets...(especially if the resolution is high and the information can approach to 5.3MB (1680X1050)) So I started to compress with GZIP stream and the 5.3MB became 500KB, then I added my own compress algorith...

Compressing/packing "don't care" bits into 3 states

At the moment I am working on an on screen display project with black, white and transparent pixels. (This is an open source project: http://code.google.com/p/super-osd; that shows the 256x192 pixel set/clear OSD in development but I'm migrating to a white/black/clear OSD.) Since each pixel is black, white or transparent I can use a sim...

YSlow tells me site is not compressed even though it is

"Grade F on Compress components with gzip There are 19 plain text components that should be sent compressed" I have checked the compression of the main page, as well as all 19 components individually using "http://www.whatsmyip.org/http_compression/" and it shows compression in all of them. Furthermore, I ensured I'm not using a proxy ...

Binary Array Compression in C

I have binary array in c, I want to compress the array, kindly suggest me algorithm which compress binary array. I have used Lempel–Ziv–Welch (LZW) algorithm but its not suitable for me because there is no repetition in my data. ...

Is Terra Compression possible? If so, please explain and provide samples.

Long Ascii String Text may or may not be crushed and compressed into hash kind of ascii "checksum" by using sophisticated mathematical formula/algo. Just like air which can be compressed. To compress megabytes of ascii text into a 128 or so bytes, by shuffling, then mixing new "patterns" of single "bytes" turn by turn from the first to t...

Mongrel Gzip Compression

I would like to compress my mongrel's output, I found this plugin, but it's from 2007, and I could not make it work. I have haproxy balancing among several mongrels on my server, I've apache, but it's used only for static content, so mod_deflate doesnt affect the page itself. Any suggestion? If haproxy could compress, that would do it...

How to handle large image in HTML page

I have a large JPEG image about 3500 x 2500 pixels and 4 MB size. I want to display this image in a HTML page so that it takes about 3/4 of the screen, and also compress it, so that it loads quickly, but without compromising the quality too much. Is this feasible ? ...

What's the faster way to implement the signed-to-unsigned map r(x)= 2x-1 if x>0 and r(x) = 2x otherwise

Mapping signed to unsigned integers bijectively can be done using common techniques like Two's complement. Unfortunately, they fail to map small negative integers to small numbers. For compression algorithms, we often want to preserve the absolute value of numbers as much as possible: small negative and positive numbers must be mapped to...

What compression format should we use; should we lay DEFLATE (.zip) to rest?

With most Linux distributions dropping gzip and bzip2 in favor of LZMA2 for compressing their packages, and many open source implementations for many platforms, I wonder: Shouldn't we lay DEFLATE and the .zip format (which unfortunately got bastardized over and over) to rest, and move on to other, modern ways of distributing our (source)...

IIS 7.5 ASP.NET-4 Gzip compression

I just can't seem to get GZIP compression enabled for my ASP.NET 4 application. Only javascript files seem to get compressed. The page, css and others dont get compressed. The response header of a not compressed CSS file is: Content-Type text/css Last-Modified Mon, 09 Aug 2010 20:10:34 GMT Accept-Ranges bytes Etag ...

IIS Dynamic Compression and RouteCollections (Rewritten URLs)

Hello, When a page is served, i.e., http://some.tld/FAQ.aspx, dynamic compression works just fine; The aspx extension is registered as a file type to compress. But when using routes.MapPageRoute to rewrite the url as some.tld/FAQ IIS will not compress this page. There's no extension to register here. Does anyone know how to get IIS to...

Utility to compress jpeg as good as photoshop or better

Photoshop has a very good jpeg compression algorithm, using which it creates smaller files with same visual quality (compared to for example ImageMagick). Is there some utility, which can produce same or better quality to size ratio? ...