Metric Time in Tau Station

If you've been following our progress with Tau Station, you know we're creating a science fiction universe in Perl for people to enjoy. As of this writing, the time in Tau Station is 194.10/51:647 GCT.

"GCT" stands for "Galactic Coordinated Time" and that's a variant of metric time. As a software developer, I wish we had that in the real world, but alas, we don't.

The GCT time listed above is roughly 194 years and 10 days after the "Catastrophe" (an apocalyptic event that effectively serves as our "epoch"). There are 100 days in a year, 100 "segments" in a day (14.4 minutes each) and 1000 units in a segment (.864 seconds each).

I love the fact that figuring out the display time for GCT is this simple:

my $days = sprintf "%9.5f" => $seconds_since_catastrophe / $second_in_a_day;
$days =~ m{^(?<year>\d+)(?<day>\d\d)\.(?<segment>\d\d)(?<unit>\d\d\d)}a;
my $gct = "$+{year}.$+{day}/$+{segment}:$+{unit} GCT";

Perl 5 Porters Mailing List Summary: March 6th-12th

Hey everyone,

Following is the p5p (Perl 5 Porters) mailing list summary for the past week.

Enjoy!

Perl6::Tidy initial release

Perl6::Tidy has been released to GitHub, not on the ecosystem yet. The driver program is 3 lines, mostly passing options to the tidier. Which is 6 lines, doing the real grunt work.

It doesn't do much yet, but it's pure Perl 6.

Raspberry Pi becoming more prevalent?

The last half-year or so, I've been hacking on different Integrated Circuits, various small hardware, learning how to wrap specific C software (while ensuring the code remains within the Perl license) in order to bring the Raspberry Pi toward the realm of reasonable Perl programming.

I have written numerous pieces of software to allow this. The first was WiringPi::API. This is the core wrapper that allows you to use the wiringPi library right from your Perl scripts.

I pushed this further with RPi::WiringPi, which is an object oriented wrapper for WiringPi::API, but performs important benefits; it registers pins so you can't re-use them by 'accident', and it does an auto-cleanup (ie. it resets everything back to non-dangerous state) on failure. It also allows you to pull in other RPi-type objects and use them directly.

With the different ICs, hardware, etc that the RPI:: scope encompasses, I've finally run into a situation where I can't effectively ensure the quality of it all.

My First Articles

It's my first articles in blogs.perl.org

Dancer2 0.205000 improves application speed, deprecates request->dispatch_path

Dancer2 0.205000 is on it’s way to CPAN, and brings with it a number of bug fixes, documentation improvements, and enhancements. The changes with the most potential impact to your existing applications include:

[Off topic] PHP syntax is (version && context) dependent

PHP accepts or rejects certain syntax depending on the context.

Let's hope you never have to deal with things like this.

Shire Calendar Update

I have recently adopted modules Date::Tolkien::Shire and DateTime::Fiction::JRRTolkien::Shire.

The releases to date have been relatively minor fixes, but the development releases of a couple days ago are more significant, to the extent that I thought users of these modules should get a "heads up."

  • Common code and data have been factored out into Date::Tolkien::Shire::Data. This module also provides time formatting, allowing the implementation of a strftime() method in both the original modules.
  • The direct conversion of dates between Gregorian and Shire in both modules has been replaced by calculations in terms of Rata Die days. Regression tests have been provided (in xt/author/regression.t) to try to ensure that this did not break anything.
  • DateTime::Fiction::JRRTolkien::Shire has been provided with most of the DateTime interface. The known missing pieces are:
    • Duration and date arithmetic. I hope to add this in a subsequent release.
    • format_cldr(). I am not sure whether this will be added or not; at the moment the implementation path is unclear to me.
    • era(), which is marked as deprecated in the DateTime code.

I can not imagine that there are any mission-critical uses of these modules, but interested parties should probably take a look at the revisions, and let me know if anything untoward turns up.

Tom Wyant

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is hosted by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.