最新发布第25页
排序
Docker 部署 Ollama
安装 ollama这里采用 docker 进行 ollama 的部署。部署支持 CPU 也支持 GPU, 详情参考https://hub.docker.com/r/ollama/ollama。这里采用 CPU 的安装模式,安装命令如下docker run -d -v /opt/...
Day 2 – 理解数据类型和字符串操作
基本数据类型 String 字符串下标 字符串的下标 Subscripting可以提取字符串特定位置的字符。 # 提取第一个字符 print('Hello'[0]) # H # 提取最后一个字符 print('Hello'[len('Hello') - 1]) # ...
Day 13 – 调试 Debugging
代码调试中的几种方法以及建议。 描述问题,代码执行的目的是什么,实现的流程是什么 复现问题,调试 Bug 的前提 Play Computer,能够像计算机一样逐行浏览代码,以便找出问题所在。 修复错误,...
更新数据
在 SwiftData 中更新数据非常简单,默认情况会自动保存,无需手动调用保存操作。以下示例演示了创建一个 Student模型,并获取模型的数据进行更新,数据将自动保存: @Model class Student { var...
How to handle different result types in a task group 如何处理任务组中的不同结果类型
Each task in a Swift task group must return the same type of data as all the other tasks in the group, which is often problematic – what if you need one task group to handle ...
Is it efficient to create many tasks? 创建许多任务是否有效?
Previously I talked about the concept of thread explosion, which is when you create many more threads than CPU cores and the system struggles to manage them effectively. Howev...
Data Class 数据类
Kotlin 中的 数据类(data class) 是一种用于只存数据的类,能够自动生成常用的函数。 equals() hashCode() toString() copy() 语法 data class ClassName( val prop: Type, var prop2: Type )...
Docker 容器与主机间文件/文件夹拷贝
Docker 容器与主机之间文件或者文件夹的拷贝是经常遇到的场景。Docker 提供了docker up 命令,可以轻松实现容器与主机之间文件或者文件夹的拷贝。docker cp命令语法docker cp命令的基本语法,如...







