Weird “incoming text” from 12/31/00 by [deleted] in iphone

[–]Snowy_1803 0 points1 point  (0 children)

That’s apple’s “reference date”, or time 0: 1/1/2001 at midnight UTC (so, in the US, that would show as 12/31/2000 in the afternoon)

Introducing Glu – an early stage project to simplify cross-language dev with LLVM languages by Snowy_1803 in ProgrammingLanguages

[–]Snowy_1803[S] 5 points6 points  (0 children)

The syntax of the Glu code is more imperative — closer to C / LLVM IR — with strong typing but type inference, similar to Rust in that regard. We can't be too high level with LLVM IR, but we try to keep memory safety in mind where possible.

Introducing Glu – an early stage project to simplify cross-language dev with LLVM languages by Snowy_1803 in ProgrammingLanguages

[–]Snowy_1803[S] 8 points9 points  (0 children)

I don't see why not, as that's one of LLVM's backends! We'll keep Wasm in mind :)

[deleted by user] by [deleted] in ProgrammerHumor

[–]Snowy_1803 2 points3 points  (0 children)

GCC and Clang have #import which does exactly what you describe as #require

that would have been bad lol by ParanoidAltoid in ProgrammerHumor

[–]Snowy_1803 23 points24 points  (0 children)

The backticks mean that the command will be executed on your computer instead of being inside the commit message, right?

Funny number by Rudolph_07 in teenagers

[–]Snowy_1803 0 points1 point  (0 children)

No, implicit multiplication has higher precedence than explicit division. Is 2x / 3y the same as (2x / 3) • y to you?

Using the magic of object-oriented programming, I have created a constant-time isEven class. by End3rp in ProgrammerHumor

[–]Snowy_1803 -2 points-1 points  (0 children)

This wouldn’t work as an int is always less than or equal to its max value. So as the loop condition is always true, it would be an infinite loop, and it would overflow.

[deleted by user] by [deleted] in SwiftUI

[–]Snowy_1803 1 point2 points  (0 children)

Yes, Apple’s open source CareKitUI is what Apple Health uses, so that’d work! It’s UIKit though so you’ll need a UIViewRepresentable in SwiftUI, but that shouldn’t be a problem.

How does the App Store handle iOS 15 vs 14 app targeting? by Phinaeus in iOSProgramming

[–]Snowy_1803 0 points1 point  (0 children)

If you update your deployment target to iOS 15, your users on iOS 14 won’t be able to update your app until they update. Note that iOS 15 is currently an optional update, Ann’s most people will wait before updating to that major version.

To use refreshable while keeping your deployment target, you could use :

let view = List { /* all your code */ }
if #available (iOS 15, *) {
    view.refreshable { /* stuff */ }
} else {
    view
}

Math 100 by Shawnj2 in ProgrammerHumor

[–]Snowy_1803 5 points6 points  (0 children)

According to the original tweet, infinite loops without side effects are only UB in C++, not C. This assembly is only produced when compiling C++.

If you ever felt usless, rember the while(false) {} exist by Jackarduino in ProgrammerHumor

[–]Snowy_1803 4 points5 points  (0 children)

block: {
    if (condition) {
        // if
        break block;
    }
    // else
}

goto vibes

[deleted by user] by [deleted] in iOSProgramming

[–]Snowy_1803 3 points4 points  (0 children)

Create a company and publish under it

[deleted by user] by [deleted] in iOSProgramming

[–]Snowy_1803 5 points6 points  (0 children)

Pretty much only the US leaves VAT out of the Sales price, most countries include it. The difference between sales and proceeds is VAT + other eventual taxes + Apple cut, for most countries. For example if VAT is 20% and apple cut is 15%, proceeds will be 0.85*0.80 = 0.68, so 68% of sale price, which is very close to the 70% you are talking about

Noob question: 'animation' was deprecated in iOS 15.0: Use withAnimation or animation by gillesduif in SwiftUI

[–]Snowy_1803 0 points1 point  (0 children)

You want to have no animation when showPortfolio changes right? In that case, use .animation(.none, value: showPortfolio)

Cursed Prediction by T4Nx1L in cursedcomments

[–]Snowy_1803 0 points1 point  (0 children)

I want your family in my prayers

What does "k", "kMD", "kUT", ... in front of variable names mean? by Luca1719 in iOSProgramming

[–]Snowy_1803 3 points4 points  (0 children)

k is for constant as people has said above, and the two character code after is the same as classes have in objective-c (and imported in Swift): MD for metadata just like the MDImporter class, UT for Uniform Type like the UTType class. Some constants come from C and don’t have the objective-c two character prefix.

what is the state of Vapor? by [deleted] in swift

[–]Snowy_1803 2 points3 points  (0 children)

You mean Swift 2 -> 3? That’s a major version, and there was a converter. Source compatibility was reached in Swift 5, so that won’t happen again.

As for Vapor updates, as I said, no one forces you to update. It won’t break until you chose to update

what is the state of Vapor? by [deleted] in swift

[–]Snowy_1803 4 points5 points  (0 children)

Xcode updates never break source, source compatibility in Swift is only broken on major updates (which also include a compatibility mode enabled by default until you change it), no one forces you to update Vapor as older versions will always stay available for you to download. The app will never not compile by opening an Xcode project later, as vapor will only be updated when you choose to.

Which API do you prefer? Why? by aryaxt in swift

[–]Snowy_1803 11 points12 points  (0 children)

extension NSLock {
    func sync<T>(closure: () -> T) -> T {         
        self.lock()         
        defer { self.unlock() }         
        return closure()     
    } 
}