compression

Makefile to combine js files and make a compressed version

微笑、不失礼 提交于 2019-11-27 23:00:23
I am trying to write a basic makefile that combines multiple js files into a single one and then does the same but compresses them. So far I have this one that can make the compressed version fine. # Set the source directory srcdir = src/ # Create the list of modules modules = ${srcdir}core.js\ ${srcdir}sizzle.js\ ${srcdir}json2.js\ ${srcdir}ajax.js\ ${srcdir}attribute.js\ ${srcdir}content.js\ ${srcdir}cookie.js\ ${srcdir}css.js\ ${srcdir}event.js\ ${srcdir}json.js\ ${srcdir}location.js\ ${srcdir}opacity.js\ ${srcdir}ready.js\ ${srcdir}size.js\ ${srcdir}init.js # Compress all of the modules

Zlib-compatible compression streams?

时光总嘲笑我的痴心妄想 提交于 2019-11-27 22:57:53
Are System.IO.Compression.GZipStream or System.IO.Compression.Deflate compatible with zlib compression? From MSDN about System.IO.Compression.GZipStream: This class represents the gzip data format, which uses an industry standard algorithm for lossless file compression and decompression. From the zlib FAQ : The gz* functions in zlib on the other hand use the gzip format. So zlib and GZipStream should be interoperable, but only if you use the zlib functions for handling the gzip-format. System.IO.Compression.Deflate and zlib are reportedly not interoperable. If you need to handle zip files (you

How can I extract or uncompress gzip file using php? [duplicate]

喜欢而已 提交于 2019-11-27 21:51:53
This question already has an answer here: How can I unzip a .gz file with PHP? 5 answers function uncompress($srcName, $dstName) { $sfp = gzopen($srcName, "rb"); $fp = fopen($dstName, "w"); while ($string = gzread($sfp, 4096)) { fwrite($fp, $string, strlen($string)); } gzclose($sfp); fclose($fp); } I tried this code but this does not work, I get: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster@domain.com and inform them of the time the error occurred, and anything you

Compress all file .js with Google Closure Compiler Application in one File

你离开我真会死。 提交于 2019-11-27 21:21:38
问题 I would like to Compress all my file .js in a same directory in one file with Google Closure Compiler in a command line. For one file it's : java -jar compiler.jar --js test.js --js_output_file final.js But I didn't find in the doc how put my other file at the end of final.js without write over the last compress file ? I would like something like that : java -jar compiler.jar --js --option *.js --js_output_file final.js It's possible or must I do a programm who add all file in a file and

Uncompress BZIP2 archive

耗尽温柔 提交于 2019-11-27 21:16:08
I can uncompress zip, gzip, and rar files, but I also need to uncompress bzip2 files as well as unarchive them (.tar). I haven't come across a good library to use. I am using Java along with Maven so ideally, I'd like to include it as a dependency in the POM. What libraries do you recommend? The best option I can see is Apache Commons Compress with this Maven dependency. <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-compress</artifactId> <version>1.0</version> </dependency> From the examples : FileInputStream in = new FileInputStream("archive.tar.bz2");

Avoid Video Compression when Selecting Movie with UIImagePickerController?

偶尔善良 提交于 2019-11-27 20:37:13
I'm using UIImagePickerController to allow my user to select a video from the asset library. When the user selects the "Choose" button on the second screen, the view displays a progress bar and a "Compressing Video..." message. Why is this happening? Is there some way I can avoid this compression operation? Answer: There is currently no way to control how UIImagePickerController compresses the picked video. I just did some quick tests. Using a test app I created, I picked the same video two times -- once with the videoQuality property set to UIImagePickerControllerQualityTypeHigh and once with

How to compress mp4 video using MediaCodec Android?

不羁岁月 提交于 2019-11-27 20:19:48
问题 In my Android app, I want to compress mp4 video by changing its resolution, bitrate. I don't want to use FFmpeg (because I don't want to use NDK), so I decided to use MediaCodec API. Here are my logical steps: Extract video file with MediaExtractor, then decode data. Create new encoder with my new resolution, bitrate and encode data. Using MediaMuxer to create a new mp4 file. My problem is: I don't know how to setup the connection between output of decoder and input of encoder. I can decode

Why does base64-encoded data compress so poorly?

橙三吉。 提交于 2019-11-27 20:02:30
问题 I was recently compressing some files, and I noticed that base64-encoded data seems to compress really bad. Here is one example: Original file: 429,7 MiB compress via xz -9 : 13,2 MiB / 429,7 MiB = 0,031 4,9 MiB/s 1:28 base64 it and compress via xz -9 : 26,7 MiB / 580,4 MiB = 0,046 2,6 MiB/s 3:47 base64 the original compressed xz file: 17,8 MiB in almost no time = the expected 1.33x increase in size So what can be observed is that: xz compresses really good ☺ base64-encoded data doesn't

Python - mechanism to identify compressed file type and uncompress

心已入冬 提交于 2019-11-27 19:57:41
问题 A compressed file can be classified into below logical groups a. The operating system which you are working on (*ix, Win) etc. b. Different types of compression algorithm (i.e .zip,.Z,.bz2,.rar,.gzip). Atleast from a standard list of mostly used compressed files. c. Then we have tar ball mechanism - where I suppose there are no compression. But it acts more like a concatenation. Now, if we start addressing the above set of compressed files, a. Option (a) would be taken care by python since it

Encode/compress sequence of repeating integers

橙三吉。 提交于 2019-11-27 19:24:09
问题 I have very long integer sequences that look like this (arbitrary length!): 0000000001110002220033333 Now I need some algorithm to convert this string into something compressed like a9b3a3c3a2d5 Which means "a 9 times, then b 3 times, then a 3 times" and so on, where "a" stands for 0, "b" for 1, "c" for 2 and "d" for 3. How would you do that? So far nothing suitable came to my mind, and I had no luck with google because I didn't really know what to search for. What is this kind of encoding /