diff --git a/content/posts/operating-systems/deepin20.9.md b/content/posts/operating-systems/deepin20.9.md index b46ffc41..793d3b9c 100644 --- a/content/posts/operating-systems/deepin20.9.md +++ b/content/posts/operating-systems/deepin20.9.md @@ -77,6 +77,10 @@ repost: - **Vim** - **VSCode Great Icons** 文件图标主题 +{{< admonition question >}} +rust5-analyzer 插件可能会因为新版本要求 glibc 2.29 而导致启动失败,请参考这个 [issue](https://github.com/rust-lang/rust-analyzer/issues/11558) 来解决。 +{{< /admonition >}} + ## 终端和 Vim 新手教学文档: diff --git a/content/posts/riscv/openeuler-riscv-qemu-mugen.md b/content/posts/operating-systems/openeuler-riscv-qemu.md similarity index 96% rename from content/posts/riscv/openeuler-riscv-qemu-mugen.md rename to content/posts/operating-systems/openeuler-riscv-qemu.md index 86816e7e..0f17cff8 100644 --- a/content/posts/riscv/openeuler-riscv-qemu-mugen.md +++ b/content/posts/operating-systems/openeuler-riscv-qemu.md @@ -1,5 +1,5 @@ --- -title: "openEuler RISC-V 系统: QEMU 仿真和 Mugen 测试框架" +title: "openEuler RISC-V 系统: QEMU 仿真" subtitle: date: 2024-03-07T14:48:21+08:00 # draft: true @@ -19,6 +19,7 @@ tags: - openEuler - QEMU - Mugen + - Neofetch categories: - RISC-V - Operating Systems @@ -292,6 +293,19 @@ $ echo $? 我个人比较期待 RISC-V 配合 nommu 在嵌入式这类低功耗领域的发展,同时也对 [RISC-V Hypervisor Extension](https://riscv.org/wp-content/uploads/2017/12/Tue0942-riscv-hypervisor-waterman.pdf) 在虚拟化方面的发展感兴趣。 +## Neofetch + +根据 [neofetch wiki](https://github.com/dylanaraps/neofetch/wiki/Installation#latest-git-master-bleeding-edge) 从 git 拉取最新数据进行构建: + +```bash +$ git clone https://github.com/dylanaraps/neofetch +$ cd neofetch +$ make install +$ neofetch +``` + +{{< image src="/images/oerv/openEuler-RISC-V-neofetch.png" >}} + ## References - openEuler RISC-V: [通过 QEMU 仿真 RISC-V 环境并启动 OpenEuler RISC-V 系统](https://github.com/openeuler-mirror/RISC-V/blob/master/doc/tutorials/vm-qemu-oErv.md) diff --git a/content/posts/rust/subtying-and-variance.md b/content/posts/rust/subtying-and-variance.md index ffbc0943..745a425d 100644 --- a/content/posts/rust/subtying-and-variance.md +++ b/content/posts/rust/subtying-and-variance.md @@ -55,6 +55,38 @@ repost: - cplusplus: [strtok](https://cplusplus.com/reference/cstring/strtok/) - cppreference: [strtok](https://en.cppreference.com/w/cpp/string/byte/strtok) +### shortening lifetimes + +影片大概 19 分时给出了为何 cargo test 失败的推导,个人觉得非常巧妙 + +```rs +pub fn strtok<'a>(s: &'a mut &'a str, delimiter: char) { ... } + +let mut x = "hello world"; +strtok(&mut x, ' '); +``` + +为了更直观地表示和函数 `strtok` 的返回值 lifetime 无关,这里将返回值先去掉了。在调用 `strtok` 时,编译器对于参数 `s` 的 lifetime 推导如下: + +``` +&'a mut &'a str +& mut x + +&'a mut &'a str +& mut &'static str + +&'a mut &'static str +& mut &'static str + +&'static mut &'static str +& mut &'static str + +&'static mut &'static str +&'static mut &'static str +``` + +所以 `strtok` 在接收参数 `s` 后 (通过传入 `&mut x`),会推导其 lifetime 为 static,这就会导致后面使用 `x` 的不可变引用 (`&x`) 时发生冲突。 + ## Documentations 这里列举视频中一些概念相关的 documentation diff --git a/docs/404.html b/docs/404.html index d2752cb0..1ee4cf08 100644 --- a/docs/404.html +++ b/docs/404.html @@ -25,7 +25,7 @@
0% @@ -141,5 +141,5 @@

FixIt 主题在启用 JavaScript 的情况下效果最佳。
- + diff --git a/docs/baidu_urls.txt b/docs/baidu_urls.txt new file mode 100644 index 00000000..0166cadc --- /dev/null +++ b/docs/baidu_urls.txt @@ -0,0 +1,44 @@ +https://ccrysisa.github.io/posts/linux2023/ +https://ccrysisa.github.io/posts/subtying-and-variance/ +https://ccrysisa.github.io/posts/c-recursion/ +https://ccrysisa.github.io/posts/linux-hashtable/ +https://ccrysisa.github.io/posts/c-function/ +https://ccrysisa.github.io/posts/concurrency-ordering/ +https://ccrysisa.github.io/posts/concurrency-concepts/ +https://ccrysisa.github.io/posts/openeuler-riscv-qemu/ +https://ccrysisa.github.io/posts/c-std-security/ +https://ccrysisa.github.io/posts/orst/ +https://ccrysisa.github.io/posts/linux-dev-review/ +https://ccrysisa.github.io/posts/riscv-optimization-guide/ +https://ccrysisa.github.io/posts/channels/ +https://ccrysisa.github.io/posts/c-standards/ +https://ccrysisa.github.io/posts/c-memory/ +https://ccrysisa.github.io/posts/c-bitwise/ +https://ccrysisa.github.io/posts/smart-pointers-and-interior-mutability/ +https://ccrysisa.github.io/posts/c-numerics/ +https://ccrysisa.github.io/posts/linux2023-lab0/ +https://ccrysisa.github.io/posts/rust-tcp/ +https://ccrysisa.github.io/posts/linux-quiz1/ +https://ccrysisa.github.io/posts/linux-concepts/ +https://ccrysisa.github.io/posts/iterators/ +https://ccrysisa.github.io/posts/c-linked-list/ +https://ccrysisa.github.io/posts/declarative-macros/ +https://ccrysisa.github.io/posts/lifetime-annotations/ +https://ccrysisa.github.io/posts/deepin20.9/ +https://ccrysisa.github.io/posts/deepin-dragonos/ +https://ccrysisa.github.io/posts/nycu-statistics/ +https://ccrysisa.github.io/posts/debug-gdb/ +https://ccrysisa.github.io/posts/c-pointer/ +https://ccrysisa.github.io/posts/nthu-computer-network/ +https://ccrysisa.github.io/posts/c-spec-ch6/ +https://ccrysisa.github.io/posts/c-spec-ch7/ +https://ccrysisa.github.io/posts/c-specification/ +https://ccrysisa.github.io/posts/git/ +https://ccrysisa.github.io/posts/network/ +https://ccrysisa.github.io/posts/binary-representation/ +https://ccrysisa.github.io/posts/why-rust-/ +https://ccrysisa.github.io/posts/git-learn/ +https://ccrysisa.github.io/posts/ubuntu22.04lts/ +https://ccrysisa.github.io/posts/gnu-linux-dev/ +https://ccrysisa.github.io/posts/math/ +https://ccrysisa.github.io/posts/hello_world/ diff --git a/docs/categories/c/index.html b/docs/categories/c/index.html index 79b899ce..b02f4f72 100644 --- a/docs/categories/c/index.html +++ b/docs/categories/c/index.html @@ -26,7 +26,7 @@
-
0% @@ -168,5 +168,5 @@
FixIt 主题在启用 JavaScript 的情况下效果最佳。
- + diff --git a/docs/categories/c/index.xml b/docs/categories/c/index.xml index 0011f4dc..f6f029d8 100644 --- a/docs/categories/c/index.xml +++ b/docs/categories/c/index.xml @@ -2,7 +2,7 @@ C - 分类 - KZnight's Blog https://ccrysisa.github.io/categories/c/ - C - 分类 | KZnight's Blog + C - 分类 - KZnight's Blog Hugo -- gohugo.iozh-CNcaijiaxin@dragonos.org (ccrysisa) caijiaxin@dragonos.org (ccrysisa)Sat, 16 Mar 2024 20:56:18 +0800 你所不知道的 C 语言: 递归调用篇 diff --git a/docs/categories/concurrency/index.html b/docs/categories/concurrency/index.html index 369633c8..214e73f2 100644 --- a/docs/categories/concurrency/index.html +++ b/docs/categories/concurrency/index.html @@ -26,7 +26,7 @@
-

Concurrency 2 -

2024

0% @@ -138,5 +138,5 @@
FixIt 主题在启用 JavaScript 的情况下效果最佳。
- + diff --git a/docs/categories/concurrency/index.xml b/docs/categories/concurrency/index.xml index 258900ad..dc3ab99c 100644 --- a/docs/categories/concurrency/index.xml +++ b/docs/categories/concurrency/index.xml @@ -2,7 +2,7 @@ Concurrency - 分类 - KZnight's Blog https://ccrysisa.github.io/categories/concurrency/ - Concurrency - 分类 | KZnight's Blog + Concurrency - 分类 - KZnight's Blog Hugo -- gohugo.iozh-CNcaijiaxin@dragonos.org (ccrysisa) caijiaxin@dragonos.org (ccrysisa)Mon, 11 Mar 2024 16:23:57 +0800 并行程序设计: 执行顺序 diff --git a/docs/categories/draft/index.html b/docs/categories/draft/index.html index 89d5fc6c..6a1ebd57 100644 --- a/docs/categories/draft/index.html +++ b/docs/categories/draft/index.html @@ -26,7 +26,7 @@
-

draft 2 -

2024

+ draft 2

2024

2023

2023

0% @@ -138,5 +138,5 @@
FixIt 主题在启用 JavaScript 的情况下效果最佳。
- + diff --git a/docs/categories/draft/index.xml b/docs/categories/draft/index.xml index aad11fdc..44a13f40 100644 --- a/docs/categories/draft/index.xml +++ b/docs/categories/draft/index.xml @@ -2,7 +2,7 @@ draft - 分类 - KZnight's Blog https://ccrysisa.github.io/categories/draft/ - draft - 分类 | KZnight's Blog + draft - 分类 - KZnight's Blog Hugo -- gohugo.iozh-CNcaijiaxin@dragonos.org (ccrysisa) caijiaxin@dragonos.org (ccrysisa)Thu, 29 Feb 2024 23:44:29 +0800 RISC-V Optimization Guide diff --git a/docs/categories/index.html b/docs/categories/index.html index 5c7ca348..97132c1f 100644 --- a/docs/categories/index.html +++ b/docs/categories/index.html @@ -25,7 +25,7 @@
-

所有分类 11 -

-