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
cmake_minimum_required(VERSION 3.16) | |
project(factory_methods) | |
set(CMAKE_CXX_STANDARD 17) | |
add_library(shape_factory shape_factory.cpp) | |
add_executable(factory_method main.cpp) | |
target_link_libraries(factory_method shape_factory) |
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
cmake_minimum_required(VERSION 3.16) | |
project(monostate_idiom) | |
set(CMAKE_CXX_STANDARD 17) | |
add_library(monostate monostate.cpp) | |
add_executable(monostate_idiom main.cpp) | |
target_link_libraries(monostate_idiom monostate) |
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
cmake_minimum_required(VERSION 3.16) | |
project(singleton_idiom) | |
set(CMAKE_CXX_STANDARD 17) | |
add_library(singleton singleton.cpp) | |
add_executable(singleton_idiom main.cpp) | |
target_link_libraries(singleton_idiom singleton) |
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
cmake_minimum_required(VERSION 3.16) | |
project(pimpl_idiom) | |
set(CMAKE_CXX_STANDARD 17) | |
add_library(timer timer.cpp) | |
add_executable(pimpl_idiom main.cpp) | |
target_link_libraries(pimpl_idiom timer) |
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
// | |
// Tell me about your birthday! | |
// Created by angelos on 03/05/2020. | |
// | |
#include <ctime> | |
#include <iostream> | |
#include <string_view> | |
int validate_input(int lower_limit, int upper_limit, std::string_view prompt); | |
void year(tm &birthday); |
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
#define CATCH_CONFIG_MAIN | |
#include "catch.hpp" | |
#include <boost/tokenizer.hpp> | |
#include <iostream> | |
using namespace std::literals::string_literals; | |
int basic_calc(const std::string &input) { | |
boost::char_separator<char> operators{"+-*/"}; |
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
cmake_minimum_required(VERSION 3.15) | |
project(sets) | |
set(CMAKE_CXX_STANDARD 17) | |
add_executable(sets sets.cpp) |
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
cmake_minimum_required(VERSION 3.0.0) | |
project(tcp_server VERSION 0.1 | |
DESCRIPTION "Poco echo TCPServer") | |
set(CMAKE_CXX_STANDARD 17) | |
find_package(Poco REQUIRED Foundation Net) | |
# check if Poco library was found |
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
def callback(self, image_msg): | |
# convert a ROS image message into an cv::Mat using module cv_bridge | |
cv_image = self._cv_bridge.imgmsg_to_cv2(image_msg, "bgr8") | |
# copy from | |
# classify_image.py | |
# convert (encode) the image format into streaming data and assign it to | |
# memory cache. It is mainly used for compressing image data format to facilitate | |
# network transmission | |
image_data = cv2.imencode('.jpg', cv_image)[1].tostring() |
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> | |
class Base { | |
public: | |
virtual void function1() { std::cout << "Base::function1()" << std::endl; } | |
virtual void function2() { std::cout << "Base::function2()" << std::endl; } | |
virtual ~Base() { std::cout << "Base destructor" << std::endl; } | |
}; | |
class Derived1 : public Base { |