compression

Large number array compression

谁都会走 提交于 2020-01-13 11:05:52
问题 I've got a javascript application that sends a large amount of numerical data down the wire. This data is then stored in a database. I am having size issues (too much bandwidth, database getting too big). I am now ready to sacrifice some performance for compression. I was thinking of implementing a base 62 number.toString(62) and parseInt(compressed, 62). This would certainly reduce the size of the data but before I go ahead and do this I thought I would put it to the folks here as I know

How to create a zip file in memory, starting from file bytes?

陌路散爱 提交于 2020-01-13 10:29:06
问题 I try to create a zip file in memory with c#, but the result is a zip file with corrupted files inside it. All file to zip are in a database. I store the bytes. The files are PDF. my code is the following //[extract bytes and file name for every file] using (var zipArchiveMemoryStream = new MemoryStream()) { using (var zipArchive = new ZipArchive(zipArchiveMemoryStream, ZipArchiveMode.Create, true)) { foreach (var file in fileData) { var zipEntry = zipArchive.CreateEntry(file.FileName); using

Zipping files with javascript - corrupt archive

孤街醉人 提交于 2020-01-13 09:41:13
问题 I'm trying to use JSZip to zip some text and then open it with 7Zip. The problem is, the archive is apparently corrupted at some point. I can't open it. I'm guessing it's not created correctly, possibly because I'm not using the correct encoding, but there could also be a slight chance that it's happening during transfer from my Android device (this is a Phonegap project) to my PC (I use adb to transfer the archive). My code is: var zip = new JSZip(); zip.add("hi.txt", "Hello World"); var

Does BinaryFormatter apply any compression?

笑着哭i 提交于 2020-01-13 09:04:53
问题 When .NET's BinaryFormatter is used to serialize an object graph, is any type of compression applied? I ask in the context of whether I should worry about the object graph having many repeated strings and integers. Edit - Hold on, if strings are interned in .NET, there's no need to worry about repeated strings, right? 回答1: No, it doesn't provide any compression but you can compress the output yourself using the GZipStream type. Edit: Mehrdad has a wonderful example of this technique in his

Does BinaryFormatter apply any compression?

丶灬走出姿态 提交于 2020-01-13 09:04:51
问题 When .NET's BinaryFormatter is used to serialize an object graph, is any type of compression applied? I ask in the context of whether I should worry about the object graph having many repeated strings and integers. Edit - Hold on, if strings are interned in .NET, there's no need to worry about repeated strings, right? 回答1: No, it doesn't provide any compression but you can compress the output yourself using the GZipStream type. Edit: Mehrdad has a wonderful example of this technique in his

Does BinaryFormatter apply any compression?

冷暖自知 提交于 2020-01-13 09:04:28
问题 When .NET's BinaryFormatter is used to serialize an object graph, is any type of compression applied? I ask in the context of whether I should worry about the object graph having many repeated strings and integers. Edit - Hold on, if strings are interned in .NET, there's no need to worry about repeated strings, right? 回答1: No, it doesn't provide any compression but you can compress the output yourself using the GZipStream type. Edit: Mehrdad has a wonderful example of this technique in his

Predict Huffman compression ratio without constructing the tree

青春壹個敷衍的年華 提交于 2020-01-13 07:03:32
问题 I have a binary file and i know the number of occurrences of every symbol in it. I need to predict the length of compressed file IF i was to compress it using Huffman algorithm. I am only interested in the hypothetical output length and not in the codes for individual symbols, so constructing Huffman tree seems redundant. As an illustration i need to get something like "A binary string of 38 bits which contains 4 a's, 5 b's and 10 c's can be compressed down to 28 bits.", except both the file

Pre-compress static files in IIS 6

我们两清 提交于 2020-01-13 06:22:46
问题 I am implementing Gzip compression for CSS and JS files on my site and just need to double check something. Is the file compressed on every request? or is it collected and sent from the Temporary folder (if the file exists)? I just want to be sure that my files are not compressed on every request. Also, is this a default behaviour or do I need some extra configurtion? And last, do I need to worry or configure something when using hash tags in the path (to inform the browser that the file has

C/C++ Packing and Compression [closed]

旧巷老猫 提交于 2020-01-12 21:06:24
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . I'm working on a commercial project that requires a couple of files to be bundled (packed) into an archive and then compressed. Right now we have zlib in our utility library, but it doesn't look like zlib has the functionality to compress multiple files into one archive. Does

C/C++ Packing and Compression [closed]

谁说我不能喝 提交于 2020-01-12 21:05:19
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . I'm working on a commercial project that requires a couple of files to be bundled (packed) into an archive and then compressed. Right now we have zlib in our utility library, but it doesn't look like zlib has the functionality to compress multiple files into one archive. Does