Well there is always more things to post on and today I found yet another.
You might remember this post where I was setting starting money for player characters and you might remember this post where I pinched the idea from.
There was a flaw with this as it is true I was not longer able to set starting gold or hit points by doing something this
return $self->current_gp()
if ($self->current_gp());
[This post will be imported to cpanlists.org once the service is ready]
Do you want to develop your Perl project on your PC or laptop, without having to be constantly connected to the Internet? Then follow this simple guide.
Creating a CPAN mirror
First you'll want an offline CPAN mirror, where most of the useful Perl modules reside. There is already a document explaining how to do this, so go read it. At the time of this writing (Feb 2014), a full CPAN mirror stands at +- 16GB. Chances are you don't need a full mirror, but a mini one, which contains only the latest version of each module and currently stands at about 2.5GB. You can then update your offline mirror every so often (I do this about once a week).
Next, you'll also want App::cpanminus, if you don't already have it. This CPAN client makes it easy to install from an offline CPAN or DarkPAN mirror.
Now to install a module from your local mirror, you can simply do:
As part of my rewriting of my testing classes (tired of hearing about it yet?), I found myself at the part where I needed to explain test fixtures. A fixture, in this context, is simply a particular known state that you can test against. In particular, I'm focusing on using database fixtures in tests. There's not a lot of good discussion about this and that's unfortunate because fixtures can really benefit your test suite.
This is part 11 of an ongoing series where I explore my relationship with Perl. You may wish to begin at the beginning.
This week we look at trade-offs in expressivity.
Last week I told a story about a CS professor who was inexplicably afraid of recursion. Other than the obvious moral of “don’t be afraid of things that use underlying complexity to make your external code simpler,”1 what exactly does this have to do with Perl?
Well you might remember the few post I did on my little pet mod Orignal and how its tests where broken how I fixed that and made it more broken!
But now the good news it I 100% Green well I known I am not going to win any prize for this module as a matter of fact the only review pan it. Hey but at least people are looking at it
Anyway it is what it is. A simple way to get accessors that worked for me in a very restricted development environment and I though it might help some-one else and really every ones should have at least one mod on CPAN they wrote themselves from scratch..
Funny I also like to look at it every once and a while on the CPAN MAP but I doubt it will ever make the top 100 there? Btw the way I find this a much faster way to search on CPAN and most likely the only good thing you will take away from this post.
Still no-one has gotten the joke behind the name that I do find funny.
I know it has been a while, but I’m finally getting around to posting my reflections on the Dallas-Ft. Worth Perl MongersWinter Hackathon. Better late than never right? I will talk about my solution, but I also want to comment on the hackathon itself, which I thought was an excellent bit of fun.
DBD::SQLite 1.41_06 is a release candidate of the next production release of DBD::SQLite. I'm planning to release it around the QA Hackathon in March if there's no blocking report. I suppose upgrading won't break your software, but please test it with 1.41_06 and post anything new you find to RT/GitHub/Mailing List.
Here're notable changes since the last stable release:
SQLite's query planner has been rewritten since SQLite 3.8.0 (bundled in DBD::SQLite 1.41_01). According to the upstream author, the new query planner should give exactly the same result (though perhaps with a little less CPU time spent planning) for simple queries, and for complex queries, it can in many cases provide a much faster answer.
DBD::SQLite now supports URI filenames to control read/write mode and/or shared cache mode.
DBD::SQLite now respects explicit data type specification of bind values (via bind_param() etc) even if "sqlite_see_if_its_a_number" handle attribute is set to true.
Looking at any number of differing sites that rate programming languages it is clear that since the early 2000s perl started a decline but has be happily chugging along at anywhere from 7.5% to 10% depending on which site you look at.
The TIOBE index is one as is langpop and they have their way to create their results. Mostly they look at github, Stack Overflow and Google searches.
Somehow F# is trending upward. But is it because its is better or is it because it is new and people are looking for answers on it and checking in many new modules into Github?
I think Tim Bunce has long since debunked the myth of the death of perl and if you have seen this presentation it is well worth your time as his point his point is quite clear, Perl is a mature language that attracts a higher quality of developer.
My client especially wishes to display clustered stacked bar charts with and without a 3d effect, via JS.
I do realize the 'clustered stacked' and '3d' requirements are both very limiting.
AFAIK the d3 package has no 3d option, but is otherwise fascinating.
JS libs I know of are:
o JSPowered. It's a commercial product, very nice, and is called via their PHP programs. It even supports clustered stacked bar charts, making it special in that way. Currently this seems to be the only option.
o InfoVis. It looks nice, but has no 3d effect available, not clustered stacked, apparently.
This summary is rather impressive, but does not mention 3d.
Xerces-C++ is Apache's C++ implementation of the Xerces XML parser. It turns out that it ships with a simple example program, stdinparse, that can validate your XML (which many tools do) against multiple schemas simultaneously (which few Open Source tools do).
Mojolicious is an awesome framework designed from the ground up to be non-blocking. During web development it is sometimes desirable to run a command and do something with the results. However, with methods such as "system" and "open" the command will block concurrent requests.
A non-blocking process execution is possible with background processes; however, the process must be managed and if the UserAgent needs updating, then long-polling will need to be utilized.
Below is a complete Mojolicious::Lite program that does this. In words, the app generates a utility script on-the-fly that a) sleeps; b) writes to a state file; and c) sleeps at the the end. This means that our state file will be around while the program is running. This mimics several use-cases, for example creating a thumbnail.
The state file can be inspected using events provided by Mojo::IOLoop::ProcBackground. The alive event is a heartbeat for the process and the dead event happens when the process stops.
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.