On Jun 6, 2:25 am, "Rüdiger Werner" <[EMAIL PROTECTED]> wrote:
> "BEES INC" <[EMAIL PROTECTED]> schrieb im Newsbeitragnews:[EMAIL PROTECTED]
> ...
>
> Problem: Star Ratings
>
> People can rate cheeseburgers on my website with a star rating of 0-5
> stars (whole stars only), 5 being mighty tasty a
"BEES INC" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
...
Problem: Star Ratings
People can rate cheeseburgers on my website with a star rating of 0-5
stars (whole stars only), 5 being mighty tasty and 0 being disgusting.
I would like to show the average of everyone's rati
On Jun 4, 9:03 am, "BEES INC" <[EMAIL PROTECTED]> wrote:
> I've been awfully busy programming lately. My Django-based side
> project is coming along well and I hope to have it ready for use in a
> few weeks. Please don't ask more about it, that's really all I can say
> for now. Anyways, I came acro
On Wed, Jun 4, 2008 at 11:03 AM, BEES INC <[EMAIL PROTECTED]> wrote:
> My Solution (in Python):
>
> # round to one decimal place and
> # separate into whole and fractional parts
> parts = str(round(star_sum/num_raters, 1)).split('.')
> whole = int(parts[0])
> frac = int(parts[1])
> if frac < 3:
>
BEES INC wrote:
I've been awfully busy programming lately. My Django-based side
project is coming along well and I hope to have it ready for use in a
few weeks. Please don't ask more about it, that's really all I can say
for now. Anyways, I came across an interesting little math problem
today and
On Thu, Jun 5, 2008 at 11:52 AM, Chuckk Hubbard
<[EMAIL PROTECTED]> wrote:
> On Wed, Jun 4, 2008 at 11:03 AM, BEES INC <[EMAIL PROTECTED]> wrote:
>
>> My Solution (in Python):
>>
>> # round to one decimal place and
>> # separate into whole and fractional parts
>> parts = str(round(star_sum/num_rate
On Jun 4, 9:03 am, "BEES INC" <[EMAIL PROTECTED]> wrote:
> I've been awfully busy programming lately. My Django-based side
> project is coming along well and I hope to have it ready for use in a
> few weeks. Please don't ask more about it, that's really all I can say
> for now. Anyways, I came acro
BEES INC wrote:
I've been awfully busy programming lately. My Django-based side
project is coming along well and I hope to have it ready for use in a
few weeks. Please don't ask more about it, that's really all I can say
for now. Anyways, I came across an interesting little math problem
today and
I've been awfully busy programming lately. My Django-based side
project is coming along well and I hope to have it ready for use in a
few weeks. Please don't ask more about it, that's really all I can say
for now. Anyways, I came across an interesting little math problem
today and was hoping some s
On Apr 13, 5:35 pm, Ivan Illarionov <[EMAIL PROTECTED]> wrote:
> On Mar 19, 2:17 pm, "BJörn Lindqvist" <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Mon, Mar 17, 2008 at 11:57 PM, Arnaud Delobelle
>
> > <[EMAIL PROTECTED]> wrote:
> > > > def make_slope(distance, parts):
> > > > step = distance / fl
On Mar 19, 2:17 pm, "BJörn Lindqvist" <[EMAIL PROTECTED]> wrote:
> On Mon, Mar 17, 2008 at 11:57 PM, Arnaud Delobelle
>
>
>
> <[EMAIL PROTECTED]> wrote:
> > > def make_slope(distance, parts):
> > > step = distance / float(parts)
> > > intstep = int(step)
> > > floatstep = step - int
On Mon, Mar 17, 2008 at 11:57 PM, Arnaud Delobelle
<[EMAIL PROTECTED]> wrote:
> > def make_slope(distance, parts):
> > step = distance / float(parts)
> > intstep = int(step)
> > floatstep = step - intstep
> >
> > steps = []
> > acc = 0.0
> > for i in range(parts):
>
"Jeff Schwab" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
| Marc Christiansen wrote:
| > This was my first thought, too. But tailcall optimisation wouldn't help
| > here. `make_slope` is not tail recursive, the `+` (aka list.extend)
gets
| > executed after the recursion.
|
|
| de
Marc Christiansen wrote:
> sturlamolden <[EMAIL PROTECTED]> wrote:
>> On 18 Mar, 00:58, Jeff Schwab <[EMAIL PROTECTED]> wrote:
>>
>>> def make_slope(distance, parts):
>>> if parts == 0:
>>> return []
>>>
>>> q, r = divmod(distance, parts)
>>>
>>> if r and parts % r:
>>>
sturlamolden <[EMAIL PROTECTED]> wrote:
> On 18 Mar, 00:58, Jeff Schwab <[EMAIL PROTECTED]> wrote:
>
>> def make_slope(distance, parts):
>> if parts == 0:
>> return []
>>
>> q, r = divmod(distance, parts)
>>
>> if r and parts % r:
>> q += 1
>>
>> return [q] +
On 18 Mar, 00:58, Jeff Schwab <[EMAIL PROTECTED]> wrote:
> def make_slope(distance, parts):
> if parts == 0:
> return []
>
> q, r = divmod(distance, parts)
>
> if r and parts % r:
> q += 1
>
> return [q] + make_slope(distance - q, parts - 1)
Beautiful. If Pyt
Arnaud Delobelle wrote:
> On Mar 17, 10:24 pm, "BJörn Lindqvist" <[EMAIL PROTECTED]> wrote:
>> Here is an interesting math problem:
>>
>> You have a number X > 0 and another number Y > 0. The goal is to
>> divide X into a list with length Y. Each
BJörn Lindqvist wrote:
> Here is an interesting math problem:
>
> You have a number X > 0 and another number Y > 0. The goal is to
> divide X into a list with length Y. Each item in the list is an
> integer. The sum of all integers is X. Each integer is either A or A +
On Mar 18, 1:24 am, "BJörn Lindqvist" <[EMAIL PROTECTED]> wrote:
> Here is an interesting math problem:
>
> You have a number X > 0 and another number Y > 0. The goal is to
> divide X into a list with length Y. Each item in the list is an
> integer. The sum
On Mar 17, 10:24 pm, "BJörn Lindqvist" <[EMAIL PROTECTED]> wrote:
> Here is an interesting math problem:
>
> You have a number X > 0 and another number Y > 0. The goal is to
> divide X into a list with length Y. Each item in the list is an
> integer. The sum
On Mar 17, 5:24 pm, "BJörn Lindqvist" <[EMAIL PROTECTED]> wrote:
> Here is an interesting math problem:
>
> You have a number X > 0 and another number Y > 0. The goal is to
> divide X into a list with length Y. Each item in the list is an
> integer. The sum
Here is an interesting math problem:
You have a number X > 0 and another number Y > 0. The goal is to
divide X into a list with length Y. Each item in the list is an
integer. The sum of all integers is X. Each integer is either A or A +
1, those should be "evenly distributed."
E
22 matches
Mail list logo