Monthly Archives: August 2013

Dear Massachusetts Drivers…

Dear Massachusetts Drivers,

Please consider some pro-tips about driving from a displaced Californian…

  1. Merging is most efficiently achieved with alternate feeding of cars into the merging lane. Doing so will mean less traffic snarls and frustration. If you are racing ahead of the other drivers getting into bumper-to-bumper traffic, you are just playing with yourself.
  2. When you change lanes behind me, regardless of direction, and decide to make a statement by coming within inches of my rear bumper (whatever statement that may be, I have no idea), please understand that if you hit or clip my car, the fault will lie with you since you rear-ended me and should have been in control of your vehicle at all times particularly in regards to the car immediately in front of you. This is doubly true for drivers of all sports cars, construction, and landscaping trucks.
  3. When you change lanes to get in front of me, going at a speed that is at least matches mine or faster would be best, otherwise get out of my way.

Until such time that you see fit to follow these suggestions, I would hold you dear in my heart as your own class of stupid crazy. Especially those of you on Route 128 north of the Pike.

Happy driving!
p

Ya Got Trouble

Mothers of River City! Heed the warning before it’s too late! Watch for the tell-tale sign of corruption! The moment your son leaves the house, does he re-buckle his knickerbockers below the knee? Is there a nicotine stain on his index finger? A dime novel hidden in the corn crib? Is he starting to memorize jokes from Capt. Billy’s “Whiz Bang?” Are certain words creeping into his conversation? Words like “swell” and “so’s your old man?”
“Ya Got Trouble,” The Music Man

This cracks me up every time I hear it.

Excel files and Scripting Bridge: Three conditions

Working with Excel files in Excel via Scripting Bridge is non-obvious, even when the bulk of the work done is extracting information from Excel like I do. Exporting content from Excel into CSV or a tab-delimited file isn’t an option since oftentimes I need to capture styles applied to text that is simply lost upon export. I have to work in Excel, and over time I have learned that in order to work with an Excel file with Scripting Bridge, the file must meet these conditions:

  • Saved in .XSLX format and not .XLS.
  • Have more than one worksheet (tab).
  • Not have any data connections.

The first condition was simple to troubleshoot and check because the file will not open. There is no visible error, but the returned value is nil. Bam. Done.

The second condition was not as obvious. I discovered the condition through the getItemCountInColumn:removeHeaderRow:inSheet: function in my OCScriptingBridgeExcelController class. The problem was that the function would never stop counting. Columns with 1,000 items would be in the tens of thousands before I figured out what was going on and stopped the application. I don’t know what other issues may arise by having only one tab—finding those would be all but impossible to test given the sheer volume functions available in Excel—but at least I know the issue is there and the condition is easy to test. As to why the number of worksheets would interfere with such a seemingly simple function is buried somewhere in Microsoft.

The third test—no data connections—is proving to be much more difficult and had the same problems as the second. The problem testing for this arises when trying to decipher what Excel means by a data connection. Is this a connection in a pivot table or is this a named item, and what can be done about the connection if one is found? Connections, in general, are pretty well scattered throughout the API. Connections are managed (so far as I have found) in two places: the pivotCache class, accessed through the workbook class, and the namedItem class, accessed through the worksheet class. Documentation on both is just as scattered (and non-existent on the Mac). In my case, it appears the namedItems array is where my found connections are held. In Applescript, there is no way to remove one once it has been created, and I haven’t gotten around to figuring out how to handle the existence of a named item. I am left with the same question as I do for the second condition: What does the existence of a named item have to do with getting information from an Excel spreadsheet? This is just weird.

People simply empty out

And what hurts is the steadily diminishing humanity of those fighting to hold jobs they don’t want but fear the alternative worse. People simply empty out. They are bodies with fearful and obedient minds. The color leaves the eye. The voice becomes ugly. And the body. The hair. The fingernails. The shoes. Everything does.

As a young man I could not believe that people could give their lives over to those conditions. As an old man, I still can’t believe it. What do they do it for? Sex? TV? An automobile on monthly payments? Or children? Children who are just going to do the same things that they did?
Charles Bukowski, People simply empty out

A note about comments on the blog

The issue of whether comments should be on blogs in order for them to be considered blogs has been debated ad nauseum. I am firmly in the camp of not having comments and any reasoning I could muster has already been better explained by Alex Payne 1:

For most sites, though, comments are worse than useless. The anonymity of the Internet inspires hit-and-run attacks, unintelligible ramblings, and truckloads of spam. I believe that comments are evil by default, and the sites above that seem to have healthy communities are blessed flukes.

For me, the spam and hacking that come with allowing comments are really the main reason why I won’t allow them. I enjoy hearing other people’s opinions and have had luck with them in the past. But that was a long time ago. This site (and blog) is customized to be as low maintenance as I can make it without writing an entire framework myself, and the last thing I want to do here is intentionally leave myself open to security problems. So, off with the comments. I can understand (and can hear) the argument that this makes the blog an echo chamber, but I do not agree with that assessment because the quality of comments is usually really crappy and not worth their time to respond. Again, Alex Payne…

I think people do their best writing when they’re forced to defend their ideas on their own turf. It’s one thing to leave a comment on someone else’s blog, but quite another to put your argument in front of your own readers.

This is ultimately simple: My turf, my rules; their turf, their rules; optionally calling and responding across domains. Don’t like the rules, don’t play the game. I don’t like how commenting generally runs on websites, so I won’t allow them since I can avoid them. Done and done.


1 Please also see Daring Fireball who also links to Alex Payne.