Re: Solving the problem of mutual recursion

2013-05-26 Thread Peter Brooks
On May 27, 12:16 am, Chris Angelico wrote: > On Mon, May 27, 2013 at 5:35 AM, Ian Kelly wrote: > > I'm pretty sure that CPython uses the GIL regardless of platform.  And > > yes you can have multiple OS-level threads, but because of the GIL > > only one will actually be running at a time.  Other

Re: Solving the problem of mutual recursion

2013-05-26 Thread Peter Brooks
On 26 May, 20:22, Carlos Nepomuceno wrote: > > > > Date: Sun, 26 May 2013 11:13:12 -0700 > > Subject: Re: Solving the problem of mutual recursion > > From: peter.h.m.bro...@gmail.com > > To: python-l...@python.org > [...] > >> How can you get 140% of CPU? I

Re: Solving the problem of mutual recursion

2013-05-26 Thread Peter Brooks
On 26 May, 20:09, Carlos Nepomuceno wrote: > > > > > > > > > > > > Date: Sun, 26 May 2013 10:21:05 -0700 > > Subject: Re: Solving the problem of mutual recursion > > From: peter.h.m.bro...@gmail.com > > To: python-l...@python.org > > > On May 26, 5:09 pm, J

Re: Solving the problem of mutual recursion

2013-05-26 Thread Peter Brooks
On May 26, 5:09 pm, Jussi Piitulainen wrote: > > A light-weighter way is to have each task end by assigning the next > task and returning, instead of calling the next task directly. When a > task returns, a driver loop will call the assigned task, which again > does a bounded amount of work, assig

Solving the problem of mutual recursion

2013-05-26 Thread Peter Brooks
I'm not sure if this'll interest anybody, but I expect that I'm going to get some mutual recursion in my simulation, so I needed to see how python handled it. Unfortunately, it falls over once it detects a certain level of recursion. This is reasonable as, otherwise, the stack eventually over-fills

Re: Simple algorithm question - how to reorder a sequence economically

2013-05-24 Thread Peter Brooks
On May 24, 11:33 pm, Carlos Nepomuceno wrote: > > > > > > > > > > > > Date: Fri, 24 May 2013 12:01:35 -0700 > > Subject: Re: Simple algorithm question - how to reorder a sequence > > economically > > From: peter.h.m.bro...@gmail.com > > To: python-l...@pyt

Re: Using ACLs in JSON

2013-05-24 Thread Peter Brooks
On May 24, 6:13 pm, Carlos Nepomuceno wrote: > Not exactly what you want but you may consider Google ACL XML[1]. > > If there aren't any system integration restrictions you can do what you think > it's best... for now. > > [1]https://developers.google.com/storage/docs/accesscontrol#applyacls > Th

Re: Using ACLs in JSON

2013-05-24 Thread Peter Brooks
On May 24, 6:42 pm, Michael Torrie wrote: > On 05/24/2013 02:18 AM, Peter Brooks wrote: > > > I'm designing a system that should allow different views to different > > audiences. I understand that I can use application logic to control > > the access security, but

Re: Simple algorithm question - how to reorder a sequence economically

2013-05-24 Thread Peter Brooks
On May 24, 5:00 pm, Carlos Nepomuceno wrote: > > > I don't know what "spurious evidence of correlation" is. Can you give a > mathematical definition? > If I run the simulation with the same sequence, then, because event E1 always comes before event E2, somebody might believe that there is a causa

Re: Simple algorithm question - how to reorder a sequence economically

2013-05-24 Thread Peter Brooks
Thank you all for those most helpful suggestions! random.shuffle does precisely the job that I need quickly. Thank you for introducing me to itertools, though, I should have remembered APL did this in a symbol or two and I'm sure that itertools will come in handy in future. Thanks for the warnings

Using ACLs in JSON

2013-05-24 Thread Peter Brooks
I'm designing a system that should allow different views to different audiences. I understand that I can use application logic to control the access security, but it seems to me that it'd make more sense to have this documented in the data-stream so that it's data-driven. I was wondering if there

Simple algorithm question - how to reorder a sequence economically

2013-05-24 Thread Peter Brooks
What is the easiest way to reorder a sequence pseudo-randomly? That is, for a sequence 1,2,3,4 to produce an arbitrary ordering (eg 2,1,4,3) that is different each time. I'm writing a simulation and would like to visit all the nodes in a different order at each iteration of the simulation to remo