Still Fixing that Bug in djangocms-picture (part deux)

Last time, I began fixing a fairly simply space-within-anchor-tags bug in djangocms-picture.

I’m using this exercise as an opportunity to (a) try out a disciplined development process in the context of a Django application and (b) dig into the Django and Django CMS APIs.

This involves writing a failing test against the existing plugin rendering code, seeing it fail, fixing the bug, and then seeing the test pass.

My experience so far with this framework has not been as stellar as I had originally thought it would be. Continue reading

Posted in website revamp | Tagged , , , | Leave a comment

Fix that Bug in djangocms-picture

I mentioned a couple fundamental issues off the bat with my website revamp using Django CMS.

I’m in the process of revamping my hub site, I had created a barebones site: only a single page of content, two columns (using djangocms-column), and a row of social-media icons (using djangocms-picture). I only made minimal changes to get it “good enough for now.”

There were still a couple unresolved issues, even before any serious theming, one of which was that the social-media icons are rendering with small, blue underlines in between. Before theming the site, I’d like to deal with this irksome quirk.

But oh! I thought, This also presents a perfect opportunity to apply my standard dev process to a Django project! Let’s go! Continue reading

Posted in website revamp | Tagged , , , | Leave a comment

Website Revamp to Django CMS

It was long past time to redo my hub site, It had been running Drupal for far too long. I won’t tell you what version. Suffice it to say that the version had been unsupported for quite some time before I finally decommissioned it.

Rather than upgrade to a new version of Drupal, I chose to revamp the site and move to Django CMS. Continue reading

Posted in website revamp | Tagged , , , | Leave a comment

How to Cheep in Many Programming Languages (not a tutorial, but a spiritual journey)

I have a small problem.

The first part of the problem is that I’ve been a Perl developer for the past decade—

That came out wrong. Let me start again.

I have a small problem.

The first part of the problem is that I’ve been enjoying Modern Perl for the past decade while not learning any other programming languages. Don’t get me wrong: I love Perl, and I love programming, and I love learning new things. But since 2006, I’ve mostly been focusing on personal growth. Continue reading

Posted in Uncategorized | Tagged , | 1 Comment

The Most Powerful Programming Paradigm in the World?

Cornell Facebook Camp Hackathon
Photo by Benjamin Golub

I’m not a hackathon kinda guy. I don’t get off on solving hard or novel problems. I don’t believe in contests. I’m not particularly energized by the idea that a whole bunch of us are trying to solve the same problem at once— I do believe in community, and I appreciate being able to interact with other developers, but on a different level than just getting into the same (virtual or physical) room together, eyes to the computer screen.

So why then did I participate in the Dallas/Fort Worth Perl Mongers
Winter 2013 Hackathon? Continue reading

Posted in Uncategorized | Tagged , , , , , | 1 Comment

Mopping up with Perl

30 Ways to Shock Yourself #2,
photo by Bre Pettis,
from the book Elektroschutz in 132 Bildern

I ported my Hackathon entry to the latest Perl dev release (5.19.9), the one with built-in sub signatures.

I had originally designed it using the latest p5-mop and Алексей Капранов’s (Alexei Kapranov’s) signatures package. (I thought this was more in the spirit of mop than Sub::Signatures.) And that worked fairly well, with only a few glitches, and only a few complaints. But since sub signatures are now available (Yay!) in core (No hiding how I feel about that, eh?), it seemed a good time to bring the experiment fully into the present.

And here are some discoveries from my experiences with Perl mop+signatures. Continue reading

Posted in Uncategorized | Tagged , , , | Leave a comment

Benchmarking Perl 6: How Ready for Prime Time Is It?

Racing at the 2009 Camel Cup in Alice Springs, Australia
Photo © 2009 Toby Hudson CC BY-SA

Here are the slides from the talk I gave at this month’s Boston Perl Mongers meeting, this past Tuesday: Benchmarking Perl 6: How Ready for Prime Time Is It?

The talk examines:

  • Perl 6’s suitability for “production.” (Your definition may vary.)
  • Experiences of the state and stability of Rakudo.
  • Benchmarks of my favorite P6 features.
  • Lines of P6 code from everyday life.
  • Some comparisons of P6 with P5.


P.S. There’s a lot of the story that you miss when you can’t hear the talk. I may be able to post an audio recording and/or a YouTube video with the audio combined with some version of the slides: still looking into these. Unfortunately, I didn’t have time to set up a proper screencast during the talk, so I’m putting together these productions after the fact. And I’m sure there’s a lesson somewhere in there on the efficiency of good planning in design. 🙂

P.P.S. I collected my data using Geoff Broadwell’s (japhb) per6-bench benchmarking framework. (You can catch the code I used in my GitHub fork of perl6-bench.) I also highly recommend his YAPC::NA 2013 talk.

Posted in Uncategorized | Tagged , , , , | Leave a comment

More Simple Stats with Perl 6

Last time, a time long, long ago, in a universe far, far away, I left you with the following Perl 6 code (or something like it). This code reads in a series of book heights and displays the number of books of each height (in order from shortest to tallest).

my %num_of_height;
for lines() {
    if m/^ \s* (\d+[\.\d+]?) [\s* x \s* (\d+)]? \s* $/ {
        my $height = +$0;
        my $num = +($1 || 1);
        %num_of_height{$height} += $num;
    } elsif ! m/^\s*$/ {
        note "Invalid line ignored: $_";

#| unique book heights seen, in order from shortest to tallest
my @heights = sort { $^a <=> $^b }, keys %num_of_height;

say "Histogram data:";
for @heights -> $height {
    my $num = %num_of_height{$height};
    say "$height x $num";

As you may recall, this little bit of somewhat less-than-useful P6 script was inspired by a homework assignment in my daughter’s high-school statistics course. While she manually counted up the heights of the books we measured, in order to draw a histogram of the data, I wrote a Perl script to do the same counting.

Since then, for kicks, I’ve also hacked together about 50 lines of code to display an actual histogram of these data, with horizontal bars of *****. I’m not going to go into that code here, because I did not write it at the time, but if you want, you can check it out on Github.

However, I did discover how succinctly Perl 6 could answer the other questions from the assignment. Continue reading

Posted in Uncategorized | Tagged , , | 4 Comments

Reason #2 Why We Write Unit Tests

Seen on DamnLOL

Ninety-nine little bugs in the code,
Ninety-nine little bugs!
You take one down, patch it around,
A hundred and seventeen bugs in the code!

(See also Twelve Benefits of Writing Unit Tests First.)

Posted in Uncategorized | Tagged , , , | Leave a comment

Some Simple Stats with Perl 6

When my daughter told me she was taking statistics, I wondered how she could do that without knowing any calculus. Then on second thought, I guess there is a certain amount you can do with statistics, even without knowing any calculus.

Ah, yes. And last night’s homework assignment drilled that home. She asked me to help her. First, she needed to find a quantitative data set she could use to construct a histogram. Looking around the living room, I suggested, “What about the heights of the books on my book shelves? You could measure the spines and write them down in a data table.”

Now, I currently have nine full shelves of books in my living room, everything from Dave Barry and Dilbert to Peopleware to marketing and memoirs, theology and psychology, short stories and the theory of writing, to Holly Lisle, Douglas Adams, Robert Heinlein, and The Sisterhood of the Traveling Pants. (And I am not making this up.) And those are just the books that are actually on shelves, not the books that are still in boxes.

I think she was a little overwhelmed by the idea.

“You don’t have to include all the books, just one or two shelves worth. Maybe that one over there, half full of mass-market paperbacks all the same size.” Easy to measure, easy to count.

So we chose that shelf and the shelf just under it, a nice cross-section of fiction in mass-market, trade paperback, and hardcover. And then while she was manually collating the data, inspiration struck me. Why don’t I write a quick Perl 6 script to check her results. It’ll give me something to write about; plus I’ll see whether Perl 6 is really useful for anything, especially minor scripts.

And as it turns out, it might be. Continue reading

Posted in Uncategorized | Tagged , , | Leave a comment