This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Use Vim settings, rather then Vi settings (much better!). | |
"This must be first, because it changes other options as a side effect. | |
set nocompatible | |
"colors zenburn | |
set background=dark | |
set exrc | |
set secure |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename Data> | |
class concurrent_queue | |
{ | |
private: | |
std::queue<Data> the_queue; | |
mutable boost::mutex the_mutex; | |
boost::condition_variable the_condition_variable; | |
public: | |
void push(Data const& data) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <libavutil/samplefmt.h> | |
#include <libavutil/timestamp.h> | |
#include <libavutil/audio_fifo.h> | |
#include <libavutil/avstring.h> | |
#include <libavformat/avformat.h> | |
#include <libswresample/swresample.h> | |
/** The number of output channels */ | |
#define OUTPUT_CHANNELS 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <stdlib.h> | |
std::string generateIccid() | |
{ | |
char res[20]; | |
int sum = 0; | |
int num = 0; | |
for (size_t i = 0; i < sizeof res - 2; i++) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <memory> | |
#include <iostream> | |
#include <unistd.h> | |
#include <thread> | |
using namespace std; | |
class a: public std::enable_shared_from_this<a> | |
{ | |
std::shared_ptr<a> self; | |
public: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Алгоритм крестики-нолики, действия по приоритету: | |
1 Ход в позицию, приводящую к победе | |
2 Блокировка победы противника на следующем ходу | |
3 Создание вилки | |
4 Ход в центр | |
5 Если противник пошел в угол, ход в противоположный угол | |
6 Ход в любой угол | |
7 Ход в любую свободную позицию |