Archive for October, 2013

Monthly Donations: VLC and the Pegasus Foundation

Thursday, October 31st, 2013

Ah, what a fine day… for science! I mean, for my monthly donations.

Today I’m supporting VLC, the fantastic open source media player (actually, it’s much more than just a player) that I use both on my Linux desktop and on a MacBook. VLC has been around since early 2001 and through the years has gained well-deserved reputation as the player that can play any media file (which is thanks to the numerous decoding/encoding libraries included with the program). It’s developed by the VideoLAN project team — thanks guys, great job!

The second donation that I’m making this month is to the Pegasus Foundation, devoted to rescuing horses bound for slaughterhouses, and generally helping animals in need. I supported them in December last year, and this time I’m making a donation for a little 5-year-old dog named Jinx, who was severely hit by a car, had undergone surgery and now needs to go through long and extensive rehabilitation to recover. Stay strong, Jinx!

POD Web View

Wednesday, October 23rd, 2013

When developing a Perl module, I often want to get a quick preview of the documentation that I’m writing, just to see if everything is in order and how it turns out. I used to do this the old fashioned way, by generating an HTML file with pod2html or pod2cpanhtml and opening it in a browser, but I was hoping in this day and age there is an easier and better solution, preferably a web application.

Looking around, however, the only thing I could find was the pod2html page at the CPAN Search site, which allows you to upload a POD file, have it processed by pod2html, and displayed with CPAN style. I thought it might be a good idea to try building something more user-friendly, with features like editing POD in the browser, drag and drop file uploads, etc.

And what better time for a little project like this than a weekend when you’re ill and not supposed to leave your apartment? Well, that’s what my last weekend was like — two days of coughing and coding, and here’s the result: POD Web View.

The application allows you to upload a POD file, get it from a URL, or paste its contents and edit it on the fly. The generated HTML can be displayed in the style of your choice, mimicking how it would look on CPAN, MetaCPAN, or GitHub.

To give credit where it’s due, the backend is built on Dancer and uses Pod::Simple::HTML to generate the HTML preview. The user interface is made with Twitter Bootstrap, a lot of JavaScript/jQuery code, and the amazing Ace editor.

I hope this will be useful for at least a few fellow Perl developers, like it already is for me. Please note that at this point this is still work in progress — the backend code needs some more work (e.g. basic sanity checks), and there are a couple UI issues that I’m aware of (and likely a dozen more that I’m not). Anyway, be my guest and give it a try, and if you’d like to report an issue, or maybe help me with the development (more than welcome), I’ve put the project up on GitHub.

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

Tuesday, October 15th, 2013

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.

A few days ago, I was delighted to find out that the problem went away by itself, since Plack switched from using LWP::UserAgent to its own Plack::LWPish, which is built around HTTP::Tiny. Now I needed to implement SPDY in HTTP::Tiny, which is, well, tiny when compared to LWP::UserAgent, so the task seemed much easier. I gave it a shot this weekend and got it working in a matter of hours, spawning HTTP::Tiny::SPDY, a subclass of HTTP::Tiny that works the same as the original, but can also do SPDY.

I immediately used the module for the intended purpose of testing Arriba in SPDY mode, and, as expected, this revealed many problems, but most of them turned out to be easy to fix (except for one, which took me more than three hours just because I didn’t RTFM in the first place — will I ever learn?). Soon, Arriba running SPDY was passing all the tests in the suite, which I happily celebrated with a tasty porter beer. I am now cleaning up the code to prepare it to be finally released on CPAN.

And speaking of CPAN, HTTP::Tiny::SPDY is already there, as well as on GitHub. Like Arriba, this is an early release, the code is hackish and immature, and I take zero responsibility for the pain and suffering that you may bring upon yourself when you try to use it. But if you do, I crave your feedback.

  • Archives

  • Categories

  • Meta

  • Latest Tweets

    Warning: Illegal string offset 'last_access' in /usr/local/www/ on line 334

    Warning: Illegal string offset 'time_limit' in /usr/local/www/ on line 334

    Warning: Illegal string offset 'last_access' in /usr/local/www/ on line 336

    Warning: Illegal string offset 'twitter_api' in /usr/local/www/ on line 234

    Warning: Illegal string offset 'user_token' in /usr/local/www/ on line 262

    Warning: Illegal string offset 'user_secret' in /usr/local/www/ on line 263

    Warning: Illegal string offset 'consumer_key' in /usr/local/www/ on line 264

    Warning: Illegal string offset 'consumer_secret' in /usr/local/www/ on line 265

    Warning: Illegal string offset 'twitter_username' in /usr/local/www/ on line 270

    Warning: Illegal string offset 'show_retweets' in /usr/local/www/ on line 272

    Warning: Illegal string offset 'exclude_replies' in /usr/local/www/ on line 275

    Warning: Illegal string offset 'twitter_data' in /usr/local/www/ on line 282

    Warning: Illegal string offset 'twitter_data' in /usr/local/www/ on line 350

    Warning: Illegal string offset 'twitter_data' in /usr/local/www/ on line 351
    Twitter outputted an error:
    Warning: Illegal string offset 'time_format' in /usr/local/www/ on line 484
  • Follow odyniec on Twitter