Posted by robost86 on 21:06:00 01-07-2002
Welcome to the first YPN C contest!
Your task is the write a compression program - the program that compresses best wins! I will collect a number of mixed files, both ASCII text and binary data. The one that gets the best average wins
Here are the rules:
You may only use ANSI C, without any libraries, inline asm etc.
You may not use other peoples code. Of course you can read articles about compression - but stealing code is unfair.
Your code should be able to compile and run on my P200, running Linux 2.4.17 (may upgrade..doesn't matte anyway), gcc 2.95.3. If it doesn't I'll mail you back (or tell you in IRC).
You should provide a decompression program (or include the possibility to decompress in the normal program). The decompressed file should exactly match the uncompressed one.
Your program may not use any external files.
Mail entries to robost86@hotmail.com
Either zipped or tarred and compressed with gzip. Just sending a .c file will disqualify you.
Deadline: 13th January 2001
Good luck!
P.S: I'll post the test suite here in a few minutes.
Posted by fsvara on 18:36:00 01-08-2002
why disqualify people who send .c files only?
Posted by robost86 on 18:56:00 01-08-2002
Hotmail scandisks ASCII files up, curse MS if you feel like sending only a .c file.
Posted by SilentStrike on 03:05:00 01-09-2002
Yeah anon, as long as they program in ANSI C .
Posted by robost86 on 07:35:00 01-09-2002
Not many of us even have Windows, so Windows-specific contests is nothing I will support. DOS programs is not that much of a problem, since most of us either have an old DOS computer, or at least DOSemu.
Posted by KaGez on 08:32:00 01-09-2002
I think there will also be a VB contest later, since there are quite many ppls in here who code/coded in VB, so maybe someday there will be one.... or, you could just create one yourself!
[addsig]
Posted by Peter on 11:03:00 01-09-2002
Yep, if there is interest for it, which I think there is, (among our idle members at least.. never seen most of them around..) there will surely be VB contests.
As KaGez said, you can always start your own
Posted by robost86 on 13:21:00 01-09-2002
And as rob_ert said, you should make contest as many ass possible can take part in
(corrected a typo)
[ This Message was edited by: robost86 on 2002-01-09 13:22 ]
Posted by KaGez on 13:42:00 01-09-2002
robert = I perume that "ass" should be "as"
Anonymous:
As Peter said above, your free to start a contest, as long as you think that you can actually get some ppls to work on that contest
[addsig]
Posted by fsvara on 14:05:00 01-09-2002
porblem is i don't know a thing about compression... except of course the "remove-every-second-bit-and-use-a-random-one-when-decompressing-instead" "algorithm"... should even have "acceptable" results with raw sound files... but i guess that doesn't fall in the "lossless" category (except when you're really lucky and find the correct bits again) so it'll get disauqalified...
Posted by fsvara on 14:06:00 01-09-2002
btw, any pointers to compression-related info? i know it's a highly mathematical topic and hence quite out of this world, but do you know any links to basic intro info?
Posted by robost86 on 15:38:00 01-09-2002
KaGez: You're right, heh...
I like Turbo Pascal, but it's not that useful after all.
Svara, Check this page, contains a few links: http://www.internz.com/compression-pointers.html
btw, this is my post nr 500
Posted by KaGez on 12:13:00 01-10-2002
I only like 3d maths!
[addsig]
Posted by Peter on 12:54:00 01-10-2002
I tried to write a compression program (despite the fact that I didn't have an idea about how it'd work at first). The resulting code is a load of shit .
Posted by robost86 on 12:47:00 01-11-2002
I know how this algorithm work, but it's not THAT easy of implement
Posted by IbYdI on 13:20:00 01-11-2002
it's not that easy, but it's not so hard.
the best way to implement it is to write a code specification in real life language, and kindda arrange code in classes.
From there its very very easy.
Posted by KaGez on 14:37:00 01-11-2002
btw, that thingy is also called RLE compression (short for: Run Length Encoding). Most of the times it's only reffered as RLE if you use it with images, but it is also RLE with "normal" files
[addsig]
Posted by IbYdI on 14:55:00 01-11-2002
KaGez :
There is a big difference between RLE compression and Huffman compression.
Huffman compression is explain before.
RLE (Run Lenght Encoding) reduces strings of recurring characters to a single character, followed by a count of how many times the character occurred.
There is also CLZ (Lempel-Ziv compression), and it works this way : as input data is read, a dictionary of previious data is kept in memory. If a string of characters in the input data matches an entry in the dictionary, a code pointing to the dictionary entry is written to the output.
But the Huffman compression algor. is best to use for all types of files.
Posted by Peter on 15:05:00 01-11-2002
IbYdl: hm I write a compression program just for fun, not for having an useful prog . I'd agree with you if it was about making a serious program, but I want to find my own way when I just do something for the heck of it.
peace out..
Posted by IbYdI on 15:09:00 01-11-2002
peace out??? was there a war???
i just wanted to help
sorry
maybe writting a serious program is fun just for me here.
Posted by robost86 on 15:53:00 01-11-2002
I understand you, but maybe you don't write a serious compression program the first time you code anything compression-related.
Posted by KaGez on 03:00:00 01-12-2002
nnnnnnoooooooooo, there have to be ppls out the who want their very first app to be a program that is better than the best of the things out there.... I've heard that IbYdI can't code in C/C++, so how would he use those binary trees? don't tell me he'll do it in VB... heh ....
[addsig]
Posted by Maltanar on 20:55:00 01-12-2002
Why not? The only thing you need is a simple base-conversion program, and maybe a custom data-type for 8/16/32-bits.
Posted by Peter on 21:10:00 01-12-2002
IbdY: lol no, peace out is one of my fill words.. like "see ya guys"
Posted by KaGez on 02:48:00 01-13-2002
Maltanar:
VB is slow!
That's at least what I've experienced with VB apps ...
[addsig]
Posted by IbYdI on 11:58:00 01-13-2002
.well i started learning c++ and ill learn it fast.
.the Huffman compression can be implemented in Visual Basic!!!
.and another thing, im not just a programmer, i have very good skills in maths & logic. And that is kinda enough for me to understand more complex things than this compression thing
Posted by KaGez on 13:03:00 01-13-2002
you can talk about very good skills in maths and logic after you have written your own 3d engine without using OpenGL or DX. Then you're good @ maths and logic, but else you only need to have a good understanding of what you do. You don't need maths for most things. (_most_)
[addsig]
Posted by IbYdI on 13:09:00 01-13-2002
you dont need maths but you need logic for everything.
math is a very big science tree, and only one branch is the 3d math.
i think i made myself clear.
Posted by KaGez on 13:54:00 01-13-2002
oh, but 3d math is by far the most difficult for programming.
having logic is normal for a human being! Are you no human being or are you just feeling special?
[addsig]
Posted by IbYdI on 19:29:00 01-13-2002
i never feel special.
Posted by Peter on 07:35:00 01-14-2002
But you can have more or less developed logical skills. We train that, and programming methodics, while we program.
IbYdI: then it's about time
Posted by KaGez on 12:24:00 01-14-2002
That's what I love about programming!
You always first have to think about how you can do it (best), and then you can start coding! =)
[addsig]
Posted by Peter on 18:45:00 01-14-2002
Yeah! Or do as I usually do (the dirtier way): get a cool idea and start coding like a maniac only to realize you started off with a bad method. Say "what the heck" and start over, this time with a clearer idea of what to do. Repeat this until you get bored of it...
haha.. yeah that's me. I know it's not quite an efficient way of working but I guess I'm learning..
Posted by fsvara on 21:52:00 01-14-2002
that's how rms said he coded emacs...
Posted by KaGez on 05:41:00 01-15-2002
I think it's not so bad at all... you learn from the mistakes you've done before, and you'll probably (hopefully ) won't do that mistake again... I also do it quite often, and I also have learned much when working like that
[addsig]
Posted by fsvara on 15:01:00 01-15-2002
sure, but it's not really the ideal way to go when you want to get something done
Posted by KaGez on 12:58:00 01-16-2002
ok, when I want to get something done I plan it. But if I do some stuff (like my OpenGL Terrain Fractal), I just start coding, and fix what is needed to be fixed
[addsig]
Posted by robost86 on 10:38:00 01-28-2002
Sometimes designing and planning a project can be harder than actually implementing it. I'm working on Primula, a 32-bit OS, and planning/designing the general design os the system has shown not to be any easier. On the other hand - some projects you can do without thinking too much
Posted by KaGez on 13:59:00 01-28-2002
but there are also many things that you won't get done if you haven't writte it down once before you code them
[addsig]
Posted by robost86 on 20:16:00 01-28-2002
Deinfe "get done"
There's (almost) always way to do things, but sometime the way can be so ugly you choose not using it. For example, if you suddenly notice your C program is filled with gotos and global variables everywhere, you might want to do something else for a whlie
Posted by KaGez on 06:26:00 01-29-2002
hehe, I mostly use glbal vars, so I don't care for it dun use goto labels tho :/ never used the min C/C++ ...
get done = get it working smoothly with almost no performance loss, and good looking code
ok for a definition?
[addsig]
Posted by robost86 on 09:59:00 01-29-2002
Hehe, yeah, even though you can make a program _look_ good from the outside, but not in the code (e.g. when you use lots of global variables for everything
Posted by IbYdI on 10:40:00 01-29-2002
...people invented classes to overcome those problems with vars and code...
still i know few people that say they are C++, or VB ... programmers, but they dont use classes. Still they make good programms, but only themselfs can read the code w/o loosing nervs.
Posted by KaGez on 11:03:00 01-29-2002
erm... for certain things you need global vars just btw .... and I need _lot's_ of them...
ok, I know what comes next... next robert will say something like "then you can't code" or something of that sort
[addsig]
Posted by IbYdI on 11:10:00 01-29-2002
well some global vars sure are needed.
i try to keep their count as low as possible (sometimes 0).
but having more than 5 ... ugh ...
[addsig]
Posted by KaGez on 12:55:00 01-29-2002
lmao!!
make a game with less than 5 global vars ... lmao
[addsig]
Posted by Peter on 13:13:00 01-29-2002
what's wrong with global vars? *ducks*
Posted by KaGez on 13:52:00 01-29-2002
oh yes, forgot to mention what comes next from robert _or_ lbYdl .... "not everybody programs games".... yes, but not also everybody programs little useless compression algorithms
[addsig]
Posted by fsvara on 15:30:00 01-29-2002
talk about useless... )
Posted by IbYdI on 18:43:00 01-29-2002
is a compression algo. useless? it's good for practice...
anyway
kagez: when i was talking 'bout classes. i wasn't talking 'bout you.
but since you take everything personal, forgeting that maybe your way isn't always the best way, any discussion with you is useless.
Posted by KaGez on 08:40:00 01-30-2002
Quote:
well some global vars sure are needed.
i try to keep their count as low as possible (sometimes 0).
but having more than 5 ... ugh ...
am I the only one not seeing the classes part?
I was talking about the compression algos some of us have been making for this contest... they are.... useless, or not?
[addsig]
Posted by IbYdI on 09:24:00 01-30-2002
like i said, and i say this with best intentions, i've got this fealing that you read other people oppinions just to tell them that they are wrong.
but they are useless if none of them has a good compression algo.
btw. compression alog's were mostly invented by mathematics, and not programmers
Posted by KaGez on 12:04:00 01-30-2002
so, if I only tell ppls that they are wrong, what do you do? you don't seem to be a _little_ better ...
[addsig]
Posted by fsvara on 12:37:00 01-30-2002
actually argueing about what i useful or useless is pretty pointless, as most (or everything...) we are programming has already been done in some way or the other. So yes, that compression algorithm is "useless", and so is linux (we have other OSes, right?), so is my plugin for wncrypting xchat's open query i am working on, so is kagez' fractal terrain generator and stuff.
So let's not talk about what is "useful" but rather about what is "fun", and as that is something that everybody judges differently, we cannot (or rather: shouldn't) argue about it at all
Posted by IbYdI on 12:52:00 01-30-2002
i just tell my opinnion when needed.
[addsig]
Posted by robost86 on 09:44:00 02-05-2002
KaGez: You can't code
j/k, but you _can_ do programs without using lots of global variables. For example, you can use variables (or pointers to them) as function parameters, for an example of that, check my program "Cnasica" (C/C++ section). There I tried to get rid of global variables, and I did it pretty well, I think.
Posted by robost86 on 09:46:00 02-05-2002
Also, about uselessness... I don't think KaGez is the person to acuse us for coding useless things (even though he's kind of right). Rotating cubes and fractals aren't _that_ useful
Posted by fsvara on 23:55:00 02-12-2002
so, did anybody write more than one line of code for this contest?
Posted by HeavyJ on 03:43:00 02-18-2002
Is programming for QB good?
And i've an idea: you can have the same thing but to compress images later.
Posted by HeavyJ on 03:58:00 02-18-2002
joke
little bit old
Posted by HeavyJ on 04:00:00 02-18-2002
no, even MPF 3.5 is made in QB and isn't bad
Posted by fsvara on 13:11:00 02-18-2002
what are you talking about...
Anyway, try posting replies in one message if possiblibe
Posted by robost86 on 06:41:00 02-21-2002
He's talking about his Pascal/QB image compression/viewer tools
Posted by inhahe on 10:19:00 09-23-2003
1. How much more efficient is arithmetic encoding than huffman encoding?
2. Why isn't Huffman encoding 100% optimal?
Posted by inhahe on 10:21:00 09-23-2003
3. Could an arithmetic encoded file theoretically be interpreted by a huffman tree?