On Jun 9, 6:12 pm, Robert Kern wrote:
> On 2009-06-09 18:05, Mensanator wrote:
>
>
>
>
>
> > On Jun 9, 4:33 pm, Esmail wrote:
> >> Hi,
>
> >> random.random() will generate a random value in the range [0, 1).
>
> >> Is there an easy way to generate random values in the range [0, 1]?
> >> I.e., inc
On Jun 9, 4:33 pm, Esmail wrote:
> Hi,
>
> random.random() will generate a random value in the range [0, 1).
>
> Is there an easy way to generate random values in the range [0, 1]?
> I.e., including 1?
>
Are you trying to generate a number in the range [0,n] by multiplying
a random function that
On Jun 9, 6:05 pm, "Gabriel Genellina" wrote:
> En Tue, 09 Jun 2009 18:33:39 -0300, Esmail escribió:
>
> > random.random() will generate a random value in the range [0, 1).
>
> > Is there an easy way to generate random values in the range [0, 1]?
> > I.e., including 1?
>
> I think you shouldn't w
I used paster to create a project named pitz. I'm writing a bunch of
user documentation. Where should I put it?
The project looks a little like this:
/home/matt/projects/pitz
setup.py
pitz/
__init__.py # has my project code
docs/ # has my reST files
On Jun 9, 8:45 pm, Mensanator wrote:
> On Jun 9, 6:05 pm, "Gabriel Genellina" wrote:
> > py> a+(b-a)*z < b # the expression used for uniform(a,b)
> > False
> > py> a+(b-a)*z
> > 11.0
>
> What you do with the number after it's created is not
> random's concern.
Mensanator, you missed Gabriel's po
On Jun 9, 8:39 pm, Paul McGuire wrote:
> Are you trying to generate a number in the
> range [0,n] by multiplying a random function that
> returns [0,1] * n? If so, then you want to do
> this using: int(random.random()*(n+1)) This will
> give equal chance of getting any number from 0 to n.
Bette
thanks for your reply!
"Lie Ryan" $y61.12...@news-server.bigpond.net.au...
myopc wrote:
hi, all
I am ruuning a c++ program (boost python) , which create many python
interpreaters and each run a python script with use multi-thread
(threading).
when the c++ main program exit, I want to shut dow
On Jun 10, 7:41 am, "Gabriel Genellina"
wrote:
> En Mon, 08 Jun 2009 22:15:22 -0300, BigHand escribió:
>
> > I have an embedded python application. which is a MFC app with
> > Python interpreter embedded.
>
> > In the App, I have a separate thread to execute a Python script
> > (using the
Jon Harrop wrote:
Arved Sandstrom wrote:
Jon Harrop wrote:
Arved Sandstrom wrote:
Lew wrote:
Interesting distinction. Would it be fair to compare concurrent
programming to the bricks used to build the parallel program's edifice?
Way too much of a fine distinction. While they are in fact dif
On Tue, 09 Jun 2009 18:28:23 -0700, John Yeung wrote:
> The docs are now... sort of correct. For some values of a and b,
> uniform() can never return b. Notably, I believe uniform(0, 1) is
> equivalent to random(), and will never return 1. However, uniform(1, 2)
> CAN return 2, if this is any i
I've become interested in basic graphs and networks and I'm wondering
about what algorithms are there for generating basic regular graphs
like the simplex graph or dodecahedron graph, etc (I'm sure there are
many). I'm particularly keen on understanding the very basic functions
for determining edge
On Jun 10, 11:32 am, John Yeung wrote:
> On Jun 9, 8:39 pm, Paul McGuire wrote:
> > Are you trying to generate a number in the
> > range [0,n] by multiplying a random function that
> > returns [0,1] * n? If so, then you want to do
> > this using: int(random.random()*(n+1)) This will
> > give eq
William Clifford writes:
> I've become interested in basic graphs and networks and I'm wondering
> about what algorithms are there for generating basic regular graphs
> like the simplex graph or dodecahedron graph, etc (I'm sure there are
> many). I'm particularly keen on understanding the very b
On Jun 9, 8:28�pm, John Yeung wrote:
> On Jun 9, 8:45�pm, Mensanator wrote:
>
> > On Jun 9, 6:05�pm, "Gabriel Genellina" wrote:
> > > py> a+(b-a)*z < b # the expression used for uniform(a,b)
> > > False
> > > py> a+(b-a)*z
> > > 11.0
>
> > What you do with the number after it's created is not
>
On Jun 9, 4:33 pm, Esmail wrote:
> Hi,
>
> random.random() will generate a random value in the range [0, 1).
>
> Is there an easy way to generate random values in the range [0, 1]?
> I.e., including 1?
You could do random.uniform(0, 1.0002). Due to floating-
point rounding, there are
On Jun 10, 1:40 am, Ben Charrow wrote:
> If you're looking to debug your program, try "import pdb"
Another option, if you wish to debug an error, is to run python using
the -i parameter. This will leave you inside the interpreter at the
point that execution stops. Very handy.
- alex23
--
http:/
By what method would a string be inserted at each instance of a RegEx
match?
For example:
string = '123 abc 456 def 789 ghi'
newstring = ' INSERT 123 abc INSERT 456 def INSERT 789 ghi'
Here's the code I started with:
>>> rePatt = re.compile('\d+\s')
>>> iterator = rePatt.finditer(string)
>>> co
On Tue, 09 Jun 2009 20:58:54 -0700, William Clifford wrote:
> I've become interested in basic graphs and networks and I'm wondering
> about what algorithms are there for generating basic regular graphs like
> the simplex graph or dodecahedron graph, etc (I'm sure there are many).
> I'm particularl
In article
,
"504cr...@gmail.com" <504cr...@gmail.com> wrote:
> By what method would a string be inserted at each instance of a RegEx
> match?
>
> For example:
>
> string = '123 abc 456 def 789 ghi'
> newstring = ' INSERT 123 abc INSERT 456 def INSERT 789 ghi'
If you want to do what I think y
On Jun 10, 8:00 am, rh0dium wrote:
> Apparently there is a problem with the if statement???
Try restructuring the if as a ternary condition:
import os, site; smsc = os.environ.get("TECHROOT", "/home/tech"); smsc
= smsc if os.path.isdir(smsc) else "/home/tech"; site.addsitedir
(os.path.join(smsc,
Here is part of the specification of an algorithm I'm implementing that
shows the reason for my original query:
vid = w * vid + c1 * rand( ) * ( pid – xid ) + c2 * Rand( ) * (pgd –xid ) (1a)
xid = xid + vid (1b)
where c1 and c2 are two positive constants,
rand() and Rand() are two random functi
On Tue, 09 Jun 2009 21:04:49 -0700, Mensanator wrote:
> On Jun 9, 8:28�pm, John Yeung wrote:
>> On Jun 9, 8:45�pm, Mensanator wrote:
>>
>> > On Jun 9, 6:05�pm, "Gabriel Genellina"
>> > wrote:
>> > > py> a+(b-a)*z < b # the expression used for uniform(a,b) False
>> > > py> a+(b-a)*z
>> > > 11.0
On Jun 9, 9:19 pm, alex23 wrote:
> On Jun 10, 8:00 am, rh0dium wrote:
>
> > Apparently there is a problem with the if statement???
>
> Try restructuring the if as a ternary condition:
>
> import os, site; smsc = os.environ.get("TECHROOT", "/home/tech"); smsc
> = smsc if os.path.isdir(smsc) else "
On Jun 9, 4:58 pm, David Lyon wrote:
> On Tue, 9 Jun 2009 16:30:06 -0700 (PDT), rh0dium
> wrote:
>
> >> > Apparently there is a problem with the if statement???
>
> >> > Thanks
>
> > No for .pth files this needs to be on a single line..
>
> I can't really see why you need conditional code...
>
>
On Jun 9, 11:19 pm, Roy Smith wrote:
> In article
> ,
>
> "504cr...@gmail.com" <504cr...@gmail.com> wrote:
> > By what method would a string be inserted at each instance of a RegEx
> > match?
>
> > For example:
>
> > string = '123 abc 456 def 789 ghi'
> > newstring = ' INSERT 123 abc INSERT 456 d
On Tue, 9 Jun 2009 21:33:56 -0700 (PDT), rh0dium
wrote:
>> Having multiple paths or multiple .PTH files isn't a
>> problem for python.
> ..
> We use it for our dev tree before we roll to production. Once dev is
> QA'd then we (integrate) those changes to main and release.
Makes sense...
:-)
On Jun 9, 11:35 pm, "504cr...@gmail.com" <504cr...@gmail.com> wrote:
> On Jun 9, 11:19 pm, Roy Smith wrote:
>
>
>
> > In article
> > ,
>
> > "504cr...@gmail.com" <504cr...@gmail.com> wrote:
> > > By what method would a string be inserted at each instance of a RegEx
> > > match?
>
> > > For exampl
On Jun 9, 11:24 pm, Steven D'Aprano
wrote:
> On Tue, 09 Jun 2009 18:28:23 -0700, John Yeung wrote:
> > The docs are now... sort of correct. For some values of a and b,
> > uniform() can never return b. Notably, I believe uniform(0, 1) is
> > equivalent to random(), and will never return 1. Howe
On Jun 10, 12:01 am, alex23 wrote:
> On Jun 10, 11:32 am, John Yeung wrote:
>
> > On Jun 9, 8:39 pm, Paul McGuire wrote:
> > > Are you trying to generate a number in the
> > > range [0,n] by multiplying a random function that
> > > returns [0,1] * n? If so, then you want to do
> > > this using:
On Tue, 09 Jun 2009 22:21:26 -0700, John Yeung wrote:
> On Jun 9, 11:24 pm, Steven D'Aprano
> wrote:
>> On Tue, 09 Jun 2009 18:28:23 -0700, John Yeung wrote:
>> > The docs are now... sort of correct. For some values of a and b,
>> > uniform() can never return b. Notably, I believe uniform(0, 1)
Steven D'Aprano wrote:
On Tue, 09 Jun 2009 18:28:23 -0700, John Yeung wrote:
The docs are now... sort of correct. For some values of a and b,
uniform() can never return b. Notably, I believe uniform(0, 1) is
equivalent to random(), and will never return 1. However, uniform(1, 2)
CAN retur
On Jun 9, 11:28�pm, Steven D'Aprano
wrote:
> On Tue, 09 Jun 2009 21:04:49 -0700, Mensanator wrote:
> > On Jun 9, 8:28 pm, John Yeung wrote:
> >> On Jun 9, 8:45 pm, Mensanator wrote:
>
> >> > On Jun 9, 6:05 pm, "Gabriel Genellina"
> >> > wrote:
> >> > > py> a+(b-a)*z < b # the expression used fo
On Jun 9, 11:58 pm, William Clifford
wrote:
> I've become interested in basic graphs and networks and I'm wondering
> about what algorithms are there for generating basic regular graphs
> like the simplex graph or dodecahedron graph, etc (I'm sure there are
> many). I'm particularly keen on unders
504cr...@gmail.com wrote:
> By what method would a string be inserted at each instance of a RegEx
> match?
>
> For example:
>
> string = '123 abc 456 def 789 ghi'
> newstring = ' INSERT 123 abc INSERT 456 def INSERT 789 ghi'
Have a look at re.sub():
>>> s = '123 abc 456 def 789 ghi'
>>> re.com
On Jun 10, 1:52 am, Steven D'Aprano
wrote:
> On Tue, 09 Jun 2009 22:21:26 -0700, John Yeung wrote:
> > Therefore, to me the most up-to-date docs (which say
> > that uniform(a, b) returns a float in the closed
> > interval [a, b]) is closer to correct than before,
> > but still fails to point out t
101 - 135 of 135 matches
Mail list logo