Skip to content

Instantly share code, notes, and snippets.

View usagi's full-sized avatar
🍣
Sushi

USAGI/USAGI.NETWORK usagi

🍣
Sushi
View GitHub Profile
cmake_minimum_required(VERSION 2.8.10)
project(cv-osoi)
find_package(OpenCV REQUIRED)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
find_library(OpenCL_LIBS OpenCL)
if(NOT OpenCL_LIBS)
message(FATAL "libOpenCL.so is not found")
else()
message(STATUS "OpenCL_LIBS: ${OpenCL_LIBS}")
endif()
cmake_minimum_required(VERSION 2.8.10)
project(app)
find_package(ImageMagick REQUIRED COMPONENTS Magick++)
include_directories(${ImageMagick_INCLUDE_DIRS})
add_executable(app app.cxx)
target_link_libraries(app ${ImageMagick_LIBRARIES})
cmake_minimum_required(VERSION 2.8.10)
project(parallel_sort)
add_custom_target(parallel_sort.g++.Ofast ALL g++ -std=c++11 -Ofast -march=native -fopenmp -o parallel_sort.g++.Ofast ${PROJECT_SOURCE_DIR}/parallel_sort.cxx)
add_custom_target(parallel_sort.g++.O3 ALL g++ -std=c++11 -O3 -march=native -fopenmp -o parallel_sort.g++.O3 ${PROJECT_SOURCE_DIR}/parallel_sort.cxx)
add_custom_target(parallel_sort.g++.O2 ALL g++ -std=c++11 -O2 -march=native -fopenmp -o parallel_sort.g++.O2 ${PROJECT_SOURCE_DIR}/parallel_sort.cxx)
add_custom_target(parallel_sort.g++.O1 ALL g++ -std=c++11 -O1 -march=native -fopenmp -o parallel_sort.g++.O1 ${PROJECT_SOURCE_DIR}/parallel_sort.cxx)
add_custom_target(parallel_sort.g++.O0 ALL g++ -std=c++11 -O0 -march=native -fopenmp -o parallel_sort.g++.O0 ${PROJECT_SOURCE_DIR}/parallel_sort.cxx)
add_custom_target(parallel_sort.g++.Os ALL g++ -std=c++11 -Os -march=native -fopenmp -o parallel_sort.g++.Os ${PROJECT_SOURCE_DIR}/parallel_sort.cxx)
#include <rtccore.h>
#include <WonderRabbitProject/key.hxx>
int main()
{
for(auto n = 3; n; --n)
{
std::cerr << n << "\n";
Sleep(1000);
}
#pragma once
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
namespace
{
struct cv_video_helper_t final
{
#include <algorithm>
#include <vector>
#include <iostream>
int main()
{
using namespace std;
vector<int> vs{0,1,2,3,4,5,6,7,8,9};
auto i = copy_if(begin(vs), end(vs), begin(vs), [](int v){ return v%2==0; });
#include <iostream>
#include <boost/property_tree/ini_parser.hpp>
int main()
{
using std::cout;
using boost::property_tree::ptree;
using boost::property_tree::write_ini;
ptree p;
#include <thread>
#include <chrono>
#include <string>
#include <iostream>
int main()
{
std::cerr << "<press enter to exit>\n";
bool to_continue = true;
#include <thread>
#include <string>
#include <chrono>
#include <iostream>
int main()
{
bool is_running = true;
auto t = std::thread([](bool& is_running)
#include <boost/thread.hpp>
#include <string>
#include <chrono>
#include <iostream>
int main()
{
bool is_running = true;
auto t = boost::thread([](bool& is_running)