A PubSubHubbub test

This post is a just an experiment I’m running to see how certain RSS services respond to updates. I’ll be making changes to it and checking how quickly the services switch to the newer versions. Those who use PubSubHubbub ought to respond very quickly, but we’ll see. If I learn something interesting, I’ll write a post about it.

If you’re seeing this in your RSS reader, I apologize for the lack of content. I needed a real, public blog post on which to run the experiment, and I wanted complete control over both the post and its feed. Putting something here seemed like the best way to achieve those goals.

Consider it akin to a sponsored post—possibly interesting to readers but mostly in service to the writer.

Update 11/13/14 8:29 AM
It took Feedbin over 20 minutes just to show the original version, which seems weird. Anyway, let’s see how this first updated is handled.

Update 11/13/14 10:11 AM
Well, it didn’t happen right away, but Feedly, NewsBlur, and BazQux are now all showing the previous update. Feedbin and FeedWrangler are not. We’ll see how things progress as the day wears on.

Update 11/13/14 2:44 PM
As best I can tell, NewsBlur hasn’t picked up the second update. Feedly and BazQux have, but they sure take their own sweet time about it.

I got a tweet from Feedbin telling me that it uses the nonstandard1 <updated> tag to determine whether it should update a post. Since I’m in control of my feed, it’s not a big deal for me to add that tag. I’ll add it “by hand” now to see if and when Feedbin changes what it serves for this post.

Update 11/13/14 2:55 PM
Whoa! Feedly and BazQux updated in just a few minutes. Feedbin still hasn’t, but that might be because I added the <updated> tag with a date formatted the way I thought RSS feeds were supposed to be formatted

Thu, 13 Nov 2014 20:44:00 +0000

instead of the way it’s shown in the Gist Feedbin linked to

2014-11-13T20:44:00Z

No wonder Brent Simmons got out of this business.

Update 11/13/14 3:45 PM
OK, <updated> is an Atom element, so I’ve changed how it appears in my (RSS) feed from

<updated>Thu, 13 Nov 2014 21:45:00 +0000</updated>

to

<atom:updated>2014-11-13T21:45:00Z</atom:updated>

So far, this has had no effect on Feedbin. It’s still showing the original post without any of the updates.


  1. There’s little that’s truly standard in RSS—it looks like HTML back in the “best viewed in Netscape Navigator” days. 


I’m gonna be (D miles)

As Merlin Mann and John Gruber talked about Roman numerals on the latest episode of The Talk Show, three thoughts went through my mind:

  1. I’ve never been able to remember the Roman numerals for 50 and 500. I know they’re L and D, but I can’t keep track of which is which. Next season, the NFL will be heading toward Super Bowl L, so maybe that’ll help me remember.
  2. Although IV is the standard for 4, IIII can be and is used, which should make Merlin feel better. The Wikipedia article on Roman numerals shows examples and says IIII may actually have been more common in Roman times. If Merlin wants to use IIII, he can just claim to be harkening back to an earlier tradition.
  3. Common Lisp has a built-in way to generate Roman numerals from Arabic using the format function. This is an example of how Common Lisp is even more of a kitchen-sink language than Perl is.

(An additional thought I just had: Markdown doesn’t let you specify Roman numerals for ordered lists unless you drop down into HTML. This calls for a new standard!)

Common Lisp’s format function, like C’s printf, uses a format string to specify how numbers and strings are to be printed out. And as with printf, the syntax of the format string is terse and difficult to remember without frequent use.

The ~R radix control is the wackiest of the format control directives. Used by itself, it generates a string of English words for the number. Here’s an excerpt from an interactive CLISP session:

[1]> (format nil "~R" 99)
"ninety-nine"

Used with a colon, we get an ordinal version of the number:

[2]> (format nil "~:R" 99)
"ninety-ninth"

Used with an at sign, we get a standard Roman numeral:

[3]> (format nil "~@R" 99)
"XCIX"

Used with both the colon and the at sign, we get a variant Roman numeral:

[4]> (format nil "~:@R" 99)
"LXXXXVIIII"

I’m not surprised Common Lisp has this capability, but I am surprised it’s in the language itself. You’d think something this odd would be in a fun but seldom used library.

Speaking of odd and fun:

Update 11/11/14
In an email, Bader Alabbasi tells me of a mnemonic he learned in school for the order of the Roman numerals for 50, 100, 500, and 1000: Lazy Centurians Dislike Marching.


Post-post post

Following up on last week’s post about my downed basketball hoop, a few days ago I brought an angle grinder and a few cut-off wheels home from work and turned the 9′ long, 200 lb post into five easy-to-carry pieces. The process of doing so is a good illustration of the different types of strength engineers have to consider when designing a product.

Cut-up post

I used the angle grinder to cut through the thin steel wall all around the post. With the steel breached, it took just a light tap with a sledgehammer to break through the concrete. The solid 4″×4″ plug of concrete was easy to break for two reasons:

  1. Concrete has a low tensile strength, and I generated tensile bending stresses in it by hitting the post from the side. Had I struck the post on its end, the concrete wouldn’t have broken.
  2. Concrete is brittle, which is to say it doesn’t bend or stretch much before breaking. Brittle materials tend to do poorly when struck because they can’t absorb the energy of impact through deformation.

The thin steel envelope, however, had to be cut, because mild steel has a relatively high tensile strength and, what’s more important, is quite ductile. It can absorb huge amounts of impact energy by undergoing permanent deformation before it breaks. I could’ve beaten on that post with a sledgehammer all day long, and it would never have broken.

But the concrete was stronger than the steel in one sense. Although I tried to use a light touch with the angle grinder, I couldn’t stop myself from plunging the cut-off wheel into the concrete after cutting through the steel. The cut-off wheel is made of hard mineral particles bound together with resin and reinforced with fiberglass. Although it wears away as it cuts through the steel, it does so at a fairly slow rate. But when it comes in contact with the aggregate in the concrete, it’s mineral vs. mineral and the wheel wears very quickly as it notches into the concrete. I wore down three cut-off wheels while cutting this post; had it been hollow, I would’ve been able to finish the job with the first wheel.

There are, of course, cut-off wheels made for cutting concrete. They use much harder minerals than the wheels made to cut steel. The composite design of cut-off wheels is an interesting example of combining different materials with different types of strength. The minerals are very hard, which is good for cutting, but very brittle, which is bad for handling any off-center or impact loading. A cut-off wheel made of pure aluminum oxide would cut like crazy but wouldn’t last under real-world conditions where side loading is inevitable.1 The resin is there not only to bind the mineral particles together, but also to provide a certain ductility to the wheel. And the fiberglass adds tensile strength to handle the off-center bending loads.

Reinforced concrete is another example of composite design. The steel reinforcing bars are placed where tensile stresses will develop during service (typically in the lower halves of beams). They carry the tensile stresses while the concrete carries the compressive stresses.2

Another way to deal with concrete’s weakness in tension is to prestress it. In prestressed concrete, a clever arrangement of high-strength steel cables (called tendons) are strung though the body of the beam or slab, stretched to a state of high tension, and anchored to the concrete. This induces compressive stresses in the concrete in the places where the service loads will induce tensile stresses. The idea is to have essentially no net tension in the concrete during service.

Prestressing also works with glass. Like concrete, glass is quite brittle, but unlike concrete, glass has a high tensile strength. The unfortunate thing about glass, and the reason we tend to think of it as weak, is that it’s sensitive to notches, scratches and other imperfections. A small nick on the surface of glass will reduce the tensile load it can carry tremendously.3 To get around this problem, we can make very smooth-surfaced glass and embed it in resin to protect it from scratches (fiberglass), or we can induce compressive stresses on the surface, so the nicked and scratched don’t experience any tension.

The Gorilla Glass in your iPhone is prestressed through chemical means. In effect, big atoms are jammed into the surface of the glass, pushing the other atoms away and creating a compressive stress. This is a relatively new way of prestressing glass and is very effective.

The more traditional way to prestress glass is to thermally temper it by heating it up and rapidly cooling it. The outer surface cools first, creating a hard shell. As the inside cools, it tries to shrink, but its shrinkage is resisted by the hard outer shell. This puts the inside into tension and the outside into compression. So even when a piece of tempered glass is just sitting on a table, it’s in a state of high stress and high strain. If you do manage to break it, the high strain energy locked into the glass is released and results in many, many fractures. This is why tempered glass breaks into lots of small pieces.

The most dramatic example of thermally prestressed glass is in Prince Rupert’s drops, sperm-shaped glass toys created by dropping molten glass into water. The head of the drop is almost impossible to break directly because of it’s high compressive prestress, but any damage to the tail causes the whole thing to shatter into bits. The high-speed camera work in this episode of Smarter Everyday does a great job of showing the fracture progression.

The explanation in the clip is good, too, except for the part about how arches get stronger as you compress them. Pretend you didn’t hear that line.

According to the Wikipedia article, Prince Rupert’s drops were introduced to England by their eponym as a gift to Charles II. Our old friend Robert Hooke wrote about them in his Micrographia:

Some of these I broke in the open air, by snapping off a little of the small stem with my fingers, others by crushing it with a small pair of Plyers; which I had no sooner done, then the whole bulk of the drop flew violently, with a very brisk noise, into multitudes of small pieces, some of which were as small as dust, though in some there were remaining pieces pretty large, without any flaw at all, and others very much flaw’d, which by rubbing between ones fingers was easily reduced to dust; these dispersed every way so violently, that some of them pierced my skin. I could not find either with my naked Eye, or a Microscope, that any of the broken pieces were of a regular figure, nor any one like another, but for the most part those that flaw’d off in large pieces were prettily branched.

The move to England leads us, finally, to the real reason I wrote this post. Friday’s episode of QI had a segment in which Stephen Fry broke a Prince Rupert drop (or, as he calls it, a Dutch tear) by clipping its tail.

The embedded video is supposed to start at 19:38. If it doesn’t, scroll there.

The BBC likes to shut down YouTubers who post its shows, but it’s not very efficient at it, so I’m hoping this is still here for you. You should, of course, watch the whole episode, and all the other episodes, most of which you can find somewhere on YouTube. I recommend you fast forward through any Rev. Richard Coles part you encounter—he’s horribly dull.


  1. It would also be expensive. Hard minerals are cheaper in particle form. 

  2. Note to structural engineers: Yes, I know there are plenty of situations in which reinforcing steel is used to carry compressive stresses. This is a blog post, not a rewrite of Ferguson

  3. Fracture mechanics is the study of the strength of materials with notches and cracks. Alan Arnold Griffith, the father of fracture mechanics, developed his ideas while trying to explain, among other things, why glass is much weaker than it ought to be. 


Keyboard Maestro and UI scripting

Update 11/6/14
I’m not sure how long the Presets popup has been in the Print sheet, but I suspect was there before I returned to the Mac in 2004. For some reason, I never paid any attention to it, but the response I’ve gotten to this post in the 20 minutes it’s been up has certainly changed that. Virtually everything in this post could be done by setting the options I want and saving them as a preset.

Oh, well. The techniques in the AppleScript are still useful for other situations.

Keyboard Maestro generally does a good job of simulating user interaction, but sometimes it’s better to drop down into AppleScript to get things done. A good example is a macro I’ve been using for a while to speed the printing of my expense reports.

I’ve written before about the Numbers template I use for my expense reports. I use Numbers because:

  1. I can use the same template on the Mac in my office and on my iPhone while I’m on the road.
  2. It lets me include scanned receipts in the same document as the spreadsheet.
  3. For billable expenses, I can turn it into a PDF and attach it to the invoice I send to the client.

Despite the nice ability to generate PDFs, I still print out paper expense reports to submit to our bookkeeper for reimbursement. We’re a small company with a heterogeneous computing environment, and paper is the path of least resistance. I do like to save paper, though, so I paste the scanned receipts onto the second page and print double-sided. And because my expense reports are in landscape mode, I like using short-edge binding.

Numbers printing sheet

The click-click-click of changing the default print settings to what I want bothered me enough that I built a Keyboard Maestro macro so I could change the settings and print with one keystroke: ⌃⌥⌘P.

Here’s the macro, which you can download:

KM two-sided printing macro

I invoke the macro when I’m in the preview mode that Numbers shows when you choose File‣Print… in the normal mode.

Numbers print preview

I start from here because I like to make sure I’ve sized and arranged the receipts to fit on the second page, if possible. When I type ⌃⌥/⌘P, the macro performs three steps:

  1. It selects File‣Print… again, which brings up the Print sheet.
  2. It runs an AppleScript that selects the two-sided printing options I like.
  3. It clicks the Print button at the bottom right corner of the sheet, sending the job off to the printer.

The AppleScript in the second step is this:

applescript:
 1:  tell application "System Events"
 2:    tell process "Numbers"
 3:      tell sheet 1 of window 1
 4:        tell checkbox "Two-Sided"
 5:          if not (its value as boolean) then click
 6:        end tell
 7:        tell (pop up button 1 whose accessibility description is "PDE")
 8:          click
 9:          click menu item "Layout" of menu 1
10:        end tell
11:        tell (pop up button 1 whose accessibility description is "Two-Sided")
12:          click
13:          click menu item "Short-Edge binding" of menu 1
14:        end tell
15:      end tell
16:    end tell
17:  end tell

Line 1 opens System Events to make the UI commands available. Lines 2 and 3 do the tells necessary to focus the subsequent UI scripting actions on the Print sheet. Then we start the trickier parts.

Lines 4–6 click the “Two-Sided” checkbox if it isn’t already selected. The state of that checkbox depends on whether I’ve already printed something two-sided during the current Numbers session. So the state of the checkbox has to be tested before clicking it—that’s easy to do in AppleScript but not so easy in Keyboard Maestro.

The best way to be sure of the name of a button or checkbox is to run Accessibility Inspector and move the mouse over the item of interest. You can address the item with the name in the AXTitle field.

Two-Sided button in Accessibility Inspector

Currently, Layout is the initial setting of the options popup button in the middle of the Numbers Print sheet, but that could change in the future. To ensure that its options are available, Lines 7–10 select Layout from that popup button.

The popup buttons in the Print sheet don’t have an AXTitle field, so we have to address them a different way. We could find the index of a popup button by repeatedly trying lines like

tell pop up button 1
  click
  click menu item "Layout" of menu 1
end tell

and

tell pop up button 2
  click
  click menu item "Layout" of menu 1
end tell

and

tell pop up button 3
  click
  click menu item "Layout" of menu 1
end tell

and so on until one of them worked. I’ve used this approach in the past, but I’ve also been burned when a new version of the application is released and the developers have reordered the popup buttons.

A more robust way to get the right popup button is to select it according to its accessibility description. This is one of the properties of a UI element, found in the AppleScript dictionary for System Events.

System Events dictionary

Its value can be found by moving the mouse over the popup button and looking at the AXDescription field in Accessibility Inspector.

Layout button in Accessibility Inspector

Of course, this being AppleScript, you can’t just say

tell pop up button "PDE"

Instead you have to get the list of all pop up buttons, filter it down to those with an accessibility description of “PDE” (which is just the one), and then pluck out the single item in that list. You can think of Line 7 as the end point of a sequence of ever-narrowing selections:

The last one is just a shorter and more English-like version of the one before it. They accomplish the same thing.

Lines 11–14 work just like Lines 7–10, but on a different popup button. As before, I got its accessibility description from the AXDescription field in Accessibility Inspector.

As best I know, Keyboard Maestro doesn’t have a direct method of selecting an item from a popup button. The best solution I know is described in an old blog post on the Stairways Software site:

  1. Simulate a click on the popup button (probably by using an image).
  2. Simulate keystrokes to select the desired menu item.
  3. Simulate the Return key

Unless you’re really averse to programming, the AppleScript is easier once you know the general technique.