Can a developer use an iPad as their only portable “computer”?

I am at a crossroads in my work situation. Since 2008 I have worked as a freelance web developer, which naturally meant using a laptop as my primary/only computer. I worked mostly from home, but I would frequently go to coffeehouses, and occasionally work on-site at client offices. A portable computer was a must.

The same week that Steve Jobs announced the 11-inch MacBook Air, I went out and purchased one. It was exactly what I wanted: a full-blown Mac, (almost) as small as an iPad (which of course I already owned as well, but mainly used for testing, occasional gaming, and watching all six seasons of Lost in the span of a month on Netflix, not for “real work”). I loved the MacBook Air. I said it was the best Mac I’d ever owned, though I admitted it was a tad underpowered. Enough so that when SLP needed a new computer 6 months later, I gave her my MacBook Air instead and bought myself a new, slightly more powerful version of the same.

That MacBook Air has been my only computer ever since. In fact, shortly after switching to it full-time, I wrote a glowing review of it right here. But last April I moved my business into a storefront studio space. I’m not going to coffeehouses anymore. Now, more often than not, clients come to me instead of the other way around. And all of this time I’ve been sitting at a desk, with that same 11-inch MacBook Air hooked up to an HP 23-inch LCD. (Yes, HP. I may be a self-proclaimed Apple fanboy, but even I can’t justify the expense of one of their Cinema Display monitors.)

It’s in this context that I’ve finally really become aware of the performance limitations of the 2010 MacBook Air. It’s unbearably slow with Adobe Creative Suite apps. It’s even unbearably slow running Panic’s Coda. And no computer today should choke up on what is essentially a glorified text editor. (That said… As much as I love Coda, it does seem bloated and slow almost everywhere I’ve used it. There’s no comparison to the blazing speed of BBEdit, which I also love, but Coda has some features I prefer, so it remains my main coding tool.)

Over the past few months, as my workload has increased and my patience has diminished, I can no longer pretend that the 2010 MacBook Air’s performance is adequate for my needs. I know the 2012 Airs are at least 3 times faster than the one I have, and I’m sure this year’s will be even faster, and maybe even have a Retina display, and therein lies the problem: I’ve been desperately wanting to upgrade my Mac, but I couldn’t bring myself to buy one of the current 11-inch Airs (the only portable I will consider) when they’re getting so close to a refresh.

At the same time, I have a major crunch at work over the next 3 months. I couldn’t afford to wait on my creaky old Air anymore. So last weekend I settled on a compromise, borne of the fact that I almost never touch my MacBook Air outside of the studio anymore. I got a Mac mini for the studio. I went with the more powerful quad-core i7 model, which is rated on Geekbench as at least 6 times faster than my old MacBook Air, and almost twice as fast as the current ones.

I’ve already noticed a huge difference. Adobe Creative Suite is way faster, almost to the point of no longer being infuriating. (But that’s another story.) Coda is still occasionally sluggish, but that may have more to do with the fact that I’m working with files on our local file server over a questionable WiFi connection. I should try putting the files directly on my hard drive to see if it makes a difference.

But now I am faced with a weird dilemma. This is the first desktop computer I’ve owned since the Dell I had back in 2001, and the first Mac desktop since even before that. (It was a Bondi blue G3 tower, if you were wondering.) The dilemma is this: in a world of iPads, where I am already pretty much never touching my MacBook Air outside of work, do I really need a portable Mac at all?

I still have the Air, of course, and have continued to lug it around next to my iPad in my Tom Bihn bag this week. But why? In the two meetings I had this week at client offices, I only used my iPad. Maybe the iPad is really all I need. Maybe?

I have a few months to find out. I won’t consider buying another MacBook Air until the new models are out, so in the meantime I will experiment. I will try only using the iPad for any and all computing tasks outside of the studio. I’ve begun that today, by typing this blog post on it as I sit at the kitchen counter with my Saturday morning coffee. It’s been a bit of a challenge. I gave up on using the WordPress web interface and switched to the (marginally better) dedicated iPad app. And I’ve made lots of typos… some that iOS auto-corrected, some it didn’t, and some false positives it shouldn’t have. (C’mon, iPad… use some context, would ya? Why would anyone ever write “you we’re”?)

The biggest challenge will be if I have to write some actual code. But it’s a far different world for that than it was even a year ago. I have a handful of coding apps on my iPad, though nothing I have could be more valuable than another pair of apps from Panic: Diet Coda (great name, BTW) and Prompt, a terminal app. I haven’t had much call to use either of them… yet. But I’ve been comforted knowing they’re there.

At the end of this month we’re planning a family vacation to Utah. That may prove to be the ultimate test. Do I dare leave for a week with only my iPad? Honestly, I’m not sure I can. It will depend on the state of my various work projects at that time. But I’d like to be able to give it a try.

I’ll post follow-ups here as the experiment continues.

Building a centered gallery grid with flexible column count for responsive web pages

It took an untold number of fruitless Google searches and a couple of hours of trial and error to get this to work. I think part of the problem may have been that I simply didn’t really know how to describe what I’m trying to do in a way that would yield good search results. And so, I hope now that I have a solution, sharing it here might help someone else.

The situation: I have a web page that contains a gallery of square images. The page is responsive but the sizes of the images are fixed. I want the page to automatically show as many images across as will fit in the layout on any particular screen, creating anywhere from one to five columns as needed. And, it needs to stay centered.

I got all of this going pretty easily… all except the “it has to stay centered” part. I was able to get it to work if there was only a single line of images, but as soon as they wrapped to multiple lines, the container element went to a full width and the images became left-aligned. It took considerable effort to discover a solution, although that solution itself is embarrassingly simple. I was hung up on a couple of possible approaches that got me nowhere, which probably contributed to the problems I had finding the right way to do it.

So… here we go. We’ll start with an unordered list:

<ul class="gallery">
  <li><img src="image.jpg" alt="" /></li>
  <li><img src="image.jpg" alt="" /></li>
  <li><img src="image.jpg" alt="" /></li>
  <li><img src="image.jpg" alt="" /></li>
  <li><img src="image.jpg" alt="" /></li>
  <li><img src="image.jpg" alt="" /></li>
  <li><img src="image.jpg" alt="" /></li>
  <li><img src="image.jpg" alt="" /></li>
  <li><img src="image.jpg" alt="" /></li>
  <li><img src="image.jpg" alt="" /></li>
</ul>

And here is that embarrassingly simple CSS:

ul.gallery {
  text-align: center;
}

ul.gallery li {
  display: inline-block;
}

OK, that’s not really all of the CSS. Your li tag needs height and width properties, and you may want to give it margin as well. But those values are going to be specific to your project.

TinyMCE and the non-breaking space problem

Let’s get right to it then: TinyMCE is great, but I am annoyed by its willingness to take users’ multiple spaces literally! Collapsing multiple spaces is a basic characteristic of HTML, and allowing users to carelessly (or intentionally, which they still shouldn’t do) insert multiple spaces by converting every other one of those spaces into the &nbsp; (non-breaking space) character is BAD!

IMHO.

Anyway… start with a pinch of Stack Overflow, add a dash of the official TinyMCE documentation, along with a heaping tablespoon of reading between the lines, and I have a working solution to the problem. My installation of TinyMCE now automatically converts any &nbsp; characters in the text back into regular ol’ spaces.

It’s a bit draconian; after all there are legitimate uses for non-breaking spaces. But 95% of the times they’re inserted by TinyMCE are user accidents, and another 4.9% of those times are abuses like faked “tabs” that would be solved better by another approach altogether. (There are reasonable CSS-based solutions that work in some cases, but let’s talk HTML’s need for tabs another time.)

Anyway… here’s the gist of the solution. You need to create a callback function. Here’s mine:

function my_cleanup_callback(type,value) {
  switch (type) {
    case 'get_from_editor':
      // Remove &nbsp; characters
      value = value.replace(/&nbsp;/ig, ' ');
      break;
    case 'insert_to_editor':
    case 'submit_content':
    case 'get_from_editor_dom':
    case 'insert_to_editor_dom':
    case 'setup_content_dom':
    case 'submit_content_dom':
    default:
      break;
  }
  return value;
}

It may look like there’s a lot of extra stuff in here you don’t need; I included all possible values for type inside the switch to be prepared for the future. You do want to check for type == 'get_from_editor' though; otherwise your replace() is going to run under way too many conditions and may cause weird behavior like new paragraphs appearing when you just want to insert new text into an existing one, or browser-generated warnings about leaving the page when you try to save. (I ran into both as I was fine-tuning this.)

Now that you have your callback function, you just need to… you know… call it. That’s done inside tinyMCE.init(). You’ll need to include this line somewhere:

cleanup_callback: 'my_cleanup_callback',

Be sure to check if cleanup_callback is already declared somewhere, and also don’t forget the comma at the end, unless you’re inserting this as the last line.

Once you’ve got it all rolled out to your site, you’ll need to clear your cache. I’ve found TinyMCE’s configuration files can be annoyingly persistent in the browser cache.

Yes… you have correctly observed that I had to use non-breaking spaces myself in this post, to get the indents in the code samples to show. Pay no attention to the man behind the curtain. And remember my complaint about the lack of tab characters in HTML. Another day.

The uncomfortable marriage of the UNIX command line and Mac GUI, and its implications for my sudoers file

I’m a longtime Mac user. A “power user,” you might say. Not so much a power UNIX user, though I do a fair bit of Linux-based command line tomfoolery as part of my job.

But things get ugly when the two come together. At the command line I am a bit too inclined to treat my Mac like a Linux server. It may have UNIX at its core, but it’s not Linux. And Apple has put some effort into de-UNIX-ing it as well. Things you expect to work don’t work the way you expect them to. (Yes, I just wrote that sentence. See what this is doing to my brain???)

For reasons I don’t care to get into, I decided today that I needed to modify the sudoers file on the studio’s Mac mini file server. And in my own inimitable and slightly stupid way, I handled this task as I typically do anything involving changing buried system files, not by struggling through using a command line text editor, but by copying the file to my desktop (where it is magically released from the prison of UNIX file permissions in which Apple has… uh… imprisoned hidden UNIX system files). I edited the file and put it back in the /etc folder where it belongs.

Only problem: in the process, the file’s ownership and permissions got changed. No problem, I thought. I’ll just sudo that sucker. Only problem is, when the permissions on the sudoers file aren’t what the system expects them to be, it doesn’t let anybody sudo anything.

Well… crap.

But then I remembered… Mac GUI solutions to the rescue! I opened up Disk Utility and ran “Repair Disk Permissions.” Problem solved! Apple has saved me from myself.

Now I can go back to my delusion that I am a power user.

Ode to the locker room

Being a runner in Minnesota can be difficult, because it forces you to make one of three choices:

  1. Run outside in subzero weather.
  2. Get a gym membership and run on a track or treadmill for 4-5 months.
  3. Stop running altogether in the winter.

Since #3 is not a viable option, you’re left with either bundling up with many layers and tiptoeing hesitantly along icy sidewalks or park paths with blustery winds buffeting your face, or paying a monthly fee for the privilege of driving to a building and running indoors on a treadmill or (if you’re lucky) a track, a tedious but climate-controlled solution.

Being an uncharacteristically wimpy Minnesotan, I’ve gone with the gym membership. I’m very fortunate, I suppose, to live close to the Midtown YWCA in Minneapolis, where I have access to first-rate facilities including a 1/6 mile indoor track. I loathe running on a treadmill. The track can be tedious, but at least I’m actually moving. And if I pick the right soundtrack, I can even visualize running around Lake Nokomis instead. (I’ve run Nokomis to the sounds of my own The Long Run enough times that I know precisely where I am in relation to the lake as each of the 11 sections of the 40-minute piece comes on.)

But as much as I can trick myself into enjoying (or at least tolerating) indoor running in the winter, there’s one aspect of Y membership that I will never like or be able to reconcile with my desire to be outside and alone when I run: the locker room.

I was not a jock in school. In fact, I was pretty much exactly whatever the opposite of a jock is. So what little time I did spend in a locker room was an exercise in taunting and humiliation (real or imagined, and probably more imagined than I believed at the time). I’m no longer afraid of the locker room. I just don’t like it.

I don’t like how crowded it is. I don’t like having to find a space on a bench to put my stuff while I change, or coming back to the locker room after my run to see someone else has chosen bench space directly in front of my locker.

I don’t like listening to other people whistling in the showers. What is so great about this experience to make them want to whistle their tuneless little non-melodies?

I don’t like people who are too comfortable being naked in the locker room, and I also don’t like people who are too uncomfortable with it. Be naked in the shower, the sauna, and at your locker, but nowhere else. Don’t be afraid to take off your swim trunks in the shower. Conversely, don’t stand at the sink naked while you shave, or at the counter by the hair dryers, reading a newspaper. (It kind of just seems logical to me to cover up certain parts when you’re wielding a razor blade, electronics, or paper. Especially paper.)

I don’t like listening to other people’s conversations, even when I am deliberately eavesdropping. I don’t want to be eavesdropping. I especially don’t like listening to teenagers swear loudly. And get off my lawn.

I don’t like how hot it is in the locker room, and how by the time I’m done drying off after my shower, I’ve started sweating again before I can even put on my shirt.

Given my dislike of winter in general, and especially my dislike of the compromises it requires (like spending so much time on the corollary disliking of myriad characteristics of spending time in the Y locker room), I’ve been asked by certain individuals in my life why I want to live in Minnesota at all.

They just don’t understand.

I’m not sure if it’s the harsh conditions of life in the Upper Midwest, much like the harsh conditions in the Scandinavian countries where many of our ancestors came from, or whether we’re just resentful of how easily our existence is ignored by the rest of the country, but part of the joy of being Minnesotan is to be able to complain about being Minnesotan. For us, to love something is to feel comfortable complaining about it.

Of course, that would suggest that perhaps I really love the locker room. But love and hate are not opposites. The opposite of love is indifference. And whether I love the locker room, or hate it, the one thing I clearly am not is indifferent.

But whatever the reason for my strong feelings, there is one that is stronger than all. Spring can’t get here soon enough.

Did Adobe actually mock up these Mac OS X screenshots on Windows? (Yes… I’m pretty sure they did.)

So, for reasons I’d rather not get into, I had to break down and install Flash Player in Safari today. (OK, I’ll get into it briefly… due to a rather obscure bug, Chrome — my preferred browser — has been crashing repeatedly on me whenever I try to upload a file. Long-term solutions aside, I had an immediate need for a way to use a Flash-based file uploader, so I had to install Flash in Safari.)

On the final page of the Flash Player download process on Adobe’s website, they offer a series of helpful screenshots to guide the most novice of Mac users through the process of locating and running the installer. Only… no, wait. Those can’t be real Mac OS X screenshots. The fonts are all wrong! So is the anti-aliasing, if you want to get really geeky about it. They’re mostly Arial, with the trademark overly-hinted anti-aliasing of Windows. Strangely though, it looks like the text label under the disk icon in the first screenshot is in Helvetica.

The real telltale sign for me though was the white mouse pointer arrow. Mac OS X has a black arrow. (The Mac has always had a black arrow, and Windows has always had a white one… presumably one of Microsoft’s infringement-suit-skirting superficial changes to the GUI in the early days of the Mac/Windows rivalry.)

I have come to expect subpar user experiences from Adobe, a company whose products I once loved so dearly. But this really takes the cake. I can’t even quite comprehend how screenshots like these were produced. It’s impossible to get results like this on a real Mac. Do they have some weird proprietary in-house Mac emulator that runs on Windows? (Actually, that might explain a lot.) Did they actually meticulously create these “screenshots” in (the Windows version of) Photoshop? Or do they have a Windows application specifically designed to generate fake Mac screenshots for all of their documentation? I’m at a loss to explain it, but there’s no way it wasn’t significantly more work than simply, you know, taking screenshots on a real Mac.

See for yourself… (Note: The image is slightly scaled down here to fit the page. Click it to view at full size.)

adobe_screenshots

SPF for dummies (i.e. me)

For a while I’ve known that (legitimate) outgoing email messages originating from my web server were occasionally not reaching their intended recipients. I also knew that there was a DNS change you could make to help prevent this problem, but I didn’t know any more about it and it was a marginal enough problem that I could just put it off.

Finally today I decided to deal with it. And I was (re)introduced to the SPF acronym. No, that’s not Sun Protection Factor, or Spray Polyurethane Foam, or even Single Point of Failure (although in my case perhaps that last one is accurate). No, it stands for Security Policy Framework, and it’s an add-on to the core capabilities of DNS that provides a way to positively identify the originating servers of outgoing email messages.

My situation is simple: I have a domain name that needs to be able to send mail from either my mail server or my web server. Most of the tutorials I found for SPF were far too convoluted to address this simple arrangement. Then I found this post by Cyril Mazur which provided the very simple answer:

v=spf1 a mx ~all

Simply add the above as a new TXT record in your DNS zone file, and you should be set.

Defense Against the Dark Arts (of iMessage Configuration)

Ever since upgrading to iOS 6, I’ve had a problem. The glorious promise of iMessage with its seamless integration of SMS/MMS and Apple’s messaging services between iPad, iPhone and Mac has mostly worked, with one infuriating, deal-breaking exception.

Texts to my phone number go to my iPad and not to my iPhone.

Look, all of this integrated messaging is cool. Being able to have text messages show up not only on my phone but on my other devices is awesome. But they have to at least show up on my phone or the whole thing is a failure.

I’ve researched the problem and found some people with somewhat similar issues, lots of stuff involving jailbroken iPhones (which mine is not), etc. but no clear answers to my exact problem. Several people in forums suggested shutting off iMessage on the various devices, deleting accounts, full-blown factory restore, you name it. All of which were either things I tried and found didn’t work, or wasn’t willing to try due to the amount of time and tedious work involved.

iMessage SettingsSo I began experimenting. There was one distinct problem I could see in settings. On both iOS devices and my Mac, the Messages app was showing both my phone number and email address. But in some cases one was grayed out. Infuriatingly, on my iPad and Mac, the phone number was grayed out and checked, and on the iPhone the phone number was grayed out and not checked. I could easily add or remove the connection of my email address to any of the devices, but my phone number was stubbornly locked into my iPad only. (Or, well, my iPad and my Mac… I guess. Honestly I hardly ever use Messages on my Mac so I haven’t really paid attention.)

I wish I could give a clear account of what came next, but I started tapping various buttons and clicking various boxes with such a fury that it all became a blur. What I do remember is that I clicked the checkbox next to my email on my Mac, which un-grayed the phone number. I was then able to uncheck the phone number, and the email now became grayed out.

So, if I understand correctly, the way iMessage settings work, at least one receiving phone number/email address must be checked at all times, so if only one is checked, it’s also grayed out so you can’t uncheck it. Then, if you check the other one, you may be able to uncheck the first.

That wasn’t working on my iPhone, however. Strangely though (at least as I recall from the aforementioned blur), when I repeated the process from my Mac on my iPad, then took a look at my phone, it was already switched to having the phone number checked and grayed out.

So then I began running some tests. This is where things get muddy, and since all of this just happened a few minutes ago, I still may not have a complete solution. I tried sending a text to my phone number from SLP’s iPhone. Never got it. Then I tried sending a text to my phone number from my iPad and it went to my phone within seconds. Cool. Then I tried sending a text to my email address from SLP’s iPhone, and it immediately showed up on all three of my devices.

Everything then is working as expected except that I did not get the text from SLP’s iPhone to my phone number at all, on any device. It’s hard to say what that’s all about. Are things working now? I don’t know.

Here’s another weird thing to throw into the mix. SLP and I share an iTunes Store account, but we have separate iCloud accounts. I also have a separate iCloud account apart from the iTunes Store account. The iTunes Store account uses my “real” email address, and I have a separate me.com email address I use on iCloud. So that’s all kind of a big mess, yes I know. Anyway, whenever I made these various changes to my configurations, the iOS devices would pop up alerts regarding the change. These alerts also appeared on SLP’s iPhone, even though her Messages settings don’t have any of my account info associated with them.

The bottom line here, for me, is that Apple really has not dealt with the reality of multiple users on the same device, multiple family members sharing an iTunes Store account but needing their own iCloud accounts, etc. They may be trying to deal with it all, but they’re trying to integrate too many things that had developed for too long as independent products. And they’re not having as much success at it as they think they are.

This post began as many others here do, as an attempt to share my solution to an Apple conundrum. Unfortunately in this case I just can’t quite make sense of what’s happening, and it seems to be one of those dark-clouds-on-the-horizon portents of more trouble to come with Apple’s tendency for its ambitions to exceed its capabilities in the realm of networked services.

I just want it to work. Isn’t that the Apple promise?

Follow up: Just after posting this I had our neighbor — who also has an iPhone but of course does not share our iTunes/iCloud accounts — send a text to my phone number, and I got it. So the problem seems mostly resolved. But let’s leave it at this: if you share your iTunes Store account with another family member and you both have iPhones, you might need to send your text to each other’s email addresses instead of phone numbers, if you’re running into the same problems I’ve been having.

Classic albums I belatedly “discovered” in 2012

I have, with some friends and acquaintances, cultivated the notion that I’m some kind of walking encyclopedia of music, especially that of the 1970s. But in reality there is so much music out there that I’ve never heard or just never really given a chance, even things by bands I really like. For instance, this year I finally heard Pink Floyd’s Obscured by Clouds for the first time. It was the album they recorded just prior to their legendary breakthrough Dark Side of the Moon, and it’s been on heavy rotation in the studio for the past few months.

That got me thinking: every year I compile my list of the top 5 new albums of the year, but I never reflect on the “new to me” music that I’ve only just gotten into this year. I’m not going to bother with a review of every album, but here’s a list of all of the new music I added to my library in 2012 that wasn’t released in 2012. Some of it is from the past couple of years; some of it is older than I am.

For extra fun, the list is presented in the order I added these albums to my iTunes library. I also bought a few greatest hits albums but I’m leaving them out, along with — of course — new remastered versions of albums I already owned.

  • Weather Report: Black Market (1976)
  • Antonio Carlos Jobim: Tide (1970)
  • Washed Out: Within and Without (2011)
  • Boards of Canada: Music Has the Right to Children (1998)
  • Washed Out: Life of Leisure (2010)
  • Hüsker Dü: Zen Arcade (1984)
  • Sufjan Stevens: Illinoise (2005)
  • Boards of Canada: Hi Scores (1996)
  • Boards of Canada: Trans Canada Highway (2006)
  • Billy Joel: 52nd Street (1978)
  • The Alan Parsons Project: I Robot (1977)
  • The Darcys: The Darcys (2011)
  • The Beach Boys: Concert (1964)
  • The Beach Boys: Summer Days (And Summer Nights!!) (1965)
  • The Beach Boys: Today (1965)
  • The Beach Boys: Live in London (1968)
  • Van Halen: Women and Children First (1980)
  • Bob Dylan: Nashville Skyline (1969)
  • Trombone Shorty: Backatown (2010)
  • Boz Scaggs: Silk Degrees (1976)
  • Def Leppard: Pyromania (1983)
  • Gong: Flying Teapot – Radio Gnome Invisible, Pt. 1 (1973)
  • The Sea and Cake: Car Alarm (2008)
  • The Mothers of Invention: Freak Out! (1966)
  • Frank Zappa: Hot Rats (1969)
  • Pink Floyd: Obscured by Clouds (1972)
  • Com Truise: Fairlight (2011)
  • Com Truise: Galactic Melt (2011)
  • Röyksopp: Senior (2010)
  • Röyksopp: Junior (2009)
  • Tame Impala: InnerSpeaker (2010)
  • Com Truise: Cyanide Sisters (2011)
  • Queen: The Game (1980)
  • Emerson Lake and Palmer: Live at the Mar y Sol Festival (1972)
  • Peter Gabriel: So (1986) [Seriously! OK, I did already own it on vinyl.]