The name given to the process of encoding data such that it uses lesser number of bits as compared to the original representation.
3
votes
1answer
29 views
Python date compression
I m making a script to store date information in the smallest size in bits
(I don't mind of the actually memory use in the program / runtime)
...
2
votes
1answer
104 views
Compress and decompress a string from a file
This is a task for a computing controlled assessment. I'm wondering if it could be made more efficient. The only things I could think of would be the 'import re' and turning the filename input and ...
1
vote
2answers
67 views
Simple string compression in Python
This is my solution to exercise 1.6 in Cracking the Coding Interview. I am interested in receiving feedback on the coding style and time/space complexity.
The exercise statement is:
Implement a ...
3
votes
1answer
50 views
zlib wrapper class
I needed to write zlib wrapper class for my application, so I can change it with different algorithm later if I want to do so.
Here is the simple version:
...
3
votes
2answers
133 views
Analyzer for compression algorithms (or tools)
This file contains the main functions of my tool, rac. In particular, I care a lot about the Shannon function.
Would you please give some hints to make the file cleaner? I have a perversion for ...
5
votes
1answer
53 views
Prefix free compression and decompression
I have written a prefix-free compressor that assigns the shortest bit-strings to the most common characters. It works very well for natural language as some characters (SPACE, "a", "e" ...) are much ...
3
votes
1answer
70 views
DotNetZip: Adding files to archive faster in web app
I'm looking for ways to speed up the process of adding entries to a zip-archive, in a web app, using DotNetZip.
The problem currently is that the response times out before all files has been added to ...
7
votes
1answer
102 views
Multithreaded Decompression
I'm working on optimizing a class for decompressing Mass Effect 3's .sfar files. .sfar files are archives, and this function decompresses a file from inside an .sfar and writes it to the provided ...
1
vote
1answer
35 views
Encoding and decoding in Haskell — 99 Problems exercise 13, 14
I've been working on these solutions to the Haskell 99 questions, encoding and decoding series for a while now, so I figured I ought to present them to see how I screwed up the implementation.
...
1
vote
0answers
58 views
Cuda C Matrix Compression
I am using Cuda to learn and implement a CSR matrix compression algorithm. What can I do better relating to C's best practices?
main.c:
...
6
votes
1answer
89 views
Speeding up process time while archiving files
I asked this question on Stackoverflow, and was told I might have better luck here.
I'm new to c# and have created a basic file archiver. It works, and it does what it's suppose to do, but I think it'...
13
votes
2answers
243 views
Python 3 decompression routine 10x slower than C# equivalent
I'm relatively new to Python 3, especially IO programming, writing a Blender add-on to import model data.
The model data is available in a custom compression, and I originally wrote code in C# to ...
0
votes
1answer
45 views
Condense JSON for bandwidth efficiency
JSON is quickly becoming the formatting standard of choice for quick, convenient, and reliable machine to machine communications. It is flexible and widely supported but it has some drawbacks when it ...
-4
votes
2answers
163 views
RAM overhead on a compression program [closed]
In a program, the one below is attempting to codify into a translation of another file. The output is severely condensed. It works, and once I get it to decompress, then it will win award after award. ...
3
votes
1answer
158 views
Huffman algorithm implementation in C++
Lately, I have been working on this Huffman algorithm and it is finally done, though I think it is improvable due to the fact that people say you have got to use two priority queues but I ended up ...
0
votes
1answer
100 views
Compressing a file using zip or gzip
Write a Compress class defines two static methods, gzipFile(), which
compresses a file using GZIP compression format, and zipDirectory(),
which compresses the files (but not directories) in a ...
1
vote
1answer
703 views
Simplifying LZW compression & decompression
I have wrote code that takes an input file text that can be compressed, and should contain ascii values, and then a new file is created with an appended ".lzw" and that file can then be decompressed. ...
2
votes
1answer
61 views
Custom compression tool
I have made my own compression tool for a stack-based language that uses a dictionary compression method. The code for the decompression is the following:
...
2
votes
0answers
25 views
Adding information to a compressed file and compressing the output
I wrote this script for adding information to a compressed file and compressing the output:
...
5
votes
1answer
68 views
Uncompress archive, check contents, add missing files, recompress archive
The code looks for the specified .tgz file, if it's not present, it creates it. It looks for files ending in .txt in the cwd and adds them to a list. It decompresses the gzip, checks for the .txt ...
4
votes
1answer
74 views
SICP - exercise 2.69 - generate a huffman tree from a set of ordered leaves
From SICP
Exercise 2.69: The following procedure takes as its argument a list of
symbol-frequency pairs (where no symbol appears in more than one pair)
and generates a Huffman encoding tree ...
2
votes
1answer
60 views
RLE-like string compression in clojure
There have been already many similar questions to this one (e.g. this and this, just to point two), but I did not find any for clojure.
The goal is to compress a string in a RLE-like way: i.e. each ...
3
votes
2answers
585 views
Extracting RAR files in a directory
I just started programming, and something is telling me that this working function looks to big for what it does. Can you give a better version of the code so I can understand how to code faster, ...
1
vote
1answer
124 views
String compression implementation in C
I implemented basic string compression algorithm that uses the counts of repeated characters. For example: the string aabcccccaaa would become a2b1c5a3. What do you think about this, is there a better ...
1
vote
2answers
61 views
Simple compression on steroids - now with decompression
A third follow up to the simple compression implementation.
Adopted most of @holroy's suggestions. Main changes:
Compression now uses high-bit to indicate that additional length bytes are still ...
8
votes
2answers
213 views
Simple compression reloaded++
As a follow up to my previous question I've improved the code + algorithm. The compression now works the following way:
Each character is followed by a length byte. The top 3 bits of that byte denote ...
4
votes
2answers
61 views
Simple string compression reloaded
Inspired by this question I thought I provide my implementation. I tried to go with the spirit of the *nix tool chain - read from stdin and write to stdout. This has the added benefit of making ...
10
votes
4answers
900 views
Algorithm for simple string compression
I attempted a problem from the Cracking the Coding Interview book. The following input: aabcccaaa should give the following output: ...
12
votes
1answer
460 views
C++11 implementation of Huffman-encoding
This is a c++11 implementation of Huffman-encoding that I wrote as a hobby. My main goal in writing it was to get more accustomed to c++11 and STL in general, as well as stuff like bit-manipulation.
...
2
votes
1answer
43 views
4
votes
2answers
172 views
lz77 is quick on strings but not on bytes
I ported a lz77 implementation from java to c#, and it's working fine. Now I want it to compress bytes and not strings, as I need it for another project.
This is the porting, operating on string:
<...
3
votes
1answer
108 views
Run-length encoding in Haskell
I wrote a short Haskell script to compress and decompress via the use of run length encoding.
The concept is simple enough, n equal items ...
3
votes
1answer
207 views
4
votes
3answers
945 views
String compression by using repeated characters count
My task was to perform a basic string compression by replacing consecutive repeated characters by one instance of the character and integer denoting the number of repetitions.
For example the string "...
5
votes
1answer
889 views
Convert zip to gzip and upload to S3 bucket
My code accesses an FTP server, downloads a .zip file, pushes the file contents as .gz to an AWS S3 bucket.
...
1
vote
2answers
164 views
Brotli compression algorithm, translated from Python into Haskell
I have converted some code in Python into its Haskell equivalent.
Python implementation:
...
5
votes
1answer
77 views
Interop compression
This is a function definition from an external dll, that I'm calling from my code:
...
7
votes
2answers
127 views
Reverse engineering Darkstone game archives
Reverse engineering old games is something I do every now and then. This time, I took a shot at this old RPG called Darkstone.
The bulk of the game's data is stored in archive files with the ...
4
votes
2answers
177 views
LZW encoder and decoder
Recently, I reviewed this question about an LZW decoder. In order to properly review that question, I needed to write my own encoder and decoder to be able to test their program. Someone thought it ...
7
votes
2answers
249 views
LZW decompressor in C (II)
Here is an update to my previous thread which you can find here. Again, I'd very much appreciate any advice or comments about the structure/logic of the program, style of the code, or reusability of ...
11
votes
1answer
2k views
LZW decompressor in C
Here is a simple decompressor in C. I'd very much appreciate any advice or comments about the structure/logic of the program, style of the code, or reusability of the features. I'm a real novice and ...
3
votes
1answer
30 views
Bash Compress Managed Directory Ignoring .git, bower_components, node_modules, etc
Fairly easy way to compress a wordpress plugin (or similar) as a zip file without including all the dependencies used to create and manage the development, but which don't belong in the final product.
...
2
votes
1answer
75 views
Teamwork challenge for Timus Online Judge
Question is here:
Input
The first line contains an integer \$N\$, which is the quantity of numbers written down by Vasya (\$1 \le N \le 1000\$). The second line contains these numbers ...
4
votes
2answers
135 views
Transforming an array in Ruby
I watched a presentation by Dave Thomas on Elixir where he gave an example problem that he solved using functional programming. He mentioned using Ruby to solve the same problem, but did not show an ...
8
votes
1answer
5k views
Simple LZW compression algorithm
It's a simple version of LZW compression algorithm with 12 bit codes. I want to know what's good and what's bad about this code. Be as picky as you like.
...
2
votes
1answer
293 views
Huffman code generator in Haskell
This is problem 50 in https://wiki.haskell.org/99_questions/46_to_50. The website has more elegant Haskell solutions, but I wanted to get feedback on how the code I wrote on my own below could be ...
3
votes
1answer
73 views
Program for compacting other given code
I've just finished a small function that will reduce the size of code as much as possible without breaking anything. Obviously it makes everything a bit unreadable so it's not really for cleaning the ...
2
votes
1answer
51 views
2
votes
2answers
108 views
Using reduce twice in a row for Run Length Encoding
First of all, I'm new to Lisp (I currently use CLISP and SBCL). There probably are huge mistakes in this code so any guidelines are welcome :)
I'm very confused about how to do this. It's just about ...
3
votes
1answer
814 views
HTML Compressor with regex
I would like to compress a Magento HTML page using some regex, and this is what I have written:
...