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
/* generator.h v1.0 by maxrt101 | |
* Header that provides functionality similar to python's generators, | |
* including implementations for range(), enumarate() and zip() | |
*/ | |
#ifndef _MRT_UTILS_GENERATOR_H_ | |
#define _MRT_UTILS_GENERATOR_H_ 1 | |
#include <exception> | |
#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
/* serialization.hh v1.2 by maxrt101 | |
* Serializer/Deserializer for C++ objects | |
* To make class serializable, add MAKE_SERIALIZABLE() macro inside it's declaration | |
* and pass all fields into it. | |
*/ | |
#ifndef _MRT_SERIALIZATION_H_ | |
#define _MRT_SERIALIZATION_H_ 1 | |
#include <cstdio> |
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 <cstring> | |
#include <cctype> | |
#include <cstdio> | |
void hexdump(const unsigned char* data, size_t size, int cols) { | |
int can_print = 1; | |
size_t count = 0; | |
char* buf = new char[cols]; | |
while (can_print) { |
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
#!/usr/bin/env python3 | |
# combination generator by maxrt101 | |
import itertools | |
import hashlib | |
import sys | |
def generate(digits: int, src: list) -> list: | |
return list(itertools.product(*([src] * digits))) |
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
# TaskLog by maxrt101 | |
from dataclasses import dataclass | |
from enum import Enum | |
import threading, queue, time | |
class State(Enum): | |
SUCCESS = 0 | |
FAILED = 1 | |
STARTING = 2 |
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
/* hexdump.c by maxrt101 */ | |
#include <stdlib.h> | |
#include <stddef.h> | |
#include <stdarg.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include <errno.h> | |
#include <ctype.h> |