This file contains hidden or 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
taskkill /f /im wslservice.exe | |
wsl --shutdown | |
powershell -command "Restart-Service LxssManager" |
This file contains hidden or 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
version: "3" | |
services: | |
zookeeper: | |
image: bitnami/zookeeper | |
ports: | |
- 2181:2181 | |
environment: | |
- ALLOW_ANONYMOUS_LOGIN=yes | |
kafka: |
This file contains hidden or 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
version: "3" | |
services: | |
zookeeper: | |
image: bitnami/zookeeper | |
ports: | |
- 2181:2181 | |
environment: | |
- ALLOW_ANONYMOUS_LOGIN=yes | |
kafka: |
This file contains hidden or 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 functools | |
import time | |
def retry(n=3, sleep=1): | |
def decorate(f): | |
@functools.wraps(f) | |
def applicator(*args, **kwargs): | |
i = 0 | |
while True: | |
i += 1 |
This file contains hidden or 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 os | |
import math | |
from tqdm import tqdm | |
from PIL import Image | |
def list_files(path): | |
return list(filter(os.path.isfile, [os.path.join(path, f) for f in os.listdir(path)])) | |
This file contains hidden or 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 sys | |
import struct | |
def get_byte(b): # python 2 | |
if sys.version_info[0] == 3: | |
return b | |
else: | |
return ord(b) |
This file contains hidden or 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 os | |
import sys | |
import webp | |
from PIL import Image | |
from send2trash import send2trash | |
parent_dir = sys.argv[1] | |
_, _, filenames = next(os.walk(parent_dir)) |
This file contains hidden or 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 math import sqrt, floor, ceil, gcd, log | |
import random | |
from tqdm import tqdm | |
from collections import Counter | |
def inclusive_range(start, stop, step=1): | |
return range(start, (stop + 1) if step >= 0 else (stop - 1), step) | |
def prod(l): | |
p = 1 |
This file contains hidden or 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
(* Content-type: application/vnd.wolfram.mathematica *) | |
(*** Wolfram Notebook File ***) | |
(* http://www.wolfram.com/nb *) | |
(* CreatedBy='Mathematica 11.2' *) | |
(*CacheID: 234*) | |
(* Internal cache information: | |
NotebookFileLineBreakTest |
This file contains hidden or 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 keras | |
print("keras version:", keras.__version__) | |
import os | |
import time | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import random | |
from tqdm.autonotebook import tqdm as progressbar |
NewerOlder