compression

asp.net mvc - some files are not gzipped

a 夏天 提交于 2019-12-08 03:47:42
问题 Interestingly some static files are gzipped some are not (specifically ckeditor.js). What might be the cause? Config section is below: <dynamicTypes> <add mimeType="text/*" enabled="true" /> <add mimeType="message/*" enabled="true" /> <add mimeType="application/x-javascript" enabled="true" /> <add mimeType="application/json" enabled="true" /> <add mimeType="*/*" enabled="false" /> </dynamicTypes> <staticTypes> <add mimeType="text/*" enabled="true" /> <add mimeType="message/*" enabled="true" /

DelegatingHandler to decompress incoming requests in WebApi

最后都变了- 提交于 2019-12-08 03:24:13
问题 In my app we are sending decent size packets up from a client and receiving a decent sized response, so I want to implement some compression on the way up and the way back. On the way back it is fine because I can lean on IIS's dynamic compression to do that for me, but on the way up I am finding the following issue. I have a delegating handler that sits there to decompress the incoming requests: (Most of this code is based on parts of Fabrik.Common (https://github.com/benfoster/Fabrik.Common

zlib/gzip interpreter

我的梦境 提交于 2019-12-08 03:04:14
问题 Greetings, I'm trying to analyze the output of the zlib(gzip) algorithm compared to the input. Determine stuff like dictionary size, the substring run-length pairs and where they correspond in the original plaintext. I'm using zlib to exchange many very small chunks of data (under 1K each), and want to determine overhead from the dictionary, a percentage of substring matches vs. dictionary-encoded plaintext in the results, that sort of thing. After a quick googling didn't yield results, I'm

Android - reading a text file from Assets seems to include a LOT of junk before/after the actual data?

蓝咒 提交于 2019-12-08 02:51:04
问题 I package a text file with my Android App (in Assets) which I read within the App itself. To avoid this file being compressed, it's named 'mytestfile.mp3' and until recently, that worked just fine. In one of the recent SDK/ADT changes, it seems something 'odd' is happening when reading from Assets and I'm open to ideas as to what it is... I use code something like this AssetFileDescriptor descriptor = getAssets().openFd("mytextfile.mp3"); BufferedReader f = new BufferedReader(new FileReader

Compressing a Base 62(0-9a-zA-Z) encoded string

会有一股神秘感。 提交于 2019-12-08 02:36:12
问题 I need to compress a base62 (0-9a-zA-Z) encoded string with a length of 20 characters into a 15-16 character string in order to squeeze some other information in. The tricky part is the compressed output should also be base62 encoded. Can this be done? Any suggestion is greatly appreciated. Thanks! 回答1: See the Pigeonhole principle - if you try to put 100 pigeons into 10 holes, some holes will have multiple pigeons. In the same way, for your problem, there will have to be occurrences of two

Does anyone know a list with magic numbers of file systems and archive/compression formats?

时光总嘲笑我的痴心妄想 提交于 2019-12-08 02:14:54
问题 I'm looking for a list that has the magic numbers of the most important of the following file systems and archive/compression formats: http://en.wikipedia.org/wiki/List_of_file_systems http://en.wikipedia.org/wiki/List_of_archive_formats For example something like: -filesystem- -magic_number- -cramfs- -45 3d cd 28 00- -archive/compression- -magic_number- -gz- -1f 8b- I found some on google but no complete list or technical docs, so I ask you guys as experts. 回答1: You could try this list: File

Compact data structure for sorted array

谁说胖子不能爱 提交于 2019-12-08 01:39:27
问题 I have a table with sorted numbers like: 1 320102 2 5200100 3 92010023 4 112010202 5 332020201 6 332020411 : 5000000000 3833240522044511 5000000001 3833240522089999 5000000002 4000000000213312 Given the record number I need the value in O(log n) time. The record number is 64-bit long and there are no missing record numbers. The values are 64-bit long, they are sorted and value(n) < value(n+1). The obvious solution is simply doing an array and use the records number as index. This will cost 64

Convert java.awt.Image to TIFF byte array with compression

末鹿安然 提交于 2019-12-08 01:30:14
问题 I have a java.awt.Image that I need to add CCITT T.6 compression and convert to a TIFF byte array. I have seen some examples of using TIFFImageWriteParam and other classes from the javax.imageio package but I can’t find a complete example going all the way from Image to byte array. Here is what I have so far beginning with a java.awt.Image obtained from scanning. This works just fine to generate a byte array of a TIFF, but I need to find a way, using TIFFImageWriteParam or some other means,

Efficient compression and representation of key value pairs to be read from 1D barcodes

折月煮酒 提交于 2019-12-08 00:58:56
问题 I'm currently writing an application for Windows Mobile which needs to be able to pick up key value pairs from 1D barcodes (configuration settings). The less barcodes need to be scanned, the better. Sample input: ------------------------------ | Key | Value | ------------------------------ | 12 | Söme UTF-8 Strîng | | 9 | & another string | ------------------------------ I thought of the following algorithm: 1. Concat the key value pairs and encode the values with Base64 So we would get

iphone 4 video upload compression

落爺英雄遲暮 提交于 2019-12-08 00:53:32
问题 i have an app that uploads some video through an http POST command to a server. on the iPhone 4 (and possibly the 3GS) when the user uploads a 34 second video a little thing pops up at the bottom of the screen and says that the video is being compressed. probably for faster upload. problem being is that the server guy says he can't uncompress the videos on the server end. this is causing problems when someone tries to view the videos. on the iphone 4 they look compressed when viewed and on my