compression

How to enable GZIP compression in IIS 7.5

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 04:11:07
问题 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? 回答1: GZip Compression can be enabled directly through IIS. First, open up IIS, go to the website you are hoping to tweak and hit the Compression page. If Gzip is not installed, you will see something like the following: “The dynamic content compression module is not installed.” We should fix this. So we go to

pdftk compression option

别说谁变了你拦得住时间么 提交于 2019-11-27 04:09:05
问题 I use pdftk to compress a pdf using the following command line pdftk file1.pdf output file2.pdf compress It works as the weight of my file decreased. Are there [options] to change the compression??? Or maybe other solutions to compress my file? It is heavy because some graphics have a lot of points . Is there a way to convert these graphs to jpg for instance and adapt the compression? 回答1: I had the same problem and found two different solutions (see this thread for more details). Both

How do you create a .gz file using PHP?

烂漫一生 提交于 2019-11-27 04:02:08
问题 I would like to gzip compress a file on my server using PHP. Does anyone have an example that would input a file and output a compressed file? 回答1: The other answers here load the entire file into memory during compression, which will cause ' out of memory ' errors on large files. The function below should be more reliable on large files as it reads and writes files in 512kb chunks. /** * GZIPs a file on disk (appending .gz to the name) * * From http://stackoverflow.com/questions/6073397/how

How to read or parse MHTML (.mht) files in java

我的梦境 提交于 2019-11-27 04:00:25
问题 I need to mine the content of most of known document files like: pdf html doc/docx etc. For most of these file formats I am planning to use: http://tika.apache.org/ But as of now Tika does not support MHTML (*.mht) files.. ( http://en.wikipedia.org/wiki/MHTML ) There are few examples in C# ( http://www.codeproject.com/KB/files/MhtBuilder.aspx ) but I found none in Java. I tried opening the *.mht file in 7Zip and it failed...Although the WinZip was able to decompress the file into images and

How does Google's Page Speed lossless image compression work?

醉酒当歌 提交于 2019-11-27 03:59:00
问题 When you run Google's PageSpeed plugin for Firebug/Firefox on a website it will suggest cases where an image can be losslessly compressed, and provide a link to download this smaller image. For example: Losslessly compressing http://farm3.static.flickr.com/2667/4096993475_80359a672b_s.jpg could save 33.5KiB (85% reduction). Losslessly compressing http://farm2.static.flickr.com/1149/5137875594_28d0e287fb_s.jpg could save 18.5KiB (77% reduction). Losslessly compressing http://cdn.uservoice.com

Video compression on android using new MediaCodec Library

和自甴很熟 提交于 2019-11-27 03:46:18
In my app I'm trying to upload some videos that the user picked from gallery. The problem is that usually the android video files are too big to upload and so- we want to compress them first by lower bitrate/ resolution. I've just heard about the new MediaCodec api that introduce with API 16 (I perviously tried to do so with ffmpeg). What I'm doing right now is the following: First decode the input video using a video decoder, and configure it with the format that was read from the input file. Next, I create a standard video encoder with some predefined parameters, and use it for encoding the

How to compress a String in Java?

删除回忆录丶 提交于 2019-11-27 03:29:58
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 short, GZIPOutputStream can be used to compress longer strings. so, can somebody give me a help to compress a String? My function is like: String compress(String original) throws Exception { } Update: import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.zip.GZIPOutputStream; import java.util.zip.*; //ZipUtil public

How to detect type of compression used on the file? (if no file extension is specified)

有些话、适合烂在心里 提交于 2019-11-27 03:19:53
How can one detect the type of compression used on the file? (assuming that .zip, .gz, .xz or any other extension is not specified). Is this information stored somewhere in the header of that file? Mark Adler You can determine that it is likely to be one of those formats by looking at the first few bytes. You should then test to see if it really is one of those, using an integrity check from the associated utility for that format, or by actually proceeding to decompress. You can find the header formats in the descriptions: Zip (.zip) format description , starts with 0x50, 0x4b, 0x03, 0x04

Python: Reducing memory usage of dictionary

三世轮回 提交于 2019-11-27 02:51:26
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 instance: i_love TAB 10 love_you TAB 12 Currently, the pseudocode of I'm doing right now is loadData(file): data = {} for line in file: first, second = line.split('\t') data[first] = int(second) #or float(second) return data To much of my surprise, while the total size of the files in disk is about 21 mb, when loaded into memory the process takes 120 - 180 mb of

WCF REST Compression

喜夏-厌秋 提交于 2019-11-27 02:25:03
问题 I have a REST service that returns a large chunk of XML, about 150k worth. e.g. http://xmlservice.com/services/RestService.svc/GetLargeXML Therefore I want to compress the response from the server, as GZIP should reduce this to something much smaller. Having searched everywhere I cannot for the life of me find an example of how to perform compression for WCF REST services. Help!! NOTE: My service is hosted by a third party and I CANNOT do this via IIS as it is not supported by them. 回答1: It