App-ffeedflotr - plot using Firefox and flot

Sometimes, I want a pretty plot of data. Excel is not always the tool of choice,
especially when the data to plot is something like running progress of a (Perl) script I wrote,
or the output of

while /bin/true done; ls $file ; sleep 1; done

Inspired by feedGnuplot , I wrote ffeedflotr.pl, which takes data and plots it in Firefox. So far, it is not really configurable. But as I have the API blueprint of `feedGnuplot`, I can easily/conveniently adapt it to the featureset.

One nasty thing I found is that Firefox does not like to execute Javascript that comes from `data:` URIs. I suspect this is due to security concerns, but it means that I have to find a sneakier way to load custom HTML into Firefox, preferrably avoiding a tempfile. Things that I've tried so far are named pipes - Firefox does not like reading from these either, likely due to the same or similar security concerns.

Yet Another Perl Podcast #2: Новости за прошедший месяц, источники информации на русском, новые cpan модули

События за прошедший месяц ( март - 1.03.11-1.04.11 ): Релизы cpan модулей: Источники информации о perl:
  • planetperl.ru - аггрегатор новостей про perl
  • onperl.ru - блог Андрея Шитова
  • perlrussia.org - расписание мероприятий
  • perl5doc.ru - переводы документация perl5 на русский язык
  • pm.org - Perl Mongers
  • moscow.pm.org - московская группа perl программистов
  • kiev.pm.org - киевская группа perl программистов

В выпуске участвовал

Cсылки: RSS и лента на rpod.ru
Следите за анонсами в twitter

Adding Version Control Sanity to Solaris logadm

Solaris includes a log rolling utility called logadm, which is very useful for managing logs without having to write your own custom scripts or install some other utility across all of your servers.

However, there is one big drawback to logadm. Whenever it runs, it stores a timestamp for each log it rolls in the logadm configuration file itself. I'll leave it to the reader to question the sanity of this.

For example:

/var/adm/messages -C 4 -a 'kill -HUP `cat /var/run/syslog.pid`'

Is changed to:

/var/adm/messages -C 4 -P 'Sat Apr 09 21:27:21 2011' -a 'kill -HUP `cat /var/run/syslog.pid`'

Stop using Locale::Maketext

The following is a translation of a talk given by Steffen Winkler at German Perl Workshop 10, Internationalisierungs-Framework auswählen, in 2010. You can find my translation of the POD on Github. (In fact you are better off reading it there, because the CSS formatting on blogs.perl.org sucks, at least for now. If you’re seeing this in a feed reader, feel free to stay.)

Aside from Steffen’s talk, there is also Nikolai Prokoschenko’s rant On the state of i18n in Perl, which mentions to some extent the fact that gettext has established workflows as well as supporting software (such as graphical tools) known in many software communities and even outside the open source world, whereas Maketext has… none of that, and is known only to Perl folk.

Be smart. Don’t use Maketext.

Funky Function Filters in Perl6

A while back I wrote about Funky Function Filters. Let me refresh your memory - we have a Python and a Ruby snippet and we translate it into Perl5. The code is a toy to show some fancy shmancy lambda (unnamed functions) usage. The idea is to take a list of functions, filter them, and then with the remaining ones show what happens with parameters from -10 to 10.

Python example:

for f in filter(lambda f: f(-1)>=f(1),
                [lambda x:x, lambda x:x**2, lambda x:x**3]):
    for x in range(-10, 11):
        print x, f(x)

Ruby translation:

for f in [lambda { |x| x }, lambda { |x| x**2 }, lambda { |x| x**3 }
         ].select { |f| f.call(-1) >= f.call(1) }
    for x in -10..10
        print x, f.call(x)
    end
end

My perl5 translation:

CPAN Testers Summary - March 2011 - Hourglass

A relatively quiet month during March, although my thanks go to Leo Lapworth and Dave Cantrell for noticing and reporting bugs in the websites. Feel feel to report bugs you spot on the CPAN Testers websites to me directly (barbie@cpan.org), as if I'm not the person to deal with that particular website, I can re-direct you to the right person. You're also welcome to report bugs on RT, and as I get more of the individual websites on CPAN, it'll be easier to report bugs and feature requests directly for the respective website.

Work has been ongoing with releasing the website code, with the release of CPAN-Testers-WWW-Wiki, which contains the basic code to run the CPAN Testers Wiki. The data that is contained within the website has not been released, though it is available on request if anyone wished to use it. I'm currently working on packaging the CPAN Testers Blog in the same way, and hope to have that released later this month.

First steps with App::Mist

My last posting seems to have whet the appetite of a few people, or at least interested one or two enough to follow this project on GitHub. Today I'd like to delve deeper into how you can use App::Mist to deploy or distribute an application.

Slides from my presentation at OSDC.TW 2011

I gave a talk at OSDC.TW 2011 about PPM as yet another faster installer, and several modules I took over from Randy Kobes who passed away last year.

Compared to the transition from CPAN/CPANPLUS to App::cpanminus, PPM, which once used a remote API server but now downloads indices (summary) and store them in a local database, seems to be taking a different (or opposite) track. Its XML based spec is apparently old-fashioned (actually, the original Open Source Description spec, on which PPM spec was based, was deprecated years ago). And the one on the CPAN is way behind the one bundled in ActivePerl. Certainly it's not good for everyone.

Excel::Writer::XLSX with charts

I've released a new version of Excel::Writer::XLSX to CPAN with support for charts.

The output looks something like this:

column1.jpg

The example program that generated it is here.

I'll be adding more features in the near future such as chart sub-types, formatting, hi-lo bars and droplines.

If you are already using the Spreadsheet::WriteExcel charting features, or are interested in using this feature, try it out and let me know what you think.

The osCommerce shopping cart morphs into Perl

Hi Folks

I'm beginning to transform a major part (but not all) of the osCommerce shopping cart into Perl. See osCommerce for details.

If you've already done so, and your code is open source, let us all know. Otherwise, I'll just keep grinding away, given that I've got the time and incentive to do so.

The namespace I intend to release it under is Business::Cart::Generic, and I'll be releasing another, restricted, version as Business::Cart::EdgarsMission.

The latter is an animal rescue group here in Victoria (Australia), who I've volunteered to help with their problem of charging people more-or-less accurate postage when they buy merchandise from Edgar's Merchandise.

The problem comes from being able to stuff 2 T-shirts, say, into 1 parcel, and thus not being able to justify postage on 2 separate T-shirts.

Basically, I'll keep track of purchases and with the aid of a special table of information (i.e. rules of thumb) from the chief packer of merchandise, I'll determine which sized package can be used for all the common combinations of merchandise.

Naturally this system will not be exact, but they are prepared for that.

I volunteered thru Good Company.

Compile a Vanilla Perl on Windows with MinGW


Compiling Perl on Unix is really straight forward, but on Windows you need to pay some extra effort .

If you want to build a default (a.k.a. Vanilla) Perl distribution on Windows with no pain read the following concise article:

http://perl-node-interface.blogspot.com/2011/04/compile-vanilla-perl-on-windows-with.html

HTML::Scrubber 0.09 release

Following my recent post on HTML::Scrubber, I have been given maintainership rights on the module.

So I have sorted all the urgen stuff, including the 3 separate RT entries for a tmp file vulnerability, and pushed a new version to CPAN.

Coincidently, whilst updating the Changelog, I noticed the last release was exactly 7 years ago. So, umm, happy birthday HTML::Scrubber 0.08, but you have now been superseded!

Snappy

I generally use Compress::LZF as "an extremely fast (not that much slower than a pure memcpy) compression algorithm. It is ideal for applications where you want to save some space but not at the cost of speed".

Google recently released Snappy, previously known as Zippy, which "aims for very high speeds and reasonable compression" and is used in Bigtable.

And luckily gray recently released Compress::Snappy.

Whenever slinging data around the network or writing things temporarily to disk, it costs you almost no CPU to use lightweight compression and will save you some I/O. Which is good as processors are fast and disk and network are slow.

For permanent storage I still use gzip, zlib or bzip2.

Future of Finance::Currency::Convert::XE

Many years ago I wrote a set of scripts and modules that together formed a way for me to access eBay internationally. I frequently bought records from the UK, US, Germany and Australia, so those were the plugins that I focused on, but the intention was to allow more to interface to other eBay sites. I even did a presentation at YAPC::Europe in 2004, called The Perl Auctioneer, which explained my progress.

As part of the currency calculations and conversion, I used the same site that eBay themselves were using, XE.com. As I became more involved in other projects, and my international eBay buying declined, my efforts to finish and release the Perl Auctioneer waned. However, I was still using the currency conversion module, so released it as a stand-alone package. In time this became Finance::Currency::Convert::XE.

CPAN Instant Update Mirroring

If you've got a CPAN mirror and you haven't had a chance to test out the instant update mirroring, I'm here to suggest you try it out. I had a few spare moments earlier this week to test it out and I'm happy to say that the setup is trivial. If you follow these instructions, you can get yourself set up in a matter of minutes. In my case it was installing a couple of modules and then firing up the sync from the command line. When I checked back later, I had around 9 GB of CPAN goodness. As it happened, I uploaded a dist via PAUSE later in the day. I remembered to check my new instant update mirror a few minutes later and yes, my upload was already available in the mirror.

BioPerl in the Google Summer of Code (2011 Edition)

BioPerl is again part of the Google Summer of Code! The Open Bioinformatics Foundation, which also includes BioPython, BioRuby, and others, has been accepted into the Google Summer of Code for 2011. We are actively looking for students interested in OBF-related bioinformatics projects; new ideas are welcome. Project ideas and other details can be found here:

And the fastest OO accessor is...

There's a lot of FUD out there about the performance of various OO modules, particularly Mouse. So let's set it straight with some benchmarking.

I've chosen to simulate that buggaboo of OO performance in Perl, the simple accessor. The one that you're going to call millions of times and that you'll be sorely tempted to reimplement with a hash or tear all the argument checks out of for "performance". To make it a little more realistic, I'm checking both getting and setting as well as a simple argument check.

Welcome Perl !

I am kinda beginner in Perl I should mention that I've worked for 3 months with Perl and I wanna share my experience in Perl with you

How I manage the distribution of Perl5 projects

If you are working like me (which is unlikely) distributing and deploying your Perl5 projects poses a significant challenge. Managing self-contained projects has become vastly easier since the advent of local::lib, Dist::Zilla and App::cpanminus but the ever changing (and sometimes incompatible) nature of CPAN has bitten me more than once in my life as a coder. Here is how I try to solve this, judge for yourself if this approach has any merit and encourage me to go further down this path if you think it does.

Perl Feature Request, or am I missing something?

One of the most simple things you can do with Perl, is process text files. For that, you usually use the diamond operator, you chomp the read line, and process, line by line.

This is great and works mostly of the times.

Or, in the other hand, works when you can control where your files, the ones being processed, come from.

Because, if you want to make a generic application, you need to know that when running on Unix, chomp will remove the newline, but not the carriage return character, unlike when the same script is run under windows.

And I think that is annoying.

Why should we base on the architecture we are running on and not in the file we are processing?

If there any situation where, when reading line by line, we want chomp to maintain the carriage return if it is there?

I know chomp removes the character defined by $/, and this character is different from operating system to operating system.

But is this behavior the one we really mean?

Or am I missing something, and there is something I can do with file handles (IO::Handle, afaik) that will guess the line ending?

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.