Compile-Time Validation
Utils Accidental Software Vulnerabilities Spectre MeltdownMemory Safety "Memory safety is the state of being protected from various software bugs and security vulnerabilities when dealing with memory computations with context, allowing for the chaining of operations while managing side effects or state through a standardized interface.Composition - Return Values Compose two functions (f1, f2) into destroy_action {}; enum class opt_exists { yes, no, maybe }; templateState> class opt { std::optional data; public: static constexpr auto id = ID; constexpr auto 0 码力 | 137 页 | 1.70 MB | 5 月前3Implementing Particle Filters with Ranges
Practical recommendations and remarks 4BAYESIAN FILTERS Algorithms used to estimate the internal state of a dynamical system given noisy observations and random perturbations in the system itself. Prediction Observation model X BELIEF - Represented by a set of particles PARTICLE - A single hyphotesis of the state of the system with an associated weight 6PARTICLE FILTERS Prediction bel(Xt-1) bel(Xt) Update particles with high weights Eliminate particles with low weights 6.1MONTE CARLO LOCALIZATION (MCL) STATE - Position and orientation of the robot TRANSITION - Control commands, odometry, etc. OBSERVATION0 码力 | 83 页 | 4.70 MB | 5 月前3Working with Asynchrony Generically: A Tour of C++ Executors
sender21 BASIC LIFETIME OF AN ASYNC OPERATION SCHEDULER schedule SENDER RECEIVER OPERATION STATE connect start …operation completes… … and notifies receiver … time passes… Implementation sender22 SHAPE OF A RECEIVER RECEIVER set_value(values... ) set_error(error ) set_done() Operation state notifies receiver by calling one of these exactly once.23 CONCEPTUAL BUILDING BLOCKS OF P2300 operation_state; concept receiver: set_value(receiver, Values...) void; set_error(receiver, Error) void; set_done(receiver) void; concept operation_state: start(operation_state) void;240 码力 | 121 页 | 7.73 MB | 5 月前3Multi Producer, Multi Consumer, Lock Free, Atomic Queue
next read/pop operation ● The relation between the content of the cell and the index defines the state of the index ● Cell & Entry content and Indices content are updated using CAS only ● There is no e, MPMC Queue - Depth Capacity 4 - S_0 - Empty State: Empty Seq: 3 D.Flag: 0 State: Empty Seq: 2 D.Flag: 0 State: Empty Seq: 1 D.Flag: 0 State: Empty Seq: 0 D.Flag: 0 Write Index: 0 Read Index: Queue - Depth Capacity 4 - S_1 - One data item State: Empty Seq: 3 D.Flag: 0 State: Empty Seq: 2 D.Flag: 0 State: Empty Seq: 1 D.Flag: 0 State: Full Seq: 0 D.Flag: 1 Write Index: 1 Read Index:0 码力 | 54 页 | 886.12 KB | 5 月前3So You Think You Can Hash
Insights Anatomy of a Hash Function 1. Initialize internal state 2. Consume bytes into internal state 3. Finalize internal state to result type (usually size_t)2024 Victor Ciura | @ciura_victor std::size_t len) { std::size_t h = 14695981039346656037u; ⇐ initialize internal state // consume bytes into internal state: unsigned char const * p = static_cast(key); unsigned len; for (; p < e; ++p) h = (h ^ *p) * 1099511628211u; return h; ⇐ finalize internal state to size_t }2024 Victor Ciura | @ciura_victor - Unleashing 🦀 The Ferris Within 30 Anatomy of 0 码力 | 119 页 | 6.54 MB | 5 月前3deploying the networking TS
bytes to be shifted ...discard bytes read from the network 13 Writing DataConn using async_write_state = std::array; // Completion signature: // void(std::error_code, std::size_t); template decltype(auto) async_write(AsyncWriteStream& stream, message_type type, async_write_state& state, ConstBufferSequence payload, CompletionToken&& token); 14 Building a Toolbox Overarching typename CompletionToken> decltype(auto) async_heartbeat(AsyncWriteStream& stream, async_write_state& state, WaitableTimer& timer, Events events, CompletionToken&& token); 16 Events Complex asynchronous 0 码力 | 44 页 | 892.77 KB | 5 月前3The Most Important Design Guideline is Testability
my classes testable. I sometimes find that the issue is hidden state. I then have to find ways to expose and manipulate that state in test cases. Sometimes that causes new problems typically exposing my classes testable. I sometimes find that the issue is hidden state. I then have to find ways to expose and manipulate that state in test cases. Sometimes that causes new problems typically exposing my classes testable. I sometimes find that the issue is hidden state. I then have to find ways to expose and manipulate that state in test cases. Sometimes that causes new problems typically exposing0 码力 | 126 页 | 9.11 MB | 5 月前3Hello 算法 1.0.0b4 C++版
com 250 在以下框架代码中,state 表示问题的当前状态,choices 表示当前状态下可以做出的选择。 /* 回溯算法框架 */ void backtrack(State *state, vector&choices, vector<State *> &res) { // 判断是否为解 if (isSolution(state)) { // 记录解 recordSolution(state recordSolution(state, res); // 停止继续搜索 return; } // 遍历所有选择 for (Choice choice : choices) { // 剪枝:判断选择是否合法 if (isValid(state, choice)) { // 尝试:做出选择,更新状态 makeChoice(state, choice); backtrack(state, choices choices, res); // 回退:撤销选择,恢复到之前的状态 undoChoice(state, choice); } } } 接下来,我们基于框架代码来解决例题三。状态 state 为节点遍历路径,选择 choices 为当前节点的左子节 点和右子节点,结果 res 是路径列表。 // === File: preorder_traversal_iii_template.cpp === 0 码力 | 343 页 | 27.39 MB | 1 年前3Hello 算法 1.1.0 C++ 版
的通用性。 在以下框架代码中,state 表示问题的当前状态,choices 表示当前状态下可以做出的选择: /* 回溯算法框架 */ void backtrack(State *state, vector&choices, vector<State *> &res) { // 判断是否为解 if (isSolution(state)) { // 记录解 recordSolution(state recordSolution(state, res); // 不再继续搜索 return; } // 遍历所有选择 for (Choice choice : choices) { // 剪枝:判断选择是否合法 if (isValid(state, choice)) { // 尝试:做出选择,更新状态 makeChoice(state, choice); backtrack(state, choices choices, res); // 回退:撤销选择,恢复到之前的状态 undoChoice(state, choice); } } } 接下来,我们基于框架代码来解决例题三。状态 state 为节点遍历路径,选择 choices 为当前节点的左子节 点和右子节点,结果 res 是路径列表: // === File: preorder_traversal_iii_template.cpp === 0 码力 | 379 页 | 18.47 MB | 1 年前3Hello 算法 1.0.0 C++版
的通用性。 在以下框架代码中,state 表示问题的当前状态,choices 表示当前状态下可以做出的选择: /* 回溯算法框架 */ void backtrack(State *state, vector&choices, vector<State *> &res) { // 判断是否为解 if (isSolution(state)) { // 记录解 recordSolution(state recordSolution(state, res); // 不再继续搜索 return; } // 遍历所有选择 for (Choice choice : choices) { // 剪枝:判断选择是否合法 if (isValid(state, choice)) { // 尝试:做出选择,更新状态 makeChoice(state, choice); backtrack(state, choices choices, res); // 回退:撤销选择,恢复到之前的状态 undoChoice(state, choice); } } } 接下来,我们基于框架代码来解决例题三。状态 state 为节点遍历路径,选择 choices 为当前节点的左子节 点和右子节点,结果 res 是路径列表: 第 13 章 回溯 hello‑algo.com 282 // === File: preorde 0 码力 | 378 页 | 17.59 MB | 1 年前3
共 210 条
- 1
- 2
- 3
- 4
- 5
- 6
- 21