This file contains hidden or 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 <functional> | |
| #include <map> | |
| #include <typeinfo> | |
| #include <iostream> | |
| struct Event { | |
| virtual ~Event() {} | |
| }; | |
| struct TestEvent : Event { | |
| std::string msg; |
This file contains hidden or 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
| Run this command to install MG-CLI: | |
| sudo apt-get update && wget https://minergate.com/download/deb-cli -O minergate-cli.deb && sudo dpkg -i minergate-cli.deb | |
| to start miner (4 cores for BCN) use this command: | |
| minergate-cli -user <[email protected]> -bcn 4 | |
| Feel free to send some of your earnings to me: | |
| BTC (Don't attempt to send other coins to this address!): 17f77AYHsQbdsB1Q6BbqPahJ8ZrjFLYH2j |
This file contains hidden or 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 "fixedp.h" | |
| #include <iostream> | |
| int main(int, char **) | |
| { | |
| fixedp<true, 16, 16> x(0); //32-bit signed 16.16 fixed-point number | |
| fixedp<false, 8, 8> y(10); //16-bit unsigned 8.8 fixed-point number | |
| std::cout << (fixedp<false, 4, 4>(3.5) + fixedp<false, 4, 4>(4.5)).toFloat() << std::endl; | |
| //prints "8" |
This file contains hidden or 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 <stdexcept> | |
| /* | |
| T must implement operator=, copy ctor | |
| */ | |
| template<typename T> class CircBuf { | |
| // don't use default ctor | |
| CircBuf(); |
This file contains hidden or 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
| # References: | |
| # https://cmake.org/cmake/help/latest/command/add_custom_target.html | |
| # https://samthursfield.wordpress.com/2015/11/21/cmake-dependencies-between-targets-and-files-and-custom-commands/ | |
| # https://gist.github.com/socantre/7ee63133a0a3a08f3990 | |
| # https://stackoverflow.com/questions/24163778/how-to-add-custom-target-that-depends-on-make-install | |
| # https://stackoverflow.com/questions/30719275/add-custom-command-is-not-generating-a-target | |
| # https://stackoverflow.com/questions/26024235/how-to-call-a-cmake-function-from-add-custom-target-command | |
| # https://blog.csdn.net/gubenpeiyuan/article/details/51096777 | |
| cmake_minimum_required(VERSION 3.10) |
This file contains hidden or 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
| find_package(Threads REQUIRED) | |
| ExternalProject_Add( | |
| googletest | |
| GIT_REPOSITORY https://github.com/google/googletest.git | |
| UPDATE_COMMAND "" | |
| INSTALL_COMMAND "" | |
| LOG_DOWNLOAD ON | |
| LOG_CONFIGURE ON | |
| LOG_BUILD ON) |