@mayoff@mastodon.social

Joined April 2012
“Have you ever heard of ‘not-invented-here’ syndrome?” “Yes, but we have our own term for it.”
18
1,200
30
2,515
Swift tip for #adventofcode day 13 Paste the input into your source code, add a comma at the end of each non-empty line, conform your Message type to ExpressibleByIntegerLiteral and ExpressibleByArrayLiteral, and let the compiler do the parsing.
2
enum Message: ExpressibleByIntegerLiteral, ExpressibleByArrayLiteral { case value(Int) indirect case list([Message]) init(integerLiteral: Int) { self = .value(integerLiteral) } init(arrayLiteral: Self...) { self = .list(arrayLiteral) } }
1
let messages: [Message] = [ [1,1,3,1,1], [1,1,5,1,1], [[1],[2,3,4]], [[1],4], [9], [[8,7,6]], [[4,4],4,4], [[4,4],4,4,4], [7,7,7,7], [7,7,7], [], [3], [[[]]], [[]], [1,[2,[3,[4,[5,6,7]]]],8,9], [1,[2,[3,[4,[5,6,0]]]],8,9], ]
#adventofcode 2022 day 6 in Swift: print( input.indices .map { input[..<$0] } .first { Set($0.suffix(4)).count == 4 }! .count, input.indices .map { input[..<$0] } .first { Set($0.suffix(14)).count == 14 }! .count )
1
1
Swift tip: don't take the intersection of a Set and a String you may get the wrong answer RIP my advent of code placing tonight github.com/apple/swift/issue…
1
who called it retrocomputing and not restoration hardware
1
If you're playing @taijigame and you want to brute-force (a small number of) tiles by hand and you know a little about binary arithmetic, this is handy: stackoverflow.com/a/17493235…
1
Feeling left out by that snazzy new iPhone 14 Pro hardware? We've got you covered with the revolutionary Dynamic Peninsula™
3
Last minute Apple event predictions: - Apple will introduce the best iPhones they've ever made - Tim Cook will think we're gonna love them
2
Approximately one month until the final Xcode 14.0 build is published. Dates on which final .0 builds of Xcode were published: ⒌0 2013-09-10 ⒍0 2014-09-09 ⒎0 2015-09-16 ⒏0 2016-09-07 ⒐0 2017-09-12 ⒑0 2018-09-17 ⒒0 2019-09-16 ⒓0 2020-09-15 ⒔0 2021-09-14 ⒕0 2022-09-??
1
All problems in computer science can be solved by another level of indirection All problems in stage magic can be solved by another level of misdirection All problems in tabloid journalism can be solved by another level of indiscretion
1
1
If I tell someone how to read Unix documentation from the command line, is that mansplaining?
2
pressing the keys really hard to make sure my javascript is strongly typed
1
3
1
12
I’ve archived every question + answer from the #SwiftUI #WWDC22 Slack lounge before the channel shuts. A treasure chest of insight! I’ve categorised each answer so it’s easier to navigate. I hope you find it helpful. Thank you Apple for an epic week <3 notion.so/swiftui-lounge-wwd…
24
135
18
681
Apple treating iPadOS and tvOS the way the Professor and Mary Anne were treated in the original Gilligan's Island theme.
Rob Mayoff retweeted
Do you prefer the old style macOS alerts? There is a way to get them globally for AppKit in Big Sur and Monterey: defaults write -g NSAlertMetricsGatheringEnabled -bool false
15
56
13
242
who called it cheese and not fromagenized milk