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


Groups > comp.lang.python > #49661

Re: how to calculate reputation

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <kasturisurya@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'true,': 0.05; '(its': 0.09; 'false,': 0.09; 'logic': 0.09; 'null,': 0.09; 'cc:addr :python-list': 0.11; '11:59': 0.16; 'bool': 0.16; 'here..': 0.16; 'jumping': 0.16; 'sorting': 0.16; 'all.': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'users.': 0.18; 'all,': 0.19; 'seems': 0.21; 'cc:addr:python.org': 0.22; 'lets': 0.24; 'initial': 0.24; 'math': 0.24; 'question': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'values': 0.27; 'header:In- Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'didnt': 0.31; 'anyone': 0.31; 'quite': 0.32; 'url:python': 0.33; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'crazy': 0.36; 'false': 0.36; 'url:listinfo': 0.36; 'thanks': 0.36; 'url:org': 0.36; 'should': 0.36; 'so,': 0.37; 'list': 0.37; 'pm,': 0.38; 'anything': 0.39; 'explain': 0.39; 'skip:& 20': 0.39; 'users': 0.40; 'url:mail': 0.40; 'algorithms': 0.60; 'simple': 0.61; 'total': 0.65; 'jul': 0.74; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=VmE0fLBEFNPgRINoG++lylzpZ0Z8jYW2UpmfvZAdqEk=; b=Q/1hoMpaPRhLA8couMSBbSyfUgGWdIULohWCWcKyFomAdP4l78JJcoNuH3dv+g8QkQ ZnzR435ro1JU1F3izGyWbHnUHOlQXI+YTXNTSmK7cSSq70mpFIthERid2K26HFU2e4mW VWBTNFmAabwvmBHQ6OsBwgBbccbiLW9EJs7yYfu0JcxkZMGkFx8C1UTOtmKnbgzYmRP2 Ut2CMrtH9QmNwXgGmGjZHDMBIf5r8R1RGMw52qHameWTixQTi5NNR+uP9rJL1bVMuhK7 M0gQBS7HF8P/+tGcL75aqebU07RsMX+cL7+3o1eWCzNEsv5owghZZW2jvNXSh/8pte/d Vtmw==
X-Received by 10.182.87.170 with SMTP id az10mr14521702obb.10.1372803617205; Tue, 02 Jul 2013 15:20:17 -0700 (PDT)
MIME-Version 1.0
Sender kasturisurya@gmail.com
In-Reply-To <T2IAt.5266$Jk4.4110@newsfe09.iad>
References <mailman.4127.1372801460.3114.python-list@python.org> <T2IAt.5266$Jk4.4110@newsfe09.iad>
From Surya Kasturi <suryak@ieee.org>
Date Wed, 3 Jul 2013 00:19:57 +0200
X-Google-Sender-Auth sAoHW4lRkJhUzTzcdljdQb7Rv4s
Subject Re: how to calculate reputation
To Tobiah <toby@tobiah.org>
Content-Type multipart/alternative; boundary=089e0111bcfaf383ab04e08ebf29
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.4130.1372803626.3114.python-list@python.org> (permalink)
Lines 149
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1372803626 news.xs4all.nl 15924 [2001:888:2000:d::a6]:33916
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:49661

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On Tue, Jul 2, 2013 at 11:59 PM, Tobiah <toby@tobiah.org> wrote:

> On 07/02/2013 02:43 PM, Surya Kasturi wrote:
>
>> Hi all, this seems to be quite stupid question but I am "confused"..
>> We set the initial value to 0, +1 for up-vote and -1 for down-vote! nice.
>>
>> I have a list of bool values True, False (True for up vote, False for
>> down-vote).. submitted by users.
>>
>> [True, False, False, True....]
>>
>> Now to calculate the total reputation
>>
>> should I take True = +1, False=0  [or] True = +1, False=-1 ?? for adding
>> all.
>>
>> I am missing something here.. and that's clear.. anyone please help me on
>> it?
>>
>> Thanks
>>
>>
>>
>>
> for vote in bool_votes:
>
>         reputation += 2 * vote - 1
>
>
> Tobiah
> --
> http://mail.python.org/**mailman/listinfo/python-list<http://mail.python.org/mailman/listinfo/python-list>
>


I think I didnt explain it clearly.. let me make it clear..

1. The database we are using is having BooleanField for it!! so, cant do
anything
2. I am not looking for sorting algorithms .. just simple math :) It sounds
crazy but let me describe my confusion

lets have 3 users with

[null, null, null]
reputation = 0

[T, - - ]
rept = 1

[T T T]
rept = 3

[T T F]
rept = 1 (its jumping from 3 to 1 -->but generally, we observe only
decrease in 1 right?)

[T T F]
rept = 3 (its jumping from 1 to 3)

These jumpings are common? or my logic is going any wrong?

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

how to calculate reputation Surya Kasturi <suryak@ieee.org> - 2013-07-02 23:43 +0200
  Re: how to calculate reputation Tobiah <toby@tobiah.org> - 2013-07-02 14:59 -0700
    Re: how to calculate reputation Surya Kasturi <suryak@ieee.org> - 2013-07-03 00:19 +0200
    Re: how to calculate reputation Ian Kelly <ian.g.kelly@gmail.com> - 2013-07-02 16:29 -0600
    Re: how to calculate reputation Joshua Landau <joshua.landau.ws@gmail.com> - 2013-07-02 23:27 +0100
  Re: how to calculate reputation Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-07-03 00:18 +0000
    Re: how to calculate reputation Chris Angelico <rosuav@gmail.com> - 2013-07-03 10:26 +1000

csiph-web