Author of:
and maintainer of:
http://jonasbn.livejournal.com/
I wrote my first entry here back in June 2002 on the 30th. Time to move on...
Take care and thanks for all the good, funny and insightful comments...
I am experiencing serious trouble attempting to post journal entries to use.perl.
Somebody else complained about this and somebody else responded, but I cannot find the entry again
use.perl has been my primary blog for a long time, perhaps it is time to move on...
This assignment was a small one, estimated to about 20 hours, it did however go a bit over estimate. The project scope was to develop a form to collect data to populate a PDF page.
I know that the PDF format has a form technology integrated, but I did not have the time to investigate this any further. so I spent a friday evening prototyping different PDF modules from CPAN and settled PDF::API2. Developing it in Perl would allow me to integrate with the existing framework - a new technology from Adobe or similar was too much of a risk for such a small task.
We started out two developers, this backfired a bit when we got to integrate the two parts we had developed and we spent a lot of time testing and debugging. I ended up wrapping up the project myself.
I do not quite understand why the court ruling involving the Artistic License has not got more blogging time in the Perl community.
I read an article on the case in Dr. Dobbs, after seeing it mentioned in non-perl RSS feeds.
The article mentions members of the Perl community I have met and our very own Perl Foundation.
So from here a huge cheer and congratulations on the outcome as the author of the article writes:
It's a big deal.
So I sat down with the training plans I (somewhat) followed preparing for last years Copenhagen Marathon and attempted to layout a plan, but lazyness got me so I wrote a script.
The date for next years Copenhagen Marathon in 24th. of May 2009 (the argument to the script).
Here is the output (the training plan):
hoarfrost
; perl marathon-training.pl 24052009
Week: 01 Week number: 50 Distance: 35
Week: 02 Week number: 51 Distance: 30
Week: 03 Week number: 52 Distance: 40
Week: 04 Week number: 1 Distance: 40
Week: 05 Week number: 2 Distance: 40
Week: 06 Week number: 3 Distance: 35
Week: 07 Week number: 4 Distance: 45
Week: 08 Week number: 5 Distance: 45
Week: 09 Week number: 6 Distance: 45
Week: 10 Week number: 7 Distance: 40
Week: 11 Week number: 8 Distance: 50
Week: 12 Week number: 9 Distance: 50
Week: 13 Week number: 10 Distance: 50
Week: 14 Week number: 11 Distance: 45
Week: 15 Week number: 12 Distance: 55
Week: 16 Week number: 13 Distance: 55
Week: 17 Week number: 14 Distance: 55
Week: 18 Week number: 15 Distance: 50
Week: 19 Week number: 16 Distance: 60
Week: 20 Week number: 17 Distance: 65
Week: 21 Week number: 18 Distance: 65
Week: 22 Week number: 19 Distance: 50
Week: 23 Week number: 20 Distance: 45
Week: 24 Week number: 21 Distance: 20
And here is the script:
#!/usr/bin/perl
# $Id$
use strict;
use warnings;
use DateTime;
use constant DAYS_IN_WEEK => 7;
our $VERSION = '0.01';
my @distances
= qw(20 45 50 65 65 60 50 55 55 55 45 50 50 50 40 45 45 45 35 40 40 40 30 35);
if ( !$ARGV[0] ) {
die 'Usage: marathon-training.pl <date of marathon ddmmyyyy>';
}
#parsing argument
my ( $day, $month, $year ) = $ARGV[0] =~ m{
(\d{2}) #day (two digits)
(\d{2}) #month (two digits)
(\d{4}) #year (four digits)
}mx;
#DT does it own dying
my $dt = new DateTime(
year => $year,
month => $month,
day => $day,
time_zone => 'UTC',
);
#Using DateTime (machine) to go back the number of weeks scheduled in distances
#minus one of be of by one week when we get to the marathon, eventhough an
#extra week of preparation might not hurt
$dt = $dt->subtract(
DateTime::Duration->new(
days => ( DAYS_IN_WEEK * scalar @distances ) - DAYS_IN_WEEK
)
);
#Print the plan from the beginning and on...
my $i = 0;
while (@distances) {
printf 'Week: %02d', ++$i;
print "\tWeek number: " . $dt->week_number();
$dt = $dt->add( DateTime::Duration->new( days => DAYS_IN_WEEK ) );
print "\tDistance: " . pop @distances;
print "\n";
}
exit 0;
Of course the scripts TODO list would be long, things like localization etc. should be taken into consideration.
I skipped the Sparta training 13 km. run. My legs are sore after doing 30 km. last week and cleaning/emptying our attic Saturday (which is on the 5th. floor).
Tomorrow night I will do my regular 10 km. and next Sunday I think I am up for something a bit longer.
Soreness and everything taken into consideration it feels really good to be running again and I am aiming for doing 10 km. in 45 minutes.
Made 10 km. again yesterday. My time was about 50 minutes, which I think is quite good after such a long break.
http://nikeplus.nike.com/nikeplus/?l=runners,runs,1755202461,runID,808694827
I bought a new chip from Nike/Apple the day before and it just works out perfectly, so now I can start logging some kilometers again - yay!
Finally I was able to get this release uploaded.
http://search.cpan.org/~jonasbn/Business-DK-CPR/lib/Business/DK/CPR.pm
The list of changes is long, mosy important change is that by now I support the new CPR numbers issued in Denmark.
Should be at your local mirror shortly.
Ok, yesterday I got my running schedule laid out.
I have not applied kilometer goals etc. I will do that later on, for now I just need to get into a regular interval.
And guess what! - I did 10 km. last night in 50 minutes. My left leg is hurting a bit today, but I think I will be ready for Wednesday where my next run is scheduled.
Update: And my chip died so I need to get a new set before Wednesday and I have no record of this run anywhere...
Sparta had their first marathon practice run yesterday. I did not participate
I had planned to get up to speed so I could run 13 km, but I have not run a single kilometer.
So my plan is to get ready for next sunday, I feel fat, lazy and weak - I have to get back on track. Running is so good in so many ways.