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
#for Windows | |
import pathlib | |
import sys | |
import os | |
curr_path = pathlib.Path().resolve() | |
def copy2cb(data): | |
with open(".ts","w") as f: | |
f.write(str(data)) |
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
/* | |
* This solution works for Windows as well, | |
* i don't know what about Unix-like, but i think | |
* it can include different implementations with | |
* macros as Win32 e.t.c. | |
* So we save ipconfig result to file get its 13 line | |
* with ipv4 data, save it, delete file and then return data. | |
*/ | |
#ifndef GET_IP_H | |
#define GET_IP_H |
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 os import listdir, system | |
import pathlib | |
data = listdir(pathlib.Path().absolute()) | |
data = list(filter(lambda n: n[len(n)-4:] == ".exe",data)) | |
if len(data) != 1: | |
print("can not find what to run") | |
else: | |
programm = data[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
template<class T> | |
class Node | |
{ | |
private: | |
T data; | |
Node* left, * right; | |
public: | |
Node() | |
{ |
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"SFML/Graphics.hpp" | |
#include<vector> | |
#include<random> | |
#include<iostream> | |
using namespace sf; | |
using namespace std; | |
const int MAX_X = 4; |
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"SFML/Graphics.hpp" | |
#include<random> | |
#include<vector> | |
#include<iostream> | |
using namespace std; | |
using namespace sf; | |
const int CELL_SIZE = 16; |
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 "SFML/Graphics.hpp" | |
#include<random> | |
#include<vector> | |
#include<string> | |
//to print score and wait | |
#include<iostream> | |
#include<conio.h> | |
using namespace std; |
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
use rand::prelude::*; | |
use modinverse::modinverse; | |
fn is_prime(n: u32) -> bool | |
{ | |
//checks is number prime | |
let limit = (n as f64).sqrt() as u32; | |
for i in 2..=limit { | |
if n % i == 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
def FizzBuzz(number): | |
is_mult_of_3 = lambda n: (n % 3) == 0 | |
is_mult_of_5 = lambda n: (n % 5) == 0 | |
if is_mult_of_3(number) and is_mult_of_5(number): | |
return "FizzBuzz" | |
elif is_mult_of_3(number): | |
return "Fizz" | |
elif is_mult_of_5(number): | |
return "Buzz" | |
else: |
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 ctypes | |
import time | |
kernel32 = ctypes.windll.kernel32 | |
user32 = ctypes.windll.user32 | |
#standart clipboard formats used with win32 | |
CF_TEXT = 1 | |
CF_BITMAP = 2 |
NewerOlder