CppCon 2016: Cheinan Marks “I Just Wanted a Random Integer!"
http://CppCon.org
—
Presentation Slides, PDFs, Source Code and other presenter materials are available at: https://github.com/cppcon/cppcon2016
—
I just wanted to generate a random integer between 1 and 100 for my unit tests.
An hour later I was down the rabbit hole of the C++ <random> header wondering why it was so complicated, weren't rand() and modulo good enough and was <random> overkill, genius or both?
Several hours later I had watched STLs 2013 Going Native talk on < random> (go watch it!), read some blogs and had even more questions: does the mt19937 generator go on the heap? Just how cheap are uniform distributions to construct? Were there even better generators out there and were they easier to use? Oh and what is entropy? How do you put it in a pool and how can it be exhausted?
The story took a few unexpected twists and turns, but in the end I got my random integers, and answers to almost all my questions which I will share. Whether <random> is genius or overkill though, you will have to decide for yourself.
—
Cheinan Marks
Spiral Genetics
As an engineer with a chemical engineering background, Cheinan is interested in practical code and wants to take the latest advances both in science and programming and use them in real life working code along with applying engineering principles to software development. Cheinan is a senior developer at Spiral Genetics, Inc. in Seattle.
—
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
Видео CppCon 2016: Cheinan Marks “I Just Wanted a Random Integer!" канала CppCon
—
Presentation Slides, PDFs, Source Code and other presenter materials are available at: https://github.com/cppcon/cppcon2016
—
I just wanted to generate a random integer between 1 and 100 for my unit tests.
An hour later I was down the rabbit hole of the C++ <random> header wondering why it was so complicated, weren't rand() and modulo good enough and was <random> overkill, genius or both?
Several hours later I had watched STLs 2013 Going Native talk on < random> (go watch it!), read some blogs and had even more questions: does the mt19937 generator go on the heap? Just how cheap are uniform distributions to construct? Were there even better generators out there and were they easier to use? Oh and what is entropy? How do you put it in a pool and how can it be exhausted?
The story took a few unexpected twists and turns, but in the end I got my random integers, and answers to almost all my questions which I will share. Whether <random> is genius or overkill though, you will have to decide for yourself.
—
Cheinan Marks
Spiral Genetics
As an engineer with a chemical engineering background, Cheinan is interested in practical code and wants to take the latest advances both in science and programming and use them in real life working code along with applying engineering principles to software development. Cheinan is a senior developer at Spiral Genetics, Inc. in Seattle.
—
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
Видео CppCon 2016: Cheinan Marks “I Just Wanted a Random Integer!" канала CppCon
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
![CppCon 2016: Walter E. Brown “What C++ Programmers Need to Know about Header <random>"](https://i.ytimg.com/vi/6DPkyvkMkk8/default.jpg)
![CppCon 2014: Andrei Alexandrescu "Optimization Tips - Mo' Hustle Mo' Problems"](https://i.ytimg.com/vi/Qq_WaiwzOtI/default.jpg)
![C++/Game Tutorial 8: Random Number Generator!](https://i.ytimg.com/vi/JGwSEbnJGR0/default.jpg)
![The Science Of Roundness](https://i.ytimg.com/vi/NjbvOTUSqdI/default.jpg)
![CppCon 2019: Arthur O'Dwyer “Back to Basics: Smart Pointers”](https://i.ytimg.com/vi/xGDLkt-jBJ4/default.jpg)
![DConf 2019 -- Ask us Anything! -- Andrei Alexandrescu, Walter Bright](https://i.ytimg.com/vi/OsOfTVm2ExY/default.jpg)
![R&D Support Demo: How to Use the New Random-Number Generators in SAS](https://i.ytimg.com/vi/oNPWjJ2OD2c/default.jpg)
![Storage Duration and Linkage in C and C++ - Dan Saks](https://i.ytimg.com/vi/0kgTuWkyorc/default.jpg)
![I used Elm in production and it cost me my job – Annaia Berry](https://i.ytimg.com/vi/RFrKffrKCeU/default.jpg)
![Functional Programming using C++ (1/27) - Introducing functional programming](https://i.ytimg.com/vi/jD8Tu1tqvZo/default.jpg)
![CppCon 2018: Dan Saks “Making New Friends”](https://i.ytimg.com/vi/POa_V15je8Y/default.jpg)
![CppCon 2017: Arthur O'Dwyer “dynamic_cast From Scratch”](https://i.ytimg.com/vi/QzJL-8WbpuU/default.jpg)
![CppCon 2019: Ben Saks “Back to Basics: Exception Handling and Exception Safety”](https://i.ytimg.com/vi/W6jZKibuJpU/default.jpg)
![C++ How To: Generate Random Numbers](https://i.ytimg.com/vi/OF8hCaX24Vs/default.jpg)
![dotGo 2017 - John Cinnamond - Go Lift](https://i.ytimg.com/vi/1B71SL6Y0kA/default.jpg)
![RustLatam 2019 - Niko Matsakis: What's unique about Rust?](https://i.ytimg.com/vi/jQOZX0xkrWA/default.jpg)
![Practical constexpr - Jason Turner - Meeting C++ 2017](https://i.ytimg.com/vi/xtf9qkDTrZE/default.jpg)
![Traits and You: A Deep Dive — Nell Shamrell-Harrington](https://i.ytimg.com/vi/grU-4u0Okto/default.jpg)
![CppCon 2019: Marshall Clow “std::midpoint? How Hard Could it Be?”](https://i.ytimg.com/vi/sBtAGxBh-XI/default.jpg)