SWP Day Two

Well a little less busy today just a few talks and mine own and then a little Perl6 playtime.

Maxim Vuets (‎mvuets‎) gave an interesting talk on that terrible Canadian invention of toki pona. Some-how Max managed to get Perl to work at parsing that language and it gives a whole new meaning to the Practical part of the P in Perl.

Next Dave and I where up with our introduction to Replay which was well received and we had a few good suggestions for some other programmers.

Mike Francis (‎mrf‎) was up again and today with a much expanded talk on Web::Machine and Dave and I got a few ideas on the restful part of Replay

I took a bit of a much needed Nap for most of the rest of the day but I did take a litle time to see how the Perl6ers where doing and they started with over 300+ failing test files and Gog knows how many failed test, insert dumb look from Stefan here,to just about 20 test files and 100 tests.

We ending the days with a few lightning talks, just remember that 6 in German sounds funny to an English speaker, a good dinner and then a clean up and I am off to the Mountains to bag those last few 4ks .

MongoDB monitoring with swat

MongoDB provides some http interface to enable monitoring.

Swat is a perl/bash DSL for web application smoke tests. The one of interesting feature of swat is that one could easy create a smoke tests suite for a certain application and then distribute it as cpan module.

Imaging you an IT guy. So add monitoring for mongo now is as simple as installing cpan module :


$ sudo cpan install swat::mongodb
$ swat swat::mongodb 127.0.0.1:28017
/home/vagrant/.swat/reports/127.0.0.1:28017/listDatabases/00.t .. ok
/home/vagrant/.swat/reports/127.0.0.1:28017/serverStatus/00.t ... ok
/home/vagrant/.swat/reports/127.0.0.1:28017/buildInfo/00.t ...... ok
All tests successful.
Files=3, Tests=12,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.03 cusr  0.00 csys =  0.05 CPU)
Result: PASS


A Video-to-Song Converter in Perl 6

Here's my longest Perl 6 script yet. I'm trying to come up with some shorter ideas for future articles.

I have a directory full of music videos in MP4 format, and wanted to convert the audio to MP3 files. I also wanted to insert the title and artist, which are generally found in the filenames, into the ID3 fields in the MP3 file. However, there was a sticking point: the filenames are inconsistent. The only pattern is that they all end in 12 junk characters and a ".mp4" extension. Other than that, some are "title - artist", some are "artist - title", some are one of those without the hyphen or anything to separate the two, some have other bits of text stuck in here and there, a few don't have the artist at all, and so on.

Help me test Net::SSH2

Short story

I have released a new development version of Net::SSH2.

Help me test it, please!

Really long story

Some years ago, I started working on Net::OpenSSH. At the beginning it was just a hack, but it worked unexpectedly well and I was able to push a very perlish interface on top of it and over time it grew and become a very powerful and feature rich module and above all, very user friendly.

Just one drawback remained. Due to a limitation in OpenSSH the module, it couldn't be made to work on Windows (well, maybe now, that Microsoft is pushing OpenSSH development there...) and that bothered me. Windows users were limited to two choices: the almost impossible to install, unmaintained and buggy Net::SSH::Perl or the at that time new Net::SSH2, a wrapper around libssh2 that was quite promising but still very low level and quite hard to use.

SWP Day One

Well after being all Perl6ed out the day before I was up bright eyed and bushy tailed for this year's Swiss Perl Work Shop

The first talk today was by Dr. Tara Andrews (‎aurum‎) a most entertaining speaker who can some-how mix arcane Byzantine~Armenian history, the battle between the Epistemology of the Inexact and Exact Sciences, digital rot and open source Perl projects and still keep a room full of programmers spellbound.

We where next treated to what I could only call a fireside-chat with Larry Wall. We head a great deal about the evolution of Perl6 and how it has gone though many incarnations over the years to the point (you heard it here first folks) that Perl6 might not be ready for his birthday but will be ready before Christmas.

Dispatch Tables

At a previous job, I saw some code that asked the user which function they wanted to run and then executed a subroutine with that name. This code demonstrates why such a practice is bad:

Faster PDL Development Cycle---But How?

This entry is a repost from the start of a discussion on the PDL developers mailing list in the hopes of getting wider inputs from the perl community.

PDL Developers-

With the addition of two active and highly motivated PDL developers (Zakariyya Mughal and Guggle "Ed" Worth) we've made significant progress in cleaning up the PDL distribution itself and the development process itself. PDL is now run through test builds automatically on git commit via the Travis-CI framework of github. Many perl platforms and PDL configuration options are exercised. PDL-2.013 was the best tested pre-release release ever.

patch -p3

The next edition of the patch.pm Perl hackathon will be held in Lyon on Saturday September 12, 2015.

My plan for this one-day hackathon is first to take advantage of the visit of Liz and Wendy on their way home from Granada. :-) I'd also like to kick off some regular mini-hackathons (not just Perl) in the Lyon area.

So if you're in the area, join in!

My First Perl6 (Part the First)

Well since I was in Olten anyway for the SWP I might as well take in the Perl6 workshop. I initialy signed up to do some install testing on windows 64 which according to the many rumors I have herd it would be a nightmare wrapped up in a nice bow.

So after arriving a little later than expected and seeing the good old familiar faces I grabbed a seat and began to play.

The first stop was getting started page on Perl6.org and within a few mins of poking about I found the Rakudo page followed the link there to the MSI page clicked the button and bingo-bango-bongo of and ready with Perl6.

Well so much for Perl6 being hard to install.

Well next I tackled a few simple scripts the normal 'hello world' type scripts and a few other ones and of course this gets very boring very quickly unless your idea of a good time is trying our regex but that is more like my nightmare.

Preparing for a Technical Interview (with Perl)

I've uploaded some more slides, this time from my YAPC::NA masterclass, on how to prepare for and survive a technical interview. They are somewhat Perl-related, but most of the content should be as applicable for non-Perl interviews too.

How to prepare for (and survive) a technical interview

Amazon AWS EC2 and Cluster SSH

Cluster SSH, or its OSX incarnation CsshX are great tool to quickly connect to a collection of machines and issue interactive commands in parallel. You just configure them with a collection of machines called 'clusters', set your .ssh/config correctly for all those boxes and voila, you are now in the matrix.

The problem arise when you run your stuff on Amazon's AWS on EC2 dynamic instances. It's impossible to know at a given time which instances are effectively running, and it makes your cssh (or CsshX) configuration useless.

The good news is, Amazon provides an API to access and manage EC2 instances. The even better new is there's a Perl package to access that programmatically. So..

Lets put EC2 API Access and Cluster SSH together: ec2-cssh

Read more here ..

Just announced: PPW talk deadline extended!

Calling for all talks! The Pittsburgh Perl Workshop has already received some great talks - and we're looking for a few more! Having already confirmed that Larry Wall will be attending this year's workshop to discuss the release of Perl 6 - the organizers are looking to include two tracks of great talks!

Talk submissions will continue to be accepted through Friday, August 28th. Visit pghpw.org/ppw2015 for more details and to submit your talk!

PPW will be held in downtown Pittsburgh on October 9–11 2015.

Ad-Hoc OLAP databases with Yertl and HANA

In my previous posts I showed how to set up an ODBC connection to cloud-hosted HANA (HCP) and then, in a follow-up post, I drawned on moving data over such channel on the fly using an ETL fremework called Yertl. In less then two weeks I will be giving a short talk at YAPC EU 2015 related to these topics. Specifically, I would like to share some ideas about building ad-hoc OLAP databases using the two tools (Yerlt and HANA).

Q&A Session with Larry Wall at Swiss Perl Workshop 2015

Only seven days left (and six to the start of the Perl 6 Hackathon).

Now, we need you, even in case your are not attending.

Larry Wall will answer your questions in a Q&A session on Friday at 10:50 hrs CEST.

Please ask everything you ever wanted to know about Perl and the "Perl universe" and send your questions to spw@perl-workshop.ch or add your comments to this blog post.

swat for Dancer

SWAT is simple DSL to create a smoke tests for any web application in easy and fast way. Recently I have created some tests for well known perl web framework Dancer. This tests might be used by Dancer developers as simple smoke tests suite could be run at any CI platform.

dancer.png

Starting to Learn Regexes in Perl 6

So I was looking for a script to convert that had a regex, to play with some of the new regex stuff. I picked one that I thought was laughably simple and small, and I'm glad I did, because it still took a while to convert.

Getting big without getting fat, in perl

I presented this talk last night at Sydney PM to a crowd of 12 enthusiastic mongers. Thanks to Catalyst-IT for hosting us, and for shouting free pizza and drinks!

We got stuck for a while explaining to people what mix-ins and roles are... thankfully this is a slide pack so you dont have to endure the endless attempts to find useful metaphors. Also my typo of Role::Tony seemed to endlessly amuse, so I have left that in place.

Moving data around with Yertl over ODBC (to HANA)

Probably, the first Perl blog post that I read this year — or even the first thing I read this year ;) — was "Managing SQL Data with Yertl" by Doug Bell about a nice ETL freamework that he wrote. The framework comes with a set of command-line tools that let you extract, munge and move data between different SQL databases.

As I was struggling at that time with getting some reports running against an old OLTP database, which I was very reluctant to touch, I thought of writing a tool extract, let's say, the last quarter of data, re-model the schema and move the data to HANA DB, which exposes MDX interface. A simple extract-load task can be easily implemented by chaning two ysql processes:


ysql query mysql-local "select * from EntryExternal" | ysql write hana-trial "insert into Entries (caption,category,finalPrice,finalized,resolved) VALUES ($.caption, $.category, $.finalPrice, $.finalized, $.resolved)"

File::Slurp is broken and wrong

If you are using File::Slurp, you should possibly reconsider. Basically, there are three reasons to do so;

It is wrong in a lot of cases.

File::Slurp predates IO layers, and as such doesn't take them into account well. A few years ago, after some complaints, an attempt was done to make it handle encodings. This was nothing short of being wrong.

The best known bug in this area is #83126, which means that :encoding() layers are always interpreted as :utf8. This not only means that UTF-8 encoded text is not validated (which can be a security risk), but also that files in other encodings (such as UTF-16) will be read as UTF-8, which surely will give an incorrect result.

Likewise it's not handling :crlf correctly, in particular explicitly asking for :crlf will always disable it, even on Windows.

Basically, it's doing all binmodes wrong except the one you shouldn't be using anyway (:utf8), and you should pretty much always be using a binmode, so there's no way to win really.

Last Minute Hotel Rooms @ Swiss Perl Workshop

The organisers of the Swiss Perl Workshop would like to inform you that they are freeing some hotel rooms by tomorrow, Wednesday 19 August, 18 CET.
The rooms are in the hotels Amaris and Oltnerhof, both within 5 minutes on foot from the venue.
Reservations were made for the duration of the workshop, Perl 6 hackathon included (Wednesday 26 August - Sunday 30 August)

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.