Scalar::Util::looks_like_number

I had a recent discussion with a Data::Dump::Color user about formatting ints/floats/stringy numbers differently. So here's a short summary of how core module function Scalar::Util's looks_like_number() can be used to detect the different data types:

eBooks ... for Science!

I slid into the world of eBooks when a half-price Nook sale collided with O'Reilly's
Day against DRM half-price sale. It was the Perfect Storm that this tight-fisted Luddite needed to take the plunge. I set myself a budget and just as I'd picked out all the books that I allowed myself, O'Reilly decided I'd bought enough to merit a 60% discount, so more books had to be bought. One must stick to the budget!

PubMed is experimenting with ePub formats and they are much easier to read than the customary PDF's, but waiting for everything to be converted (or just trying to find one) would try the patience of even Vladimir.

I have a suggestion for someone with more Impatience than me. (I started this post 5 months ago). Have a look at LaTeXML and then think that with many of the papers submitted in LaTeX and a tool that converts to XML, you're halfway to reading all your latest science down the coffee shop.

Another great podcast

I've recommended Disastercast here before, and I know that some of you have since subscribed. However, for those that haven't, episode 13 is worth listening to. It is about safety issues arising from software, in particular looking at the Therac-25, a medical device which which, because of race conditions, killed people.

Finding Your Google Code SVN Password

(Hopefully this post will become outdated soon...)

Google Code can use SVN (among others) for version control, even generating a password for you. Which is all well and good but currently you cannot see where to find that password from the home page:
        https://code.google.com/
To get your Google Code SVN password, you need to get to your Profile -- one way is to go to:
        https://code.google.com/hosting/
then follow along to Profile -> Settings -> GoogleCode.com Password , where you can get or refresh your Google Code SVN password. 'Nuff said.

Backing up private data securely

My situation: work on PC at the office, on laptop elsewhere. All of data already in git repositories--well almost, photos and videos are currently out, due to their size. I use SSD on both computers, and my partitions are encrypted.

Some of the data are public, like open source Perl projects. Some work-related, where we have our company git repos. And some private, like personal notes, addressbook, agendas/todos, ledger files, etc.

Since I've read that SSDs usually die without any warning, I am quite paranoid and install post-commit hook to backup data after each commit (however, when the lag due to backup is becoming annoying, I disable it momentarily).

For public repos, I've got it covered. There are services like github, bitbucket, or whatever which you can just push your work to.

UAV::Pilot v0.6 Released

UAV::Pilot version 0.6 is now on CPAN. Lots of little changes this time. The big thing is an API change, where Control::ARDrone and Driver::ARDrone were instead named ARDrone::Control and ARDrone::Driver, respectively. This keeps everything related to a single type of UAV under one namespace directory, which I think will be nicer going forward as I implement other UAV systems.

[More on my blog]

Perl TV

The other day I was idly browsing Perl-related videos on YouTube. I saw quite a few with very low visitor count.

For example, I bumped into a presentation by Brabie about the Eco-System of CPAN Testers. It had less than 20 views!

I find it sad that all the energy Barbie put in preparing and giving the talk at YAPC, where maybe 50-100 people heard it, and all the work the organizers of YAPC put in recording the video and publishing it, and in the end less than 20 people watch it.

So I decided I go forward with my long-time plan and launched the Perl TV.

The idea is to collect interesting Perl-related videos, make them easy to find (e.g. cross linking based on their content, the CPAN modules they cover, etc.), provide a textual description and notes of the video, and promote them.

Velociraptor Perl Nerd Merit Badge

I've updated the Perl Nerd Merit Badge campaign with a candidate design using the velociraptor from Sebastian's perl-raptor repo. If you want a badge, pledge $8 to the campaign.

raptor.png

If you would like to get such a badge but can't use Crowdtilt, let me know how you'd like to pay and I'll reserve a badge for you.

If you're a Perl mongers group who wants to buy several at once, I can make a deal with you to get cheaper shipping to a single address.

HTTP::Tiny::SPDY - A Subclass of HTTP::Tiny with SPDY Support

I have recently returned to working on Arriba, the PSGI-compliant web server with support for the SPDY protocol, modeled on Starman.

I sort of released it (on GitHub only, not on CPAN) back in January, at that time the code was passing the tests in Plack::Test::Suite when running as a regular HTTP/HTTPS server. My next goal, before considering the module ready to be released on CPAN, was to make it pass those tests in SPDY mode. This meant I needed to add support for SPDY to good old LWP::UserAgent, which was used as the HTTP client in Plack tests.

Over the weeks/months that followed, I made a few attemps at tackling this problem, but had a hard time wrapping my head around the architecture of LWP::UserAgent and figuring out a reasonable way to add SPDY into the mix. Having very little time to devote to this project, I didn't get anywhere with it.

Announcing Perl::Critic::Policy::ControlStructures::ProhibitForeachHandle

A couple days ago I uploaded a Perl-Critic policy to find and complain about things like foreach ( <FOO> ) {...}. The problem (or at least potential problem) with this is that it sucks the entire file into memory before performing the first iteration. Which may be what you wanted, but may not be too.

I plan to leave it at a development release for a couple weeks to allow time for comments and so on. You can find it at its CPAN Search page.

Some code ports to Mojolicious, just for fun.

Today is a relatively minor holiday in the US, but I had work off all the same. I found myself experimenting (when I probably should have been working on my YAPC::Brazil talk :-/). Thanks to today’s PerlWeekly (you are a subscriber right??), I found out about an interesting post by Johnny Moreno which creates a tiny json service backend using Perl. Of course it uses CGI.pm to do so, which made me curious what a Mojolcious port would look like.

The Problem With Perl Testing

If there is one thing about testing in Perl which bugs me, it's that most testing in Perl is what cgi-lib.pl is to Plack. The following is mostly a rant and I'm also guilty of many of these sins.

Yes, we have a beautiful testing infrastructure around our tests. For example, if I want to know which operating systems and versions of Perl my Code::CutNPaste module fails on, I just go take a look. Or I can quickly see almost 3,000 passing test reports for aliased (woo hoo!). The Perl community is proud of tools like this and we should be. Just reading about Perl's test-infected culture is fantastic and other language which claim to be test-infected often come in a poor second.

Er, sort of.

TPF Grant Progress Report: October 2013

This past May, The Perl Foundation awarded a grant to fund development of a couple features in Pinto. Pinto is a robust tool for curating a private repository of CPAN modules, so you can build your application with the right modules every time. This is my second progress report on that work.

I want mop rest capability to define fast accessor

In Perl, accessor access is about 30 times slower than direct access. For example,

  # Accessor access
  $obj->title;
 
  # Direct access
  $obj->{title};

"$obj->title" is about 30 times slower than "$obj->{title}". In current perl, we can't replace accessor access with direct access in general way.

but in mop, we can distinguish method and attribute. If so, we may replace accessor access with direct access. I want mop to rest capability to define this fast accessor.

Steven said "$self->title" is overhead, but if fast accessor is implemented, this is no longer overhead, and we can access attribute by unified way without performance overhead.

PDL 2.007 Released!

PDL (”Perl Data Language”) gives standard Perl the ability to compactly store and speedily manipulate the large N-dimensional data arrays which are the bread and butter of scientific computing.

PDL turns Perl into a free, array-oriented, numerical language similar to (but, we believe, better than) such commercial packages as IDL and MatLab. One can write simple perl expressions to manipulate entire numerical arrays all at once. Simple interactive shells, pdl2 and perldl, are provided for use from the command line along with the PDL module for use in Perl scripts.

As a frequent PDL user and occasional contributor, I am happy to pass along this note from Chris Marshall and the whole PDL team. Read the entire release message here.


It is with great pleasure that the PDL development team announces the release of the latest version of the PDL Data Language with 64bit platform support.

This release would not have been possible without the contributions of developersChris Marshall, Craig DeForest, Derek Lamb, Dima Kogan, Rob/Sisyphus, David Mertens, Diab Jerius, William Parker, and Henning Glawe.

A special thanks also to those who helped with bug reports, problem discussions, and, of course, participation in CPAN Testers which has helped to make the best tested PDL release ever!

Enjoy and Happy PDL-ing! The PDL Development Team

Real-Time Web Apps

Real-Time Web Apps :

The slides from my MadMongers Real-Time Web Apps talk are now available online. 

[From my blog.]

a perl5 to perl6 translator

The "perlito" perl5 to perl6 compiler is online at: http://perlcabal.org/~fglock/perlito5to6.html.

It is also available as an irc bot for snippets and as a command line script.

Software Test Podcast

I've recently been listening to Software Test Podcast. And I was particularly struck by episode 41, in which the presenters interview James Whittaker. He used to be Head Testing Honcho at Google until moving to Microsoft a year and a bit ago.

Almost all of what he says is good news for the perl community. The way we value testing and make it part of the community and how in our day jobs with perl most of us have "testing as an activity not a role", as he puts it, is not common elsewhere, but elsewhere is catching up to what we've been doing.

There is some bad news for us though. Almost all perl code has terrible diagnostics, so if we happen to ship something buggy, it can be awful hard to figure out what's going wrong even if you've got a shiny new test case written for the bug.

IRC notifications on your phone (or Pebble watch)

IMG_20131010_202348~01.jpg

Installation

Install irssi

sudo apt-get install irssi

Grab the script:

mkdir -p $HOME/development
cd $HOME/development
git clone https://github.com/chiselwright/irc-notifications.git
cd irc-notifications

Make sure you have required perl modules available

perl Makefile.PL

Install any missing modules. (TODO: make irssi scripts work with perlbrew)

Install the script:

sh SETUP.sh

You should see something like:

➔ sh SETUP.sh
mkdir: created directory `/home/chisel/.irssi'
mkdir: created directory `/home/chisel/.irssi/scripts'
mkdir: created directory `/home/chisel/.irssi/scripts/autorun'

If you now run

Why is the latest version of Devel::ptkdb not on CPAN?

In my recent post about debugging perl using Devel::hdb I claimed that
Devel::ptkdb has not been released since 2004, but a commenter pointed out there
are recent released on Sourceforge.

Does anyone here know why is it not uploaded to CPAN?

Are there other projects that somehow stopped being uploaded to CPAN?

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.