compression

Disable GZIP compression for IE6 clients

别说谁变了你拦得住时间么 提交于 2019-12-04 01:23:56
问题 We need to conditionally disable GZIP compression if user's browser is IE6 (it hangs browser for 5min) in few pages of larger site. Server is IIS7 and has compression for static content turned on - want that compression left working if user agent is not Mozilla/4.0. ASPX code sample anyone? Alternatively, code to conditionally redirect to the same page on another site (could create another virtual site with compression disabled) but need to pass all parameters (GET/POST). 回答1: Check out this

curl command return http/1.1 406 not acceptable error

一个人想着一个人 提交于 2019-12-04 00:31:17
问题 I am using below command line curl for knowing if my site supports compressing and caching curl --head --compress http://www.mysite.com it returns the following result Http://1.1 406 Not Acceptable Date: Wed, 28 Dec 2011 07:41:32 GMT Server: Apache Content-Type: text/html; charset-iso-8859-1 what do you think about the problem? Thanks 回答1: In some case I had, faking the agent solved this problem, by using: curl -A "Mozilla/4.0" Similarly using libcurl C-API : curl_easy_setopt(curl, CURLOPT

Using callback to display filenames from external decompression dll in Inno Setup

一笑奈何 提交于 2019-12-03 22:38:48
问题 Originally asked here, but was asked to submit it as a separate question. I have the following dll coded in C below that I'm using in an Inno Setup Installer to extract game files. This is a replacement installer for a game which originally used a 16-bit installer and files are copied off a CD-ROM. I'd like to be able to use InnoTools InnoCallback to display the file names extracted using my dll, but as this is my first venture into C coding, I have no idea how to do it. An example of this

What is the maximum theoretically possible compression rate?

戏子无情 提交于 2019-12-03 22:29:13
This is a theoretical question, so expect that many details here are not computable in practice or even in theory. Let's say I have a string s that I want to compress. The result should be a self-extracting binary (can be x86 assembler, but it can also be some other hypothetical Turing-complete low level language) which outputs s . Now, we can easily iterate through all possible such binaries and programs, ordered by size. Let B_s be the sub-list of these binaries who output s (of course B_s is uncomputable). As every set of positive integers must have a minimum, there must be a smallest

How to retrieve data from a attached zip file in Blackberry application?

北城以北 提交于 2019-12-03 21:48:49
I am using eclipse to build application for Blackberry. I attached a zip file with my application. Please help me, I don't know how to retrieve data form the zip file in application development. In BlackBerry we can use two compression standarts: GZip and ZLib . Choose one, then compress your file and add to project. Then you should be able to open it as an resource. After that decompress it with GZIPInputStream or ZLibInputStream accordingly. Example (uncompress and print text from test.gz attached to project): try { InputStream inputStream = getClass().getResourceAsStream("test.gz");

Designing a mobile web server and client for traffic compression

自古美人都是妖i 提交于 2019-12-03 21:04:09
问题 I have been a bit confused on how best to go about this. The thing : I'm creating a j2me mobile app that will send compressed data via HTTP to a web server, which then will uncompress the request, fetch the data, compress it and send back to client. One similar solution to this is: T-Booster The Problem : I'm confused on how to send a compressed http request from the client app, what technology to use for the server and how best to go about implementing it. Assuming the server is handing

C# better compression for remote desktop broadcast application

时光毁灭记忆、已成空白 提交于 2019-12-03 20:39:45
I am in the process of creating a TCP remote desktop broadcasting application. (Something like Team Viewer or VNC) the server application will 1. run on a PC listening for multiple clients on one Thread 2. and on another thread it will record the desktop every second 3. and it will broadcast the desktop for each connected client. i need to make this application possible to run on a connections with a 12KBps upload and 50KBps download DSL connection (client's and server). so.. i have to reduce the size of the data/image i send per second. i tried to reduce by doing the following. I. first i

deflate and inflate (zlib.h) in C

只愿长相守 提交于 2019-12-03 19:07:05
问题 I am trying to implement the zlib.h deflate and inflate functions to compress and decompress a char array (not a file). I would like to know if the following syntax is correct ? Am I missing something or defined something incorrectly ? char a[50] = "Hello World!"; char b[50]; char c[50]; // deflate // zlib struct z_stream defstream; defstream.zalloc = Z_NULL; defstream.zfree = Z_NULL; defstream.opaque = Z_NULL; defstream.avail_in = (uInt)sizeof(a); // size of input defstream.next_in = (Bytef

Implementing in-memory compression for objects in Java

那年仲夏 提交于 2019-12-03 18:36:24
问题 We have this use case where we would like to compress and store objects (in-memory) and decompress them as and when required. The data we want to compress is quite varied, from float vectors to strings to dates. Can someone suggest any good compression technique to do this ? We are looking at ease of compression and speed of decompression as the most important factors. Thanks. 回答1: If you want to compress instances of MyObject you could have it implement Serializable and then stream the

Uglify-js doesn't mangle variable names

帅比萌擦擦* 提交于 2019-12-03 17:58:02
问题 Trying to prepare good build environment for my js library. According to reviews on the web UglifyJS seems to be one of the best compressing modules out there, working under NodeJS. So here is best recommended way of minifying the code: var jsp = require("uglify-js").parser; var pro = require("uglify-js").uglify; var orig_code = "... JS code here"; var ast = jsp.parse(orig_code); // parse code and get the initial AST ast = pro.ast_mangle(ast); // get a new AST with mangled names ast = pro.ast