最新发布第17页
排序
Android 模拟器访问外网
在 Android Studio 中开发应用,需要访问 google 相关服务。 模拟器访问Google 连接 AndroidWifi 在 Android 的模拟器的设置中,连接 WiFi,模拟器中 Wifi 的名称可能不一样。 连接 Wifi 设置网...
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 1 – Python 变量与数据管理
打印 Python 中的打印语句 print('Hello world!') 字符串操作 字符串连接 字符串的连接可以使用+操作符 print('Hello' + ' ' + 'world!') 字符串长度 字符串的长度计算,使用len()函数 输入函数...
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...
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...






