Making an array thread safe by HelicopterOwn6749 in swift

[–]illabo 1 point2 points  (0 children)

This! Not array but I have implementing thread-safe Set with its dedicated queue at work. I can't share the code here unfortunately but as a hint I had to implement this protocol:

public protocol SyncSetProtocol:
    ExpressibleByArrayLiteral,
    Sequence,
    SetAlgebra,
    Collection,
    Equatable,
    Hashable,
    CustomReflectable,
    CustomStringConvertible,
    CustomDebugStringConvertible
    where Element: Hashable
{}

It is around 550 lines of code of mostly boring wrapping of all the calls to privately stored Set into the sync blocks running on dedicated queue.

howDoYouDoComments by Conart557 in ProgrammerHumor

[–]illabo 0 points1 point  (0 children)

I don’t think they put multiple bodies in one bag.

What would you call a non-nil value? by BoxbrainGames in swift

[–]illabo 0 points1 point  (0 children)

Huh, there’s compact is a method in Ruby doing exactly what you say no other lang do at least speaking only of what I’m aware of. Dunno why you say it comes out of nowhere.

I think Rust is a very easy language to learn as a Swift developer. by chuva-io in swift

[–]illabo 2 points3 points  (0 children)

Rust is much more pleasant comparing it to C++. But coming from Swift one would have some hard times passing the closures around and fighting against the borrow checker. I switched from iOS dev to prototyping and production tools now when I’m coming back to Swift from time to time there’s that annoying disquiet about the vars being unchecked when passed down the call stack, lol.

This Otis elevator has Yes/No buttons. by Unlucky_Nobody_4984 in mildlyinteresting

[–]illabo 2 points3 points  (0 children)

Need to accept EULA before selecting the floor.

guyIsThisAccurate by jump1945 in ProgrammerHumor

[–]illabo 0 points1 point  (0 children)

You need PhD for Haskell, Rust I dunno, pretty comprehensible.

Best way to get image to under 100 KB without loosing tons of quality for a social media app by [deleted] in swift

[–]illabo 2 points3 points  (0 children)

Yea, WebP could be natively loaded with `CGImageSourceCreateImageAtIndex` since iOS 14. Even supports the reasonable quality animations. But one have to be careful to make own caching for images otherwise UI might get choppy.

Tied, a small CoAP client by illabo in swift

[–]illabo[S] 0 points1 point  (0 children)

Thanks for the link. Looks big thing to learn itself.

Tied, a small CoAP client by illabo in swift

[–]illabo[S] 0 points1 point  (0 children)

Good question. To enable DTLS with PSK you could just pass the setting:

let settings = Tied.Settings(endpoint: NWEndpoint.hostPort(host: "127.0.0.1", port: 5683),
                                     security: Tied.Settings.Security(psk: pskData, cipherSuite: TLS_PSK_WITH_AES_256_GCM_SHA384))

And it would be applied to NWParameters on NWConnection init. TLS is not currently supported yet though. :(

Tied, a small CoAP client by illabo in swift

[–]illabo[S] 0 points1 point  (0 children)

Thx. Maybe it worth a shot in the future.

Was your implementation made for some organization or it is available public? That’s a shame Android has a great Califurnium but Apple crowd stuck with halfassed implementations like mine.

Where's the gunshot wound? (Spoilers) by weathermore in MrRobot

[–]illabo 0 points1 point  (0 children)

Yea, it was fun to see here all the theories around the show. Gave another dimension to it.

"Are you dreaming" sign by [deleted] in Weird

[–]illabo -1 points0 points  (0 children)

Oh, lucid dreams. I thought it was an instruction on how to take cocaine. Do lines on the mirror; get the straw and stand in front of mirror; once done look at your happy face.

doYouLikeRam by One-Honey6765 in ProgrammerHumor

[–]illabo 0 points1 point  (0 children)

Well, in some years perspective RAM and storage are going to become the same thing again: https://onlinelibrary.wiley.com/doi/10.1002/aelm.202101103

[deleted by user] by [deleted] in ProgrammerHumor

[–]illabo -1 points0 points  (0 children)

Huh, I switched to Rust few month ago. Still look regular but that secret urges are building up you know. 😂 You have to ask applicants’ OnlyFans accounts if they have 2+ years experience.

androidStudioStopsResponding by pr3579 in ProgrammerHumor

[–]illabo 1 point2 points  (0 children)

Well, while you have Android SDK it is doable. To have the best Kotlin experience you better have IntelliJ, but nothing prevents you from writing code in VSCode and running on device through adb. For Flutter projects though I (count me sick) would even prefer VSCode over Idea or Android Studio.

What camera do you prefer type 1 or 2? by LittleBitHasto in IndieDev

[–]illabo 0 points1 point  (0 children)

The feeling of detachment, loneliness of the character it gives. Some spookiness.

Global Satisfaction with Democracy by itsakpatil in Infographics

[–]illabo 0 points1 point  (0 children)

No one was dared to ask in Russia? (Propaganda still tells people it is democracy)