I left off yesterday with a little re factoring to do. I had essentially the same code for handling construction errors in Accessor.pm and in Types.pm. In any other object orientated language I ever worked with this would be rather a pain to fix. Even in plain perl one would have a few problems getting things just right.
Fortunately I am using Moose.
The great thing about Moose a Role can consume another Role. So all I needed to do was suck out all the code I need from the 'around BUILDARGS' call in Accessor.pm and then place it in a separate role class 'Database::Accessor::Roles::AllErrors', create a function to call and then adapt it to run 'inline'.
By 'inline' I mean call the function as if it was an exposed function in some other module. That means I do not this the normal 'shift' at the start of a sub to get the calling instance.
I added a new session storage backend for Dancer2 today. Dancer2::Session::CHI is on its way to your local CPAN mirror. If you are currently using CHI in your Dancer2 applications, this will let you use CHI as your backing datastore for storage data. Please see the pod for details.
Contact me with any issues you may have, or file them on the github bugtracker.
Version 0.03 of XML::Invisible is now on CPAN. This lets you write parsers that produce XML-like Abstract Syntax Trees (AST), or actual XML documents, without writing any code. Why did I write it?
Parsing: a tiny introduction
Parsing is turning a text input, into semantically valuable output. It is often broken into the stages of lexing (turning the initial text into tokens - errors detected if invalid tokens given), parsing (structuring those tokens into ASTs - errors if structure wrong), later processing (doing something with the AST).
There are a number of ways of writing parsers generally. The most maintainable way is using as much of a declarative style as possible, usually by writing a grammar. There are various options in Perl, including Marpa, Parse::RecDescent, and Pegex. For each of these, you have to write a grammar (obviously), and write some code to handle the text inputs and parsing results.
I have updated my "Parsing: a Timeline" to version 3.1. You can see the official announcement on my blog, or "cheat" by going straight to the new timeline.
The timeline is a painless introduction to a fascinating and important story which is scattered among one of the most forbidding literatures in computer science. Previous versions have been, by far, the most popular of my writings.
A third of Timeline 3.1 is new, added since the 3.0 version. Much of the new material is adapted from previous blog posts, both old and recent. Other material is completely new. The sections that are not new with 3.1 has been carefully reviewed and heavily revised.
I was all ready to wrap up my 'new' constructor errors when I figured I better see what I get when I do something like this;
$da->reset_conditions();
$da->add_condition( {
right => { value => 'test' },
operator => '=',
},);
which will fail as I have no 'left' on that 'condition' and that is what I got.
Attribute (left) is required at D:\GitHub\database-accessor\lib/Database/Accessor/Types.pm line 119 Looks like your test exited with 255 just after 16.
Between Christmas and new year (Dec 27-30) Leipzig, Germany will hold the largest hacker conference in Europe: the 35th Chaos Communication Congress. Do you consider going to 35c3?
Tickets are sold only in presale. Phase I is reserved to inhabitants of the CCC universe (this doesn't require membership to any organization–CCC e.V. [registered society] members only get a lower price) and in phase II anyone has a chance to get a ticket in the ticket shop.
Last year at the 34c3 I met some Perl people by chance and we agreed to meet this year again and to form an assembly (explanation and list of them from last year). Those are areas shaped by a special interest groups and can be anything from a simple desk up to buildings in the exhibition hall. Do we want to form an assembly (probably a pair of desks for a start)?
On behalf of the Dancer Core Team, I am trying to get a 2018 Dancer Advent Calendar organized, and we would like your help and input!
How can you help? It's simple! Are there articles covering some specific area of Dancer or its ecosystem that you would like to know more about? Just reply and let us know what you would like to see.
Do you want to write an article for the advent calendar? Tell us your Dancer success stories, all about a plugin you authored, how your migration from D1 to D2 went... the sky is the limit.
If you have any ideas, please submit them soon to give authors a chance to work on content for the calendar.
Well its fix one break everything day here in the Moose-Pen
I thouhg it was just going to be one of those quick look how well things pass postette days today but I was dead wrong;
I did a check in a a quick push and then ran the full test suite and got
t/20_dad_load.t ............. Attribute (conditions) does not pass the type constraint because: ArrayRefofConditions can not be an empty array ref at /usr/local/lib/perl/5.18.2/Moose/Object.pm line 24
Moose::Object::new('Database::Accessor', 'HASH(0x2eeb320)') called at t/20_dad_load.t line 15
# Looks like your test exited with 255 before it could output anything.
So many times I just had to kill the run.
I am about 99.99756% sure it was this cnage from yeaterday
I've not been writing here much because I've been busy building Tau Station--a narrative sci-fi MMORPG. I'm also doing a lot of client work and that keeps me from sharing much here since I tend to take a bit more time when I write entries on this blog.
However, I've taken the time to set up a new homepage for myself. It uses Github pages because it was ridiculously easy to get started. I'm consolidating many of my more popular articles there, and many of the pages have a comments section powered by Disqus.
Final day... and the RPerl live demo works! We can show how fast the compiler runs, and some people even asked if it’s for real. It is! Will and Mahrez did a great job, but they didn’t stop there; RPM installation packages are now available for programmers to try RPerl on their own code. CentOS 7 is currently supported, with more RedHat and Debian operating systems coming up next.
RPerl is an open source project, meant to benefit the whole community, and even if I don’t really get it, I’m very proud to promote that. I am not a computer programmer myself,
but I am happy to call myself a "Friend of Perl" and also a "Friend of RPerl". You can, too!
I had the great pleasure of talking to Gloria Wall on that last day, after the brilliant interview she gave on day 2. (For those who don't already know, Gloria is the wife of Perl founder Larry Wall.) She told me that not being a programmer doesn’t mean I don’t belong here. Everyone should feel welcome to join in, and bring whoever is interested. I’ll remember that conversation as one of the highlights of this conference. I’m very happy to have been part of it, and I can’t wait until the next one!
Just when I though I had all the bugs out of my Database::Accessor I found a bunch more while finishing off tests case '42_new_validation.t'.
Most of the bugs where with the 'links' attribute. My test for this attribute are a check to make sure a link has a 'to' is present, and it not undef, and the same for type and then at lease on condition is present.
The first bug was
not ok 19 - type is proper link ; links
and the error it was throwing was;
'links->type' Constraint: The Link 'undef', is not a valid Accessor Link! Try one of 'LEFT', 'OUTER', 'RIGHT'
We’ve been missing a Log4perl plugin for Dancer2 for, well, forever, and this weekend I have released Dancer2::Logger::Log4perl.
This was originally developed by Ryan Larscheidt and Jon Miner at the University of Wisconsin. I have added a minimal test, a little pod, and wrapped a release around it. The rest of this is their work, and I cannot thank them enough for making this happen. Special thanks goes out to Mohammad S Anwar for finding some omissions from my original release earlier this weekend.
There are more tests needed still, but I wanted to get this out in the wild as soon as I could.
If you notice any issues, please report them at https://github.com/cromedome/Dancer2-Logger-Log4perl/issues
After a round of code review the js branch has been merged into master.
The nqp part has been on master for a long time so the whole js backend is now merged
In other good news 6pad is up (https://perl6.github.io/6pad/).
6pad allows you to compile and run Perl 6 code from the comforts of your own browser.
For now Rakudo.js depends on BigInt support (which mean you should likely use 6pad with Chrome).
BigInt support is being worked on Firefox and all the Chrome derivatives should update their V8s soon.
6pad is still being worked on so it still likely has some bug.
Support for using React to create DOM elements is planned and should come soon.
6pad has support for running your gists so if you write your own spiffy Perl 6 example I'll show it to 6pad users.
Focus of the JS backend will now be on on polishing 6pad and fixing some failing tests.
I (Zoffix Znet) am writing this document to Larry Wall to request the creation of a second name for the "Perl 6" language. This name is not a rename of the language, but is simply an alternative name, an alias. Similar to how TimToady is an alias for Larry Wall.
It's been a year and a half since the time when I first re-opened this issue with a blog post, and in this document, I compiled the argumentation for creation of the alias, the community suggestions for what that alias might look like, along with the observations of discussions on the topic that occured during that time period.
I ask that Larry Wall renders his decision on the alias by November 1, 2018, so we would have the time to create proper informational materials for the 6.d language release, during which time, the name alias would be officially announced, if one is chosen.
Now that I have my constructor single error working the way I like I figure I better go back and clean up my test cases and create a new test case just to check the error on 'new' construction.
I am going to start with '30_view.t' as that is the one I have been mucking with most over the past little while.
The first thing I did was strip out the new 'validation' tests and suck them in a new tests case '42_new_validation.t' and after a few adjustments it presently looks like this;
Developers team of the PVS-Studio static code analyzer for C/C++/C#/Java checked the Perl 5 source code and found some errors.
For example, the incorrect using of the ternary operator:
V502 Perhaps the '?:' operator works in a different way than it was expected. The '?:' operator has a lower priority than the '-' operator. toke.c 9494
I'm planning to remove the module Unicode::Properties from CPAN. The reason to remove the module is that it is outdated (the code is from 2008), the module uses a faulty methodology to get the properties, and it is unreasonable to maintain in its current form. Currently the module has no stars on metacpan, has no reviews or reverse dependencies, and the only user feedback I have received, from Tom Christiansen was to tell me that the module wasn't good enough for his purposes (see module doc), so I assume it is unused.
If you are a user of this module, please let me know. If you want to adopt the module (strongly not recommended) let me know.
For the October 9 gathering of Boston Perl Mongers we'll be hosted by MaxMind in Waltham, instead of our usual MIT location. Our speaker will be Mark Fowler.
(Boston.PM is happy to accept this offer of hosting from MaxMind, and would welcome hosting offers from other organizations in Eastern MA. It gives those who live further West or otherwise are unable/unwilling to travel to the city a chance to attend.
We're also looking for presenters. You don't have to travel to Boston. Remote presenters welcome. Have a module you want to promote, or a conference talk you'd like to "beta test" or give again, see our presenter's guide.)
About the talk:
A resource for beginners and advanced Perl users alike, the Perl Advent calendar features humorous stories featuring Santa's Elves and the fun they have with Perl. This talk will talk about all the exciting things that occurred in last year's calendar. Somewhat akin to twenty four two minute lighting talks, it'll expose you to a wide range of topics.