IE’s automatic Compatibility Mode

The other day, we had a mystery: Some javascript code that has worked on production for a while now stopped working in IE9. The error console complained that the forEach() method did not exist on an array. And yet, IE9 has always supported Array.forEach(). WTF?

We re-wrote that code with regular for loops, and moved on. But today, we saw weird layout problems in IE9. Fiddling around, by accident, I discovered that the pages were rendering in IE7 mode! Off to Google:

It seems that Microsoft “helpfully” renders pages in compatibility mode (IE7) if it thinks the site is in the intranet zone. I don’t know how it decides that a page is in the intranet zone. You can override this behavior in the settings, on an individual basis.

Luckily, there is a special meta tag that IE looks for, and changes the rendering engine accordingly:

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

Alternately, you can send a header that does the same thing.

Note that this only applies to a true IE9 install. If you emulate IE9 using IE10 or 11, you will not see the automatic application of compatibility mode. As you can imagine, this only added to the mystery, because I was unable to reproduce the bugs on my laptop. It was only with a borrowed laptop that I discovered IE7 mode.


Car Wars as connective tissue

Review, if you will, this wonderful Car Wars retrospective. In the early 80’s it didn’t matter if you spent most weekends on the East Front or the 6th Level of Foozle’s Lair, you occasionally played Car Wars. It was the connective tissue that bound all gamers together. I recall, simultaneously:

  1. never taking this game seriously
  2. buying a bunch of supplements
  3. some great sessions!

Actually, one of the wonderful things about this game is that nobody every got mad. Losing is a high-EQ ability, not commonly found in teenage boys. But all I recall from Car Wars is laughter. No one ever took it seriously enough to get uptight.



Reduce Friction to Win


Here’s another lesson from basketball, that applies to business (and life). Winning emerges from harmony. That means that high-EI people, who actually try to get along with one another, are critical to any team (or organization).

A post on Bruin Nation, reflecting on the career of coach Larry Brown, says:

I would also point to his ability to reduce the inherent friction between individuals in a team game.  Phil Jackson was a coach who had great insight into how to do this. When constructing a team he would find veterans who could fill certain roles on the team that would not conflict with the stars.  Younger players wanting to prove themselves and  playing for big contracts would– even though more talented than role-player veterans–take shots and touches from the more talented stars, hence leading to a less efficient team.

And I think Brown has those same type of friction-reducing skills.

A day earlier, Ailene Voisin published a column about internal discord in the Sacramento Kings front office. Coach George Karl said:

I think organizations are a little bit like basketball teams,” he said. “They have to play together, work together. Where the responsibilities fall, what the opinions are, behind closed doors we’re allowed to have fights, heated discussions. But Bill Walsh told me when I first started coaching that “‘organizations that aren’t together don’t win.”

And before last night’s Warriors game, coach Steve Kerr said:

I think comedy plays a huge role in sports. You have to have guys who are funny, who keep the locker room loose.

Yes, the universe is sending me a message. I get it.

The photo, “WD-40” is copyright (c) 2014 by Mike Mozart and made available under a Attribution 2.0 license.

Add swap to your Digital Ocean Droplet

I have one of the small droplets on Digital Ocean, which works fine for serving web sites. And also learning about linux.

It turns out that linux does not automatically come with swap space. That’s obviously in keeping with the unix philosophy of:

  1. doing the minimum
  2. assumes you know what you are doing

It is easy enough to set up a swapfile. Instructions vary slightly based on your linux flavor. For example, I run centos 6, so these instructions work for me. Google as needed.

After setting up a swapfile, npm installs work flawlessly. Highly recommended.

Translate placeholders with Google Translate widget

The Google Translate widget does not translate placeholder text in form fields. A regrettable oversight. This code corrects that.

Re-setting the mysql root password

DB corruption, or hacking? Either way, I’ve had my WordPress DB wedged twice in the last 3 years.The solution is to reset the root password. Instructions are here, but repeated below:

/etc/init.d/mysqld stop
mysqld_safe --skip-grant-tables &
mysql -u root
use mysql;
update user set password=PASSWORD("mynewpassword") where User='root';
flush privileges;
/etc/init.d/mysql stop
/etc/init.d/mysql start


Jim Harbaugh’s last lesson

I was really, really late to the Harbaugh party. He was loopy and successful at Stanford, but I’m not a Stanford alum or fan — I only paid attention when he played USC or UCLA. And the 49ers were bad for so long, I didn’t expect them to bounce up so high just because of a coach. Plus, there was a lockout, which limited my interest in football that first season. And then I wondered if the 49ers weren’t just a little lucky, a flash-in-the-pan.

I finally embraced the Harbaugh 49ers two years ago.  I started reading everything about Harbaugh, and I came to understand that he is a really interesting, unique, effective person. As most great coaches are.

Harbaugh is always teaching us new lessons (which is funny, because Jed York says he wants his next coach to be a “teacher”). We all expected Harbaugh to diva his way to another NFL team, cash in huge, and stick it to York. But that’s not what he did.

Instead, he went back to college coaching. And sure, there are extenuating circumstances. He is coaching his alma mater, a historically famous football school, heir to a legendary coach. And they are paying him an NFL-level salary (although less than he could command on the open market).

Why did he choose that path? I think he came to understand that success is not happiness, and happiness is not counted in championship rings. This is different from Jed York’s (and many other NFL owners) understanding of the world. A few years ago, when Jerry Sloan retired, I wrote this:

Michael Jordan and  Kobe Bryant from the player side, along with Pat Riley on the coaching side, have turned a psychotic need to win into one of the most prized attributes of any coach or player. Jerry Sloan never suffered from that. He wanted to win, and tried very hard to do so. But for Sloan, winning was a by-product of playing your hardest and executing perfectly. If you played hard and executed well, you could walk away from any game with your head held high.

More recently, Carmelo Anthony said this:

You can’t control winning. It’s out of your control. You can control what you do. You can control your work ethic and your mind-set. When it comes down to winning, everything has to be synchronized, from ownership all the way down to the staff. Everything has to be in sync.

I don’t have any quotes handy, but at the beginning of this NBA season, Kobe was asked why he returned, and why he returned with the Lakers. And his answers were a little mysterious, but he talked about “going through the process,” and “honoring the process.” I think Kobe (like Carmelo, and Jerry Sloan, and now Jim Harbaugh) has come to understand that happiness does not come from achievement, it comes from striving for achievement. From hope for future success, not reflection on past success. It’s more important to play to win, than to actually win. Here’s a bit from Harbaugh’s farewell press conference:

-Q: You’ve said playing for a Super Bowl title is the ultimate prize and you don’t have one yet. Is that still a goal for you?

-HARBAUGH: We played for it and that’s the way we look at it. Every time we took the field it’s been a tremendous thrill, one of the great thrills of my life and am forever proud of what we accomplished.

By leaving the NFL, and going to Michigan, Harbaugh is also telling us that love and acceptance and trust are really important. Those are the things that have to be synchronized, as Carmelo says. Those things, and the freedom to pursue happiness, are more important than money or trophies.



James Garner died

NOTE: this was started last summer. Then noodled on for several months. Then I hit “publish”.) 

James Gamer died last Saturday. He was 86.

I have a ton of affection for Garner, but mostly based on his “Jim Rockford” character. “The Rockford Files” were on in my house every week during it’s initial run. Then every day in re-runs. The Gamon’s were unabashed Rockford fans.

This is a notice, not a lament. Garner did everything I cared about by 1980. I enjoyed his subsequent work, but I don’t get misty-eyed about it.

He was, frankly, an underachiever. Tall, handsome, charming: he should have been the heir to Cary Grant and Rock Hudson. But he wasn’t “actor” enough to escape his true nature. That nature was on display in “Maverick,” “The Great Escape”, and “The Rockford Files.” Garner enjoyed playing the role of the smooth-talking, ethically-flexible, reluctant hero. Rockford, in particular, had a hidden line he would not cross. That’s when he flipped into a hero. Rockford also had an interesting twist on manly pride: You could overpower him in various ways. He accepted that pragmatically. But if you fooled Rockford, he became a relentless foe.

I think Hour of the Gun was Garner’s only effort at a darker role. He fails, in my opinion. But Jason Robards is an outstanding Doc Holiday. And the affection between Garner’s Wyatt Earp and Robards’ Holiday seems authentic.

As usual with old celebrities, I don’t really miss or mourn James Garner. But I’m glad he was around.


windows delete path too long

One problem with nodejs programming is that npm modules can produce deeply nested folders. So deep, Windows will throw “path too long” errors if you try to delete them.

Path too long errors are really hard to get around. Consider this MS Support page. Skim down to “Cause 4, Resolution 5″: “Use a tool that can traverse deep paths.” Gee, thanks Microsoft.

There are a bunch of commercial tools, starting at $20, that will delete anything for you. However, I don’t think I should have to pay extra to delete files. Call me crazy.

Luckily, there is a free solution: 7-Zip. You should install this anyway, because it is the best Windows zip file system. And totally free.

It turns out 7-Zip has a file manager, like Windows Explorer. Use the 7-Zip file manager to locate the file or folder that you want to delete. Click to select. Then, using the keyboard, press shift+delete. Voila! All gone.


Chromebooks: good enough, smart enough, and doggone it, I like ‘em

I bought a chromebook earlier this year. This exact model, for $300, to be precise. I was curious about two things:

  1. Would I miss desktop software?
  2. Would a seemingly underpowered computer frustrate me?

The answers are no, and no.

As usual in life, your mileage may vary. But I found it really easy to transition to browser computing. Most of the things I do on the computer have browser-based alternatives. And I find that living in the cloud gives me an incredible lightness of being. I never install or update software. I don’t get malware. If my chromebook falls in a well, I can just buy another one (they’re cheap, and easy to find), and be right back in business. Heck, I could borrow a browser and be right back in business.

Predictably, I use Google Docs in place of office tools, though I am not a heavy user. Microsoft has ported real Office to the web now, so you could always pay for that if you don’t love Google’s 80% solution.

I’ve ripped my last cd, I think. I subscribed to Google’s music service a couple of years ago. There is so much to listen to, I think I can just live without whatever is missing.

Actually, that’s pretty much the dividing line. Some people are complete-ists. They want every single thing, just in case. They may never use pivot tables, but if your spreadsheet doesn’t support it, they’ll reject it. Those people won’t buy chromebooks. I shed no tears for them.

You can make music, edit video, draw pictures, and even program from inside a browser. You’ll sacrifice some features (for now), but you won’t be blocked from accomplishing your mission.

A few delightful things that I didn’t expect to be a big deal, but they are:

Instant on. Open the lid, and chromebook is up and moving. It’s shocking how useful that is.

Really long battery life. Mac people already know about this superpower, but I’m a Windows refugee. Going hours and hours without plugging in is also really useful.

No malware. Mac people used to know what this is like, until they didn’t. But it was just an accident on the Mac. ChromeOS is military-grade secure by design. I can visit any website, open any attachment, plug in usb sticks of unknown provenance. ChromeOS has my back.

ChromeOS keyboard. At first, I thought it was funky. But the more I used my chromebook, the more I grew to appreciate the thoughtfulness of the special keys. I wish my Windows computers had this keyboard.

What about offline use? Well…

I spend the lion’s share of my time at home, my office, Starbucks, and McDonalds. Lack of internet is not a problem that I actually have. If I were still riding trains on my commute, I might feel differently.

There are, in fact, many things you can do offline with your chromebook. The same things, mostly, that you can do offline on regular computers. But you need to plan ahead. When you own a chromebook, you get used to just streaming everything off the cloud. To do offline stuff, you have to remember to save files to local storage. Then you can access them offline. You can read Kindle books, watch movies, play music, look at pictures, and work on office docs.

A few notes on the hardware:

There probably are no bad chromebooks, but I think you’ll be happiest with an Intel Haswell processor. Benchmarks show the Haswell outperforming the other chromebook chips, and anecdotal reports on the internet say the other chips sometimes lag. There is no price premium ($200 for the Acer C720), so prefer the Haswell.

I, personally, love the 11″ screen form factor. It’s the right size for couch-surfing, and makes an unobtrusive companion around town. But there are 13″ and 14″ inch screens too.

Surprisingly, 2GB of ram is fine. I guess 4GB would be even better, but I really haven’t felt any pain.

My chromebook has a touch screen. I don’t use it a ton, but I’m glad it’s there.

Some chromebooks come with 16GB of storage. Others, like mine, come with 32GB. It never hurts to have more, but I wouldn’t notice if someone stole half my storage. Everything is stored on Google Drive.