From the pages of Stupid Software Design Quarterly…

About a month ago, printing stopped working on my machine. I had a clunky workaround, so I didn’t worry too much about it. I had just upgraded the cups package, which manages printing, on the print server, and it seemed to think the printer wasn’t “available”.

Let’s back up a bit. My print server (which is also my desktop) runs FreeBSD. The standard solution for printing on FreeBSD these days is to use cups (originally a commercial open-source product from an independent software house, now owned by Apple). I bought a Xerox Phaser 6140 really cheap (under $150 including shipping), but adding an Ethernet port would have doubled the price (not to mention wasting an IP address for something that shouldn’t be public anyway), so I had to use the USB interface. Fine, I said, and got a long USB cable to plug it in; it showed up as /dev/ulpt0, and I configured cups to print to that device, and all was well.

(Well, actually, not all was well — I had to configure some hacks in /etc/devfs.conf to allow cupsd(8) to access the printer device, and I also ended up creating another hack for devd(8) to automatically pause and restart printing when the printer was powered on and off, since laser printers generate a lot of heat and are energy hogs.)

When I upgraded the cups package and printing stopped working, I discovered quickly that I had no difficulty printing directly to /dev/ulpt0 — I just had to remember the usual bit about sending a control-D to tell the printer’s PostScript job manager that the file I had just transmitted was done. So clearly whatever had broken printing wasn’t in the operating system, but some new misbehavior on the part of cupsd. After digging around (and finding lots of totally unhelpful Linux forum sites that talked about “blacklisting modules” and other crap that FreeBSD users don’t have to put up with), I was able to find out the name of the program that cupsd outsources USB printing to: /usr/local/libexec/cups/backend/usb, which allowed me to find it in the process table, which allowed me to ktrace(1) it, which told me why I was tearing my hair out:

  5950 usb      CALL  open(0x80082f3f1,0,0)
  5950 usb      NAMI  "/dev/usbctl"
  5950 usb      RET   open 7
  5950 usb      CALL  ioctl(0x7,USB_READ_DIR,0x7fffffff9950)
  5950 usb      RET   ioctl 0
  5950 usb      CALL  open(0x7fffffff9a90,0x2,0)
  5950 usb      NAMI  "/dev/ugen0.1"
  5950 usb      RET   open -1 errno 13 Permission denied
  5950 usb      CALL  open(0x7fffffff9a90,0x2,0)
  5950 usb      NAMI  "/dev/ugen1.1"
  5950 usb      RET   open -1 errno 13 Permission denied
  5950 usb      CALL  open(0x7fffffff9a90,0x2,0)
  5950 usb      NAMI  "/dev/ugen2.1"
  5950 usb      RET   open -1 errno 13 Permission denied
  5950 usb      CALL  open(0x7fffffff9a90,0x2,0)
  5950 usb      NAMI  "/dev/ugen3.1"
  5950 usb      RET   open -1 errno 13 Permission denied
  5950 usb      CALL  open(0x7fffffff9a90,0x2,0)
  5950 usb      NAMI  "/dev/ugen4.1"
  5950 usb      RET   open -1 errno 13 Permission denied
  5950 usb      CALL  open(0x7fffffff9a90,0x2,0)
  5950 usb      NAMI  "/dev/ugen5.1"
  5950 usb      RET   open -1 errno 13 Permission denied
  5950 usb      CALL  open(0x7fffffff9a90,0x2,0)
  5950 usb      NAMI  "/dev/ugen6.1"
  5950 usb      RET   open -1 errno 13 Permission denied
  5950 usb      CALL  open(0x7fffffff9a90,0x2,0)
  5950 usb      NAMI  "/dev/ugen6.2"
  5950 usb      RET   open -1 errno 13 Permission denied
  5950 usb      CALL  open(0x7fffffff9a90,0x2,0)
  5950 usb      NAMI  "/dev/ugen3.2"
  5950 usb      RET   open -1 errno 13 Permission denied
  5950 usb      CALL  ioctl(0x7,USB_READ_DIR,0x7fffffff9950)
  5950 usb      RET   ioctl 0
  5950 usb      CALL  close(0x7)
  5950 usb      RET   close 0
  5950 usb      CALL  write(0x2,0x7fffffff9510,0x20)
  5950 usb      GIO   fd 2 wrote 32 bytes
       "DEBUG: libusb_get_device_list=0
  5950 usb      RET   write 32/0x20
  5950 usb      CALL  close(0x5)
  5950 usb      RET   close 0
  5950 usb      CALL  close(0x6)
  5950 usb      RET   close 0
  5950 usb      CALL  write(0x2,0x7fffffff7a00,0x2f)
  5950 usb      GIO   fd 2 wrote 47 bytes
       "INFO: Waiting for printer to become available.
  5950 usb      RET   write 47/0x2f

What’s it trying to do there? Why did it try to open a whole bunch of device special files it had no business looking at, and then print the message, “Waiting for printer to become available”?

Then it dawned on me what mindbogglingly stupid thing it must be doing: it’s enumerating all of the USB devices, and then trying to open them by USB address rather than using the proper driver! Which of course means that it will be going through the wrong device special file, and the permissions I’ve configured to be automatically applied via /etc/devfs.conf won’t have any effect. Obviously, I’m not going to allow cupsd(8) to interact with every USB device on my system, so I guess I’ll just have to hope that the USB address of my printer never changes — and that I can remember this whole mess when I replace my print server!

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

Other people’s recipes: Cook’s Illustrated’s Cream-cheese brownies

Last weekend I made the notably unsuccessful “cherries and cream pie” (see writeup), and of course that meant I had leftover cream cheese (that recipe only took a quarter of a cup) and sour cream, two ingredients which I rarely have any use for in everyday cooking. So in order to use them up before they spoiled, I went looking for recipes that would use both. Cheesecakes were out of the question, since they typically require much more than I had on hand, and tend to be written to require an exact number of packages of the Leading National Brand. Any number of recipes call for sour cream alone, which didn’t help dispose of the cream cheese, but I settled on the cream-cheese brownie recipe from last month’s Cook’s Illustrated. (For subscribers, that’s this recipe from 2014, not this recipe from 1999.)

This recipe was a bit fussier than the traditional brownie recipe, which is hardly surprising considering that what we’re making is effectively two desserts — a brownie and a cheesecake — which are baked together in one pan, but are supposed to retain at least some of their distinctness. That means dirtying a lot of bowls (I ended up using four — one for the chocolate and butter, one for the dry team, one for the cream-cheese mixture, and one for the wet ingredients). I think it turned out pretty good:
An 8x8 pan of cream-cheese brownies on a cooling rack, cut into nine individual brownies, with one removed

I didn’t do as good a job of swirling the cheesecake into the brownie batter as shown in the printed recipe. Also, the recipe calls for 2″x2″ brownies, which is ridiculous; an 8×8 pan makes nine brownies, no more. Here’s the center piece:
Cream-cheese brownie on a plate

Of course, that does mean that as I made them, they’re a bit calorie-heavy. I see no reason you couldn’t make this recipe in a 9×9 pan instead, and then it wouldn’t be ridiculous to get 16 (somewhat thinner) brownies. But doubling the recipe and baking in a 9×13 pan (with appropriate adjustment to the cooking time) would seem quite practical as well, if you’re not in the position that I was of trying to get rid of leftovers! (I think commercial bakers tend to make brownies in half-sheet or even full-sheet pans, which are just too shallow for proper brownie construction, in my humble opinion.)


Multiply everything by 9/16 (approximately 0.56) for the 2×2 brownies specified in the recipe (yield 16). Either way, a special treat, not an every-day dessert. I’ll be freezing some of these, or giving them away to colleagues.

Nutrition Facts
Serving size: 1 brownie
Servings per container: 9
Amount per serving
Calories 423 Calories from fat 235
% Daily Value
Total Fat 26g 40%
 Saturated Fat 16g 81%
 Monounsaturated Fat 1g
Trans Fat 0g
Cholesterol 97mg 32%
Sodium 216mg 9%
Potassium 42mg 1%
Total Carbohydrate 42g 14%
 Dietary fiber 0g
 Sugars 30g
Proteins 5g 10%
Vitamin A 15%
Vitamin C 0%
Calcium 7%
Iron 11%
Posted in Food | Tagged , , | Leave a comment

Week 6 chocolate tasting results

I noticed that I forgot to post the results of our sixth weekly chocolate tasting. From our wiki:

Once again, one of our “reference” chocolates took top honors: the Jelina Noir 72% that we had previously tasted back in week 1 (however, of this week’s participants, only Sue Felshin had attended the tasting in week 1). The Jelina was tied for first place with Idilio Origins Finca Torres, both having two first-place votes each, but gets the nod on the basis of its two second-place votes. Valrhona Araguani and Idilio Origins Carenero Urrutia Superior tied for third place, each receiving one first-place and one second-place vote; Idilio Origins Selección Cata Ocumare came in fifth with one second-place vote. Now I need to go buy another bar of the Jelina for our championship round.

Because this week is the first week of classes, we’re delaying week 7, the last of the preliminary round, until next week, once people’s schedules settle down a bit.

Quote | Posted on by | Tagged , , | Leave a comment

Other people’s recipes (sort of): Cherries & cream pie

This gallery contains 10 photos.

As I discussed last weekend, the cherry pie I made used less than half of the cherries I had bought. So of course I had to make something else with cherries (I didn’t want to make the same pie twice … Continue reading

Gallery | Tagged , , | 1 Comment

Quote of the day: Libertarians don’t make everything better

From Andrew Wheeler’s “Antick Musings”:

A friend of mine is fond of saying “everything’s worse with libertarians” — it’s cruel and reductive, and definitely not true universally. But there’s a certain kind of libertarian, particularly here on the Internet, who does make everything worse. (There are similar Troskyites, too, but libertarians infest the Net the way roaches do a dirty kitchen, scurrying out of all corners at the slightest attractive morsel.) They shove everything into a few pre-defined rhetorical boxes, and then spread their hands as if they’ve proved something — and they’re at their very worst when it comes to extreme situations and lifeboat rules.

I have never before seen so succinct a summary of online libertarian debating tactics.

Quote | Posted on by | Tagged , | Leave a comment

Where does chocolate come from?

In our chocolate tastings, one of the matters we’ve discussed at some length is where chocolate comes from. Cacao is a tropical tree, native to Central and South America, but that region now produces only a small fraction of the world’s supply. Very little chocolate, as we understand it (and as we were tasting!) is produced there, however — at least considering production for export. This is a bit of a shame, since many of the cacao-producing countries are fairly poor, and they would do well to “move up the value chain” and keep a greater share of the revenue in their own countries. I’m only aware of one company that actually manufactures finished chocolate bars in the country where the cacao is grown (excluding the very small supply of domestic cacao grown in Hawaii), and that’s Madécasse in Madagascar. We haven’t included any of their bars in our tastings because all the ones I’ve seen from them fall into the category of “chocolate with stuff in it”, and we’re only doing plain chocolate bars.

There are a lot of different ways to understand where various parts of the chocolate-making process occur, but thanks to the Harvard Center for International Development’s Atlas of Economic Complexity, there are some great tools for understanding and visualizing international trade flows in all sorts of commodities. The trade in cacao and chocolate is not broken down quite as finely as I would like, but a good proxy for cacao production is net exports of cacao beans, as shown in this map:
World map showing net exporters of cacao, colored in accordance with the dollar value of exports.

One way to understand which countries make chocolate would be to look at net imports of cacao beans, the exact converse to the previous chart. But I thought it was more interesting to look at net exports of finished chocolate (2010 data):
World map showing net exporters of finished chocolate products, colored in accordance with the dollar value of exports.
What I didn’t realize at the time I saved this map was the extent to which some countries’ trade in chocolate is close to balanced: notice how France and the United States both seem to be underrepresented here. If you look at gross exports of chocolate, rather than net, those missing countries reappear. (And the biggest net importer? The United Kingdom, which buys lots of German chocolate while the Germans don’t seem too keen on reciprocating — bilaterally, $326 million from Germany to the UK versus only $28 million from the UK to Germany.)

UPDATE: Just realized I forgot about El Rey chocolate from Venezuela — probably because I haven’t seen it in stores in a really long time.

Posted in Food, Law & Society | Tagged , , | Leave a comment

Did someone ask for more recipe pointers?

Another three cookbooks’ worth of interesting recipes:

Not to worry: I’ve almost run out of bookmarks so I don’t have too many more of these to go. I hope they prove useful to someone.

Aside | Posted on by | Tagged , , | Leave a comment

Week 5 chocolate tasting results

This week’s chocolate tasting was a tough one, compromised somewhat by low attendance and a very similar set of chocolates. My summary from our wiki:

With only six participants, abd seven very similar products, it’s difficult to name a clear winner in this tasting. Sue suggested that I describe this week’s theme as “The Battle of the Blands”, and around the tasting table, all panelists commented on the difficulty of choosing a favorite. The Divine Intensely Rich Dark Chocolate and Whole Foods Dark Chocolate: Tanzania Schoolhouse Project tied with two first-place votes each, but neither one received any second-place votes. Both Valrhona Andoa and reference Valrhona Guanaja received a single vote each for both first and second place. The reference TCHO Dark chocolate discs received three second-place votes, and TCHO PureNotes “Chocolatey” received the final second-place vote.

I have a suspicion that the Whole Foods product, which is made in Belgium, may actually be Callebaut.

Quote | Posted on by | Tagged , , | Leave a comment

Nutrition information for high-test chocolate

As I’ve noted before, good chocolate can vary quite substantially in its nutritional value, as manufacturers adjust the ratio of cocoa solids to cocoa butter, even when keeping the overall percentage cacao the same. Taken from the CSAIL Tasters wiki, here is a composite nutritional picture based on 16 products claiming between 70% and 72% cacao.

Per 100 grams chocolate
575 kcal
2409 kJ
40.7 g fat
26.0 g saturated fat
45.6 g total carbohydrate
9.4 g dietary fiber
44.0 g sugar
8.1 g protein

Note that I don’t have numbers for iron, which is the only other FDA-required nutrient disclosure which chocolate contains in a significant amount. While it’s always better to reference a specific product’s nutrition labeling, hopefully this will help people figure out how much they can have when no label is provided.

Posted in Food | Tagged , | Leave a comment

Other people’s recipes: Sweet cherry streusel pie from Four & Twenty Blackbirds

This gallery contains 15 photos.

It’s been a long while since I’ve made an actual pie — I think it would have to have been a pumpkin pie, some year around Thanksgiving. But earlier this year I bought The Four & Twenty Blackbirds Pie Book … Continue reading

Gallery | Tagged , , , ,