Article View: alt.free.newsservers
Article #145885--
From: Jeff-Relf.Me
Date: Wed, 14 Nov 2012 09:51
Date: Wed, 14 Nov 2012 09:51
70 lines
4001 bytes
4001 bytes
ďťż<PRE><H2>
Hello, my dear fantasy audience... How are you ?
My, you look lovely tonight !
I changed most of the code that I last posted.
[ uploaded to: ⌿ <A hRef="http://Jeff-Relf.Me/X.CPP">X.CPP, Visual C++</A> ]
Now, a block of text is 5 lines ( or words, when comparing words on a line ),
not 30 characters... for a better, more sure match.
[ A blank line, for example, would match too often, too soon ]
"diff" ( text file comparison ) works like this:
You've an inner and outer loop, like this:
IncPair: if ( !*Tx.PP && !*Txâ.PP ) goto Done ;
if ( !*Txâ.PP ) {
while( *Tx.PP ) PrnB( 0, *Tx.PP++ ); goto Done ; }
if ( !*Tx.PP ) {
while( *Txâ.PP ) PrnB( 1, *Txâ.PP++ ); goto Done ; }
if ( ďźâŁ( Tx.PP, Txâ.PP ), Tx.PP = EEâ, Txâ.PP = EEââ, Match )
goto IncPair ;
Identical = 0, PPâ
Slow = Tx.PP, PPâ
Fast = Top = Txâ.PP + 1;
PPâ
Slowâ = Txâ.PP, PPâ
Fastâ = Topâ = Tx.PP + 1 ;
while( *PPâ
Slow || *PPâ
Slowâ ) {
while( *PPâ
Fast || *PPâ
Fastâ ) {
if ( *PPâ
Fast )
if ( ďźâŁ( PPâ
Slow, PPâ
Fast ) ) Shâ
Diff else PPâ
Fast++ ;
if ( *PPâ
Fastâ )
if ( ďźâŁ( PPâ
Fastâ, PPâ
Slowâ ) ) Shâ
Diff else PPâ
Fastâ++ ; }
PPâ
Slow += !!*PPâ
Slow, PPâ
Slowâ += !!*PPâ
Slowâ ;
PPâ
Fast = Top, PPâ
Fastâ = Topâ ; }
BBâ = Tx.ee, BBââ = Txâ.ee ; Shâ
Diff
Done:
Sh( L"%s%s(%s) lines.", Identical ? L"Identical ââ " : L""
, Prn( Txâ.PP - Txâ.BB + H + Tr )
, Prn( Tx.PP - Tx.BB + H + Tr )); return 1 ; }
"PPâ
Slow" and "PPâ
Slowâ" step through the outer loop,
comparing every line of the two files, from both sides,
ignoring previously reported changes.
Likewise, "PPâ
Fast" and "PPâ
Fastâ" increment the inner loop,
stepping though every line of the pair of files,
minus the bit that's already been reported on. "Shâ
Diff" reports.
At the end of each inner loop, PPâ
Slow is incremented
and PPâ
Fast goes back to the top ("Top") of the unreported portion.
Take, for example, two files, each 100 lines long;
their lines are compared 100 * 100 * 2 times.
ďźâŁ() compares two blocks of 5 lines ( or 5 Words ) each.
Changed words are highâ
lighted, not just changed lines,
via a bestâ
fit algorithm ( it's not 100% correct ).
Once blocks match, previous unmatched lines are displayed.
The topâ
most block of unmatched text is displayed first,
no matter if it's in the "left" ( older mod ) or "right" ( newer ).
Technical Details
Message-ID:
<Jeff-Relf.Me@Nov.14{1.51.AM.Seattle.2012}>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.free.newsservers.20150605.mbox.gz!num2.nntp.dca.giganews.com!num1.nntp.dca.giganews.com!number.nntp.dca.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news-out.octanews.net!indigo.octanews.net!news.glorb.com!news-spur1.glorb.com!newsread.glorb.com!.POSTED!not-for-mailReferences:
<k7i5f5$1gs$1@pcls6.std.com> <Jeff-Relf.Me@Nov.9{9.48.PM.Seattle.2012}> <k7lo68$904$1@pcls6.std.com> <Jeff-Relf.Me@Nov.10{2.16.PM.Seattle.2012}> <k7oq5j$o26$1@pcls6.std.com> <Jeff-Relf.Me@Nov.11{11.51.PM.Seattle.2012}>Show Full Headers
Complete Article Headers
Message-ID: <Jeff-Relf.Me@Nov.14{1.51.AM.Seattle.2012}>
Subject: --
Date: Wed, 14 Nov 2012 09:51:25 +0000
From: Jeff-Relf.Me <@.>
References: <k7i5f5$1gs$1@pcls6.std.com> <Jeff-Relf.Me@Nov.9{9.48.PM.Seattle.2012}> <k7lo68$904$1@pcls6.std.com> <Jeff-Relf.Me@Nov.10{2.16.PM.Seattle.2012}> <k7oq5j$o26$1@pcls6.std.com> <Jeff-Relf.Me@Nov.11{11.51.PM.Seattle.2012}>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.free.newsservers.20150605.mbox.gz!num2.nntp.dca.giganews.com!num1.nntp.dca.giganews.com!number.nntp.dca.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news-out.octanews.net!indigo.octanews.net!news.glorb.com!news-spur1.glorb.com!newsread.glorb.com!.POSTED!not-for-mail
Newsgroups: alt.free.newsservers,sci.physics,comp.os.linux.advocacy
Organization: Glorb Internet Services, http://www.glorb.com
Lines: 70
NNTP-Posting-Host: XJGH+5GM8EvggnDfgIBqtQ.813.posting.glorb.com
Content-Type: Text/HTML; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Complaints-To: abuse@glorb.com
NNTP-Posting-Date: Wed, 14 Nov 2012 09:51:25 +0000 (UTC)
User-Agent: Jeff-Relf.Me/X.TXT
X-Notice: Scanned by Mr. Bill