Since that last one fit badly in 280:

If I know I will likely run a command when a certain error message occurs, I make my script print the command along with the error message.

Like in this case the command to open FileMerge and let me update the files of a comparison test.

Any of you have cool Xcode build log tricks?

Like echo “/path/to/file:100:12: error: foo” from a script to show an error (or warning, or note).

Or print “opendiff ‘/path/fileA.txt’ ‘/path/fileB.txt’ -merge ‘/path/fileA.txt’” to copy and FileMerge files that need manual updates.

Another low-hanging fruit for diffing UIs apart from “detecting a list and don’t mark the entire line as changed if it just gained a comma at the end”:

Detect line ending changes in files. Mark if all occurences of LF are in the file and are now CRLF (or start/end with CRLF).

I wonder what Hex Fiend’s “Binary Templates (Beta)” menu item is all about. Never noticed that before, but sounds really useful… (Thinking like Resourcerer TMPLs?)

Since I just had to look it up again: For lifetime purposes, you can basically assume std::string::c_str() returns the string’s internal buffer.

So if the std::string is modified or goes out of scope/is deleted, your C-string is invalid as well. Otherwise, it is safe to use.

offing, n.: The more distant part of the sea in view.

Suddenly, that turn of phrase makes a lot more sense.

Still a bit surprised that Swift still has no thread-local variables. I really still have to use NSThread.current.threadDictionary, which means I can’t easily attach a mutable Dictionary<> or Array<> because it gets copied instead of referenced…

Um… what the hell happened with Stan Lee’s Lightspeed? The story barely makes sense. It’s as if they had a 120 minute script and had truncated it to 90.

Sudden revelation:

Nicholas Hoult would make an awesome Daniel Jackson for a Stargate reboot.

Roland Emmerich, Dean Devlin, Robert Cooper, Martin Gero, Jonathan Glassner, whoever … GET ON THAT! <3

Also cool:

Swift avoids the issues of C’s ability to accidentally “capture” the line after an “if” because it always requires {} around conditional and loop bodies.

It’s not possible to accidentally use assignment statements as conditionals (i.e. = in Swift returns Void).

Also pondering whether I should use Swift Playgrounds at the start of my tutorial.

Thinking no, as I’d like to get people to the point where they can deal with UIKit, so knowing the basics of an Xcode project helps.

OTOH Xcode is a lot of up-front explaining I could do later.

Thinking about how I’d write a Swift tutorial like my C tutorial masters-of-the-void.com - most of it gets simpler, I can pretty much throw out all my memory management advice.

But readLine() returns a String?, so I may need to cover types and optionals very early.

Does Xcode no longer show the “Enable Developer Mode” confirmation panel? I did a fresh install of Xcode on a new macOS install and it didn’t show it.

I did see it a while ago in CLion though. Is that a per-machine flag these days? Or did Xcode get special dispensation?

What would be cool for writing games in Swift would be if there was a way to declare a class and instantiate it right away. So

object jeff {}

would basically just be syntactic sugar for

class $jeff_class {} let jeff = $jeff_class()

Regarding those puzzle “aptitude tests”:

  1. It’s not what I’ll be doing in the job

  2. All they filter for is people rich enough to blow 45 minutes on busywork without being paid for it (=privileged)

  3. I would have done 3-4 tests or a coding task.

  4. I sent them an exhaustive CV including my Github link and even pointers to several of my projects that did exactly what they do right now

I miss MacOS 9 where command line apps launched as their own separate application in their own window.

Was much less frequent that I wanted to close my console window and accidentally closed my Xcode window instead.

Anyone know how one creates a bit field in Swift that works like an OptionSet in Swift and can still be used by Objective-C? I.e. something that works like I had written it in Objective-C?

Sudden Termination seems to have been implemented the wrong way round on macOS in the GUI:

The way they described it at WWDC, I thought they’d quit apps to save resources but keep the dock icon.

Instead, they’re removing the dock icon while the app is still running?

I know diff algorithms are hard, but I sure wish Git and the other differs I use recognized comma-separated lists and didn’t mark the previous line as changed just because a comma was added to allow for the next item. (Just a display change, of course it needs merging)

Anyone doing a fresh install of Xcode 10.x on a Mac with a clean macOS 10.14.x soon?

I need screen shots of the windows Xcode puts up on initial start (license, tools install etc.) and of the “Enable Developer Mode?” debugger confirmation.

(for masters-of-the-void.com)

Any Jekyll pros out there?

I’m wondering if there’s a good way to make variants of the same page and allow users to switch between them.

Like when Apple’s docs let you switch between Objective-C and Swift examples. Most of the text is the same here.

How do I do the equivalent of

[@interface](https://micro.blog/interface) Foo : NSObject
-(id) init NS_UNAVAILABLE;
-(id) initWithError: (NSError**)outError;
@end

in Swift?

class Foo: NSObject {
    private override init() {}
    init() throws { ... }
}

doesn’t work :(