Docker, Explained for “Old School” Developers

Docker, Explained for “Old School” Developers

Anyone writing code has probably seen a bunch of references to Docker by now. It’s like this new toy that’s all the rage, but for people like me — where picking up new things takes a crap-load more work than it used to — the general reaction is “I’ll learn that when it’s unavoidable.” Alas, a few weeks back it became unavoidable, and I’m here to report back.

If you’re even mildly inquisitive, a quick scan of Docker says a lot about containers and it’s pretty obvious that a container is some kind of virtual environment, but there’s not much that tells you why you should give a damn. I’m going to try to fix that. I’m not going to describe how to use Docker here, just what it’s for. There’s lots of great resources on making use of it elsewhere.

If you got into development in a time when your workplace had a nice air-conditioned room with raised floors and racks of servers and keyboard/console switches, then this post is for you.

The TL:DR on this is the learning curve here is a lot less than it seems at first, and the flexibility it gives you to set up and change configurations is truly powerful. Invest a few days in learning the basics and you can build, rebuild, and reconfigure virtual server rooms that significantly reduce the amount of time needed to maintain your own local environment. As a common example, if you’ve ever sworn at LAMP/ XAMP / MAMP configurations only to start from scratch or if you’ve tried to get two versions of just about anything running on the same system, then Docker definitely is for you.

(more…)

Fix: Single File Tests Break in Netbeans 11.0 / PHPUnit 8.2

UPDATED 2019-07-22: Netbeans 11.1, released today, incorporates a robust fix for this problem that should survive future changes in PHPUnit.

TL/DR: There’s a one line patch to PHPUnit below that will kludge the kludge and get you running again.

Anyone who has worked with PHPUnit for some time knows that backwards compatibility isn’t exactly a prime consideration. Meanwhile, although Netbeans currently has very good support for PHP, you have to figure that the intersection set between the Java developers working on the project and the people who figure that PHP is anything but a toy language for building simple projects is, well… small. [We’ll just ignore the fact that Facebook, the largest application on the planet, is written in PHP].

So when Netbeans says it offers support for PHPUnit 3.4.0 or higher, it’s okay to expect the integration to be out of date. Rather surprisingly, it’s actually worked right up to PHPUnit 8.1.

But now we have 8.2. Command line parsing has been made more robust, and the extra parameter Netbeans passes in to a kludged custom test when running a single file doesn’t work anymore. [BTW I don’t blame the Netbeans developers for this kludge, it was probably the only solution that worked back in 3.4.0.]

This makes the current Netbeans approach outdated and unworkable. Like many open source projects, this means someone who cares has to go in and do some significant re-work. Don’t hold your breath. I’d give it a go but my Java foo is about 20 years old now. I probably don’t know enough any more to even be dangerous. I think I know a good architectural approach but attempting to implement it would be a recipe for failure.

So what to do? Patch PHPUnit! This is a pain since the patch will have to be reapplied every time PHPUnit is updated, which is frequently. But at least it works.

So here’s the kludge: in the file TextUI/Command.php in the handleArguments array, just change the line that reads

if (isset($this->options[1][1])) {

to

if (isset($this->options[1][1]) && substr($this->options[1][1], 0, 6) != '--run=') {

This ignores the Netbeans-generated argument and everything works as before. Not pretty but it works.

For more information (and a possible fix), follow the Netbeans Issue.

Creative Downloads: Everything Is Not Free, at Least Not Yet

A few minutes ago I didn’t know Sara Madison existed. Until an author friend shared her brilliant post “Dear Broke Reader: Your Sense of Entitlement is Killing Me” on Facebook.

Readers of this blog will know that I’m a huge fan of open source. Be it software, designs, engineering, etc. There’s a huge body of work that I believe benefits from the open source movement. That belief is predicated around freedom. I strongly believe that people who use products should have the ability to control their destiny after they acquire a product, and the best way to do that is to give them the tools to recreate and modify the product.

But that doesn’t mean everything should be free. While it’s true that I have contributed to collaborative open source projects that give the code away, it is not an entirely altruistic endeavour, for at the same time I’ve taken advantage of similar efforts by hundreds of others to build things that I never could have built alone. The key thing here is that these projects are collaborative works where all the participants in a community benefit.

Individual creative works are another thing entirely. There’s no similar multiplier that gives a creator back a multiple of what they’ve contributed. Someone who illegally downloads a book by a small author isn’t gaining any freedom, they’re just getting a product for free. If you download one of my Creative Commons licensed low resolution photographs and use it to print a crappy large format print, you deserve to waste your money. Book authors don’t enjoy that ability to constrain the clarity of digital versions of their work.

At some point, as individual labour stops being the way most of us add value to the economy, we’ll have to transition to some form of guaranteed minimum income scheme. At that point, there might be a rationalization that goes along the line of “this author is already receiving enough to get by, so they’re getting enough”. While I can’t say I agree with that position, at least someone who is passionate about creating has the knowledge that they won’t starve to death in the process. But neither will they live comfortably, nor will they receive the value that others derive from reading their work. A survivable system still isn’t a sustainable system. But this is futurism. We’re not there yet, and until then, taking advantage of someone who needs the money to keep doing what they’re doing is outright theft.

The Blog is Ported (again). Hello WordPress.

Welcome to the third major iteration of It’s Fixed in the Next Release. From Blogger (yuck) to Serendipity (which truly deserves more attention than it gets) to WordPress (market share wins, even in the open source world) here we are.

Speaking of open source, what you see here is only possible because of the FOSS (Free Open Source Software) model. Not only is the core of WordPress completely open, most of the themes, plugins, and tools are as well.

Independent of the cost, FOSS made this blog because the theme is a hybrid. The base theme is the free version of “Blogolife”. I’ve made some changes to it, both in terms of some invisible code rework, and by hacking in the tag display from “AskIt”, a commercial template I purchased for a project that died. At first I thought AskIt was going to do the trick, but in the end I just didn’t like the main page layout. Blogolife had the clean traditional blog feel but the display of tags and categories wasn’t all that great (I haven’t done anything to the categories yet).

I also removed all of Blogolife’s admin links and promotions for the “PRO” version. Needless to say I wasn’t likely to be buying that anyway.

It’s interesting hacking on WordPress code, and it’s a classic comparison between simplicity and power. I think it’s possible to keep most of the WordPress API in your head, and its possible to be a true expert on it in a year or so. Meanwhile, I’ve been working with Joomla for almost six years now, and it seems I keep on discovering new tricks, not including the outside-the-core stuff like template frameworks and the like. So there’s a freedom in WordPress that makes it possible to hack bits of two themes together in a few days and get something that works. But at the same time I feel like I’m working in a small shop with hand tools. By comparison Joomla feels like a manufacturing line full of robots — configure each one to do a job then watch the whole facility in action.

Each environment has its place. It’s actually more personally satisfying to feel you’ve built something by hand. WordPress certainly rocks the blogging / simple site space, but it has its limitations. Over in the Joomla development world we wrestle with issues like how to make it so those “robots” of ours plug into each other most effectively and with a minimum of code duplication. While we’re making it easier to plug things together I think we’d also be wise to keep an eye on offering freedom to site builders who need to produce a custom solution but only know the basics of PHP development. We never want to be in the position where someone says “Joomla is a great platform but you need a team of developers to build and run a site.”

After all, market share wins, even in the open source world.

So Long, Serendipity, and Thanks for All the Posts

To say this blog has suffered from neglect is to make a rather large understatement. It turns out that converting a passing thought into a coherent post takes too many words and too much time. Or maybe finishing a post just doesn’t generate enough endorphin. Whatever the reason, It’s Fixed in the Next Release underwhelmed my expectations, and then Twitter really made a mess of it. (more…)

Mastodon