I think I will join the shame circle started by KD. So here is my confession and it happened today.
Well today I was finishing creating a new system for a customer based on another similar one. So there I am happily copying some files, re-naming thing A here and thing B there, setting up some configs, refactoring, cleaning and generally enjoying trying to remove some aspects of a giant anti-pattern from our system.
Things worked fine for the export portion of the system so then I moved on to the import and on the first try it died and died hard.
Well after some head scratching I was at a loss so I called in a colleague to have a look. After the usual blame the new code and blame the old code game, then a round or two of everyone's favorite pastime 'Change Die to Carp::confess'. Nothing!
We even tried 'perl -d xxx.pl' and even that didn't help.
Due to our internal reasons, the Grants Committee did not call for application in the 2013 Q4 round.
Now we are back in business; we will call for grant proposals in early March. The deadline will be two weeks after the CFP is open. The exact date will be announced at news.perlfoundation.org.
The Grants Committee members are working hard to improve the process. It'll be one of the improvements to increase the CFP frequency from quarterly to every two months.
<farnsworth>"Good news, everyone!</farnsworth>
I'm going to be back in London for the entire first two weeks of March.
First up, if anyone is planning on attending QCon London next month, here's a discount code that will get you £100 off registration (and see another £100 donated to Make A Wish UK): CONW100
We're also looking into the possibility of me giving another talk for London.pm one evening in the second week. I'll blog the details of that event, once we can confirm a date and venue.
Peter Seibel has written a great blog post on code reading - learning more about programming by reading good examples. The final model he describes has someone diving into a piece of code like a 19th century explorer and then reporting back to the group on what they found. This sounds like a valuable activity for a Perl Mongers group.
So my question to you is what CPAN module would you recommend as rewarding to an intrepid code explorer; and why? Of course I'm not suggesting Perl programmers should only read Perl code, but I do think CPAN is a good place to start.
I was cleaning up some papers out of a notes binder this AM and blundered across something I scribbled down during a YACEU, (not sure if it ws 08 or 09). On closer examination it was a number of notes taken during one of the lighting talk session.
Nothing that I would want 5 years later the only interesting bits where some of those magic/secret/sacred code one-lines that somebody always presentes during one the the lightning talks.
I rarely use them myself except for the good old spaceship operator or
<=>
Useful when you want to sort this @(-1,23,5,-6,0) you want this @(-6,-1,0,5,23 ) and get this @(-1 -6 0 23 5)*
Used normally like this
my @arry = (-1,23,5,-6,0);
my @sorted = sort({$a<=>$b}) @arry;
$client is doing a lot of heavy lifting (perhaps accidentally) in some Catalyst-driven Template Toolkit code. Apparently, it's far too easy to pass a DBIx::Class object into the stash, and then trigger things that end up hitting the database... from the view. That wouldn't be horrible, except the same exact queries are being used in multiple places in the templates, causing many redundant identical queries to the database per page hit. (Note aside: if this was Rose::DB... I'd trivially jump to Rose::DB::Object::Cached. Problem solved.)
I wanted a way to see what method calls were being invoked on the objects in the stash. Simple... just subclass Template::Stash! Now I get a list of the component invoking the method, the path from the root stash to the object, and the method call being made.
In my previous post I spoke about what Subroutine attributes are and how to use them. Here I compare them to other techniques for introducing orthogonal behaviors: Method modifiers and Aspects. These three techniques enable to modify what a subroutine does, but they do it in different ways and are thus suited for different needs.
A many readers of this blog know I have been spending a good deal of time lately playing about with Moose doing all sorts of silly little things with AD&D character creation and alike.
Well I was curious today and started to take apart a little bit of Moose and see what was under the hood so to speak. So far I have discover that all the nice Moose sugar are really just function calls and since some programming I was doing today requires me to use 'no Moose', he much preferred 'namespace::autoclean;' not being install on the box I was playing with yet.
So I started to look in the Moose dir of my perl for the 'sub no' the one that takes away all the sugar. Well I tired every combination of 'sub no' I could think of with 'ack', 'Grep' and even loading things on Padre to see the outline result.
Given our community is a little... let's say cautious I feel the need to open with a disclaimer. I am in no way affiliated with Gittip, in the past, present and the foreseeable future. In fact I looked at their bugtracker for the first time this morning and am appalled that a site in production for 2 years can have so many outstanding basic conceptual issues.
In any case this entry is about the underlying idea, so if you can manage to not get distracted by a shoddy implementation - read on (NSFW language as always :)
If you avoid DBIx::Class because of performance issues, you should probably check out version 0.08250 or better. In an interesting note from the Changes file:
Rewrite from scratch the result constructor codepath - many bugfixes and performance improvements (the current codebase is now capable of outperforming both DBIx::DataModel and Rose::DB::Object on some workloads).
Previously I used it because with DBIx::Class::Schema::Loader, I could pregenerate my classes from a database schema and it's fairly robust. When the database changes, I can regenerate my classes on the fly and and run the tests to verify that nothing's broken. However, I hit upon a case where it generated some bad code. As it turns out, DBIx::Class::Schema::Loader was correct and it revealed a bug in my database design.
Cheerio, in case you missed me, started to study again (compunter science and music) so had almost none time for Perl. Even worse, I was forced to learn and write Java. My complaint on international human rights court is pending. But now are holidays, time to prepare exams and .. to reflect about my open source activities.
Last week we talked about the awesome productivity of Perl without really asking why it’s so good at it. For one answer to that, we’ll need to look at a new spectrum.
There are several different spectra in Perl. In fact, one of the coolest things about Larry is that he’s not only given us a cool language to play with; he’s also given us cool new ways to think about the languages we play with. Along one spectrum we have the tripartite concept of laziness, impatience, and hubris. This series has only touched on these indirectly: laziness drives the language be legible, impatience drives it to be productive, and hubris drives it to be closer to a natural language.2 Along another spectrum, we have the orthogonal concepts of manipulexity and whipuptitude, which we just discussed last week.
But there’s another spectrum to look at, which includes the twin concepts of TMTOWTDI and DWIM.3 TMTOWTDI is closely linked to context, which we covered pretty thoroughly. But what about DWIM?
Well I am getting close to finishing off my 'Creator' class that I started in this post I really have only three little parts to add on to get to the end. Character Starting Monies, Alignment, and equipping the character.
Well equipping is more a game play than a character creation part as buying something and stuffing it in your sack happens at any point in the game. So all I will have to do is give the character his starting tithe then let them loose in the store, as everyone knows a fool and his money are quickly parted if that 1th level Magic-User want to blow his wad on Chainmail and a Falchion far be it from me from stopping me from buying it.
Equipping and using it is another question and again that belongs in game play so I will defer that till later.
TPF (The Perl Foundation) announced the new Secretary of the Grants Committee. It's me.
Some of you may not know what TPF does. It may not be well known that TPF grants money for Perl development.
Here in this blog, I would like to add a bit of transparency on what the committee does, answer questions and have feedback from the community.
While it's my blog as the Secretary, the Grants Committee's official communication channel continues to be news.perlfoundation.org. You don't need to read my blog to apply for a grant but you are expected to read news.perlfoundation.org.