451 posts
Location
The left part of this post
Posted 09 February 2013 - 05:21 PM
Pastebin ID: DBPST1kP
how to use:
compressor -create sourcefile output
compressor compressedfile
where sourcefile is a file where each line is a file to compress
it makes a file named readme, you can delete it, it there because the program error if i dont make a file before accepting another file
Im making a GUI, post ideas!
Poll added
475 posts
Posted 09 February 2013 - 05:25 PM
Does this make the file size smaller or just packs together a folder?
451 posts
Location
The left part of this post
Posted 09 February 2013 - 05:28 PM
it makes the file smaller and compress everything to one fille
451 posts
Location
The left part of this post
Posted 11 February 2013 - 10:45 AM
Launched!
818 posts
Posted 11 February 2013 - 11:31 AM
A quick bug report for you:
You change getmetatable to @gm, but @gm to getmetatables. Havn't actually used the compressor but I think that would cause a problem.
2217 posts
Location
3232235883
Posted 11 February 2013 - 11:44 AM
cant compress itself without breaking
this isnt verry good
451 posts
Location
The left part of this post
Posted 11 February 2013 - 03:25 PM
A quick bug report for you:
You change getmetatable to @gm, but @gm to getmetatables. Havn't actually used the compressor but I think that would cause a problem.
Fixed! thanks for the bug report
cant compress itself without breaking
this isnt verry good
you try compressing it with another copy of the porgram?
620 posts
Location
Holland
Posted 12 February 2013 - 04:45 AM
Does serialising make things smaller?
7508 posts
Location
Australia
Posted 12 February 2013 - 04:48 AM
Does serialising make things smaller?
Nope, not one bit.
but because the data is read into a table, the only way to write a table to a file is to serialize it…
451 posts
Location
The left part of this post
Posted 12 February 2013 - 05:10 AM
Does serialising make things smaller?
it replaces large word to two or therre letters si ts smaller(like the comprssion on lightshot)
8543 posts
Posted 12 February 2013 - 06:41 AM
Have you done any file size comparisons? I very much doubt that this would provide a significant compression ratio.
1688 posts
Location
'MURICA
Posted 12 February 2013 - 09:47 AM
Don't think this is the best method of actual compression - if anything, you didn't chose very common keywords at all.
2217 posts
Location
3232235883
Posted 12 February 2013 - 09:56 AM
and now im gona make my own compression…
451 posts
Location
The left part of this post
Posted 12 February 2013 - 02:56 PM
Pool added!
2217 posts
Location
3232235883
Posted 12 February 2013 - 03:57 PM
what do you mean by zip compression with http?
451 posts
Location
The left part of this post
Posted 13 February 2013 - 02:37 AM
I will compress the file in the program and i will send that file to a php script that will compress it in .zip and show it in the screen so i can write it to a file in the computer and whit decompression too
2217 posts
Location
3232235883
Posted 13 February 2013 - 02:40 AM
will it be real .zip compression >_>
if then yes
451 posts
Location
The left part of this post
Posted 13 February 2013 - 02:50 AM
will it be real .zip compression >_>
if then yes
while true do
if poll then
if poll.yes > 5 then
print("I will do it")
elseif poll.no > 5 then
Print("Cancelled")
else
sleep(4)
end
end
end
451 posts
Location
The left part of this post
Posted 13 February 2013 - 04:51 AM
I have made a site where you can compress then if anybody can help to integrate this to the code will be credited(when i finish the credits)
the site is
luazipcompress.webuda.com/compress.phpcompress.php can compress strings if called
luazipcompress.webuda.com/compress.php?file=string&mode="compress"
or decompress
luazipcompress.webuda.com/compress.php?file=string&mode="decompress"
code:
<?php
if ($_GET["mode"]=="compress") {
echo gzcompress($_GET["file"], 9);
} elseif ($_GET["mode"]=="decompress") {
echo gzuncompress($_GET["file"]);
}
?>
2217 posts
Location
3232235883
Posted 13 February 2013 - 05:38 AM
remove the quotes around compress and decompress in the url example, that was derp on my part .-.
and please use $_POST instead of $_GET
and use this instead of before:
http.request("
luazipcompress.webuda.com/compress.php","file="..textutils.urlEncode(string).."&mode=compress")
EDIT: your site is already down *sigh*
please implement some sort of length limit
404 posts
Location
St. Petersburg
Posted 14 February 2013 - 01:18 PM
you know, it would be WAAAAAAY more effective to use
huffman tables to compress the actual bytes of the text. it decreases the file size by a lot.
you take the bytes and arrange them in a table from most used to least used.
then, for every byte of text, you put the byte's table location of 1s followed by a 0.
append all of the bytes in the table to the binary stream
the most used bytes will compress down the most, following the series:
10, 110, 1110, 11110, 111110, 1111110, 11111110, …
997 posts
Location
Wellington, New Zealand
Posted 22 February 2013 - 08:11 PM
you know, it would be WAAAAAAY more effective to use
huffman tables to compress the actual bytes of the text. it decreases the file size by a lot.
you take the bytes and arrange them in a table from most used to least used.
then, for every byte of text, you put the byte's table location of 1s followed by a 0.
append all of the bytes in the table to the binary stream
the most used bytes will compress down the most, following the series:
10, 110, 1110, 11110, 111110, 1111110, 11111110, …
That's not Huffman coding.
404 posts
Location
St. Petersburg
Posted 23 February 2013 - 03:40 AM
–snip–
That's not Huffman coding.
oh. k. when i read up on zip compression, that's what it said.
453 posts
Location
Holland
Posted 24 February 2013 - 06:44 AM
pretty cool program you made. i see the point of compressing but its not really needed with the amount of memory computers and disks have.
620 posts
Location
Holland
Posted 25 February 2013 - 09:13 PM
Still needing to implement it i can help.
451 posts
Location
The left part of this post
Posted 26 February 2013 - 02:24 PM
If you give me a php code(because im not very good at php) for zip compression a a way to pass information using http api i will add zip support
301 posts
Location
Whenever, Wherever!
Posted 26 February 2013 - 04:40 PM
I can't do php or zip, but I can write a zlib program in node.js and host it, if you'd like.
997 posts
Location
Wellington, New Zealand
Posted 26 February 2013 - 07:25 PM
I compressed
my own compressor with this one and it came out 0.097% bigger than it started as.
…
…
…
…
404 posts
Location
St. Petersburg
Posted 27 February 2013 - 06:16 PM
I compressed
my own compressor with this one and it came out 0.097% bigger than it started as.
compressors work best with large files. try it with a 1MB or larger file
799 posts
Location
Land of Meh
Posted 27 February 2013 - 08:38 PM
I compressed
my own compressor with this one and it came out 0.097% bigger than it started as.
compressors work best with large files. try it with a 1MB or larger file
Where can you find a program that's 1MB? The only one I can think of right now that is over that is the secret along time ago movie, which is 2MB. If a compressor in CC only worked with files above 1MB, it'd be pretty useless…
I'm pretty sure that compression works with files above 2KB, and from memory, immibis's compression software is 5KB (I think :P/>).
997 posts
Location
Wellington, New Zealand
Posted 27 February 2013 - 10:18 PM
compressors work best with large files. try it with a 1MB or larger file
Where can you find a program that's 1MB? The only one I can think of right now that is over that is the secret along time ago movie, which is 2MB. If a compressor in CC only worked with files above 1MB, it'd be pretty useless…
I'm pretty sure that compression works with files above 2KB, and from memory, immibis's compression software is 5KB (I think :P/>/>/>).
rom/programs/secret/alongtimeago comes out 6.39% bigger than it started as.
7508 posts
Location
Australia
Posted 28 February 2013 - 12:30 AM
I compressed
my own compressor with this one and it came out 0.097% bigger than it started as.
How much smaller/bigger does yours make it?
496 posts
Location
New Zealand
Posted 28 February 2013 - 12:57 AM
I compressed
my own compressor with this one and it came out 0.097% bigger than it started as.
How much smaller/bigger does yours make it?
If you read his thread you'll see:
This compressor compresses itself at 67%, which could easily be improved to 50% if LuaJ didn't mangle non-ASCII characters.
For comparison, 7-Zip is able to compress the compressor program at a ratio of 35% (lower is better), and urielsalis's compressor achieves a whoppingly useless 100.097%
28 posts
Posted 11 March 2013 - 02:28 PM
cant compress itself without breaking
this isnt verry good
LOL
43 posts
Location
Germany
Posted 12 March 2013 - 05:35 AM
Maybe you're interested in this:
https://github.com/davidm/lua-compress-deflateluaIt's basically gzip in pure LUA. Just proposing it because I know I would never use a compression programming relying on a web server.
Good luck!
1852 posts
Location
Sweden
Posted 18 April 2013 - 12:18 PM
Pool added!
Lol, Can I swim in it? :P/>
But back on topic..
I haven't tested this but I'm sure that it's better than one I would create.
1619 posts
Posted 18 April 2013 - 01:05 PM
Pool added!
Lol, Can I swim in it? :P/>/>
But back on topic..
I haven't tested this but I'm sure that it's better than one I would create.
It's not. It enlarges files instead of compressing them.
1511 posts
Location
Pennsylvania
Posted 18 April 2013 - 01:14 PM
It's not. It enlarges files instead of compressing them.
I find compressors in CC to be pointless. What files would ever be large enough to need compression? No program on the forum is anywhere near as large as it would need to be for compression.
1619 posts
Posted 18 April 2013 - 02:13 PM
It's not. It enlarges files instead of compressing them.
I find compressors in CC to be pointless. What files would ever be large enough to need compression? No program on the forum is anywhere near as large as it would need to be for compression.
Exactly. And I've maxed out disk/computer storage in the config.