 Rust 程序设计语言 简体中文版 1.85.0现在让我们转向一些不太复杂的集合:哈希 map! 164/562Rust 程序设计语言 简体中文版 使用 Hash Map 储存键值对 最后介绍的常用集合类型是哈希 map(hash map)。HashMap<K, V> 类型储存了一个键类型 K 对应一个值类型 V 的映射。它通过一个哈希函数(hashing function)来实现映射,决定如何 将键和值放入内存中。很多编程语言支持这种数据结构,不过通常有不同的名字:哈希、 map 中,其中键是队伍的名字而 值是每个队伍的分数。给出一个队名,就能检索到该队的得分。 本章我们会介绍哈希 map 的基本 API,不过还有更多吸引人的功能隐藏于标准库在 HashMap<K, V> 上定义的函数中。一如既往请查看标准库文档来了解更多信息。 新建一个哈希 map 可以使用 new 创建一个空的 HashMap,并使用 insert 增加元素。在示例 8-20 中我们记录两支 String 这样具体类型的泛型参数,就像一个获取未知类型值 的函数可以对多种具体类型的值运行同一段代码一样。事实上我们已经使用过第六章的 Option Rust 程序设计语言 简体中文版 1.85.0现在让我们转向一些不太复杂的集合:哈希 map! 164/562Rust 程序设计语言 简体中文版 使用 Hash Map 储存键值对 最后介绍的常用集合类型是哈希 map(hash map)。HashMap<K, V> 类型储存了一个键类型 K 对应一个值类型 V 的映射。它通过一个哈希函数(hashing function)来实现映射,决定如何 将键和值放入内存中。很多编程语言支持这种数据结构,不过通常有不同的名字:哈希、 map 中,其中键是队伍的名字而 值是每个队伍的分数。给出一个队名,就能检索到该队的得分。 本章我们会介绍哈希 map 的基本 API,不过还有更多吸引人的功能隐藏于标准库在 HashMap<K, V> 上定义的函数中。一如既往请查看标准库文档来了解更多信息。 新建一个哈希 map 可以使用 new 创建一个空的 HashMap,并使用 insert 增加元素。在示例 8-20 中我们记录两支 String 这样具体类型的泛型参数,就像一个获取未知类型值 的函数可以对多种具体类型的值运行同一段代码一样。事实上我们已经使用过第六章的 Option- ,第八章的 Vec - 和 HashMap<K, V>,以及第九章的 Result - 这些泛型了。本 章会探索如何使用泛型定义我们自己的类型、函数和方法! 首先,我们将回顾一下提取函数以减少代码重复的机制。接下来,我们将使用相同的技术,从 0 码力 | 562 页 | 3.23 MB | 26 天前3
 【周鸿祎清华演讲】DeepSeek给我们带来的创业机会-360周鸿祎-202502皮带托辊异常检测 • 分析监测烧结工序物料 成分 • 烧结皮带智能监测 • 烧结设备运行工况检测 • 料场生产计划智能配置 • 烧结矿成分预测 • 烧结矿质量预测 • 烧结烟气 S02 排放在 线预测与控制 • 构建能源消耗预测 • 智能故障诊断 • 挡板位移检测 • 皮带划痕、 撕裂、 跑偏检测预警 • 1球团皮带智能监测 • 生球粒度分布在线 识别 • 球团1颗粒粒度检测 • 球团1现场生产安全 • 热卷带头方向识别 • 钢卷带头监测与联动控制 • 钢卷托举位置对中检测 • 宽厚板双边剪自动对中 • 钢卷喷号自动识别 • 棒材自动数支数 • 自动控制转钢辊道的转向 和转速 • 连轧机组中心线检测 • 轧钢机械振动故障的诊断 • 轧次计划优化算法 • 断带预测分析 • 带钢卷取温度高精度预报 • 带钢跑偏预测分析 • 掉顶头异常识别 • 热轧管材表面质检 • 钢管识别跟踪 • 铸管外表面缺陷自动检测0 码力 | 76 页 | 5.02 MB | 5 月前3 【周鸿祎清华演讲】DeepSeek给我们带来的创业机会-360周鸿祎-202502皮带托辊异常检测 • 分析监测烧结工序物料 成分 • 烧结皮带智能监测 • 烧结设备运行工况检测 • 料场生产计划智能配置 • 烧结矿成分预测 • 烧结矿质量预测 • 烧结烟气 S02 排放在 线预测与控制 • 构建能源消耗预测 • 智能故障诊断 • 挡板位移检测 • 皮带划痕、 撕裂、 跑偏检测预警 • 1球团皮带智能监测 • 生球粒度分布在线 识别 • 球团1颗粒粒度检测 • 球团1现场生产安全 • 热卷带头方向识别 • 钢卷带头监测与联动控制 • 钢卷托举位置对中检测 • 宽厚板双边剪自动对中 • 钢卷喷号自动识别 • 棒材自动数支数 • 自动控制转钢辊道的转向 和转速 • 连轧机组中心线检测 • 轧钢机械振动故障的诊断 • 轧次计划优化算法 • 断带预测分析 • 带钢卷取温度高精度预报 • 带钢跑偏预测分析 • 掉顶头异常识别 • 热轧管材表面质检 • 钢管识别跟踪 • 铸管外表面缺陷自动检测0 码力 | 76 页 | 5.02 MB | 5 月前3
 Manus AI:Agent元年开启9):;<=>Manus ?@A+'BCDEFGHIJK,LMN OPQMR<"S>TUVWXY3 less structure more intelligence GZ[5\]^_`abcde_`fgchi_`jEc'k_` lm,no computer usecdeep researchccoding agent pqrstuvwxyz{|}~•G)€>•JK‚ƒ Manus,•P„…†‡ ˆ‰Š‹xG'B,LJKŒkF • ManusÐ!ÑÒÓ*GÔg<Õ5 • uvÖk5tAIןØAI AgentGÙÚÛ© • ÜÝÞßà5zChromeCEdgeÜÝÞáâAIŸ ßà,QŸ%ãLäå°æ3çècéœYouTubeêëcìíGmail/LinkedIn/Twitter•º p> • Ž4CîïÁ%5áâŽ4CîïÁ%kð,ñ%ã•ÌòPòóñ%AIŸ ôK> • AIdeAPIõö5z÷øÕáâAPIõö µdeG÷øÕf$2°,67ËþæacCFWghX Manus AI:Agent元年开启9):;<=>Manus ?@A+'BCDEFGHIJK,LMN OPQMR<"S>TUVWXY3 less structure more intelligence GZ[5\]^_`abcde_`fgchi_`jEc'k_` lm,no computer usecdeep researchccoding agent pqrstuvwxyz{|}~•G)€>•JK‚ƒ Manus,•P„…†‡ ˆ‰Š‹xG'B,LJKŒkF • ManusÐ!ÑÒÓ*GÔg<Õ5 • uvÖk5tAIןØAI AgentGÙÚÛ© • ÜÝÞßà5zChromeCEdgeÜÝÞáâAIŸ ßà,QŸ%ãLäå°æ3çècéœYouTubeêëcìíGmail/LinkedIn/Twitter•º p> • Ž4CîïÁ%5áâŽ4CîïÁ%kð,ñ%ã•ÌòPòóñ%AIŸ ôK> • AIdeAPIõö5z÷øÕáâAPIõö µdeG÷øÕf$2°,67ËþæacCFWghX- FPŸ R³Œjk Clm<ÑG]nopmqr>st2022E,FPŸ R<100'u#xÆS)÷ø,vw60+3C,ôK40[+cC%ã,xŸcCyz 7700[+FW{ã,|/5nFW}$~•> • L€Monica•‚,9€Œ"ƒ<„…Muv,ƒ5†D‡[ˆ%GD‡5†IJÞ--‰Š!ƒD‡5†[ˆGfigma> 0 码力 | 23 页 | 4.87 MB | 5 月前3
 Trends Artificial Intelligence
language models shown (per Epoch AI, includes state of the art improvement on a recognized benchmark, >1K citations, historically relevant, with significant use). Source: Epoch AI (5/25) Training Dataset language models shown (per Epoch AI, includes state of the art improvement on a recognized benchmark, >1K citations, historically relevant, with significant use). Source: Epoch AI (5/25) Training Compute 5MM 6MM 0 3 6 Number of Developers (MM) 7K 27K 0 15 30 2021 2025 Number of AI Startups (K) Number of Applications Using GPUs (K) 1.7K 4K 0 2.5 5 +2.4x +3.9x +2.4x Technology Ecosystem0 码力 | 340 页 | 12.14 MB | 4 月前3 Trends Artificial Intelligence
language models shown (per Epoch AI, includes state of the art improvement on a recognized benchmark, >1K citations, historically relevant, with significant use). Source: Epoch AI (5/25) Training Dataset language models shown (per Epoch AI, includes state of the art improvement on a recognized benchmark, >1K citations, historically relevant, with significant use). Source: Epoch AI (5/25) Training Compute 5MM 6MM 0 3 6 Number of Developers (MM) 7K 27K 0 15 30 2021 2025 Number of AI Startups (K) Number of Applications Using GPUs (K) 1.7K 4K 0 2.5 5 +2.4x +3.9x +2.4x Technology Ecosystem0 码力 | 340 页 | 12.14 MB | 4 月前3
 julia 1.10.10accurate log(1+x) for x near zero exponent(x) binary exponent of x significand(x) binary significand (a.k.a. mantissa) of a floating-point number x Trigonometric and hyperbolic functions All the standard a substring using range indexing: julia> str[4:9] "lo, wo" Notice that the expressions str[k] and str[k:k] do not give the same result: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation iterated over at the same time in a single for loop using zip: julia> for (j, k) in zip([1 2 3], [4 5 6 7]) println((j,k)) end (1, 4) (2, 5) (3, 6) Using zip will create an iterator that is a tuple0 码力 | 1692 页 | 6.34 MB | 3 月前3 julia 1.10.10accurate log(1+x) for x near zero exponent(x) binary exponent of x significand(x) binary significand (a.k.a. mantissa) of a floating-point number x Trigonometric and hyperbolic functions All the standard a substring using range indexing: julia> str[4:9] "lo, wo" Notice that the expressions str[k] and str[k:k] do not give the same result: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation iterated over at the same time in a single for loop using zip: julia> for (j, k) in zip([1 2 3], [4 5 6 7]) println((j,k)) end (1, 4) (2, 5) (3, 6) Using zip will create an iterator that is a tuple0 码力 | 1692 页 | 6.34 MB | 3 月前3
 Julia 1.10.9accurate log(1+x) for x near zero exponent(x) binary exponent of x significand(x) binary significand (a.k.a. mantissa) of a floating-point number x Trigonometric and hyperbolic functions All the standard a substring using range indexing: julia> str[4:9] "lo, wo" Notice that the expressions str[k] and str[k:k] do not give the same result: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation iterated over at the same time in a single for loop using zip: julia> for (j, k) in zip([1 2 3], [4 5 6 7]) println((j,k)) end (1, 4) (2, 5) (3, 6) Using zip will create an iterator that is a tuple0 码力 | 1692 页 | 6.34 MB | 3 月前3 Julia 1.10.9accurate log(1+x) for x near zero exponent(x) binary exponent of x significand(x) binary significand (a.k.a. mantissa) of a floating-point number x Trigonometric and hyperbolic functions All the standard a substring using range indexing: julia> str[4:9] "lo, wo" Notice that the expressions str[k] and str[k:k] do not give the same result: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation iterated over at the same time in a single for loop using zip: julia> for (j, k) in zip([1 2 3], [4 5 6 7]) println((j,k)) end (1, 4) (2, 5) (3, 6) Using zip will create an iterator that is a tuple0 码力 | 1692 页 | 6.34 MB | 3 月前3
 Julia 1.11.4log(1 + x) for x near zero exponent(x) binary exponent of x significand(x) binary significand (a.k.a. mantissa) of a floating-point number x Powers, logs and roots For an overview of why functions a substring using range indexing: julia> str[4:9] "lo, wo" Notice that the expressions str[k] and str[k:k] do not give the same result: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation iterated over at the same time in a single for loop using zip: julia> for (j, k) in zip([1 2 3], [4 5 6 7]) println((j,k)) end (1, 4) (2, 5) (3, 6) Using zip will create an iterator that is a tuple0 码力 | 2007 页 | 6.73 MB | 3 月前3 Julia 1.11.4log(1 + x) for x near zero exponent(x) binary exponent of x significand(x) binary significand (a.k.a. mantissa) of a floating-point number x Powers, logs and roots For an overview of why functions a substring using range indexing: julia> str[4:9] "lo, wo" Notice that the expressions str[k] and str[k:k] do not give the same result: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation iterated over at the same time in a single for loop using zip: julia> for (j, k) in zip([1 2 3], [4 5 6 7]) println((j,k)) end (1, 4) (2, 5) (3, 6) Using zip will create an iterator that is a tuple0 码力 | 2007 页 | 6.73 MB | 3 月前3
 Julia 1.11.5 Documentationlog(1 + x) for x near zero exponent(x) binary exponent of x significand(x) binary significand (a.k.a. mantissa) of a floating-point number x Powers, logs and roots For an overview of why functions a substring using range indexing: julia> str[4:9] "lo, wo" Notice that the expressions str[k] and str[k:k] do not give the same result: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation iterated over at the same time in a single for loop using zip: julia> for (j, k) in zip([1 2 3], [4 5 6 7]) println((j,k)) end (1, 4) (2, 5) (3, 6) Using zip will create an iterator that is a tuple0 码力 | 2007 页 | 6.73 MB | 3 月前3 Julia 1.11.5 Documentationlog(1 + x) for x near zero exponent(x) binary exponent of x significand(x) binary significand (a.k.a. mantissa) of a floating-point number x Powers, logs and roots For an overview of why functions a substring using range indexing: julia> str[4:9] "lo, wo" Notice that the expressions str[k] and str[k:k] do not give the same result: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation iterated over at the same time in a single for loop using zip: julia> for (j, k) in zip([1 2 3], [4 5 6 7]) println((j,k)) end (1, 4) (2, 5) (3, 6) Using zip will create an iterator that is a tuple0 码力 | 2007 页 | 6.73 MB | 3 月前3
 Julia 1.11.6 Release Noteslog(1 + x) for x near zero exponent(x) binary exponent of x significand(x) binary significand (a.k.a. mantissa) of a floating-point number x Powers, logs and roots For an overview of why functions a substring using range indexing: julia> str[4:9] "lo, wo" Notice that the expressions str[k] and str[k:k] do not give the same result: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation iterated over at the same time in a single for loop using zip: julia> for (j, k) in zip([1 2 3], [4 5 6 7]) println((j,k)) end (1, 4) (2, 5) (3, 6) Using zip will create an iterator that is a tuple0 码力 | 2007 页 | 6.73 MB | 3 月前3 Julia 1.11.6 Release Noteslog(1 + x) for x near zero exponent(x) binary exponent of x significand(x) binary significand (a.k.a. mantissa) of a floating-point number x Powers, logs and roots For an overview of why functions a substring using range indexing: julia> str[4:9] "lo, wo" Notice that the expressions str[k] and str[k:k] do not give the same result: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation iterated over at the same time in a single for loop using zip: julia> for (j, k) in zip([1 2 3], [4 5 6 7]) println((j,k)) end (1, 4) (2, 5) (3, 6) Using zip will create an iterator that is a tuple0 码力 | 2007 页 | 6.73 MB | 3 月前3
 julia 1.13.0 DEVlog(1 + x) for x near zero exponent(x) binary exponent of x significand(x) binary significand (a.k.a. mantissa) of a floating-point number x sin cos tan cot sec csc sinh cosh tanh coth sech csch asin a substring using range indexing: julia> str[4:9] "lo, wo" Notice that the expressions str[k] and str[k:k] do not give the same result: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation iterated over at the same time in a single for loop using zip: julia> for (j, k) in zip([1 2 3], [4 5 6 7]) println((j,k)) end (1, 4) (2, 5) (3, 6) Using zip will create an iterator that is a tuple0 码力 | 2058 页 | 7.45 MB | 3 月前3 julia 1.13.0 DEVlog(1 + x) for x near zero exponent(x) binary exponent of x significand(x) binary significand (a.k.a. mantissa) of a floating-point number x sin cos tan cot sec csc sinh cosh tanh coth sech csch asin a substring using range indexing: julia> str[4:9] "lo, wo" Notice that the expressions str[k] and str[k:k] do not give the same result: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation iterated over at the same time in a single for loop using zip: julia> for (j, k) in zip([1 2 3], [4 5 6 7]) println((j,k)) end (1, 4) (2, 5) (3, 6) Using zip will create an iterator that is a tuple0 码力 | 2058 页 | 7.45 MB | 3 月前3
共 25 条
- 1
- 2
- 3














 
 