Dodged the XML bullet

Years ago, when XML was the new hotness, I kept meaning to learn it. (I mean, I learned it, except the headers and CDATA, but I never figured out how to use XPath or XQuery or XSLT or do anything useful with it. I learned just enough to write a toolchain that emits an RSS feed that iTunes is happy with and stopped there. Tidy is your friend.)

Maybe I dodged a bullet. The other day Manton Reece and Brent Simmons came up with JSON Feed, a replacement (or at least an alternative to) Atom and RSS. Suits me. I prefer YAML to JSON, but I’d take either one over XML even if I could only see them upside down in a mirror.

It’s not there any more, but in their first announcement (quoted here), Reese and Simmons committed a gaffe and said what they thought:

developers will often go out of their way to avoid XML. JSON is simpler to read and write, and it’s less prone to bugs.

Duh. But the rationale they state now is still true, if a little less transparent.

While I’m thinking about it: a pet peeve. RSS says that <pubDate> wants an RFC 822 compliant timestamp for feeds, but good luck if you’re in Alaska, which is part of the US not in the big four time zones. (Use Zulu -0900 instead.)

Updated. More brutal honesty:

Reece and Simmons decided the time was right to build an updated syndication format, as more and more developers are refusing to work with XML.

“I believe that developers (particularly Mac and iOS developers, the group I know best) are so loath to work with XML that they won’t even consider building software that needs an XML parser,” Simmons said. “Which says to me that JSON Feed is needed for the survival of syndication.”

Tech Tab Sweep

Krita appears to be Gimp spelled sideways, but cross-platform, or more accurately, Gimp:Photoshop::Krita:Painter.

OpenSSH best practices. Mac OS X 10.10 “Yosemite” takes SSH security so seriously that after you upgrade, you can’t log in remotely. Even if you tell it you want to.

Use Ruby to make your graphs look hand-drawn, like the ones in XKCD.

Via RubyFlow: A set of step-by-step TDD tutorials, a library for importing real-world CSV data.

Gruff: a library for creating beautiful charts in Ruby.

Honeybadger.io: Use capture3 instead of backticks: capturing I/O from shell commands. I should be using pry instead of irb, and when I switch, here’s how to work with exceptions in pry.

Microsoft promises that you can clean install Windows 10 after upgrading. Hanselman confirms, but look at the questions in people’s comments. Someone at Microsoft should be asking, why don’t they trust us, and what do we have to do so they start?

Google’s new build tool: Bazel. What are the odds I’d switch when I’m still learning Rake?

Tech Links – May 29

Three open-source Python shells.

Don’t catch Exceptions. I must have known why I always do rescue => boom to catch exceptions. The reason is that Ruby makes that shorthand for rescue StandardError => boom. Nifty.

libgrader: find quality gems for your next project. It knows about two of my favorites gems: pericope and titleize. (Unlike awesome-ruby.)

Sequel: the database toolkit for Ruby. (Here’s an introductory screencast at RubyTapas.) I keep thinking I should do something with sqlite. Well, really I think I should do something with a database, but I’d rather put it on Drobox than try to figure out how to have a mysql server out on the internet and not regret it.

The reason? Once you’ve used a join you’ll never be content using a spreadsheet for a database. Here’s a quick introduction to joins.

Mac audio graphing tool FuzzMeasure updated. I didn’t remember that it had a name of its own. I thought it was just SuperMegaUltraGroovy. Anyway, every time I look at this I think to myself about the software I wrote in the mid-90s and all the cool graphs I’d like to have implemented.

Tech Tab Sweep

It’s time to upgrade your Ubuntu machines.

8 things to do after installing Ubuntu 15.04. One of the items is to add a tweak tool, which reminded me of Unsettings.

I’m working on a similar list for Windows, except (a) nobody gets to install Windows, you have to buy a PC with it preinstalled, and (b) there are about 300 things you have to do next.

Speaking of Ubuntu…. I barely know what a .deb is, so this article was complete gibberish to me, with all this talk about Snaps and Snappy for future releases of Ubuntu.

Bjarne Stroustrup outlines changes in store for C++ in v17. I can barely remember how awesome I used to think C++ was back in 1986. And compared to C, I guess is was, then. Today—forget about it. Just give me a scripting language.

Finally: During the 1990’s I used to be a DIY system builder, but the past decade or two I’ve been too busy and too impoverished. And there’s a lot to be said for buying something small. Still, I might get around to building something again someday. This sounds like fun:

Podcast Publication Date

A couple of weeks (months?) ago, my podcast feed quit including a publication date, and I couldn’t figure it until just the other day. The problem was that my publication tags looked like this:

<pubDate>Sun, 05 Apr 2015 19:18:25 AKDT</pubDate>

but that won’t validate. It never has, but something must have changed in Apple land (either on their servers, or in iTunes) to make the times quit working.

The problem is that AKDT isn’t a RFC-822 compliant time zone. (It assumes that time zones in North America have names that are 3-character strings.) Instead you have to use ‘-0800’. (AKST isn’t compliant either, so you have to use ‘-0900’.)

<pubDate>Fri, 10 Apr 2015 10:24:15 -0800</pubDate>

Podcast Tagging

I’ve got a podcast and it’s a chore to update. I’ve built some tools to help me produce an RSS feed for the podcast, which is a good thing, since RSS = XML = too persnickety to do by hand. But I’ve had to do some of the work by hand, specifically, tagging the .MP3 files with the appropriate ID3 tags. I was using iTunes, which has never been very fun, and seems to get worse with each iteration.

Enter eyeD3. It’s a tag editor, but unlike most of them, you can operate it from the command line. Better yet, eyeD3 understands ID3 v. 2.X tags. The documentation for the classic eyeD3 interface is what I like best. You can use it to set all kinds of tags for your podcast. Like these v2.x tags here. If you want to set one of the date tags, you’ll need to know how to specify a date in ISO 8601 format.

Also, did you know that mp3info lets you get the length of an audio file from the command line? I didn’t, until I read it on the internet, and durned if it’s not true. That’s pretty nifty. And there’s even a Ruby API for it!

I also learned about something called mutagen, which is like eyed3 but for arbitrary types of audio files.

I spent the day learning all this, so my tools still need to be updated to do what I now know can be done programmatically. But I’ve done the hardest part, viz.:

Podcast Tagging

Problems with ObamaCare

Quite apart from the wisdom of interfering with great swaths of the economy to create new entitlements, there is the practical matter of making it work. And that’s proving to be a problem for people working on the Obamacare web site at HealthCare.gov:

The better way to do things is a school of software development called Agile — it’s been around since the 1950s, was basically codified in the early 2000s, now has a whole non-profit devoted to it, and is the dominant form of software design in teams. Rather than moving from one static stage to the next, it emphasizes constant iteration and testing, with prototypes building on prototypes so the endpoint is something that works. The only problem, from a government perspective, is that you need to be comfortable with not knowing exactly that they will look like.

Yes. Just because a type of software development got us to the moon (back when 1K of RAM was a lot) doesn’t mean it’s the right approach to use in the 1990s. Or especially the 2010’s.

That’s one lesson from software development. Here are some others:

1) avoid building centralized systems. The mainframe has given way to minicomputers and PCs then a client-server world and now a web of devices, browsers, and various types of service providers. Web 2.0, baby.

Where does a centralized “Five Year Plan” approach to governing fit in a world of decentralized independent actors?

2) have the right type of abstraction. A spinning metal disk has nothing in common with a USB stick nor with an internet connection, but I can save a file on any one of them with the same program. That’s because there is an abstraction called a file system, and my word processor doesn’t really care what the hardware looks like: it can be silicon, magnetic disks, or something in the cloud. Software drivers for each type of hardware present a common interface that makes them all look the same to the word processor.

A centralized approach to governing doesn’t permit there to be appropriate abstractions. A mix of federal, state, and local governments, with large and small commercial and nonprofit organizations, allows you to have abstraction. Each one does what it needs to do and only that.

Ten Years

Ten years ago this month, I quit my job in order to go to seminary. Here’s what I used to work on:

Hardware

My job was to figure out how to avoid paying to fix them when they weren’t broken.

More rbenv notes

My last post on rbenv mentioned some things you need to do to get ruby to build on Mountain Lion. Here are a few more things.

This guy Jacob Swanner didn’t want to use either Xcode or gcc. He just used the Xcode command-line tools, with a CC environment variable, thus:

$ CC=/usr/bin/clang rbenv install 1.9.3-p194
$ rbenv global 1.9.3-p194

That won’t work with older versions of Ruby, however, as I mentioned before.

I noted he is also a Homebrew user. I’m not yet ready to go there, although macports gets more and more frustrating with each OS release. (I’m not alone.) (But that’s a subject for some other time.)

And, for convenience, here’s another Homebrewer’s notes on how to get ruby building again with Mountain Lion