Re: FAQ
FAQ said: 2.3: Why do I need to truncate dates? ... Of course if you are trying to work out if an hour long meeting is going on now then you should truncate to hours... but for that kind of thing you probably want a DateTime::Span RFC - Do we need something like this? $span = DateTime::Span-hour( $dt ); $span = DateTime::Span-day( $dt ); ... QUESTION: Is there a better way to do this using DateTime::Sets? I'll try to answer that. - Flavio S. Glock
WAS: RH9: Cannot determine ...
I'm having problems with RedHat 9. Now it could just be my install, but someone might be able to help me. I know this is offtopic, but the problem only reared it's head when installing DateTime. The problem is this: in shell, I can't type a quote without a seqeunce such as [quote][x][delete]. It seems that if I type [quote][e] I get an 'e' with an accute. [quote] seems to have become a meta key for accents and thus I get only the occasional quote in my Makefile. See below. Does anyone have any idea what's going on? I just tested it in gEdit under X and I have exactly the same problem The only place that it doesn't happen is in SSH, however the Makefile is still missing heaps of single-quotes. How do I fix this? Thanks anyone. Following is my original email where I was trying to track down a suspected problem with the DateTime installer. (DBI installed without any hiccups!) Cheers! Rick Redhat 9 cannot determine if we have a C compiler and so tries defaulting to install PP Only. When I first run 'perl Makefile.PL' I am told that this is because: make: *** No rule to make target 'testub'. Stop. This seems to be because we try to run (on line 34 of Makefile.PL) system($make text$Config{obj_ext}); I checked $Config{obj_ext} at line 33 and it is 'ub' for some reason, however when I check in a one-liner, it's '.o'. Now if I 'make test.o' from the command line, it compiles. So, then I went into Makefile.PL and changed line 34 to system($make text.o); and it writes the Makefile without any problems. However now when I 'make' I get another error: Makefile:98: *** missing separator. Stop. Which means that there's an error on line 98 of the Makefile. Line 97-99 is: INSTALLSITEBIN = /usr INSTALLVENDORBIN = /usr/bin' installvendorhtml1='' So the problem on line 98 would be the single quote. Where did THAT come from? Now, I remove that and try again .. hang on, now I find that there are heaps of lines with single quotes. OK, I'm going to stop this and paste what seems to be the basic question at the top of this mail. -- There are 10 kinds of people: those that understand binary, and those that don't. The day Microsoft makes something that doesn't suck is the day they start selling vacuum cleaners Write a wise proverb and your name will live forever. -- Anonymous
RE: RH9: Cannot determine ...
Hi Rick, I'm having problems with RedHat 9. Now it could just be my install, but someone might be able to help me. I know this is offtopic, but the problem only reared it's head when installing DateTime. The problem is this: in shell, I can't type a quote without a seqeunce such as [quote][x][delete]. It seems that if I type [quote][e] I get an 'e' with an accute. [quote] seems to have become a meta key for accents and thus I get only the occasional quote in my Makefile. See below. Does anyone have any idea what's going on? I just tested it in gEdit under X and I have exactly the same problem [snipped] I seem to recall something like this in CLPM. I can't find it now, But is had to do the the locale setting The workaround for your original problem is probably to execute the Makefile.PL and the make/make test phase with the locale set to LC_ALL=C. Ron Hill
Re: installing DateTime-TimeZone-0.17 on HPUX 10.20... or Cygwin
Hill, Ronald wrote: I was not able to get this to work with the HP make utility However, I installed gmake and it works!!! I was able to install the DateTime-TimeZone-0.17. Where do we document these kinda things? Rather than document it, is there any way to fix the Makefile to have 32 1k lines instead of 1 32k line? Having to require a specific make/gmake is really not a good plan. It should be very unusual to require some different helper utility like 'gmake' to build an extension to Perl when that resident 'make' can build Perl itself. John -- John Peacock Director of Information Research and Technology Rowman Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748
Re: installing DateTime-TimeZone-0.17 on HPUX 10.20... or Cygwin
I will add it to the FAQ... -ben On Mon, Jun 02, 2003 at 07:46:54AM -0700, Hill, Ronald wrote: Hi Jean Ben, From Ben Bennet (Fri, 30 May 2003 15:24:13 -0400) OK, it looks like it is bombing because of all of the modules to install... each timezone module looks like: [snipped] This is a tough problem to solve... the easiest thing might be to try gnu make since that appears to be smart enough to handle arbitrarily long strings. The fix probably needs to occur in MakeMaker though... Might be worth dropping them an email with the example. -ben I have a similar problem with make for cygwin [snipped] The workaround I used was to type make -n make-n.sh then edit make-n.sh to replace the 32K line -e yada yada yada by calling a make-n.pl Perl script, which contains one 32K line. May be a new item in the FAQ could be sufficient... Jean Forget I was not able to get this to work with the HP make utility However, I installed gmake and it works!!! I was able to install the DateTime-TimeZone-0.17. Where do we document these kinda things? Ron Hill
Re: installing DateTime-TimeZone-0.17 on HPUX 10.20... or Cygwin
I still think it is a MakeMaker problem, has anyone reported it to them? I plan on adding it to the FAQ until we get it resolved properly. -ben On Mon, Jun 02, 2003 at 08:24:24AM -0700, Hill, Ronald wrote: Hi John, Rather than document it, is there any way to fix the Makefile to have 32 1k lines instead of 1 32k line? I guess I was not clean as what I was refering to when I made the statement of Document it. What I should have asked is Is there a place to document the test results that I have Sorry, I should have been more clear. However, I agree the this needs to be fixed in the makefile. Having to require a specific make/gmake is really not a good plan. It should be very unusual to require some different helper utility like 'gmake' to build an extension to Perl when that resident 'make' can build Perl itself. John You are absolutely correct!! Ron Hill
Re: installing DateTime-TimeZone-0.17 on HPUX 10.20... or Cygwin
On Mon, 2 Jun 2003, Ben Bennett wrote: I still think it is a MakeMaker problem, has anyone reported it to them? And are you guys using the latest MakeMaker? I think this might have been fixed in the new beta versions. -dave /*=== House Absolute Consulting www.houseabsolute.com ===*/
Re: FAQ
On Mon, 2 Jun 2003, Flavio S. Glock wrote: FAQ said: 2.3: Why do I need to truncate dates? ... Of course if you are trying to work out if an hour long meeting is going on now then you should truncate to hours... but for that kind of thing you probably want a DateTime::Span RFC - Do we need something like this? $span = DateTime::Span-hour( $dt ); $span = DateTime::Span-day( $dt ); ... What does this do? -dave /*=== House Absolute Consulting www.houseabsolute.com ===*/
Re: FAQ
Dave Rolsky wrote: On Mon, 2 Jun 2003, Flavio S. Glock wrote: RFC - Do we need something like this? $span = DateTime::Span-hour( $dt ); $span = DateTime::Span-day( $dt ); ... What does this do? It is a shortcut to build frequently-used spans: $dt = DateTime-new( year = 2003, month = 10, day = 5, hour = 11 ); $span = DateTime::Span-day( $dt ); # whole-day span: # [ 2003-10-05T00:00:00 .. 2003-10-05T23:59:59 ] this is a tipical application: $set = DT::E::Recurrence-xxx; $today_events = $set-as_list( span = DateTime::Span-day( today ) ); $month_events = $set-as_list( span = DateTime::Span-month( today ) ); - Flavio S. Glock
Re: FAQ
On Mon, 2 Jun 2003, Flavio S. Glock wrote: Dave Rolsky wrote: On Mon, 2 Jun 2003, Flavio S. Glock wrote: RFC - Do we need something like this? $span = DateTime::Span-hour( $dt ); $span = DateTime::Span-day( $dt ); ... What does this do? It is a shortcut to build frequently-used spans: $dt = DateTime-new( year = 2003, month = 10, day = 5, hour = 11 ); $span = DateTime::Span-day( $dt ); # whole-day span: # [ 2003-10-05T00:00:00 .. 2003-10-05T23:59:59 ] this is a tipical application: $set = DT::E::Recurrence-xxx; $today_events = $set-as_list( span = DateTime::Span-day( today ) ); $month_events = $set-as_list( span = DateTime::Span-month( today ) ); I don't think month makes it clear that it's this month versus the date and one month after it. I'm not averse to shortcuts, but they need to have clearer names. -dave /*=== House Absolute Consulting www.houseabsolute.com ===*/
RE: installing DateTime-TimeZone-0.17 on HPUX 10.20... or Cygwin
Hi Dave, On Mon, 2 Jun 2003, Ben Bennett wrote: I still think it is a MakeMaker problem, has anyone reported it to them? And are you guys using the latest MakeMaker? I think this might have been fixed in the new beta versions. -dave I just installed ExtUtils-MakeMaker-6.10_04 from CPAN. Same results :( Ron Hill
RE: Windows once more
On Mon, 2 Jun 2003, Hill, Ronald wrote: I was not able to find the Time::Local module on CPAN Yeah, it's not there yet. t\20infinite..NOK 12# Failed test (t\20infinite.t at line 55) # got: '1.#QNAN' # expected: '-1.#IND' t\20infinite..NOK 13# Failed test (t\20infinite.t at line 55) # got: '1.#QNAN' # expected: '-1.#IND' t\20infinite..NOK 14# Failed test (t\20infinite.t at line 55) # got: '0' # expected: '-1.#IND' t\20infinite..ok 36/36# Looks like you failed 3 tests of 36. ARGH! I give up. Someone else is going to have to fix this on Windows at this point, or maybe I'll just disable these tests on Win32. -dave /*=== House Absolute Consulting www.houseabsolute.com ===*/
RE: Patch DateTime-0.12 on HPUX Perl 5.8.0
Hi Dan, * Hill, Ronald [EMAIL PROTECTED] shaped the electrons to say... On Fri, 30 May 2003, Dan Sully wrote: HPUX doesn't have finite() - it has isfinite() instead. Not my HPUX box. I'm running 10.20 and the HP ANSI C compiler I tried the make test and here is a listing of the errors Of course they would have to change it between 10.20 and 11.00/11i I unfortunately don't have a 10.20 box to test on. What does a 'man finite' get you? -D I did a man on finite here are the results: DESCRIPTION The finite() function is recommended by the IEEE-754 standard for floating-point arithmetic. finite() returns 1 only when -INFINITY x +INFINITY. Otherwise, it returns 0 (that is, when x is +-INFINITY or x is NaN). finitef() is a float version of finite(); it takes a float argument. To use this function, compile either with the -Ae option or with the -Aa and -D_HPUX_SOURCE options. Otherwise, the compiler promotes the float argument to double, and the function returns incorrect results. finitef() is not specified by any standard, but it is named in accordance with the conventions specified in the Future Library Directions section of the ANSI C standard. I hope this helps Ron Hill
RE: Windows once more
On Mon, 2 Jun 2003, Hill, Ronald wrote: ARGH! I give up. Someone else is going to have to fix this on Windows at this point, or maybe I'll just disable these tests on Win32. -dave Oh, Dave please don't give up. We need this for all Platforms Otherwise, modules that use recurences will fail horribly! (like mine). This is the reason I need to install the latest DateTime.pm module, So I can test my module. I give up in the sense of patches welcome, but I don't have any idea what the problem is, so it's going to take someone who actually understands Windows to fix this. I can't even get it to work on HPUX :( Try removing the ifdef _HPUX_SOURCE part entirely. -dave /*=== House Absolute Consulting www.houseabsolute.com ===*/
RE: Windows once more
Hi Dave, On Mon, 2 Jun 2003, Hill, Ronald wrote: I can't even get it to work on HPUX :( Try removing the ifdef _HPUX_SOURCE part entirely. -dave I removed the section you suggested Still no joy :( Ron Hill
FAQ outstanding questions...
Typos in POD that I spotted during FAQ development: 1) DateTime::Format::Strptime: This method is synonymous with DateTime's strptime method. 2) DateTime: DateTime does not if second values greater than 59 are valid based on current leap seconds, and invalid values simply cause an over-flow. Questions that came up in the FAQ development (you can also see these in the FAQ in the correct context if you search for QUESTION): 1) Is it worthwhile to add an optional resolution argument to compare to allow easier usage? (There was discussion, but I don't think we came down anywhere) 2) What is the overlap between DateTime::Format::Builder and DateTime::Format::Strptime? Which is preferred? 3) QUESTION How do you print non 0 or space padded years and months? [in strftime] 4) Wasn't this [the DateTime constructor croaking on bad dates] going to be overridable? 5) What happened to the module that was going to handle guessing? [at short timezone names] 6) Is there something equivalent for two days from the end of the month? Should there be? Perhaps the flag should say whether the start or end of the month offset is what matters... [In DateTime::Duration] 7) Do Sets constructed from explicit dates always get sorted? 8) Should DateTime::Set have a way to add an more explicit dates without having to make a new set and union it in? 9) Do we need a DateTime::Set clone method (ditto span, etc.)? 10) Did we ever work out how to attatch information to a date from a set? [I remember a proposal floating about, I will have to look at the archives] 11) Are we going to return an object for +/-inf or will it always be a string? [I remember some discussion here, how did it turn out?] 12) Is that true about the SpanSet? If so the docs are wrong. [What does DateTime::Set-complement() (unary) return, a Set or a SpanSet, if a Set, what does it mean (the returned type is currently a Set, but the values are odd] 13) How do I set a time zone on a set? (and span and spanset) There are some other questions about alternate implementations and business logic that I need to think about (unless someone else has any bright ideas). Thanks, -ben
Re: FAQ outstanding questions...
On Mon, 2 Jun 2003, Ben Bennett wrote: 2) What is the overlap between DateTime::Format::Builder and DateTime::Format::Strptime? Which is preferred? Yeah, I'd like to know too. 4) Wasn't this [the DateTime constructor croaking on bad dates] going to be overridable? Not unless someone shows me a use case for it that can't be easily solved some other way. 6) Is there something equivalent for two days from the end of the month? Should there be? Perhaps the flag should say whether the start or end of the month offset is what matters... [In DateTime::Duration] my $dt = DateTime-last_day_of_month( year = 1999, month = 2 )-subtract( days = 2 ); 7) Do Sets constructed from explicit dates always get sorted? This question doesn't make sense. Sets are explicitly not an ordered entity. You're thinking of lists, which a set can be turned into. 8) Should DateTime::Set have a way to add an more explicit dates without having to make a new set and union it in? You can do $set-union($dt_object). I suppose allowing multiple arguments would make sense too. 9) Do we need a DateTime::Set clone method (ditto span, etc.)? It doesn't hurt. 10) Did we ever work out how to attatch information to a date from a set? [I remember a proposal floating about, I will have to look at the archives] No, I think this needs to be some sort of DT::Set extension. 11) Are we going to return an object for +/-inf or will it always be a string? [I remember some discussion here, how did it turn out?] It's not a string right now, it's a number that stringifies in various ways. Returning an object might be better. 13) How do I set a time zone on a set? (and span and spanset) You can't. That doesn't make sense. Set it on the objects you feed into it. -dave /*=== House Absolute Consulting www.houseabsolute.com ===*/