compression

Internet Explorer 8 + Deflate

我们两清 提交于 2019-12-03 15:14:49
I have a very weird problem.. I really do hope someone has an answer because I wouldn't know where else to ask. I am writing a cgi application in C++ which is executed by Apache and outputs HTML code. I am compressing the HTML output myself - from within my C++ application - since my web host doesn't support mod_deflate for some reason. I tested this with Firefox 2, Firefox 3, Opera 9, Opera 10, Google Chrome, Safari, IE6, IE7, IE8, even wget.. It works with ANYTHING except IE8. IE8 just says "Internet Explorer cannot display the webpage", with no information whatsoever. I know it's because of

Bitmap compressed with quality=100 bigger file size than original

烂漫一生 提交于 2019-12-03 14:53:33
I am trying to send an image to a server. Before sending it, I am reducing its size and quality, and then fixing any rotation issue. My problem is that, after rotating the image, when I save it, the file is bigger than before. Before rotation size was 10092 and after rotation is 54226 // Scale image to reduce it Bitmap reducedImage = reduceImage(tempPhotoPath); // Decrease photo quality FileOutputStream fos = new FileOutputStream(tempPhotoFile); reducedImage.compress(CompressFormat.JPEG, 55, fos); fos.flush(); fos.close(); // Check and fix rotation issues Bitmap fixed = fixRotation

Spring boot http response compression doesn't work for some User-Agents

天大地大妈咪最大 提交于 2019-12-03 14:19:48
I'm trying to enable http response compression on Spring boot web application. It works for some user-agents, and for some reason doesn't for others (specific cases below). My basic question is: Why http response compression (gzip) in Spring Boot works only for some User-Agent headers and where it is configured. Spring boot reference doesn't say anything about it. I prepared simple web application with enabled compression: sample spring-boot-compression app There are integration tests that verify that gzip encoding works for some cases only. I configured spring boot with: server: tomcat:

Write “compressed” Array to increase IO performance?

折月煮酒 提交于 2019-12-03 13:53:34
I have an int and float array each of length 220 million (fixed). Now, I want to store/upload those arrays to/from memory and disk. Currently, I am using Java NIO's FileChannel and MappedByteBuffer to solve this. It works fine, but it takes near about 5 seconds (Wall Clock Time) for storing/uploading array to/from memory to disk. Now, I want to make it faster. Here, I should mention most of those array elements are 0 ( nearly 52 %). like: int arr1 [] = { 0 , 0 , 6 , 7 , 1, 0 , 0 ...} Can anybody help me, is there any nice way to improve speed by not storing or loading those 0's. This can

Fast search in compressed text files

梦想与她 提交于 2019-12-03 13:27:55
问题 I need to be able to search for text in a large number of files (.txt) that are zipped. Compression may be changed to something else or even became proprietary. I want to avoid unpacking all files and compress (encode) the search string and search in compressed files. This should be possible using Huffman compression with the same codebook for all files. I don't want to re-invent the wheel, so .. anyone knows a library that does something like this or Huffman algorithm that is implemented and

ASP.NET: Compress ViewState

岁酱吖の 提交于 2019-12-03 13:21:26
问题 What are the latest and greatest ways to compress the ASP.NET ViewState content? What about the performance of this? Is it worth it to keep the pages quick and minimize data-traffic? How can I make: <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTM4Mjc3NDEyOWQYAQUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgkFLGN0b DAwJENvbnRlbnRQbGFjZUhvbGRlcl9NYWluQ29udGVudCRSYWRCdXQxBSxjdGwwMCRDb250ZW50UGxhY2VIb

Twitter text compression challenge

本秂侑毒 提交于 2019-12-03 13:08:15
问题 Rules Your program must have two modes: encoding and decoding . When encoding : Your program must take as input some human readable Latin1 text, presumably English. It doesn't matter if you ignore punctuation marks. You only need to worry about actual English words, not L337. Any accented letters may be converted to simple ASCII. You may choose how you want to deal with numbers. 123 one two three one hundred twenty three 123 1 2 3 one hundred twenty three one two three one hundred twenty

Video Compression: What is discrete cosine transform?

天大地大妈咪最大 提交于 2019-12-03 12:22:01
问题 I've implemented an image/video transformation technique called discrete cosine transform. This technique is used in MPEG video encoding. I based my algorithm on the ideas presented at the following URL: http://vsr.informatik.tu-chemnitz.de/~jan/MPEG/HTML/mpeg_tech.html Now I can transform an 8x8 section of a black and white image, such as: 0140 0124 0124 0132 0130 0139 0102 0088 0140 0123 0126 0132 0134 0134 0088 0117 0143 0126 0126 0133 0134 0138 0081 0082 0148 0126 0128 0136 0137 0134 0079

How can I Compress a directory with .NET?

老子叫甜甜 提交于 2019-12-03 12:12:53
I have a directory that contains several files. I want compress this folder to a zip or tar.gz file. How can I do his work in C#? Giorgi You can use DotNetZip Library . It has quite rich and useful features. EDIT: string[] MainDirs = Directory.GetDirectories(DirString); for (int i = 0; i < MainDirs.Length; i++) { using (ZipFile zip = new ZipFile()) { zip.UseUnicodeAsNecessary = true; zip.AddDirectory(MainDirs[i]); zip.CompressionLevel = Ionic.Zlib.CompressionLevel.BestCompression; zip.Comment = "This zip was created at " + System.DateTime.Now.ToString("G"); zip.Save(string.Format("test{0}.zip"

Spark: saveAsTextFile without compression

时光怂恿深爱的人放手 提交于 2019-12-03 12:12:18
By default, newer versions of Spark use compression when saving text files. For example: val txt = sc.parallelize(List("Hello", "world", "!")) txt.saveAsTextFile("/path/to/output") will create files in .deflate format. It's quite easy to change compression algorithm, e.g. for .gzip : import org.apache.hadoop.io.compress._ val txt = sc.parallelize(List("Hello", "world", "!")) txt.saveAsTextFile("/path/to/output", classOf[GzipCodec]) But is there a way to save RDD as a plain text files, i.e. without any compression ? I can see the text file in HDFS without any compression with this code. val