Re: Can't debug without source code.
Brian Murray <[email protected]> Mon, 4 Oct 2010 09:28:15 -0700
| Newsgroups | gmane.network.slrn.user |
|---|---|
| Organization | Murray Twins |
| Message-ID | <[email protected]> |
On Fri, Sep 24, 2010 at 12:56:59PM -0400, John E. Davis wrote: > Brian Murray <[email protected]> wrote: > > 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. > > One of the things that I would like to do is to add support for the > sldb debugger to slrn. I believe that it can be accomplished without > too much effort. > > > You'll find it attached. I've also added in comment that is an example > > of a subject that was not threaded. > > 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]\\)"; > > Are these slang regular expressions? I suspect that > bracket_pattern is trying to match strings such as > > "[17 of 89]" > "[17/89]" > > If so, then bracket_pattern will not work when interpreted as a > slang RE. You might want to use the onigurama or pcre modules for > more powerful REs. Alternatively, you can try: > > bracket_pattern = "\[[0-9]+ ?[o/]f? ?\([0-9]+\)\]"R; > > The above pattern will match > > "[17 of 89]" > "[17/89]" > > as well as the false positives: > > "[17 /f89]" > "[17o89]" > > It looks like you also want to match the forms using "(". If so, > use: > > bracket_pattern = "[[(][0-9]+ ?[o/]f? ?\([0-9]+\)[])]"R; > > > bracket_matches = string_matches(subject1, bracket_pattern, 1); > > if ( bracket_matches[0] != NULL ) > > The above works only because upon failure, bracket_matches will be > NULL, which is a scalar that will be interpreted in the above context > as an array with a single element. It is better to simply use > > if (bracket_matches != NULL) ... > > >{ > > ( subject1, ) = strreplace(subject1, bracket_matches[0], bracket_matches[1], 1); > > Here, you are replacing 1 occurance of bracket_matches[0] in > subject1 with bracket_matches[1]. So you are replacing the entire > string of characters matched by bracket_pattern with the characters > matched by the "?:of" bit of the pattern. Since "?:of" looks a bit > odd I suspect that you are not using a slang RE. > > [...] > > % check and see if the stripped subjects now match > > if ( 0 == strcmp(subject1, subject2) ) > > You can also use: > > if (subject1 == subject2) > > I hope this helps. Yes, it did some. Debugging this further the issue occurs with subjects that have 2 sets of ([0-9]+/[0-9]+) in them. Consider the following subjects: Austro.Pop.Show-2006-Zehn.(10/52) 'Austro.Pop.Show-2006-Zehn - 105 - Rainhard Fendrich - Schickeria.mp3' yEnc (22/23) Austro.Pop.Show-2006-Zehn.(10/52) 'Austro.Pop.Show-2006-Zehn - 105 - Rainhard Fendrich - Schickeria.mp3' yEnc (23/23) Because I am matching on the 10/52 section and stripping that out the rest of the section won't match. What I really want is to be able to pass string_match a -1 so the string is scanned from the end not the front. I've also tried using pcre and pcre_matches and that seems to only return the first match not multiple matches. pcre_parens = pcre_compile("\\(\\d+/\\d+\\)"); slsh> pcre_matches(pcre_parens, subject1); String_Type[1] slsh> pcre_matches(pcre_parens, subject1)[0]; (10/52) Any ideas are extremely welcome. Thanks, -- Brian Murray ------------------------------------------------------------------------------ Virtualization is moving to the mainstream and overtaking non-virtualized environment for deploying applications. Does it make network security easier or more difficult to achieve? Read this whitepaper to separate the two and get a better understanding. http://p.sf.net/sfu/hp-phase2-d2d
signature.asc
(application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAkyqAJ8ACgkQDTAwc5ER+zXzrACgoEqVUkGQWMtdXQFxhsLytZiq yZMAn1g5rLarpzqAkJU5+6vZ213YArlo =u4B0 -----END PGP SIGNATURE-----