Содержание предоставили:
- Michael Sherman
- Yuan Cao
#pragma once | |
#include <mutex> | |
#include <utility> | |
#include <type_traits> | |
namespace details { | |
template <typename T, typename = void> | |
struct has_del_method : std::false_type {}; |
#pragma once | |
// Suppress warnings for AMQP-CPP | |
#if defined(__clang__) | |
#pragma clang diagnostic push | |
#pragma clang diagnostic ignored "-Wunused-parameter" | |
#pragma clang diagnostic ignored "-Wclass-conversion" | |
#pragma clang diagnostic ignored "-Wdeprecated-copy" | |
#include <amqpcpp.h> | |
#include <amqpcpp/libev.h> |
#!/bin/env bash | |
set -e | |
model="gpt-4o" | |
temperature=0.8 | |
prompt="Below is the output of \`git log <latest_tag>..HEAD\`."` | |
`"\nPlease provide a perfect tag message."` | |
`"\nUse emojis in the message text when appropriate. Use past tense."` |
#!/bin/env bash | |
set -e | |
model="gpt-4o"; | |
temperature=0.8; | |
prompt="Below is the output of \`git diff HEAD\`."` | |
`"\nPlease provide a perfect git commit message."` | |
`"\nAlways use an emoji as the first character. Use emojis in the message text when appropriate."` |
#include <unistd.h> | |
// true if current user is not root | |
// or true if owner changing is not required (targ_uid == 0) | |
// or true if current user is root and uid changed | |
// false otherwise (owner changing was unsuccessful) | |
bool change_owner(unsigned int targ_uid) noexcept | |
{ | |
return | |
(0u != getuid()) || // made sure that src_uid == 0 (source is root) |
#include <stdio.h> | |
#include <assert.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <errno.h> | |
#include <event2/bufferevent.h> | |
#include <event2/buffer.h> | |
#include <event2/listener.h> | |
#include <event2/util.h> |
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: fixdell | |
# Required-Start: $local_fs $syslog $named | |
# Required-Stop: $local_fs $syslog $named | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Fix DELL freezes | |
# Description: startup script for Fix DELL freezes | |
### END INIT INFO |
#include <iostream> | |
#include <cmath> | |
#include <chrono> | |
struct BenchResult | |
{ | |
std::chrono::nanoseconds duration; | |
double sum; | |
}; |
#include <iostream> | |
#include <utility> | |
#include <vector> | |
// Равномерно разделяет диапазон значения | |
// Для балансировки нагрузки на ядра CPU | |
std::vector<std::pair<int, int>> | |
splitRange(int from, int to, uint threads) noexcept | |
{ | |
std::vector<std::pair<int, int>> pairs; |