Pure ruby stream compression library? 
Author Message
 Pure ruby stream compression library?

Anybody know of one? Compression speed or ratio is not important. Need
to do in-memory compression/decompression of strings. No dependency to C
libraries (zlib, libbzip2, lzo, etc) nor external commands (zip/unzip,
gzip, etc).

--
dave



Fri, 21 Oct 2005 15:03:31 GMT  
 Pure ruby stream compression library?
No I don't, but I'm interested in this problem:

-  Why do you not want external libraries?
-  Does it have to be a *stream* compression library?
You could get better results if you allow the data to be read in chunks.

Daniel.

Quote:

> Anybody know of one? Compression speed or ratio is not important. Need
> to do in-memory compression/decompression of strings. No dependency to C
> libraries (zlib, libbzip2, lzo, etc) nor external commands (zip/unzip,
> gzip, etc).

> --
> dave

--
Daniel Carrera
Graduate Teaching Assistant.  Math Dept.
University of Maryland.  (301) 405-5137


Sat, 22 Oct 2005 03:30:12 GMT  
 Pure ruby stream compression library?

Quote:

> No I don't, but I'm interested in this problem:

> -  Why do you not want external libraries?
> -  Does it have to be a *stream* compression library?
> You could get better results if you allow the data to be read in chunks.

> Daniel.

Oh, and one more question, do you only need it to work on Ruby strings?  
Or does it have to be generic data?

Daniel.



Sat, 22 Oct 2005 03:32:10 GMT  
 Pure ruby stream compression library?

Quote:

> No I don't, but I'm interested in this problem:

> -  Why do you not want external libraries?

The application is to likely be deployed on a shared hosting server
where I can't control the environment. It's good enough that Ruby is
provided.

Btw, come to think of it, zlib library should be common enough that when
ruby is there very good chances is zlib is also there.

Quote:
> -  Does it have to be a *stream* compression library?
> You could get better results if you allow the data to be read in chunks.

What I meant was stream-oriented, the way zlib or tar works. Contrast
this with, say, zip or rar, which is file-oriented (you can't pipe a
data onto zip to compress it, for instance). So chunk processing is an
orthogonal issue.

Quote:
> Oh, and one more question, do you only need it to work on Ruby strings?  
> Or does it have to be generic data?

Ruby strings is sufficient. I can load and unload the data to Ruby
strings first.

--
dave



Sat, 22 Oct 2005 21:53:44 GMT  
 Pure ruby stream compression library?

Quote:


> >No I don't, but I'm interested in this problem:

> >-  Why do you not want external libraries?

> The application is to likely be deployed on a shared hosting server
> where I can't control the environment. It's good enough that Ruby is
> provided.

> Btw, come to think of it, zlib library should be common enough that when
> ruby is there very good chances is zlib is also there.

If it's a shared hosting server that lets you upload Ruby scripts, then I
don't suppose they could stop you uploading or compiling your own copy of
zlib (or if the compilers have been removed, uploading your own copy of gcc
first :-)

If you don't have shell access, try uploading this:

  #!/usr/local/bin/ruby
  require 'cgi'
  c = CGI::new
  print c.header
  puts "Enter command: <form method=get><input type=text name=command></form>"
  if c['command'][0]
    puts "<pre>"
    $stdout.flush
    system "#{c['command'][0]} 2>&1"
    $stdout.flush
    puts "</pre>"
  end

Suggestion: use .htaccess to prevent the whole world seeing this script, if
you don't want to incur your webmaster's wrath...

Cheers,

Brian.



Sat, 22 Oct 2005 22:25:38 GMT  
 Pure ruby stream compression library?
Saluton!


Quote:
> If you don't have shell access, try uploading this:
> system "#{c['command'][0]} 2>&1"

With server setup done properly that will not work. Not because this
is blocked but because you are in a jail without compilers and the
like.

Besides that running arbitrary commands may violate the terms of use
of your provider.

Just my 0.02 questionmarks (that is a running{*filter*}in Europe - many
systems display the euro symbol identical to a question mark).

Gis,

Josef 'Jupp' Schugt
--
e-mails that do not contain plain text, are larger than 50 KiB, are
unsolicited, or contain binarys are ignored unless payment from your
side or technical reasons give rise to a non-standard treatment.
<html><form><input type crash></form></html>



Sun, 23 Oct 2005 08:32:17 GMT  
 Pure ruby stream compression library?

Quote:


> > If you don't have shell access, try uploading this:
> > system "#{c['command'][0]} 2>&1"

> With server setup done properly that will not work. Not because this
> is blocked but because you are in a jail without compilers and the
> like.

So, compile whatever you want on another box and upload it. Shared libraries
missing? Upload them, or link your binaries statically.

If you have rights to upload code and execute it, this is equivalent rights
to full shell access - within your chroot jail if configured, but that
doesn't matter. If you want a Ruby extension which uses zlib.a/zlib.so but
it's not on the system, technically you can upload your own.

Quote:
> Besides that running arbitrary commands may violate the terms of use
> of your provider.

I don't disagree there. I should have put
    raise "don't run this"
as the first line of that script :-)

Cheers,

Brian.



Sun, 23 Oct 2005 15:48:44 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Speed Kata: pure-Ruby powmod

2. Pure Ruby implementation of CRC32?

3. Ruby/SMB - ruby interface to the libsmbclient library

4. A short, pure-Ruby AOP implementation

5. Philosophical question: extension v. pure ruby

6. NQXML: Pure Ruby XML parser (almost)

7. Anybody know of good compression / zip library

8. ADDZip Compression libraries

9. LSPack Compression Library

10. LinderSoftware LSP 32bit Compression Library

11. LZW Compression library for Clipper needed.

12. LSZip Compression Library - New Evaluation Version

 

 
Powered by phpBB® Forum Software