compression

mod_deflate or mod_gzip, which should be used?

╄→尐↘猪︶ㄣ 提交于 2019-11-30 14:13:13
mod_deflate or mod_gzip , which should be used? I read mod_gzip on better explained but want to know extra about mod_deflate . You should read " Compressing Web Content with mod_gzip and mod_deflate " by Stephen Pierzchala. From a pragmatic point of view, I suggest mod_deflate because it is easy to configure, well documented , and actively maintained. Also, a precompiled version of mod_deflate is more than likely available for your server. Apache may even come with mod_deflate , as is the case with the Windows installer and apache2.2-bin Debian package. Eduardo While looking for mod_deflate, I

A simple regex search and replacement in php for minifying/compressing javascript?

允我心安 提交于 2019-11-30 13:54:14
Can you post a regex search and replacement in php for minifying/compressing javascript? For example, here's a simple one for CSS header('Content-type: text/css'); ob_start("compress"); function compress($buffer) { /* remove comments */ $buffer = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $buffer); /* remove tabs, spaces, newlines, etc. */ $buffer = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $buffer); return $buffer; } /* put CSS here */ ob_end_flush(); And here's one for html: <?php /* Minify All Output - based on the search and replace regexes. */ function

Can i use more heap than 32 GB with compressed oops

落爺英雄遲暮 提交于 2019-11-30 13:42:03
I could understand that with compressed oops , we can only use 32 GB of RAM. Is there someway i can use more than that like by allocating 2 heap or something ? Thanks Vineeth You can't have multiple heaps (you can have multiple JVMs though, which is called scaling out as opposed to scaling up). JVM uses compressed object pointers automatically below 32 GiB of memory. If you understand how it works (dropping youngest three bits from each address as they are always 0 due to memory alignment) you'll understand that you can't go further. There is an interesting fact: once you exceed this 32 GiB

Compress images to reduce file size

橙三吉。 提交于 2019-11-30 13:01:19
I'm building an app that lets the user take a photo or select one from the library on the iPhone and upload it to the Parse backend. The problem I'm facing is regarding to the size of the file. I've read about what big players like Facebook, Twitter, Instagram, and Google do regarding resolution and file size but I can't get close to that. I'm sure they have the best code and tools to do that but I'll be happy to implement it as good as possible with iOS regular processes. This is what I'm doing right now: - (UIImage *)normalResImageForAsset:(ALAsset*)asset { // Convert ALAsset to UIImage

Compression of ASCII strings in C

北城余情 提交于 2019-11-30 13:00:44
I have some C code that stores ASCII strings in memory as a four byte length followed by the string. The string lengths are in the range 10-250 bytes. To reduce occupancy I'd like to compress each string individually on the fly, still storing the length (of the compressed string) followed by the compressed string. I don't want to compress at a larger scope than individual strings because any string can be read/written at any time. What libraries/algorithms are available for doing this? Thanks for your help. NickB ZLib is always at your service - it has a very little overhead for the cases when

How to compress files into zip folder in android? [duplicate]

只愿长相守 提交于 2019-11-30 12:12:34
问题 This question already has answers here : zip/compress a folder full of files on android (6 answers) Closed 5 years ago . I am trying to send multiple files in email, i got the codes for attaching them in the email. Intent sendIntent = new Intent(Intent.ACTION_SEND_MULTIPLE); sendIntent.setType("application/octet-stream"); ArrayList<Uri> uris = new ArrayList<Uri>(); uris.add(0, Uri.parse("file://"+Environment.getExternalStorageDirectory()+ "/.file")); File f = getActivity().getDatabasePath("

Any theoretical limit to compression?

大憨熊 提交于 2019-11-30 11:25:26
Imagine that you had all the supercomputers in the world at your disposal for the next 10 years. Your task was to compress 10 full-length movies losslessly as much as possible. Another criteria was that a normal computer should be able to decompress it on the fly and should not need to spend much of his HD to install the decompressing software. My question is, how much more compression could you achieve than the best alternatives today? 1%, 5%, 50%? More specifically: is there a theoretical limit to compression, given a fixed dictionary size (if it is called that for video compression as well)

javascript string compression with localStorage

谁都会走 提交于 2019-11-30 10:39:51
问题 I am using localStorage in a project, and it will need to store lots of data, mostly of type int, bool and string. I know that javascript strings are unicode, but when stored in localStorage , do they stay unicode? If so, is there a way I could compress the string to use all of the data in a unicode byte, or should i just use base64 and have less compression? All of the data will be stored as one large string. EDIT: Now that I think about it, base64 wouldn't do much compression at all, the

Hadoop, how to compress mapper output but not the reducer output

我是研究僧i 提交于 2019-11-30 10:20:35
问题 I have a map-reduce java program in which I try to only compress the mapper output but not the reducer output. I thought that this would be possible by setting the following properties in the Configuration instance as listed below. However, when I run my job, the generated output by the reducer still is compressed since the file generated is: part-r-00000.gz. Has anyone successfully just compressed the mapper data but not the reducer? Is that even possible? //Compress mapper output conf

Can anyone make heads or tales of this spigot algorithm code Pitiny.c

给你一囗甜甜゛ 提交于 2019-11-30 10:15:55
This C program is just 143 characters long! But it “decompresses” into the first 10,000 digits of Pi . // Created by cheeseMan on 30/11/13. long a[35014],b,c=35014,d,e,f=1e4,g,h; int main(int argc, const char * argv[]) { for(;(b=c-=14); h=printf("%04ld",e+d/f)) for(e=d%=f;(g=--b*2);d/=g) d=d*b+f*(h?a[b]:f/5), a[b]=d%--g; } I was doing some research on loss-less compression algorithms, still no luck yet, when I came across this pitiny.c . The weird thing is that it compiles successfully no errors or bugs, but like i said i cannot make heads or tales of the code, even its syntax. I just would