If I go your recommend hashing route good idea to use one of the GNU libs

#awk [miles]

hi igi
even

hehe hi
use awk it’ll be done a lot quicker
and it’ll be fast too

[miles]: use some other structure.

ah, is it? I don’t think so. It is obviously what he has to do instead of asking for line numbers if I hint him to a context

yes hnaz it is

thanks for your verbose reasoning on it. Have a nice day

yw bye!

the core loop I’ve written is fast… Im just at the point now where I need to insert a found tag to a seperate list, and also write the code to check if the tag found is already in the list

http://pastebin.com/m3c6162d
any ideas?

in what waay do you mean?

yeah it’s called an associative array [miles]

it just keeps hanging, never reaching line 70 (the n++)

or a hashtable i guess

ok, I’ll google a bit for that
thank you

http://burtleburtle.net/bob/hash/evahash.html is the best hash function i’ve found [miles]

http://sourceforge.net/projects/judy/

tie it into a hashtable

just found that

nice

n gets never incremented if tmpInt%primes[n] == 0

a hashtable isn’t hard to implement tho

hnaz, yes; it worked before i ported it to ansi C
i left the algo as it is; should work fine, dunno why not
hnaz, tmpint is changed if tmpInt%primes[n] == 0
so it should work i the next loop

the check in line 65 is too late

or at least after a finite amount of loops
hnaz, it is old
doesn’t matter, primes[n] can never be 0

if primes[n] is 0, the program will abort

the while above takes care of that
hnaz, it doesn’t
it just sits there
never reaching line 70
it must have something to do with the datatypes or so
but algo works without all the amendements to get it to compile as -ansi -pedantic

infinite loop

where is the problem?

that it should be true after a finite amount of loops
hnaz, you do realize that tmpInt is changed inside that if, do you?

hmm

if i coment out the printf
output is:tmpInt: 0, primes[n]: 2
0, primes[n]: 2
tho

you might want to run it through gdb?
oops

nice Ubuntu ships with that libjudy

why shouldnt it even suse does

did’nt know of judy until now

holy shit

don’t worry .)

sorry hnaz
seems i dropped a line
thx tho

so… mmm this libjudy is known

[miles]: so are hashtables and if you want to learn C, coding one is essential imnsho

I know about hashtables
but for what im doing atm, speed is of the essence.. so if this judy is fast and flexiable… (thank god im refering to a lib not a woman), perfect

hehe

heh

[miles]: go, read the source and enjoy yourself

jeje
http://judy.sourceforge.net/downloads/10minutes.htm
just looking at that

interesting

I wonder if this is a little bloated for my needs
I just need something similar to gdbm but using memory

”man gdbm”

hi there

hi

whats the difference between a non-external and an external function?

eh?
it’s all file based no?

[miles]: if that doesn’t do it, just implement a hashtable yrself or use #awk

my key is a string, the queueid from sendmail logs… and the data, is a binary blob
just need insert, search, delete

I have 1million on avg. lines of text I have to parse thru. I a fast method where I can extract (done) certain tags, and add them to a list. In the line by line parsing, I have to check in the list if the tag is there.

also, you can create in-memory filesystems.
leveraging the gdbm library, and your operating system, saving the time to come up with an algorithm/data structure for this (if that is worthwhile).

mmm
interesting
ok, so there a few options

!cruft

something is actually stearing me in the direction of hashing
If I go your recommend hashing route… good idea to use one of the GNU libs?

meh

like create an md5

do what you want; i recommended awk

lol

i wouldn’t use gdbm at all, rather i’d use dbm.

id use twkmver2000

lol
can you recommend a hashing algorithm to use on the queueid’s please?
md5 an overkill?

i doubt i’d hash it.

mmm spose if I treat it as binary, not text.. and do a binary search

depends which is most critical, insert time or search time.

search
definatly

hash if you need a fast search but can accept a slow insert, btree if too slow an insert is unacceptable.
write it several ways, the interface doesn’t really change if you use bdb.

it’s got to keep track of the queueid … so if a mail comes in, it’s queueid gets inserted, and each line read from the logs, the queueid needs to be checked if it’s allready been found
when the message gets delivered, the queueid would be removed from the list

sup people
i need help with something… ?\
someone ?

noone is here, come back later

oh great, new guy thinking he is the guy.

You might have more luck if you just ask the question.

oh that’s good too

i dont have a question im just trying to impress and slovaqui girl
say hello

HELLO CARTUCHO!!!
what’s your question

i dont have one.

hmm

welp,
you’ve dissapointed a lot of nerds

and one kitten

they were hoping some kind of discussion about the superiroity of BSD style indentation

BSD style indention is better :P

it’s freer

heh
it’s ligther

what it BSD style indention )

i disappointed who?

lol

BSD style goes like this
for (*;*;*)
{
[tab]mycode
}
it is cool.

yuck

*
To prove that you're not a bot, enter this code
Anti-Spam Image

Comments are closed.