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
project(cmake_recipe01 LANGUAGES CXX) | |
set(CMAKE_CXX_STANDARD 14) | |
# set(USE_LIBRARY OFF) | |
option(USE_LIBRARY "Compile sources into a library" OFF) | |
message(STATUS "Compile sources into a library? ${USE_LIBRARY}") | |
include(CMakeDependentOption) | |
cmake_dependent_option( |
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.17) | |
project(cmake_recipe01 LANGUAGES CXX) | |
set(CMAKE_CXX_STANDARD 14) | |
set(USE_LIBRARY ON) | |
message(STATUS "Compile sources into library? ${USE_LIBRARY}") | |
set(BUILD_SHARED_LIBS OFF) | |
list(APPEND _sources Message.h Message.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
byobu new -s embedded-cookbook | |
byobu list-sessions | |
byobu attach-session -t embedded-cookbook | |
byobu kill-session -t embedded-cookbook | |
F6 will detach your current Byobu session | |
F2 creates new windows within the current session. | |
F3 and F4 scroll left and right through the windows list. | |
F8 renames the current open window in the list |
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(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{"+-*/"}; |