Maisha, now with OAuth support

A project I started back last year is Maisha, a command line client to interface to social micro-blogging networks, such as Twitter. On 31st August this year, Twitter depreciated the Basic Authention method of allowing applications to login users with a simple username and password combination. In its place they now use OAuth. (See also the blog post by Marc Mims - author of Net-Twitter).

On the face of it, OAuth seemed a bit confusing, and even the documentation is devoid of decent diagrams to explain it properly. Once I did get it, it was surprising to discover just how easy the concept and implementation is. For the most part Marc Mims has implemented all the necessary work within Net-Twitter, so Maisha only needed to add the code to provide the right URL for authorisation, and allow the user to enter the PIN# that then allows the application to use the Twitter API.

Perlito Perl6 in .NET

There is a new article about the Perlito Perl 6 compiler, published by the São Paulo Perl Mongers. The article is mostly focused on the Javascript backend, and all code snippets can be run in the browser. There are also instructions on how to install the Perl 5 backend from CPAN. The article finishes with an overview of the compiler internals.

In the development front, Perlito now passes all it's tests in .NET, using the IronPython backend:

$ /usr/local/bin/prove -e "perl perlito.pl -Bipy" ... t/16-var-redeclare.t ....... ok t/21-test.t ................ ok All tests successful. Files=30, Tests=125, 77 wallclock secs ( 0.17 usr 0.14 sys + 48.15 cusr 2.53 csys = 50.99 CPU) Result: PASS

qw() in list context deprecated

Someone decided that using `for var qw()` should be forbidden, you have to write explicitly now `for ... (qw())` instead of `qw()` beginning with 5.14. WTF

5.14 seemed to be a fine release for me, the first in a long time which is actually faster then most of the previous ones. And there were not too many languages policists.
But this new qw() deprecation warning is just pure nonsense.

`qw` used in for list where only list-context can be used should still be allowed.
Why should I be forced to update all my code to add `()` around `qw()` only because it seems to be "right". perl has let you use handy shortcuts forever.

for my $a qw() {} => for my $a (qw()) {}
How awful!

Writing Large Systems in Perl is a Privilege Not A Right

I have had an experience which has caused me to reevaluate my relationship with Perl. Members of my local PM have also had to deal with this for the last six months or so. After a post-pub conversation with pozorvlak the other night, I have come the conclusion that while writing large systems in Perl is possible and sometimes even desirable, this is a privilege of showing that you can be disciplined and not a right.

Perl 5, at least, allows you to have many different ways of attacking a programming problem. This can be a benefit but it comes with two large problems. First, if your programmer is not disciplined, Perl is almost guaranteed to give you spaghetti code. Second, if your programmer is inexperienced, Perl will give you something that works but will be unmaintainable by either the programmer themselves or an experienced programmer. Perl does not teach nor require good programming practice.

Number::Phone 1.8 released

I wouldn't normally bother to blog about an update to an existing module, but this has an incompatible change.

Previously, if you tried to create a Number::Phone object but didn't have a module installed that knew about the numbering plan of the country that number was in, then the constructor would fail and return undef. This was silly. Now, it returns a minimal object that knows what country the number is in and not a lot else.

Working For Bletchley Park

This might not seem like a perl blog post. However it is...
Back in the second world war Bletchley Park was the focus of the allied code breaking operations, and the equipment and techniques devised there were the direct ancestors of modern computers and algorithms.
Perl builds on foundations laid at Bletchley.
After the war the role of Bletchley was treated as a state secret, and to the shame of the UK the whole history and site was allowed to crumble; only in the last few years have serious efforts been made to preserve the site and its history, but more work and money is still needed.
So, if you are in the area, why not visit Bletchley.
And, if, like me, you have a good career in computing, why not consider donating something back to the birth place of the modern computer.
At least 100 others have joined me and pledged 1 day's salary to the Bletchley Park Trust - we would love it if you could join us.
You can find more details at http://www.work4bletchley.org.uk or donate at http://www.justgiving.com/workforbletchleypark

Kephra 0.4.4 and release cycles

In the next days, Kephra 0.4.4 will arrive.
New features are mainly about basics editing. Things that are easier with mouse like selecting word, line (double or triple click) or or selected some content items are now as easy with keyboard as with the mouse. And things that are fast with keys like cut copy paste and find string are now available with simple mouse clicks, without context menu (even if its still there - timtoday) (left click on selection - copy, middle click inserts selection like in emacs, right click while selecting-cut). Most of that I borrowed from Acme. Some little tools where added too. All in all easy to understand things. So what readers may wonder most, is calling it a "testing release" like 0.4.3 two month ago.

On CPAN it was marked as stable because there you have only a 2 way distinction. And testing releases are optimized on stability as dev releases are optimized on freshness. So why introduce a third level release cycle?

Translating LaTeX to Word: Pandoc

As some of you might notice from my old tech blog, I often have problems with my colleagues in the Humanities because they use Word and I use LaTeX. This cause me recently to have a lost day as I had to translate a PDF by hand into Open Office so I could send it in Word to my editor.

In my search to make this process much less arduous, I believe that I have found the panacea: pandoc. I tried it on my XeLaTeX file for my current article and it worked very, very well. It outputs in OpenOffice format and from there, it is easy to translate into Word.

There are two problems (as there always are). First, it does not handle BibTeX at all so you must copy and paste that information by hand from your PDF. Second, it mangled the Greek that I had in the file which means that pandoc does not handle UTF-8 very well at some point in the process of producing the Open Office file. I will need to file a bug report. Other than that, however, I am very impressed

Equinócio de Setembro

O equinócio é um evento que foi criado pela comunidade Perl Mongers de São Paulo para gerar conteúdo sobre a linguagem em português, o qual é realizado nos meses em que o Sol cruza o plano do equador, publicando um artigo por dia durante o mês.

Em março deste ano aconteceu a primeira edição do evento, e na edição deste mês já foram publicados dez artigos:

Todos os artigos do evento podem ser encontrados no site do São Paulo Perl Mongers.

YAPC::Europe 2010 Conference Survey Results

The results from the Conference Survey for YAPC::Europe 2010 in Pisa, Italy are now online.

This year YAPC::Europe had 245 registered attendees, with 153 of those attendees (amounting to 62%) submitting their responses. Many thanks to the 153 of you who took the time to take the survey, and all those who submitted 1048 evaluations for the speakers. It really is very much appreciated.

I now plan to work through the feedback for the organisers, and prepare the raw data, as well as the raw data for previous surveys. After that I hope to release all the code used to administer the surveys, so that if anyone wishes to use this code for their own purposes they can. However, as the YAPC Conferences Surveys can interface to the Act system, if you are organising a YAPC or Workshop using Act and wish to run surveys, please feel free to ask me to set up an instance for you.

If you have any feedback regarding the surveys, or suggestions for questions, or have any questions regarding the surveys themselves, please feel free to contact me at barbie@cpan.org. For previous surveys please visit the YAPC Conference Surveys website

Showcasing Test::TinyMocker

For a while we've been using in Dancer a few mocking subroutines that we've put together quite elegantly as TinyMocker in our 't/lib' folder to assist us in tests.

However, with time we've been asked (okay, Sukria has been asked) to separate this so others could use it outside of Dancer. Sukria has released this as Test::TinyMocker.

Test::TinyMocker allows to mock subroutines (be it in object oriented or basic packaged subroutines). Here is how it will look:


use Test::More tests => 21;
use Test::TinyMocker;
use My::Object;
mock 'My::Object::run' => sub {
isa_ok( $_[0], 'My::Object' );
...
};
my $object = My::Object->new();
isa_ok( $object, 'My::Object' );
$object->run(); # will run some tests instead of the actual method

A nice aspect of TinyMocker is that it tries to also be expressive (which we also enjoy in Perl-world) and allow you to write in a way that is easier for people to read (albeit a bit longer for you to write):


mock 'My::Object'
=> method 'run'
=> should {
isa_ok( $_[0], 'My::Object' );
};

If you use an arrayref, it automatically understands you want to mock several methods at once. It also provides "methods" for readability:

mock 'My::Object'
=> methods [ 'run', 'walk' ]
=> should {
...
}

I hope this helps you as much as it helps us!

use.perl refugee

While things over at use.perl get sorted out, I have decided to move my technical blogging over to this space. I know I am not the most prolific tech blogger out there but I like from time to time to post a few things here and there about tech stuff.

PDX.pm videos

When I'm in town during a Portland Perl Mongers meeting, I livestream the event with UStream, and record the presentations if the speakers permit it. Last night, I taped Michael Schwern talking about Test::Builder2 and Chromatic regarding Modern Perl. Check them out!

Birmingham.pm 10th Birthday

On the 8th September 2010, Birmingham Perl Mongers celebrated their 10th birthday. While there are several other groups around the world who have been in existence longer, I think we are the second longest (uninterrupted) running group in the UK.

106-dscf1220.jpg

Mike Bissett (who was our special guest last month, when he paid us a visit while on holiday, as he now lives in Australia) and I started Birmingham Perl Mongers on our return from OSCON in 2000. We sent off the necessary forms and got ourselves setup on the perl.org servers during August, launched a website, and had our first official meeting in the Hogshead on Newhall Street, on Wednesday 13th September 2000.

Since those early days our numbers have grown, we've been involved with several different projects, hosted a YAPC and a QA Hackathon, held many technical meetings with numerous special guests and generally had a great time.

For our Birthday, JJ and his wife Penny, baked us a cake, decorated appropriately. Photos from last night are now online.

Here's to the next 10 years.

Perl Event of the Summer

For one reason or another I have had to delay giving a talk at my local Perl Mongers group for the past few months. And one of the regulars accused me of hyping it so much that it will no longer be able to stand up to expectations. So I responded by writing a long email to the mailing list explaining why nobody will want to miss this presentation. Not to be outdone, he then wrote a script for a commercial for this talk in the form of a movie trailer. I couldn't just let it go at that, so I actually created the commercial for his script!

Master-Slave 2.0: Replica Sets

MongoDB's replica sets are very similar to a normal master-slave setup, except they are self-monitoring: if the master goes down, the slaves will band together to promote a new master automatically.

It's easy to try this out and fun to watch the automatic failover (or perhaps I'm easily amused). You'll need to download MongoDB and the MongoDB Perl driver (cpan MongoDB). Once you unzip the MongoDB binaries, you're ready to spin up a replica set (there's no install necessary).

Change to the MongoDB directory you downloaded and start up three MongoDB servers. Each database server needs:

  1. Somewhere to put its data (a directory).
  2. A unique port to listen on (it's a server).
  3. The name of the replica set it's a member of. Each replica set needs a unique name, so for this example I'll use mongoMonger.

In the "real world" (production), you'd have each member of the set on a different machine, but I'm setting them up locally in case you only have one machine to work with.

An Unexpected Test Result

I spent several hours debugging a catastrophic test suite failure today. As our test classes take over an hour to run and the failure takes place near the end of the test run, it was a very annoying issue to debug. Unfortunately, the test class in question passed when run by itself, but not when run in the entire suite. That usually means the global state had been altered in an unexpected way, and boy had it! Seems the test was failing because it was trying to run a method that a completely separate test class had -- and those classes weren't related by inheritance. It was very confusing until I finally realized that someone had mistyped a package name at the top of the test class. A few minutes later I had a new test which verified the package name ... and found ten other misspelled package names (out of 325 packages).

YAPC::Europe 2010 Talk/Tutorial Evaluations

I have just sent out the evaluations for all the talks and tutorials given at YAPC::Europe 2010 in Pisa. If you haven't received yours, first check that it hasn't got lost in a spam filter. If it hasn't arrived by tomorrow, let me know and I'll resend a copy.

There were 153 survey responses received and 1048 talk responses received. With 245 attendees, that gives a 62.44% response rate, so thank you to all who took the time to complete all the surveys.

The official conference survey results will be published within the next few days, on the YAPC Conference Surveys site.

How can I troubleshoot my Perl CGI script?

Awhile ago I moved my How can I troubleshoot my Perl CGI script? to StackOverflow. I'm just getting around to telling everyone about it because it was pretty far down on my to do list.

I think this has almost pushed the old location on SourceForge out of the googlebrain, but it wouldn't hurt for people to link to it in a blog post, tweet, whatever to encourage Google to find this one. Someday SourceForge will disappear and we won't have to worry about it anymore. How is it even still alive? StackOverflow has pretty good googlejuice though, maybe because Google likes StackOverflow.

Since it's on StackOverflow, this also means that I'm basically letting go of it. StackOverflow encourages people to revise the questions and answers of other to improve them, and I've given it wiki status to encourage that even more. Take a look, see what I've left out (or left in), what's new and exciting (or old and boring).

CPAN Testers Summary - August 2010 - Mourning Sun

It's the end of an era. After 11 years from the first official CPAN Testers test report submission, the cpan-testers mailing list has finally closed its doors. From now on, anyone sending a test report via SMTP, will receive a bounce-back email. Most have already upgraded and reconfigured their smoker clients to use HTTP/S. For those that haven't or are new testers wanting to start afresh, please read the Quick Start page on the CPAN Testers Wiki, and join the cpan-testers-discuss mailing list to ask for help and advice.

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.