I've always was interested in how compressed files worked and why the compression factor is so low.
The entropy explanation isn't something i would accept without tinkering with the data. The idea of my compression algorithm(currently under development) is to
use algebraic properties of files to express the data in more concise way.
The thing might sound trivial, but its implementation is not.
Normal compression works by splitting FILE and finding redundant pieces to express them in minimum volume.
Imagine a FILE read and converted to arbitrary precision integer. Now consider all the myriad ways to generate said integer. Sounds difficult? Not so much.
1.lets take a Prime Number,e.g. 2 and raise it to power closest to our integer, e.g. 20000. Note the difference from the (FILE-result).
2.Get the smallest difference with the powers available,
and proceed to next step:
3.If the difference is negative: find 2 raised to the power
of X which would close the gap,by substracting it from #1
If the difference is positive just add 2 with closest power to the difference .
The end result could be something like
2^6+2^5-2^3+2^1-2^0=Integer=FILE
Its can be improved further by using other prime numbers powers with the idea of expression taking the least space.
The same thing can be accomplished with arbitrary length floating point numbers like 2^123712.1282 which would converge faster,but will require some fixing to convert to a stable binary result.
Posted by FrozenVoid at 15:37
Name:
Anonymous2009-06-19 11:30
Frozen Void, read ``Meta Math'' by Gregory Chaitin.
Name:
Anonymous2009-06-19 12:02
>>199
Imagine holding a microphone in front of a speaker. That's what happens.
>>202
A metaphor that makes sense? I must be on the wrong board. >>201
I doubt he read it. Scanning his eyes from left to right, and flicking pages, maybe.
Name:
Anonymous2009-06-19 12:29
>>202
An infinite never-ending sound loop that will eventually generate a sound so loud it blows up the universe?
>>204
More like routing the output of a sentience matrix into itself using the power supply as a bridge, creating a feedback loop that enhances intelligence to the point of total omniscient sublimation.
Update:MPI and GMP refusing to link with my compiles and i downloaded MAPM, which apparently works.
(I have GCC(install corrupted and refuses to work),DMC(works ok),TCC(fails to work sometimes with function errors,but very fast and produces small .exes))
The problem its converting all files to decimals(which goes 100bytes/second). here is the current code(inpbuf is where file is stored):
M_APM decstr=m_apm_init();printf("Converting number in inpbuf to decimal:\n");
//store multiplier,store current byte,current byte multiply,current decstr copy,
M_APM pow2store=m_apm_init();M_APM pow2base=m_apm_init();M_APM bytexpow=m_apm_init();M_APM decstrcopy=m_apm_init();
//byte multiplier (2^8)^(pos from end:0=1) first bit=1,
M_APM pow2exp=m_apm_init();m_apm_set_long(pow2exp,2L);
unsigned long int curbyte;unsigned long int curpow;unsigned long int pos;
for(pos=(filesize-1);pos;pos--){
curbyte=(unsigned long int)inpbuf[pos];
if(pos%1000==0){printf("Processed %u of %u bytes\n",filesize-pos,filesize);}
//curent byte as int
m_apm_set_long(pow2base,curbyte);
//this is multiplier for current byte (2^8)^pos=2^(pos*8)
m_apm_integer_pow_nr(pow2store,pow2exp,8*((filesize-pos)-1));
m_apm_multiply(bytexpow, pow2base, pow2store);
m_apm_copy(decstrcopy,decstr);
m_apm_add(decstr,decstrcopy,bytexpow);
}
printf("Inpbuf succesfuly converted to decimal.\n");
m_apm_free(pow2store);m_apm_free(pow2base);m_apm_free(bytexpow);m_apm_free(decstrcopy);m_apm_free(pow2exp);
char *testbuf=malloc(filesize*26);m_apm_to_integer_string(testbuf,decstr);
fwrite(testbuf,1,strlen(testbuf),output);
>>211
There you are mistaken. I bothered with a reply in hopes that you would cease posting in future due to your newly acquired knowledge. Sadly, I think it's fallen on deaf ears.
if i had to choose between giving up a hand, my vision, or my hearing i would probably choose my hearing.
i wouldn't be able to stand being blind.
just saying
Name:
FrozenVoid2009-06-21 8:54
>>212 See, you have an agenda. Your "gives a shit" claim is self-contradictory to "I'd like to take the time", but you miss the point of it, pretending to be remote observer and not active participant.
Just for comparison this is the code i use to convert to hex(0x??), which is far more elegant.
char *hexdata=malloc(filesize*2+2);hexdata[0]='0';long pos;hexdata[1]='x';char tmp_0f;char tmp_f0;
for(pos=0;pos<filesize;pos++){
tmp_f0=(inpbuf[pos]&0xF0)>>4;tmp_0f=(inpbuf[pos]&0x0F);
hexdata[pos*2]=tmp_f0<0x0a?tmp_f0+48:tmp_f0+55;
hexdata[(pos*2)+1]=tmp_0f<0x0a?tmp_0f+48:tmp_0f+55;}
Jesus Fucking Christ, your unindented, non-monospace code looks bloody disgusting; doesn't it irk you?
Name:
FrozenVoid2009-06-21 9:47
>>218 my normal style is:
char *hexdata=malloc(filesize*2+2);hexdata[0]='0';long pos;hexdata[1]='x';char tmp_0f;char tmp_f0;
for(pos=0;pos<filesize;pos++){tmp_f0=(inpbuf[pos]&0xF0)>>4;tmp_0f=(inpbuf[pos]&0x0F);
hexdata[pos*2]=tmp_f0<0x0a?tmp_f0+48:tmp_f0+55;hexdata[(pos*2)+1]=tmp_0f<0x0a?tmp_0f+48:tmp_0f+55;}
_________________________________________________ http://xs135.xs.to/xs135/09042/av922.jpg
orbis terrarum delenda est
Name:
FrozenVoid2009-06-21 9:51
Without comments i can view most programs in 1 page and instantly see all variables,etc
for debugging its fairly easy to split offending lines into 2,3 segments and recheck it.
>>220
Good luck tracking down an AI determinism bug in a large scale game- where you didn't write any of the code and the person who did wrote it using your unique ``style''.
Name:
FrozenVoid2009-06-21 10:07
>>221 there is astyle for those who prefer to waste their screen real estate.
My code isn't scrambled. Its predictably ends on delimiters.
_______________________________ http://xs135.xs.to/xs135/09042/av922.jpg
orbis terrarum delenda est
>>222
Are you telling me you could find an AI determinism bug if the engine was written like this?
Name:
Anonymous2009-06-21 10:18
>>219
Your ``normal style'' is absolutely unreadable. Please note that other people might want to read your code for some twisted reason, so you should at least try to make it so that my eyes don't bleed when I see your code.
Name:
FrozenVoid2009-06-21 10:18
>>223
If i knew what this "AI determinism" meant (in this context i guess its something like "NPC goes crazy")
and has minimal reference for the functions employed in code, its easy.
Also, all these formatting can be changed with Astyle in minutes. No need to fuss over a minor point.
>>229
Not FIOC-like style, just any readable style.
Name:
FrozenVoid2009-06-21 10:53
>>230 'Readable' is very subjective. While you read text files, you don't complain that every page is "not properly indented", or do you? You just read them like books.
__________________________________________ http://xs135.xs.to/xs135/09042/av922.jpg
orbis terrarum delenda est
Name:
Anonymous2009-06-21 10:54
>>230
No, you are demanding FIOC style exactly. The "variety" of styles you pretend to accept are in fact different in curly braces' placement rules, erase curly braces altogether and you have FIOC, one and only.
That is to say, clearly posting this was not a good idea.
Name:
FrozenVoid2009-06-22 3:35
>>235 It wasn't. But nevertheless amusing.
In other news: A new version of my algorithm will be published today which lowers base search times drastically(and very compact).
1073741819
What a long, messy number. Should be compressed.
Name:
FrozenVoid2009-06-22 10:44
GMP: gives this: POLINK: error: Unresolved external symbol '__imp___iob'.
MPI: crashes when used to initaliaze second mp_int variable. exception -1073741819
MAPM: works but its gives corrupted results in output and conversion to decimal very slow
MIRACL:this i'll try next
________________________________ http://xs135.xs.to/xs135/09042/av922.jpg
orbis terrarum delenda est
Name:
FrozenVoid2009-06-22 11:05
MIRACL refuses to compile with Pelles C.
D:\Program Files\PellesC\Include\miracl.h(249): error #2001: Syntax error: expected ';' but found 'mr_large'.