当前位置: 首页 > news >正文

Rust更换Cargo国内源,镜像了寂寞

换皮不换身

换了国内源,构建时该卡还会卡。因为它所谓的换源,只是更换crates.io“索引”的源,而不是package“内容”的源。换了国内源后,在国内编译时访问 crates.io-index 自然会快很多,可是crates.io-index里面的信息含量本身就不多,主要是package名称/版本/依赖/特性等,Cargo还要去crates.io网站查询指定package的下载地址,而下载地址也是指向crates.io网站的。最终网络访问瓶颈还是境外的crates.io网站。

换国内源

清华

https://mirrors.tuna.tsinghua.edu.cn/help/crates.io-index.git/

清华大学开源软件镜像站,Rust crates.io 索引镜像使用帮助:
编辑 $CARGO_HOME/config 文件,添加以下内容:

[source.crates-io]
replace-with = 'mirror'[source.mirror]
registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git"

Rust Crates 实践指南 - The Guide to Rust Crates

https://mirrors.gitcode.host/zzy/rust-crate-guide/4-cargo/4.1-source-replacement.html

创建 $HOME/.cargo/config 文件(各操作系统及版本均大致相同),然后在 config 文件内写入下述配置内容:

[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
# 指定镜像
replace-with = '镜像源名' # 如:tuna、sjtu、ustc,或者 rustcc# 注:以下源配置一个即可,无需全部# 中国科学技术大学
[source.ustc]
registry = "git://mirrors.ustc.edu.cn/crates.io-index"# 上海交通大学
[source.sjtu]
registry = "https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index"# 清华大学
[source.tuna]
registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git"# rustcc社区
[source.rustcc]
registry = "https://code.aliyun.com/rustcc/crates.io-index.git"

查询 crates.io-index

https://github.com/rust-lang/crates.io-index/blob/master/to/ki/tokio

// ingore old vertions ...
{"name":"tokio","vers":"1.30.0","deps":[{"name":"async-stream","req":"^0.3","features":[],"optional":false,"default_features":true,"target":null,"kind":"dev"},{"name":"backtrace","req":"^0.3.58","features":[],"optional":false,"default_features":true,"target":"cfg(tokio_taskdump)","kind":"normal"},{"name":"bytes","req":"^1.0.0","features":[],"optional":true,"default_features":true,"target":null,"kind":"normal"},{"name":"futures","req":"^0.3.0","features":["async-await"],"optional":false,"default_features":true,"target":null,"kind":"dev"},{"name":"libc","req":"^0.2.145","features":[],"optional":true,"default_features":true,"target":"cfg(unix)","kind":"normal"},{"name":"libc","req":"^0.2.145","features":[],"optional":false,"default_features":true,"target":"cfg(unix)","kind":"dev"},{"name":"loom","req":"^0.7","features":["futures","checkpoint"],"optional":false,"default_features":true,"target":"cfg(loom)","kind":"dev"},{"name":"mio","req":"^0.8.6","features":[],"optional":true,"default_features":false,"target":null,"kind":"normal"},{"name":"mio-aio","req":"^0.7.0","features":["tokio"],"optional":false,"default_features":true,"target":"cfg(target_os = \"freebsd\")","kind":"dev"},{"name":"mockall","req":"^0.11.1","features":[],"optional":false,"default_features":true,"target":null,"kind":"dev"},{"name":"nix","req":"^0.26","features":["fs","socket"],"optional":false,"default_features":false,"target":"cfg(unix)","kind":"dev"},{"name":"num_cpus","req":"^1.8.0","features":[],"optional":true,"default_features":true,"target":null,"kind":"normal"},{"name":"parking_lot","req":"^0.12.0","features":[],"optional":true,"default_features":true,"target":null,"kind":"normal"},{"name":"pin-project-lite","req":"^0.2.11","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"rand","req":"^0.8.0","features":[],"optional":false,"default_features":true,"target":"cfg(not(all(target_family = \"wasm\", target_os = \"unknown\")))","kind":"dev"},{"name":"signal-hook-registry","req":"^1.1.1","features":[],"optional":true,"default_features":true,"target":"cfg(unix)","kind":"normal"},{"name":"socket2","req":"^0.5.3","features":["all"],"optional":true,"default_features":true,"target":"cfg(not(target_family = \"wasm\"))","kind":"normal"},{"name":"socket2","req":"^0.5.3","features":[],"optional":false,"default_features":true,"target":"cfg(not(target_family = \"wasm\"))","kind":"dev"},{"name":"tempfile","req":"^3.1.0","features":[],"optional":false,"default_features":true,"target":"cfg(not(target_family = \"wasm\"))","kind":"dev"},{"name":"tokio-macros","req":"~2.1.0","features":[],"optional":true,"default_features":true,"target":null,"kind":"normal"},{"name":"tokio-stream","req":"^0.1","features":[],"optional":false,"default_features":true,"target":null,"kind":"dev"},{"name":"tokio-test","req":"^0.4.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"dev"},{"name":"tracing","req":"^0.1.25","features":["std"],"optional":true,"default_features":false,"target":"cfg(tokio_unstable)","kind":"normal"},{"name":"wasm-bindgen-test","req":"^0.3.0","features":[],"optional":false,"default_features":true,"target":"cfg(all(target_family = \"wasm\", not(target_os = \"wasi\")))","kind":"dev"},{"name":"windows-sys","req":"^0.48","features":[],"optional":true,"default_features":true,"target":"cfg(windows)","kind":"normal"},{"name":"windows-sys","req":"^0.48","features":["Win32_Foundation","Win32_Security_Authorization"],"optional":false,"default_features":true,"target":"cfg(windows)","kind":"dev"}],"cksum":"2d3ce25f50619af8b0aec2eb23deebe84249e19e2ddd393a6e16e3300a6dadfd","features":{"default":[],"fs":[],"full":["fs","io-util","io-std","macros","net","parking_lot","process","rt","rt-multi-thread","signal","sync","time"],"io-std":[],"io-util":["bytes"],"macros":["tokio-macros"],"net":["libc","mio/os-poll","mio/os-ext","mio/net","socket2","windows-sys/Win32_Foundation","windows-sys/Win32_Security","windows-sys/Win32_Storage_FileSystem","windows-sys/Win32_System_Pipes","windows-sys/Win32_System_SystemServices"],"process":["bytes","libc","mio/os-poll","mio/os-ext","mio/net","signal-hook-registry","windows-sys/Win32_Foundation","windows-sys/Win32_System_Threading","windows-sys/Win32_System_WindowsProgramming"],"rt":[],"rt-multi-thread":["num_cpus","rt"],"signal":["libc","mio/os-poll","mio/net","mio/os-ext","signal-hook-registry","windows-sys/Win32_Foundation","windows-sys/Win32_System_Console"],"stats":[],"sync":[],"test-util":["rt","sync","time"],"time":[]},"yanked":false,"rust_version":"1.63"}
{"name":"tokio","vers":"1.31.0","deps":[{"name":"async-stream","req":"^0.3","features":[],"optional":false,"default_features":true,"target":null,"kind":"dev"},{"name":"backtrace","req":"^0.3.58","features":[],"optional":false,"default_features":true,"target":"cfg(tokio_taskdump)","kind":"normal"},{"name":"bytes","req":"^1.0.0","features":[],"optional":true,"default_features":true,"target":null,"kind":"normal"},{"name":"futures","req":"^0.3.0","features":["async-await"],"optional":false,"default_features":true,"target":null,"kind":"dev"},{"name":"libc","req":"^0.2.145","features":[],"optional":true,"default_features":true,"target":"cfg(unix)","kind":"normal"},{"name":"libc","req":"^0.2.145","features":[],"optional":false,"default_features":true,"target":"cfg(unix)","kind":"dev"},{"name":"loom","req":"^0.7","features":["futures","checkpoint"],"optional":false,"default_features":true,"target":"cfg(loom)","kind":"dev"},{"name":"mio","req":"^0.8.6","features":[],"optional":true,"default_features":false,"target":null,"kind":"normal"},{"name":"mio-aio","req":"^0.7.0","features":["tokio"],"optional":false,"default_features":true,"target":"cfg(target_os = \"freebsd\")","kind":"dev"},{"name":"mockall","req":"^0.11.1","features":[],"optional":false,"default_features":true,"target":null,"kind":"dev"},{"name":"nix","req":"^0.26","features":["fs","socket"],"optional":false,"default_features":false,"target":"cfg(unix)","kind":"dev"},{"name":"num_cpus","req":"^1.8.0","features":[],"optional":true,"default_features":true,"target":null,"kind":"normal"},{"name":"parking_lot","req":"^0.12.0","features":[],"optional":true,"default_features":true,"target":null,"kind":"normal"},{"name":"pin-project-lite","req":"^0.2.11","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"rand","req":"^0.8.0","features":[],"optional":false,"default_features":true,"target":"cfg(not(all(target_family = \"wasm\", target_os = \"unknown\")))","kind":"dev"},{"name":"signal-hook-registry","req":"^1.1.1","features":[],"optional":true,"default_features":true,"target":"cfg(unix)","kind":"normal"},{"name":"socket2","req":"^0.5.3","features":["all"],"optional":true,"default_features":true,"target":"cfg(not(target_family = \"wasm\"))","kind":"normal"},{"name":"socket2","req":"^0.5.3","features":[],"optional":false,"default_features":true,"target":"cfg(not(target_family = \"wasm\"))","kind":"dev"},{"name":"tempfile","req":"^3.1.0","features":[],"optional":false,"default_features":true,"target":"cfg(not(target_family = \"wasm\"))","kind":"dev"},{"name":"tokio-macros","req":"~2.1.0","features":[],"optional":true,"default_features":true,"target":null,"kind":"normal"},{"name":"tokio-stream","req":"^0.1","features":[],"optional":false,"default_features":true,"target":null,"kind":"dev"},{"name":"tokio-test","req":"^0.4.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"dev"},{"name":"tracing","req":"^0.1.25","features":["std"],"optional":true,"default_features":false,"target":"cfg(tokio_unstable)","kind":"normal"},{"name":"wasm-bindgen-test","req":"^0.3.0","features":[],"optional":false,"default_features":true,"target":"cfg(all(target_family = \"wasm\", not(target_os = \"wasi\")))","kind":"dev"},{"name":"windows-sys","req":"^0.48","features":[],"optional":true,"default_features":true,"target":"cfg(windows)","kind":"normal"},{"name":"windows-sys","req":"^0.48","features":["Win32_Foundation","Win32_Security_Authorization"],"optional":false,"default_features":true,"target":"cfg(windows)","kind":"dev"}],"cksum":"40de3a2ba249dcb097e01be5e67a5ff53cf250397715a071a81543e8a832a920","features":{"default":[],"fs":[],"full":["fs","io-util","io-std","macros","net","parking_lot","process","rt","rt-multi-thread","signal","sync","time"],"io-std":[],"io-util":["bytes"],"macros":["tokio-macros"],"net":["libc","mio/os-poll","mio/os-ext","mio/net","socket2","windows-sys/Win32_Foundation","windows-sys/Win32_Security","windows-sys/Win32_Storage_FileSystem","windows-sys/Win32_System_Pipes","windows-sys/Win32_System_SystemServices"],"process":["bytes","libc","mio/os-poll","mio/os-ext","mio/net","signal-hook-registry","windows-sys/Win32_Foundation","windows-sys/Win32_System_Threading","windows-sys/Win32_System_WindowsProgramming"],"rt":[],"rt-multi-thread":["num_cpus","rt"],"signal":["libc","mio/os-poll","mio/net","mio/os-ext","signal-hook-registry","windows-sys/Win32_Foundation","windows-sys/Win32_System_Console"],"stats":[],"sync":[],"test-util":["rt","sync","time"],"time":[]},"yanked":false,"rust_version":"1.63"}
{"name":"tokio","vers":"1.32.0","deps":[{"name":"async-stream","req":"^0.3","features":[],"optional":false,"default_features":true,"target":null,"kind":"dev"},{"name":"backtrace","req":"^0.3.58","features":[],"optional":false,"default_features":true,"target":"cfg(tokio_taskdump)","kind":"normal"},{"name":"bytes","req":"^1.0.0","features":[],"optional":true,"default_features":true,"target":null,"kind":"normal"},{"name":"futures","req":"^0.3.0","features":["async-await"],"optional":false,"default_features":true,"target":null,"kind":"dev"},{"name":"libc","req":"^0.2.145","features":[],"optional":true,"default_features":true,"target":"cfg(unix)","kind":"normal"},{"name":"libc","req":"^0.2.145","features":[],"optional":false,"default_features":true,"target":"cfg(unix)","kind":"dev"},{"name":"loom","req":"^0.7","features":["futures","checkpoint"],"optional":false,"default_features":true,"target":"cfg(loom)","kind":"dev"},{"name":"mio","req":"^0.8.6","features":[],"optional":true,"default_features":false,"target":null,"kind":"normal"},{"name":"mio-aio","req":"^0.7.0","features":["tokio"],"optional":false,"default_features":true,"target":"cfg(target_os = \"freebsd\")","kind":"dev"},{"name":"mockall","req":"^0.11.1","features":[],"optional":false,"default_features":true,"target":null,"kind":"dev"},{"name":"nix","req":"^0.26","features":["fs","socket"],"optional":false,"default_features":false,"target":"cfg(unix)","kind":"dev"},{"name":"num_cpus","req":"^1.8.0","features":[],"optional":true,"default_features":true,"target":null,"kind":"normal"},{"name":"parking_lot","req":"^0.12.0","features":[],"optional":true,"default_features":true,"target":null,"kind":"normal"},{"name":"pin-project-lite","req":"^0.2.11","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"rand","req":"^0.8.0","features":[],"optional":false,"default_features":true,"target":"cfg(not(all(target_family = \"wasm\", target_os = \"unknown\")))","kind":"dev"},{"name":"signal-hook-registry","req":"^1.1.1","features":[],"optional":true,"default_features":true,"target":"cfg(unix)","kind":"normal"},{"name":"socket2","req":"^0.5.3","features":["all"],"optional":true,"default_features":true,"target":"cfg(not(target_family = \"wasm\"))","kind":"normal"},{"name":"socket2","req":"^0.5.3","features":[],"optional":false,"default_features":true,"target":"cfg(not(target_family = \"wasm\"))","kind":"dev"},{"name":"tempfile","req":"^3.1.0","features":[],"optional":false,"default_features":true,"target":"cfg(not(target_family = \"wasm\"))","kind":"dev"},{"name":"tokio-macros","req":"~2.1.0","features":[],"optional":true,"default_features":true,"target":null,"kind":"normal"},{"name":"tokio-stream","req":"^0.1","features":[],"optional":false,"default_features":true,"target":null,"kind":"dev"},{"name":"tokio-test","req":"^0.4.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"dev"},{"name":"tracing","req":"^0.1.25","features":["std"],"optional":true,"default_features":false,"target":"cfg(tokio_unstable)","kind":"normal"},{"name":"wasm-bindgen-test","req":"^0.3.0","features":[],"optional":false,"default_features":true,"target":"cfg(all(target_family = \"wasm\", not(target_os = \"wasi\")))","kind":"dev"},{"name":"windows-sys","req":"^0.48","features":[],"optional":true,"default_features":true,"target":"cfg(windows)","kind":"normal"},{"name":"windows-sys","req":"^0.48","features":["Win32_Foundation","Win32_Security_Authorization"],"optional":false,"default_features":true,"target":"cfg(windows)","kind":"dev"}],"cksum":"17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9","features":{"default":[],"fs":[],"full":["fs","io-util","io-std","macros","net","parking_lot","process","rt","rt-multi-thread","signal","sync","time"],"io-std":[],"io-util":["bytes"],"macros":["tokio-macros"],"net":["libc","mio/os-poll","mio/os-ext","mio/net","socket2","windows-sys/Win32_Foundation","windows-sys/Win32_Security","windows-sys/Win32_Storage_FileSystem","windows-sys/Win32_System_Pipes","windows-sys/Win32_System_SystemServices"],"process":["bytes","libc","mio/os-poll","mio/os-ext","mio/net","signal-hook-registry","windows-sys/Win32_Foundation","windows-sys/Win32_System_Threading","windows-sys/Win32_System_WindowsProgramming"],"rt":[],"rt-multi-thread":["num_cpus","rt"],"signal":["libc","mio/os-poll","mio/net","mio/os-ext","signal-hook-registry","windows-sys/Win32_Foundation","windows-sys/Win32_System_Console"],"stats":[],"sync":[],"test-util":["rt","sync","time"],"time":[]},"yanked":false,"rust_version":"1.63"}

Cargo从这里可以拿到历史版本号,依赖项(deps),特性(features)等信息。

查询package

https://crates.io/api/v1/crates/tokio/1.32.0

{"version":{"audit_actions":[{"action":"publish","time":"2023-08-16T21:11:49.973478+00:00","user":{"avatar":"https://avatars.githubusercontent.com/u/6180?v=4","id":10,"login":"carllerche","name":"Carl Lerche","url":"https://github.com/carllerche"}}],"checksum":"17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9","crate":"tokio","crate_size":725004,"created_at":"2023-08-16T21:11:49.973478+00:00","dl_path":"/api/v1/crates/tokio/1.32.0/download","downloads":1848459,"features":{"default":[],"fs":[],"full":["fs","io-util","io-std","macros","net","parking_lot","process","rt","rt-multi-thread","signal","sync","time"],"io-std":[],"io-util":["bytes"],"macros":["tokio-macros"],"net":["libc","mio/os-poll","mio/os-ext","mio/net","socket2","windows-sys/Win32_Foundation","windows-sys/Win32_Security","windows-sys/Win32_Storage_FileSystem","windows-sys/Win32_System_Pipes","windows-sys/Win32_System_SystemServices"],"process":["bytes","libc","mio/os-poll","mio/os-ext","mio/net","signal-hook-registry","windows-sys/Win32_Foundation","windows-sys/Win32_System_Threading","windows-sys/Win32_System_WindowsProgramming"],"rt":[],"rt-multi-thread":["num_cpus","rt"],"signal":["libc","mio/os-poll","mio/net","mio/os-ext","signal-hook-registry","windows-sys/Win32_Foundation","windows-sys/Win32_System_Console"],"stats":[],"sync":[],"test-util":["rt","sync","time"],"time":[]},"id":873708,"license":"MIT","links":{"authors":"/api/v1/crates/tokio/1.32.0/authors","dependencies":"/api/v1/crates/tokio/1.32.0/dependencies","version_downloads":"/api/v1/crates/tokio/1.32.0/downloads"},"num":"1.32.0","published_by":{"avatar":"https://avatars.githubusercontent.com/u/6180?v=4","id":10,"login":"carllerche","name":"Carl Lerche","url":"https://github.com/carllerche"},"readme_path":"/api/v1/crates/tokio/1.32.0/readme","rust_version":"1.63","updated_at":"2023-08-16T21:11:49.973478+00:00","yanked":false}}

Cargo从这里可以拿到package下载地址:"dl_path":"/api/v1/crates/tokio/1.32.0/download"。这是一个相对地址,前面需要加上crates.io的origin,最终获得完整下载地址:https://crates.io/api/v1/crates/tokio/1.32.0/download

下载package

https://crates.io/api/v1/crates/tokio/1.32.0/download

自动重定向到 https://static.crates.io/crates/tokio/tokio-1.32.0.crate,下载得到的是.crate文件,实际是一个压缩包,解压后就是tokio项目源代码目录树。

前瞻

现有方案不解决主要问题。我想今后Rust还是需要提供crates.io内package下载镜像源的。

相关文章:

Rust更换Cargo国内源,镜像了寂寞

换皮不换身 换了国内源,构建时该卡还会卡。因为它所谓的换源,只是更换crates.io“索引”的源,而不是package“内容”的源。换了国内源后,在国内编译时访问 crates.io-index 自然会快很多,可是crates.io-index里面的信…...

【网络安全带你练爬虫-100练】第23练:文件内容的删除+写入

目录 0x00 前言: 0x02 解决: 0x00 前言: 本篇博文可能会有一点点的超级呆 0x02 解决: 你是不是也会想: 使用pyrhon将指定文件夹位置里面的1.txt中数据全部删除以后---->然后再将参数req_text的值写入到1.txt …...

ESP32蓝牙实例-BLE服务器与客户端通信

BLE服务器与客户端通信 文章目录 BLE服务器与客户端通信1、软件准备2、硬件准备3、代码实现3.1 BLE服务器实现3.2 Android手机测试BLE服务器3.3 ESP32 BLE客户端在本文中,我们将介绍如何使用低功耗蓝牙在两个 ESP32 开发板之间执行 BLE 服务器客户端通信。 换句话说,将介绍如…...

第11章_瑞萨MCU零基础入门系列教程之SysTick

本教程基于韦东山百问网出的 DShanMCU-RA6M5开发板 进行编写,需要的同学可以在这里获取: https://item.taobao.com/item.htm?id728461040949 配套资料获取:https://renesas-docs.100ask.net 瑞萨MCU零基础入门系列教程汇总: ht…...

【面试题精讲】如何使用Stream的聚合功能

有的时候博客内容会有变动&#xff0c;首发博客是最新的&#xff0c;其他博客地址可能会未同步,认准https://blog.zysicyj.top 首发博客地址 系列文章地址 求和&#xff08;Sum&#xff09;&#xff1a; List<Integer> numbers Arrays.asList(1, 2, 3, 4, 5);int sum n…...

Linux 中的 chmod 命令及示例

在 Unix 操作系统中,chmod命令用于更改文件的访问模式。该名称是change mode的缩写。其中规定每个文件和目录都有一组权限来控制权限,例如谁可以读取、写入或执行该文件。其中权限分为三类:同时读、写和执行,用“r”、“w”和“x”表示。这些字母组合在一起形成一组用户的特…...

sannaing i14 pro max使用体验

体验了一把山寨机&#xff0c;不明真相的人会以为这是三星的英文标志&#xff0c;又是pro又是max的&#xff0c;价格600&#xff0c;进系统去看了配置&#xff0c;cpu写的是snapdragon 888&#xff0c;运存12g&#xff0c;内存500g。下了个安兔兔也是被忽悠了&#xff0c;它也以…...

Shazam音乐检索算法原理及实现

算法基本流程如下&#xff1a; 1. 采集音乐库 2. 音乐指纹采集 3. 采用局部最大值作为特征点 4. 将临近的特征点进行组合形成特征点对 5. 对每个特征点对进行hash编码 编码过程&#xff1a;将f1和f2进行10bit量化&#xff0c;其余bit用来存储时间偏移合集形成32bit的hash码 …...

vue递归组件

父组件&#xff1a; <template><div><treeVue :treeData"treeData"></treeVue></div> </template><script setup lang"ts"> import { reactive } from "vue"; import treeVue from "./tree.vue…...

软件测试/测试开发丨测试用例自动录入 学习笔记

点此获取更多相关资料 本文为霍格沃兹测试开发学社学员学习笔记分享 原文链接&#xff1a;https://ceshiren.com/t/topic/27139 测试用例自动录入 测试用例自动录入的价值 省略人工同步的步骤&#xff0c;节省时间 兼容代码版本的自动化测试用例 用例的执行与调度统一化管理…...

来学Python啦,大话字符串

To be a happy man&#xff0c; reading&#xff0c; travel&#xff0c; hard work&#xff0c; care for the body and mind。做一个幸福的人&#xff0c;读书&#xff0c;旅行&#xff0c;努力工作&#xff0c;关心身体和心境。 前面我们讲解过关于用Python写温度转换器&…...

pyqt5设置背景图片

PyQt5设置背景图片 1、打开QTDesigner 创建一个UI&#xff0c;camera.ui。 2、创建一个pictures.qrc文件 在ui文件同级目录下先创建一个pictures.txt&#xff0c;填写内容&#xff1a; <RCC><qresource prefix"media"><file>1.jpg</file>…...

C# WPF 自己写的一个模拟病毒传播的程序,有可视化

源代码: https://github.com/t39q/VirusSpread 主要代码 using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks;namespace VirusSpread.Bu…...

stable diffusion实践操作-大模型介绍-SDXL1大模型

系列文章目录 大家移步下面链接中&#xff0c;里面详细介绍了stable diffusion的原理&#xff0c;操作等&#xff08;本文只是下面系列文章的一个写作模板&#xff09;。 stable diffusion实践操作 提示&#xff1a;写完文章后&#xff0c;目录可以自动生成&#xff0c;如何生…...

软考高级系统架构设计师系列案例考点专题四:嵌入式系统

软考高级系统架构设计师系列案例考点专题四:嵌入式系统 一、相关概念二、软件可靠性和硬件可靠性的区别三、可靠性指标四、可靠性设计五、冗余技术六、软件容错七、双机容错技术八、集群技术九、负载均衡十、可维护性的评价指标十一、软件维护的分类嵌入式每年必考一题,但是属…...

Django Form实现表单使用及应用场景

首先需要定义一个使用场景&#xff1a; 音乐网站的前端部分可以添加上传歌手的单曲&#xff0c; 这个添加页面就使用django form表单来实现。 目录 数据表内容 歌手表及表模型 单曲表及表模型 演示表单使用 设置路由 创建form.py 视图实例化表单类 模板使用表单对象 表…...

golang面试题:json包变量不加tag会怎么样?

问题 json包里使用的时候&#xff0c;结构体里的变量不加tag能不能正常转成json里的字段&#xff1f; 怎么答 如果变量首字母小写&#xff0c;则为private。无论如何不能转&#xff0c;因为取不到反射信息。如果变量首字母大写&#xff0c;则为public。 不加tag&#xff0c…...

国内项目管理中级证书CSPM-3正在报名!

CSPM-3中级项目管理专业人员认证&#xff0c;是中国标准化协会&#xff08;全国项目管理标准化技术委员会秘书处&#xff09;&#xff0c;面向社会开展项目管理专业人员能力的等级证书。旨在构建多层次从业人员培养培训体系&#xff0c;建立健全人才职业能力评价和激励机制的要…...

vue表格不显示列号123456

我在网上找了半天&#xff0c;都是如何添加列号123456的&#xff0c;没有找到不显示列号的参考&#xff0c;现在把这个解决了&#xff0c;特此记录一下。 没有加右边的就会显示&#xff0c;加上右边的就隐藏了...

【大数据】Kafka 入门指南

Kafka 入门指南 1.Kafka 简介2.Kafka 架构3.分区与副本4.偏移量5.消费者组6.总结 1.Kafka 简介 Apache Kafka 是一种高吞吐、分布式的流处理平台&#xff0c;由 LinkedIn 开发并于 2011 年开源。它具有 高伸缩性、高可靠性 和 低延迟 等特点&#xff0c;因此在大型数据处理场景…...

Qt 5.15集成Crypto++ 8.8.0(MSVC 2019)笔记

一、背景 笔者已介绍过在Qt 5.15.x中使用MinGW&#xff08;8.10版本&#xff09;编译并集成Crypto 8.8.0。 但是该编译出来的库&#xff08;.a和.dll&#xff09;不适用MSVC&#xff08;2019版本&#xff09;构建环境&#xff0c;需要重新编译&#xff08;.lib或和.dll&#xf…...

前端面试的话术集锦第 9 篇:高频考点(webpack性能优化)

这是记录前端面试的话术集锦第九篇博文——高频考点(webpack性能优化),我会不断更新该博文。❗❗❗ 在此章节中,我不会浪费篇幅给大家讲如何写配置文件。如果你想学习这方面的内容,那么完全可以去官网学习。在这部分的内容中,我们会聚焦于以下两个知识点,并且每一个知识…...

程序员,你真热爱编程吗?

程序员的热爱与演变 我发现&#xff0c;程序员这个行业不像其他行业那样&#xff0c;很多人是因为热爱编程才去做程序员&#xff0c;不会被逼无奈去做程序员&#xff08;要是真有就太惨了&#xff09;。 热爱编程的漫长过程 热爱过、⼜不爱了、⼜爱了&#xff0c;这是个过程…...

算法通关村-----海量数据的处理方法

从40亿中产生一个不存在的数 问题描述 给定一个文件&#xff0c;包含40亿个非负整数&#xff0c;请你设计一个算法&#xff0c;产生一个不在该文件中的数字。假设你只有1GB内存。 问题分析 40亿整数,在java中&#xff0c;用int存储的话&#xff0c;大概需要40亿✖️4B,大约…...

Pytorch 多卡并行(1)—— 原理简介和 DDP 并行实践

近年来&#xff0c;深度学习模型的规模越来越大&#xff0c;需要处理的数据也越来越多&#xff0c;单卡训练的显存空间和计算效率都越来越难以满足需求。因此&#xff0c;多卡并行训练成为了一个必要的解决方案本文主要介绍使用 Pytorch 的 DistributedDataParallel&#xff08…...

快速排序(重点)

前言 快排是一种比较重要的排序算法&#xff0c;他的思想有时候会作用到个别算法提上&#xff0c;公司招聘的笔试上有时候也有他的过程推导题&#xff0c;所以搞懂快排势在必行&#xff01;&#xff01;&#xff01; 快速排序 基本思想&#xff1a; 根据基准&#xff0c;将数…...

python高级内置函数介绍及应用举例

目录 1. 概述2. 举例 1. 概述 Python中有许多高级内置函数&#xff0c;它们提供了丰富的功能和便利性&#xff0c;可以大大简化代码并提高效率。以下是一些常用的高级内置函数&#xff1a; map()&#xff1a; 用于将一个函数应用于一个可迭代对象的所有项&#xff0c;返回一…...

人体呼吸存在传感器成品,毫米波雷达探测感知技术,引领智能家居新潮流

随着科技的不断进步和人们生活质量的提高&#xff0c;智能化家居逐渐成为一种时尚和生活方式。 人体存在传感器作为智能家居中的重要组成部分&#xff0c;能够实时监测环境中人体是否存在&#xff0c;为智能家居系统提供更加精准的控制和联动。 在这个充满创新的时代&#xf…...

软件设计模式(三):责任链模式

前言 前面荔枝梳理了有关单例模式、策略模式的相关知识&#xff0c;这篇文章荔枝将沿用之前的写法根据示例demo来体会这种责任链设计模式&#xff0c;希望对有需要的小伙伴有帮助吧哈哈哈哈哈哈~~~ 文章目录 前言 责任链模式 1 简单场景 2 责任链模式理解 3 Java下servl…...

开发者的商业智慧:产品立项策划你知道多少?

文章目录 想法的萌芽&#x1f31f;初步评估产品可行性&#x1f34a;分析核心功能和特点以及竞争对手&#x1f4dd;大健康监测&#x1f4dd;时尚新科技产品&#x1f4dd;准确性&#x1f4dd;多功能&#x1f4dd;品牌口碑&#x1f4dd;数据分析与个性化建议&#x1f4dd;社交互动…...

微企点建站平台介绍/免费建自己的网站

前段时间谷歌推出了谷歌眼镜&#xff0c;在移动设备中出尽风头&#xff0c;苹果向法院提出诉讼苹果侵犯了自己的专利。然后苹果又推出了针对谷歌眼镜的iWatch&#xff0c;谷歌和苹果之间的战争于次世界大战&#xff0c;看看他们之间的战争到底有多激烈。 苹果与谷歌的战争这就像…...

seo网站建设方案/对搜索引擎优化的认识

1.公式的转化 我们都知道在latex上编写公式非常简便&#xff0c;他有一套自己的语言支持。 但是复杂的公式在word上编写十分麻烦&#xff0c;那如何将latex上的公式无缝的对接到word上呢&#xff1f; 一个在线转变网站 使用&#xff1a; $$ \mathbf{G} \left[\begin{matrix}g…...

建设通网站源码/seo排名优化app

MR100处理器代表了Allwin公司在无人机视频编码处理器方面的最新成就,该处理器集成了一个单核Cortex-A7 CPU,其工作速度可达到1.2GHz,支持多种外设。一个512MbitDDR2高度集成。 视频引擎支持多格式,如H.264编码器,1080p@45fps,H.264解码器,1080p@30fps,JPEG/MJPEG解码器…...

做网站需要什么学历/介绍网络营销的短文

1、ls命令作用 ls命令用于显示指定工作目录下之内容&#xff08;列出目前工作目录所含之文件及子目录) 2、ls命令结构 drwxr-xr-x 2 root root 4.0K 3月 23 2017 etc “d” 表示文件的类型为目录 “rwx” 表示文件所有者的权限:r是读&#xff0c;w是写&#xff0c;x是…...

网站alexa排名/微信推广方式有哪些

什么是位置参数&#xff0c;Python位置参数 位置参数&#xff0c;有时也称必备参数&#xff0c;指的是必须按照正确的顺序将实际参数传到函数中&#xff0c;换句话说&#xff0c;调用函数时传入实际参数的数量和位置都必须和定义函数时保持一致。 实参和形参数量必须一致 在…...

厦门外贸网站建设多少钱/百度如何做推广

arpspoof是一个好用的ARP欺骗工具&#xff0c;Kali linux中自带了该工具&#xff0c;在ubuntu中&#xff0c;安装它只需运行命令&#xff1a;sudo apt-get install dsniff安装完成后&#xff0c;输入命令&#xff1a;man arpspoof 可以查看使用手册&#xff0c;2.4版本的手册内…...