Show more

Nice little glitch in Assassin’s Creed: Odyssey: The NPCs on the road and your horse use the same pathfinding algorithm, which means when you tell it to take you to a map location, it will mow down any and all pedestrians on its way XD

I really wish a resettable lazy property was a thing in Swift.

Forgot to remember a result in C++ and realized that couldn’t have happened in Swift three times over: 1. The method would have needed @ discardableResult, 2. init would have complained about the un-initialized property, 3. using the property would have complained about NIL.

TIL about Swift’s Unmanaged.passUnretained(self).toOpaque() for interacting with C APIs, and about the &+= operator (overflow operator) and its friends. (docs.swift.org/swift-book/Lang)

Anyone know how to correctly implement async Publisher + Subscriber in Combine (so pushes instead of pulls)? I have a ThingManager I can subscribe to and it’ll call a closure I provide. Is this the right way? gist.github.com/uliwitness/394

Template parameters in Swift error messages always look like a surprised grave digger. Whoever came up with that syntax, thanks for the smiles:

ObjectBox.Box<τ_0_0>

Hey, if I have a framework that does iOS 12 stuff, and I want to add one class/extension to it only for iOS 13, which uses 13-only API, can I do that without making the extension its own framework?

Like if but around a class?

I remember learning about linked lists because that’s how you searched for a particular window on classic macOS. They’re a fun and fairly straightforward concept if you know pointers.

That said, I’m happy i don’t need to use them in my day-to-day work anymore.

Anyone ever made their own wristwatch out there? Preferentially a wearable really dumb computer with always-on display and battery time of at least 3 days? Also with a decent built-in clock?

Anyone know where to start? Are there tiny mainboards that fit that bill?

Wasn’t aware that, in C++

Foo myVar = myMakeFoo();

will not call any copy constructors, move constructors or assignment operator overloads. Looks like myVar’s address is just passed into myMakeFoo() as the return value address and constructed in place w/o copying. Clever!

So given Combine is coming up (but will take a few years to trickle down), what would you use in Swift if you had to notify clients of changes in your object today?

Imagine you have class Lazy<A> {} and a class Other<B> {}, and want to add an extension to any to Lazy<Other<B>>, you can declare an OtherProtocol and make Other conform (“tag” Other with that protocol), and then extension Lazy<A: OtherProtocol> {}

Just saw an @Ignore annotation in some Java tests. This actually sounds like a handy way to keep institutional knowledge: Write tests for things you’ve deemed unimportant for this release, mark them ignored, then later have a reminder how this was intended to work.

I love “The Good Witch”. It’s sappy and has a tiny hint of fantasy that you can ignore if you want to. Also, Catherine Bell, James Denton, Catherine Disher and Peter MacNeill.

I only just realized that you can use protocols as tags on arbitrary classes. Not unlike how some people use template arguments as tags in C++.

I only just learned about xclangspec files for Xcode:

github.com/RobotsAndPencils/st

Apparently just in time to see Xcode 11 dropping support for them. I guess LSP is the way forward? If Xcode 11 supports third-party LSP servers, that is.

GDPR door-slam, noun: Making your users traverse more than 3 links to even get to a screen that lets them turn off tracking.

If your site doesn’t show me an “off” switch by page 3, I’m leaving and never coming back.

Looking at you, Oath/TechCrunch/Tumblr.

C++’s

noexcept(false)

is some of the worst wording I have to use regularly. Have to look it up each time. Especially given there is also nothrow(). Why isn’t it throws(…) or so?

Neat thing about tests: Sometimes you go to write a test to verify that a failure is graceful, and in the process figure out a ridiculously simple way to actually make it no longer fail.

Show more
Mastodon for Tech Folks

This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either! We adhere to an adapted version of the TootCat Code of Conduct and have documented a list of blocked instances. Ash is the admin and is supported by Fuzzface, Brian!, and Daniel Glus as moderators. Hosting costs are largely covered by our generous supporters on Patreon – thanks for all the help!