Skip to content

Instantly share code, notes, and snippets.

@residentkrm
residentkrm / thread_pool.cpp
Created January 13, 2018 16:07 — forked from wush978/thread_pool.cpp
c++ thread pool example(linux only)
#include <boost/shared_ptr.hpp>
#include <boost/make_shared.hpp>
#include <boost/thread.hpp>
#include <boost/bind.hpp>
#include <boost/asio.hpp>
#include <boost/move/move.hpp>
#include <iostream>
#include <unistd.h>
namespace asio = boost::asio;
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main()
{
string str;
getline(cin, str);
#include <iostream>
#include <math.h>
#include <conio.h>
#include <iomanip>
#include <fstream>
#include <stdlib.h>
using namespace std;
double f(double x, double y)
{
DOMAINS
nflight=integer
time=real
destination=symbol
chast=symbol
PREDICATES
nondeterm flight(integer,real,symbol,symbol)
CLAUSES
flight(10000,7.30,"Moskow","every day").
flight(1005,9.30,"Paris","in one day").
#include "stdafx.h"
#include <iostream>
#include <math.h>
using namespace std;
double func(double x)
{
return pow(x,3.0)-0.2*x*x+0.5*x-1;
}
#include <ctime>
#include <cstdlib>
#include <iostream>
#include <string>
#include <stack>
bool isOpenBracket(char symbol) {
return symbol == '(' || symbol == '{' || symbol == '[';
}
#include <iostream>
#include <cstdio>
#include <fstream>
#include <vector>
#include <conio.h>
int main()
{
// prepare file
std::ofstream("d:/test.txt") << 1 << ' ' << 2 << '\n';
std::FILE* f;
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <string>
#include <conio.h>
using namespace std;
int main(int argc, char *argv[]) {
@residentkrm
residentkrm / boss_twin_walkyr.cpp
Last active August 29, 2015 14:02
boss_twin_walkyrAI::SummonColorballs
void SummonColorballs(uint8 quantity)
{
// ToCCommonLoc[1]: {563.672974f, 139.571f, 393.837006f, 0}
float x0 = ToCCommonLoc[1].GetPositionX(), y0 = ToCCommonLoc[1].GetPositionY(), r = 47.0f;
float y = y0;
for (uint8 i = 0; i < quantity; i++)
{
float x = float(urand(uint32(x0 - r), uint32(x0 + r)));
if (urand(0, 1))
y = y0 + sqrt(pow(r, 2) - pow((x-x0), 2));