Rust算法教程 The Algos (algorithms)如果当前循环没有发⽣元素交换,说明数组已经有序 if !swapped { break; } } } #[cfg(test)] mod tests { use super::*; #[test] fn test_empty_vec() { let mut empty_vec: Vecfor x in bucket { result.push(x); } } result } #[cfg(test)] mod tests { use super::super::is_sorted; use super::*; #[test] fn empty() { let arr: } } if !swapped { break; } } } #[cfg(test)] mod tests { use super::*; #[test] fn basic() { let mut arr = vec![5, 2, 1, 3, 4, 6]; 0 码力 | 270 页 | 8.46 MB | 1 年前3
Node.js Manual & Documentationencoding='utf8') o buffer.write(string, offset=0, encoding='utf8') o buffer.toString(encoding, start=0, end=buffer.length) o buffer[index] o Buffer.isBuffer(obj) o Buffer.byteLength(string, encoding='utf8') sourceEnd=buffer.length) o buffer.slice(start, end=buffer.length) Streams 流 Readable Stream 可读流 o Event: 'data' 事件:'data' o Event: 'end' 事件:'end' o Event: 'error' 事件:'error' o Event: 'close' write(string, encoding='utf8', [fd]) o stream.write(buffer) o stream.end() o stream.end(string, encoding) o stream.end(buffer) o stream.destroy() Crypto 加密模块 o crypto.createCredentials(details)0 码力 | 153 页 | 1.21 MB | 1 年前3
使用 PlantUML 绘制 UML - PlantUML 语言参考指引(Version 1.2019.1)• loop • par • break • critical • group, 后面紧跟着消息内容 可以在标头 (header) 添加需要显示的文字 (group 除外)。 关键词 end 用来结束分组。 注意,分组可以嵌套使用。 @startuml Alice -> Bob: Authentication Request alt successful case Bob -> start loop 1000 times Alice -> Bob: DNS Attack end Alice -> Log : Log attack end end else Another type of failure Bob -> Alice: Please repeat end @enduml 1.11 给消息添加注释 我们可以通过在消息后面添加 note left 或者 或者 note right 关键词来给消息添加注释。 PlantUML 语言参考指引 (1.2019.1) 8 / 145 1.12 其他的注释 1 时序图 你也可以通过使用 end note 来添加多行注释。 @startuml Alice->Bob : hello note left: this is a first note Bob->Alice : ok note right: this0 码力 | 146 页 | 1.91 MB | 1 年前3
PlantUML 1.2019.3 语言参考指引• loop • par • break • critical • group, 后面紧跟着消息内容 可以在标头 (header) 添加需要显示的文字 (group 除外)。 关键词 end 用来结束分组。 注意,分组可以嵌套使用。 @startuml Alice -> Bob: Authentication Request alt successful case Bob -> attack start loop 1000 times Alice -> Bob: DNS Attack end Alice -> Log : Log attack end end else Another type of failure Bob -> Alice: Please repeat end @enduml PlantUML 语言参考指引 (1.2019.3) 8 / 156 1.11 11 给消息添加注释 1 时序图 1.11 给消息添加注释 我们可以通过在消息后面添加 note left 或者 note right 关键词来给消息添加注释。 你也可以通过使用 end note 来添加多行注释。 @startuml Alice->Bob : hello note left: this is a first note Bob->Alice : ok note right: this0 码力 | 157 页 | 1.78 MB | 1 年前3
PlantUML 1.2019.2 语言参考指引• loop • par • break • critical • group, 后面紧跟着消息内容 可以在标头 (header) 添加需要显示的文字 (group 除外)。 关键词 end 用来结束分组。 注意,分组可以嵌套使用。 @startuml Alice -> Bob: Authentication Request alt successful case Bob -> attack start loop 1000 times Alice -> Bob: DNS Attack end Alice -> Log : Log attack end end else Another type of failure Bob -> Alice: Please repeat end @enduml PlantUML 语言参考指引 (1.2019.2) 8 / 156 1.11 11 给消息添加注释 1 时序图 1.11 给消息添加注释 我们可以通过在消息后面添加 note left 或者 note right 关键词来给消息添加注释。 你也可以通过使用 end note 来添加多行注释。 @startuml Alice->Bob : hello note left: this is a first note Bob->Alice : ok note right: this0 码力 | 157 页 | 1.78 MB | 1 年前3
Comprehensive Rust(简体中文) 202412return value. Simply omit the ; at the end of the expression. The return keyword can be used for early return, but the ”bare value” form is idiomatic at the end of a function (refactor gcd to use a return) covered in detail later in the course. An expression can be ”boxed” with Box::new as seen in the tests. To evaluate a boxed expression, use the deref operator (*) to ”unbox” it: eval(*boxed_expr). Some say that the variable owns the value. Every Rust value has precisely one owner at all times. At the end of the scope, the variable is dropped and the data is freed. A destructor can run here to free up resources0 码力 | 359 页 | 1.33 MB | 10 月前3
Julia 中文文档step to the package. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1051 Adding tests to the package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1051 Compatibility 'println(PROGRAM_FILE); for x in ARGS; println(x); end' foo bar 13 14 CHAPTER 3. 入门 foo bar 或者你可以把代码写到一个脚本文件中再执行它: $ echo 'println(PROGRAM_FILE); for x in ARGS; println(x); end' > script.jl $ julia script.jl foo Int128,UInt8,UInt16,UInt32,UInt64,UInt128] println("$(lpad(T,7)): [$(typemin(T)),$(typemax(T))]") end Int8: [-128,127] Int16: [-32768,32767] Int32: [-2147483648,2147483647] Int64: [-92233720368547758080 码力 | 1238 页 | 4.59 MB | 1 年前3
使用 PlantUML 绘制 UML - PlantUML 语言参考指引(Version 1.2019.9)• loop • par • break • critical • group, 后面紧跟着消息内容 可以在标头 (header) 添加需要显示的文字 (group 除外)。 关键词 end 用来结束分组。 注意,分组可以嵌套使用。 @startuml Alice -> Bob: Authentication Request alt successful case Bob -> attack start loop 1000 times Alice -> Bob: DNS Attack end Alice -> Log : Log attack end end else Another type of failure Bob -> Alice: Please repeat end @enduml PlantUML 语言参考指引 (1.2019.9) 8 / 173 1.11 11 给消息添加注释 1 时序图 1.11 给消息添加注释 我们可以通过在消息后面添加 note left 或者 note right 关键词来给消息添加注释。 你也可以通过使用 end note 来添加多行注释。 @startuml Alice->Bob : hello note left: this is a first note Bob->Alice : ok note right: this0 码力 | 174 页 | 2.00 MB | 1 年前3
使用 PlantUML 绘制 UML - PlantUML 语言参考指引(Version 1.2019.4)• loop • par • break • critical • group, 后面紧跟着消息内容 可以在标头 (header) 添加需要显示的文字 (group 除外)。 关键词 end 用来结束分组。 注意,分组可以嵌套使用。 @startuml Alice -> Bob: Authentication Request alt successful case Bob -> attack start loop 1000 times Alice -> Bob: DNS Attack end Alice -> Log : Log attack end end else Another type of failure Bob -> Alice: Please repeat end @enduml PlantUML 语言参考指引 (1.2019.4) 8 / 164 1.11 11 给消息添加注释 1 时序图 1.11 给消息添加注释 我们可以通过在消息后面添加 note left 或者 note right 关键词来给消息添加注释。 你也可以通过使用 end note 来添加多行注释。 @startuml Alice->Bob : hello note left: this is a first note Bob->Alice : ok note right: this0 码力 | 165 页 | 1.89 MB | 1 年前3
使用 PlantUML 绘制 UML - PlantUML 语言参考指引(Version 1.2019.6)• loop • par • break • critical • group, 后面紧跟着消息内容 可以在标头 (header) 添加需要显示的文字 (group 除外)。 关键词 end 用来结束分组。 注意,分组可以嵌套使用。 @startuml Alice -> Bob: Authentication Request alt successful case Bob -> attack start loop 1000 times Alice -> Bob: DNS Attack end Alice -> Log : Log attack end end else Another type of failure Bob -> Alice: Please repeat end @enduml PlantUML 语言参考指引 (1.2019.6) 8 / 173 1.11 11 给消息添加注释 1 时序图 1.11 给消息添加注释 我们可以通过在消息后面添加 note left 或者 note right 关键词来给消息添加注释。 你也可以通过使用 end note 来添加多行注释。 @startuml Alice->Bob : hello note left: this is a first note Bob->Alice : ok note right: this0 码力 | 174 页 | 1.98 MB | 1 年前3
共 577 条
- 1
- 2
- 3
- 4
- 5
- 6
- 58













