compress

Django automatically compress Model Field on save() and decompress when field is accessed

Given a Django model likeso: from django.db import models class MyModel(models.Model): textfield = models.TextField() How can one automatically compress textfield (e.g. with zlib) on save() and decompress it when the property textfield is accessed (i.e. not on load), with a workflow like this: m = MyModel() textfield = "Hello, ...

Encode/compress sequence of repeating integers

Hey there! I have very long integer sequences that look like this (arbitrary length!): 0000000001110002220033333 Now I need some algorithm to convert this string into something compressed like a9b3a3c3a2d5 Which means "a 9 times, then b 3 times, then a 3 times" and so on, where "a" stands for 0, "b" for 1, "c" for 2 and "d" for...

Ruby zlib deflate massive data

I'm trying to use Zlib::Deflate.deflate on a massive file (4 gigs). There are obvious problems with doing that, the first of which being that I can't load the entire file into memory all at once. Zlib::GzipWriter would work, since it works with streams, but it's not zlib compression. Any ideas? ...

is there a way to compress a GET string so it won't be so long?

I need to compress a string so it is shorter for a GET method form. Is there any way to compress a string and it will be decrypted later? That way... ?error=LOTS OF STUFFLOTS OF STUFFLOTS OF STUFFLOTS OF STUFFLOTS OF STUFF is shorter in some sort of key ?error=somekey so I can get back the result later. Not using MySQL preferably. ...

Best .NET Framework compression class?

Hi all Yes, I know GZipStream or DeflateStream is the common ones in .NET Framework which handle compression/decompression. I wish to have compress/decompress functions in my program, but I wish a .NET Framework C# one, not a 3rd party open source. I can't use because of those copyright restrictions in my program. GZipStream and Defl...

C# Compress Triple Byte Array

Hi. I currently got this script, which compresses byte arrays. But I need it rewritten, so it can compress triple byte arrays [,,] Thanks! public static byte[] Compress(byte[] buffer) { MemoryStream ms = new MemoryStream(); GZipStream zip = new GZipStream(ms, CompressionMode.Compress, true); zip.Write(buffer, 0, buffer.Length); zip.Cl...

iphone binary failing to compress

When I try to compress my binary (to upload for app submission), I get a ridiculously small zip file (a 10 meg file turns into 300k). I've done this a dozen times and never had a problem and am uncertain what could be causing this. I tried restarting xcode and doing a clean build. Has anyone seen this happen before? ...

Minify HTML/PHP

I'm using gzip to compress my html/php files along with js/css/etc. This reduces the payload quite nicely but I also want to 'minify' my markup of both .html and .php pages. Ideally I'd like to control this from a .htaccess file (where I also do the gzipping) rather than the having to include php to each file. I'd like the output to be ...

gzip compatibility

Hi, I need to implement a C routine to (un)compress files in gzip format. Can anyone give me an example? I tried zlib, but it not seems compatible. Thanks. ...

windows command promt zip/compress directory

Is possible to compress/archive a directory with all of its sub-directories and files in a single file from cmd.exe ? I know there are a lot of utilities available but I need to perform the operation only with the windows default utilities . I'm running windows server 2003 . ...

Compress Document folder in application sandbox of iphone

Hi I need to compress the Documents folder in the application sandbox and upload the compressed file to a server. I've been able to send files from iphone to the server, but am stuck in regards to compressing the folder. I'm using the ASIHTTPRequest libraries for connecting to the server. Any body can point me to the right direction. I...

Read a .Z file (unix compresses file) in Java

Hello, The said file extension is explained here at http://kb.iu.edu/data/abck.html. I want to use a java api to read the contents of a Z file. Neither the ZipFile api or the GZIPInputStream seem to work. I can use the ZipFile api to open normal .zip files. ZipFile zf = new ZipFile("CR93H2.Z"); Enumeration entries = zf.entries(); To...

Compress Python objects before saving to cache

What's the fast method to compress Python objects (list, dictionary, string, etc) before saving them to cache and decompress after read from cache? I'm using Django and I hope to add compress/decompress support directly in Django's cache backend which makes it available to all my Django apps. I looked into django/core/cache/backends/me...

Testing if gzip is working locally

I've a local wamp setup and installed the deflate_module in apache. I've also set up the following rule in .htaccess. <IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript text/javascript application/javascript application/json </IfModule> But how can I test if ...

An efficient way to merge 2 large CSS files

I'm looking for a tool that allows you to merge 2 large CSS files. All the ones I've tried so far (like CSSMerge) haven't worked out. Some of them just randomly remove properties. Others choke on the non-standard properties like -webkit and -moz and give me errors. And I also need something that preserves the case of each rule. CSSMerge ...

how to compress a String?

I use GZIPOutputStream or ZIPOutputStream to compress a String( my string.length() is less than 20), but the compress result is longer than original string. on some site, I found some friends said this is because my original string is too short, GZIPOutputStream is only do use to compress long string. so, can somebody give me a help to...

Is there any way of compressing the tagfile in vim

Hi, I was following the guide at teuton.blogspot.com to set up autocompletion, when I ran the command: `ctags –R --c++-kinds=+p --fields=+iaS --extra=+q \ -f ~/.vim/commontags /usr/include` to generate a tagfile, only to realise that the command would generate a 'commontags'-file of 1.5GB a bit larger, than I'd have liked it to b...

Why compress this javascript file cause error

I use Jquery , and change many compress tool but still cause error "it dont know function I created in this file" http://gist.github.com/586338 help me !!! This file run fine , dont have a error if it dont compress ...

Visual Studio 2010 Deployment package

I want to use this task in the VS2010 Web Application package deployment process to compress the javascript files: <Target Name="CompressJS"> <ItemGroup> <_JSFilesToCompress Include="*.js" /> </ItemGroup> <Message Text="Compresing Javascript files $(_PackageTempDir)" Importance="high" /> <JSCompress Files="@(_JSF...

How can I write compressed files on the fly using Perl?

I am generating relatively large files using Perl. The files I am generating are of two kinds: Table files, i.e. textual files I print line by line (row by row), which contain mainly numbers. A typical line looks like: 126891 126991 14545 12 Serialized objects I create then store into a file using Storable::nstore. These objects usual...