Mocking LWP::UserAgent properly
On studying programming and programmers
In university, we do a lot of waterfall in courses with project work. It isn’t the kind of thing a student would do (to) themselves, so professors feel obligated to give us that experience in class. Research shows that both business and recent graduates wish they’d been taught agile development methodologies in university and college, but course content always lags behind.
At Pythian, we used a mostly-Scrum methodology, with all the benefits and challenges that entails.
Introducing File::Symlink::Atomic
Wordpress theme for hashbang.ca
Tips & tricks from my 4 months at Pythian
After working with Yanick Champoux on a few little Perl projects here and there, we finally met face-to-face at YAPC::NA last summer. A few months later, when I was looking for a co-op position, I immediately thought of Pythian.
SSL security in HTTP::Tiny
I was asked to add SSL support to a client library, while also moving from home-grown manual HTTP code to a proper module. HTTP::Tiny
was ideal because it is pure-Perl, a core module since 5.14 (so it’ll be maintained), and it’s just one .pm file, making it easy to ship.
An application server that supported SSL was provided for testing purposes, but the SSL certificate didn’t match the hostname – HTTP::Tiny
correctly rejected connections. I needed to be able to control the settings sent to the underlying IO::Socket::SSL
object used for the encrypted connection so I could turn off security features for testing. As I worked on that, David Golden offered invaluable feedback, which greatly improved the design of the features added to HTTP::Tiny
.
As of 0.018, HTTP::Tiny
is more configurable, and has a simple interface for easily making SSL connections more secure.
Wherein I realize the bliss of writing init scripts with Daemon::Control
Init scripts are annoying little things – almost entirely boilerplate. Here’s how I learned to stop struggling, and love Daemon::Control
to control my daemons.
The module really is as simple as the synopsis – you describe the daemon, have it write an init script (which actually just runs your Daemon::Control
script) for you, then update-rc.d
and you’re golden. It really is that simple.
Posted: Apr 16, 2012
Tags:
A pastebin with almost no user interface
Dist::Zilla::Plugin::Twitter gets an OAuth update
My pluginbundle for Dist::Zilla
includes, among other things, the Twitter plugin so I can brag on Twitter every time I release a module. Mysteriously, it broke one day. Looking at the code, I realized that it was sending my username and password to authenticate. I remember being uneasy with that at the time I set it up, but I quickly forgot, and continued along blithely. OAuth is an authorization standard that allows users to avoid giving their username & password to a potentially-untrusted application. Using OAuth has been requested since 2011, and the 401 Unauthorized
error I got indicates that now it is mandatory for Twitter.
David Golden offered to let me maintain the module, and I’m a sucker, so… :D
Posted: Apr 2, 2012
Tags:
Consistency and direction in pagination
Today, I discovered yet again one of the cardinal sins of user interface design – inconsistency. A blog had two pagination interfaces on one page - and they had opposite directionality. For one, older posts were to the left; for the other, older posts were to the right. This is an obvious and egregious error, and the solution is to make them operate in the same direction, or better yet, remove one.
Broken busybox can cause DHCP timeouts on Android
Apparently, when your Android device’s busybox installation gets broken for whatever reason, this doesn’t cause your phone to come to a screeching, grinding halt. The breakage is much more subtle.
Posted: Dec 7, 2011
Tags:
Applying fair dealing exceptions to TPMs
James Gannon points out that “Critics of the TPM provisions in Bill C-11 often claim to have a “balanced” solution for TPM protection: to create an exception that allows hacking for legal purposes.” That’s certainly correct, however, he proceeds to misconstrue what that suggestion actually means.
On the government's internet surveillance plans
Minister Vic Towes responded to Privacy Commissioner Jen Stoddart’s open letter Friday:
On Bill C-11, Another Act To Amend The Copyright Act
Between April 2006 and March 2011, Canada was governed by a minority Conservative government, meaning the government needed the co-operation of the opposition parties to pass legislation. Despite a lot of talk about minority governments necessarily yielding instability, having a minority government forestalled the worst of the Conservatives' plans. In the last federal election in March, the Conservative Party won a majority of the seats in Parliament – meaning they have enough votes to pass any legislation they want, barring opposition within their own party. Given Prime Minister Stephen Harper’s iron-fisted control over his caucus, that’s unlikely.
Mocking LWP::UserAgent
Important update: Don’t follow this advice, follow that advice!
chromatic mentioned how to use dependency injection in You’re Already Using Dependency Injection. Although I had read that when he posted it, I hadnt actually ever done it. That is, until today.
My 4 months at DRDC
Earlier this year, I posted a short entry about having accepted a job offer from Defence Research & Development Canada (DRDC). Over the past four months, I’ve had a great supervisor, a relaxed workplace, and challenging work. As you might imagine, working at a defence research lab is quite different from anything I’d done previously. I knew that was going to be the case, but I was still surprised at how little of my prior knowledge applied to The Real World Of Real Work. But first, what awesome, classified, doomsday devices did I get to work on? Well…
Trimming whitespace in gedit with Perl
With gedit plugins, you can turn this simple text editor into a lightweight IDE. It’s fast, has good syntax highlighting, and can have code completion, shell integration, and many similar feature you might expect from an IDE. One feature it lacked was trimming whitespace from files. I searched for plugins to do this, and found several, but none of them quite met my expectations, because none were configurable. I typically want my files to end with one and only one newline. Of course, the solution is Perl.
Revising perlopentut
At YAPC::NA 2011, I whined about the lack of codification of tribal knowledge in Perl. One area that’s ripe for fixing is the documentation on open
. There’s a section in perlfunc
for open
, and a tutorial: perlopentut
. That tutorial is where I’ve started my campaign to have the tutorials and FAQs give good advice.