Skip to content

Instantly share code, notes, and snippets.

View donRumata03's full-sized avatar
💤
Idleness limit exceed

Владимир Латыпов donRumata03

💤
Idleness limit exceed
View GitHub Profile
#pragma once
#include <cassert>
#include <cstdlib>
#include <iterator>
#include <utility>
#include <memory>
#include <algorithm>
template <typename T>
@donRumata03
donRumata03 / combination_by_number.rs
Created April 11, 2022 15:29
Generic combinatortial object generation in Rust (each filename corresponds to combinatorial object generated in file)
#![allow(dead_code)]
#![allow(unused_imports)]
use {
std::{
io::{
self,
Read,
Write,
Stdin,
@donRumata03
donRumata03 / main.py
Created January 16, 2021 17:46
The Mark Ipatov Bot
import telebot
def clean_word(word: str):
return "".join(filter(lambda x: str.isalnum(x), word.lower()))
def IpatovMarkize(string: str):
words = string.split()
has_mipatov = False
@donRumata03
donRumata03 / fifth.py
Created October 17, 2020 16:42
NTI physics solution (10-11 grades)
from fourth import *
weight_addition_on_pole_newtons = a_to_center * m_stone
weight_addition_on_pole_micronewtons = weight_addition_on_pole_newtons * 1e6
if __name__ == '__main__':
print(weight_addition_on_pole_micronewtons)
@donRumata03
donRumata03 / joystick.h
Created May 17, 2020 14:22
"VibroHod" source code
#include <Arduino.h>
#include <SoftwareSerial.h>
class Joystick{
int m_up = 0;
int m_down = 0;
int m_right = 0;
int m_left = 0;
bool m_button = false;
@donRumata03
donRumata03 / Grapher.py
Created May 2, 2020 13:36
Python scripts for an experiment with screw. It also researches linear regression`s error dependendency on the number of points dropped out.
import numpy as np
from matplotlib import pyplot as plt
from scipy.optimize import curve_fit
data = [(float(i[0]), float(i[1])) for i in list(map(str.split, open("data1.txt", "r").read().strip().split("\n")))]
def line(_x, _k, b):
return _x * _k + b
@donRumata03
donRumata03 / algo.py
Last active May 19, 2020 21:11
A python script, that makes svg file "generated.svg" with n`th order Serpinsky triangle and a difficult labirint
from typing import *
class edge:
def __init__(self, s, e, l):
self.start = s
self.end = e
self.length = l
def __repr__(self):
return f"({self.start}, {self.end}, {self.length})"
start : int
@donRumata03
donRumata03 / linear_regression.py
Created February 25, 2020 18:32
Linear regression is easy!) (You need only matplotilb for plotting result and numpy for np.linspace)
import random
from typing import Any
from matplotlib import pyplot as plt
import numpy as np
class linear_regression:
b : float
k : float
def __init__(self, init_k : float, init_b : float):