[gDesklets] New Control added (Random)
- From: Bjoern Koch <H Humpel gmx de>
- To: gDesklets <gdesklets-list gnome org>
- Subject: [gDesklets] New Control added (Random)
- Date: Thu, 06 Mar 2008 21:48:26 +0100
Hi there,
rev. 93 just hit launchpad!
A new Control has been added: Random.
As the provided functions are very "basic" for programming in general
and therefore they might be useful for some desklets I thought it might
be a good candidate to be part of the basic Controls provided by
gDesklets ;).
You need to "feed" the control with a sequence (tuple) with all
necessary parameters.
Detailed information on these parameters can be found in the python
docs: http://docs.python.org/lib/module-random.html
Basic/simple testing has been done, but some more testing might be a
good idea (someone in here to volunteer ?! ;) ).
Here is the output from ./test-control.py Controls/Random/ :
IRandom:bss2bsoo8o0dl3kumdpegtrc2-2
betavariate r Beta distribution. Conditions on the
parameters are alpha > 0 and beta > 0. Returned values range between 0
and 1. Sequence: (alpha, beta).
choice r Return a random element from the
non-empty sequence seq. Sequence: (seq).
expovariate r Exponential distribution. lambd is 1.0
divided by the desired mean. Sequence: (lambd, ).
gammavariate r Gamma distribution. (Not the gamma
function!) Conditions on the parameters are alpha > 0 and beta > 0.
Sequence: (alpha, beta).
gauss r Gaussian distribution. mu is the mean,
and sigma is the standard deviation. Sequence: (mu, sigma).
lognormvariate r Log normal distribution. Sequence: (mu,
sigma).
normalvariate r Normal distribution. mu is the mean, and
sigma is the standard deviation. Sequence: (mu, sigma).
paretovariate r Pareto distribution. alpha is the shape
parameter. Sequence: (alpha, ).
randint r Return a random integer N such that a <=
N <= b. Sequence: (a, b).
random r Return the next random floating point
number in the range [0.0, 1.0). Sequence: ().
randrange r Return a randomly selected element from
range(start, stop, step). Sequence: (start, stop, step).
sample r Return a k length list of unique
elements chosen from the population sequence. Sequence: (population, k).
sequence rw The sequence/tuple to be used.
uniform r Return a random real number N such that
a <= N < b. Sequence: (a, b).
vonmisesvariate r mu is the mean angle, expressed in
radians between 0 and 2*pi, and kappa is the concentration parameter,
which must be greater than or equal to zero. Sequence: (mu, kappa).
weibullvariate r Weibull distribution. alpha is the scale
parameter and beta is the shape parameter. Sequence: (alpha, beta).
Greetings, Bjoern
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]