Star|way

anyone know of a fast dll that would search text files, & could be used with mirc ?

the txt files are around 5mb on an average

the txt files are around 5mb on an average

fedex

Why not write your own?

a good algorithm to search in a big chunks I would recommend booyer's moore algorithm.

But feel free to use anything else.

a good algorithm to search in a big chunks I would recommend booyer's moore algorithm.

But feel free to use anything else.

Star|way

thank-you

fedex

Welcome.

Need a link or you can do that on your own?

Need a link or you can do that on your own?

Star|way

gimmie some links

fedex

Okay, moment please.

Star|way

k

actually i've written a search for it in mirc..

actually i've written a search for it in mirc..

tiocsti

yeah bmh has its good points

but it is horrible in certain circumstances too

but it is horrible in certain circumstances too

Star|way

but its too slow at times depending on the search

tiocsti

not only depending on the search

but it requires the block to be buffered

but it requires the block to be buffered

fedex

Yes.

tiocsti

as opposed to a fsm which can work char by char

Star|way

tiocsti, i was referring to the mirc script that i wrote

fedex

tiocsti: You recommend something else?

tiocsti

since bmh searches at the end, it cant do that

fedex, searching is complex, and ideal depends greatly on context

fedex, searching is complex, and ideal depends greatly on context

fedex

How about tbm?

Star|way

i need it to search from the 3rd token onwards

excluding the 1st 2 words of the line

excluding the 1st 2 words of the line

tiocsti

for short strings, bmh loses too, the overhead is greater than performance gained

Star|way

i've experimented with diff methods in mirc.. but it turns out slow in certain instances..

tiocsti

if you are searching fixed strings known at compile time, then something like a fsm can be very fast

but i dont know anything about mirc

but i dont know anything about mirc

fedex

www.cs.utexas.edu/users/moore/best-ideas/string-searching/fstrpos-example.html

Star|way

k.. i don't really know anything about asm

fedex

Check that.

Star|way

fedex, k thanks

fedex

Welcome.

tiocsti

if you know your strings ahead of time, its hard to recommend bmh though

if writing general purpose code, bmh is good, although it just depends

if writing general purpose code, bmh is good, although it just depends

fedex

Maybe he/she can just write his/her own searching algorithm.

tiocsti

maybe

fedex

I have no idea about the thing he wrote for IRC looks like though.

tiocsti

it's hard to imagine something worse than strstr

since it takes the brute force approach

which is actually optimal for small search spaces

but degrades exponentially for large spaces

if he's searching multiple strings, though, something like a-c can be nice

since it takes the brute force approach

which is actually optimal for small search spaces

but degrades exponentially for large spaces

if he's searching multiple strings, though, something like a-c can be nice

fedex

Maybe KMP algorithm?

tiocsti

ugh kmp is not good.

malfunc

n8

tiocsti

my logic usually goes something like:

if i need to do incremental searching, fsm

if i need to do incremental searching, fsm

fedex

If not?

tiocsti

if i need to find the match in n strings, aho-corasick

if i need to match single string bmh

of course, theres some overlap areas where the choice the table would give is not optimal

if i need to match single string bmh

of course, theres some overlap areas where the choice the table would give is not optimal

fedex

I see...

But then again it depends on the situation as well.

But then again it depends on the situation as well.

tiocsti

right

if its small input size

brute force is optimal

if its small input size

brute force is optimal

fedex

Yeah.

He was talking about a 5mb input.

He was talking about a 5mb input.

tiocsti

i would probably use bmh there

fedex

So I guess, your choice would be better than mine.

tiocsti

or a-c if its multiple strings

(depending on how many of course)

(depending on how many of course)

fedex

Yeah.

tiocsti

all the cool stuff in string searching doesnt take place in cs anymore

its all about bioinformatics :)

its all about bioinformatics :)

fedex

heh.

tiocsti: You were a CS student?

Or you are graduate or what? :]

tiocsti: You were a CS student?

Or you are graduate or what? :]

tiocsti

i was, yes

fedex

What are you now?

tiocsti

i didnt learn much about string searching in school

kmp, bmh, basic stuff

kmp, bmh, basic stuff

fedex

Yes, true.

Yeah, but you learnt about algorithms.

You reasearch on your own later.

Yeah, but you learnt about algorithms.

You reasearch on your own later.

tiocsti

yeah, i work in an industry where string search performance is important

so i know a lot about that, and have some bioinformatics books, which is where all the good stuff is

since they need very efficient string searches in that field

so i know a lot about that, and have some bioinformatics books, which is where all the good stuff is

since they need very efficient string searches in that field

fedex

ahh....

That explains your good knowledge about the topic.

That explains your good knowledge about the topic.

Deathmaster

does anyone have a dword to ascii convertion routine? (16-bit code)

fedex

:]

Deathmaster

? fedex

fedex

maybe 2 dwords?

tiocsti

you can do it like you learned in school

split the number into ones tens hundreds thousands, etc

start with the largest bucket, work to smallest

split the number into ones tens hundreds thousands, etc

start with the largest bucket, work to smallest

fedex

div/mod

Deathmaster

yeah i know how to do divide it in ones tens hundreds and so on :)

i have another problem

i have to calculate that remainder

if the high word is not null then i don't know how to calculate the remainder

i have another problem

i have to calculate that remainder

if the high word is not null then i don't know how to calculate the remainder

fedex

mod

After you div you mod to get the remainder.

After you div you mod to get the remainder.

tiocsti

still talking mirc i presume

Deathmaster

i do what fedex?

fedex

mod

modulo

modulo

Deathmaster

the remainder is placed by div in dx

tiocsti

ok only one of you is i guess :)

Deathmaster

lol man

fedex

theehee, I meant in real life.

Deathmaster

i thought he was kidding or something

well nevermind

well nevermind

fedex

modulus == %

NEvermind.

Goodnight everyone.

NEvermind.

Goodnight everyone.

Star|way

night fedex

Deathmaster

anyway... i need to calculate that remainder and i'm looking for a better method than subtracting the quotient*10 from the divident :)

and no more strange "mod" instructions this time, pls :))

and no more strange "mod" instructions this time, pls :))

Star|way

all of you must be experts in asm

do a lot of people use win32 asm ?

i know nothing of it.. i just read a bit of it.. & that was years back

was ver interesting though.. from what i read..

wish i had the time to pursue it...

do a lot of people use win32 asm ?

i know nothing of it.. i just read a bit of it.. & that was years back

was ver interesting though.. from what i read..

wish i had the time to pursue it...

Inode

deathmaster: whatever ^ divisor == remainder ... (mod is ^)

err

i mean %

err

i mean %

Deathmaster

what the hell???

this is some kind of joke?

i need to divide 64bit to 32bit

sorry

32bit to 16bit

the 32bit number is always bigger than 2^16-1, so the high word is always not null

i can't divide it just like that 'cause i would get an overflow

so first i divide the high word

then the low word

i can calculate the quotient

but i don't know how to calculate the remainder in a decent way

what the hell is all that bs about mod and % ??? this in #c++ god damn it

this is some kind of joke?

i need to divide 64bit to 32bit

sorry

32bit to 16bit

the 32bit number is always bigger than 2^16-1, so the high word is always not null

i can't divide it just like that 'cause i would get an overflow

so first i divide the high word

then the low word

i can calculate the quotient

but i don't know how to calculate the remainder in a decent way

what the hell is all that bs about mod and % ??? this in #c++ god damn it

Inode

is your dividend is 32bits and divisor 16bits?

Deathmaster

ye

s

s

Inode

m$ did it like this for some dos progs.... div32b: mov cx, ax | mov ax, dx | xor dx, dx | div bx | xchg cx, ax | div bx | ret

input: 32 bit dividend at DX:AX ... and BX had the divisor

output: CX:AX quotient... DX remainder

input: 32 bit dividend at DX:AX ... and BX had the divisor

output: CX:AX quotient... DX remainder

Deathmaster

inode

i don't know what m$ did in some dos program

but you can't make a 32bits 2 16bits division

oh no sorry

i wans't paying attention

well i did exactly the same thing

so you're saying that the remainder

is basicly the remainder of the second division (of the low word) ?

let's say you have F000 0000

no.. ignore me

i didn't see an instruction on that line :)

yes it works... thanks a lot Inode :)

i don't know what m$ did in some dos program

but you can't make a 32bits 2 16bits division

oh no sorry

i wans't paying attention

well i did exactly the same thing

so you're saying that the remainder

is basicly the remainder of the second division (of the low word) ?

let's say you have F000 0000

no.. ignore me

i didn't see an instruction on that line :)

yes it works... thanks a lot Inode :)