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
Verifying that "marena.id" is my Blockstack ID. https://onename.com/marena |
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 <algorithm> | |
#include <iostream> | |
#include <vector> | |
using namespace std; | |
/* | |
Just for fun: equivalent to: | |
if (score < 40) |
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
// my solution for: http://www.geeksforgeeks.org/check-if-a-given-number-is-fancy/ | |
// Precondition: i only contains digit chars | |
bool is_fancy(const string& i) | |
{ | |
static const map<char, char> toFancy{ | |
{'0', '0'}, {'1', '1'}, | |
{'6', '9'}, {'8', '8'}, {'9', '6'}, | |
{'2', 0}, {'3', 0}, {'4', 0}, {'5', 0}, {'7', 0}, | |
}; |
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
// canonical way | |
template<typename MapType> | |
auto map_vals(const MapType& m) | |
{ | |
vector<typename MapType::mapped_type> res; | |
res.reserve(m.size()); | |
transform(begin(m), end(m), back_inserter(res), [](const auto& p) { | |
return p.second; | |
}); | |
return res; |
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 <type_traits> | |
#include <string> | |
using namespace std; | |
// PACK UTILS (TAG VERSION) ============================= | |
/* find type T in a pack (recursive) | |
This is used to find a TAG |
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 <random> | |
#include <iostream> | |
namespace boost | |
{ | |
namespace mario | |
{ | |
enum class Mano | |
{ | |
Piuma=0, Fero=1 |