DateTime::Duration Presentation

2006-01-08 Thread David Wheeler
Howdy, I'm integrating duration objects into an app I'm building, but have a bit of a problem using DateTime::Duration objects. The problem is this: Say that a user selects a duration of 2 hours for the duration in a Web form and saves it. The next time the user accesses that Web form,

Re: DateTime::Duration Presentation

2006-01-08 Thread David Wheeler
On Jan 8, 2006, at 4:13 PM, Rick Measham wrote: David Wheeler wrote: The normalization stuff in DateTime::Format::Duration gets us part of the way there, but not quite, as if I say, 23 hours, 90 minutes, it will return 24 hours 29 minutes, which is not quite the same as what

Re: Comparing DateTime::Duration

2006-01-07 Thread David Wheeler
On Jan 7, 2006, at 3:49 AM, Rick Measham wrote: Now, if perl had an '===' operator for 'identical' then we could use that to determine if both durations are *always* equal (so maybe we need to add a comparison function for it: 1 second === 10 nanoseconds 1 year

Documents compare() Return Values

2006-01-06 Thread David Wheeler
Maybe I'm just a knucklehead, but I started out thinking that DateTime::Duration-compare() would return true if the two durations were the same, and false if they were not. When that wasn't working, I looked at the docs and could find nothing to say what it *does* return. But I noticed

Comparing DateTime::Duration

2006-01-06 Thread David Wheeler
Just a quick question, maybe I just don't understand something. I have code that compares new and old values of object attributes before assigning the new value. If the attribute has not been changed, I don't bother to assign. However, this doesn't work with DateTime::Duration attributes,

Re: Storing recurrences in a SQL DBMS?

2005-05-03 Thread David Wheeler
On May 2, 2005, at 18:41 , Tim wrote: p.s. Since Postgres has been mentioned already I'll mention MySQL :) http://dev.mysql.com/doc/mysql/en/spatial-extensions-in-mysql.html PostgreSQL geometric data types: http://www.postgresql.org/docs/8.0/static/datatype-geometric.html ;-) David smime.p7s

Re: Storing recurrences in a SQL DBMS?

2005-04-29 Thread David Wheeler
On Apr 28, 2005, at 10:48 PM, Dave Rolsky wrote: What I'd really like to see is some way to query both single events and recurring events within a given timeframe, all in one query that returns a sorted array of occurrences. I haven't tried it (yet), but you might want to check out the INTERVAL

Re: Storing recurrences in a SQL DBMS?

2005-04-29 Thread David Wheeler
On Apr 28, 2005, at 11:05 PM, David Wheeler wrote: I haven't tried it (yet), but you might want to check out the INTERVAL data type in PostgreSQL. http://www.postgresql.org/docs/current/static/datatype-datetime.html Or, more precisely: http://www.postgresql.org/docs/8.0/static/datatype

Re: Storing recurrences in a SQL DBMS?

2005-04-29 Thread David Wheeler
On Apr 29, 2005, at 10:51 AM, Dave Rolsky wrote: Surely implementation of that data type is just a SMOP! What would the data type look like, exactly? You might be able to create it using DOMAINS in PostgreSQL. http://www.postgresql.org/docs/current/static/sql-createdomain.html Hehe. Actually,

Re: DateTime::Pregnancy name

2004-10-10 Thread David Wheeler
On Oct 10, 2004, at 5:58 PM, Rick Measham wrote: ... I just think that DateTimeX looks too strange. It works for modules whose namespace is all upper (like CGI, DBI, LWP etc), but looks a little strange for namespaces like DateTime. Seems to work fine for MasonX... Regards, David

Re: [cpan #6980] $d-day(1); == $d-set(day = 1);

2004-07-17 Thread David Wheeler
On Jul 16, 2004, at 4:35 PM, John Siracusa wrote: As for this: $obj-start_date(format = '%B %d %Y at %T') being nothing more than syntactic sugar for this: $obj-start_date-strftime('%B %d %Y at %T') Yes, that's my argument against it. And it's why dates are such a PITA in Bricolage. the

Re: [cpan #6980] $d-day(1); == $d-set(day = 1); (fwd)

2004-07-16 Thread David Wheeler
On Jul 16, 2004, at 2:01 PM, Dave Rolsky wrote: Let me cut off this line of discussion, because I really, really, really hate this style of dual-purpose methods. The reason I dislike it so much is that it's impossible to distinguish between a mutator and an accessor that accepts arguments to

Re: [cpan #6980] $d-day(1); == $d-set(day = 1);

2004-07-16 Thread David Wheeler
On Jul 16, 2004, at 2:52 PM, John Siracusa wrote: And I cringe at APIs with 50 methods that begin with set_ and 50 more that begin with get_. I have to mentally filter out the prefix noise when trying to look up methods based on the part that is the most relevant to the API (e.g. day) It's

Re: [cpan #6980] $d-day(1); == $d-set(day = 1); (fwd)

2004-07-15 Thread David Wheeler
On Jul 15, 2004, at 2:40 PM, Dave Rolsky wrote: $d-day(1) and friends should be the equivalent of $d-set(day = 1) to make the interface consistent and obvious. Hrm. I'm inclined to agree, I think. I like having separate accessors and mutators but DateTime's current model: $d-day; # accessor

Re: Moving to subversion?

2004-04-22 Thread David Wheeler
On Apr 22, 2004, at 5:45 AM, Dave Rolsky wrote: Objections? Comments? My only objection to svn is that activitymail doesn't work with it. Perhaps someone could convince the maintainer of that program to find the tuits to port it, eh? Otherwise, I'm thinking of moving my projects to svn, too,

Re: Moving to subversion?

2004-04-22 Thread David Wheeler
On Apr 22, 2004, at 4:01 PM, Tim Bunce wrote: I don't know what activitymail is, but I do know that svn.perl.org sends emails for each commit (to a mailing list that corresponds to the module being changed). That's what activitymail does, but it sends the diffs from the (CVS) commits, too,

Re: Moving to subversion?

2004-04-22 Thread David Wheeler
On Apr 22, 2004, at 5:14 PM, Dave Rolsky wrote: It's well worth the move, IMO. Yeah, I think so, too. I'll check it out as soon as I have the tuits and Ask gives me the a-ok. Cheers, David

Re: Moving to subversion?

2004-04-22 Thread David Wheeler
On Apr 22, 2004, at 8:54 PM, Tim Bunce wrote: I should have added that the emails include the diff. As an attachment? That's what has distinguished activitymail over the last two years or so. David

Re: Help Installing DateTime::Format::ICal

2004-02-24 Thread David Wheeler
On Feb 24, 2004, at 7:02 PM, Dave Rolsky wrote: But I'm led to ask: Is Module::Build really robust enough to switch from MakeMaker to Module::Build? You think MakeMaker is robust? Hahahahahaha That's funny. What Dave is trying to say is, yes, Module::Build is robust enough to switch from

Re: Help Installing DateTime::Format::ICal

2004-02-24 Thread David Wheeler
On Feb 24, 2004, at 8:42 PM, Rick Measham wrote: Thankyou for a sensible response David. While MakeMaker's maintainer and others may say long live Module::Build, I keep having trouble with it whereas I've never had trouble with MakeMaker. Thus my question. Yes, this was due to an oversight Ken

Re: Help Installing DateTime::Format::ICal

2004-02-24 Thread David Wheeler
On Feb 24, 2004, at 9:44 PM, Dave Rolsky wrote: I felt uncomfortable telling them to wait for M::B 0.24 with no release timeframe, because Ken went on vacation right after release 0.23. Ken's on vacation _again_?? Damn! D

Re: DateTime::Stringify ...

2004-02-21 Thread David Wheeler
On Feb 21, 2004, at 7:48 AM, Dave Rolsky wrote: I found the discussion about stringification. The reason I took it out of the DateTime.pm code was that it made stack traces look quite wack. I trust that's only true when you use a DT object in a stringification context? Doesn't seem like much

Re: DateTime::Stringify ...

2004-02-21 Thread David Wheeler
On Feb 21, 2004, at 12:11 PM, Dave Rolsky wrote: Well, right. But I'm talking about printing out a stack trace, ala Carp or Devel::StackTrace. It prints out subroutine arguments, which may include objects. If the objects are stringify to something like '2004-01-02 11:12:13' then that could be

Re: DateTime::Stringify ...

2004-02-21 Thread David Wheeler
On Feb 21, 2004, at 2:01 PM, Dave Rolsky wrote: Hmmm, I guess not. At least, I couldn't get 'no overload' to do anything useful. How much of a PITA is it to use overload::StrVal and overload::Overloaded in Devel::StackTrace? Not a PITA at all, I just liked the other solution even more. This is

Re: DateTime::Stringify ...

2004-02-21 Thread David Wheeler
On Feb 21, 2004, at 4:56 PM, David Wheeler wrote: Could Devel::StackTrace print out the names of objects and their addresses some other way, to avoid problems when they happen to be stringified? Sorry, shoulda read the other followups, first. Sounds like Matt Sisk has hit upon a great solution

Re: Chinese/Japanese calendars - GMP is a pre-requisite

2004-01-19 Thread David Wheeler
On Jan 19, 2004, at 2:40 AM, Joshua Hoblitt wrote: Because not everyone is connected to a network with access to a CPAN mirror. And those people will hate you. RTFM on Module::Install Got tuits? David

Re: Chinese/Japanese calendars - GMP is a pre-requisite

2004-01-17 Thread David Wheeler
On Jan 16, 2004, at 7:55 PM, Joshua Hoblitt wrote: I would do it the way we did it in DBD::Pg: Put it in t/lib: Why not use Module::Install? Because not everyone is connected to a network with access to a CPAN mirror. And those people will hate you. Regards, David

Re: Chinese/Japanese calendars - GMP is a pre-requisite

2004-01-16 Thread David Wheeler
On Jan 16, 2004, at 4:42 PM, Dave Rolsky wrote: There's App::Info and Alien for detecting non-Perl dependencies, but someone would have to code up the libgmp parts explicitly. Well, Alien mainly exists as an idea in Arthur Bergman's head. (Maybe he has been taken over by an alien?). It's goal is

Re: Chinese/Japanese calendars - GMP is a pre-requisite

2004-01-16 Thread David Wheeler
On Jan 16, 2004, at 5:38 PM, Jonathan Leffler wrote: Thanks for the pointer to App::Info - it looks interesting. DBD::Informix already has to do a lot of stuff like that - and has classes which supports its efforts. Integrating that into a App::Info framework probably isn't too hard. No,

Re: Problem with DateTime::Format::DateManip v0.01

2003-09-05 Thread David Wheeler
use strict; use POSIX qw(tzset); print scalar localtime, $/; { local $ENV{TZ} = Asia/Tokyo; tzset; print scalar localtime, $/; } print scalar localtime, $/; The question is, what does the third print statement print? Do I need to call tzset again after the block? TIA, David -- David

Re: Problem with DateTime::Format::DateManip v0.01

2003-09-05 Thread David Wheeler
question from David a few months ago? Possibly. I had reported an issue with TZs not appearing to work on Debian, but if you said exactly the above, I missed it. Sorry. I'm glad to have the information now! Cheers, David -- David Wheeler AIM: dwTheory [EMAIL

Re: Problem with DateTime::Format::DateManip v0.01

2003-09-04 Thread David Wheeler
-- except perhaps on Debian. Are you saying that if I want the setting of TZ to portably affect, e.g., localtime, that I need to always POSIX::tzset() after I do it? Seems a waste to load all of POSIX.pm just for that... Cheers, David -- David Wheeler AIM

Re: DateTime-localtime() (was Re: DT::TZ test failure)

2003-08-10 Thread David Wheeler
it for you, passing your default arguments, and returning the result. In fact, make it a code reference, and you will for all practical purposes have a curried version of the constructor! Regards, David -- David Wheeler AIM: dwTheory [EMAIL PROTECTED

Re: TZ Environment Variable

2003-07-28 Thread David Wheeler
and post a test script to demonstrate the issue? Mark? Scott? Thanks, David -- David Wheeler AIM: dwTheory [EMAIL PROTECTED] ICQ: 15726394 http://kineticode.com/ Yahoo!: dew7e

Re: DateTime parse(), parser()

2003-07-16 Thread David Wheeler
objects, and throw different exceptions for user errors vs. programmer error. David -- David Wheeler AIM: dwTheory [EMAIL PROTECTED] ICQ: 15726394 http://kineticode.com/ Yahoo!: dew7e

Re: integrate leap seconds with core XS code?

2003-07-12 Thread David Wheeler
is that this should greatly speed up a common code path. Sounds pretty sensible to me. David -- David Wheeler AIM: dwTheory [EMAIL PROTECTED] ICQ: 15726394 http://kineticode.com/ Yahoo!: dew7e

Re: Compilation on HPUX, AIX, VMS, etc

2003-06-13 Thread David Wheeler
Unix variants, or VMS, QNX, or other weird things like that. Testing on Mac OS X: Other than this: Warning: the following files are missing in your kit: META.yml Please inform the author. DateTime looks good -- all tests pass, etc. Regards, David -- David Wheeler

Re: Compilation on HPUX, AIX, VMS, etc

2003-06-13 Thread David Wheeler
On Friday, June 13, 2003, at 10:59 AM, David Wheeler wrote: Testing on Mac OS X: Other than this: Warning: the following files are missing in your kit: META.yml Please inform the author. DateTime looks good -- all tests pass, etc. Uh, that's Perl 5.8.0. David -- David Wheeler

Re: FAQ cleanup

2003-06-06 Thread David Wheeler
really add anything to the FAQ for most readers. Tried Pod::Simple::HTML? We should all nicely ask Sean to get it finished, now that his new book is pretty well done. Regards, David -- David Wheeler AIM: dwTheory [EMAIL PROTECTED

Re: FAQ cleanup

2003-06-06 Thread David Wheeler
that subclassing is one of Sean's goals for the Pod::Simple classes. I say we bug him about it. ;-) Regards, David -- David Wheeler AIM: dwTheory [EMAIL PROTECTED] ICQ: 15726394 http://kineticode.com/ Yahoo

Re: FAQ cleanup

2003-06-06 Thread David Wheeler
, for the code that Sean eventually wants to develop there, and which should be subclassable. I know that Graham Barr is also anxiously waiting for Sean to write the new P::S::HTML. Regards, David -- David Wheeler AIM: dwTheory [EMAIL PROTECTED

Re: Mac testers wanted

2003-02-23 Thread David Wheeler
a hitch. Mac OS X 10.2.4 Perl 5.8.0 CPANPLUS 0.042 DateTime::TimeZone 0.08 DateTime 0.06 David PS: I've noticed in the past that Mac OS X 10.1 seemed to ignore the TZ environment variable -- could that have been part of the problem? -- David Wheeler AIM: dwTheory

Re: DateTime in XS

2003-02-15 Thread David Wheeler
ships in the core. It hasn't stopped DBI from gaining wide acceptance. And only recently has a pure perl DBI been introduced. And it's used far less, of course. David -- David Wheeler AIM: dwTheory [EMAIL PROTECTED] ICQ: 15726394

Re: Which DOW is day #1?

2003-01-12 Thread David Wheeler
. month[$date-month_num] vs. $date-month both return January I think that this will be resolved by: month[$date-month_0] vs. $date-month both return January David -- David Wheeler AIM: dwTheory [EMAIL PROTECTED] ICQ: 15726394

Re: Base object API/semantics

2003-01-12 Thread David Wheeler
, or call a user-defined callback). And die with an exception object as the default, yes? David -- David Wheeler AIM: dwTheory [EMAIL PROTECTED] ICQ: 15726394 http://david.wheeler.net/ Yahoo!: dew7e

Re: Static objects with dynamic wrappers?

2003-01-12 Thread David Wheeler
$$dth-clone( hour = 17 ) or equivalent # internal gymnastics, and then stores the resulting object. Yes, although if someone expects the object reference to be the same, they'll get a rude surprise. David -- David Wheeler AIM: dwTheory [EMAIL PROTECTED

Re: Base object API/semantics

2003-01-11 Thread David Wheeler
of Exception::Class. However, it'd probably be ideal to allow users to determine how to deal with these things, a la DBI's approach. Regards, David -- David Wheeler AIM: dwTheory [EMAIL PROTECTED] ICQ: 15726394 http

Re: [mplspm]: Picking up the ball

2003-01-11 Thread David Wheeler
by default. David -- David Wheeler AIM: dwTheory [EMAIL PROTECTED] ICQ: 15726394 http://david.wheeler.net/ Yahoo!: dew7e Jabber: [EMAIL PROTECTED]

Re: Base object API/semantics

2003-01-11 Thread David Wheeler
, along with a PrintError, just for those who actually like warnings. Regards, David -- David Wheeler AIM: dwTheory [EMAIL PROTECTED] ICQ: 15726394 http://david.wheeler.net/ Yahoo!: dew7e

Re: Base object API/semantics

2003-01-11 Thread David Wheeler
it's like that except for day of week. Hmm, I will ponder this some more. Nah, Matthew is right, I think Just do it. The only time you shouldn't do it is if we override localtime and want to stringify it like Time::Piece does. David -- David Wheeler AIM

Re: Base object API/semantics

2003-01-11 Thread David Wheeler
you call today Elevenday or something ;) I wouldn't rule that out when it comes to other calendars. David -- David Wheeler AIM: dwTheory [EMAIL PROTECTED] ICQ: 15726394 http://david.wheeler.net/ Yahoo

Re: Picking up the ball

2003-01-10 Thread David Wheeler
-month, $ship_d-day ); One of the most important methods that Date::ICal is missing, IMO, and that we should grab from Time::Piece and put into the core, in my opinion, is strftime. I *love* that method! my $t = localtime; print $t-strftime(%Y/%m/%d); David -- David Wheeler

Re: [mplspm]: Picking up the ball

2003-01-10 Thread David Wheeler
stringification. If the DBD handles it, fine, but I think it'd be ideal to design it in such a way that the DBD didn't have to do anything more than specify the datetime string format it needs (in strftime format, most likely), and have the DateTime object do the rest. Regards, David -- David

Re: [mplspm]: Picking up the ball

2003-01-10 Thread David Wheeler
, and I'm probably just getting way too far ahead of myself. ;-) David -- David Wheeler AIM: dwTheory [EMAIL PROTECTED] ICQ: 15726394 http://david.wheeler.net/ Yahoo!: dew7e