Bad Bug #2: Makes Me Blue, So Blue

This is another long-standing Bad Bug. It’s clearly broken, easy to demonstrate, and difficult to believe it would be allowed to persist. I realize that in writing about these, I open myself to criticism along the same lines. In a way, I welcome it. Maybe we’ve got a Bad Bug in our software that’s getting in your way. If so, blog about it passionately. Rally others to your cause. Write us and insist we take a second look.

Bad Bug #2 is in Core Graphics. Both renderings below are of the same PDF document. On the left, the document is rendered using PDFKit. On the right, the document is rendered using CoreGraphics.

CoreGraphics and PDFKit Bug In Action

I filed this bug with Apple at OS X 10.11.1, and there have been three dot releases with no fix. While it’s possible to work around the bug by drawing into an NSView rather than using Core Graphics, that’s not really an acceptable workaround. It’s also difficult to detect exactly what causes the bug, as it does not impact all CMYK nor all overprint mode (OPM) documents. In other words, trying to work around this would create a huge performance hit.

Fortunately, the bug is “cosmetic” in nature, meaning that although the colors are presented incorrectly to the user when a PDF is drawn using Core Graphics, the underlying colors are correct when viewed in other PDF applications. This isn’t much solace to us and PDFpen, but it is much better than the alternatives.

Please feel free to reproduce and file duplicate bug reports, and we’ll keep our fingers crossed that this is addressed in macOS Sierra.

UPDATE (July 18, 2016):

Turns out, the bug is limited to PDFs with transparency layers.

The workaround is to wrap the drawing in begin / end transparency layer calls:

    CGContextRef context = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
    CGContextBeginTransparencyLayer(context, NULL);
    CGContextDrawPDFPage(context, page);
    CGContextEndTransparencyLayer(context);

Keeping my fingers crossed it gets fixed in macOS Sierra.

Bad Bug #1: HTML Popup Menus Fail in Slide Over

As a software developer, I understand that not all bugs are severe. Not all bugs will be addressed in the lifetime of a piece of software. Time can be limited. A bug can be rare enough not to merit further investigation. Really bad bugs, which cause crashes, tend to get fixed. Bad bugs, which fall short of that, can remain far longer than one would hope. This series aims to shed light on Bad Bugs.

Apple introduced multitasking as one of the marquee features of iOS 9. Slide Over multitasking is available on a broad variety of iPads. To use Slide Over, one drags in from the right margin and chooses an app. The app then runs in a horizontally compact view on the right third of the screen.

If an app displays a web view which shows a <select> element (popup menu), the user can’t make a selection in Slide Over. Tapping the popup menu invokes a modal view. Tapping a menu item doesn’t dismiss the modal view. The user can’t do anything else with the app at that point. They’re stuck.

Image of Bad Bug in Action

The bug was reported to Apple by December 8, 2015. That report was closed as a duplicate. Based on its bug number, the original must have been filed before September 17, 2015. It’s fair to assume any fix would have missed 9.1, released on October 21, 2015. It’s difficult to believe a fix missed 9.2 on December 8, 2015 and 9.2.1. So far, there’s no fix in 9.3b5.

Given that the bug was already reported, I asked DTS for a workaround (case 636921784). They responded: “Our engineers have reviewed your request and have determined that you are experiencing an issue for which there is no known workaround at this time.” This is surprising because the bug does not occur in Safari under the same circumstances.

To me, this is a Bad Bug because:

  • It affects a headline feature of iOS 9
  • It’s been known for a while (six months or so)
  • There is no workaround

For good measure, I filed bug 25006548, which I expect will be closed as a duplicate. Hopefully, filing duplicates like these causes some internal up-voting so that Bad Bugs such as this can be addressed.

UPDATE: Christian Hemker notes that this issue was first reported on August 13, 2015 by the Chromium team. Thanks, Christian!

The Rook

The Rook by Daniel O’Malley is a fantasy novel and a waking-from-amnesia story set in the present. Generally, I prefer historical fiction to fantasy. I think the fact that the time is present day works well for me.

The narrator has suddenly found herself in the body of Myfanwy Thomas. She just happens to be a high-ranking official of a secret group known as the Checquy (pronounced Sheck-Eh). She learns about her former life via a series of letters written by the original Myfanwy Thomas before her memory was wiped in a disastrous confrontation. Unfortunately for the narrator, she also learns that she is almost certainly still in grave danger and that this danger comes from within the Checquy.

I really enjoy the fact that the narrator is her own person. While she understands that her survival is dependent on presenting a credible Myfanwy Thomas, she refuses to be as timid or constrained as her predecessor. She also happens to have special powers, some of which are supernatural and some of which derive from the sheer force of her personality.

O’Malley took a risk in combining genres and in doing exposition via letter. I think it works in this book. It allows for the outside perspective of the narrator as constant commentary on how Myfanwy Thomas operates in a world which is mostly unaware of her misfortune.

Adding to the pressure, the Checquy are under attack by the Grafters. They are an ancient Belgian organization, who use their supernatural powers to attack and control others. Ordinarily, this would be a trite good-versus-evil plot, but don’t forget that someone within the Checquy wants Myfanwy Thomas dead.

“The Rook” is an incredibly fun read. The setup, as farfetched as it is, works well, and O’Malley keeps the story’s feet on the ground most of the time. It’s a delight to see the coming into her own of the narrator. I sincerely hope you’ll enjoy it as much as I have.

Pizza with Thai Green Curry Sauce and Chickenless Strips

This was the second of ten new dishes I made for my 2015 Resolution.

Pizza with Thai Green Curry Sauce and Chickenless Strips

This one was inspired by a stream of tweets from Daniel Jalkut of Red Sweater Software, maker of MarsEdit, which I used to write this blog post.

If you follow Daniel and pay attention on Fridays, you’ll frequently see tweets such as this. One Friday, he even did a live video via Meerkat or Periscope of his pizza-making. I think it’s his mission to dispel the myth that making pizza is difficult, and he does a fairly solid job of that. Enough to encourage me to try.

I found making pizza to be messy more than anything else, as the pizza dough really likes to stick to surfaces, so you spread around a lot flour or corn meal to keep it from doing so. I also found that dough really doesn’t like to stay stretched out, so I needed to stretch it beyond where I thought it needed to end up and just trust that it would pull back.

I’m a fan of Trader Joe’s, so that’s where I got my toppings. I like their chickenless strips because they’re an easy protein to work with, and they take on whatever flavor you sautée them in. I used Frank’s Red Hot this time. Philip suggested that I brush the dough with olive oil before saucing it, and that turned out to be a good idea. I love TJ’s red and green Thai curries, so I used the green curry for the sauce. I put some cheese on top, and I was ready to go.

The final challenge to pizza making is getting the pizza from the peel on which you’ve prepared it onto the hot stone. Pizza doesn’t like to slide. The dough likes to pull back. The ingredients like to get in the way. This part of pizza-making will take me years to master, but they’ll be fun and yummy years I’m sure. For now, the marked “left shift” of ingredients in the picture above is testament to my novice status as a pizza maker.

Chilaquiles in Guajillo Sauce

This was the first of ten new dishes I made for my 2015 Resolution.

IMG 0274

I’ve made chilaquiles in homemade green salsa before, and I like them very much, so I wanted to try a different sauce. I decided on a red salsa, made with guajillo (wah-HEE-yo) peppers.

I started with this recipe for the guajillo sauce.

If you’re going to use the sauce for chilaquiles, you can simplify the recipe by putting all of the broth into the blender then running the result through the strainer. Skip the bit with the medium-sized pot to thicken. Add epazote if you can.

To complete the chilaquiles, put 2 tablespoons of vegetable oil into a cast iron skillet, heat the oil at medium-high, and pour in the sauce. Once the sauce is bubbling, reduce the heat to medium, and add tons of tortilla chips. Pretty much fill the pan. Stir until the chips are coated with sauce. Eventually, the chips will saturate and sop up all of the remaining sauce. When they’re nearly done, reduce the heat to low and prepare to serve.

I recommend topping with grated cotija cheese (queso cotija) and Mexican sour cream (crema Mexicana). Yum!

Cloud Atlas

Cloud Atlas by David Mitchell is one of my all-time favorite fiction reads. I’m going to start with a mild spoiler about the structure, so if you hate spoilers: stop reading, grab a copy, and enjoy.

“Cloud Atlas” has a fun structure with six stories, each in a distinct style, five of which lead up to the sixth, and then they’re each concluded in reverse chronological order. I particularly enjoyed the science fiction story, set in a dystopian near-future in which human clones known as fabricants do the jobs hapless consumers won’t. It’s fast-paced, clever, and challenging to sort out the twists. The same is true of the detective story, involving a cub reporter and her story on safety problems with the local nuclear power plant.

I love how Mitchell weaves the stories together. One common thread is musical. The fictional Cloud Atlas Sextet figures in all of the stories. It also serves as the basis of the structure of the book. Sometimes there are echoes from one story in another. There’s even something common to all of the protagonists, but to reveal its exact nature would be too much of a spoiler.

I’ve devoured Mitchell’s other work since reading Cloud Atlas, and I’ve enjoyed all of it. This was the first of his work that I encountered, and so it has a special place in my heart.

My 2015 Resolution: Ten New Dishes

The hostess of our New Year’s Eve party required guests to make a resolution. She had everyone write their resolution on a small white board, and she took a picture “for encouragement.” My resolution, as you can see below, was to make ten “totally new” dishes during 2015:

Greg Holding Sign Saying: "Cook 10 Totally New Dishes"

We agreed that I would send her pictures of each new dish I made, so I have a record of this particular challenge. Here’s a list of what I made. Check back, and I’ll link them to posts where I elaborate on them with photos and recipes.

  1. Chilaquiles in Guajillo Sauce
  2. Pizza with Thai Green Curry Sauce and Chickenless Strips
  3. Escalivada
  4. Goat Cheese & Fig Jam Tartlets
  5. Ratatouille Lasagna
  6. Parmesan Crisps
  7. Moroccan Spiced Chicken
  8. Corn Risotto
  9. Potato Leek Soup (with a hint of fennel)
  10. Homemade Black Beans

This was a good party game, and it turned out to be a very fun and tasty resolution.

Bionic Me

I hadn’t considered my iPhone a “bionic extension” until I used my iPhone’s camera to solve a problem by doing something I couldn’t do with my body.

This summer, in the course of painting the dining room, I had to take down curtains. Removing the curtains and rods was easy. Removing the fixture which held the rods was not.

The fixture had no visible screws or points of attachment. The space between it and the ceiling was smaller than my head, so I couldn’t see down from the top. I could feel an opening at the top, so I was pretty sure this held the clue to how these worked.

I was very lucky to have a flash of inspiration and realize that I had a camera in my pocket. My iPhone could certainly fit into the space between the ceiling and the fixture. Armed with this photo, I was able to solve my problem:

Wall Fixture

The fixture had screws which slid along a track on the wall. Once I pushed up on the fixture, those screws cleared the track, and I was able to pull the fixture off the wall with ease.

I tend to think of the iPhone as a communication and computing device, so sometimes I forget that it operates within the physical world. Better yet, it can do so in ways that I cannot.

It felt incredibly rewarding to use my iPhone to solve this particular problem. I hope the next time I’m faced with something similar that my iPhone comes to mind.