最新发布第17页
排序
Composable
在 Jetpack Compose 中,每一个 UI 元素都是通过一个带有 @Composable 注解的函数构建的,例如: @Composable fun Greeting(name: String) { Text(text = 'Hello $name') } 只要一个函数前加了 ...
macOS Python 多版本管理
安装 Homebrew Homebrew 的官网 https://brew.sh/ 在终端输入以下命令进行安装 /bin/bash -c '$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)' 安装完成后...
Day 9 – 字典与嵌套
字典 基本语法 字典是由键值对组成,基本的语法如下 {key1:value1, key2: value2, ...} 示例 # 字典示例 colors = { 'apple': 'red', 'pear': 'green', 'banana': 'yellow' } 基本使用 字典的基...
Day 21 – 贪吃蛇(下)
类继承 从现有类继承行为和外观的过程成为类继承。这里的行为和外观分别为类的方法和属性。类继承可以对现有的类进行属性以及方法的扩展。 # Fish类 class Fish: def __init__(self): '''初始化...
一对多关系
一对多关系是 SwiftData 中最常见的关系类型,当关系的一方有一个数据数组,而另一方是可选时,会自动创建这种关系。 例如,我们可以说每个学生属于一个班级,而每个班级有很多学生 @Model clas...
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...
Important: Do not use an actor for your SwiftUI data models 重要提示:请勿将角色用于 SwiftUI 数据模型
Swift’s actors allow us to share data in multiple parts of our app without causing problems with concurrency, because they automatically ensure two pieces of code cannot...
How to handle concurrency errors in unit tests 如何处理单元测试中的并发错误
Both Swift Testing and XCTest give us three main options for handling errors in tests: we can consider them immediate failures, we can handle them internally and make our own asser...
php 8.2 安装fileInfo扩展
在 Centos 7中安装 php 8.2 的 fileInfo 扩展,宝塔面板安装的过程中会出现错误 宝塔面板安装 fileInfo 报错 解决方法如下 # 打开目录 cd /www/server/php/82/src/ext/fileinfo/ # 生成编译配置...






