[RFC] Astro related modules

2003-10-22 Thread Daisuke Maki
I've now re-organized the astronomical calculation portions of the
chinese calendar modules into the following. This should be nicer to the
namespace. Please let me know if they look ok:

   http://www.wafu.ne.jp/~daisuke/DateTime-Util-Calc-0.01.tar.gz
   http://www.wafu.ne.jp/~daisuke/DateTime-Util-Astro-0.01.tar.gz
   http://www.wafu.ne.jp/~daisuke/DateTime-Event-Lunar-0.01.tar.gz

I also plan to create Astro::Event::SolarTerm, which will allow me to
partition things nicely within my planned DT::C::Chinese and
DT::C::Japanese.


--d




Re: [RFC] DateTime::Bundle::Minimal and DateTime::Bundle::Basic

2003-10-22 Thread Iain Truskett

Also, regarding DTF::HTTP suitability, it has a requirement of
HTTP::Date which is part of LWP. This probably counts against it for
bundling (though most people using bundles probably have LWP already).


cheers,
-- 
Iain.  


pgp0.pgp
Description: PGP signature


Re: [RFC] DateTime::Bundle::Minimal and DateTime::Bundle::Basic

2003-10-22 Thread Iain Truskett
* [EMAIL PROTECTED] ([EMAIL PROTECTED]) [23 Oct 2003 08:01]:

[...]
> That sounds like a good idea, however I'm not sure about
> including DT::F::Mail and DT::F::HTTP. They seem to be
> fairly specific- task oriented modules.
>
> I admit that they're probably common tasks, but if I
> wanted a quick way to get up and going with DateTime, but
> it was for DBI, I'd be annoyed that I was getting net-
> related modules.

Their primary format is the one in their name, i.e. rfc
based formats. However both are capable of understanding
way more than that. With the exception of the DTF::Manip,
Mail and HTTP are probably the most flexible parsers. Though
DTF::Pg seems to have quite a few formats up its sleeves.

Personally, speaking as author of both, and as a non-Bundle
user, I don't really mind either way. As a DT user, Mail,
HTTP and W3CDTF cover 97% of all formatting and parsing
cases I come across. That's me and _my_ use cases though.


cheers,
-- 
Iain.  


pgp0.pgp
Description: PGP signature


Re: RFC: DateTime::TemporalValue

2003-10-22 Thread Rick Measham
Dan Kubb wrote:
> I recently worked on a project where I had to keep track of data
> that changed over time.  I needed to keep a history of the
> changes, as well as allow values to be specified for future
> time periods.

> For example, a value could be set, and it would go into
> effect starting now.  A second value could be set that
> goes into effect in 2 weeks, and expires 2 weeks after
> that.. after which time, the original value goes back
> into effect.
# snip
> I'm certainly open to suggestions, or criticism on the code or
> interface.  I'm not even sure this belongs under the DateTime
> namespace, but I figured this was the best place to start asking.

G'day Dan,

Thanks for your interest. A couple of things ...

1. You need to put it somewhere further under the namespace. Such as
DateTime::Event::Temporal?

2. This sounds very similar to the Calendaring system I'm working on ...
I just hadn't thought of this sort of event. Currently when two events
clash, one disappears while the other remains. Or one of them moves to
some open time. However your event replaces only the intersecting
portions. This sort of event will help in other places too.

Also, DateTime::Event::Calendar can store a value with an event, and can
even happily store a reference such as a hashref so there's no problem
retrieving your value.

Here's some example code:

$calendar = DateTime::Event::Calendar->new('Temporal Value');

$calendar->register(
behaviour => 'blockout', # not a good name, still thinking
event => DateTime::Event::Calendar::Event->from_span(
start => $dt1,
end   => $dt2,
),
data  => '1',
}

$calendar->register(
behaviour => 'blockout', 
event => DateTime::Event::Calendar::Event->from_span(
start => $dt3,
end   => $dt4,
),
data  => '2',
}

__END__

So it's all in there now. Given dt3 and dt4 fall between dt1 and dt2,
here's what we have:

   dt1 dt3 dt4   dt2
|---^---^---^-^-|

And as we travel through the calendar, $calendar->current_event->data
returns:
|   211 |

Which I believe is the result you need?


Cheers!
Rick Measham




Re: [RFC] DateTime::Bundle::Minimal and DateTime::Bundle::Basic

2003-10-22 Thread rickmeasham
 
 
 
 
> Dave Rolsky schreef: 
> > DateTime, it will tell you that you need these 
prereqs anyway. 
 
Eugene van der Pijll <[EMAIL PROTECTED]> wrote: 
> The first few versions of Bundle::DateTime left out 
those prereqs. 
> As a result, the bundle was difficult to install for the 
first time: 
 
A good point Dave, so there's really no need for 
Bundle::DateTime::Minimal, as you get the same thing 
by just installing DateTime with CPAN. 
 
So then we're left with the other bundle, which Eugene 
has suggested calling Bundle::DateTime, and moving 
the existing bundle to Bundle::DateTime::Complete. 
 
That sounds like a good idea, however I'm not sure 
about including DT::F::Mail and DT::F::HTTP. They 
seem to be fairly specific-task oriented modules. 
 
I admit that they're probably common tasks, but if I 
wanted a quick way to get up and going with 
DateTime, but it was for DBI, I'd be annoyed that I 
was getting net-related modules. 
 
I'm open to including them, just a little disinclined. 
 
Cheers! 
Rick 
 
P.S. Eugene: as you point out, you need to include all 
prerequisites in the bundle. It also seems that the 
order is of the utmost importance. I had to install the 
current bundle at least four times before it got 
everything installed. I wondered if that could be 
because it installs the modules in the order in the file 
rather than downloading them all and checking 
prereq's first. On the other hand I seem to recall 
CPAN.pm didn't fully install before it went on to the 
next one.. maybe I have an old CPAN. 
 
Cheers more! 
Rick 


Re: [RFC] DateTime::Bundle::Minimal and DateTime::Bundle::Basic

2003-10-22 Thread Eugene van der Pijll
Dave Rolsky schreef:
> On Wed, 22 Oct 2003, Eugene van der Pijll wrote:
> 
> > DT prereq's:
> > Class::Factory::Util 1.3 - prereq's of DateTime
> > Params::Validate 0.52
> > Test::More 0
> > Time::Local 1.04
> > Class::Singleton 1.03 - prereq of DT::TimeZone
> > DateTime::Locale 0.03 - needed by DateTime
> > DateTime::TimeZone 0.25 - needed by DateTime
> > DateTime
> 
> I don't get how this is useful.  If you use CPAN or CPANPLUS to install
> DateTime, it will tell you that you need these prereqs anyway.

The first few versions of Bundle::DateTime left out those prereqs.
As a result, the bundle was difficult to install for the first time:
I can't remember exactly what happened, but DateTime couldn't be
installed first time round because of its prereqs; the prereqs were
installed; then CPAN first tried to install all other
modules in Bundle::DateTime before installing DateTime itself, and each
installation failed of course...

The best solution seemed to be to include the prereqs in the Bundle.

Eugene


Re: [RFC] DateTime::Bundle::Minimal and DateTime::Bundle::Basic

2003-10-22 Thread Dave Rolsky
On Wed, 22 Oct 2003, Eugene van der Pijll wrote:

> DT prereq's:
> Class::Factory::Util 1.3 - prereq's of DateTime
> Params::Validate 0.52
> Test::More 0
> Time::Local 1.04
> Class::Singleton 1.03 - prereq of DT::TimeZone
> DateTime::Locale 0.03 - needed by DateTime
> DateTime::TimeZone 0.25 - needed by DateTime
> DateTime

I don't get how this is useful.  If you use CPAN or CPANPLUS to install
DateTime, it will tell you that you need these prereqs anyway.


-dave

/*===
House Absolute Consulting
www.houseabsolute.com
===*/



Re: [RFC] DateTime::Bundle::Minimal and DateTime::Bundle::Basic

2003-10-22 Thread Eugene van der Pijll
Rick Measham schreef:
> I just installed Bundle::DateTime on my Darwin machine ... I hadn't 
> looked through the docs beforehand :)
> 
> Can I suggest two other bundles that I'm willing to maintain (they 
> shouldn't need much alteration anyway. Not like the full bundle!)
> 
> Bundle::DateTime::Minimal is the minimum needed to install and use 
> DateTime.pm
> 
> Bundle::DateTime::Basic contains the above, plus the extra modules 
> required for Sets and Spans as well as the main Format modules

I would prefer just 1 more bundle, Bundle::DateTime, containing the
mimimum needed for DateTime.pm, and a few selected other modules that
don't introduce new prereq's:

DT prereq's:
Class::Factory::Util 1.3 - prereq's of DateTime
Params::Validate 0.52
Test::More 0
Time::Local 1.04
Class::Singleton 1.03 - prereq of DT::TimeZone
DateTime::Locale 0.03 - needed by DateTime
DateTime::TimeZone 0.25 - needed by DateTime
DateTime

your choices for basic:
DateTime::Set
DateTime::Format::Strptime -- needed by DT::F::Builder
DateTime::Format::Builder -- prereq of several other formats

my additions:
DateTime::Format::HTTP
DateTime::Format::ISO8601
DateTime::Format::Mail

> Maybe we could also look at Bundle::DateTime::Formatters to 
> quick-install all the formatters and Bundle::DateTime::Events to 
> quick-install all events and DateTime::Bundle::Calendars to install 
> all the calendars. That's more work though ...

I can't imagine anyone else but a kalendrophile installing all
calendars, or all events, and kalendrophiles can just install
Bundle::DateTime::Complete.

(I created Bundle::DateTime for myself, to have a simple method of
getting all DT modules; I don't think it's the best way to install
DateTime.pm, so I wouldn't mind renaming it to B::DT::Complete. With the
name as it is, a query for DateTime in the CPAN.pm shell will return
both DateTime.pm and Bundle/DateTime.pm, which is not good.)

Eugene


Re: RFC: DateTime::TemporalValue

2003-10-22 Thread Flavio S. Glock
Dan Kubb wrote:
> 
> I recently worked on a project where I had to keep track of data
> that changed over time.  I needed to keep a history of the
> changes, as well as allow values to be specified for future
> time periods.


DateTime::TemporalValue
082:  #Class::Multimethods could really clean this up, but it doesn't
work
083:  #under mod_perl yet, so I can't use it.
  
How about (untested):

  my $spanset = DT::SpanSet->empty_set->union( @_ );

from the docs:
 Set operations may be performed not only with 
 DateTime::SpanSet objects, but also with DateTime,
 DateTime::Set and DateTime::Span objects.

- Flavio S. Glock