On Tue, 10 May 2005 23:53:43 GMT, Jim Sizelove <[EMAIL PROTECTED]> wrote:
>Bengt Richter wrote:
[...]
>> Maybe (not tested beyond what you see ;-)
I had that feeling ... somehow the word "max" was trying to get my attention,
but I posted without figuring out why ;-/
>
>It is with some trepidation t
Jim Sizelove wrote:
Wow! c.l.py is allmost like an AI program generator. But I guess it
helps to ask questions about problems that programmers find interresting :-)
The "linear" approach is pretty simple to code and understand. I am just
afraid what happens when many users tries to book that 1
Should work fine as far as I can see. Of course, thats not very
'pythonic' - I should probably give at least 10 different unit tests
that it passes ;)
Its gratifying to know I'm not the only one who needed that final
yield.
Jim Sizelove wrote:
> Bengt Richter wrote:
> > On Tue, 10 May 2005 15:14:
Bengt Richter wrote:
> On Tue, 10 May 2005 15:14:47 +0200, Max M <[EMAIL PROTECTED]> wrote:
>
>
>>I am writing a "find-free-time" function for a calendar. There are a lot
>>of time spans with start end times, some overlapping, some not.
>>
>>To find the free time spans, I first need to convert t
On Tue, 10 May 2005 15:14:47 +0200, Max M <[EMAIL PROTECTED]> wrote:
>I am writing a "find-free-time" function for a calendar. There are a lot
>of time spans with start end times, some overlapping, some not.
>
>To find the free time spans, I first need to convert the events into a
>list of non o
On Tue, 10 May 2005 15:14:47 +0200, Max M <[EMAIL PROTECTED]> wrote:
>I am writing a "find-free-time" function for a calendar. There are a lot
>of time spans with start end times, some overlapping, some not.
>
>To find the free time spans, I first need to convert the events into a
>list of non o
[EMAIL PROTECTED] wrote:
> The linear method:
>
> You create an array - one bool per minute. For one day 24 * 60 entries
> is enough. Spans (Start, End) are in minutes from midnight. Set array
> slots in range(Start, End) to True for each input span.
>
> Scan the array and find metaspans - contig
Max M wrote:
> I am writing a "find-free-time" function for a calendar. There are a lot
> of time spans with start end times, some overlapping, some not.
>
> To find the free time spans, I first need to convert the events into a
> list of non overlapping time spans "meta-spans".
>
"Almost" lin
The linear method:
You create an array - one bool per minute. For one day 24 * 60 entries
is enough. Spans (Start, End) are in minutes from midnight. Set array
slots in range(Start, End) to True for each input span.
Scan the array and find metaspans - contiguous sequences of False.
--
http://ma
Max M wrote:
> I am writing a "find-free-time" function for a calendar. There are a
lot
> of time spans with start end times, some overlapping, some not.
>
> To find the free time spans, I first need to convert the events into
a
> list of non overlapping time spans "meta-spans".
>
> This nice asci
This is the problem of finding the connected components inside an
interval graph. You can implement the algorithms yourself, of you can
use my graph data structure here:
http://sourceforge.net/projects/pynetwork/
The graph methods:
createIntervalgGraph
And:
connectedComponents
can probably solve
I am writing a "find-free-time" function for a calendar. There are a lot
of time spans with start end times, some overlapping, some not.
To find the free time spans, I first need to convert the events into a
list of non overlapping time spans "meta-spans".
This nice ascii graph should show what
12 matches
Mail list logo