Tag Archives: Apple

Tech Talk: Learning New Tricks, My Mac Experience (Developer Edition)

Developers at The Nerdery have a lot of choices to make when they start their new job. Although having a dozen different types of cereal in the cafeteria to choose from seems like a big decision to make, it rarely impacts their work performance. Each employee has a decision to make over their choice of workstation and development tools.

Scott Carpenter shares his experience when he joined the ranks of code-ninjas here at The Nerdery and how he made a very adventurous choice to “try something new”.

Learning New Tricks, My Mac Experience
by Scott Carpenter

An email from The Nerdery after I accepted the job:

“Let us know what you want to use, Mac or PC, and what software you’ll need so we can have everything ready when you start.”

Not entirely unexpected, and this is as it should be, but, what a refreshing statement! It told me, you’ll have some freedom of choice here. (Unlike the scenario where you’re not even allowed to set your browser’s home page, which has happened to me and was less than empowering.)

Well, what did I want to use? I’ve used Windows since slightly before Win 95 launched, and at home, exlusively GNU/Linux since 2008. I’m comfortable and productive with both, and was aware that Ubuntu might even have been a valid choice, but I thought: maybe it’s time to see what this Mac business is all about. Macs have good hardware and are pretty. And they have Unix under the hood, right? Okay then.

I had some doubts on my first day when I realized, I don’t know how to use this computer. This is a building full of smart people, and I’m new, and I don’t even know how to use my machine. But a computer is a computer. You know what you should be able to do; you just have to find out how to do it on this weird fruity machine. Luckily there is this thing called The Google, and there were my fellow Mac-using newbs to help me with things like finding the power button.

So what happens when you start using a Mac? I’m going to focus on a couple of keyboard-related problems you’ll run into immediately, especially if you’re a developer that uses the keyboard a lot, and you spend a lot of time in various editing windows. I’ll give you a couple of sanity-saving and life-improving tips.

But first we should talk about balance. In particular, when configuring a machine, whether hardware or software. I’ve learned there’s something to be said for accepting the defaults when possible. It simplifies your life and saves time by reducing the endless customization you’ll tend to do.

But then again, tinkering is fun. And we’re all different. It’s not just about how Steve wanted you to use a computer. It’s also about your needs, and your feelings. Instead of saying, “You shouldn’t want to do that,” or asking, “If you want it to work like Windows, why don’t you use windows?”, let’s fix the glitch.

The first thing is fairly simple, having to do with this strange “command” key. There is a control key on the outside left and right positions on a Mac keyboard, as is proper, but it’s not like the control key you know. Instead, the peculiar “command” button has usurped most of its power.

This turns out to be okay. Many of the key combos you’re used to work just fine with command. But. It’s in the wrong place. So the first thing you’ll want to do is swap the command and control buttons in “System Preferences… > Keyboard > Modifier Keys…”

It may be helpful at first to re-label the keys to remind you of the change:

mac keyboard with labels on alt and cntrl keys

This developer’s properly configured and labeled Mac keyboard.

(We’ll pause for a moment to allow for weeping from native Mac users.)

The next thing we’ll fix is the atrocious behavior of the “home” and “end” keys.

By default, the home key will scroll to the top of your document, but leave the cursor wherever it’s at. End will likewise scroll to the end. This is completely unacceptable. Here is what our fingers have been trained to use:

Home Move cursor to beginning of current line.
End Move cursor to end of current line.
Shift + Home Select text from cursor to beginning of line.
Shift + End Select text from cursor to end of line.
Ctrl + Home Move cursor to beginning of document.
Ctrl + End Move cursor to end of document.
Shift + Ctrl + Home Select text from cursor to beginning of document.
Shift + Ctrl + End Select text from cursor to end of document.

I found a nice solution, which I’ve extended after a bit more research. I like this method because it doesn’t require a third-party program, and it can be set per user.

You’ll need to edit the default key bindings file:

~/Library/KeyBindings/DefaultKeyBinding.dict

On my machine, the KeyBindings dir and the DefaultKeyBinding.dict didn’t exist, so I just created them. Add the entries below:

{
    /* Remap Home / End to Appropriate Behavior */
    /* Home */
    "\UF729"   = "moveToBeginningOfLine:";
    /* End  */
    "\UF72B"   = "moveToEndOfLine:";
    /* Shift + Home */
    "$\UF729"  = "moveToBeginningOfLineAndModifySelection:";
    /* Shift + End  */
    "$\UF72B"  = "moveToEndOfLineAndModifySelection:";
    /* Cmd + Home */
    "@\UF729"  = "moveToBeginningOfDocument:";
    /* Cmd + End  */
    "@\UF72B"  = "moveToEndOfDocument:";
    /* Shift + Cmd + Home */
    "@$\UF729" = "moveToBeginningOfDocumentAndModifySelection:";
    /* Shift + Cmd + End  */
    "@$\UF72B" = "moveToEndOfDocumentAndModifySelection:";
}

(Note that we’re using the command key in place of control, since we moved it to the correct position on the outside.)

You’ll need to restart an open application to use the new bindings in that app, and it doesn’t work in all applications. For example, it doesn’t work in the built-in Terminal program, but in there, you can go to “Preferences > Settings > Keyboard” and set home = \\033OH and end = \\033OF. (Make action = “send string to shell:”)

Side note: In Terminal, the command key doesn’t assume the control key’s duties. Your fingers will often forget this, pressing Command (AKA pseudo-Control) + C or D, and you’ll wonder why your program doesn’t stop.

Bonus tip: Your fingers also may want to use Ctrl + arrow keys to move left and right one word at a time, and also to use “shift” to select the words. For that:

    /* Cmd + Left */
    "@\UF702"  = "moveWordBackward:";
    /* Cmd + Right */
    "@\UF703"  = "moveWordForward:";
    /* Shift + Cmd + Left */
    "@$\UF702" = "moveWordBackwardAndModifySelection:";
    /* Shift + Cmd + Right */
    "@$\UF703" = "moveWordForwardAndModifySelection:";

(Again with Cmd because we’ve moved it into the Ctrl spot.)

More useful info here.

I also spent time learning new habits and adjusting to “what is,” but these changes to “what should be” helped me feel much more comfortable in the new environment, along with getting a proper ergonomic keyboard and trackball:

Complete computer setup with dual monitor

Now we're iComputing!

It’s been a lot of fun. OS X is built on Unix, and you can be happy “doing it wrong” by hanging out in the ugly and gross command line underworld. I found myself wanting to keep learning and playing with my new toy at home over the weekend. I missed it. It’s a beautiful machine, and I love to learn and explore new things. I suddenly realized I was looking at the price of new iMacs. I kinda want one for home, too.

Steve’s revenge!

Scott Carpenter was first introduced to programming in 1981 when Scott’s dad, an electrical engineer, gave him his first computer to encourage his interest in programming. It worked – in 1998 Scott graduated from St. Cloud State University with his Bachelor of Science in business computer information systems. Scott went on to work for Cargill for 15 years as a software developer where he focused on application integration, integration design and development. In 2013, Scott’s journey brought him to The Nerdery where he puts his technical expertise to use as a PHP, WordPress and Java developer.

Filed under Tech Talk, Technology

Friday Links: Apple apologizes for Maps

Filed under Links

Friday Links: Aspects of Daily life today that would have been unbelievable 12 years ago

Filed under Links

What Apple’s win over Samsung means

The Atlantic has a nice, succinct round-up of reactions to the Apple v. Samsung verdict that came out last week.

In the post they distill all the reactions and supply the pertinent quotes about what the verdict means to you, design, technology, Android, Microsoft, and a few others. With hundreds of thousands of pixels spilled about this case, The Atlantic’s piece might be the only one you need to read.

Filed under Design, Technology

How a Wired Reporter was hacked using his Apple & Amazon accounts

We all have our weaknesses. Some people can’t resist the pull of bad reality television. Some are weak in the face of a Lifetime TV movie. Me? I am incapable of skipping past a devastating account of hacking. The kind of hacking that strikes fear in the hearts of people and involves losing precious, sentimental digital ephemera — photos, notes, etc.

This is exactly what happened to Wired writer, Mat Honan, who was hacked and lost everything. Honan recounts how the hackers got into all his accounts using his Apple ID, Gmail, and information from Amazon. It’s a great, horrifying read that will either put fear in your heart or make you feel super smug for being so savvy with all your accounts.

“I’m angry that Amazon makes it so remarkably easy to allow someone into your account, which has obvious financial consequences. And then there’s Apple. I bought into the Apple account system originally to buy songs at 99 cents a pop, and over the years that same ID has evolved into a single point of entry that controls my phones, tablets, computers and data-driven life. With this AppleID, someone can make thousands of dollars of purchases in an instant, or do damage at a cost that you can’t put a price on.”

Filed under Technology

Primer Notes: WWDC ’12 Recap

Filed under Education

Friday Links: The History of April Fool’s Day

Filed under Links

The inside scoop on ‘Think Different’

If you have a little time (and tolerance for clunky writing) go read Forbes’ The real story behind Apple’s ‘Think Different campaign. The piece is written by Rob Siltanen who was the creative director & managing partner at TBWA/Chiat/Day. He not only pitched ‘Think Different,” but also wrote the rough draft of the script that became the iconic commercial.

“When the ‘Think Different’ campaign launched, Apple immediately felt the boost despite having no significant new products. Within 12 months, Apple’s stock price tripled.”

Wednesday Links: Because it’s a holiday week

Filed under Links

Friday Links: The pros & cons of the Internet circa 1996

Filed under Links