Questions tagged [compression]

The name given to the process of encoding data such that it uses lesser number of bits as compared to the original representation.

There are a number of techniques to compress information, with most algorithms working to compress image, speech, music or video. Encoding the same information in lesser bits results in saving some crucial resource such as transmission bandwidth or hard-disk space. Compression algorithms also take advantage of human perception to further reduce the size of information. By encoding the same piece of information with fewer bits in places that the human brain is not accustomed to perceiving as well as other parts, substantial gains in compression ratios can be achieved.

9175 questions
63
votes
5 answers

GZipStream or DeflateStream class?

The MSDN documentation tells me the following: The GZipStream class uses the gzip data format, which includes a cyclic redundancy check value for detecting data corruption. The gzip data format uses the same compression algorithm as the…
Captain Sensible
  • 4,946
  • 4
  • 36
  • 46
61
votes
3 answers

Is the git binary diff algorithm (delta storage) standardized?

Git uses a delta compression to store objects that are similar to each-other. Is this algorithm standardized and used in other tools as well? Is there documentation describing the format? Is it compatible with xdelta/VCDIFF/RFC 3284?
Thilo
  • 257,207
  • 101
  • 511
  • 656
60
votes
10 answers

How to compress a String in Java?

I use GZIPOutputStream or ZIPOutputStream to compress a String (my string.length() is less than 20), but the compressed result is longer than the original string. On some site, I found some friends said that this is because my original string is too…
user421851
  • 777
  • 2
  • 6
  • 9
60
votes
9 answers

Compressing / Decompressing Folders & Files

Does anyone know of a good way to compress or decompress files and folders in C# quickly? Handling large files might be necessary.
DylanJ
  • 2,373
  • 3
  • 25
  • 24
59
votes
10 answers

How can I Zip and Unzip a string using GZIPOutputStream that is compatible with .Net?

I need an example for compressing a string using GZip in android. I want to send a string like "hello" to the method and get the following zipped…
Bob
  • 22,810
  • 38
  • 143
  • 225
58
votes
11 answers

how to config grunt.js to minify files separately

there are some js files in static/js/ 1. a.js 2. b.js 3. c.js how to config grunt.js to get below files: 1. a.min.js 2. b.min.js 3. c.min.js as far, I have to type specific file name: min: { dist: { src: …
looping
  • 1,141
  • 3
  • 11
  • 20
57
votes
6 answers

Compression library using Nvidia's CUDA

Does anyone know a project which implements standard compression methods (like Zip, GZip, BZip2, LZMA,...) using NVIDIA's CUDA library? I was wondering if algorithms which can make use of a lot of parallel tasks (like compression) wouldn't run much…
Xn0vv3r
  • 17,766
  • 13
  • 58
  • 65
57
votes
7 answers

How can I protect myself from a zip bomb?

I just read about zip bombs, i.e. zip files that contain very large amount of highly compressible data (00000000000000000...). When opened they fill the server's disk. How can I detect a zip file is a zip bomb before unzipping it? UPDATE Can you…
flybywire
  • 261,858
  • 191
  • 397
  • 503
55
votes
8 answers

Compressing floating point data

Are there any lossless compression methods that can be applied to floating point time-series data, and will significantly outperform, say, writing the data as binary into a file and running it through gzip? Reduction of precision might be…
Szabolcs
  • 24,728
  • 9
  • 85
  • 174
55
votes
6 answers

How to Compress/Decompress tar.gz files in java

Can anyone show me the correct way to compress and decompress tar.gzip files in java i've been searching but the most i can find is either zip or gzip(alone).
kdgwill
  • 2,129
  • 4
  • 29
  • 46
55
votes
7 answers

How do I compute the approximate entropy of a bit string?

Is there a standard way to do this? Googling -- "approximate entropy" bits -- uncovers multiple academic papers but I'd like to just find a chunk of pseudocode defining the approximate entropy for a given bit string of arbitrary length. (In case…
dreeves
  • 26,430
  • 45
  • 154
  • 229
54
votes
6 answers

Extracting zip file contents to specific directory in Python 2.7

This is the code I am currently using to extract a zip file that lives in the same current working directory as the script. How can I specify a different directory to extract to? The code I tried is not extracting it where I want. import zipfile fh…
lodkkx
  • 1,163
  • 2
  • 17
  • 29
54
votes
17 answers

What do you use to minimize and compress JavaScript libraries?

What do you use to minimize and compress JavaScript libraries?
flybywire
  • 261,858
  • 191
  • 397
  • 503
54
votes
6 answers

Python: Reducing memory usage of dictionary

I'm trying to load a couple of files into the memory. The files have either of the following 3 formats: string TAB int string TAB float int TAB float. Indeed, they are ngram statics files, in case this helps with the solution. For…
Paul Hoang
  • 1,014
  • 2
  • 11
  • 21
53
votes
6 answers

How to enable GZIP compression in IIS 7.5

I want to compress my files using GZIP. Can you share the web.config code for compressing files with GZIP? Is there anything more that I have to do after uploading my web.config file?
chaitali gupta
  • 533
  • 1
  • 5
  • 4