🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #232915

Peter Ross' attribution line should have whatever comes after “ From: ”.

#232915
From: _
Date: Wed, 29 Apr 2009 04:17
118 lines
6253 bytes
Peter Ross' attribution line should have whatever comes after “ From: ”.
That's the fix, the fix he failed to mention to JED.

I often write “ regular expressions ”, including inside code.
Visual C++ solutions can be, and usually are,
more powerful than the regEx you're confined to.

How can you, Mr. »Q«, honestly claim that I 
“ don't know what Visual C++ is ” ?

>From my “ www.JeffRelf.F-M.FM/X.CPP ”,
here's a sample of some VC++ code I recently changed to add
a “ StaticRank ” ( instead of xRank ) to sort “ watched ” nyms.

“ StaticRank ” was added so that a nym's “ watched ” status,
as specified by the X.ZIP user, no longer biases a nyms xRank.
I did this so I could report-out pure xRanks, unBiased by the user.

“ Sort by thread ” is lame, I assert; better to 
list posts from least-watched to most-watched, grouped by nym.
For that, each post has:

  A. The catagory it's in, “ Top·0, Middle·1, Bottom·2 ”.
     “ Top ” has replies to the user,
     “ Bottom ” has posts the user made “ ― the rest are in “ Middle ”.

  B. Information about the nym that made the post, to wit:

     1. His count of unRead posts, “ cnt·unReads ”.
     2. His “ StaticRank ”: a higher number puts him higher in the list.

     3. His xRank ( a 64 bit float ), based on who replied to him.
     4. How long ago he last posted, “ ageYoungest ”.
        ( There's also an ageOldest, used for reporting, not sorting )
     
  C. How old the post is, “ AgeDays ” ( a 32 bit float ).
  
  D. A boolean, to know if the post was read or not, “ wasRead ”.
     ( “ nonWatched ” nyms are muffled, so that no more than
       the 3 most-recent are marked as “ unRead ”.
       No nym has more than 30 “ wasRead ” posts, not even mine. )

//  Posts are to be listed from least-watched to most-watched,
//  grouped by nym. Lower numbers ( e.g. larger negative numbers )
//  come first, at the top of the list.

//  “ Case ” is the post that's being scored;
//  “ Vs ” is the post  Case  is being compared against.
inline double Cmp( LsP  Case, LsP  Vs ) {

  //  There are 3 Catagories ( Cat ): “ Top·0, Middle·1, Bottom·2 ”.
  //  “ Top ” has replies to me, “ Bottom ” has posts I made;
  //  the rest are in “ Middle ”.
  if ( Case->Cat != Vs->Cat )
    //  “ Case ” goes up the list ( e.g. has a larger negative number )
    //  when “ Vs ” has a higher “ Cat ”.
    return  Case->Cat - Vs->Cat ;
    
  NymT & caseNym = * Case->Nym, & vsNym = * Vs->Nym ;
  if ( Case->Cat == Cat_Mid && & caseNym != & vsNym ) {
    //  Both Case and Vs are in Cat_Mid and
    //  they don't have the same nym.
    
    if ( !vsNym.cnt·unReads != !caseNym.cnt·unReads )
      //  Case goes up the list when
      //  caseNym has unReads and vsNym doesn't.
      return  !caseNym.cnt·unReads - !vsNym.cnt·unReads ;

    if ( caseNym.StaticRank != vsNym.StaticRank )

      //  Case goes up the list when caseNym has a higher StaticRank.
      return  vsNym.StaticRank - caseNym.StaticRank ;

    if ( caseNym.xRank == vsNym.xRank )

      //  caseNym and vsNym have the same xRank.
      //  Case goes up the list when vsNym hasn't posted as recently.
    
      //  This groups posts by nym because
      //  no two nyms have the same xRank  And  the same ageYoungest.
      //  ageYoungest is a float with a one second resolution.
      return  caseNym.ageYoungest - vsNym.ageYoungest ;
      
    //  Case goes up when caseNym has a higher xRank.
    return  vsNym.xRank - caseNym.xRank ;
  }
  
  if ( Case->Cat == Cat_Bot )

    //  Case and Vs are in Cat_Bot ( i.e. they're posts I've made ).
    //  Sort by oldest first,
    //  so my most recent post is at the very bottom.

    //  Case goes up when it's older.
    return Vs->AgeDays - Case->AgeDays ;
    
  //  Case and Vs either “ have the same nym and are in Cat_Mid ”
  //  or they're both in Cat_Top, possibly with differnt nyms.

  if ( Case->wasRead != Vs->wasRead )

    //  Both posts are in Cat_Mid, with the same nym, because 
    //  Cat_Top has no wasRead posts.
    //  Case goes up when it's unRead and Vs isn't.
    return  Case->wasRead - Vs->wasRead ;
    
  //  Sort by youngest first, Case goes up when Vs is older.
  return  Case->AgeDays - Vs->AgeDays ;  }

//  “ Quick Sorts ” posts using Cmp() ( above ).
PostsByMostWatched( LsA _B,  LsA _E ) {  if ( _E <= _B ) return;
  LsA  BB = _B - 1, EE = _E + 1 ;  LsP  Std = _B [ ( _E - _B ) / 2 ] ;
  LOOP {
    while ( Cmp( * ++ BB , Std ) < 0. );
    while ( EE >= BB && Cmp( * -- EE , Std ) > 0. );
    if ( EE <= BB ) break;  LsP T = * BB ; * BB = * EE ; * EE = T ;  }
  PostsByMostWatched( _B, EE < _E ? EE : -- EE );  
  PostsByMostWatched( EE + 1, _E ); }
Technical Details
Message-ID: <_@Jeff_Relf.Seattle.2009_Apr28.9.17pm.Md>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!pfeed09.wxs.nl!newsfeed.kpn.net!pfeed08.wxs.nl!news.glorb.com!news2.glorb.com!news-spur2.glorb.com!homer.glorb.com!not-for-mail
References: <gt1vdb$2mk$1@news.eternal-september.org> <20090427085717.239@skamandros.andrews-corner.org> <_@Jeff_Relf.Seattle.2009_Apr26.6.33pm.DU> <slrngvepd7.2o7.pjr@pjr.gotdns.org> <_@Jeff_Relf.Seattle.2009_Apr28.6.22pm.Ci> <20090428211453.52d40245@bellgrove.remarqs.net>

Show Full Headers
Complete Article Headers
Message-ID: <_@Jeff_Relf.Seattle.2009_Apr28.9.17pm.Md>
Subject: Peter Ross' attribution line should have whatever comes after “ From: ”.
Date: Wed, 29 Apr 2009 04:17:25 +0000
From: _@Jeff_Relf.Seattle.inValid
References: <gt1vdb$2mk$1@news.eternal-september.org> <20090427085717.239@skamandros.andrews-corner.org> <_@Jeff_Relf.Seattle.2009_Apr26.6.33pm.DU> <slrngvepd7.2o7.pjr@pjr.gotdns.org> <_@Jeff_Relf.Seattle.2009_Apr28.6.22pm.Ci> <20090428211453.52d40245@bellgrove.remarqs.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!pfeed09.wxs.nl!newsfeed.kpn.net!pfeed08.wxs.nl!news.glorb.com!news2.glorb.com!news-spur2.glorb.com!homer.glorb.com!not-for-mail
Newsgroups: news.software.readers
Organization: Glorb Internet Services, http://www.glorb.com
Lines: 118
NNTP-Posting-Host: rHkC8ilpik+gnC7s6RDDMg.user.posting2.glorb.com
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Complaints-To: abuse@glorb.com
NNTP-Posting-Date: Wed, 29 Apr 2009 04:17:25 +0000 (UTC)
X-Notice: Scanned by Mr. Bill
User-Agent: JeffRelf.F-M.FM/X.ZIP