Andreas Weis - Quickly Estimating Powers of Two
1/15 Quickly Estimating Powers-of-Two Andreas Weis Woven Planet CppCon 20212/15 About me ComicSansMS @DerGhulbus Co-organizer of the Munich C++ User Group Currently working as a Runtime Framework 223 =? 236 =? 2128 =?4/15 Small Powers of Two 21 = 2 22 = 4 23 = 8 24 = 16 25 = 32 26 = 64 27 = 128 28 = 256 29 = 5125/15 Small Powers of Two 21 = 2 22 = 4 23 = 8 24 = 16 25 = 32 26 = 5126/15 Small Powers of Two 21 = 2 22 = 4 23 = 8 24 = 16 25 = 32 26 = 64 27 = 128 28 = 256 (Number of states in an 8 bit char) 29 = 5127/15 Small Powers of Two 21 = 2 22 = 4 23 = 8 ⋄ 240 码力 | 56 页 | 326.32 KB | 5 月前3The Beauty and Power of Primitive C++
The Beauty and Power of “Primitive” C++ Bjarne Stroustrup Morgan Stanley, Columbia University www.Stroustrup.com Stroustrup - "Primitive" - CppCon 2020 1This year is different Stroustrup - "Primitive"0 码力 | 53 页 | 1.03 MB | 5 月前3Leveraging the Power of C++ for Efficient Machine Learning on Embedded Devices
Leveraging the power of C++ for efficient machine learning on embedded devices Adrian Stanciu adrian.stanciu.pub@gmail.com CppCon, 2023 1 / 50About me ◮ I am a software engineer from Romania ◮ I have thermostats) ◮ Medical equipment (e.g. pacemakers) ◮ Characteristics: ◮ Limited hardware resources ◮ Low power consumption ◮ May have real-time performance constraints 7 / 50Machine learning on embedded devices0 码力 | 51 页 | 1.78 MB | 5 月前3Applicative: The Forgotten Functional Pattern
QUESTION OF POWER? A QUESTION OF POWER? 69A QUESTION OF POWER? A QUESTION OF POWER? Every monad is an applicative. Every monad is an applicative. 69.1A QUESTION OF POWER? A QUESTION OF POWER? Every monad powerful" than applicative. Monad is "more powerful" than applicative. 69.2A QUESTION OF POWER? A QUESTION OF POWER? Every monad is an applicative. Every monad is an applicative. Monad is "more powerful" You can do everything with monad that you can do with applicative. 69.3A QUESTION OF POWER? A QUESTION OF POWER? Every monad is an applicative. Every monad is an applicative. Monad is "more powerful"0 码力 | 141 页 | 11.33 MB | 5 月前3Some Things C++ Does Right
smaller but relies on a specific collection type (e.g.: it won’t work with an array) Note that it’s two instructions in both cases, howeverA word about beauty and elegance C# goes for specifics lst transform(begin(v), end(v), begin(v), g); transform(begin(v), end(v), begin(v), f); • … which does two passes through v, with transform(begin(v), end(v), begin(v), f_g_x(f,g)); • … which only does a away if you don't like it.” Anders Hejlsberg, in a 2004 interview https://www.artima.co m/intv/choices.htmlThe beauty of const • There is some truth to that, of course • C++ provides pragmatic mechanisms0 码力 | 228 页 | 2.47 MB | 5 月前3Many Ways to Kill an Orc (or a Hero)
between good and evil • As we do this, we will discuss the design choices we make 24What this is about? • We always make design choices when we code • Even if we choose to just « throw brute force code there is, but it’s still a choice • In our « easy case » implementation, we already made some choices that might deserve discussion 25What this is about? class Character { /* ... name_, life_, etc } }; class Plate : public Armor { float protection() const override { return 0.2f; } }; These two are only examples, obviously 64A first attempt… // ... class Hero : public Character, public Bellicose0 码力 | 202 页 | 1.26 MB | 5 月前3A Multithreaded, Transaction-Based Locking Strategy for Containers
begins it is assigned a unique timestamp from an authoritative, universal timestamp source • If two transactions are attempting to write the same update group at the same time, the transaction with Containers 24Copyright © 2020 Bob Steagall K E W B C O M P U T I N G Implementing STO in C++ – Design Choices • Need some basic synchronization components • Mutex • Condition variable • Atomic pointer Containers 25Copyright © 2020 Bob Steagall K E W B C O M P U T I N G Implementing STO in C++ – Design Choices • Threads share containers holding lockable items • Threads will initiate transactions, and each0 码力 | 142 页 | 474.78 KB | 5 月前3DEDUCING this PATTERNS
several unpalatable choices:GETTERS Before P0847, you have several unpalatable choices: Neglect some overloads (probable)GETTERS Before P0847, you have several unpalatable choices: Neglect some overloads several unpalatable choices: Neglect some overloads (probable) Write them all separately Delegate to a particular one (const_cast etc)GETTERS Before P0847, you have several unpalatable choices: Neglect some several unpalatable choices: Neglect some overloads (probable) Write them all separately Delegate to a particular one (const_cast etc) Delegate to a template helper All these choices involve copy-pasting0 码力 | 126 页 | 5.15 MB | 5 月前3Designing C++ Code Generator Guardrails
Prologue To be fair, the RFC was dense. Still, these changes had been in motion and evolving for two years. Teams across our Engineering department had collaborated, shared their use cases, accepted all of that functionality is worse than irrelevant; it can be counterproductive. Conflicting choices can hinder interoperability. Too many options leads to bloat. A hugely successful tool that is 2018 Bloomberg Finance L.P. All rights reserved. © 2024 Bloomberg Finance L.P. All rights reserved. Two lines of attack converge 17© 2018 Bloomberg Finance L.P. All rights reserved. 18 Working under the0 码力 | 48 页 | 2.71 MB | 5 月前3Hello 算法 1.0.0b4 C++版
个整数的和是否为 target ,若是,则返 回它们的索引。 10. 搜索 hello‑algo.com 190 Figure 10‑6. 线性查找求解两数之和 // === File: two_sum.cpp === /* 方法一:暴力枚举 */ vectortwoSumBruteForce(vector &nums, int target) { int size 和索引 i 添加进哈希表。 10. 搜索 hello‑algo.com 191 Figure 10‑7. 辅助哈希表求解两数之和 实现代码如下所示,仅需单层循环即可。 // === File: two_sum.cpp === /* 方法二:辅助哈希表 */ vector twoSumHashTable(vector &nums, int target) { int size 13. 回溯 hello‑algo.com 250 在以下框架代码中,state 表示问题的当前状态,choices 表示当前状态下可以做出的选择。 /* 回溯算法框架 */ void backtrack(State *state, vector &choices, vector &res) { // 判断是否为解 if (isSolution(state)) 0 码力 | 343 页 | 27.39 MB | 1 年前3
共 269 条
- 1
- 2
- 3
- 4
- 5
- 6
- 27
相关搜索词
AndreasWeisQuicklyEstimatingPowersofTwoTheBeautyandPowerPrimitiveC++LeveragingtheforEfficientMachineLearningonEmbeddedDevicesApplicativeForgottenFunctionalPatternSomeThingsDoesRightManyWaystoKillanOrcorHeroMultithreadedTransactionBasedLockingStrategyContainersDEDUCINGthisPATTERNSDesigningCodeGeneratorGuardrailsHello算法1.00b4