Re: Can't debug without source code.

Brian Murray <[email protected]> Wed, 22 Sep 2010 17:14:15 -0700
Newsgroups gmane.network.slrn.user
Organization Murray Twins
Message-ID <[email protected]>
On Wed, Sep 22, 2010 at 06:35:29PM -0500, J.B. Nicholson-Owens wrote:
> Brian Murray wrote:
> > I'm working on a new version of the multipart.sl macro for slrn [...]
> >
> > An added data point is that I have occasionally seen a message "Frame
> > Stack Overflow" when loading the news group however I think it
> > disappears quite quickly.  Is there some way to change this behavior and
> > is it likely related to my macro?
> 
> Without seeing your source code it's impossible for us to know.  Perhaps 
> you could attach your macro to a followup post to the list?

I was sort of wondering how I could proceed in debugging it myself but
of course I am happy to have others look at it too.

You'll find it attached.  I've also added in comment that is an example
of a subject that was not threaded.

Thanks,
-- 
Brian Murray

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
multipart.sl (text/plain, 2.4 KB)
% This macro makes use of subject_compare_hook to put multipart binary
% postings into the same thread.
% Based on a script by Jurriaan Kalkman <[email protected]>

% try to determine if two headers belong to the same multipart
% posting. Return 0 if they do, 1 if they don't
%
% we assume headers use a number in [] or in () to tell us what
% part of a multipart-posting this is.
%
% This is an example of what is not being threaded:
%
% Angel.Crew-2005-One.Life,One.Sentence.(07/21) "Angel.Crew-2005-One.Life,One.Sentence.01.Life Sentence.mp3" yEnc (1/10)


define subject_compare_hook ( subject1, subject2 )
{
variable bracket_pattern;
variable parens_pattern;
variable hyphen_image_pat;
variable bracket_matches, bracket_matches2;
variable parens_matches, parens_matches2;
variable hyphen_image_matches, hyphen_image_matches2;
variable replacement, replacement2;

bracket_pattern = "\\[[0-9]+ ?\\(?:of\\) ?/\\([0-9]+\\)\\]";
parens_pattern = "([0-9]+/[0-9]+)";
hyphen_image_pat = " ?\\([0-9]+[ -_]?\\)[0-9]+\\(.[jJ][pP][gG]\\)";

bracket_matches = string_matches(subject1, bracket_pattern, 1);
if ( bracket_matches[0] != NULL )
{
    ( subject1, ) = strreplace(subject1, bracket_matches[0], bracket_matches[1], 1);
}

parens_matches = string_matches(subject1, parens_pattern, 1);
if ( parens_matches[0] != NULL )
{
    ( subject1, ) = strreplace(subject1, parens_matches[0], "", -1);
}

hyphen_image_matches = string_matches(subject1, hyphen_image_pat, 1);
if ( hyphen_image_matches[0] != NULL )
{
    replacement = hyphen_image_matches[1] + hyphen_image_matches[2];
    ( subject1, ) = strreplace(subject1, hyphen_image_matches[0], replacement, 1);
}

bracket_matches2 = string_matches(subject2, bracket_pattern, 1);
if ( bracket_matches2[0] != NULL )
{
    ( subject2, ) = strreplace(subject2, bracket_matches2[0], bracket_matches2[1], 1);
}

parens_matches2 = string_matches(subject2, parens_pattern, 1);
if ( parens_matches2[0] != NULL )
{
    ( subject2, ) = strreplace(subject2, parens_matches2[0], "", -1);
}

hyphen_image_matches2 = string_matches(subject2, hyphen_image_pat, 1);
if ( hyphen_image_matches2[0] != NULL )
{
    replacement2 = hyphen_image_matches2[1] + hyphen_image_matches2[2];
    ( subject2, ) = strreplace(subject2, hyphen_image_matches2[0], replacement2, 1);
}

% check and see if the stripped subjects now match
if ( 0 == strcmp(subject1, subject2) )
{
    return 0;
}

% and then
   return 1;
}
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkyam9cACgkQDTAwc5ER+zWLPQCg405+nxhZaGHWOfLN5fGgUONY
gncAoJGwhM1wB2LPPyKzQ+f0Mx0Phu2K
=FtEc
-----END PGP SIGNATURE-----