Archive for April 29, 2018

Sunday, April 29, 2018

Multiple Cursors in Xcode

Daniel Martín:

For the new refactoring engine, the Xcode team developed a simple implementation for testing, but kept it disabled:

defaults write com.apple.dt.Xcode PegasusMultipleCursorsEnabled -bool true

Press Command and click/select some text and the editor will create a new cursor.

Any edits that you make are then repeated by all the cursors simultaneously. This can make certain batch changes faster and more reliable than doing them one-by-one, and for many common cases it’s easier (and requires less of a mental context switch) than writing a regular expression or script. The Xcode implementation is difficult to use in practice, though, because when Command is down, Xcode often wants to do something with the word I’m clicking on/near, rather than letting me place the cursor. Also, the edits are not bundled into undo groups the way you would expect.

Update (2018-06-04): Ole Begemann on Xcode 10:

“The Xcode Source Editor now supports multi-cursor editing allowing you to quickly edit multiple ranges of code at once.

Place additional cursors via ⌃+⇧+Click or with column select (⌥+Click+Drag), or using ⌃+⇧+Up/Down.”

Update (2018-08-02): Benjamin Mayo:

Xcode 10 multiple cursors are too good not to share.

Update (2020-11-27): Dave DeLong:

Discovered a way in #Xcode to do an “edit all” that’s not limited to declarations

  1. select the thing you want to edit
  2. press-and-hold ⌥⌘E to “select next occurrence” until everything’s selected
  3. type in the replacement; all of ‘em get changed

Update (2023-02-14): Keith Harrison:

I found myself rediscovering Xcode’s multi-cursor support this week. Here’s a reminder in case you need it.

30 Years of Frontier

Dave Winer:

My goal was to create an environment I would work in for the rest of my career. I just realized it’s exactly 30 years later, and I’m still using it.

[…]

Now that I also work in JavaScript, it amazes me how easy the simple things are in Frontier, compared to JS, esp when you have to tack on a database. You really have to work at seeing what’s going on. In Frontier, you just click around expanding things. You can even look at the runtime stack that way.

John Gruber:

If you never used Frontier, it’s hard to explain what made it so special. My very favorite thing about Frontier is the “object database”. It wasn’t like using a database in the SQL sense. It was just persistent storage.

James Thomson:

Douglas Adams asked me to add support for running Frontier scripts in DragThing about twenty years ago, and I did, because he was Douglas Adams.

Hamish Sanderson:

Automatic props to @mattneub, whose Frontier, The Definitive Guide is published online here for those that’d like to learn more[…]

It’s an excellent book.

Brent Simmons:

For the past few days I’ve been working on adding Frontier-like object database (ODB) support to my database framework.

Previously: Congratulations.

Swift for TensorFlow, Released

TensorFlow (Hacker News):

We have released Swift for TensorFlow as an open-source project on GitHub!

Our documentation repository contains a project overview and technical papers explaining specific areas in depth. There are also instructions for installing pre-built packages (for macOS and Ubuntu) as well as a simple usage tutorial.

Moving forward, we will use an open design model and all discussions will be public.

Marcin Krzyzan:

Google forked Swift to make it compatible with TensorFlow because they can.

Last time Google forked Apple codebase was what... WebKit to build Chrome? I hope it’s not a trend now.

Chris Lattner:

We are not interested in producing a long term fork, we aim to work with the Swift community to get everything upstream.

Jameson Toole:

Don’t mistake Swift for TensorFlow as a simple wrapper around TensorFlow to make it easier to use on iOS devices. It’s much more than that. This project is an attempt to change the default tools used by the entire machine learning and data science ecosystem.

[…]

The inability of Python to be an end-to-end language in a world dominated by machine learning and edge computing is the motivation behind Swift for TensorFlow. Chris Lattner makes the case that Python, with its dynamic typing and interpreter, can’t take us any further. In his words, engineers need a language that treats machine learning as a “first class citizen”. And while he lays out deeply technical reasons why a new approach to compiler analysis is necessary to change the way programs using TensorFlow are built and executed, the most compelling points of his argument focus on the experience of those doing the programming.

Previously: Swift for TensorFlow.

Update (2018-05-14): Chris Lattner:

Super excited that the Swift for TensorFlow compiler changes are moving into the main swift.org github repository.

Pre-Announcing AirPower

Nick Heer:

Imagine an alternate universe where the AirPower and the wireless charging case for the AirPods weren’t announced until, say, the opening keynote of WWDC this year with same-day availability. Sure, buyers of iPhones and Apple Watches that were released last year would have to suffer through several tedious months of wondering why Apple didn’t make their own charging pad because many of the ones out there right now aren’t very good, but the reaction to its then-immediate availability would have been a classic example of underpromising and overdelivering.

Instead, people are disappointed, and Apple looks bad.

Update (2018-05-01): Nick Heer:

One thing everyone seems to be getting wrong about the AirPower mat is that it is late or delayed. It isn’t. Schiller promised “2018”. The only reference to “early 2018” was in a couple of ads.