Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: Representing windows of time in a string

by davido (Cardinal)
on Oct 30, 2003 at 17:11 UTC ( #303331=note: print w/replies, xml ) Need Help??

in reply to Representing windows of time in a string

Advanced Perl Programming, otherwise known as the Panther book from O'Reilly & Assoc. has a discussion that you would probably find beneficial. Chapter two, section three:

Consider that there are only 24 * 7 = 168 hours in a week, the entire week's schedule can be represented by a bitmap vector of 21 bytes (168 / 8) .... The other cool thing is that you can obtain time conflicts by logically AND-ing two bitmaps.

The implementation example provided in the book uses vec to construct the bitmaps, and logical 'and' to check for overlaps.

Hope this helps...


"If I had my life to live over again, I'd be a plumber." -- Albert Einstein
  • Comment on Re: Representing windows of time in a string

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://303331]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2023-06-11 00:09 GMT
Find Nodes?
    Voting Booth?
    How often do you go to conferences?

    Results (39 votes). Check out past polls.