Keep posting those kid updates

People have all kinds of complaints about social media. Privacy is threatened. Stupidity abounds. People can't give politics a rest. People waste bandwidth on trivia like what they had for breakfast.

One complaint I've seen a few times goes something like: "I'm tired of people posting about their kids." I can see how people might feel that way, but I happen to feel the opposite, at least on Facebook. I love my friends' kid photos and kid stories. Many times I've chuckled out loud as if the kids were my own nieces and nephews.

Maybe I'm just lucky to have friends who have great kids and also post plenty of non-kid stuff that I also like, so I never feel overwhelmed with updates on Little Johnny or Little Janey.

Marathon

Although I am a native New Yorker, I don't have any personal stake in whether the NYC Marathon goes on this Sunday or not. Except for seeing bits of it on TV, I've always been pretty oblivious to it. I've never been stuck in traffic because of it; I've never had to clean up after it. Nor do I run a business that benefits from it, nor am I a fan who follows the sport.

The controversy over Bloomberg's decision feels weird, maybe because I am so detached from the event both as a tradition and as a practical matter.

I've seen arguments that New Yorkers need the Marathon to run as scheduled to "send a message" of some kind. I don't see the value of any such message, and I'm not sure who we're sending it to.

I've read that the Marathon will bring much-needed money into the city ($340 million), while not really diverting all that much in terms of resources that are needed elsewhere like police and medical personnel. If it is all about money, I can see how it would be hard politically to just say so, although Bloomberg seems to have pretty much done just that.

I've seen counterarguments that letting the race go on is insensitive and disruptive to many people who are suffering, especially in Staten Island, which was hit very hard and is where the race begins. I see from the course map (PDF) that the runners will barely spend any time in Staten Island. On the other hand, setting up the starting line will be a major, perhaps disruptive, logistical undertaking. And as is often the case, maybe it's the idea of the thing that really matters more than the numbers.

I don't have a cogent argument either way. All I can say is, it feels weird to me that the Marathon was not canceled. I can certainly understand the strong feelings of the people who condemn Bloomberg's decision. But maybe there are valid reasons for this particular show to go on.

How I tweaked that HTML table

My last post contains an HTML table that is a modified version of the big table on the "Closing the Gap on Autism" page. Here, mainly for my own future reference, is how I generated the modified table. There are probably ways I could have done it smarter or quicker.

  • Generate a sorted CSV file
    • Select the table contents in Safari and copy-paste them to a Numbers spreadsheet.
    • Sort on state, city, and ZIP, in that order. I was thrown off by the fact that Numbers doesn't have a menu item with the word "Sort" in it. I learned from the Help documentation that what I wanted was "Reorganize".
    • Format the ZIP column to be five digits, padded on the left with zeros. Otherwise the leading zeros will be omitted when the file is exported.
    • Export to a CSV file.
    • Pipe the CSV file through uniq to remove duplicate entries.
  • Convert the CSV to an HTML table
    • This CSV Converter page does the job nicely. I noticed Excel has an option to export directly to HTML, which would have been a nice shortcut except what it generates is horrifying.
  • Clean up the HTML
    • Paste the HTML into Sublime Text.
    • Get rid of the spaces that the CSV Converter inserted before many of the closing ">" characters. This wasn't important; I just didn't like looking at the extra spaces.
    • Replace tabs with spaces. I couldn't get find-and-replace to work with tabs, and was too lazy to try harder than I did.
    • Use regex plus global find-and-replace to convert the store numbers into links to the Gap web site. Because there were sometimes two store numbers, I used two find-and-replace passes to generate the store links. I manually cleaned up one case where three store numbers were given.
    • Use another regex find-and-replace to fix phone numbers with spaces in them.
    • Use another find-and-replace to remove the extra spaces from "St ." and "Ave .".
    • Replace "&" with an ampersand.

There are a whole bunch more punctuation fixes I could have made, but I decided not to bother. I allowed myself to fix one typo, and corrected "Loehmen"s" to "Loehman's".

I added a bit of CSS before posting to WordPress. You can tell I'm not a CSS expert — mainly I wanted to draw the borders.

Closing the Gap on Autism

This weekend, Autism Speaks and The Gap are partnering in a charity discount event called Closing the Gap on Autism. Here's an excerpt from the email I got about this; it explains the event more clearly than the copy on the web site:

This weekend, Friday, September 28 – Sunday, September 30 donate $5 to Autism Speaks at participating Gap stores and receive a special 25% off discount on all regular priced items on Gap, GapBody, GapKids, babygap & Gap Maternity merchandise.

It’s so simple: buy your special $5 coupon in-store and you get $25% off your entire purchase. If you spend $20, it pays for itself!

The coupon is only available in-stores.

The web site shows a list of participating stores, but it seems to be sorted only by state and not city. As a result, the New York, NY stores (for example) are not all grouped together.

Here is that same list, sorted by city and state, and with links to the individual stores' web pages so it's easy to check on their hours and find them on a map. Note that for some reason some of the stores have two store numbers listed, only one of which is valid. In these cases, one of the store links won't work but the other should.

[Update: I've now sorted the list by ZIP as well as city and state, so, for example, all the 10011's are together.]

[Update: I've also removed duplicate lines. This is clearly an obsessive thing for me — I'd be surprised my improved list of stores actually makes a difference for anybody.]

If you spot an error, please let me know.

[Update: I've moved the list of stores to its own page.]

Don't break Emacs

One of my favorite Mac OS features is support for basic Emacs keystrokes for editing and navigation. If you're unfamiliar with this feature, start editing some text in a Cocoa app like TextEdit or Mail, and try ^A, ^B, ^D, ^E, ^F, ^K, and ^T, to name just a few. This functionality is built into standard Cocoa text controls like NSTextField and NSTextView.

Occasionally I come across a web site that intercepts keystrokes that would normally be Emacs keystrokes. For example, a site might implement a rich text editor and use ^B to mean "bold", which is a familiar shortcut for Windows users, but means "move one character backward" to Emacs users. I wish these web sites would detect the platform they're running on and use familiar Mac shortcuts — in this case, Command-B — which would have the double benefit of being naturally discoverable for Mac users and not overloading an Emacs keystroke.

Native apps can "break Emacs" too. I just reported a bug in Sublime Text where ^K (kill to end-of-paragraph) doesn't work in the text field in its Save dialog. I suspect this is because, for some reason, Sublime Text explicitly maps ^K to an item in the Edit menu instead of falling back on the default Cocoa behavior.

In July I filed Radar 11964801 on iTunes because ^D (forward delete) doesn't work in the Search field — a bizarre edge case if I ever saw one. ^D isn't mapped to any menu item in iTunes, nor is it documented as a keyboard shortcut for either Mac or Windows. I really wonder what causes this bug. My Radar was marked as a duplicate of 11306235, so there's at least one other picky nerd out there.

Here's how picky I am. Suppose there was a magical "Mac OS, PC Edition" that could run on any cheap PC hardware. Suppose for some perverse reason the "PC Edition" lacked the Emacs feature but was identical to Mac OS in all other respects. I wouldn't even consider it. I'd still pay more for Apple hardware, although I would certainly consider recommending the "PC Edition" for less nerdy friends and relatives.

And so, while I realize these Emacs breakages are trivial-beyond-trivial in the grand scheme of things, I'd still like to register this tiny plea to developers targeting the Mac: please don't break Emacs.