Today I am going to give params and containers a miss and move back into the '30_fields.t' test that I left alone so long ago. One of the planned concepts in Database::Accessor it the ability to have static data as part of the elements array. This is accomplished by using the 'Param' class in place of the “Element' class so you could do an SQL like this
SELECT 'User Name:', username, 'Address:', address FROM user
Why one wold want to do that I am not 100% sure on though I have seen it done in the past like the above for a reporting purposes. I could just simply make the Driver::DBI code insert the scalar values when it detects them but then I would be opening myself up to the good old '
Little Bobby Tables
This is the second part in the series! Be sure you
read Part I first where we discuss
what Seqs are and how to .cache them.
Today, we'll take the Seq apart and see what's up in it; what drives it;
and how to make it do exactly what we want.
PART II: That Iterated Quickly
The main piece that makes a Seq do its thing is
an object that does the Iterator
role. It's this object that knows how to generate the next value, whenever
we try to pull a value from a Seq, or push all of its values somewhere, or
simply discard all of the remaining values.
So
yesterday
I had left over SQL error that I wanted to have a look at. The error was
FROM locations WHERE <*>.city =
so I had no view in the where predicate;
$new_da->add_condition({left =>{ name => 'city',
},
right =>{ value => $other_user}
});
As I have saind in many previous posts I want to got give the DAD writer data that is as sanitized as possiable and therefor I should fix the above.
I first broke the code for setting the element on a view into is own private sub;
I've got quite a few CPAN distributions that require one another, and it's gotten to the point that it's very easy to forget to bump prereq versions before uploading a new release to the CPAN.
As a stopgap, I wrote Module::CheckDep::Version (may not be indexed yet). What this module does is using MetaCPAN::Client, fetches all distributions by author, pulls out all prerequisite distributions and the version of it that your distribution has listed, checks if there's a newer version of it, and lists out the ones that need a bump in the prereq's version.
Update: I've updated the distribution (v0.05) to install a binary, checkdep, so that you don't have to write your own to use the library:
[This is an addendum post to a series. You may want to begin at the beginning. The last update was update #1.
IMPORTANT NOTE! When I provide you links to code on GitHub, I’m giving you links to particular commits. This allows me to show you the code as it was at the time the blog post was written and insures that the code references will make sense in the context of this post. Just be aware that the latest version of the code may be very different.]
This year is only the second time since 2011 that I’ve been unable to attend YAPC::NA. Since I couldn’t make it out to hang with my Perl peeps in person, I thought the least I could do is offer up a long-awaited update to Date::Easy.
This latest version (available now-ish on CPAN as 0.03_01, and to be upgraded to 0.04 within the next few days assuming CPAN Testers approves) contains a few small updates, and one big one. First, the miscellaneous bits:
This list contains just a small number of talks that I personally thought are important/enjoyable for the most readers. This is by no means an official list curated by an organization. See the YouTube playlist for all awesome talks. I also encourage you to write your own blog about TPC. And yes, it’s officially called “Tipsy” now!
Where did my test fail?
Although I tried to select talks with videos, I had to make an exception for this one. I wasn’t able to locate neither videos mentioned in this section.
On Tuesday night, Damian Conway talked about his new modules: Dios lets you declare classes with Perl 6 syntax, which uses Keyword::Declare to declare a couple new keywords it needs. Data::Dx and Test::Expr also utilize “adding new keywords”. First one is a wrapper around Data::Dumper, and second one is a Test module that prints out source code when an error happens, which apparently was not a thing yet. Pretty awesome, right?
So yesterday I left off with my SQL looking correct but my query failing on the DBD::DBM so to-day I though I better just do a quick postette just to prove to my many readers that my code actually works.
So I all did was write up this quick little script
Why learn a whole new language for templating when you already know a perfectly good one? This isn't the first module that allows you to embed Perl in your templates, but it's yet another one.
I vividly recall my first steps in Perl 6 were just a couple of months
before
the first stable release of the language in December 2015. Around that time,
Larry Wall was making a presentation and showed a neat feature—the sequence
operator—and it got me amazed about just how powerful the language is:
# First 12 even numbers:
say (2, 4 … ∞)[^12]; # OUTPUT: (2 4 6 8 10 12 14 16 18 20 22 24)
# First 10 powers of 2:
say (2, 2², 2³ … ∞)[^10]; # OUTPUT: (2 4 8 16 32 64 128 256 512 1024)
# First 13 Fibonacci numbers:
say (1, 1, *+* … ∞)[^13]; # OUTPUT: (1 1 2 3 5 8 13 21 34 55 89 144 233)
Its back-end has been designed and implemented in order to allow future hypervisors to be added to the framework. Currently, it supports KVM and LXC is in the works.
The client only requirements are: a web-browser and a remote viewer supporting the spice protocol.
It is very easy to install and use, following the documentation, virtual machines can be deployed in minutes. It is an early release but is has been used in production. The frontend has been built with Mojolicious and the hypervisor connections are made with Sys::Virt . It is open source and the code can be download from github. Contributions welcome !
Main Features:
KVM backend for Windows and Linux Virtual machines
LDAP and SQL authentication
Kiosk mode
Remote Access with Spice for Windows and Linux
Light and fast virtual machine clones for each user
As things went just a little to smoothly over the past few post I though it would be a good day to try something that I know is going to cause me grief. In the vain I added this test;
--------------------------------------------------------------------------- SPVM - Fast calculation, GC, static typing, VM with perlish syntax SPVM(CPAN)
Nobody seems to have blogged about Les Journées Perl so I thought I would blog about Les Journées Perl. Or maybe I haven't been paying attention, or it passed by me in a state of crossing timezones?
I was travelling back from the UK office the weekend the workshop happened, so stopped by. I also uploaded a couple of photos to the perl_events Instagram feed. The workshop was held in the Carrefour numérique in the Cité des Sciences et de l'Industrie in Paris - a very interesting space within a very interesting space. Possibly one of the most interesting spaces I've been that has hosted a Perl workshop. Here's a recap of the talks I understood that stuck in my mind, I believe the talks were recorded so may appear online soon. You can find all the talks, with links to slides/etc here.
This post contains an Arduino Trinket Pro GPS prototype project that only relates to Perl in that all of my knowledge and experience came from my Raspberry Pi Perl work, along with writing C/XS code for several ICs and sensors and making those available as Perl APIs. I'm posting it here due to that relevancy, and because I don't blog anywhere else ;)
To start off, I'll explain a little bit how I got to this path.
I became interested in the Raspberry Pi after a colleague showed me a project he had built with one. I went out, bought a couple and started tinkering. The very first thing I wanted to do was use Perl on it. There were a couple of libraries available, but they seemed convoluted to me, so I wrote my own.