compression

Zipping the contents of a folders in PHP

爱⌒轻易说出口 提交于 2019-12-10 21:52:01
问题 Before marking this post as a duplicate, please note that I have already searched for answer on SO and the once I've found so far (listed below) haven't been exactly what I've been looking for. How to [recursively] Zip a directory in PHP? using zipArchive addFile() will not add image to zip ZipArchive - addFile won't work Those are just some of the ones I've looked at. My problem is this: I can't use addFromString, I have to use addFile, it's a requirement of the task. I've already tried a

Compression XML metrics .

我怕爱的太早我们不能终老 提交于 2019-12-10 21:35:27
问题 I have a client server application that sends XML over TCP/IP from client to server and then broadcast out to other clients. How do i know at what the minimun size of the XML that would warrant a performance improvement by compression the XML rather than sending over the regular stream. Are there any good metrics on this or examples? 回答1: Xml usually compresses very well, as it tends to have a lot of repetition. Another option would be to swap to a binary format; BinaryFormatter or

UUID into unsigned int

醉酒当歌 提交于 2019-12-10 21:28:14
问题 Is there anywhere to compress/convert/encode/encrypt a UUID into an unsigned int? I read UUID's from a sql table, the history is ugly and i can not change... I have only an unsigned int to store it in. This is C++ in case that makes a difference Any thoughts on this? Thanks Reza 回答1: Use a CRC32 of the UUID (I assume you mean 32-bit integer). There's obviously the potential for collisions, but if there's a collision it should be rare enough you can just fix it manually. Note that if this is

WCF custom binding for compression

若如初见. 提交于 2019-12-10 20:33:39
问题 Following the sample for compression by Microsoft. I have added the encoder, encoder factory, and binding element to my solution. The difference from their sample is that we do not register our endpoints via the config file (requirement), but instead use a custom Service Host Factory. Service Host: protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses) { ServiceHost host = base.CreateServiceHost(serviceType, baseAddresses); if (host.Description.Endpoints.Count

Unrar an archive in C#

不问归期 提交于 2019-12-10 19:42:54
问题 I want to silent extract of .rar archive. .Net haven't any Rar classes in IO.Compression, so i'd like to use cmd (it's better, than external dll). It extracts, but not in silent mode. What am I doing wrong? const string source = "D:\\22.rar"; string destinationFolder = source.Remove(source.LastIndexOf('.')); string arguments = string.Format(@"x -s ""{0}"" *.* ""{1}\""", source, destinationFolder); Process.Start("winrar", arguments); 回答1: I use this bit of code myself (your code added): const

Compression in IIS 8.5 not successful, stating ALREADY_CONTENT_ENCODING

一世执手 提交于 2019-12-10 19:38:15
问题 I am trying to debug the issue of why my pages are not being GZIP'ed or deflated according to YSLOW. I ended up enabling Failed Request Logs on the server and was able to see the failed reason of why it is not compressing, it thinks it is already compressed. DYNAMIC_COMPRESSION_NOT_SUCCESS Reason="ALREADY_CONTENT_ENCODING" I have enabled dynamic and static compression in IIS, I have also changed the web.config file to include the following. <httpCompression directory="%SystemDrive%\inetpub

Can GZip compression (via .net) increase file size?

隐身守侯 提交于 2019-12-10 19:28:46
问题 I keep track of the original size of the files that I'm compressing using .Net's GZipStream class, and it seems like the file that I thought I was compressing has increased in size. Is that possible? This is how I'm doing the compression: Byte[] bytes = GetFileBytes(file); using (FileStream fileStream = new FileStream("Zipped.gz", FileMode.Create)) { using (GZipStream zipStream = new GZipStream(fileStream, CompressionMode.Compress)) { zipStream.Write(bytes, 0, bytes.Length); } } 回答1: Yes, it

Compile/use unrar C++ source for iphone app?

一笑奈何 提交于 2019-12-10 18:58:14
问题 Writing an app that will include the ability to decompress zip and rar files. I think I'm OK on how to handle the .zips but .rars seem a little more trouble. I noticed that rarlabs has source available but it's C++. Is there a way to compile, wrap or otherwise use this code within an iPhone app? Reference: http://www.rarlab.com/rar_add.htm Open to alternate suggestions on how to handle .rar files as well. I'm still pretty much a newbie so please explain in small words :) 回答1: If all you need

Is there a public implemention of LZSS compression in C# or that can be used in C#? [closed]

与世无争的帅哥 提交于 2019-12-10 18:48:35
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I'm looking for LZSS for decoding some packets from a game engine. If anyone could point me to a library I would be extremely happy. Thanks! 回答1: You can call on the Allegro Library (open source library in C developed for game development). It contains LZSS decoding and is callable from C#. Or you can also look

Compressing text for HTTP with POST parameters

纵饮孤独 提交于 2019-12-10 18:46:21
问题 I am writing client software that initiates a HTTP request with a large blob of text (JSON object actually) as POST parameter. I want to compress this text before sending and decompress the text on the server. Gzip produces binary, which I can't send as a POST parameter, I think. Which options/algorithms exist to compress text and send it to a web server? Edit: Would it be an option to GZIP and then BASE64 encode the binary data? 回答1: Why don't you just use the standard HTTP gzip compression?