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> | |
bool is_prime(unsigned long long n) { | |
if (n <= 1) return false; | |
if (n == 2) return true; | |
if (n % 2 == 0) return false; | |
for (int i = 3; i * i <= n; i += 2) | |
if (n % i == 0) return false; | |
return true; | |
} |
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
import urllib.request | |
dictionaries: dict[str, str] = { | |
"pl": "https://raw.githubusercontent.com/sigo/polish-dictionary/master/dist/pl.txt", | |
"en": "https://raw.githubusercontent.com/dwyl/english-words/master/words.txt", | |
} | |
_7seg_possible_chars: str = "0123456789abcdefhijlnoprstuy" | |
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 scipy.constants import G | |
# F = G * (M1 * M2 / r2) | |
M1 = 1 | |
F = 9.81 | |
r = 6_371_000 | |
# M2 = F * r2 / G / M1 | |
M2 = F * pow(r, 2) / G / M1 |
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 VEC_HPP_INCLUDED | |
/* | |
Author: Tymon Woźniak <https://github.com/Moderrek> | |
Vector Array implementation in C++ by Tymon Woźniak | |
*/ | |
#define VEC_HPP_INCLUDED | |
#include <iostream> | |
#include <string> |
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
/* | |
Tymon Woźniak <https://github.com/Moderrek> | |
C compile time concatenation | |
Struct printf | |
*/ | |
#include <stdio.h> | |
// struct print format | |
#define Point_Fmt "(%d, %d)" | |
// unpack struct |
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
import socket | |
import os | |
import mimetypes | |
class TCPServer: | |
def __init__(self, host='127.0.0.1', port=8888): | |
self.host = host | |
self.port = port |