🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: demon.ip.developers
Article #128

Re: Newshistory checking

#128
From: stefan the exiled
Date: Tue, 13 Jul 1999 00:00
44 lines
2606 bytes
>>>>> "Terrance" == Terrance Richard Boyes <tez@pierrot.co.uk> wrote:

   Terrance> I'm looking for an efficient way to check for duplicate
   Terrance> Message-IDs in a large NewsHistory file against the
   Terrance> output of NEWNEWS (or XOVER after extracting the
   Terrance> Message-ID).

[...]

   Terrance> Any thoughts on the best way to do it in C ?

I can tell you the way *I* did it in C, which is probably far from the
best way...

Essentially just set up an ordered list and insert message-id's in it
as they come out of NEWNEWS or XHDR. You could experiment with various
ways of quickly finding the right place to insert (I don't think I
bothered with much more than a binary chop) and if it's already there
drop it.

It doesn't seem that slow in practice (at least not compared with the
speed at which the message-id's come in anyway), although I haven't
done any benchmarking with large numbers of message-ids (only a few
hundred or so at a time). Some who actually knows about efficiency of
algorithms is welcome to tell me this sucks :-)

Of course another way that might be easier, depending on what you're
going to do with the articles, is not bother with deduping at all but
do an explicit CHECK on the message-id before downloading it, and then
download and throw it at the local newsserver with TAKETHIS if the
initial reply code was positive.

There's also the various database libraries that I guess would work
for this purpose.

   Terrance> NB a pointer to some source what I want will do just as
   Terrance> well as a detailed answer ;)

Presumably suck has to do this (at least it claims to explicitly
dedupe last time I used it). Probably worth a look anyway.

http://home.att.net/~bobyetman/index.html

Stefan
Technical Details
Message-ID: <m3908kgtjk.meow@hopf.demon.co.uk>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <19990713.200500.0AA80202.PEaa@pierrot.co.uk>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10bb05,75d5f9974c0fd91a
X-Google-Attributes: gid10bb05,public
From: stefan the exiled <smd@hopf.demon.co.uk>
Subject: Re: Newshistory checking
Date: 1999/07/13
Message-ID: <m3908kgtjk.meow@hopf.demon.co.uk>
X-Deja-AN: 500667073
References: <19990713.200500.0AA80202.PEaa@pierrot.co.uk>
X-GPG: http://www.hopf.demon.co.uk/smd-gpg.asc
Mail-Copies-To: never
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: usenet@hopf.demon.co.uk
X-Exiled-For: 1 month and 16 days 
Organization: TINO
X-URL: http://www.hopf.demon.co.uk
X-Censored-by-Laurence-Godfrey: Yes!
X-Attribution: SMD
User-Agent: Gnus/5.070095 (Pterodactyl Gnus v0.95) Emacs/20.3
Mime-Version: 1.0
NNTP-Posting-Date: 13 Jul 1999 20:54:07 GMT
Newsgroups: demon.ip.developers