Adam Rice

My life and the world around me

Page 2 of 108

Colors

Translating a document that involves optics, I ran into what I immediately recognized as ROYGBIV in Japanese:

紫、青、水色、緑、黄、オレンジ、赤

(actually that’s VIBGYOR, but the point is the same)

I had never really stopped to consider how ROYGBIV might be expressed in Japanese, but it’s an interesting question, because the Japanese word that is ordinarily rendered in English as “blue”, 青 ao, can mean blue or green. “Vegetables” in Japanese can be 青物; a green light is an 青信号. And here it’s being pushed further down the spectrum, away from green, to stand for “indigo.”

The color that holds blue’s place in the above list is 水色, “water-colored.”

And that makes me wonder, what is the color “indigo” anyhow? How is it different from blue? Why do we have two color words for what’s basically the same thing? Apparently I’m in good company—according to Wikipedia, Asimov said “It is customary to list indigo as a color lying between blue and violet, but it has never seemed to me that indigo is worth the dignity of being considered a separate color. To my eyes it seems merely deep blue.” Wikipedia has quite a bit more to say about the color indigo: “According to Gary Waldman, ‘A careful reading of Newton’s work indicates that the color he called indigo, we would normally call blue; his blue is then what we would name blue-green or cyan.'”

Curiouser and curiouser. It seems as if 青 would be a good fit for Newton’s usage of blue, and 紺 would correspond better to indigo, but it’s also interesting to observe how the meaning of simple color words has apparently shifted in English. And 水色 is a pretty good fit for what Newton meant by “blue.”

The Wikipedia article is also interesting in that it explains why there are seven colors in ROYGBIV in the first place, when our modern color models are based on three primary colors (RGB or CMY) with secondaries and tertiaries in between: it was an arbitrary decision to force the colors to correspond with the seven notes of the Western musical scale.

Showing lots of options in Contact Form 7

Contact Form 7 is a widely used WordPress plugin that offers a fair amount of flexibility, but I needed for it to do something it didn’t want to do: I wanted to display a form with a lot of options and make it look good. Normally one would do this using radio buttons or a dropdown menu. Because scrolling through long dropdown menus is especially annoying, I opted for radio buttons. But then I wound up with a long blob of radio buttons I wanted something with some structure: columns and headings.

CSS to the rescue. The following is not perfect (there are some limitations on selectors that prevented me from getting as fancy as I wanted), but I consider it a big improvement.

First, use the “Generate tag” option to create a radio button. Set an ID for the radio-button set. In this example, it is recipientlist. Enable the “Wrap each item with <label> tag?” option. This CSS is dependent on the tagging that option produces. You could rewrite this to work the other way, but it’s friendlier to turn that on anyhow.

Second, create your list of options. You probably want to do this in a text editor, not the CF7 editing window. Organize your options into sections, and insert new lines with section headings where appropriate. Begin each section with the same word–in the example shown below, I’m using “Area”. If you’re using piped options, it doesn’t matter what comes after the pipe for these section headings. Paste your completed list into the “Choices” field

Third, gank the following CSS:

<style>#recipientlist {
display: block;
-webkit-columns: 3 150px;
-moz-columns: 3 150px;
columns: 3 200px;
}
#recipientlist .wpcf7-list-item {
display: block;
margin: .25em 0;
}
.wpcf7-list-item input[value^=Area] {
display: none;
}
.wpcf7-list-item input[value^=Area] + .wpcf7-list-item-label {
font-weight: bold;
}</style>

and paste that right into the CF7 “Form” field, right at the top. Change #recipientlist to whatever ID you are using for your button set. Change Area to whatever you are using as the lead-in text for your section headings. Do not introduce any extra line breaks into this, as WordPress will add tags that you don’t want. Do not try inserting this into your theme’s styles.css document or via other style-injecting mechanisms, as parts of this will get overridden and you will be sad.

Your radio-button tag should look something like this:

[radio recipient id:recipientlist use_label_element *lots of options follow*…]

Copy that code and paste it wherever you think it belongs in your form. The style element should be at the top though.

You may want to play around with the number and width of columns, depending on your theme and the content you’re presenting.

Here’s a before and after.

Before:
before

After:
after

This isn’t perfect–there’s no way to control where the column breaks occur, or to show the sections as blocks of equal height. And it’s not semantically correct HTML. But it’s an improvement.

[Nerd mode=on]
There are four CSS rules here. The first one forces the set of buttons to show as a separate line, and breaks it into columns. The second forces each button to display on its own line. The third picks up buttons that begin with the section-identifying word “Area”; hiding the radio button and setting some margins. The fourth styles the label text for those section heading buttons.
[Nerd mode=off]

Four years

Four years ago today, I was smack in the middle an adventure: a transcontinental bike ride.

When I finished that ride, my body was wasted: I had lost at least 15 pounds. You could see my ribs through my back. I decided it was time to find a more whole-body workout. I started doing a boot-camp workout with Gwen. I wouldn’t say that I enjoyed it, exactly, but it was definitely good for me. After a few months, I had finally resolved some weak spots left over from my broken pelvis, and had built up core strength that I’d really never had before. I was pretty regular about it for the next 3½ years or so, going three times a week, occasionally taking a month off when life got crazy. Boot camp completely displaced cycling for me. I didn’t do any serious riding after I got home from my big ride, only commuting around town.

A couple of months ago, that boot camp class ceased to exist as such when the trainer started a gym; he offers something similar at the gym, but I realized I don’t want to go to a gym. I was also missing riding. Today I went out with a friend for my first ride in four years. My neck’s a little stiff, and I was tired earlier than I should be, but it was good to get out there.

I still need to do some kind of whole-body workout. But I need to keep riding my bike.

Burner-anxiety dream

You know those school-anxiety dreams where you show up in class, and discover there’s a test you weren’t expecting, or work-anxiety dreams that are similar? I had a burner-anxiety dream last night. I almost never remember my dreams, and this one seems funny enough to bear writing down.

In my dream, Gwen and I had gone to Burning Man as a last-minute thing (which should have tipped me off that I was dreaming). We were in a theme camp that had a TV playing a videotape…which is a little weird, but hey, it’s Burning Man—what isn’t weird? I was putting a bandana on my head, and realized I had left my belt pouch behind.

Then I realized I hadn’t brought even one change of clothes.

Then I realized I hadn’t brought any water.

Then I realized I hadn’t brought any food.

Then I realized we hadn’t had our tickets checked at Gate (another tip-off that I was dreaming), and I was pretty sure we didn’t have those either.

Gwen and I got into a bit of an argument over whether we should try to go back Reno to provision, or try to skate by as sparkle ponies, or just give up and go home. Since I was pretty sure we didn’t have our tickets, I was doubtful that we’d be able to get back in.

Then I woke up. It felt real while I was dreaming it.

Economics of software and website subscriptions

It’s a truism that people won’t pay for online media, except for porn. That’s a little unfair. I’m one of many people who has long had a pro account on flickr, which costs $25/year. Despite flickr’s ups and downs, I’ve always been happy to pay that. It also set the bar for what I think of as a reasonable amount to pay for a digital subscription: I give them $25, they host all photos that I want to upload, at full resolution. Back when people still used Tribe.net, they offered “gold star” accounts for $6/month, which removed the ads and gave you access to a few minor perks, but mostly it was a way to support the website. The value-for-money equation there wasn’t quite as good as with flickr, in my opinion, but I did have a gold-star account for a while.

Looking around at the online services I use, I see there are a few that are offering some variation on premium accounts. Instapaper offers subscriptions at $12/year, or about half of my flickr benchmark. The value for money equation there isn’t great—the only benefit I would get is the ability to search saved articles—but it’s a service I use constantly, and it’s worth supporting. Pinboard (which has a modest fee just to join in the first place) is a bookmarking service that offers an upgraded account for $25/year; here, the benefit is in archiving copies of web pages that you bookmark. I can see how this would be extremely valuable for some people, but it’s not a high priority for me. I use a grocery-list app on my phone called Anylist that offers a premium account for $10/year; again, the free app is good enough for me, and benefits of subscribing don’t seem all that relevant.

In terms of value for money, none of these feel like great deals to me. Perhaps because the free versions are as good as they are, or perhaps because the premium versions don’t offer that much more, or some combination of the two. But I use and appreciate all these services, and maybe that’s reason enough that I should subscribe.

At the other end of the scale, there’s Adobe, which has created quite a lot of resentment by converting its Creative Suite to a subscription model, for the low, low price of $50/month. This offends designers on a primal level. It’s like carpenters being required to rent their hammers and saws. The thing is that $50/month is a good deal compared to their old packaged product pricing, assuming that you would upgrade roughly every two years. The problem is that the economic incentives are completely upside down.

Once upon a time, Quark XPress was the only game in town for page layout, and then Adobe InDesign came along and ate their lunch. Quark thought they had no competition, and the product stagnated. Now Adobe Creative Cloud is pretty much the only game in town for vector drawing, photo manipulation, and page layout.

With packaged software, the software company needs to offer updates that are meaningful improvements in order to get people to keep buying them. Quark was slow about doing that, which is a big part of the reason that people jumped ship. With the subscription model, Adobe uses the subscription as a ransom: when customers stop subscribing, they lose the ability to even access their existing files. Between the ransom effect and the lack of meaningful competition, Adobe has no short-term incentive to keep improving their product. In the long term, a stagnant product and unhappy customers will eventually encourage new market entrants, but big American companies are not noted for their long-term perspective.

I think that’s the real difference here, both psychologically and economically: I can choose to subscribe to those smaller services, or choose not to. They all have free versions that are pretty good, and if any of them wound up disappearing, they all have alternatives I could move to. With Adobe, there are no alternatives, and once you’re in, the cost of leaving is very high.

Good reads, 2013

The following are some of the best stories, articles, essays, blog posts, etc, that I read during 2013. They weren’t necessarily written in 2013. I’m including them in roughly the order I encountered them.

Circle of Useful Knowledge

Gwen’s parents brought her a book from a library sale in their small town, The Circle of Useful Knowledge, published in 1888. It’s filled with bizarre recipes for cocktails mixed in 10-gallon quantities, tips on animal husbandry, etc.

I’m posting extracts from it in a separate blog, titled Circle of Useful Knowledge. I’m going to try to post a couple of entries a day. Enjoy.

Word processors and file formats

I’ve always been interested in file formats from the perspective of long-term access to information. These have been interesting times.

To much gnashing of teeth, Apple recently rolled out an update to its iWork suite—Pages, Numbers, and Keynote, which are its alternatives to the MS Office trinity of Word, Excel, and Powerpoint. The update on the Mac side seems to have been driven by the web and iPad versions. Not only in the features (or lack thereof), but in the new file format, which is completely unrelated to the old one. The new version can import the files from the old one, but it’s definitely an importation process, and complex documents will break in the new apps.

The file format for all the new iWork apps, Pages included, is based on Google’s protocol buffers. The documentation for protocol buffers states

However, protocol buffers are not always a better solution than XML – for instance, protocol buffers would not be a good way to model a text-based document with markup (e.g. HTML), since you cannot easily interleave structure with text. In addition, XML is human-readable and human-editable; protocol buffers, at least in their native format, are not. XML is also – to some extent – self-describing. A protocol buffer is only meaningful if you have the message definition (the .proto file).

Guess what we have here. Like I said, this has been driven by the iPad and web versions. Apple is assuming that you’re going to want to sync to iCloud, and they chose a file format optimized for that use case, rather than for, say, compatibility or human-readability. My use case is totally different. I’ve had clients demand that I not store their work in the cloud.

What’s interesting is that this bears some philosophical similarities to the Word file format, whose awfulness is the stuff of legend. Awful, but perhaps not awful for the sake of being awful. From Joel Spolsky:

The first thing to understand is that the binary file formats were designed with very different design goals than, say, HTML.

They were designed to be fast on very old computers.

They were designed to use libraries.

They were not designed with interoperability in mind.

New computers are not old, obviously, but running a full-featured word processor in a Javascript interpreter inside your web browser is the next best thing; transferring your data over a wireless network is probably the modern equivalent of a slow hard drive in terms of speed.

There is a perfectly good public file format for documents out there, Rich Text Format or RTF. But curiously, Apple’s RTF parser doesn’t do as good a job with complex documents as its Word parser—if you create a complex document in Word and save it as both .rtf and .doc, Pages or Preview will show the .doc version with better fidelity. Which makes a bit of a joke out of having a “standard” file format. Since I care about file formats and future-proofing, I saved my work in RTF for a while. Until I figured out that it wasn’t as well supported.

What about something more basic than RTF? Plain text is, well, too plain: I need to insert commentary, tables, that sort of thing. Writing HTML by hand is too much of a PITA, although it should have excellent future-proofing.

What about Markdown? I like Markdown a lot. I’m actually typing in it right now. It doesn’t take long before it becomes second nature. Having been messing around with HTML for a long time, I prefer the idea of putting the structure of my document into the text rather than the appearance.

But Markdown by itself isn’t good enough for paying work. It has been extended in various ways to allow for footnotes, commentary, tables, etc. I respect the effort to implement all the features that a well-rounded word processor might support through plain, human-readable text, but at some point it just gets to be too much trouble. Markdown has two main benefits: it is highly portable and fast to type—actually faster than messing around with formatting features in a word processor. These extensions are still highly portable, but they are slow to type—slower than invoking the equivalent functions in a typical WYSIWYG word processor. The extensions are also more limited: the table markup doesn’t accommodate some of the insane tables that I need to deal with, and doesn’t include any mechanism for specifying column widths. Footnotes don’t let me specify whether they’re footnotes or endnotes (indeed, Markdown is really oriented toward flowed onscreen documents, where the distinction between footnotes and endnotes is meaningless, rather than paged documents). CriticMarkup, the extension to Markdown that allows commentary, starts looking a little ungainly. There’s a bigger philosophical problem with it though. I could imagine using Markdown internally for my own work and exporting to Word format (that’s easy enough thanks to Pandoc), but in order to use CriticMarkup, I’d need to convince my clients to get on board, and I don’t think that’s going to happen.

I can imagine a word processor that used some kind of super-markdown as a file format, let the user type in Markdown when convenient, but added WYSIWYG tools for those parts of a document that are too much trouble to type by hand. But I’m not holding my breath. Maybe I should learn LaTeX.

Bike-share systems and the poor

This morning there was a story on NPR about bike sharing, specifically how it doesn’t do a good job of serving the poor. There are basically three reasons for this:

  1. The bike stations are not located in areas most useful to poor people;
  2. You need a debit card or credit card to use the system;
  3. Bike-share programs are expensive.

The story got me thinking about all the ways it’s expensive to be poor, and they’re certainly illustrated in this example.

To get a debit card, you need a bank account. To get a bank account, you usually need to scrape together $100 for an opening balance. This is not a huge hurdle to overcome, but if you never have $100 left at the end of your pay period, it’s going to take planning, and if life throws you a curveball before you’ve got that $100 saved up, you’re back to square one.

I looked at the prices for bike-share programs. Chicago’s Divvy has two price structures: yearly memberships and day rates. $70/year or $7/day, plus usage: in both cases you get 30-minute trips for free, but if you’ve got a longer bike trip than that, you get dinged $1.50 or $2.00 per 30 minutes. Austin’s nascent bike-share system has a similar breakdown, but is slightly more expensive.

So if you’re poor, the annual plans are probably out just because of the upfront costs, even though on a per-day basis, they’re a much better deal. If anything, you’re on the daily plan (Austin also has a weekly plan), although again, this presupposes you’ve got a bank account.

What about getting your own bike? You can get a beater bike on Craigslist. There are bikes listed there right now in the $20–50 range, so if you’re poor, the break-even point for rent vs own comes quickly—within one pay period. If you could afford the daily bike rental, you could afford to buy a bike. If you’re going to use a bike for commuting to and from work, it would be a no-brainer. It would also be a no-brainer for someone with more discretionary income who wants to commute by bike.

So given that anybody with even marginal math skills could figure out that ownership beats rental for routine, day-to-day bike usage, what’s the use-case for rental? It’s for when you’re out of your routine. Non-routine uses are hard to predict—it seems redundant to point that out. That makes the best placement of bike stations problematic.

Another obvious use case is tourism, and from what I’ve seen in Chicago and San Antonio, the placement of bike stations clearly targets tourists.

I don’t think it would be a bad idea for bike-sharing systems to be more accessible to the poor, but as long as those systems are run by private companies trying to turn a profit, it’s going to be difficult to balance that equation. Organizations like the Yellow Bike Project can do more to improve bike mobility for the poor right now, by providing them with their own bikes, teaching them how to maintain bikes, and giving them access to shop space.

PDFs, transparencies, and Powerpoint

This post is for anyone who gets frustrated trying to place vector art in a Powerpoint deck.

Gwen had a project to produce a set of ppt templates, using vector art provided by the client. Copying from Illustrator and pasting into Powerpoint, it looked fine, but saving and reopening the file showed that the vector art had been rasterized—badly.

We tried a few variations on this. Saving as PDF and placing the PDF had the same result. Saving as EMF and placing that did keep it as vector artwork, but the graphic wound up being altered in the process.

Other graphics created in Illustrator could be pasted or placed just fine, so there had to be something about this particular graphic. Although it was relatively simple, it included a couple of potential gotchas: it had one element with transparency set on it, and another with a compound path.

It was pretty easy to release the compound path and reconstruct around it—a big O with the center knocked out to expose the background. I’m pretty sure that wasn’t the problem, but it wound up helping anyhow, as I’ll discuss.

Dealing with the transparency was a little more of an issue: a transparent chevron floated over a couple of different solid colors, including the big O. To fix this, I used Pathfinder’s Divide tool to segment that chevron into separate pieces for each color it was floating over, and then set solid colors for each segment rather than relying on changing the opacity. Experimentation showed that the transparency was what triggered the rasterization.

Reproducing this process showed some artifacts in Powerpoint if the compound path was still present, so that wasn’t the problem, but it was a problem. Admittedly, this was only feasible because the image was simple, and the transparent element only covered three solid color fields, with no gradients or pattern fills—it would still be possible with those complications, but it would take a lot longer to approximate the original appearance.

Update: And if I was better at Illustrator, I would have realized the “Flatten Transparency…” command does exactly this, in one step. That would be the way to go.

This experiment was performed using two Macs, with Excel 2011 and both the CS4 and Creative Cloud versions of Illustrator.

« Older posts Newer posts »

© 2018 Adam Rice

Theme by Anders NorenUp ↑