You can find the most recent version of this tutorial here.
Intro
When you suddenly get this brilliant idea, the revolutionary game-changer, all you want to do is to immediately hack some proof of concept to start small project flame from a spark of creativity. So I'll leave you alone for now, with your third mug of coffee and birds chirping first morning songs outside of the window...
...Few years later we meet again. Your proof of concept has grown into a mature, recognizable product. Congratulations! But why the sad face? Your clients are complaining that your product is slow and unresponsive? They want more features? They generate more data? And you cannot do anything about it, despite the fact that you bought the most shiny, expensive database server that is available?
Today I saw Damian Conway giving a talk at YAPC::NA 2016 (also known as The Perl Conference now :-). He was talking about some cool Perl 6 features, and I realized that some of them are available right now in Perl 5.
Reaching out to the Perl community at large due to this release being hardware-sensitive and feedback being most useful to me when it comes from many various hardware combinations, particularly if the graphics cards involved are older or stranger.
Please test this CPAN developers release on your platforms to confirm that
there are no regressions from the last stable release. ... Actually,
please do report any and all errors you can see, i am VERY keen to see
what other issues this throws up on different platforms.
This is the very first ( to take it for a spin ) release of sparrowdo - a simple configuration management tool written on Perl6 and consuming sparrow plugins.
This is where Perl5, Perl6 could make a synergy. Consider a simple example of sparrowdo scenario:
Perl::Critic::Policy::Variables::ProhibitUnusedVarsStricter (whew!) is a Perl Critic policy that attempts to be more stringent about finding unused variables than the core policy of similar name. One of the things that has to be done to make this happen is to figure out which variables are interpolated into double-quotish strings.
The original version of this module had its own string-analysis logic, as do other Perl-Critic policies that have to figure out which variables are really being used. With the mainstreaming of postfix dereferencing, it seemed to me that the recognition of interpolated variables had become complex enough that a separate module to figure this stuff out was justified. Thus was born PPIx::QuoteLike.
After encountering CodeNewbie at OSCON 2016 I've been thinking a lot about why there are so few new developers interested in Perl. I haven't been a Perl beginner for a very long time so I went looking for resources and found FAQ for the beginners mailing list. I wanted to know how active the mailing list was so I immediately went to the web achive. Reading through the list I saw things like:
"Is there a reason why you think one CPU is better than another?"
"your code exhibits many bad elements, and you don't seem to apply all the
advice I've been giving you. Please go over
http://perl-begin.org/tutorials/bad-elements/ , read it and internalise it."
Condescending, abusive advice is worse than no advice at all. There's no way I'd send a beginner into that. Nobody should have to learn like that. Seeing it ruined my afternoon. Maybe I should have read more of the FAQ:
If you do anything with 2 dimensional CNC machines such as plotters, mills, or lasers, you’ve probably used some form of vector graphics. The most popular open source vector graphics type is called SVG or Scalable Vector Graphics. If you’re doing this professionally, you need to know how to charge for that work, and if you know the length of the shapes included in that vector file, you can do a pretty good job of preparing an estimate for a customer. That’s where SVG::Estimate comes in. It does the mind melting math to tell you the length of arbitrary lines and shapes inside a vector file.
This is my first post here and it will be a short one.
I was asked to count chinese characters in a string. Most of us know the annoying task of writing an essay with $n words. For chinese it will be $n characters.
Would be a shame if we take this too serious and write too much.
so:
my Str $text = "你好! 我喜欢吃菜!";
$text ~~ s:g/ \W | \d //;
say $text.chars;
And that's it.
So why even blog about it? What I think is amazing is that all worked with the first attempt.
I often just try stuff in perl6 without knowing if it will work the way I think it will work.
However most of the time, it just does... and this is why I love this language!
So To carry on from my last short post another short post. I am going to expand and modify my 20_dad_load.t again this time digging a little deeper in Moose's MOP or to give its full name 'Meta-Object Protocol'
One of the things I like most about moose is how easy it is to do “Introspection” or I like to say 'Lets have a look under the hood'. So I have expanded my role test from the other
day
to this
craigslist is sponsoring the Wednesday Night Pull Request Challenge at YAPC::NA::2016 on 6/22 at 6pm-10pm (or 'til). This event is modeled, inspired, and loosely affiliated with Neil Bower's fun and successful "CPAN Pull Request Challenge" .
A primary goal of this event is to introduce participants to the wonderful world of contributing to the Perl ecosystem.
This is a beginner friendly event, and assistance will be given to anyone needing help getting started.
To make things even easier, there will be a list of eligible modules to choose from. Participants may also come with their own projects and modules to work on.
I needed to do some work with splunk the log and monitoring analytics toolkit. Specifically I needed to combine disparate logs from different systems to solve a problem that had been intefering with our systems for a long time. I had a look around for stuff on the CPAN, but it was either embedded into other bigger things that I didn't want to have to deal with, or did not work for me for maintenance reasons. So I decided to write my own. The library I wrote is available here in draft form.
Now because this was written by me for debugging purposes, I think it shouldn't be a CPAN module - not without a lot of hardening it up - but I wanted to share it anyway, as a handy way of doing API integration.
I my last post I did create a Test DAD, but then I discovered the problem with doing this is you may spend considerable time just debugging that class to make sure it at least works with any roles it may have to consume and even if you get it to work you may have problems with the roles it is trying to consume.
So I really should test my Database::Accessor::Roles::DAD before I start any load tests,. My basic test I did in a previous post it a good start bur I want to be able to test it before I have says a 100% good DAD. So Moose come to the resque again with MooseX::Test::Role
With this
MooseX
I can test my role without a 100% perfect consuming class as it just stubs in any subs the role may require. So in
20_dad_load.t
I add in
But any damn fool can see that it’s 2 lines of code instead of 2 characters. It’s not more readable. It’s just foolish. Some parts of smart match suck and I get that. So throw out those cases, not smart match itself.