This file contains 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 <thread> | |
#include <string> | |
#include <chrono> | |
#include <iostream> | |
int main() | |
{ | |
bool is_running = true; | |
auto t = std::thread([](bool& is_running) |
This file contains 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 <boost/thread.hpp> | |
#include <string> | |
#include <chrono> | |
#include <iostream> | |
int main() | |
{ | |
bool is_running = true; | |
auto t = boost::thread([](bool& is_running) |
This file contains 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
cv::Mat m(480, 640, CV_8UC3); | |
Magick::Image i(m.cols, m.rows, "BGR", Magick::CharPixel, reinterpret_cast<char*>(m.data)); | |
constexpr int jpeg_quality = 60; | |
Magick::Blob buffer; | |
i.magick("JPEG"); | |
i.quality(jpeg_quality); | |
i.write(&buffer); |
This file contains 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
cv::Mat m(480, 640, CV_8UC3); | |
Magick::Image i(m.cols, m.rows, "BGR", Magick::CharPixel, reinterpret_cast<char*>(m.data)); | |
Magick::Blob buffer; | |
i.compressType(Magick::LZWCompression); | |
i.magick("TIFF"); | |
i.write(&buffer); |
This file contains 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 <vector> | |
#include <string> | |
#include <iostream> | |
int main(const int number_of_arguments_c, const char* const* const arguments_c) | |
{ | |
const std::vector<std::string> arguments_cxx(arguments_c + 1, arguments_c + number_of_arguments_c); | |
std::cerr << arguments_cxx.size() << '\n'; | |
for(const auto& a : arguments_cxx) | |
std::cerr << a << ' '; |
This file contains 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 <cmath> | |
int main() | |
{ | |
for(auto n = 0; n < 100; ++n) | |
{ | |
float t = float(n) / 100; | |
float f = 2.f; | |
float a = 4.f * std::floor(t * f) - 2.f * std::floor(2.f * t * f) + 1.f; |
This file contains 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
// std::cout のためにC++標準ライブラリー iostream を使用。 | |
#include <iostream> | |
// std::runtime_error のためにC++標準ライブラリー stdexcept を使用。 | |
#include <stdexcept> | |
// Pythonバインディングのために /usr/include/python3.3/Ptyhon.h を使用。 | |
#include <Python.h> | |
// C++の無名名前空間で定義するよ | |
namespace |
OlderNewer