Changes to Test::Builder/More/Simple incoming

A couple months back Schwern handed me the keys to Test::Builder and friends. Initially I planned to try and knock out little bugs and simply maintain stability... That plan failed and I ended up spending a lot of time giving it a major overhaul for a feature Schwern and I agreed would be very nice. Result Streaming. This was further prompted by a minor change to a specific diagnostic message that resulted in breaking fragile tests written with Test::Builder ::Tester, which frankly, has seen better days. THERE IS A BETTER WAY!

I have just released an ALPHA version of the Test-Simple dist. This dist includes the following changes and features:

Reboot All The Things - My thoughts on this years YAPC::NA

There is an old saying that "distance makes the heart grow fonder", and watching Matt Trout talking at YAPC::NA this year filled me with the mixed emotions embodied within that saying. I am simultaneously sad that I was not there to correct Matt's swiss cheese memory of past events and happy that I wasn't around to witness his sad excuse for a beard. But alas, this blog post is about much more then Matt's physiology.

Nothing makes me miss all the wonderful folks in the Perl community as not being able to get to YAPC::NA. So while I have not yet watched all of the videos, I did watch the 6 (count them, six!!!) keynotes, and I wanted to just post about my impressions of them.

XS, Advanced XS Callback Patch For OCI, Part V Much More 'C' and just a little XS

Adding some more for the new chapter in XS Fun. Today I am just going to go carry on with the next part of the patch which is very similar overview of the next function that is going to be patched.

Thinking-Cap-no-wait-Hat.jpeg


Now that we fully understand 'dbd_db_STORE_attrib' function we can move on to the next part of our patch and that is updating the 'dbd_db_FETCH_attrib' function so lets look at that in detail

it is expecting only 3 prams

  1. SV *dbh, a pointer to SV 'Scalar Value' that is the current DBI DB Handle
  2. imp_dbh_t *imp_dbh, a pointer to a structure called 'imp_dbh_t' that is used store our value
  3. SV *keysv, a 'SV' pointer to the key for the value

Like the last function the SV are our Perl values while the 'imp_dbh_t' is where in our 'c' code is going to look for the data we are asking for.

So the patch for this function is a little less complex

Planet Moose - June 2014

Welcome to Planet Moose, a brief write up on what's been happening in the world of Moose in the past month, for the benefit of those of you who don't have their eyes permanently glued to the #moose IRC channel, or the MetaCPAN recent uploads page.

If you'd like to contribute some news for next month's issue, you can do so on the wiki.

Moose

Moose 2.1208 and 2.1209 have been released containing some minor bugfixes.

Inheritance is Bad: Code Reuse Part II

0. Overview

  1. Inheritance is Bad: Code Reuse Part I
  2. Inheritance is Bad: Code Reuse Part II
  3. Inheritance is Bad: Code Reuse Part III

1. Introduction

My first part about Inheritance was more theory. I explained the problems with Inheritance, and explained how roles can solve some of them. I told that there is even a better way, but instead of going straight to that point i want to first talk about Roles. We first need to understand Roles and which problems Roles still have to go further. Instead of just explaining the problems in theory i also want to add some code, because code always helps a little bit more to understand the problem. So that post even got a little bit longer than i really wanted.

2. Our example

To point out the problems with Roles we should create a little example.

Dist::Zilla as a Continuous Delivery Tool

I just recently converted my IO::Iron  distribution to using Dist::Dilla as a release and build automation  tool. Dist::Dilla is mainly targeted at people writing free software Perl packages for releasing into CPAN (Perl free software archive) but if used properly it can make easier the releasing of any software.

Before


When I started to build the IO::Iron distribution, I already knew of Dist::Zilla but two things kept me from adapting it. Firstly, I considered it too difficult to learn for such a small project (which later grew), and, secondly, being bloated and suffering from featuritis. Instead, I went with the classic solution of using Module::Starter to begin, and continued with manually editing the Makefile.PL and every other file, including MANIFEST, README and Changes. I used my private Subversion repository. I uploaded to CPAN via the CPAN Author page page.

XS, Advanced XS Callback Patch For OCI, Part IV Finally Some Code but no Perl and just a little XS

Adding some more for the new chapter in XS Fun. Today I am just going to go carry on with the first part of the patch but like the title says I don't think there well be any Perl or XS today


So now that we have defined what our patch will fit into the DBI API lets look into how we get our values into our 'c' code.

Well DBD::Oracle, and most DBD for that matter, there is set pattern to get an value from the Perl attribute Hash-Ref and load it into our 'c' code. This is of course mostly due to 'c' language being a very closely typed and strictly structured language so playing about with variables and alike require much more care than your typical Perl mash-up.

So where we have to do this is in dbdimp.c and it has a

Web::Module::CoreList


Web::Module::CoreList - 'This is a web interface for Module::CoreList.'

Very cool and useful website, worth checking out.

As a web developer and perl programmer, I'd like to see ( and build ) more websites like this!

mop problem 5 - Role and C3 searching is not always necessary

I think Role and C3 searching is not always necessary.

Object orientation good practice I want to tell to newbies is single inheritance and delegation.

Role is multiple inheritance. Role can have attributes. This mean role have data, not only methods. I don't think this is good.

I think the reason making mop complex is Role and C3 searching.

If Role and C3 searching are none, BUILD, BUILDARGS, DEMOLISH, $self->next::method, and many complex things is no needed. And overriding new method is easy and $self->SUPER::foo work well.

I don't deny Role and C3. TMTOWTDI is good, but are Role and C3 searching needed as core features?

Answer of comments

Multiple inheritance is bad, yes. But, why? Can you explain? (I don’t mean to me. Just think about it.)

The reason is that diamond inheritances occur in multiple inheritance. A -> B, A -> C, B -> D, C -> D.

Perl Needs a User Friendly CMS


During Lightning Talks at YAPC this year (2014), I stood up and proposed a project: adapt an existing enterprise style CMS (feature complete, mature, but hard to install and not sexy enough) to directly compete with WordPress (easy to install, shiny).

Then I got this amazing piece of email as feedback and just had to share it (with permission, of course):

Scott,

I agree with your hypothesis about the importance of a CMS (or other popular extendable software) to the introduction of a computing language to novice programmers. I am one of those novice programmers. I enjoyed writing perl plugins to the Movable Type platform, but now MT is no longer open source.

I've checked in on WebGUI every couple of months, and was very excited about version 8. Plack support could be a game-changer, how could development stop now?!

Besides Plack/fastcgi, I also would like to see Postgres support.

Good luck. I hope you reach your funding goal. Let me know if there is any other way I can help.

Rick Bychowski

Test::RequiresInternet now on CPAN

During my talk at YAPC I recommended that people writing functional tests for a web service client ensure that Internet access is available before running the rest of the test. Later, a question was asked about an easy way to test for Internet access, and I was informed of the existence of Net::Detect.

With a recent thread from CPAN-workers fresh in my memory, I promised to release Test::RequiresInternet to CPAN during YAPC if I was fortunate enough to get through all of it.

I uploaded Test::RequiresInternet shortly before game night and its available on CPAN (also Github.) I just haven't gotten around to publicizing it a bit until I was back from Florida.

That means you can now write your test like this:

XS, Advanced XS Callback Patch For OCI, Part III The Plan

Adding some more for the new chapter in XS Fun. Today I am just going to go my implimetaion plan of what needs to be changed how that fits into the world of XS

The Plan

The first thing to note about this patch is that there is no change to the Oracle.xs file. Now the reason for this is has been hinted at earlier in the chapter and that is DBD::Oracle is largely a 'C' program that is linked directly with Perl using dynaloader and its bootstrap method.

So we can ignore Oracle.xs in this patch and that leads us to the question what is going to be patched? Well the answer is almost every file but the Oracle.xs as this patch digs very deeply into the guts of DBB::Oracle, and OCI but never fear there is lots of XS work that has to be done as well.

Step 1 The API

TPF Grants collected data 2010-2014

Yesterday I spent quite a few hours going over the articles published on news.perlfoundation.org which resulted in a page listing the status of all the TPF backed grants.

As far as I can understand there are 3 major grant-groups.

The "General TPF Grant" that you hear about from Makoto Nozaki which paid out $2,500 in 2013 and has a $16,000 budget for 2014.

The "Hague Grants" which is mostly for Perl 6, but I think has been depleted already.

The "Perl 5 Core Maintenance Fund" that paid out about $100,000 in 2013 and which currently has another $36,000 allocated.

I hope this will help further understand The Perl Foundation. If you find any mistakes or omissions, please send me a pull request.

How to Run a Single Test via Dist::Zilla

Last week I was working on a distribution which includes some XS and also uses Dist::Zilla. I needed to edit a single test, but didn't want to run the entire test suite after every edit. It wasn't immediately clear to me how to do this via "dzil test". I asked in #dzil and within a couple of minutes I got some excellent advice in the form of:

dzil run prove -lv t/my-test.t

If there is no XS in your distribution you can skip the build process and get an even faster test run:

dzil run --nobuild prove -lv t/my-test.t

Many thanks to KENTNL for the tip.

Remnants of a Deeper YAPC

This year I attended my third YAPC.  As always, here are my thoughts.

General bits and bobs: I thought the venue was pretty decent.  It’s definitely the best hotel showers I’ve ever had: excellent water pressure and never even a hint of running out of hot water.  Perhaps they have on-demand heaters.  I could have used more open plugs in the room, but that’s a minor complaint.  The wifi was pretty awful, as usual—one person even did a lightning announcement suggesting we complain about it.  I didn’t see the point, personally.  Several hundred geeks, most with multiple devices, plus several dozen spouses, partners, and children,1 all descending on a single location for four days ... hell, that could break anybody’s router.  And I don’t think it’s particularly reasonable to ask a place that can comfortably house all those people to maintain a super-network year-round that will only really get used once a year.  Just point your laptop at your cell phone instead and move on with life, I say.

XS, Advanced XS Callback Patch For OCI, Part II

Well continuing along with my new chapter for XS Fun. Today I am just going to introduce the Oracle part of the equation and what one has do with OCI and Perl before

Oracle HA (High Availability) Events

A small part of Oracle's HA packages are notification that are sent out when an HA event takes place, This could be a server going down, one coming up one swapping out and a number of others.

Now to actually generate these events one need some specialized set up, first you need at least one Oracle RAC instance with at at least two Oracle Enterprise servers set up with and each mush have HA event notification enable. As well you OCI environment must be set up to allow OCI events and you have to have you system set up for threading.

perlsloc - Count Perl Source Lines with Perl::Tidy

While spending some time putting together my own perltidyrc file, I became intimately familiar with the Perl::Tidy documentation.

One day, I decided to find out exactly how much code I was maintaining. Since perltidy can strip comments and POD, and also normalize the source code to make a fair measurement, it's a perfect tool for counting Source Lines of Code (SLOC).

Here's a small shell script using ack, perltidy, xargs, and wc to count the source lines of code in any number of directories.

ack -f --perl $@ | xargs -L 1 perltidy --noprofile --delete-pod --mbl=0 --standard-output | wc -l

ack -f lists the files that would be searched, and --perl searches Perl files, so we get ack's heuristics for finding Perl files. xargs -L 1 invokes the following command for every 1 line of input. The perltidy command strips the pod and tightens up the whitespace and writes the result to stdout, which wc -l will then count, line by line.

So, as an example, the current Statocles release has 50% more test lines than source lines:

» perlsloc lib bin
    1034
» perlsloc t
    1633

Grants Committee July Schedule

As communicated at the May round closure, we are accepting grant proposals all the time (Submission link). We evaluate them every two months and another evaluation month, July, is coming.

Here is the July schedule:

  • July 1: CFP reminder post
  • July 14: CFP closes for this round
  • July 15: Solicit public feedback
  • July 26: Voting
  • July 31: Announcement of the results

So you have a bit more than two weeks to be considered in the July round.

If you miss the deadline of July 15th, you can still send us your proposal later in July and it will be evaluated in the September round.

Skipping large files when mirroring your mini CPAN

My Internet connection at home is not great: it's rather slow and flaky. When I ran minicpan to update my mini CPAN earlier today, the process always seemed to choke on this file: id/D/DG/DGINEV/Lingua-EN-SENNA-0.03.tar.gz: exit with Connection time-out error. The first run I thought it must be my connection and simply re-ran the script. After the second and third and being stuck in the same file, I got curious. Lo and behold, the file is 185MB big!

I then typed this to peek into my CPAN mirror:

% cd /cpan
% find -type f -size +10M

Turns out, there are quite a few files that are over 10M in size. Seeing that I (currently) don't see any need for any of the distributions listed above, I entered:

% find -type f -size +10M -exec rm {} \;

Not too bad, I shaved around 1 GB by doing this (from about 4210MB to 3119MB). This is on a miniscule-sized SSD, so more free space is always welcome.

Create Perl Competition to the PHP Content Management System

Create Perl Competition to the PHP Content Management System :

[From my blog.]

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.