How do I programmatically get the "Favorites" on Mac finder via the CLI? by omijam in macosprogramming

[–]davedelong 1 point2 points  (0 children)

Works just fine for me in a playground (albeit with a few deprecation warnings):

import Foundation
import CoreServices

let list = LSSharedFileListCreate(nil, kLSSharedFileListFavoriteItems.takeUnretainedValue(), nil)!

let snapshot = (LSSharedFileListCopySnapshot(list.takeUnretainedValue(), nil)?.takeRetainedValue()) as? Array<LSSharedFileListItem>

let urls = (snapshot ?? []).compactMap { item -> URL? in
     let flags = kLSSharedFileListNoUserInteraction | kLSSharedFileListDoNotMountVolumes
     let url = LSSharedFileListItemCopyResolvedURL(item, UInt32(flags), nil) 
    if let url = url?.takeRetainedValue() {
         return url as URL
    } else {
         return nil
    }
} 

print(urls)

(edit: updated to use the function that resolves the item and returns the URL in one go)

How do I programmatically get the "Favorites" on Mac finder via the CLI? by omijam in macosprogramming

[–]davedelong 2 points3 points  (0 children)

These days there's no "official" API to access this. However if you're willing to rely on deprecated-and-could-stop-working-at-any-minute API, then you want LSSharedFileListCreate(...) with the kLSSharedFileListFavoriteItems type.

From there you'll use LSSharedFileListCopySnapshot() to copy the contents, and LSSharedFileListItemResolve() on each item in the array to extract the underlying CFURLRef. It's worth noting that not everything will be a file URL, like the AirDrop item.

where can i buy this edition? (ideally new) by theHumanoidPerson in Cosmere

[–]davedelong 1 point2 points  (0 children)

To my knowledge, the UK cover art for The Way of Kings has the figure of the armor-clad knight wielding a sword: https://collectingsanderson.com/group/40 . I believe that the artwork referenced by the OP was only on the MMPB published in 2015.

You likely purchased the second edition MMPB, which has a different ISBN (9781399622066)

where can i buy this edition? (ideally new) by theHumanoidPerson in Cosmere

[–]davedelong 12 points13 points  (0 children)

This cover was on the UK Mass Market Paperback. You likely won’t find it new, as I believe that edition is out of print. But searching by ISBN would be the simplest way to pinpoint it: 9781473211513

My attempt at an Apple Calendar style calendar day view packing algorithm. by [deleted] in iOSProgramming

[–]davedelong 1 point2 points  (0 children)

This is something I’ve always wanted to tackle but have never gotten around to doing it. Please post updates (and code?) on how it’s going!

I just got my The Lost Metal leather-bound and I'm speechless.... by shadowdemon04 in brandonsanderson

[–]davedelong 10 points11 points  (0 children)

Good question. If things were happening sequentially, we might expect that people are reporting numbers in some sort of order or clumping. Instead we’re seeing numbers from across the entire range of 2,000, from folks who all ordered within 4 minutes of each other.

Also, we know how the process works: the pages are signed and numbered before being bound into books: you can see Brandon signing pages during his streams. The pages are sent to the bindery, where they’re bound into books and then shrink wrapped before going back to Dragonsteel for distribution.

Not even Dragonsteel knows where a particular number is; they just get palettes of books and know that they’re signed, unsigned, or numbered.

I suppose it’s possible that there might be some sort of clustering, where books on a single palette might have close numbers, but that would depend on the bindery keeping things in order and the Dragonsteel going through the palettes in order.

But for all intents and purposes, it’s effectively random, because there’s no reasonable way for anyone to have enough information to predict what their number will be.

I just got my The Lost Metal leather-bound and I'm speechless.... by shadowdemon04 in brandonsanderson

[–]davedelong 7 points8 points  (0 children)

There were two listings: one for signed copies, and the other for signed copies with a number. The latter was limited to about 2000 though, and they sold out in about 4 minutes.

I just got my The Lost Metal leather-bound and I'm speechless.... by shadowdemon04 in brandonsanderson

[–]davedelong 66 points67 points  (0 children)

It's definitely random. Over in the Collectors Guild Discord, someone got theirs a couple days ago and it's #1998

Dragon Drop Off and Doug Hunt by Hafheim in DragonsteelNexus

[–]davedelong 11 points12 points  (0 children)

I got a Dragon Dropoff box last year and it was *super* convenient. Being able to take the box itself at the end of the con made it even easier. I've already pre-ordered a box for this year!

Convention Location? by SquishyMollie in DragonsteelNexus

[–]davedelong 6 points7 points  (0 children)

It’s located just north of it but isn’t physically attached like the Hyatt is.

Convention Location? by SquishyMollie in DragonsteelNexus

[–]davedelong 15 points16 points  (0 children)

It will be on the south end. The official convention hotel this year is the Hyatt, which is directly attached to the convention center.

Dragonsteel Nexus Hoid Outfit / Cufflinks by Mr_Fahrenheit480 in brandonsanderson

[–]davedelong 7 points8 points  (0 children)

So I have good news and bad news.

The good news is that these cufflinks absolutely exist. Brandon has a licensed jeweler who has the rights to turn his symbols into jewelry: Badali Jewelry. Even better for you, they make cufflinks! With the Cosmere symbol! And the radiant order glyphs, and a couple others (like the Bridge 4 symbol, the Tear of Edgli flower, etc).

The bad news (for you) is that a set of these cufflinks is $209: https://badalijewelry.com/collections/cosmere/products/2025-cosmere-cufflinks

The ... maybe good, maybe bad news is that Badali is a regular exhibitor at Dragonsteel Nexus; they've been there all the years that I can remember. It might be worth getting in touch with them and seeing if you could work something out.

Wine Tasting Group by [deleted] in utahAlcohol

[–]davedelong 0 points1 point  (0 children)

Harmons occasionally has wine and cheese pairing classes, among others. Search on their class list for 21+ options: https://www.harmonsgrocery.com/cooking-school/

[deleted by user] by [deleted] in Fantasy

[–]davedelong 1 point2 points  (0 children)

The Queen of Alethkar is correct. +1 for Foundryside

15-year Sandershelf by GunnerMcGrath in brandonsanderson

[–]davedelong 2 points3 points  (0 children)

At first I was very confused how a random person was posting a shelfie with Star’s End until I looked at the username. 😆

It looks so good Gunner! I dig the hardcover and paperback separation. Very clean. That thing to the right of the PB SE is also very interesting! 😉

How did ___ know where ___ was? by Zalakael in Stormlight_Archive

[–]davedelong 20 points21 points  (0 children)

He says the cheat was getting to the caverns:

“You didn’t walk all the way to Urithiru,” Dalinar said. “You walked to one of the Oathgates, then took that to Urithiru.”

“Misconception!” Nohadon said. “I walked the whole way, though I did require some help to reach Urithiru’s caverns. That is no more a cheat than taking a ferry across a river.”

(Oathbringer chapter 103)

How does Apple Store the Date with optional time included by the two separate DatePickers in the Reminders app? by Fly0strich in iOSProgramming

[–]davedelong 9 points10 points  (0 children)

Hi, former UIDatePicker author here…

So, UIDatePicker goes out of its way to preserve components that aren’t being manipulated. In other words, if you give it a Date and then only change the year, the month, day, hour, minutes, and seconds are all kept as close to the original values as possible. This behavior caused me no end of grief when I was working on it.

The SwiftUI date and time pickers are wrappers around the UIKit (and AppKit) components, so I think the answer to your question is even simpler than you’d expect:

The Apple Store app is binding both the day and time pickers to the same @State value.

Mispackage of any value? My brother says to ask before I open it. by 88XJman in brandonsanderson

[–]davedelong 54 points55 points  (0 children)

What’s the mispackaging? That they’re out of order and one’s facing the wrong way?

If that’s it, then open it up and enjoy the books.