What is an actor and why does Swift have them? 什么是 actor,为什么 Swift 有它们?
Swift’s actors are conceptually like classes that are safe to use in concurrent environments. This safety is made possible because Swift automatically ensures no two pieces of cod...
What’s the difference between actors, classes, and structs? Actors、Classes和 Structs 之间有什么区别?
Swift provides four concrete nominal types for defining custom objects: actors, classes, structs, and enums. Each of these works a little differently from the others, but the first...
How to download JSON from the internet and decode it into any Codable type 如何从 Internet 下载 JSON 并将其解码为任何 Codable 类型
Fetching JSON from the network and using Codable to convert it into native Swift objects is probably the most common task for any Swift developer, usually followed by dis...
Word 隐藏所有回车换行符
Windows 系统下,按 Ctrl + Shift + 8 可以快速显示或隐藏所有格式标记,包括回车符(¶)。 macOS 系统下,视图 -> 显示段落标 中,取消勾选。
巡检计划巡检状态选项添加颜色
列表页面添加 在 index.vue 中添加,如下的代码 <!-- 巡检计划状态添加颜色显示 --> <template v-if='column.leapKey === 'select' && column.prop === 'inspectionPlanStatus''>...
Windows 安装 Dify
软硬件要求硬件: CPU >= 2Core ; RAM >= 4GiB软件: 操作系统 Windows with WSL 2 enabled; Docker DesktopWSL 2 仅在 Windows 11 或 Windows 10 版本 1903、内部版本 18362 或更高版本中...
Docker 部署 Ollama
安装 ollama这里采用 docker 进行 ollama 的部署。部署支持 CPU 也支持 GPU, 详情参考https://hub.docker.com/r/ollama/ollama。这里采用 CPU 的安装模式,安装命令如下docker run -d -v /opt/...
Day 12 – 作用域 Scope
Python 没有块级作用域(Block Scope),只有局部作用域以及全局作用域。 局部作用域 在函数中声明的变量(或函数)具有局部作用域(也称为函数作用域)。它们只能被同一代码块中的其他代码看到...
Day 17 – 自定义类(Class)
自定义类 类定义的语法,如下 # 类的定义, ClassName必须首字母大写 class ClassName: # 类的对象 class_name_1 = ClassName() 常见的几种命名方式- PascalCase - camelCase - snake_case 构造...
Sending data safely across actor boundaries 跨参与者边界安全地发送数据
Swift tries to ensure access to shared data is done safely, partly through types such as actors, and partly through a concept of sendability implemented through the ...