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
| #!/usr/bin/env python | |
| try: | |
| import gdb | |
| inside_gdb = True | |
| except ImportError: | |
| inside_gdb = False | |
| if inside_gdb: |
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 <stdlib.h> | |
| #include <stdio.h> | |
| #include <stdint.h> | |
| #include <fcntl.h> | |
| #include <sys/stat.h> | |
| #include <sys/mman.h> | |
| #include <unistd.h> | |
| int main(int argc, const char *argv[]) | |
| { |
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 <iostream> | |
| #include <chrono> | |
| #include <ctime> | |
| #include <cmath> | |
| class Timer | |
| { | |
| public: | |
| void start() | |
| { |
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
| // Sample custom iterator. | |
| // By perfectly.insane (http://www.dreamincode.net/forums/index.php?showuser=76558) | |
| // From: http://www.dreamincode.net/forums/index.php?showtopic=58468 | |
| #include <iostream> | |
| #include <vector> | |
| #include <algorithm> | |
| #include <iterator> | |
| #include <cassert> |
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 <iostream> | |
| #include <istream> | |
| #include <ostream> | |
| #include <boost/asio.hpp> | |
| #include <boost/asio/spawn.hpp> | |
| class client { | |
| public: | |
| client(boost::asio::io_service& io_service, const std::string& server, const std::string& path) | |
| : resolver_(io_service), socket_(io_service) { |
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" |