Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

chaoticset (2105)

chaoticset
  (email not shown publicly)
http://chaoticset.perlmonk.org/
AOL IM: chaoticset23 (Add Buddy, Send Message)
Yahoo! ID: illuminatus_foil (Add User, Send Message)

JAPH. (That's right -- I'm not Really Inexperienced any more.)

I'm not just here, I'm here [perlmonks.org], and here [javajunkies.org] too, I ramble randomly in my philosophical blog [blogspot.com] and my other blog [blogspot.com]. Soon I'll come in a convenient six-pack.

Journal of chaoticset (2105)

Tuesday May 14, 2002
05:14 PM

Design and Surprise

[ #4914 ]
I think I've figured out how to set up a flexible between-date-entry search: Two boxes, one for start date and one for end date.

If a box has an entry number in it, good, keep going; otherwise, convert (what's assumed to be a date in there) into a month, day, and year. Do binary search starting from the closest journal entry with a number divisible by 1000 until an entry is reached that is the first one on that date OR the closest one to that date, then return that entry number. Move to the next box, same deal. After those two vars hold entry numbers, return an array that contains all the entries between. Convert those to titles and create a hash to convert title to entry (since the entrytitled() function's been flaking out on me for reasons I don't comprehend yet) and retrieves that entry, dumping it in the primary display text object.

(I still have to see if this causes stress to use.perl;, but I can't see how it would. I can't imagine how it could be made more efficient. If you can, please, let me know.)

I was explaining this all to Laura, my SOTF, in order to help me decide if I wanted to create an iterative function to determine the dates or a recursive one.

"...the GUI-"

"Graphical User Interface?"

*pause* "Yeah. What am I building it with?"

"Perl/Tk."

Maybe she really is listening when I'm talking.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Not sure if you already have in mind what module you'd like to use for dates, but I highly recommend Time::Piece.

    --
    J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
    • The words "time piece" were going through my mind when I was scribbling these ideas down, but I figured it was an old bad memory of an Inform library called timepiece.h, something that never quite included properly.

      Suggestion notedm research follows...thank you. :)

      --

      ------------------------------
      You are what you think.
  • I'm not sure if this is relevant to what you're trying to do, but consider Tk::DateEntry. It's an entry widget with a built-in drop down calendar. I've used it and I think it looks pretty nice.