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 generate_composite(): | |
composite = {}, {} | |
return composite | |
def split(composite): | |
left = {'value': composite[0]} | |
right = {'value': composite[1]} | |
# we enable both left and right parts to peek at each other | |
# in physics, this is called action-at-a-distance | |
left['other'] = right |
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 <asio.hpp> | |
#include <iostream> | |
#include <unordered_map> | |
#include <vector> | |
#include <deque> | |
#include <string> | |
#include "json.hpp" | |
using asio::ip::tcp; | |
using json = nlohmann::json; |
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 <string> | |
#include <asio.hpp> | |
#include <asio/io_context.hpp> | |
#include <signal.h> | |
#include "Utils.hpp" | |
#include "MessageQueue.hpp" | |
using asio::awaitable; | |
using asio::co_spawn; |
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
#ifndef __MESSAGEQUEUE_HPP__ | |
#define __MESSAGEQUEUE_HPP__ | |
#include <string> | |
#include <unordered_map> | |
#include <unordered_set> | |
#include <deque> | |
#include <asio.hpp> | |
#include "Utils.hpp" |
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
#ifndef __UTILS_HPP__ | |
#define __UTILS_HPP__ | |
#include <map> | |
#include <regex> | |
#include <sstream> | |
#include <vector> | |
#include <string> | |
#include <algorithm> | |
#include <functional> |
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 <map> | |
#include <regex> | |
#include <iostream> | |
#include <sstream> | |
#include <vector> | |
#include <string> | |
#include <unordered_map> | |
#include <unordered_set> | |
#include <algorithm> | |
#include <cctype> |
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 <string> | |
#include <asio.hpp> | |
#include <asio/io_context.hpp> | |
using asio::awaitable; | |
using asio::co_spawn; | |
using asio::detached; | |
using asio::ip::tcp; | |
using asio::use_awaitable; |
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
__ __ ___ ___ | |
| \/ | |_ _| | _ ) | |
| |\/| | | | | _ \ | |
|_| |_|ore|___|ncredible|___/ash - V3.3.3 "Bentley Edition - BYG24" | |
______________________________________________________________________ | |
NOT FOR COMMERCIAL USE - IF YOU BOUGHT THIS YOU GOT RIPPED OFF | |
Logging_MU1452-MHI2_ER_POG11_P5176-JTB-07403.01.20119200BE: | |
HW Number: 055 - PN: 9P1035041R |
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
from time import time | |
from random import random | |
from statistics import mean, stdev | |
def coin_flip(bias=0.5): | |
if random() < bias: | |
return 1 | |
else: | |
return 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
# regex pattern: [\w.%+-]+@[\w.-]+\.[a-zA-Z]{2,6} | |
# equivalent rxe code: | |
username = rxe.one_or_more(rxe.set([rxe.alphanumeric(), '.', '%', '+', '-'])) | |
domain = (rxe | |
.one_or_more(rxe.set([rxe.alphanumeric(), '.', '-'])) | |
.literal('.') | |
.at_least_at_most(2, 6, rxe.set([rxe.range('a', 'z'), rxe.range('A', 'Z')])) | |
) | |
email = (rxe |
NewerOlder