About the series: perlancar's 2014 Advent Calendar: Introduction to a selection of 24 modules which I published in 2014. Table of contents.
Here's the problem statement: For safety/privacy reason, I generally want my desktop screensaver to trigger rather quickly (say 3-5 minutes) to minimize prying eyes when I'm away or fall asleep and forget to lock. But when I watch videos, I want to set the timeout to a longer time (say the total duration of the videos plus 1 minute, or (better) 20-60 minutes which is the amount of time from I start the video until I doze off at night.
I used to have this line on my ~/.mplayer/config on my PC:
until I use a laptop with KDE plasma on it, which doesn't use xscreensaver by default. Plus I don't think disabling screensaver for the whole playback duration is sometimes not what I want (see above).
I’ve posted my slides for the Tour of Imager talk I gave earlier this week at MadMongers. If you are interested in processing photos or drawing in Perl, you’ll want to check this out.
I'm creating mop-minus-proposal project on GitHub. Current experimental mop implementation need big core change. so I think writable object orientation support is needed without core change or with minimal core change.
The following is example. This is not only specification. This code work on Perl 5.20.1+. Important thing is that the following code don't use Perl source filter, such as Filter::Simple.
About the series: perlancar's 2014 Advent Calendar: Introduction to a selection of 24 modules which I published in 2014. Table of contents.
Local variables or dynamic scoping is a very nifty feature of Perl that nowadays do not exist in a lot of other languages. It allows you to temporarily set the value of a global variable during a block/scope during runtime, effectively localizing global variables. For example, even though some modules provide configuration settings as global variables, like Data::Dump's $INDENT, you can change the values of these variables without having a global effect by using local:
{
local $Data::Dump::INDENT = ""; # disable indenting
$res = Data::Dump::dump(...);
};
# here the value of $Data::Dump::INDENT is restored the original value
Sawyer X recently gave a talk in which he outlined that merely talking about the stuff we are doing helps promote perl (watch his talk here on youtube). I believe he is absolutely correct.
Mike Schilli is one person who I think is doing a fantastic job of this. He writes a Perl article each month in Linux Magazine which is available in print and electronic editions. Here in Australia, it's available in most newsagencies (which is where I tend to stand around reading it... and sometimes I buy it). I think thats some pretty solid reach.
His article this month uses Perl to talk to the Spotify API. Which to me, is a cool way to introduce people to Perl via something that is well known and external to Perl programming problems.
There is a pay wall and by way of disclaimer, I have no affiliation with the author, the magazine or Spotify (although I do have a Spotify premium account).
David and I had a good week on Inline, but I had to cut it short to prepare for and attend this year's Pittsburgh Perl Workshop. I gave a mixed bag talk yesterday morning and the first topic was the Inline grant: https://www.youtube.com/watch?v=vDRLIjojlhg
At the end of the London Perl Workshop this year, we presented Mark Keating with a Silver Camel, to acknowledge everything he has done, and continues to do, for the Perl community, and particularly the UK Perl community.
Here's Mark shortly after being presented with his Silver Camel:
Photo by Wendy G.A. van Dijk
In case you're not familiar with Mark:
He has been chief organiser of the London Perl Workshop since 2008
He is co-founder and co-leader of North-West England Perl Mongers
He's been involved in the Google Summer of Code
He's director and secretary of the enlightened perl organisation
He's chair of The Perl Foundation's marketing committee
He's been a key player in the scheme to send newbies to conferences
He's talked about Perl at non-Perl conferences
His and Matt's company (Shadowcat) are long-term supporters of Perl
About the series: perlancar's 2014 Advent Calendar: Introduction to a selection of 24 modules which I published in 2014. Table of contents.
If you spend enough time on a Unix/Linux shell, sooner or later you'll be faced with the task of removing files in a directory that contains a lot of those files (in my case, it's usually a Maildir with lots of spam/unread emails). The directory will contain so many files (like 50k or even millions) that doing rm * will fail with the annoying "Argument list too long" message because the * wildcard is expanded by the shell into a multimegabyte list that doesn't fit into the readline buffer. To delete the contents of this directory you will have to resort to some tricks, like using xargs -n, or going up one level, deleting the container directory, and later recreating it.
When working on larger web applications, I prefer to use HTTP::Status to provide human-readable constant names in the code. This is especially helpful for anything other than the common 200, 404 or 500 status codes.
But the constants exported by HTTP::Status are basically subs:
if ($response->code == HTTP_OK) { ... }
this is fine for most cases, but not when you want interpolable variables, for example, in hash keys.
So I wrote HTTP::Status::Constants. It's a simple wrapper around HTTP::Status that provides read-only scalar constants for the HTTP_* constants.
About the series: perlancar's 2014 Advent Calendar: Introduction to a selection of 24 modules which I published in 2014. Table of contents.
My habit for the past decade or so, back when I started learning Ruby, is to use irb (the interactive Ruby shell) as a calculator. I guess one can also use python, but irb was the one that stuck in my muscle memory. perl does have the interactive debugger perl -dee since forever, but by default it does not print the result of expressions. I am recently trying to change that habit though and use Reply instead. It's nice, with colors and all (especially with the DataDumpColor plugin).
Sometimes though, instead of numeric arithmetics or string operations, I want to do some date calculations. For example, what is the date (and day of week) 20 days from today? What's 2013-09-01 plus 40 weeks?And so on. Having to write a short script e.g. loading DateTime and creating DateTime object and all that seem so cumbersome.
Well, that looks interesting, except that what interested me wasn't the job, it was the information the ID tells us about weworkremotely.com/ (though I suspect it's not something they're worried about).
Marpa::XS, Marpa::PP, and Marpa::HTML are obsolete versions of
Marpa, which I have been keeping on CPAN for the convenience of legacy
users.
All new users should look only at
Marpa::R2.
I plan to delete the obsolete releases from CPAN soon.
For legacy users who need copies, they will still be available on backPAN.
We warmly welcome you to join our Nordic Perl Workshop in Helsinki! The event will be held on Monday 17th of November 2014 at a seaside location where you can also enjoy the warmth of sauna and outside jacuzzi at the end of the day! We will also have pre-workshop events on the 16th, such as a hackathon and a pub crawl. Follow the program on the event site, we will add more information as we get all details sorted out.
Now you have the chance to have your say on the topics we will cover in the event. If you have some suggestions regarding the speeches please let us know.
The event will be epic, but we only have a limited amount of seats, so be sure to sign up now!
About the series: perlancar's 2014 Advent Calendar: Introduction to a selection of 24 modules which I published in 2014. Table of contents.
Frankly, I was a bit surprised when searching for an existing CPAN module for this task and found none. There is DBIx::Compare, but it is for database contents and not structure (it can compare two tables' field names though). Hence DBIx::Diff::Struct. An example:
I released GitPrep 1.9. You can install portable GitHub system into Unix / Linux easily. It is second major release.
Because you can install GitPrep into your own server, you can create users and repositories without limit. You can use GitPrep freely because GitPrep is free software. You can also install GitPrep into shared rental server.
add ssh_rep_url_base to cnahge or hide ssh URL user directory
add atom feed of commits page. for example, http://somehost.com/kimoto/gitprep_t/commits/master.atom
In version 1.9, by using ssh_rep_url_base option, you can hide user home directory in ssh url when you use public authentication. For example, You can do the following.
Unfortunately not many people host the code any more, and almost no one from those who might benefit from promoting their stuff there have ever sent me requests to include theirs ads. Therefore I am going to shut down the Perl Community Adserver which was hosted at two URLs: adserver.szabgab.com and pcas.szabgab.com.
I went over the logfile and sent e-mail to every person I could identify who still has the code on their web site.
If you have ever included the adserver on your pages and I have not sent you an e-mail, then please take this as my gratitude that you did host it. I think it served the Perl community a bit.
As I am going to shut it down soon, please, remove the embedded JavaScript from your pages.
Posting on blogs.perl.org brought new faces to our last Sydney PM, so heres details on our next event. Please join us if you are in Sydney Australia!
Hi All
Catalyst IT have offered to host us this month, so I went ahead and booked their board room. Thanks to Andrew Boag for setting the wheels in motion.
What: Sydney Perl Mongers Date: Tuesday, 11th November 2014 Time: 6-9:30pm Where: Catalyst IT, Suite 501-504, 89 York St Sydney NSW
The building locks it's doors at 6pm, so one of their staff will let us in. The same as SiteSuite and others. A contact mobile number will be posted later on for stragglers.
I will give a talk on HTML::FormFu.
We also need you to give a talk!
Catalyst IT will hopefully give us a talk on how Perl is used in their company to provide value to their clients. I understand they do a lot with the Koha library mangement software.