From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/54843 Path: main.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: Scoring out of bounds Date: Wed, 19 Nov 2003 15:48:30 +0900 Organization: Emacsen advocacy group Sender: ding-owner@lists.math.uh.edu Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1069224652 26107 80.91.224.253 (19 Nov 2003 06:50:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 19 Nov 2003 06:50:52 +0000 (UTC) Cc: ding@gnus.org Original-X-From: ding-owner+M3383@lists.math.uh.edu Wed Nov 19 07:50:49 2003 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AMMAr-0008WG-00 for ; Wed, 19 Nov 2003 07:50:49 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1AMM9B-0004fI-00; Wed, 19 Nov 2003 00:49:05 -0600 Original-Received: from justine.libertine.org ([66.139.78.221] ident=postfix) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1AMM96-0004fD-00 for ding@lists.math.uh.edu; Wed, 19 Nov 2003 00:49:00 -0600 Original-Received: from washington.hostforweb.net (washington.hostforweb.net [69.61.11.2]) by justine.libertine.org (Postfix) with ESMTP id BEDAD3A0045 for ; Wed, 19 Nov 2003 00:48:59 -0600 (CST) Original-Received: from yamaoka by washington.hostforweb.net with local (Exim 4.24) id 1AMM9C-0007AY-Op; Wed, 19 Nov 2003 01:49:07 -0500 Original-To: Norbert Koch X-Face: #kKnN,xUnmKia.'[pp`;Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu;B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.4 (Reasonable Discussion, linux) Cancel-Lock: sha1:R0nMA2MLpxJHmZ70InASJrHyghA= X-Payment: hashcash 1.2 0:031119:viteno@xemacs.org:4331ef2748006948 X-Hashcash: 0:031119:viteno@xemacs.org:4331ef2748006948 X-Payment: hashcash 1.2 0:031119:ding@gnus.org:fb6978fb62f847c8 X-Hashcash: 0:031119:ding@gnus.org:fb6978fb62f847c8 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - washington.hostforweb.net X-AntiAbuse: Original Domain - gnus.org X-AntiAbuse: Originator/Caller UID/GID - [32041 32041] / [47 12] X-AntiAbuse: Sender Address Domain - washington.hostforweb.net Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:54843 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:54843 >>>>> In Katsumi Yamaoka wrote: >>>>>> In >>>>>> Norbert Koch wrote: >>> Something's pushing scores up too high (my bad), but maybe it should >>> be bound in gnus-decay-score to prevent such errors? >> Here's a possible fix >> (defun gnus-decay-score (score) >> "Decay SCORE according to `gnus-score-decay-constant' and `gnus-score-decay-scale'." [...] >> + (condition-case nil >> + (floor >> + (- score >> + (* (if (< score 0) -1 1) >> + (min (abs score) >> + (max gnus-score-decay-constant >> + (* (abs score) >> + gnus-score-decay-scale)))))) >> + (arith-error most-positive-fixnum))) > I've committed it with a slight modification[1]. Thanks. I noticed that solution does not decay a score value eternally, and replaced it in CVS with the following definition: (defun gnus-decay-score (score) "Decay SCORE according to `gnus-score-decay-constant' and `gnus-score-decay-scale'." (let ((n (- score (* (if (< score 0) -1 1) (min (abs score) (max gnus-score-decay-constant (* (abs score) gnus-score-decay-scale))))))) (if (and (featurep 'xemacs) ;; XEmacs' floor can handle only the floating point ;; number below the half of the maximum integer. (> (abs n) (/ (lsh -1 -2)))) (string-to-number (car (split-string (number-to-string n) "\\."))) (floor n)))) -- Katsumi Yamaoka