Fast and small C++sizeof(mSize)) == 24); 10 11 constexpr static size_t max_cap() { return std::numeric_limits::max(); } 12 constexpr static size_t sso_cap() { return sizeof(mBuf) − 1; /* −1 for '\0' */ } 13 constexpr constexpr static bool fits_into_sso(size_t len) { return len <= sso_cap(); } 14 constexpr bool is_long() const { return mPtr != mBuf; } 15 16 constexpr string() : mPtr{mBuf}, mBuf{} {} 17 constexpr string(const const { return mPtr; } 25 constexpr size_t capacity() const { return is_long() ? mCapacity : sso_cap(); } 26 }; Andreas Fertig v1.0 Fast and small C++ 14 Implementing the Small String Optimization 0 码力 | 17 页 | 790.91 KB | 6 月前3
Go 101 (Golang 101) v1.21.0referencing underlying elements elements unsafe.Pointer // number of elements and capacity len, cap int } So, internally, slice types are pointer wrapper struct types. Each non-zero slice value has We can use the built-in len function to get the length of a container value, and use the built-in cap function to get the capacity of a container value. Each of the two functions returns an int typed result passed argument is a constant expression. As the capacity of any map value is unlimited, the built-in cap function doesn't apply to map values. The length and capacity of an array value can never change.0 码力 | 610 页 | 945.17 KB | 1 年前3
Go 101 (Golang 101) v1.21.0underlying elements 3| elements unsafe.Pointer 4| // number of elements and capacity 5| len, cap int 6| } So, internally, slice types are pointer wrapper struct types. Each non-zero slice value has We can use the built-in len function to get the length of a container value, and use the built-in cap function to get the capacity of a container value. Each of the two functions returns an int typed passed argument is a constant expression. As the capacity of any map value is unlimited, the built-in cap function doesn't apply to map values. The length and capacity of an array value can never change0 码力 | 880 页 | 833.34 KB | 1 年前3
Go 101 (Golang 101) v1.21.0underlying elements 3| elements unsafe.Pointer 4| // number of elements and capacity 5| len, cap int 6| } So, internally, slice types are pointer wrapper struct types. Each non-zero slice value We can use the built-in len function to get the length of a container value, and use the built-in cap function to get the capacity of a container value. Each of the two functions returns an int typed passed argument is a constant expression. As the capacity of any map value is unlimited, the built-in cap function doesn't apply to map values. The length and capacity of an array value can never change0 码力 | 630 页 | 3.77 MB | 1 年前3
The Vitess 7.0 Documentatione- postpone-cap int query server message postpone cap is the maximum number of messages that can be postponed at any given time. Set this number to substantially lower than transaction cap, so that the 0 (default) then the overall query timeout is used instead. -queryserver-config-query-pool- waiter-cap int query server query pool waiter limit, this is the maximum number of queries that can be queued transaction-cap int query server transaction cap is the maximum number of transactions allowed to happen at any given point of a time for a single vttablet. E.g. by setting transaction cap to 100, there0 码力 | 254 页 | 949.63 KB | 1 年前3
Django 官方教程翻译项目CN) 构建 现在我们将用额外的元数据来定义你的模型 —— 本质上是你的数据库布局。 设计哲学 模型是你数据的简单明确的描述。它包含了储存的数据所必要的字段和行为。Django 遵循 DRY 原则。它的目标是让你只需要在一 个地方定义数据模型,Django 就能自动从中导出迁移代码。 来介绍一下迁移 - 举个例子,不像 Ruby On Rails,Django 的迁移代码全部都是从你的模型文件导出的,它本质上只是个历史 坏他们的)。如果你想作为一个 Django 程序 员谋生的话,你必须擅长编写测试! 测试有几种不同的应用方法。 一些开发者遵循 测试驱动开发(test-driven development)的原则,他们在写代码之前先写测 试。这种方法看起来有点反直觉,但事实上,这和大多数人日常的做法是相吻合的。我们会先描述一 个问题,然后写代码来解决它。「测试驱动」的开发方法只是将问题的描述抽象为了 Python0 码力 | 103 页 | 1.86 MB | 1 年前3
The Vitess 9.0 Documentationqueryserver -config-pool-prefill -parallelism maxWaiters: 50000 # queryserver -config-query-pool-waiter-cap olapReadPool: size: 200 # queryserver -config-stream-pool-size timeoutSeconds: 0 # queryserver -config-stream-pool-prefill -parallelism maxWaiters: 0 64 txPool: size: 20 # queryserver -config-transaction -cap timeoutSeconds: 1 # queryserver -config-txpool-timeout idleTimeoutSeconds: 1800 # queryserver -config-idle-timeout queryserver -config-transaction -prefill -parallelism maxWaiters: 50000 # queryserver -config-txpool-waiter-cap oltp: queryTimeoutSeconds: 30 # queryserver -config-query-timeout txTimeoutSeconds: 30 # queryserver0 码力 | 417 页 | 2.96 MB | 1 年前3
Keras: 基于 Python 的深度学习库1.1 你恰好发现了 Keras . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 指导原则 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.3 快速开始:30 同时支持卷积神经网络和循环神经网络,以及两者的组合。 • 在 CPU 和 GPU 上无缝运行。 查看文档,请访问 Keras.io。 Keras 兼容的 Python 版本: Python 2.7-3.6。 1.2 指导原则 • 用户友好。Keras 是为人类而不是为机器设计的 API。它把用户体验放在首要和中心位置。 Keras 遵循减少认知困难的最佳实践:它提供一致且简单的 API,将常见用例所需的用户 操作 compile(loss='categorical_crossentropy', optimizer='sgd', metrics=['accuracy']) 如果需要,你还可以进一步地配置你的优化器。Keras 的核心原则是使事情变得相当简单, 同时又允许用户在需要的时候能够进行完全的控制(终极的控制是源代码的易扩展性)。 model.compile(loss=keras.losses.categorical_crossentropy0 码力 | 257 页 | 1.19 MB | 1 年前3
The Vitess 8.0 Documentatione- postpone-cap int query server message postpone cap is the maximum number of messages that can be postponed at any given time. Set this number to substantially lower than transaction cap, so that the 0 (default) then the overall query timeout is used instead. -queryserver-config-query-pool- waiter-cap int query server query pool waiter limit, this is the maximum number of queries that can be queued ransaction- cap int query server transaction cap is the maximum number of transactions allowed to happen at any given point of a time for a single vttablet. E.g. by setting transaction cap to 100, there0 码力 | 331 页 | 1.35 MB | 1 年前3
The Way To Go - 2012functions (see § 6.5); all these will be explained further in the next chapters: append bool byte cap close complex complex64 complex128 uint16 copy false float32 float64 imag int int8 int16 uint32 int32 having to import a package to get access to them. They sometimes apply to different types, e.g. len, cap and append, or they have to operate near system level like panic. That’s why they need support from chapters. close Used in channel communication len cap len gives the length of a number of types (strings, arrays, slices, maps, channels); cap is the capacity, the maximum storage (only applicable0 码力 | 629 页 | 4.85 MB | 1 年前3
共 598 条
- 1
- 2
- 3
- 4
- 5
- 6
- 60













