最新发布第22页
OpenCV 打开图片并显示-Stewed Noodles 资源

OpenCV 打开图片并显示

OpenCV 的基本使用: 引入 OpenCV 库 : import cv2 调用 OpenCV API 代码示例 # 使用OpenCV打开图片,并显示图片 import cv2 # 读取图片 image = cv2.imread('flow.jpg') # 显示图片 # 第一个参...
CardView-Stewed Noodles 资源

CardView

用于通过带有圆角布局和特定阴影效果来显示各种数据。CardView 可以用于创建 ListView 或 RecyclerView 中的条目布局。 创建CardView 1. CardView 条目布局 一个用于表示 RecyclerView 中单个条...
Property Delegation-Stewed Noodles 资源

Property Delegation

在 Kotlin 中,属性代理(Property Delegation)允许将一个属性 getter 和 setter 的实现委托给另一个对象(委托的对象)。 这项特性的标志就是关键字 by,它被用在 属性定义 与 委托(代理)对...
observeAsState-Stewed Noodles 资源

observeAsState

observeAsState 是 Jetpack Compose 中用于 将 LiveData 转换为 Compose 可观察状态(State) 的扩展函数。 作用让 LiveData 的变化自动触发Compose UI 重组。 基本用法 // 无默认值 val user b...
Hilt 框架-Stewed Noodles 资源

Hilt 框架

Hilt 是 Google 官方推荐的 Android 依赖注入(DI)框架,基于 Dagger,极大简化了配置和使用成本,减少样板代码,与 ViewModel / Activity / Fragment / Service 深度集成,可以自动管理依赖生...
Day 7 - 猜单词游戏-Stewed Noodles 资源

Day 7 – 猜单词游戏

猜单词游戏的基本业务流程如下所示 生成单词,检测答案 生成随机单词,并检测用户输入的单词是否在选定的单词中 import random word_list = ['aardvark', 'baboon', 'camel'] chosen_word = ran...
How to manipulate an AsyncSequence using map(), filter(), and more 如何使用 map()、filter() 等作 AsyncSequence-Stewed Noodles 资源

How to manipulate an AsyncSequence using map(), filter(), and more 如何使用 map()、filter() 等作 AsyncSequence

AsyncSequence has implementations of many of the same methods that come with Sequence, but how they operate varies: some return a single value that fulfills you...
How to create and use task local values 如何创建和使用任务本地值-Stewed Noodles 资源

How to create and use task local values 如何创建和使用任务本地值

Swift lets us attach metadata to a task using task-local values, which are small pieces of information that any code inside a task can read.Swift 允许我们使用 task-local ...
How to handle concurrency errors in unit tests 如何处理单元测试中的并发错误-Stewed Noodles 资源

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...
Live Data-Stewed Noodles 资源

Live Data

基本介绍 LiveData 是一个可观察的数据持有类。与普通的可观察对象不同,LiveData 具备生命周期感知能力,也就是说它会遵循应用中其他组件(如 Activity、Fragment 或 Service)的生命周期。 这...