Entering MooseX, Part the Seventh

Well in my last post I created a very small API of a two keys

  1. requires and
  2. one_of

Now I have to get down and dirty and write up some code to handle this API. Now the logic will be in the same place namely 'MooseX::Meta::Method::Role::Authorized' and in a rewritten 'authorized_do' sub.

Well I start out the same with

Detecting JSON/YAML/Perl/CSV/TSV/LTSV

On my recent project, fsql, I want to detect (preferably cheaply) whether a (short) piece of text is JSON, YAML, Perl, CSV, TSV, or LTSV. The JSON/YAML/Perl would contain an AOA (array of arrays) or AOH (array of hashes).

File::LibMagic gives me "text/plain" all the time, so that's useless.

Here's currently the algorithm which I'm using. It's far from perfect, but perfection is not a goal here. Good enough (or even half as good as that) is okay, since most of the time, the file type will be inferred from the filename extension. And it's okay to be wrong as long as we can be right often enough.

1. If first line contains tab character, it's either a TSV or LTSV. Type is LTSV if first line contains colon (:).

2. If text contains => it's probably Perl (but this is useless for AOA).

3. If text contains a bare word element in a comma-separated list, e.g. foo, bar, it's probably YAML, since YAML allows that kind of thing.

Grants Committee May CFP round

Our May round will open on May 1st. Send your proposal by May 10th (Schedule details).

The official CFP will be posted at news.perlfoundation.org.

Major Dancer 2 release: 0.140000

(cross-posted from the Dancer users mailing list)

Hey everyone!

I just released a new version of Dancer 2. It's a major one. I'd like to share a bit about it.

Entering MooseX, Part the Sixth

Well in my last post I decided to use a hash-ref rather than an array-ref as a way to expand my little MooseX and let the user set have a set of required roles and or a set where only one role is required from a set.

I figured this made the API a little eirer to understand and even read inline.

Now how to implement this?

Well I start first with 'MooseX::Meta::Method::Role::Authorized' do this

Doozi: Dezi + Moose

I have been working on the project now called Dezi, in one form or another,
since 2005. The actual kick-in-the-pants to make a Product, rather than a Loose Affiliation of Modules, came in an exchange in the comments of a blog post about metacpan.org.

Dezi has gone through several releases in the last few years. Now I'm preparing for a big, new release (0.3.0) that represents (for me) a seismic shift in the way I'm thinking about the product. It has to do with social coding.

Way back when, I started using the Rose family of Perl modules for work. I developed many CPAN modules against the Rose suite. I continue to find the Rose modules well-built, well-documented and very fast. I rarely find a use case that has not already been anticipated.

Swiss Perl Workshop 2014 with brian d foy

Friday 5. and Saturday 6. September 2014 the Swiss Perl Community gathers in Olten for the Swiss Perl Workshop 2014.

We are happy to announce brian d foy as keynote speaker.

Watch the announcement Roman made at this year's German Perl Workshop.

For further information, please have a look at the workshop website.

Registration is open. :-)

Improving the grant program (3) Marketing

Continued from the previous post.

From the comments to Alberto's post:

You missed as a point "People don't know that the grants exist" and "People don't think their ideas/plans are appropriate for a grant". TPF should probably advertise them more.

Let's talk about the marketing aspect.

"People don't know that the grants exist"

To improve the situation that "People don't know that the grants exist", we did the followings in the past few months:

  • Changed the rule to make it more attractive for prospective grantees (grant limit, grant cycle).
  • Reminded each Grants Committee member to advertise the program more, which became: 1) talk given at a local Perl mongers meeting 2) more appearance on social network sites 3) more appearance in personal blog and mailing list
  • Started this blog to make the grant program known by blogs.perl.org readers and search engine crawlers

Entering MooseX, Part the Fith

Well just a sort one tonight as other moose-poop-21534987.jpg got in the way,

I did talk in my last post yesterday about adding a little enhancement to my first little MooseX and after talking with some of my co-conspirators they though it would be useful that the requirements are as follows

Have at least one the indicated roles
Have all the indicated roles
Have a mix of 'Required' and at least one indicated role

So how to add that in??

Well the it does not look very hard rather than pass just a simple array to the sub why not pass a hash that has the data classified for me. On can do this in a number of ways by adding here are a few'

A hash with the keys as the roles and the values indicating it is required or not

Google Summer of Code 2014 (Update 2)

The Accepted Students and Proposals

It is my pleasure to report that all five proposals that we selected for the Google Summer of Code on behalf of the Perl Foundation have been accepted for inclusion in the program this year.

The five proposals are:

Polish Perl Workshop 2014 - the schedule - 17-18th of May

Hi there!

I have the pleasure of inviting you for the second Polish Perl Workshop which is held on 17th and 18th of May.

The schedule
Here is the schedule, as you can see, very interesting talks are coming!
the_schedule.png

Are you interested in participating?
Great! Just register, we'll be waiting for you! :)

And we'd have some nice gadgets for you!

Hopefully, see you in Poznan!

sergot

Way OT: James Mickens - The Funniest Person in Computer Science?

Read The Night Watch and tell me that I'm wrong...

(The syntactically-correct Perl script mentioned in the article is indeed syntactically-correct. (Extra points if you can tell me what it does.))

Entering MooseX, Part the Fourth

Well in my last post I manged to get rid of numerous bits of the original MooseX::Authorized Methods and get it down to what I find is just what I need the bare-basic check if a class has a role.

Now digging ever deeper into the 'clone' of Authorized Methods I have the 'MooseX::Meta::Method::Role::Authorized::HasRoles' class and I can just delete that one as I moved its functionality into the 'MooseX::Meta::Method::Role::Authorized' class so that leaves me with 'MooseX::Meta::Method::Role::Authorized::Meta::Role' and here that is

mop problem 1 - mop can't have protected attribute variable

mop can't have protected attribute variable. All attribute variable is private in the class.

Let's delete 10,000 files from CPAN

This week, let's delete 10,000 (decimal) files from CPAN. Thanks to Ricardo, we're almost a tenth of the way there.

rik_spring_cleaning.png

We're a month into spring and some of the world just celebrated Earth Day, so it's time for the thousands of PAUSE authors to each delete one old distribution (which is three files in your CPAN author directory). Visit your delete files PAUSE page to "increase the Schwartz". You can even clean up your directory with WWW:::PAUSE::CleanUpHomeDir or with App::PAUSE::cleanup.

It's not quite enough for you as the PAUSE author to delete your files. We want to get the word out, so I'd like you to get one other PAUSE author to do the same. Use your social media networks, peer pressure, begging, or whatever your favorite method is, not because there's any danger of running out of space, but because it's fun to delete things and see them disappear.

MetaCPAN Officially Welcomes Our OPfW and GSoC Participants

The MetaCPAN project would like officially to welcome our summer of 2014 Google Summer of Code (GSoC) and Outreach Program for Women (OPfW) participants. We had a lot of interest this time around and some great applications. Our OPfW participant is Pattawan Kaewduangdee and our GSoC student is Talina Shrotriya. Both Talina and Pattawan have plans to make some much needed improvements to MetaCPAN and we're really looking forward to working with them. I've linked to both of their Github profiles above in case you want to track their progress commit by commit.

I'd also like to thank the Perl Foundation for its support in both of these programs. Lately I've had a chance to glimpse how much work goes on behind the scenes to make these sorts of programs happen and I can tell you it's impressive to see how much volunteer work is involved in something like this.

Entering MooseX, Part the Third

Now for my next installment I think I will carry on the same pattern as in my last post namely just taking the next file in line and bending it to my will. So lets see what is next.
Now the namespace is 'MooseX::Meta::Method' and the file is 'Authorized.pm'.

Now my code base I have nothing in this name-space because I wanted to avoid a name-space collision as we all know you cannot have two files with the same name (well except in windows if the case is different). So under 'Method' I added another namespace called 'Role' and add my version of 'Authorized.pm'. there,

So in the the original we have

Google Summer of Code 2014 (Update 2)

The Accepted Students and Proposals

It is my pleasure to report that all five proposals that we selected for the Google Summer of Code on behalf of the Perl Foundation have been accepted for inclusion in the program this year.

The five proposals are:

Perl and Windows UAC

While doing some Registry-related things with Perl a couple of weeks ago, I ran into something that took me nearly a day to figure out: Win32::TieRegistry asks for write access to the Registry by default, and under Win7 that requires Administrator privileges. (I kid you not, it took me over a day to figure that out.)

Well, getting what turns out to be called "elevated privileges" from Perl turns out to have been pretty hard - a lot harder than it should have been, for reasons I went into in some detail in a little article about it, but, to cut straight to the chase, I came up with a way to get Perl to restart a script after invoking UAC to gain elevated privileges. It's got some weaknesses that are inherent to the way Windows manages the console, but, well, I present to you Win32::RunAsAdmin. You can use it like this:

Testing Lies Video

I was recently at the 2014 German Perl Workshop and I've written about it at our company 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.