#ruby-lang - Fri 30 Mar 2007 between 00:00 and 00:45

NY Lost Funds



sporkmongeryeah, i'm about 90% sure that won't work
Olathesporkmonger: http://pastie.caboo.se/50462
Maybe have it quit once the hash is empty.
sporkmongerthat looks promissing
OlatheI thought of another way. Let me make it.
sporkmongerwell
if it'd make it any simpler
i don't need to know -where- in the string the substrings occur
just how many times they occur
heh, i'm still trying to decipher this code, but it looks pretty damn close to what i need
and it's about 1000x times faster
Olathehttp://pastie.caboo.se/50464
Here's the beginnings of a faster one.
cygnus128sporkmonger: so in the string 'ab ab' you would find 'ab ab', 'ab a'(1), ' ab'(1), 'a '(1), ' a'(1), and 'ab'(2) right?
sorry, 'ab ab' would be found once
as well
Olathehttp://pastie.caboo.se/50466
You can probably do something with this: http://pastie.caboo.se/50469
Let me make an evaporating thingy.
The near-finished version: http://pastie.caboo.se/50470
sporkmongersorry, was afk, back now
cygnus128: i don't care about substrings that occur only once unless they're only one character long
the ultimate output is going to be a huffman coding compression tree
so everything in the string has to be able to be translated to a huffman coding
but strings that occur only once wouldn't compress very well
so i just ignore them
since they're weighted exactly the same as single characters
keeping track of singly occurring substrings would only serve to increase the size of the tree, but wouldn't improve the compression ratio
OlatheAnd the finale: http://pastie.caboo.se/50472
"lobster" is a seven character repeat at positions 0 and 50 to the right of that. Note that [50] is in position zero of the seventh stage.
So, now lobs or ster don't appear; only the complete substring.
sporkmongerinteresting
yeah, i still haven't figured out if that's desirable behavior or not yet
i had a delete method in my algorithm that resulted in the same effect
but using it didn't speed the algorithm up
and i -think- that it reduces the effectiveness of the primary algorithm
but i'm not sure
what would it take to make "lobs" and "ster" to show up as repeated substrings
OlatheRemove .parched
Just use offsets

Page: 2 9 16 23 30 37 44 51 58 

IrcArchive

NY Lost Funds