Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > sci.physics > #611466

I completely reWrote it, of course.

From Jeff-Relf.Me <@.>
Newsgroups comp.lang.c++, comp.os.linux.advocacy, sci.physics
Subject I completely reWrote it, of course.
Date 2017-01-03 00:46 -0800
Organization Glorb Internet Services, http://www.glorb.com
Message-ID <Jeff-Relf.Me@Jan.3--0.46A.Seattle.2017> (permalink)
References (1 earlier) <6d043fba-f4c8-45c2-aecc-63e780516fd1@googlegroups.com> <o4c7pt$ib$1@news.xmission.com> <Jeff-Relf.Me@Jan.1--11.51P.Seattle.2017> <ifte5e$kqd$e@alt.butts.pillow.biters> <o4f7ht$g4p$2@pcls7.std.com>

Cross-posted to 3 groups.

Show all headers | View raw


You ( MichaelMoroney ) wrote:
> Gee, the code from the forged Relf looks better than
> the code from the real Jeff.

No one gives a shit about the C++ code I posted,
nor should they, but it helps _me.

Since then, I completely reWrote it, of course;
I'm sure to change it again, as time goes by.

Currently, it's:

  //  ScreenShot:  http://Jeff-Relf.Me/Diff.PNG
  //  Help/Settings:  http://Jeff-Relf.Me/X.HTM

  //  Peel(), below, peels off diffs from the tops and bottoms
  //  of LeftOlder and RightNewer text files.
  //  
  //  BB is a pointer to the start of a dynamic array of lines ( pointers );
  //  EE points to the end of the array.
  //  
  //  Already, BB and EE point to "diffs" (mismatches lines).
  //   BB and  EE are from the LeftOlder file.
  //  _BB and _EE are from the RightNewer file.

  void Peel( LnA BB, LnA EE, LnA _BB, LnA _EE ) { int rv, S, _S, F, _F ;  
    LnP t, _t ;  LnA  BB_Slow, _BB_Slow, BB_Fast, _BB_Fast, EE_Slow, _EE_Slow, EE_Fast
    , _EE_Fast, Mid = BB + ( EE - BB )/2, _Mid = _BB + ( _EE - _BB )/2 ;
    TopMatch = BtmMatch = 0, BB_Slow = BB, _BB_Slow = _BB ;
    EE_Slow = EE, _EE_Slow = _EE, ReSetBB_Fast, ReSetEE_Fast ;

    Top:    if ( TopMatch ) if ( BtmMatch ) goto Done ; else goto Btm ;   
            if ( Level = BB_Fast - BB_Slow, TopFlags, TopMatch = !S && !_S ) {

               //  Done scaning the top of LeftOlder and RightNewer, no matches.
               BB_Match = 0 ;    goto Btm ;  }

            if (  F && _S ) if ( !gTopMatch( BB_Fast, EE, _BB_Slow, _EE ) )  BB_Fast++ ; else goto Btm ;
            if ( _F &&  S ) if ( !gTopMatch( BB_Slow, EE, _BB_Fast, _EE ) ) _BB_Fast++ ; else goto Btm ;

            //  Lower the top of LeftOlder and RightNewer, thus growing a pair of diffs.
            if ( TopFlags, !( F && _S || _F && S ) ) BB_Slow += S, _BB_Slow += _S, ReSetBB_Fast ;    goto Btm ;

    Btm:    if ( BtmMatch ) if ( TopMatch ) goto Done ; else goto Top ;
            if ( Level = EE_Slow - EE_Fast, BtmFlags, BtmMatch = !S && !_S ) {

               //  Done scaning the bottom of LeftOlder and RightNewer, no matches.
               EE_Match = 0 ;    goto Top ;  }

            if (  F && _S ) if ( !gBtmMatch( EE_Fast, BB, _EE_Slow, _BB ) )  EE_Fast-- ; else goto Top ;
            if ( _F &&  S ) if ( !gBtmMatch( EE_Slow, BB, _EE_Fast, _BB ) ) _EE_Fast-- ; else goto Top ;

            //  Raise the bottom of LeftOlder and RightNewer, thus growing a pair of diffs.
            if ( BtmFlags, !( F && _S || _F && S ) ) EE_Slow -= S, _EE_Slow -= _S, ReSetEE_Fast ;    goto Top ;
       
    Done:   BB_Match = BB_Match && EE_Match ? BB_Match : EE_Match ? ( _BB_Match = _EE_Match, EE_Match ) : ( _BB_Match = _EE, EE );
            EE_Match = BB_Match && EE_Match ? EE_Match : BB_Match ? ( _EE_Match = _BB_Match, BB_Match ) : ( _EE_Match = _BB, BB );  }


Near Globals:

  int  Level, TopMatch, BtmMatch ;    LnP  F, _F ;
  LnA  BBx, EEx, _BBx, _EEx, BB_Match, EE_Match, _BB_Match, _EE_Match ;

  #define TokensMatch  ( F && _F && F[-1] == _F[-1] && Eq( F, _F ) )
  #define ReSetBB_Fast  ( BB_Fast = BB_Slow, _BB_Fast = _BB_Slow )
  #define ReSetEE_Fast  ( EE_Fast = EE_Slow, _EE_Fast = _EE_Slow )

  #define  MatchDwn  ( _MatchDwn( F, PP, EE  ), _MatchDwn( _F, _PP, _EE  ), TopMatch = TokensMatch )
  #define  _MatchDwn( P, PP, EE ) ( P = ++PP >= EE ? 0 : *PP )

  #define  MatchUp  ( _MatchUp( F, PP, BB ), _MatchUp( _F, _PP, _BB  ), BtmMatch = TokensMatch )
  #define  _MatchUp( P, PP, BB )  ( P = --PP <  BB ? 0 : *PP )

  int gTopMatch( LnA PP, LnA EE, LnA _PP, LnA _EE ) { BB_Match = PP, _BB_Match = _PP, PP--, _PP-- ;

    //  For nearby comparisons, One Match ( not counting blank lines ) is good;
    //  more matches are needed when "zooming out" hundreds of lines.
    Loop( 1 + Level/99 ) eJ += !MatchDwn ? -eJ : !*F ;    return TopMatch ;   }

  int gBtmMatch( LnA PP, LnA BB, LnA _PP, LnA _BB ) { EE_Match = PP, _EE_Match = _PP ;  
     Loop( 1 + Level/99 ) eJ += !MatchUp ? -eJ : !*F ;   return BtmMatch ;   }

  Pinch( LnA BB, LnA EE, LnA _BB, LnA _EE ) { 
    LnA PP = BB - 1, _PP = _BB - 1 ;  while ( MatchDwn );
    BBx = BB = PP, _BBx = _BB = _PP, PP = EE, _PP = _EE ;
    while ( MatchUp );  EEx = ++PP, _EEx = ++_PP ;  }

  #define TopFlags  ( S =  BB_Slow <= Mid, _S = _BB_Slow <= _Mid, F = BB_Fast <= Mid, _F = _BB_Fast <= _Mid )
  #define BtmFlags  ( S =  EE_Slow >= Mid, _S = _EE_Slow >= _Mid, F = EE_Fast >= Mid, _F = _EE_Fast >= _Mid )

Far Globals:

  #define   Loop( N )  int  eJ = ( N ) - 1, J = -1 ; while ( ++J <= eJ )

  typedef wchar_t  wchar ;  typedef wchar  *LnP ;  typedef  LnP  *LnA ;

Back to sci.physics | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

#define came from God himself, it's sacred. Jeff-Relf.Me <@.> - 2017-01-01 23:51 -0800
  #define came from God himself, it's sacred. Jeff-Relf.Me <@..yep> - 2017-01-02 08:00 +0000
    Re: #define came from God himself, it's sacred. moroney@world.std.spaamtrap.com (Michael Moroney) - 2017-01-03 03:58 +0000
      I completely reWrote it, of course. Jeff-Relf.Me <@.> - 2017-01-03 00:46 -0800
        I completely reWrote it, of course. Jeff-Relf.Me <@..sour> - 2017-01-03 08:51 +0000
          Re: I completely reWrote it, of course. Double-A <double-a3@hush.com> - 2017-01-05 16:12 -0800
        Re: I completely reWrote it, of course. Peter Köhlmann <peter-koehlmann@t-online.de> - 2017-01-03 12:13 +0100
          Re: I completely reWrote it, of course. Melzzzzz <mel@zzzzz.com> - 2017-01-03 12:28 +0100
          Re: I completely reWrote it, of course. chrisv <chrisv@nospam.invalid> - 2017-01-03 07:32 -0600
            Ezekiel lives in your head RENT FREE!!  LOL!!! GreyCloud <mist@cumulus.com> - 2017-01-03 12:16 -0700
            With "warnings as errors", turn off these warnings. Jeff-Relf.Me <@.> - 2017-01-03 13:00 -0800
          Re: I completely reWrote it, of course. GreyCloud <mist@cumulus.com> - 2017-01-03 12:16 -0700
            Re: I completely reWrote it, of course. red floyd <dont.bother@its.invalid> - 2017-01-03 12:30 -0800
              If you're retarded then, yes, _Loop() is "undefined". Jeff-Relf.Me <@.> - 2017-01-16 11:06 -0800
            Re: I completely reWrote it, of course. scott@slp53.sl.home (Scott Lurndal) - 2017-01-04 13:33 +0000
              Re: I completely reWrote it, of course. chrisv <chrisv@nospam.invalid> - 2017-01-04 07:45 -0600
                Re: I completely reWrote it, of course. scott@slp53.sl.home (Scott Lurndal) - 2017-01-04 14:54 +0000
                The Longest Common Sequence ( NonContiguous ) algorithm ( recursive ). Jeff-Relf.Me <@.> - 2017-01-04 10:17 -0800
                Re: The Longest Common Sequence ( NonContiguous ) algorithm ( recursive ). Peter Köhlmann <peter-koehlmann@t-online.de> - 2017-01-04 19:19 +0100
                Re: The Longest Common Sequence ( NonContiguous ) algorithm ( recursive ). noTthaTguY <abu.kuanysh05@gmail.com> - 2017-01-04 16:33 -0800
                Re: The Longest Common Sequence ( NonContiguous ) algorithm ( recursive ). noTthaTguY <abu.kuanysh05@gmail.com> - 2017-01-09 16:23 -0800
                Re: The Longest Common Sequence ( NonContiguous ) algorithm ( recursive ). moroney@world.std.spaamtrap.com (Michael Moroney) - 2017-01-05 03:34 +0000
                The Longest Common Sequence ( NonContiguous ) algorithm ( recursive ). Jeff-Relf.Me <@.> - 2017-01-04 22:26 -0800
                Re: The Longest Common Sequence ( NonContiguous ) algorithm ( recursive ). Anonymous <anonymous@invalid.tld> - 2017-01-05 08:18 +0000
                Re: The Longest Common Sequence ( NonContiguous ) algorithm ( recursive ). Peter Köhlmann <peter-koehlmann@t-online.de> - 2017-01-05 09:24 +0100
                PostScript is my thing. Jeff-Relf.Me <@.> - 2017-01-05 01:08 -0800
                My diffs now _perfectly match MicroSoft's WinMerge. Jeff-Relf.Me <@.> - 2017-01-07 03:56 -0800
                Re: My diffs now _perfectly match MicroSoft's WinMerge. Peter Köhlmann <peter-koehlmann@t-online.de> - 2017-01-07 13:09 +0100
                Re: My diffs now _perfectly match MicroSoft's WinMerge. moroney@world.std.spaamtrap.com (Michael Moroney) - 2017-01-07 20:25 +0000
                Like a compiler that compiles itself, my Diff app diffs itself. Jeff-Relf.Me <@.> - 2017-01-07 17:53 -0800
                Re: My diffs now _perfectly match MicroSoft's WinMerge. Christian Gollwitzer <auriocus@gmx.de> - 2017-01-10 22:15 +0100
                Text file comparison is essential. Jeff-Relf.Me <@.> - 2017-01-16 11:23 -0800
                Re: Text file comparison is essential. noTthaTguY <abu.kuanysh05@gmail.com> - 2017-01-17 11:22 -0800
                Nothing to compare, left and right, old and new. Jeff-Relf.Me <@.> - 2017-01-19 04:12 -0800
                Re: The Longest Common Sequence ( NonContiguous ) algorithm ( recursive ). jmfbahciv <See.above@aol.com> - 2017-01-05 14:08 +0000
                Re: The Longest Common Sequence ( NonContiguous ) algorithm ( recursive ). Vir Campestris <vir.campestris@invalid.invalid> - 2017-01-05 21:09 +0000
                Re: The Longest Common Sequence ( NonContiguous ) algorithm ( recursive ). legalize+jeeves@mail.xmission.com (Richard) - 2017-01-05 21:19 +0000
                "Functional" programming is "Tree Crawling". Jeff-Relf.Me <@.> - 2017-01-05 14:53 -0800
                Re: The Longest Common Sequence ( NonContiguous ) algorithm ( recursive ). Lofty Goat <rlwatkins@gmail.com> - 2017-01-05 17:43 -0600
                Re: I completely reWrote it, of course. jmfbahciv <See.above@aol.com> - 2017-01-05 14:08 +0000
            What about you, GreyCloud ? Jeff-Relf.Me <@.> - 2017-01-16 11:02 -0800
              Re: What about you, GreyCloud ? GreyCloud <mist@cumulus.com> - 2017-01-16 19:46 -0700
                Health issues ? Jeff-Relf.Me <@.> - 2017-01-16 20:39 -0800
                Re: Health issues ? GreyCloud <mist@cumulus.com> - 2017-01-17 11:50 -0700
                Re: Health issues ? noTthaTguY <abu.kuanysh05@gmail.com> - 2017-01-17 14:19 -0800
                Re: Health issues ? noTthaTguY <abu.kuanysh05@gmail.com> - 2017-01-17 18:44 -0800
                Negative Interest Rates. Jeff-Relf.Me <@.> - 2017-01-19 04:25 -0800
                Re: Negative Interest Rates. GreyCloud <mist@cumulus.com> - 2017-01-19 11:47 -0700
                Negative Interest Rates "rips off" rich people, not the poor. Jeff-Relf.Me <@.> - 2017-01-19 19:23 -0800
                Re: Negative Interest Rates "rips off" rich people, not the poor. GreyCloud <mist@cumulus.com> - 2017-01-20 16:17 -0700
              Tons of people have reviewed the code, source and object. Jeff-Relf.Me <@.> - 2017-01-19 04:02 -0800
              Building a complex system can't be done when you're drunk and horny. Jeff-Relf.Me <@.> - 2017-01-19 04:17 -0800
                Re: Building a complex system can't be done when you're drunk and horny. David Brown <david.brown@hesbynett.no> - 2017-01-19 13:59 +0100
                No one is here to learn at your feet, sorry. Jeff-Relf.Me <@.> - 2017-01-19 05:30 -0800
                Re: Building a complex system can't be done when you're drunk and horny. chrisv <chrisv@nospam.invalid> - 2017-01-19 07:37 -0600
                Building a complex system can't be done when you're drunk and horny. Jeff-Relf.Me <@.> - 2017-01-19 05:43 -0800
                Re: Building a complex system can't be done when you're drunk and horny. noTthaTguY <abu.kuanysh05@gmail.com> - 2017-01-19 10:06 -0800
                Re: Building a complex system can't be done when you're drunk and horny. moroney@world.std.spaamtrap.com (Michael Moroney) - 2017-01-20 04:32 +0000
                Usenet isn't WikiPedia; here, it's all play and no work, anything goes. Jeff-Relf.Me <@.> - 2017-01-19 21:02 -0800
                yeah, you can always prefer your preferred header noTthaTguY <abu.kuanysh05@gmail.com> - 2017-01-19 21:22 -0800
        The "Least Longest" diffs. Jeff-Relf.Me <@.> - 2017-01-03 03:04 -0800

csiph-web