[C++ Korea 2nd Seminar] Ranges for The Cpp Standard LibraryDongMin Choi
?
Microsoft Melting Pot
C++ Korea 2nd Seminar
Ranges for The Cpp Standard Library
https://channel9.msdn.com/Events/Channel9-Korea/cplusplus/Ranges-for-The-C-Standard-Library
Go is a language developed by Google with multi-core in mind. Differ from other languages, concurrency is a first-class primitive in Go. This talk covers some useful patterns for dealing with concurrency.
This document discusses principles of clean code based on the book "Clean Code" by Robert C. Martin. It provides examples of good and bad practices for naming variables and functions, structuring functions, using comments, and other topics. Key points include using meaningful names, keeping functions small and focused on a single task, avoiding deeply nested code and long argument lists, commenting to explain intent rather than state the obvious, and other guidelines for writing clean, readable code.
This document discusses Go concurrency fundamentals including goroutines, channels, and synchronization primitives. It provides examples of using goroutines and channels for signaling between processes, timeouts, heartbeats, and implementing a load balancer. Key points covered include goroutines being lightweight processes, channel-based communication between goroutines, and using select to handle multiple channel operations.
Go is a language developed by Google with multi-core in mind. Differ from other languages, concurrency is a first-class primitive in Go. This talk covers some useful patterns for dealing with concurrency.
This document discusses principles of clean code based on the book "Clean Code" by Robert C. Martin. It provides examples of good and bad practices for naming variables and functions, structuring functions, using comments, and other topics. Key points include using meaningful names, keeping functions small and focused on a single task, avoiding deeply nested code and long argument lists, commenting to explain intent rather than state the obvious, and other guidelines for writing clean, readable code.
This document discusses Go concurrency fundamentals including goroutines, channels, and synchronization primitives. It provides examples of using goroutines and channels for signaling between processes, timeouts, heartbeats, and implementing a load balancer. Key points covered include goroutines being lightweight processes, channel-based communication between goroutines, and using select to handle multiple channel operations.
[C++ Korea] Effective Modern C++ Study item 24-26Seok-joon Yun
?
[C++ Korea] Effective Modern C++ Study item 24-26
Item 24: Distinguish universal references from rvalue references. +???
Item 25 : Use std::move on rvalue references,
std::forward on universal references. +???
Item 26 : Avoid overloading on universal references. +???
[C++ Korea] Effective Modern C++ Study item14 16 +??Seok-joon Yun
?
[C++ Korea] Effective Modern C++ Study item14 16 +??
Item 14 : Declare functions noexcept if they won't emit exceptions. +???
Item 15 : Use constexpr whenever possible. +???
Item 16 : Make const member functions thread safe. +???
[C++ korea] Effective Modern C++ ?? Study Item20,21,23Seok-joon Yun
?
[C++ korea] Effective Modern C++ ?? Study Item20,21,23
Item 20, 21, 23
Item 20 : Use std::weak_ptr for std::shared_ptr-like pointers that can dangle. +???
Item 21 : Prefer std::make_unique and std::make_shared to direct use of new. +???
Item 23 : Understand std::move and std::forward. +???
Continuous Control with Deep Reinforcement Learning, lillicrap et al, 2015Chris Ohk
?
The paper introduces Deep Deterministic Policy Gradient (DDPG), a model-free reinforcement learning algorithm for problems with continuous action spaces. DDPG combines actor-critic methods with experience replay and target networks similar to DQN. It uses a replay buffer to minimize correlations between samples and target networks to provide stable learning targets. The algorithm was able to solve challenging control problems with high-dimensional observation and action spaces, demonstrating the ability of deep reinforcement learning to handle complex, continuous control tasks.
23. Ranges
? [0 ~ 10)? ?????.
C++ Korea 5th Seminar
C++20 Key Features Summary
int arr[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
std::vector<int> v(10);
for (int i = 0; i < 10; ++i)
v[i] = i;
std::vector<int> v = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
24. Ranges
? [0 ~ 10)? ?????.
C++ Korea 5th Seminar
C++20 Key Features Summary
#include <numeric>
std::vector<int> v(10);
std::iota(v.begin(), v.end(), 0);
std::vector<int> v(10);
ranges::iota(v, 0);
25. Ranges
? [0 ~ 15)?? 5?? ??? ??? ? ??? ?? ??? ??
C++ Korea 5th Seminar
C++20 Key Features Summary
vector<int> v =
view::iota(0, 15) |
view::group_by(quotient) |
view::transform(sum);
for (auto e : v)
cout << e << " "; cout << endl;
auto quotient = [](int a, int b) {
return a / 5 == b / 5;
};
auto sum = [](auto rng) {
return ranges::accumulaate(rng, 0);
};
26. Ranges
? ??2
+ ??2
= ??2
? ???? ? ??? ? ??, ??, ?? 100? ??? ??
C++ Korea 5th Seminar
C++20 Key Features Summary
auto triples = view::ints(1) >>= [] (int z) { return
view::ints(1, z + 1) >>= [=](int x) { return
view::ints(x, z + 1) >>= [=](int y) { return
yield_if(x*x + y*y == z*z,
std::make_tuple(x, y, z));
}; }; };
auto triangles = triples | view::take(100);
29. Module
? ? cpp ???? ??? ??? ?? cpp ???? ???? ??
C++ Korea 5th Seminar
C++20 Key Features Summary
// m1.cpp
module M1;
export int f(int, int);
int g(int x) { return x * x; }
int f(int x, int y) { return g(x) + g(y); }
// m2.cpp
module M2;
export int g(int, int);
import std.core;
int f(int x, int y) { return x + y; }
int g(int x, int y)
{
return f(abs(x), abs(y));
}
// main.cpp
import M1;
import M2;
int main()
{
printf(%dn,
f(3, 4) + g(3, 4));
}
30. Coroutine
? C++ Coroutine ????: ???, ????, ??? ??? ????
Coroutine? ?? ??? ??? ?????.
(?? ??? ?? ?? ??? ??? ???? ?? ??????.)
C++ Korea 5th Seminar
C++20 Key Features Summary
31. C++20 ?? ??
? Designated initializers
? operator<=>
? Relation operator/comparison
? Nested inline namespaces
? consteval fuctions
? Feature test macros
C++ Korea 5th Seminar
C++20 Key Features Summary
32. C++20 ?? ??
? std::span
? std::endian
? std::bit_cast
? Calender and timezone library
C++ Korea 5th Seminar
C++20 Key Features Summary
33. Designated initializers
? ??? ?? ???? ??? ???.
? ??? ?? ??? ??? ???.
? ?? x, z?? ?? ???? ??? ??? ?? ????
??? ??? ?? ? ????.
C++ Korea 5th Seminar
C++20 Key Features Summary
struct A { int x; int y; int z; };
A a1{3, 4};
A a2{3, 4, 5};
A a1;
a1.x = 3;
a1.z = 5;
34. Designated initializers
? C++20??? ? ? ?? ???? ??? ? ????.
? ?, ??? ??? ??? ?? ??? ???? ???.
? ????? ??? ? ????.
C++ Korea 5th Seminar
C++20 Key Features Summary
A a1{.x = 3, .z = 5};
A a1{.x = 3, .y = 4}; // OK
A a2{.y = 4, .x = 3}; // Error
union u { int a; const char* b; };
u f = { .b = "asdf" }; // OK, active member of the union is b
u g = { .a = 1,.b = "asdf" }; // Error, only one initializer may be provided
35. operator<=>
? strcmp? ??? ??? ?? 3??? ?? ???? ??????.
(Spaceship operator, 3-way comparison???? ???.)
? a? b?? ?? 1? ?????.
? a? b?? ??? -1? ?????.
? a? b? ???(equal) ????(equivalent) 0? ?????.
(?? : ??? ????? ?? ?????.)
C++ Korea 5th Seminar
C++20 Key Features Summary
(a <=> b) < 0 // true if a < b
(a <=> b) < 0 // true if a > b
(a <=> b) == 0 // true if a is equal/equivalent to b
36. Relation operator/comparison
? ?? ? ????? ????.
C++ Korea 5th Seminar
C++20 Key Features Summary
??? 4m, ??? 1m? ???? ??? 1m, ??? 4m? ????