Programming and Scripting :: C question



Quote (curaga @ Jan. 12 2008,13:23)
Hm. Appears that after 10 letter words or so bash runs out of memory. And consumes all ram and 100+mb swap. So it isn't practical for long words, which I need :(

Back to drawing board..


It's not as pain in the balls with C,
create file with the words you will search - ie. not in array or string, assign one variable for the current searched word and change that same variable for the new search from the file, it will not have problems with memory

That way I would have trouble with HD space..
Quote (curaga @ April 14 2008,09:45)
That way I would have trouble with HD space..

OK, you're right.
Define letters (and or signs) in array as integer numbers, than create words (loops) as strings in real time calling the number from array, loop the numbers and not strings (ie 4 bytes less per letter). Than final word as string is for check (or count).
1 + (2x2) + (3x3x3) + (4x4x4x4) + .... until 13, thats a lot of combinations which means not HD space in this case but fastest PC work of more than days (months?)... that is also countable (how many flops needs program) = that's not much, but access to the password object is making time needed and thats a lot time if Big HD file or network access for up to 13.
Just a program for looping would be measured in seconds.

Yeah, that's a good idea, also very much like the one humpty posted earlier. Currently the perl implementation of Wdef is running, I will perhaps create a C program later, but I don't have time until sunday.
I would use someone else's already-optimized and tested C code or library to do permutations rather than use my own  - it's almost certainly likely to be faster, have a better algorithm, and generally work better.  There is a non-standard library for this as I recall.

Also, I've found a Perl module to do permutations with replacement without generating redundant perms (unlike Algorithm::Permute):

http://search.cpan.org/~tyemq....duction

It also claims to have very low zero memory useage.

I don't think it's an XScode module, so i don't know about speed.

Next Page...
original here.