thenetfreaker has asked for the wisdom of the Perl Monks concerning the following question:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hash confusion ?!
by shmem (Chancellor) on Feb 24, 2007 at 19:46 UTC | |
I'm working on a De/Coder which can compress 365766! (in factorial) bytes into 9.5Mb of TXT or 1.7Mb of ZIP. The compression (that has been tested so far limits the INPUT length to 60961 bytes); though the OUTPUT is twisted... Laught as much as you want, but i took the Torah {encoding: Hebrew(windows-1255)} which length is 304805 letters what's strange that this huge number equals only to 60961*5 and doesn't devide by 15,25,35,etc. I entered the Torah into a hash which contains the following about each letter : ord(Letter), Original_id, Current_id, my_gimatria_value <=> (ord(letter) -224), colour according to the book( one of five), place in the "pipe of letters", is_occupied. Afterwards i read input into the "pipe" by the only 3 rules( yet) that the current_id changes(as if there's a hole in the "pipe") to counter(from 0) multiplied on 6 AND is_occupie = true AND place = 6 , when finished, it remembers the state in which the torah is twisted into a file names filename.tX. The decoder is the problemetic part although it should be the reverse of the encoder which means rewriting the Coder "backwars". See I know what I mean. Why don't you? ...to which I want to add: Questions your post rises: Then you provide some code which I just gazed at without capacity left to understand it, being busy puzzled by the questions I laid out above. Even trying hard, I had to give up. This puzzle is beyond my skills, although it sounds interesting (maybe related with numerology?). I cannot relate all this with the title "hash confusion", given my own. Please reformulate your question and give us more insight into your proceedings. --shmem
| [reply] [d/l] [select] |
|
Re: Hash confusion ?!
by Joost (Canon) on Feb 24, 2007 at 20:08 UTC | |
I'm working on a De/Coder which can compress 365766! (in factorial) bytes into 9.5Mb of TXT or 1.7Mb of ZIP.Your definition of factorial is probably different from the normal one. According to wikipedia, 25206! bytes is roughly 1.205703438... *10100,000 bytes, or about 1099,991 Terabyte. A quick google search indicates that there are only 8.87 * 1049 atoms in the whole earth. Your number is ridiculous amounts of orders of magnitude higher. The compression (that has been tested so far limits the INPUT length to 60961 bytes);Which I can't help but notice is a bit smaller.
Laught as much as you want, but i took the Torah {encoding: Hebrew(windows-1255)} which length is 304805 letters what's strange that this huge number equals only to 60961*5 and doesn't devide by 15,25,35,etc.So what? Why do you think it should be a "factorial" number. Wait never mind, don't answer that.
p.s.: the "pipe" is a 5 cornered star shaped tunel of letters where on the pics of the start the letters are shifted and in the center the are being written.Does this post have anything to do with TIMECUBE? ;-) | [reply] |
| |
|
Re: Hash confusion ?!
by graff (Chancellor) on Feb 25, 2007 at 00:13 UTC | |
I'm able to tell that there are no syntax errors or compile-time warnings in your program, and I can see that it requires two input files, but I don't happen to have a file called "torah.cod" on my system, and there's no clue about what needs to be in a file called "temp.txt", so there's not much more I can do for you. Maybe you could reduce the code to a shorter version that can demonstrate the problem, and post that along with just enough sample data so we can run it and see what the problem is. You do seem to be doing some simple things in very complicated, bizarre ways, as in this part of the "enc()" sub that reads from "temp.txt" (I fixed the indenting a bit): This reads a line of data from the file, then seeks to a byte offset that starts at 0 and increments on each iteration. Then, having done that seek, read one byte, and end up with two characters (in @lets) that are the hex digits for the high and low nibbles of the single byte you've just read, process those two letters, then do another full-line read (which starts at the byte following the one returned by "read(...)". Okay, in some sense that actually does work. But what a lot of confusion and extra effort -- it ends up as one iteration of the while loop for every byte in the file, and the number of times each byte is read from the file is equal to the average line length times 2 -- when you really just need to read the data once, like this: I'm still puzzled why you bother assigning the return value from the "process()" sub to $data, but never use it for anything. There's probably a lot more confusion in the OP code, and it's not just a matter of hashes. Good luck -- if you can put together a coherent question, try posting that as a reply in this thread (or start a new thread), then maybe someone here can help. | [reply] [d/l] [select] |
| |
|
Re: Hash confusion ?!
by cLive ;-) (Prior) on Feb 24, 2007 at 18:29 UTC | |
| [reply] |
by thenetfreaker (Friar) on Feb 24, 2007 at 18:34 UTC | |
| [reply] |
by blazar (Canon) on Feb 24, 2007 at 23:15 UTC | |
| [reply] | |