Forwarded from Rust 视界
【工具】vulkan-tutorial-rs 编程语言练习工具
#rust
[@timkofu](https://twitter.com/timkofu) 看完 The Book 后想找一个类似 [pythonchallenge.com](https://t.co/Q0vzcnTU9S) 网站,通过做一些编程练习学习 Rust,网友给他推荐了以下几个网站:
* [vulkan-tutorial-rs](https://github.com/bwasty/vulkan-tutorial-rs)
* [www.codewars.com](https://www.codewars.com/)
* [exercism.io](https://exercism.io)
刚学 Rust 不知道该做些什么项目的同学可以看看,顺便推荐[issuehub.com](http://issuehub.io),可以用“rust + help wanted”来搜索Rust 相关的开源项目,帮助开源项目解决issue也是一种练习方式。
[Read More](https://twitter.com/timkofu/status/1158415111394123776)
#rust
[@timkofu](https://twitter.com/timkofu) 看完 The Book 后想找一个类似 [pythonchallenge.com](https://t.co/Q0vzcnTU9S) 网站,通过做一些编程练习学习 Rust,网友给他推荐了以下几个网站:
* [vulkan-tutorial-rs](https://github.com/bwasty/vulkan-tutorial-rs)
* [www.codewars.com](https://www.codewars.com/)
* [exercism.io](https://exercism.io)
刚学 Rust 不知道该做些什么项目的同学可以看看,顺便推荐[issuehub.com](http://issuehub.io),可以用“rust + help wanted”来搜索Rust 相关的开源项目,帮助开源项目解决issue也是一种练习方式。
[Read More](https://twitter.com/timkofu/status/1158415111394123776)
Twitter
Timothy Makobu (@timkofu) | Twitter
The latest Tweets from Timothy Makobu (@timkofu). MSc. Software Engineering student @HWUDubai
Forwarded from Rust 视界
十年Cpp程序员学了三个月Rust之后的感想
#cpp
文章不长,用作者的话来总结:与其把Rust看作是一门语言,倒不如将其看作是一个生态系统。他对Rust这个生态系统未来的成长感到非常excited。
- Facebook用Rust写区块链: Libra
- Goolge用Rust写操作系统: Fuchsia
- 亚马逊用Rust写虚拟化技术: FireCracker
- 微软推,崇业界都应该使用Rust语言。
看见了吗? 四大巨头的未来主要核心业务都交给或准备交给Rust了。
这也是这个10年Cpp程序员开始学习Rust的原因:未来。
Read More: [https://blog.aclysma.com/my-first-three-months-with-rust/](https://blog.aclysma.com/my-first-three-months-with-rust/)
#cpp
文章不长,用作者的话来总结:与其把Rust看作是一门语言,倒不如将其看作是一个生态系统。他对Rust这个生态系统未来的成长感到非常excited。
- Facebook用Rust写区块链: Libra
- Goolge用Rust写操作系统: Fuchsia
- 亚马逊用Rust写虚拟化技术: FireCracker
- 微软推,崇业界都应该使用Rust语言。
看见了吗? 四大巨头的未来主要核心业务都交给或准备交给Rust了。
这也是这个10年Cpp程序员开始学习Rust的原因:未来。
Read More: [https://blog.aclysma.com/my-first-three-months-with-rust/](https://blog.aclysma.com/my-first-three-months-with-rust/)
aclysma's blog
My First Three Months With Rust
I’ve used C++ professionally in games and simulations for over 10 years, and in the past few years I’ve also used C# to build distributed backend systems.
Lately, I’ve been exploring rust.
Lately, I’ve been exploring rust.
Forwarded from Rust 视界
「SO问答」对超过240个元素的数组进行循环时,为什么会有很大的性能影响?
#stackoverflow
问题:
> 下面代码当
解答:
> 总结:低于240,LLVM完全展开内部循环,可以优化掉重复循环,增加性能。
分析:
> 这是一个神奇的阈值,超过该阈值LLVM将停止执行某些优化。阈值是
比如这段代码:
你在 [godbolt](https://rust.godbolt.org/z/VKL9MS) 编辑器中查看生成的汇编代码,比较240和239,会发现有很大区别。比如当239的时候生成:
就是所谓的循环展开: LLVM将循环体粘贴一段时间,以避免执行那些“循环管理指令”,即循环变量的增量,检查循环是否结束和跳转。(可以自行对比一下240的输出)。但是,即便循环不展开,也不会造成80倍的性能差异。所以,实际上那个性能测试代码嵌套循环导致的(LLVM生成的代码基本上首先只执行内部循环(计算总和),然后通过多次累加总和来模拟外部循环!)。最好要使用Rust的惯用法: `arr.iter().sum()`,这样就不会产生80倍的性能差异了。
Read More: [https://stackoverflow.com/questions/57458460/why-is-there-a-large-performance-impact-when-looping-over-an-array-over-240-elem](https://stackoverflow.com/questions/57458460/why-is-there-a-large-performance-impact-when-looping-over-an-array-over-240-elem)
#stackoverflow
问题:
> 下面代码当
CAPACITY >= 240 的时候,与 CAPACITY >= 239 相比,性能慢了80倍。Rust编译器专门为240以内的长度做了优化? 使用 rustc -C opt-level=3 进行编译。rust
use std::time::Instant;
const CAPACITY: usize = 240;
const IN_LOOPS: usize = 500000;
fn main() {
let mut arr = [0; CAPACITY];
for i in 0..CAPACITY {
arr[i] = i;
}
let mut sum = 0;
let now = Instant::now();
for _ in 0..IN_LOOPS {
let mut s = 0;
for i in 0..arr.len() {
s += arr[i];
}
sum += s;
}
println!("sum:{} time:{:?}", sum, now.elapsed());
}
解答:
> 总结:低于240,LLVM完全展开内部循环,可以优化掉重复循环,增加性能。
分析:
> 这是一个神奇的阈值,超过该阈值LLVM将停止执行某些优化。阈值是
8字节* 240 = 1920字节 (数组是usizes数组,因此长度乘以8字节,假设 x86-64 CPU)。在该问题中的基准测试中,是仅针对长度239执行的一个特定优化,所以导致了巨大的性能差异。比如这段代码:
rust
pub fn foo() -> usize {
let arr = [0; 240];
let mut s = 0;
for i in 0..arr.len() {
s += arr[i];
}
s
}
你在 [godbolt](https://rust.godbolt.org/z/VKL9MS) 编辑器中查看生成的汇编代码,比较240和239,会发现有很大区别。比如当239的时候生成:
rust
movdqa xmm1, xmmword ptr [rsp + 32]
movdqa xmm0, xmmword ptr [rsp + 48]
paddq xmm1, xmmword ptr [rsp]
paddq xmm0, xmmword ptr [rsp + 16]
paddq xmm1, xmmword ptr [rsp + 64]
; more stuff omitted here ...
paddq xmm0, xmmword ptr [rsp + 1840]
paddq xmm1, xmmword ptr [rsp + 1856]
paddq xmm0, xmmword ptr [rsp + 1872]
paddq xmm0, xmm1
pshufd xmm1, xmm0, 78
paddq xmm1, xmm0
就是所谓的循环展开: LLVM将循环体粘贴一段时间,以避免执行那些“循环管理指令”,即循环变量的增量,检查循环是否结束和跳转。(可以自行对比一下240的输出)。但是,即便循环不展开,也不会造成80倍的性能差异。所以,实际上那个性能测试代码嵌套循环导致的(LLVM生成的代码基本上首先只执行内部循环(计算总和),然后通过多次累加总和来模拟外部循环!)。最好要使用Rust的惯用法: `arr.iter().sum()`,这样就不会产生80倍的性能差异了。
Read More: [https://stackoverflow.com/questions/57458460/why-is-there-a-large-performance-impact-when-looping-over-an-array-over-240-elem](https://stackoverflow.com/questions/57458460/why-is-there-a-large-performance-impact-when-looping-over-an-array-over-240-elem)
rust.godbolt.org
Compiler Explorer - Rust (rustc 1.36.0)
pub fn foo() -> usize {
let arr = [0; 239];
let mut s = 0;
for i in 0..arr.len() {
s += arr[i];
}
s
}
let arr = [0; 239];
let mut s = 0;
for i in 0..arr.len() {
s += arr[i];
}
s
}
Forwarded from Rust 视界
Crev的使用教程
#Crev
[cargo-crev](https://github.com/dpc/crev/tree/master/cargo-crev)是一个代码审查工具,旨在构建信任的生态网络。但它并不局限于Rust社区,C/Cpp也可以使用。
该工具可以判断你项目中依赖crate的安全性、质量和发现的问题。可以在公共的git仓库里发布可验证的review信息。通过这种方式期望在Rust生态系统中构建可信任的网络。将不会有人再受到未经审查和不受信任代码的困扰。
想想npm因为依赖包出了多少次安全事故。这个工具ms不错,但是否真的可以解决问题?
Read More: [https://wiki.alopex.li/ActuallyUsingCrev](https://wiki.alopex.li/ActuallyUsingCrev)
#Crev
[cargo-crev](https://github.com/dpc/crev/tree/master/cargo-crev)是一个代码审查工具,旨在构建信任的生态网络。但它并不局限于Rust社区,C/Cpp也可以使用。
该工具可以判断你项目中依赖crate的安全性、质量和发现的问题。可以在公共的git仓库里发布可验证的review信息。通过这种方式期望在Rust生态系统中构建可信任的网络。将不会有人再受到未经审查和不受信任代码的困扰。
想想npm因为依赖包出了多少次安全事故。这个工具ms不错,但是否真的可以解决问题?
Read More: [https://wiki.alopex.li/ActuallyUsingCrev](https://wiki.alopex.li/ActuallyUsingCrev)
GitHub
crev-dev/cargo-crev
A cryptographically verifiable code review system for the cargo (Rust) package manager. - crev-dev/cargo-crev
Forwarded from Rust 视界
使用Rust进行游戏开发6个月之后收获到了什么?
#game
一位使用Rust开发游戏的妹纸,最近6个月内使用ggez框架开发自己的个人游戏项目,这篇文章简单介绍了她的一些感想,比如如何坚持做自己的项目、ECS很棒之类的。
重点是她之前写的另一篇文章:24小时游戏开发,介绍了如何使用ggez框架在24小时内开发一款小游戏。感兴趣的看看吧。
Read More: [https://iolivia.me/posts/6-months-of-rust-game-dev/](https://iolivia.me/posts/6-months-of-rust-game-dev/)
#game
一位使用Rust开发游戏的妹纸,最近6个月内使用ggez框架开发自己的个人游戏项目,这篇文章简单介绍了她的一些感想,比如如何坚持做自己的项目、ECS很棒之类的。
重点是她之前写的另一篇文章:24小时游戏开发,介绍了如何使用ggez框架在24小时内开发一款小游戏。感兴趣的看看吧。
Read More: [https://iolivia.me/posts/6-months-of-rust-game-dev/](https://iolivia.me/posts/6-months-of-rust-game-dev/)
Forwarded from Rust 视界
「思考」对于小的结构体,传值(By-Copy)还是传引用(By-Borrow)?
#Struct
这个小小的问题,涉及日常编写代码需要考虑的两个问题:性能 vs 人体工程学
我们是追求性能呢,还是追求代码的可读性和维护性等?
该文作者通过大篇幅的讨论,甚至深入到C++中探讨,得出结论:还是By-Copy吧。至于原因,还需要仔细阅读他的文章。
Read More: [https://www.forrestthewoods.com/blog/should-small-rust-structs-be-passed-by-copy-or-by-borrow/](https://www.forrestthewoods.com/blog/should-small-rust-structs-be-passed-by-copy-or-by-borrow/)
#Struct
这个小小的问题,涉及日常编写代码需要考虑的两个问题:性能 vs 人体工程学
我们是追求性能呢,还是追求代码的可读性和维护性等?
该文作者通过大篇幅的讨论,甚至深入到C++中探讨,得出结论:还是By-Copy吧。至于原因,还需要仔细阅读他的文章。
Read More: [https://www.forrestthewoods.com/blog/should-small-rust-structs-be-passed-by-copy-or-by-borrow/](https://www.forrestthewoods.com/blog/should-small-rust-structs-be-passed-by-copy-or-by-borrow/)
Forrestthewoods
Should small Rust structs be passed by-copy or by-borrow?
Benchmarking Rust to determine if small structs should be passed by-copy or by-value.
Forwarded from Rust 视界
RACC: Berkeley YACC解析器生成器移植到Rust
#BerkeleyYACC
作者的练手项目
Repo: [https://github.com/sivadeilra/racc/](https://github.com/sivadeilra/racc/)
#BerkeleyYACC
作者的练手项目
Repo: [https://github.com/sivadeilra/racc/](https://github.com/sivadeilra/racc/)
GitHub
GitHub - sivadeilra/racc: A port of the Berkeley YACC parser-generator to Rust
A port of the Berkeley YACC parser-generator to Rust - sivadeilra/racc
Forwarded from Rust 视界
sn0int - 半自动化 OSINT 框架和包管理器
OSINT 就是“公开资源情报”,常见于安全和黑客领域。这个 sn0int 是给 IT 安全专业人士和 bug 捕获者设计的 OSINT 框架及包管理器。它用于对给定的目标或你自己搜集情报,生成统一的格式,给后续的研究使用。
Rust 已经悄悄占领安全/黑客领域了。[https://sn0int.readthedocs.io/en/stable/](https://sn0int.readthedocs.io/en/stable/)
Repo: [https://github.com/kpcyrd/sn0int](https://github.com/kpcyrd/sn0int)
OSINT 就是“公开资源情报”,常见于安全和黑客领域。这个 sn0int 是给 IT 安全专业人士和 bug 捕获者设计的 OSINT 框架及包管理器。它用于对给定的目标或你自己搜集情报,生成统一的格式,给后续的研究使用。
Rust 已经悄悄占领安全/黑客领域了。[https://sn0int.readthedocs.io/en/stable/](https://sn0int.readthedocs.io/en/stable/)
Repo: [https://github.com/kpcyrd/sn0int](https://github.com/kpcyrd/sn0int)
Forwarded from 🎏「 彼岸情报🔎!」🎏薅羊毛情报(网站/资源/软件/限免APP)见闻社
#Github情报
Netch
一款开源的网络游戏加速器
支持Socks5、55R、V2等协议,堪比一些付费的加速器,前提你的线路要给力,不然加速就没意义了
https://github.com/netchx/Netch
Netch
一款开源的网络游戏加速器
支持Socks5、55R、V2等协议,堪比一些付费的加速器,前提你的线路要给力,不然加速就没意义了
https://github.com/netchx/Netch
GitHub
GitHub - netchx/netch: A simple proxy client
A simple proxy client. Contribute to netchx/netch development by creating an account on GitHub.
Forwarded from Deleted Account
Forwarded from 🎏「 彼岸情报🔎!」🎏薅羊毛情报(网站/资源/软件/限免APP)见闻社
Forwarded from 🎏「 彼岸情报🔎!」🎏薅羊毛情报(网站/资源/软件/限免APP)见闻社
Forwarded from 🎏「 彼岸情报🔎!」🎏薅羊毛情报(网站/资源/软件/限免APP)见闻社
#彼岸工具
「10个可打印的英语教学资源网站」
http://t.cn/AiE348Vw
http://t.cn/S6j63x
http://t.cn/h3cTR
http://t.cn/AiE348V7
http://t.cn/RAkRGUG
http://t.cn/AiE348VZ
http://t.cn/RAYUnhe
http://t.cn/AiE348V2
http://t.cn/AiNXyEfx
http://t.cn/AiE348Vh
英语初学者及英语教学工作者可🐎。
「10个可打印的英语教学资源网站」
http://t.cn/AiE348Vw
http://t.cn/S6j63x
http://t.cn/h3cTR
http://t.cn/AiE348V7
http://t.cn/RAkRGUG
http://t.cn/AiE348VZ
http://t.cn/RAYUnhe
http://t.cn/AiE348V2
http://t.cn/AiNXyEfx
http://t.cn/AiE348Vh
英语初学者及英语教学工作者可🐎。
Kids-Pages
Worksheets, phonics, primary resources
Primary resources for teachers and parents all around the world. Our collection includes kindergarten worksheets, phonics, alphabet, all organized by subject. It is easy to print, download and use the kindergarten worksheets online. Help your child learn…
Forwarded from Improve Your English🌙
USEFUL IELTS INTERVIEW EXPRESSIONS
1️⃣ Saying something in another way
🔸What I'm trying to say is...
🔸In other words...
🔸To put it another way...
🔸What I mean is...
🔸Perhaps I should make that clearer by saying...
2️⃣ Agreeing with an opinion
🔸Yes, I agree...
🔸That's my view exactly.
🔸I would tend to agree with that.
🔸I couldn't agree more.
3️⃣ Disagreeing with an opinion
🔸No, I disagree.
🔸I'm afraid I disagree.
🔸I see things rather differently myself.
🔸I wouldn't say that is necessarily true.
🔸I tend to disagree.
🔸I'm not so sure about that.
4️⃣ Partially agreeing with an opinion
🔸I don't entirely agree. It is true that......however...
🔸That is partly true, but...
🔸I agree with that to an extent. However...
5️⃣ Getting asked an opinion (by the examiner)
🔸What do you think?
🔸What's your view / opinion?
🔸What are your views on...?
🔸How do you feel about...?
6️⃣ Saying your opinion could vary according to the situation
🔸That depends...
🔸I think it really depends...
🔸That depends on how you look at it.
7️⃣ Asking for clarification (part 3 only)
🔸Could you please explain what ...(word)... means?
🔸Sorry, I don't understand the question. Could you explain?
🔸Sorry, I'm afraid I didn't understand the question.
🔸Sorry, can I just clarify what you mean. Are you asking me ...(say what you believe you have been asked)...
8️⃣ Asking for repetition
🔸Sorry, would you mind repeating the question?
🔸Sorry, I didn't quite catch that. Could you repeat the question?
9️⃣ Summing up
🔸So all in all...
🔸To sum up...
🔸To conclude...
1️⃣ Saying something in another way
🔸What I'm trying to say is...
🔸In other words...
🔸To put it another way...
🔸What I mean is...
🔸Perhaps I should make that clearer by saying...
2️⃣ Agreeing with an opinion
🔸Yes, I agree...
🔸That's my view exactly.
🔸I would tend to agree with that.
🔸I couldn't agree more.
3️⃣ Disagreeing with an opinion
🔸No, I disagree.
🔸I'm afraid I disagree.
🔸I see things rather differently myself.
🔸I wouldn't say that is necessarily true.
🔸I tend to disagree.
🔸I'm not so sure about that.
4️⃣ Partially agreeing with an opinion
🔸I don't entirely agree. It is true that......however...
🔸That is partly true, but...
🔸I agree with that to an extent. However...
5️⃣ Getting asked an opinion (by the examiner)
🔸What do you think?
🔸What's your view / opinion?
🔸What are your views on...?
🔸How do you feel about...?
6️⃣ Saying your opinion could vary according to the situation
🔸That depends...
🔸I think it really depends...
🔸That depends on how you look at it.
7️⃣ Asking for clarification (part 3 only)
🔸Could you please explain what ...(word)... means?
🔸Sorry, I don't understand the question. Could you explain?
🔸Sorry, I'm afraid I didn't understand the question.
🔸Sorry, can I just clarify what you mean. Are you asking me ...(say what you believe you have been asked)...
8️⃣ Asking for repetition
🔸Sorry, would you mind repeating the question?
🔸Sorry, I didn't quite catch that. Could you repeat the question?
9️⃣ Summing up
🔸So all in all...
🔸To sum up...
🔸To conclude...
Forwarded from .
https://github.com/tebelorg/TagUI-Python
一个 Python 自动化模块,或许可以用来编写游戏脚本
一个 Python 自动化模块,或许可以用来编写游戏脚本
GitHub
tebelorg/RPA-Python
Python package for doing RPA. Contribute to tebelorg/RPA-Python development by creating an account on GitHub.
Forwarded from .
https://www.blog.duomly.com/how-to-start-with-machine-learning/
在这个人人都在谈论人工智能,传播大量无头绪机器学习资源资料的年代,初学者到底如何开始学习?本文作者给出了建议。
在这个人人都在谈论人工智能,传播大量无头绪机器学习资源资料的年代,初学者到底如何开始学习?本文作者给出了建议。
Duomly
How to Start with Machine Learning?
In this article, I'd like to tell you how to start with machine learning, and what to do to learn algorithms that will help you to build smart apps.