Painless Memcached Configuration With Catalyst & DBIx::Class

This tutorial will show you how to: Dependencies:
Memcached: Catalyst Plugins: DBIx::Class:

So dump all those in your Makefile.PL and you're halfway there.

First we edit your Catalyst app's base package. Open up your version of MyApp.pm and add:


    use Cache::Memcached::GetParserXS;
    use Cache::Memcached;

This will tell Cache::Memcached to use the XS Parser.

Now, in the section where you load your plugins, add the new ones in:

    use Catalyst qw/
        ConfigLoader
        Session
        Cache
        Session::Store::Cache
    /;


Now, configure Catalyst::Plugin::Cache. Here's an example for etc/myapp_local.pl:


Talk: Structured Wikis at Work - Enterprise 2.0 in Action


Peter Thoeny will be speaking on Wikis at our next meeting on November 23rd at LookSmart.

A enterprise wiki enables teams to organize and share content and knowledge in an organic and free manner, and to schedule, manage and document their daily activities. A wiki can also be used as an intranet where employees contribute content collaboratively, replacing a webmaster maintained intranet.

This talk explains how wikis can be used at the workplace, including initial rollout, social aspects and security concerns. It also explains how teams can use TWiki, a leading open source enterprise collaboration platform, to build tailored wiki applications supporting their workflow and business processes. Learn how a structured wiki can bring Enterprise 2.0 into the workplace.

______
Agenda

* Enterprise Collaboration
* Demo of Structured Wiki
* What is TWiki?
* Structured wikis
* Collaboration challenges at the workplace
* Wiki champion
* Initial deployment of a wiki
* Overcoming barriers to adoption

___

Outputting pretty data structure on console programs

Our application has a command-line API interface for convenient access via shell/console. It used to output API result data in YAML:

Mobile Software, Unix/Linux, and Me

Tim Bray's 3 Mobile Software Rules may just be a case of Maslow's "If the only tool you have is a hammer, everything looks like nail" to me -- but the simple designs you would get if follow Tim's rules echo Unix/Linux design to me -- no complications (no separate Exit routines & loose interconnections & few decorations). Whether you are in .NET like I am on workdays, on the bleeding edge of HA web design, or down to the metal in embedded software design, simple designs always seem to end up working the best.

Method Extraction in Vim

I'm hacking on code with some methods which are fairly long (inlined code for performance), but sometimes I have to extract some code out into its own method. Padre uses Devel::Refactor for this, but I didn't want to go down that road as it doesn't use PPI. Thus, I hacked my own using PPIx::EditorTools. It's not great, but long-term, I think it's a more robust solution.

YAPC:NA 2011 -- Asheville, NA

We have been remiss in announcing more widely that the Call for Speakers and Call for Sponsors for YAPC::NA 2011 is open. For those of you unaware YAPC::NA 2011 will be held June 27th-29th in Asheville, NC.

More information about YAPC::NA can be found on the website http://yapc2011.us.

The proof Perl gets you laid

Of course we already knew it, but now we've got proof!

the_proof.png

Grantreport - Perl 6 Tablets - second week

Tablet 2 was ready, i just completed and moved the trends section, because there not really language design priciples, mere consequences from that and a great introduction into the Perldelta.

Most work gone into the third - Variable Tablet which now start to get substance. the basic structure and lot of content i took from the german version even some lines from the wikibook programming perl, but most of this is written several times over. some parts are also removed because they will inserted on some later point.

i really hope that i didn't wrote too much in the first lines but its ment to be dense. The tablets are not about teaching you to programm nor teaching you to program perl 6 (take the open source book for that). The tablets are about finding a specific information as fast as possible. its an encyclopaedia, but written in a way you could actually learn the language from it, given you have the discipline only read what you need for the moment and ignore the rest you don't understand.

Nevertheless i plan another apendix, a cookbook section, to get a taste of real world perl 6 code.

Comparison of INI-format modules on CPAN

I'm not terribly happy with the state of Perl/CPAN support for the INI file format.

I have this requirement of modifying php.ini files programmatically from Perl like: set register_globals to On/Off, add/remove some extension (via the extension=foo lines), adding/removing some functions from the disabled_functions list, etc. So I would like to find a CPAN module that can just set/unset a parameter and leave formatting/comments alone as much as possible.

Turns out that among a dozen or so of INI modules on CPAN, a few of them do not do writes at all (e.g. Config::INI::Access or Config::Format::INI). And a few that do, write a la dump. That is, they just rewrite the whole INI file with the in-memory structure. All comments and formatting (even ordering, in some cases) are lost. Example: Config::INI::Writer and Tie::Cfg. And, last time I tried, I couldn't even install Config::IniHash from the CPAN client. Not good.

Talk about CouchDB

In october a fellow Monger, Wolfgang Kinkeldei, made a talk about "Couch-DB" for the ERLUG, the Erlangen Linux User Group. One of our Perl-Mongers organized a room for the at the computing center of the university Erlangen-Nuremberg. Therefore the Erlangen Perl-Mongers recognized this talk and could attend as well.

CouchDB is a famous NoSQL database system that got quite some attention lately. It is a project hostet at apache foundation and follows a document oriented approach. CouchDB uses REST and JSON as a powerful but easy interface. Furthermore, it provides a web-based administration interface out of the box. And with its ability to use Javascript as its internal procedural language you can easily create simple web applications on top of CouchDB without other technologies. Wolfgang told us about these features and showed us some of those things live.

Wolfgang did the talk only as an exercice, he will do the talk in front of mor people at the anual KNF-Kongress in Nuremberg.

Besides the talk the people of ERLUG and the Perl-Mongers Erlangen got the opportunity to meet each other, to share thoughts and to learn about the other group. So maybe the one ore the other meeting we will get new attendies at our meetings.

short CPANTS update

After some kind member(s) of Vienna.pm brought the server back to life, and some anonymous coward sent me an email via an anon remail asking for fresh data, I got my lazy ass off my chair .. wait, no, actually I stayed seated in my office chair .. so I got my lazy mind off other things and started a complete CPANTS reindex yesterday morning. It took all day, but since of yesterday evening there should be new and up-to-date data available on cpants.perl.org.

Of course the code that's generating the data is rather out of date, especially with regard to stuff like Moose, Devel::Declare and even newer Perls (i.e. > 5.10). The code is on github...

I don't expect to spend any time on fixing / improving the code in the next few months. And the best thing to do would be to rewrite/refactor the whole beast to make use of the metabase and to also store the generated data into the metabase.

Better than Literate!

I'm converting Marpa to XS and have started to use Cweb. Cweb is the C version of the "literate programming" system pioneered by Don Knuth. I'm pleasantly surprised by it. Cweb adds fun to the programming experience and is helping in more ways than the phrase "literate programming" would suggest.

One very important feature of Cweb is something that would seem to be a nuisance, or at best an implementation detail. The .w file which contains the Cweb is now the "source". The .c and .h files are now "built files". I am no longer working with the C language "translation units". ("Translation unit" is standards-committee-speak for the text which is directly input into the C compiler. The term is used in attempt to distance the standard from file conventions.)

(Short, grossly incomplete) comparison of Perl logging frameworks

After doing this post on comparison of Perl serialization modules, I intended to continue with other comparisons, and even thought on setting up a wiki or creating/maintaining a section on the Official Perl 5 Wiki, which already has a Recommended Modules section, although there is not much comparison being written for each recommendation. (Btw, I just noticed a change of domain for the Wiki, from perlfoundation.org to socialtext.net).

But of course other tasks soon took precedence, so until the Wiki idea is realized, I thought I'll just continue posting on the blog as usual.

There are **seriously** too many Perl logging frameworks out there. As the Log4perl FAQ mentions, "Writing a logging module is like a rite of passage for every Perl programmer, just like writing your own templating system."

So I'm not going to pretend like I've evaluated even half of logging modules that are on CPAN. Instead I'm just going to include a few worth mentioning.

Another Catalyst website goes live (ActivityMD)

Another client launch: ActivityMD.com.

The front content was WYSIWYG'd by their previous ISP. Prolific position:absolute CSS makes that content painful to edit. But links to the shiny new backend are all Catalyst, Template Toolkit, and lots of jQuery.

It's an alpha release. Feedback welcome. :)

Moose - The Brautigan library

moose_brautigan1.jpg

http://www.soundofdrowning.com/library.html

So Moose was a title by Richard Brautigan. This guy was a childhood hero of mine: "Trout Fishing in America"

Moose is referenced as one of the titles Brautigan used in
"Revenge of the lawn: The abortion ; So the wind won't blow it all away", one of the first books he continues to write and store away in a public library, which nobody ever visits to use, only to store away.

Richard Brautigan, (1935-1984) RIP

iCPAN v1.0.2 is Now in Apple's App Store

After about a week of waiting for an official review, iCPAN was reviewed, approved and published to Apple's App store earlier today. There are no code changes in this release, but the modules are up to date as of Nov 8, 2010. This release also includes manuals and cookbook POD like Moose::Manual.

I had hoped to get this release out in September, but real life got in the way. In the meantime, I've streamlined the way the POD is processed and future releases will be easier and hopefully much more regular.

Vim's quickfix mode and Perl

Very happy that f00li5h tweeted to me about the Vi::QuickFix module. In vim, my leader is the comma and when I type ',c', I now execute perl -MVi::QuickFix -c % and that creates an error.err file which vi's quickfix mode can read. :cf will take me to the first error in the fix and :cn will take me to the next error. It will even jump to the correct file, as needed. See vim's :help quickfix for more information.

However, I've done more than that. See a bunch of problems in your files? Try running this:

find lib/ -type f -name '*.pm' -exec perl -c {} 2>&1 \; | grep -v 'syntax OK' \
    | tee errors.err

On our code base, that takes around 25 minutes to run. Then I have this in my .vimrc:

" quickfix for Perl error formats
set errorformat+=%m\ at\ %f\ line\ %l\.
set errorformat+=%m\ at\ %f\ line\ %l

Those two formats match the Perl errors I'm getting (note how one ends with a dot). With those, I can now jump to all errors and warnings that compiling our code generates.

Update: Fixed the find invocation.

The Great Re-write of 2010: CGI::Session/Test::Database/DBIx::NamedDSN

Hi Folks

I have just finished a re-write of CGI::Session, called Data::Session, and started wondering how best to test it.

I've always disliked setting all the env vars to make its tests work for MySQL, PG, etc, so I hit CPAN looking for A Better Way.

I found Test::Database, which seemed to be a good idea. But examining the code was discouraging, so I decided to re-write that too.

I soon realized that one thing (among many - see below) which bugged me about Test::Database was its handing of DSNs.

So I decided to split that out into a separate distro, using an INI-style file, so I could add extra attributes to the DSN, such as active and use_for_testing. I might add use_for_production too.

That's why I've just released to CPAN DBIx::Admin::DSNManager V 1.00.

Now I'll use that in the re-write of Test::Database, which I'm going to call Test::Admin::Database.

Padre 0.74 has been released.

Padre 0.74 has been uploaded to pause and is in the queue for indexing and replication to your favourite CPAN mirror.

So while all that happens, lets take a look at what has been happening since 0.72.

Well, plenty of fixes, and a fair amount of work done with the Plugins and converting them to Dist::Zilla by Ahmad Zawawi. The changes file doesn't really show the work that goes into the Plugins, but keeping one eye on the irc logs shows plenty of commits from Ahmad between releases.

Many of the plugins for Padre reside in the same SVN repository as Padre itself, so if you find an itch that needs scratching, you don't have far to look to start scratching.

Zeno Gantner is finding time to work on bits of Padre even with a rather hectic sounding life at the moment.

What do you care what type it is?

I'm about to start writing about a bunch of stuff that will definitely show my lack of a computer science background. Unlike many of my posts, this is your chance to correct me rather than me explain things to you. This has been on my desktop for awhile, so I'm cutting bait and posting what I have instead of working on it more.

I've been reading Seven Languages in Seven Weeks: A Pragmatic Guide to Learning Programming Languages, which is an enjoyable book except for the parts where he starts to talk about types and, ahem, types of programming languages. It's mostly distracting, not very useful, probably misguided, it not outright wrong.

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.