cocoa

为什么大公司要开源自己的技术?

[亡魂溺海] 提交于 2021-02-11 20:57:00
大约一个月前,谷歌公开了用于Big Transfer(BiT)的预训练模型和微调代码——Big Transfer是一种深度学习的计算机视觉模型。根据谷歌的说法,Big Transfer将允许任何人在相应的任务上达到最优表现,即使每个类只有少量的标签图片。这仅仅是这家科技巨头免费向公众开放其专有产品的一个例子。要知道,发布强大的免费开源软件已经成为科技界的常见事件,并引发了这样一个问题:大型科技公司这么做得到了什么回报? 在90年代后期,当Open Source Initiative出现时,将源代码公开的想法被认为是一个坏策略,因为专有软件是标准,公司会尽一切努力保护软件。到2020年,开源的概念发生了巨大的变化,现在已经成为主流。 如今有许多开源技术公司,其中一些公司的年收入已经超过1亿美元(甚至10亿美元),包括红帽、MongoDB、Cloudera、MuleSoft、Hashicorp、Databricks(Spark)和Confluent(Kafka)。 除了上述科技公司高调收购和投资开源项目外,谷歌和Facebook等科技巨头也把开源放到了难以置信的重要位置,因为开源对于收集新产品的创新和建立一个庞大的开发者社区非常重要。例如,Flutter vs React Native、Tensorflow vs PyTorch、Kubernetes等

Swift: @objc(…) Attribute

荒凉一梦 提交于 2021-02-11 17:10:45
问题 In Apple-generated code (Core Data NSManagedObject subclasses, for example) I see this: @objc(LPFile) public class LPFile: NSManagedObject { ... } My question is: why is the @objc declaration done as above, instead of: @objc public class LPFile: NSManagedObject { ... } or @objcMembers public class LPFile: NSManagedObject { ... } What is special about the separate @objc(identifier) declaration? I can't seem to find documentation about it and googling just turns up the other two approaches.

Swift: @objc(…) Attribute

半世苍凉 提交于 2021-02-11 17:10:12
问题 In Apple-generated code (Core Data NSManagedObject subclasses, for example) I see this: @objc(LPFile) public class LPFile: NSManagedObject { ... } My question is: why is the @objc declaration done as above, instead of: @objc public class LPFile: NSManagedObject { ... } or @objcMembers public class LPFile: NSManagedObject { ... } What is special about the separate @objc(identifier) declaration? I can't seem to find documentation about it and googling just turns up the other two approaches.

Swift: @objc(…) Attribute

ⅰ亾dé卋堺 提交于 2021-02-11 17:08:44
问题 In Apple-generated code (Core Data NSManagedObject subclasses, for example) I see this: @objc(LPFile) public class LPFile: NSManagedObject { ... } My question is: why is the @objc declaration done as above, instead of: @objc public class LPFile: NSManagedObject { ... } or @objcMembers public class LPFile: NSManagedObject { ... } What is special about the separate @objc(identifier) declaration? I can't seem to find documentation about it and googling just turns up the other two approaches.

In Catalina, `orderFront:` causes app to become the active application; how do I prevent this?

末鹿安然 提交于 2021-02-11 15:45:05
问题 I have a background "monitoring" app that runs either as an accessory or as a regular app (user choice depending on whether they want to see it in the dock). The app has several never-key utility windows ( NSPanel s) that display the progress of background tasks. When a background task starts, the window is made visible using orderFront: . This has worked great for years; the window would simply appear somewhere behind the active app. Starting in Catalina (macOS 10.15), however, orderFront:

For macOS Cocoa, how do I specify a window or a rectangle on the screen for taking a screenshot?

ε祈祈猫儿з 提交于 2021-02-11 14:10:45
问题 I have written a macOS app for measuring image files, and I wish to add a feature for capturing screenshots. I wish for it to have a user interface for doing it much like what the macOS app "Preview" has. To use its screenshot function, one does File > Take Screenshot, and one gets a submenu with these options: From Selection... From Window... From Entire Screen "From Selection..." lets you select a rectangle on the screen by clicking and dragging. "From Window..." lets you select an app

For macOS Cocoa, how do I specify a window or a rectangle on the screen for taking a screenshot?

前提是你 提交于 2021-02-11 14:09:15
问题 I have written a macOS app for measuring image files, and I wish to add a feature for capturing screenshots. I wish for it to have a user interface for doing it much like what the macOS app "Preview" has. To use its screenshot function, one does File > Take Screenshot, and one gets a submenu with these options: From Selection... From Window... From Entire Screen "From Selection..." lets you select a rectangle on the screen by clicking and dragging. "From Window..." lets you select an app

Assign Radio Group to Radio Buttons

元气小坏坏 提交于 2021-02-11 13:59:27
问题 I have several radio buttons I need to assign a radio group to it so that only one radio button is selectable at a time.There is no radio group option.I have tried Assigning a single action outlet to all buttons Putting all buttons in a custom view None of this works. 回答1: In the old days, NSMatrix was the class that provided the radio group behavior. If you look up the docs for that class, you'll find the following note: Use of NSMatrix is discouraged in apps that run in macOS 10.8 and later

Assign Radio Group to Radio Buttons

纵然是瞬间 提交于 2021-02-11 13:57:19
问题 I have several radio buttons I need to assign a radio group to it so that only one radio button is selectable at a time.There is no radio group option.I have tried Assigning a single action outlet to all buttons Putting all buttons in a custom view None of this works. 回答1: In the old days, NSMatrix was the class that provided the radio group behavior. If you look up the docs for that class, you'll find the following note: Use of NSMatrix is discouraged in apps that run in macOS 10.8 and later

Confused about Operation and OperationQueue QoS relationship

不想你离开。 提交于 2021-02-11 06:29:35
问题 The OperationQueue documentation states for the qualityOfService property: This property specifies the service level applied to operation objects added to the queue However one can simply check that this is not true by just copy & pasting the code below into a new playground. import Foundation let q = OperationQueue() q.qualityOfService = .userInitiated print("QUEUE", q.qualityOfService.rawValue) let op = BlockOperation() op.addExecutionBlock { print("OP", op.qualityOfService.rawValue) } q