Progress::Any update

This is an update to the post where I introduced Progress::Any a few months ago. Progress::Any is a framework that separates progress updating and outputting.

I have recently revised the API (sadly not backward compatible with old one). It now resembles Log::Any a bit further. In module code, we just need to use Progress::Any to get progress indicator, set position and target, and update the indicator while doing work:

Some Perl-Related Bugs and How They Were Fixed.

In this entry, I'd like to tell about several Perl-related bugs I have run into, and how they were fixed. I know I have not been blogging a lot lately, but, on the bright side, I was busy coding.

Let's try this again

This started as a reply comment on another post about “people” being rude, that being the case please forgive how it starts.

I'm not sure I agree that the community has always been inclusive, I'll point (again) to chromatic's post back in 2k11 http://modernperlbooks.com/mt/2011/04/civility-starts-with-me.html about issues within the community relating to hostile behavior. We all have the ability to be rude, biting, short, etc. I'm just as guilty as anyone throughout my life both personally and professionally.

Imager from Image::Magick: Trial Run

I’m a hard-core Image::Magick user. I use it to automate graphics production for my board games and video games, and also use it to manipulate all of the graphics uploaded by our customers at The Game Crafter. One of my developers has been nagging me for years to switch to Imager, but Image::Magick has always worked for me, so I had no reason to switch.

I’m working on a new board game, and I just bought a new laptop, so I figured now was a good time to try out Imager, since I didn’t already have Image::Magick installed. Here’s what I’ve learned as of day one.

Introducing Unixish

Unixish is a simple framework for creating data transformation routines that can be applied to arrays or streams. The data transformation routines can also be accessed via command-line, much like your usual Unix utilities. In fact, the Data::Unixish distribution comes with several clones of Unix utilities like cat, shuf, head, tail, wc, sort, yes, rev.

Creating a data transformation routine, called a dux function (where dux is short for Data::Unixish) is easy enough. Let's say you're creating a function called revline to reverse the characters of each line of text. You write a function called revline and place it in Data::Unixish::revline package.

The GraphViz2 Chronicles - Issue 2.10

I'm just uploaded GraphViz2 V 2.10 to CPAN, and I'd like to mention a few things, although some other things have been cleaned up as well.

JQuery and Moose

In the spirt of re-usability, I'm sharing something I posted elsewhere last week:

http://www.amazon.com/gp/cdp/member-reviews/APW5UB68563TV/ref=pd_ys_sf_lf_rev?ie=UTF8&sort_by=MostRecentReview

The context is that recruiters are pressuring older programmers to learn JQuery (read Community College class) and I'm also wondering whether to rewrite a few apps that I maintain.

Test ExtUtils::ParseXS 3.18_04 before it's too late!

ExtUtils::ParseXS is the module that translates XS to C. There have been development releases (newest: 3.18_04) for some time now. No CPAN testers failures. But for something as low-level as this, tests can only cover so much. I've been wanting to build a full CPAN against it, but the infrastructure for that has been in maintenance for months.

Because the release contains a few important fixes, please test your XS against the new development release soon. Otherwise, I will take a bit of a risk and cut a production release.

Pre-Modern Perl VS Post-Modern Perl: FIGHT!

Lately we’ve seen a couple of blog posts about “pre-modern Perl.” The core idea seems to be that older Perls (say, 5.6, or perhaps even 5.005) are perfectly good for many jobs.  Which, of course, they are.  I’m not sure anyone ever said they weren’t.

Although the authors tend to downplay it in the comments, the articles are also leavened with a bit of ... shall we say, dislike? ... of modern Perl (or post-modern Perl, or however you want to style it).  Sure, they also contain a fair amount of “hey, if that’s your thing, that’s fine for you—just leave me out of it.” But it’s hard to gloss over statements such as:

You see I don’t love “modern Perl”, in fact I kind of hate it.

A Fond Farewell to CGI.pm

This text is adapted from a lightning talk delivered at YAPC::NA in Austin, TX on June 4, 2013.

Alas poor CGI.pm. I knew him, Horatio.

OK, I admit it: I’ve bashed CGI.pm plenty of times. It’s slower than alternatives (who remembers CGI::Lite?), the HTML generation looks like a terrible idea in retrospect, and the liberal use of globals in the code is pretty ugly. I wouldn’t tell anyone to use it now, and I’m not here to argue against removing it from the Perl core.

But... most of the people in this room are probably here in one way or another because of Lincoln Stein and CGI.pm.

Build For The Small Guy

When you’re building a software app, you should build for the largest user-base possible, rather than the richest user-base possible. 

I’d rather have $10/mo from 10,000 customers than $10,000 from 10 customers. It’s $100,000 per month either way, but if I lose one customer under the first model then it hurts far less than the second model.

Besides, if you build an app that enables to small guys to compete with the big guys, then the big guys will come knocking.

[From my blog.]

Better interviews and better hiring

So the tech interview is starting to change. I am very glad to see the end of the "puzzle palace" interview. Had a number of those and never did very well at them.

To quote the meat of the article:

Comparing Apples and Oranges - rubygems vs cpan part 3

In part 2 of this series I looked at the "shop window" for rubygems and cpan, and you could see a massive difference in focus both in terms of what was highlighted on the main page and the kind of documentation provided when you looked further (TL;DR is rubygems is frictionless and encouraging with few warnings or rules mentioned up front, while cpan involves poking around fusty old usenet style FAQs full of warnings, expectations and saying to wait for a week or so before you can upload).

So assuming, you've read the documentation (and in the case of uploading to CPAN got yourself a PAUSEID, which according to feedback on part 2 should take 24-56 hours rather weeks), you're ready to build a distribution and upload it.

Ruby and Perl are probably closer in this aspect than many others :
  • They both provide tools to create a new distribution
  • They both provide the command line tools to update and upload a new version of a distribution

ruby vs perl / github cannot use utf8

My little ruby derived vm cannot parse unicode codepoints >0xffff yet.
perl can of course.

user sromanov found this little limitation and wanted to file a bugreport about it.
Since my vm is hosted on github and github is written in ruby and ruby has the same problem as my app, it turned out as catch-22.

See http://www.fileformat.info/info/unicode/utf8.htm

With 3byte sequences you can represent max 0xFFFF
with 4byte sequences max 0x10FFFF.

11110xxx 10xxxxxx 10xxxxxx 10xxxxxx (3+6+6+6)=21 10FFFF hex (1,114,111)

In my case \x{2603} was representable, but \x{1f42b} not.
perl could of course parse and print \x{1f42b} properly.

A few years back I made a video game called the Lacuna Expanse....



A few years back I made a video game called the Lacuna Expanse. Last year I open sourced the code for it. A few people in the community have really dove in and kept it going. They’re doing an amazing job. This is a map one of them made of the entire expanse. Each dot on there is a star system, so you can see just how massive it is. The various colors represent the alliances that control various star systems.

[From my blog.]

Announcing Pinto-0.087

announcement.pngA new version of Pinto has been released. Pinto is an application for managing Perl modules. It solves "the CPAN problem" by creating custom repositories of Perl modules that can be used with the standard Perl tool chain. When you build your application from your Pinto repository, you get exactly the right versions of the modules you want, every time.

This release contains a few small enhancements and bug fixes, but no major changes. It is compatible with any repository you created since version 0.066. The most notable addition is Pinto::Manual::Thanks which lists all the names of everyone who contributed to the crowdfunding campaign for Pinto. The pinto command also has a related Easter egg -- see if you can find it ;-)

The features promised for the crowdfunding campaign are currently under development. I should have an update on that early next month.

Announcement designed by Olivier Guin from The Noun Project

Being nice to colleagues with git pre-commit hooks

For my current contract I'm doing a huge amount of testing on a system that is very fun to hack on. I've also been given a lot of rope leeway in how I test. Thus, I use Test::Most quite heavily, but I've a tiny problem:

use Test::Most 'die';

That should halt the test file at first failure, a feature I use quite a bit when developing to ensure that test failures don't scroll past when I'm actively hacking on code. However, when I added subtests to Test::Builder a few years ago, I made sure that a fatal failure in a subtest would cause the subtest to fail, but not the entire test program. Well, darn. That means use Test::Most 'die' doesn't quite do what I want it to do in this case.

Being pragmatic, I did the simplest thing which can possibly work. I used the testing equivalent of weapons of mass destruction:

MVC - A Personal History

I shared this story with a potential employer a couple weeks ago, who apparently was unimpressed. Notwithstanding, it's all true. Literary criticism might be the next best step.

In 2001, Arthur Andersen Business Consulting went out of business. And I lost the best job I ever had. Clearly Enron was a significant factor, but importantly, AABC ran out of money to fund their war with Andersen Consulting/Accenture. Almost immediately, I was contacted by a friend/colleague, Jeff: He was launching a startup and needed an IT Director. Essentially, my job was to develop the technology his company would resell.

First inchstone.

I have started hacking on my GSoC project to create a JavaScript backend for NQP (a Perl 6 dialect), which will be grown into a full one for Rakudo in the future.
Today I have unbitrotted the existing code at https://github.com/pmurias/rakudo-js by handling QAST::Var's with decl set to "static" (variables that don't change at runtime) the same as ones with "var" (normal ones). As such I have completed the first of 15 inchstones ;)

Unicode is 20++ years old and still a problem

Just did a quick hack to read out product data from an old shop site and import it into a new one:

- wget -r
- File::Find
- Mojo::Dom for parsing
- Text::CSV::Slurp for the result

After 11 minutes running for 14 K pages I experienced the bad surprise:

One file had non-ASCII characters in its name and File::Find does not use char-mode. I forgot about this. Text::CSV::Slurp crashed.

Why the hell are there so many CPAN modules still ignoring Unicode?

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.