Blogging Robots

Other Stuff Blog

On Anchored Selections in Windows, Gnome, and Mac OS X

April 28, 2009 by Dmitry

Pierre Igot wrote a blog post “Shrinking and expanding selections in Mac OS X(via Daring Fireball), in the first part of which he explains how text selection works on Mac OS X, and complains that this behavior is wrong. I disagree.

Let me explain. On Windows and Gnome, when you’re selecting text with mouse, the anchor is being placed on the final point of your selection (and it’s displayed with a blinking indicator in some applications like Notepad). If you select text from left to right, the anchor appears at the end of your selection:

Windows: anchor at the end

If you go from right to left, the anchor is at the beginning of it:

Windows: anchor at the beginning

Pierre writes:

What if I overshot by one character or two and actually only wanted to select the first two words? To me, since the selection with the mouse was made from left to right, intuitively I should be able to shrink the selection by one or two characters by pressing shift-Left a couple of times on my keyboard.

This seems logical: if you go left to right, you’ll probably miss a character of two, so placing anchor to the end of your selection is the right way. But this logic is flawed. It’s no harder to miss a character when you begin selecting text, than to miss it when you finish. Actually, there’s no way to select missing characters at the beginning at all, apart from starting your selection from scratch. There’s also a problem with double-clicking the word. Where should be the anchor placed in this case? Windows places it at the end of the word, while Gnome places it at the beginning.

Cocoa text controls behave differently. When you select text with mouse, the anchor is undefined. When you switch to keyboard, you control the anchor point: if you start by pressing Shift+Right, the anchor is being placed at the end of your selection, but with Shift+Left it’s being placed at the beginning. This way you can easily select missing characters in any part of your selection. Also, without anchor, you can continue growing your selection both ways.

Notice that I didn’t say that Mac OS X behave differently, just Cocoa. Carbon handle this the third way (the anchor is always where you click), but Apple is getting rid of it. That’s why Finder has anchored text selection with mouse. Good thing there are rumors that it’s being rewritten in Cocoa for Snow Leopard.

Yes, there’s inconsistency between text selection and list selection, but I have no explanation for this :)

Update: Pierre published a follow-up.

Someone is wrong on the Internet

December 12, 2008 by Dmitry

When you launch BlogJet for the first time, it conveniently shows you a test post that you can publish to see if you have configured the program right. Early versions of BlogJet included the following quotation:

Computers are useless. They can only give you answers.” — Pablo Picasso

Then I found a better quote on the Web and replaced Picasso’s one with it:

“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination.” — Albert Einstein

It turns out, Albert Einstein didn’t say that. Instead, this quote is from Leo Cherne, an American economist.

This was discovered by Ben Shoemate, and he wrote a post in his blog about it:

People use quotes as a way to strengthen their own position. If I can quote someone you respect, it adds credibility to whatever argument I’m making. Over time, the truth gets further and further away. The biggest names have always attracted people who are more than willing to put words into their mouths for their own gain – Confucious, Jesus, Aristotle, Shakespere, Einstein, and the biggest, most misquoted, of them all – God. All of them have probably been quoted more for the things they never said, than things they actually did say. I imagine this is the most disappointing part of time travel, waiting around to witness words never spoken and deeds never done.

Ben made a research to found the actual source and author. You can read more in his blog.

I’m totally agree with him, and I’m sorry that I helped spread the disinformation. Here’s the lesson: when you’re looking for a good quotation, don’t trust a few websites — do a better research.

xkcd - Duty Calls
xkcd comic

Thanks, Ben!

P.S. See also Wikipedia’s List of misquotations.

Mobile Me is the new name of .Mac. Here’s the confirmation

May 30, 2008 by Dmitry

Update: It’s official: .Mac will be MobileMe soon.

.Mac re-branding is coming

May 30, 2008 by Dmitry

I’m not in Apple rumors business, but… hell… why not?

Apple will rename their .Mac service soon. Hints are everywhere in Mac OS X 10.5.3 update.

iCal’s Localizable.strings file contains the following string:

/* Label of .Mac button in iCal’s General preferences. %@ is the new name of Apple’s online service (was .Mac) (remove -XX02)

Safari has the following lines in its Localizable.strings:

/* Title of .Mac alert sheet, with .Mac brand name subsituted */ “You need a %@ account that has syncing enabled” = “You need a %@ account that has syncing enabled”;

Same with Mail’s Prefs.strings:

/* Title of button used to open the .Mac system preference pane. */ “AOS_SYNC_BUTTON_FORMAT” = “%@…”; /* Descriptive text for .Mac Sync. */ “AOS_SYNC_FORMAT” = “Use %@ to synchronize Accounts, Rules, Notes, Signatures, and Smart Mailboxes.”;

Almost everywhere “.Mac” has been replaced with %@, which means that the name of Apple’s online service will be inserted programmatically by applications.

I looked into binaries to find out what the new name is, but it seems like apps take this value from /System/Library/PreferencePanes/Mac.prefPane /System/Library/CoreServices/AOS.bundle (thanks, Mike!), which still has the old name. It seems like it will be updated via Software Update once Apple renames .Mac and — boom! — all your apps will have the new name.

Kudos to DeepApple [ru] for finding strings in iCal.

Update: next post: “Mobile Me” name found!

MarsEdit 2 Released

September 7, 2007 by Dmitry

Customers switching from PCs to Macs ask us if we’re going to release BlogJet for Mac OS X. The answer is — we don’t have such plans at this time, sorry.

But if you’re looking for a BlogJet replacement for Mac OS X, look no futher than MarsEdit.

Daniel Jalkut, a fellow shareware developer, released a new major version of the great blog client for Mac (congrats!).

You can download a free trial version, and if you like it, it’s yours for $29.95.

For Windows users: stay tuned for the next version of BlogJet.

PASV

July 8, 2007 by Vladimir Zakharov

Coding Robots is the first Pro-Alcoholic Software Vendor

Are client applications still important?

May 31, 2007 by Dmitry

Watch and listen to what Steve Jobs and Bill Gates think about client applications vs. web applications

Continue reading: Are client applications still important? →

May 2 Snowfall

May 2, 2007 by Vladimir Zakharov

Do you think rumors about Russian weather are just urban legends? Then check out this picture made from a window of CR HQ:

IMAGE_004

There was also a drunk bear walking by in an ushanka cap and playing a bayan, but it didn’t fit in the picture