摘要:
std::mutex m; std::condition_variable cond; int flag = 0; constexpr int kLoopTimes = 10; void foo(int id){ for (int i = 0; i != kLoopTimes; ++i){ std: 阅读全文
摘要:
安装方法十分简单,打开 mysql 后输入 \. .../.../employees.sql; 就可以。吗?然后就遇到问题了,第一个是这样,我输入上面的代码之后,给我的是这个:Access denied for user为啥呢? 因为没有以 root 的身份登录,只需要这样登录就可以; mysql ... 阅读全文
摘要:
阅读全文
摘要:
templateIterator parallelFind(Iterator first, Iterator last, MatchType match){ struct FindElement { void operator()(Iterator begin, Itera... 阅读全文
摘要:
const std::string getCurrentSystemTime(){ auto tt = std::chrono::system_clock::to_time_t (std::chrono::system_clock::now()); struct tm* ptm = local... 阅读全文
摘要:
class ThreadsJoiner{ std::vector& threads;public: ThreadsJoiner(std::vector& threads_): threads(threads_) {} ~ThreadsJoiner() ... 阅读全文
摘要:
int foo(int n){ if (n < 1){ return 0; } int result = 0; for(int i = 1, factor = 1; i <= n; (factor += (pow(10.0, i))), ++i){ ... 阅读全文
摘要:
templateT parallelAccumulate(Iterator first, Iterator last, T init){ size_t const length = std::distance(first, last); if (length == 0){ ... 阅读全文
摘要:
templatestruct AccumulateBlock{ T operator()(Iterator first, Iterator last) { return std::accumulate(first, last, T()); }};class Threa... 阅读全文
摘要:
while(static_cast(std::cin.get()) != '\n') { //若读取的字符串不是换行符,则将其放回流内。 std::cin.unget(); cin >> input; // ... } 阅读全文