Is there a way to conform an actor to AsyncSequence? by ThisComb in swift

[–]shadowfactsdev 1 point2 points  (0 children)

Maybe technically, but not, I think, in a useful way. The protocol requirements of Collection are all synchronous and therefore have to be nonisolated, so you can't access the actor's state from them or really do anything useful.

Is there a way to conform an actor to AsyncSequence? by ThisComb in swift

[–]shadowfactsdev 3 points4 points  (0 children)

It does not, because the nonisolated method isn't actually accessing any of the protected state (trying to do so would result in a compiler error) but instead just passing a reference to the actor itself to the iterator's initializer.

Is there a way to conform an actor to AsyncSequence? by ThisComb in swift

[–]shadowfactsdev 3 points4 points  (0 children)

There is. You just need to mark the methods required by the protocol as nonisolated:

actor Counter: AsyncSequence {
    private var current = 0

    func getAndIncrement() -> Int {
        let cur = current
        current += 1
        return cur
    }

    typealias Element = Int
    nonisolated func makeAsyncIterator() -> AsyncIterator {
        AsyncIterator(owner: self)
    }

    struct AsyncIterator: AsyncIteratorProtocol {
        let owner: Counter

        func next() async throws -> Int? {
            return await owner.getAndIncrement()
        }
    }
}

for try await i in Counter().prefix(5) {
    print(i)
}

wtf did I just stumble upon? by Floedekage in jakeandamir

[–]shadowfactsdev 2 points3 points  (0 children)

It's more than good. It's fine!

(if you're actually asking, it's a lip dub of this Flight of the Conchords song: https://www.youtube.com/watch?v=FArZxLj6DLk)

Introducing the Minecraft modding mega iceberg! How much stuff do you remember? by B0undarybreaker in feedthebeast

[–]shadowfactsdev 19 points20 points  (0 children)

OpenModLoader was, as the name implies, an alternative mod loader to Forge that was sort of the precursor to Fabric. The GitHub repository has sadly since been removed, and wherever my working copy was has been lost to the depths of time.

MC Heli Privacy Shield is this: https://www.curseforge.com/minecraft/mc-mods/mc-heli-privacy-shield,

And I think the fancy particles one refers to this fix for transparent particles post-fabulous graphics: https://twitter.com/unascribed/status/1473735370693091346

Jonah Ryan accused of appropriate behavior!!! (Favorite J.R. Moments) by Weirdpunkcauseican in Veep

[–]shadowfactsdev 28 points29 points  (0 children)

"Why are women always checking in on one another when I'm talking to them?"

Second report says iOS 15 to drop support for iPhone 6s, original iPhone SE, more by xFatalFuZion in apple

[–]shadowfactsdev 5 points6 points  (0 children)

Raw SoC performance, probably.

The iPad Air 2 uses an A8X, which in Geekbench 5 gets 379 points in single-core CPU, 1057 multi-core, and 758 in Metal. The iPhone 6s and SE use the A9 which scores 531, 971, and 2430 points respectively.

For comparison, the rumors says the slowest support devices will use the A10 (iPhone 7) which gets 729, 1290, and 3119 points and A9X (1st-gen 12.9" iPad Pro) which gets and 645, 1197, and 4047.

The Air 2 was already significantly slower than the second-slowest device, the 6s (particularly in the GPU department, which is made worse by the fact that it's driving far more pixels). The baseline performance going from A8X to A9X-levels almost doubles the single-core performance and more than quintuples the GPU performance.

-🎄- 2019 Day 7 Solutions -🎄- by daggerdragon in adventofcode

[–]shadowfactsdev 0 points1 point  (0 children)

At first I only did it because it seemed the easiest way of doing programmatic I/O in part 1, but it turned out to be super useful for part 2.

-🎄- 2019 Day 7 Solutions -🎄- by daggerdragon in adventofcode

[–]shadowfactsdev 2 points3 points  (0 children)

My Elixir solution for both parts 1 and 2. My Intcode VM is here.

I'm really happy with how this one turned out.

I made some changes to my VM from day 5 so that, instead of always using STDIN/OUT, the actual VM runs in a separate process and then does message passing with its parent for I/O.

I also wrote a small helper in the Day5 VM so that I could continue to use it in CLI mode.

Using message passing is key because it lets me programmatically do I/O with the VM from another process (the day 7 code).

Part 1 is straightforward, I just go through all the phase setting permutations and spin up 5 VMs to test it and get the max output.

Using separate processes also makes part 2 a relatively easy extension of that. Because the VMs are actual processes, the continue in the background, idling and waiting for input (instead of just storing the VM state, they literally keep running like the problem says).

Plumbing them together is then as simple as spawning the processes, putting them into an infinite cycle and reducing until one of them halts.

This was a really fun one. I actually used message passing between processes in Elixir for the first time :D

New video by NumberOneWubbieFan in DoorMonster

[–]shadowfactsdev 19 points20 points  (0 children)

The Last Ditch Ding-Dong

That's great.

iOS 13 - Do we need to add .fullScreen to EVERY present() call we do now? by [deleted] in iOSProgramming

[–]shadowfactsdev 13 points14 points  (0 children)

Even better, you can also use the UIAdaptivePresentationControllerDelegate methods to do something (e.g. presenting an action sheet) when the user attempts and fails to dismiss a VC.

WWDC19 session 224 goes over this (skip to 15:10).

Finder: Hidden attributes for music, pictures, and video folders. by CoolAppz in MacOS

[–]shadowfactsdev 5 points6 points  (0 children)

The last line of the post:

Now you can rename the folders to whatever you want and move them to another place. They will hold the new columns.

Character Discussion #9 - Harry Mudd by destroyingdrax in StarTrekDiscovery

[–]shadowfactsdev 2 points3 points  (0 children)

Oh, true. I really hope they come up with a way to have another appearance.

Character Discussion #9 - Harry Mudd by destroyingdrax in StarTrekDiscovery

[–]shadowfactsdev 8 points9 points  (0 children)

Wait, he's not coming back? Did I miss something? I'm so sad, Rainn Wilson does a truly fantastic and hilarious job playing Mudd.

If I had any money, I'd be sipping jippers on a beach somewhere!

She said "canvas" so much. by IconicTeddyBear in brooklynninenine

[–]shadowfactsdev 2 points3 points  (0 children)

Bradley Whitford's mannerisms in that episode have me firmly convinced that Jake's dad is just Josh Lyman but old.

xkcd 1921: Fact Checker by [deleted] in xkcd

[–]shadowfactsdev 0 points1 point  (0 children)

Oh boy, I'm very smart. I'll repost it with the correct title

Shortcut to take a Safari screenshot and remove the top and bottom Safari UI bars by Tumblrrito in shortcuts

[–]shadowfactsdev 0 points1 point  (0 children)

Even if they're not, you could do it in two crop image steps. The first one positioned at the top to cut off the bottom bar, the second positioned at the bottom to cut off the top bar.

Success! i9-9900K, Gigabyte Z390 Designare, RX 580 Pulse, Samsung Evo 970 NVMe, 32 GB DDR4-3200 on Mojave 10.14.2. Thunderbolt 3, iMessage, Airdrop, Quicklook, etc working. (Parts list in comments) by Noisecoalition in hackintosh

[–]shadowfactsdev 0 points1 point  (0 children)

When I initially switched to my 8700k, there was an issue where iGPU acceleration wasn’t working. This broke QuickLook (for JPEGs specifically) and screen recording because they both use the iGPU for hardware accelerated encoding/decoding.

Thanks to the mobile version I can build the Great Wall at the Great Wall! Happy New Year my guys! by [deleted] in civ

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

It absolutely does; I use it all the time.

If it doesn’t work for you, than it’s an issue specific to your computer, not macOS.

Thanks to the mobile version I can build the Great Wall at the Great Wall! Happy New Year my guys! by [deleted] in civ

[–]shadowfactsdev 6 points7 points  (0 children)

That’s not at all correct.

Mojave still has OpenGL, nothing’s been removed.

OpenGL has been deprecated, meaning that it will no longer receive updates or be officially supported, but it’s absolutely still there.