Re: Good data structure for finding date intervals including a given date

2012-05-16 Thread Jean-Daniel
/3.1/ > [2] http://www.python.org/getit/releases/2.7.3/ > [3] http://dl.acm.org/citation.cfm?id=645413.652131 > > On Sat, May 12, 2012 at 10:17 PM, Jean-Daniel > wrote: >> >> Hello, >> >> I have a long list of n date intervals that gets added or suppressed &

Re: Good data structure for finding date intervals including a given date

2012-05-12 Thread Jean-Daniel
it fast is to have done some preprocessing at insertion time, so that not all intervals are processed at query time. On Sat, May 12, 2012 at 2:30 PM, Karl Knechtel wrote: > On Sat, May 12, 2012 at 8:17 AM, Jean-Daniel > wrote: >> I am looking for a fast way to find the intervals &

Good data structure for finding date intervals including a given date

2012-05-12 Thread Jean-Daniel
Hello, I have a long list of n date intervals that gets added or suppressed intervals regularly. I am looking for a fast way to find the intervals containing a given date, without having to check all intervals (less than O(n)). Do you know the best way to do this in Python with the stdlib? A var

Re: executing a function with feeding its global variables

2011-02-12 Thread Jean-Daniel
On Sat, Feb 12, 2011 at 7:25 PM, Peter Otten <__pete...@web.de> wrote: > Jean-Daniel wrote: > >> Hello, >> >> I am writing a small framework where the user which writes a function >> can expect some global variable to be set in the function namespace. >>

executing a function with feeding its global variables

2011-02-12 Thread Jean-Daniel
Hello, I am writing a small framework where the user which writes a function can expect some global variable to be set in the function namespace. The user has to write a function like this: """ # function.py from framework import, command, run @command def myfunc(): print HOST if __name__==

extra room in Paris in your are stuck at the airport

2010-04-19 Thread Jean Daniel
Hello, I live in Paris, my roommate and I would gladly host a poor soul blocked at the airport due to the ash cloud. See me for details, Cheers, PS: disambiguation: talking about real physical cloud here... :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Distributing Python-programs to Ubuntu users

2009-09-25 Thread Jean Daniel
Maybe the distutils list is more adapted for this question: The Zope community uses zc.sourcerelease to build rpm http://www.mail-archive.com/distutils-...@python.org/msg06599.html Buildout is said to have undocumented features to build packages. Tarek Ziade is working debian package with 'distr

Re: Not this one the other one, from a dictionary

2009-09-22 Thread Jean Daniel
Building on the answers of the others, a simple one liner, no side effect, not the fastest I guess: >>> d={'a': 'bob', 'b': 'stu'} >>> set( d.keys() ).difference( [ 'a' ] ).pop() 'b' Note the square brackets for the parameter of difference(). 'The string 'a' and the list [ 'a' ] are both iterable