Today I am finally going to get around to the last two of my operators the 'Like' and 'Not Like'. This is where we get into sort a sticky wicket and we are entering the realm of 'regular expression' queries which may work quite differently on the various SQL boxes and I know 100% different in MongoDB and other non SQL dbs. So what to do??
Well I might as well go with the standard SQL ones '%' and '_' meaning multiple and single characters, and the next question do I validate for their present in a 'Like' as this sql
WHERE first_name LIKE 'Bob'
is perfectly valid though not a very good query. I guess no validation then, just pass in what I am given on on the param. Unfortunately like most predicates almost any combination is allowed as
Perl has the strange property that its data structures try very hard to spill their contents all over the place. Despite having dedicated syntax for arrays – @foo is an array variable, distinct from the single scalar variable $foo – it’s actually impossible to nest arrays.
my @foo = (1, 2, 3, 4);
my @bar = (@foo, @foo);
# @bar is now a flat list of eight items: 1, 2, 3, 4, 1, 2, 3, 4
The idea, I guess, is that an array is not one thing. It’s not a container, which happens to hold multiple things; it is multiple things. Anywhere that expects a single value, such as an array element, cannot contain an array, because an array fundamentally is not a single value.
And so we have “references”, which are a form of indirection, but also have the nice property that they’re single values.
This is a common thing for people to find weird about Perl. Really though it’s just a different default.
Perl’s reference-taking operator is simply dual with the splat operator in Ruby and recent Javascript.
We held a Perl 5 Porters Hackathon in Amsterdam October 12-15. This was our 2nd attempt to bring active porters together to sort out issues that might otherwise take months to sort out. We got quite a bit done.
Deprecation of $[
Last year, we went over all of the long-standing deprecations in core. All but $[ were given an official EOL. $[ was not because we could not come up with a plan.
There are 3 use cases we expect are going on:
using $[ in a conditional
Assigning to $[
Assigning to $[ but making it = 0 which doesn't do anything.
Very few modules on CPAN even mention $[. I provided a grep from the grep.metacpan.org backend. We determined there's roughly 100 lines of code on CPAN which would need to be fixed to eliminate the usage of $[ on CPAN. Ilmari offered to submit patches to fix them.
I was just about to add in the next operator on my, the 'Like' command but before I did that I added a few more tests for the 'in' operator and with this test;
The just-released v0.03 of GraphQL::Plugin::Convert::OpenAPI provides a plugin to convert a given OpenAPI specification (the spec formerly known as Swagger) to a GraphQL schema.
On Saturday (25th November), the London Perl Workshop (LPW) was held at the University of Westminster. It was a free-to-attend one-day conference that three tracks of talks and one of tutorials. It was also the first in the post-Mark Keating age. This is the report of this year's organising team: Katherine, Lee, Neil, Pete, and Rick.
In brief, the talks went down well and everyone seemed to enjoy themself. Read on for more!
I attended LPW 2017 on Saturday, 25th Nov 2017 at University of Westminster. It was such a great experience. I must admit, it was the best ever I attended so far. So all credit goes to the organizers and sponsors.
This time, I was prepared to give my second talk at London Perl Workshop. The topic of my talk was "Create tube map in 20 minutes using Map::Tube". I was scheduled to give the talk at 10:00AM. However the speaker of the talk just prior to my talk didn't turn up on time for some reason, I was then asked by Sawyer, if I am willing to give my talk earlier than the scheduled time. I said Yes without any hesitation. The only concern I had was about those who shown interest in my talk in advance are going to miss it.
For those who missed my talk, please download the slides here.
Now that I have a few little API things worked out from yesterday's post I better carry on and do the next two 'operators' 'In' and 'Not In'
My original though was these two operators would now require a little parameter validation like I did for the 'Between' as most of us know the very common form of an SQL 'In' queries one like these two;
SELECT * FROM users WHERE id in (SELECT user_id FROM drivers) ;
SELECT * FROM users WHERE id in (109,100,22) ;
should just be handled by the present type and coercion code in the system but I just read that this form of SQL
SELECT * FROM users WHERE id in (SELECT user_id FROM drivers,22) ;
Ah, the joys of conference-driven development. DRYing your Perl Tests is now out, probably going to be a series, maybe even a book. It's just a quick take on refactoring test suites in Perl 6. Maybe it goes too far, but at least it goes somewhere. I actually promised this before London Perl Workshop 2017 and made it almost on time.
It fix the API (yet again) day here in the Moose-Pen
So as we all know I have been playing with the extended operators over the last few posts and I just notices something in my code;
I can enter a mixed case operator like this 'BeETween' and things will still work. This is good but I think I left a part out on the Database::Deriver side of things and in Driver ::DBI I do this;
On 16th Aug 2017, the CPAN day, I blogged about my plan for the day. In that blog, I also mentioned about my personal milestone, finishing maximum number of months in a calendar year with atleast one PR each day. If I look back historical data, in the year 2015, I had 3 such months (Oct:45, Nov:31, Dec:60).
The following year 2016, doesn't look nice, as I could only get in 1 month (Dec: 77).
However, the year 2017, looks much better as compare to previous two years. So far I managed to get in 5 months with at least 1 PR each day ((Jan:63, Jul:32, Aug:42, Oct:40, Nov: 30).
I am hoping to get Dec in as well to make it 6 months in the year 2017 beating my previous best 3 months in the year (2015). The chances are very bright as I will be participating the 24PullRequest challenge next month, which runs from 1st Dec - 24th Dec.
Overall, so far, as of today, I have submitted 605 PullRequests out of those 400 have been accepted and merged.
The MetaCPAN 2017 Hackathon, a.k.a. meta::hack v2, is the second dedicated MetaCPAN hackathon. This year the event was held in Chicago from November 16th to 19th, in server central office.
I would like to give special thanks to all event sponsors: Booking.com, cPanel, ServerCentral, Kritika without them this would have not been possible.
I took part in this event during the last three days and mainly focused on grep.metacpan.org project, which was created as an experimental project earlier this year during the QA Hackathon in Lyon, France.
That article is just a quick summary of my current participation, much more happened from all other participants, and global progress made is pretty impressive!
Since the original version of grep.metacpan.org, which appeared broken from Day 1 due to the lack of libpcre support from the git version used, many things improved and I hope you could have a smoother experience searching code extract...
Hmm I could just copy and past yesterday's postette here and and in 'NOT' in the correct places to get today's 'Is Not Null' operator postette but I an not going to take the schlock path today.
As I implied it is the turn of the 'Is Not Null' operator today another very easy one for a postette ad I start with the same test as yesterday and just add Not where needed, no need for that here.
As for the Driver::DBI code I could just add in another 'else if' into that _predicate_sql' sub but I think I will take a little different approach and have one 'elsif' that covers both. Here is the patch
How exciting! The London Perl Workshop is this Saturday, and as you may or may not know, it's not just London's premier Perl event, it's also London's premier social event! It's not to late to register to attend, for free!
Pre-Workshop Drinks
Our generous sponsor WCN are sponsoring a pre-workshop social event, which is a chance to catch up with old friends, make new friends, and hang out drinking beer (or wine, or whatever you want really) around Perl-y people. WCN specialise in providing a cloud-based talent acquisition technology suite and have decades of award-winning recruitment software expertise and an obsession with driving real change in organisations.
The pre-workshop drinks are at the Carpenter's Arms:
Meta::Hack is about getting the core MetaCPAN team together for a few
days to work on improving... well as much as possible! Last year we
focused on deploying to a new infrastructure, with new version of
Elasticsearch. This year was a much more varied set of things we wanted
to achieve.
Why get together?
Whilst Olaf couldn't attend in person, we had him up on the big screen in
the ServerCentral (who kindly hosted us and bought us lunch) offices so it
was almost as good as him being physically there. Having us together meant
we could really support each other as questions arose.. a fun one was tracking
down that the string JSON::PP::Boolean, incorrectly identifies as is_bool
in JSON::PP - there is a pull request - though
that's not released yet. We also found bugs in our own code!