HN user

mayoff

1,839 karma

Random bits of iOS programming

Posts19
Comments349
View on HN
gamehistory.org 4mo ago

Live from GDC 1989: 21 Hours of Vintage Talks from Early Gaming Luminaries

mayoff
2pts0
sealedabstract.com 6mo ago

AI hype is 80% real

mayoff
5pts2
blog.polybdenum.com 1y ago

Designing type inference for high quality type errors

mayoff
1pts0
dukope.itch.io 1y ago

Moida Mansion by Lucas Pope

mayoff
2pts0
harihareswara.net 1y ago

“A Story About Jessica" by SwiftOnSecurity

mayoff
2pts0
buttondown.email 3y ago

I have complicated feelings about TDD

mayoff
3pts0
www.youtube.com 4y ago

FP is the new OOP [video]

mayoff
3pts0
daringfireball.net 7y ago

The Talk Show Live from WWDC 2019, with Craig Federighi and Greg Joswiak

mayoff
3pts0
developer.apple.com 8y ago

WWDC 2018 Registration now open

mayoff
1pts0
paw.princeton.edu 9y ago

In Computer Languages, Clarity Is Key

mayoff
1pts0
medium.com 9y ago

Crashes, Hangs and Crazy Images by Adding Zero: Fuzzing OpenGL Shader Compilers

mayoff
1pts0
mobile.twitter.com 9y ago

Max Howell (Swift package manager engineer, creator of homebrew) leaves Apple

mayoff
6pts1
nibblestew.blogspot.com 10y ago

Rewriting from scratch, should you do it?

mayoff
6pts1
mollyrocket.com 10y ago

Five rules for game development conferences

mayoff
1pts0
www.cbloom.com 10y ago

Library Writing Realizations

mayoff
9pts1
www.youtube.com 11y ago

Siggraph 2014: Tangible and Modular Input Device for Character Articulation

mayoff
3pts0
blogs.scientificamerican.com 14y ago

Peter Norvig on a 45-year-old article about a checkers-playing program

mayoff
226pts31
assets.mediaspanonline.com 15y ago

How to Read a Newspaper, by Walter Cronkite [pdf]

mayoff
4pts3
bit-player.org 16y ago

Analyzing fuzzy rankings of colleges

mayoff
24pts3

I’m with Casey on this: I will not buy a car without CarPlay. Of course, I haven’t bought a car since 2013. That one is a Tesla Model S and I think its UI is pretty decent for maps and playing audio, but I have rented enough cars since then to know that I would much prefer CarPlay support. If I had to replace my car today, I’d probably buy a Volvo EX90, which is the electric version of the XC90 Casey talks about.

Stateless Actors 2 months ago

This article is about actors in the Swift programming language, and I’d answer the question (“is a stateless actor pointless?”) differently: there is no such thing as a stateless actor in Swift.

Every actor in Swift conforms to the Actor protocol, which has one requirement: an instance property named `unownedExecutor`. Swift uses this property implicitly when, for example, the program calls a method on the actor from outside the actor.

https://developer.apple.com/documentation/swift/actor/unowne...

(One could also argue that, because every actor type is a reference type, every actor also has its identity as part of its state.)

In Swift (Apple’s C++ successor), the normal operators (`+`, `-`, `*`) trap on overflow for integer types. If you want twos complement wrapping, you can use `&+`, `&-`, and `&*`.

Given that Apple has been making its own CPU cores for years now, I suspect overflowing checking on Apple CPUs is virtually free (aside from code size).

The second sentence of your summary is fine, but I don’t like the first sentence:

Use your language’s type system to parse unstructured inputs.

We don’t use the type system to parse. We use the type system to provide evidence (also called a proof or a witness) that parsing was successful, and we rely on the language’s access control facilities (public/private) and the soundness of its type system to prevent fabrication of false evidence.

Quaternary search effectively performs both of the next loop iteration’s possible comparisons simultaneously with the current iteration’s comparison. This is a little more complex than simple loop unrolling.

Regardless, both kinds of search are O(log N) with different constants. The constants don’t matter so much in algorithms class but in the real world they can matter a lot.

While plenty about the iPad situation sucks, my biggest gripe is the discontinuation of the Smart Keyboard Folio. This was the one that only had a keyboard, no trackpad, but could fold all the way back, which the Magic Keyboard (with trackpad) cannot. The Smart Keyboard Folio was just the perfect form factor: there when you need it, discretely out of the way when you didn’t. And when you were using it, the iPad was perfectly balanced to sit on your lap even in cramped circumstances, which the Magic Keyboard is most definitely not.

Sure, get rid of the Magic Keyboard with its unnecessary trackpad. But bring back the Smart Keyboard Folio. It was a delight.

It's kind of crazy that the IRS (among other United States government agencies) uses ID.me for account management. The .me domain belongs to Montenegro.

Somehow Woot still has a supply of the Smart Keyboard Folio for certain 11" iPads Pro/Air.

My wife is still using an older gen 11" iPad Pro and her keyboard folio stopped working (they fall apart after a few years ), so I took a gamble and ordered one. It arrived in the original, sealed packaging. As far as I can tell, it had never been opened, and it is perfect condition and works great. My wife is very happy. I bought a second one for when this one falls apart.

https://www.amazon.com/Apple-Smart-Keyboard-11-inch-iPad-Pro...

Most of the “delivery” (getting it from the factory to its final installed location) was done by machine: forklifts, cranes, ships, trucks, and (I'm guessing) a motorized lift on the back of the delivery truck.

I don’t know if Cory Doctorow has read the “fantastic 1981 novel”, but I have (decades ago) and as I recall the plot of the book and the plot of the movie are very different from each other. The author of the book didn’t write the screenplay and I doubt he had much (if anything) to do the character designs in the movie. So even if he has the rights to his novel back, it’s not at all clear to me that he could just make (or sell a license to make) a straight, recognizable sequel to Disney’s movie without getting back into bed with Disney, and clearly Disney isn’t interested or they’d have done something by now.

Some people suffer and think "I had to go through this and I hope no one else does."

Some people suffer and think "I had to go through this so everyone else should too."

The problem is that it's easy to do it wrong and the C compiler doesn't help you. RAII prevents you from leaking the resource, but the complaint in the post is that it can be cumbersome to use RAII in C++ if acquisition can fail and you want to handle that failure.

Swift doesn't capture a stack trace in the `Error` object, but Xcode can break when an error is thrown if you set a “Swift Error Breakpoint”, and the debugger will show you the stack trace. Under the hood it just sets breakpoints on the runtime functions `swift_willThrow` and `swift_willThrowTypedImpl`.

Another really nice thing about Swift is that you have to put the `try` keyword in front of any expression that can throw. This means there's no hidden control flow: if some function call can throw, you're informed at the call site and don't have to look at the function declaration.

I hate cmake but this is something cmake does well in my experience. I had to write a Godot 4 plugin and Godot has many many header files. I made a project header that #included all the Godot headers, and a single target_precompile_headers directive in CMakeLists was enough to get it working on Mac and Linux (and I think on Windows but I didn’t need to run it on Windows).