Entering MooseX, Part the Eight

Well getting close to the end of this little series and today I though it would be good to do a little code review to see if I could fined any holes.

So there was some suggestion about a new namespace 'CheckCallerRoles' and another 'AllowedMethodRoles' but I think as I cut down on the number of files I need I will just keep the present setup besides it is easy to understand.

Now there is the question of the actually API names themselves

  1. requires and
  2. one_of

Now looking at the semantics of these two I think a change may be in order. Now I do have the option 'requires' is a another word for 'needs' but that doesn't read too well and 'must_have_roles' is a no good either. I could also try 'required' which is a little less in the passive voice so I think I will finalize on that.

Image::Magick packaged for Perlbrew and cpanm

Image::Magick is great, but it's a pain to install if you are using perlbrew, or if your system's Image Magick library is out of date. After some googling I found that this was the best technique, but cpanm support is missing, making using Image::Magick very difficult to include in your application's dependencies.

Read the rest here.

Introducing WWW::KeePassRest

A couple of weeks ago, PerlTricks ran a little article on using KeePass (as a file format) to secure your data, which prompted me to dust off and finish some code I'd started sometime last year.

The problem with using File::KeePass (as astoundingly fantastic as it is!) is that the point of using KeePass in the first place is to keep you from having to see passwords at all (once you've started the KeePass utility and logged into it, anyway). If you want to use KeePass to store a username/password pair to pass to LWP (say), though, you've got a problem - you still need to enter your KeePass password to decrypt the database.

News from the MetaCPAN developers

The MetaCPAN site has a constant flow of new features. Some are small, some are big, but almost none of them get in the news. The recently added news page will provide this missing piece. It also comes with a feed .

One of the nice features of MetaCPAN is that it is open source. There is a page for how to contribute to MetaCPAN, but you can also read my article where I described how the newsfeed was added to MetaCPAN.

I hope it will help you play with the source code of MetaCPAN, and maybe add a few new features.

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

Recent Hacktivity Log

This is another "recent hacktivity log" of some of the open source work I've been up to lately.

New Command-Line App: App-Du-Analyze

App-Du-Analyze (with its command-line script of "analyze-du") is now available on CPAN. What it does is allow you to analyse the output of the UNIX "du" command, get results based on a prefix and a depth, and sort them. It is my preference for a disk usage analyser, with the benefit of being able to run several queries on the same data, by keeping the same du.txt file - a feature which I found is often lacking in GUI disk usage analysers.

Here's an example of using it:

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.

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

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.

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. :-)

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

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

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

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

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.))

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:

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.

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.