Rust 程序设计语言 简体中文版 1.85.0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1. 入门指南 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 。 源代码 生成本书的源码可以在 GitHub 上找到。 译者注:此译本也有 GitHub 仓库,欢迎提交 Issue 和 PR :) 10/562Rust 程序设计语言 简体中文版 入门指南 让我们开始 Rust 之旅!有很多内容需要学习,但每次旅程总有起点。在本章中,我们会讨论: • 在 Linux、macOS 和 Windows 上安装 Rust • 编写一个打印 Hello, 对象的上下文,将分别在第六章和第十八章讲解),并且它 们第一个参数总是 self,它代表调用该方法的结构体实例。 定义方法 让我们把前面实现的获取一个 Rectangle 实例作为参数的 area 函数,改写成一个定义于 Rectangle 结构体上的 area 方法,如示例 5-13 所示: 文件名:src/main.rs #[derive(Debug)] struct Rectangle {0 码力 | 562 页 | 3.23 MB | 29 天前3
人工智能安全治理框架 1.0构建负责任的人工智能研发应用体系。研究提出“以人为本、智能 向善”在人工智能研发应用中的具体操作指南和最佳实践,持续推进人工智能 设计、研发、应用的价值观、伦理观对齐。探索适应人工智能时代的版权保护 和开发利用制度,持续推进高质量基础语料库和数据集建设,为人工智能安全 发展提供优质营养供给。制定人工智能伦理审查准则、规范和指南,完善伦理 审查制度。 5.5 强化人工智能供应链安全保障。推动共享人工智能知识成果,开0 码力 | 20 页 | 3.79 MB | 1 月前3
Tornado 6.5 Documentationfunction: from tornado.httpclient import HTTPClient def synchronous_fetch(url): http_client = HTTPClient() response = http_client.fetch(url) return response.body And here is the same function rewritten asynchronously httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() response = await http_client.fetch(url) return response.body Or for compatibility with older versions AsyncHTTPClient from tornado import gen @gen.coroutine def async_fetch_gen(url): http_client = AsyncHTTPClient() response = yield http_client.fetch(url) raise gen.Return(response.body) Coroutines are a little magical0 码力 | 272 页 | 1.12 MB | 3 月前3
Tornado 6.5 Documentationfrom tornado.httpclient import HTTPClient def synchronous_fetch(url): http_client = HTTPClient() response = http_client.fetch(url) return response.body And here is the same function rewritten httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() response = await http_client.fetch(url) return response.body Or for compatibility with older tornado import gen @gen.coroutine def async_fetch_gen(url): http_client = AsyncHTTPClient() response = yield http_client.fetch(url) raise gen.Return(response.body) Coroutines are a little0 码力 | 437 页 | 405.14 KB | 3 月前3
julia 1.10.10by package actions which change the manifest. See Pkg.precompile. JULIA_PKG_SERVER Specifies the URL of the package registry to use. By default, Pkg uses https://pkg.julialang.org to fetch Julia packages ExponentialBackOff(n=3, first_delay=5, max_delay=1000)) retry(http_get, check=(s,e)->e.status == "503")(url) retry(read, check=(s,e)->isa(e, IOError))(io, 128; all=false) source Base.ExponentialBackOff – instead. source Base.download – Function. download(url::AbstractString, [path::AbstractString = tempname()]) -> path Download a file from the given url, saving it to the location path, or if not specified0 码力 | 1692 页 | 6.34 MB | 3 月前3
Julia 1.10.9by package actions which change the manifest. See Pkg.precompile. JULIA_PKG_SERVER Specifies the URL of the package registry to use. By default, Pkg uses https://pkg.julialang.org to fetch Julia packages ExponentialBackOff(n=3, first_delay=5, max_delay=1000)) retry(http_get, check=(s,e)->e.status == "503")(url) retry(read, check=(s,e)->isa(e, IOError))(io, 128; all=false) source Base.ExponentialBackOff – instead. source Base.download – Function. download(url::AbstractString, [path::AbstractString = tempname()]) -> path Download a file from the given url, saving it to the location path, or if not specified0 码力 | 1692 页 | 6.34 MB | 3 月前3
Julia 1.11.4by package actions which change the manifest. See Pkg.precompile. JULIA_PKG_SERVER Specifies the URL of the package registry to use. By default, Pkg uses https://pkg.julialang.org to fetch Julia packages ExponentialBackOff(n=3, first_delay=5, max_delay=1000)) retry(http_get, check=(s,e)->e.status == "503")(url) retry(read, check=(s,e)->isa(e, IOError))(io, 128; all=false) source Base.ExponentialBackOff – instead. source Base.download – Function. download(url::AbstractString, [path::AbstractString = tempname()]) -> path Download a file from the given url, saving it to the location path, or if not specified0 码力 | 2007 页 | 6.73 MB | 3 月前3
Julia 1.11.5 Documentationby package actions which change the manifest. See Pkg.precompile. JULIA_PKG_SERVER Specifies the URL of the package registry to use. By default, Pkg uses https://pkg.julialang.org to fetch Julia packages ExponentialBackOff(n=3, first_delay=5, max_delay=1000)) retry(http_get, check=(s,e)->e.status == "503")(url) retry(read, check=(s,e)->isa(e, IOError))(io, 128; all=false) source Base.ExponentialBackOff – instead. source Base.download – Function. download(url::AbstractString, [path::AbstractString = tempname()]) -> path Download a file from the given url, saving it to the location path, or if not specified0 码力 | 2007 页 | 6.73 MB | 3 月前3
Julia 1.11.6 Release Notesby package actions which change the manifest. See Pkg.precompile. JULIA_PKG_SERVER Specifies the URL of the package registry to use. By default, Pkg uses https://pkg.julialang.org to fetch Julia packages ExponentialBackOff(n=3, first_delay=5, max_delay=1000)) retry(http_get, check=(s,e)->e.status == "503")(url) retry(read, check=(s,e)->isa(e, IOError))(io, 128; all=false) source Base.ExponentialBackOff – instead. source Base.download – Function. download(url::AbstractString, [path::AbstractString = tempname()]) -> path Download a file from the given url, saving it to the location path, or if not specified0 码力 | 2007 页 | 6.73 MB | 3 月前3
julia 1.13.0 DEVby package actions which change the manifest. See Pkg.precompile. JULIA_PKG_SERVER Specifies the URL of the package registry to use. By default, Pkg uses https://pkg.julialang.org to fetch Julia packages ExponentialBackOff(n=3, first_delay=5, max_delay=1000)) retry(http_get, check=(s,e)->e.status == "503")(url) retry(read, check=(s,e)->isa(e, IOError))(io, 128; all=false) source Base.ExponentialBackOff – FILESYSTEM 1203 Base.download – Function. download(url::AbstractString, [path::AbstractString = tempname()]) -> path Download a file from the given url, saving it to the location path, or if not specified0 码力 | 2058 页 | 7.45 MB | 3 月前3
共 16 条
- 1
- 2













