aioconsole
- echo server:
python echo-server.py <IP> - echo client:
python echo-client <IP> <port> - Use
localhostas IP and10000or10001as port.
| #include <stdio.h> | |
| #include <stdlib.h> | |
| int main(int argc, char* argv[]) | |
| { | |
| int n, i; | |
| if (argc != 2) | |
| return 1; |
| from tqdm import tqdm | |
| from bs4 import BeautifulSoup as bs | |
| import requests | |
| import math | |
| url = 'http://dl.yektamusic.ml/Artist/Ebi/' | |
| r = requests.get(url) | |
| s = bs(r.content, 'html.parser') |
| function zkill | |
| set pid_name (ps -ef | fzf | awk '{print $2; print $8}') | |
| set pid $pid_name[1] | |
| if test -n "$pid"; and string match -qr '^[0-9]+$' "$pid" | |
| kill -9 $pid | |
| echo Killed {$pid_name[2]} with pid: $pid | |
| else | |
| echo Nothing done. | |
| # echo $pid |
| import eyed3 | |
| import glob | |
| def f(filename): | |
| audiofile: eyed3.mp3.Mp3AudioFile = eyed3.load(filename) | |
| # print(type(audiofile)) | |
| title = audiofile.tag.title.replace('GOOz', '') | |
| trackNumber = int(filename.split()[0]) | |
| # print(title, trackNumber) |
| #include <stdio.h> | |
| #include <unistd.h> | |
| int main() | |
| { | |
| puts("L1 I-cache:"); | |
| printf("\tSize: %li\n", sysconf(_SC_LEVEL1_ICACHE_SIZE)); | |
| printf("\tAssoc: %li\n", sysconf(_SC_LEVEL1_ICACHE_ASSOC)); | |
| printf("\tLinesize: %li\n", sysconf(_SC_LEVEL1_ICACHE_LINESIZE)); |
| from scipy import spatial | |
| import numpy as np | |
| pos = np.c_[np.random.rand(100), np.random.rand(100)] | |
| tree = spatial.cKDTree(pos) | |
| dist, ids = tree.query(pos, 2) | |
| print(f'min dist: {np.min(dist[:, 1]): 8f}') |
| ## | |
| # Div by 10 in x64 | |
| # | |
| # @file | |
| # @version 0.1 | |
| .PHONY: default all run clean | |
| default: a | |
| all: default |
| #!/usr/bin/env python3 | |
| # -*- coding: utf-8 -*- | |
| class Table: | |
| def __init__(self, table=None): | |
| empty = [3 * [" "], 3 * [" "], 3 * [" "]] | |
| self.table = table if table else empty | |
| def __delitem__(self, key) -> None: | |
| self.table.__delattr__(key) |
| #include <algorithm> | |
| #include <array> | |
| #include <iostream> | |
| #include <random> | |
| #include <string_view> | |
| const int LEN = 10; | |
| using Indexer = int; |