02 2022 档案
摘要:list derivatives & dict deconstruction ebb = dict(zip('abcde', (11, 22, 11, 33, 22))) print(ebb) print([k for k, v in ebb.items() if v == 11]) filter
阅读全文
摘要:lru_cache import functools, time @functools.lru_cache(maxsize=128, typed=False) def b(x, y, z=3): time.sleep(2) return x + y print(b(5, 6)) print('~'
阅读全文
摘要:import inspect def b(x, y: int = 5, *args, z, t=55, **kwargs) -> int: return x + y signature = inspect.signature(b) print(signature) print(signature.p
阅读全文
摘要:打印Full binary tree: import math def reveal(vail: list | tuple): """ 利用Python居中打印 :param vail: :return: """ length = len(vail) height = math.ceil(math.
阅读全文
摘要:import datetime, multiprocessing, logging, time, threading from concurrent import futures FORMAT = '%(asctime)-9s [%(processName)-10s %(process)6d] %(
阅读全文
摘要:import threading, time, logging, random, datetime, multiprocessing FORMAT = '%(asctime)-15s %(process)d %(lineno)-3s [%(threadName)-11s %(thread)6d] %
阅读全文
摘要:import time, logging, typing, threading, random, datetime FORMAT = '{asctime} {levelname} {process} {processName} {threadName} {thread} {lineno}> {mes
阅读全文
摘要:import time, logging, typing, threading, random, datetime FORMAT = '{asctime} {levelname} {process} {processName} {threadName} {thread} {message}' log
阅读全文
摘要:消费速度 > 生产速度 import threading, time, logging, random FORMAT = '%(asctime)-15s [%(threadName)-11s %(thread)6d] %(message)s' logging.basicConfig(format=F
阅读全文
摘要:import threading, logging logging.basicConfig(format='%(asctime)-15s [%(threadName)s %(thread)d] %(message)s', level=logging.INFO, datefmt='%F %T') de
阅读全文
摘要:从上述报错,可知int类参数必须是 str, bytes, bytearray, int, float 五种类型 int() 可接受两个参数 base默认是10进制 无参 -> zero 第一参数为 number类型 TypeError 不能带明确的base, 即base就是默认10进制 可将flo
阅读全文
摘要:生产杯子 import time, logging, threading FORMAT = '%(asctime)s %(threadName)s %(thread)d %(message)s' logging.basicConfig(level=logging.INFO, format=FORMA
阅读全文
摘要:import logging FORMAT = '%(asctime)-15s\tThread: %(threadName)s %(thread)d %(message)s' logging.basicConfig(format=FORMAT, level=logging.WARNING, date
阅读全文
摘要:RedHat: /etc/profile printf "%-8s %-25s %-4s %s\n" @@@@@ /etc/profile '==>' Commence printf "%-8s %-25s %-4s %s\n" @@@@@ /etc/profile '==>' Closure /e
阅读全文
摘要:load data infile 'data.csv' into table project.tbl_data character set utf8mb4 fields terminated by ',' optionally enclosed '"' escaped by '"' lines te
阅读全文
摘要:# Read more about SSH config files: https://linux.die.net/man/5/ssh_config Host * #IgnoreUnknown * AddKeysToAgent yes AddressFamily any BatchMode no C
阅读全文
摘要:# Prerequisite dnf install libtool libtool-ltdl-devel openssl-devel tcp_wrappers cyrus-sasl-devel systemd-devel perl-devel # Account groupadd --gid 38
阅读全文
摘要:StrongSwan: # ####################################### ####################################### # # # Operations # IPSec监听在UDP的500和4500两个端口,其中500是用来IKE密
阅读全文
摘要:[Unit] Description=OpenLDAP Server Daemon Documentation=man:slapd Documentation=man:slapd-config Documentation=man:slapd-mdb After=syslog.target netwo
阅读全文
摘要:tar -xf base.tar.gz --directory /data chown -R postgres.postgres /data chown -R 0700 /data sudo -u postgres /usr/lib/postgresql/10/bin/pg_ctl start --
阅读全文
摘要:从低位依次打印,并计算位数 n = int(input('number: ')) count = 0 while True: print(n % 10) n = n // 10 count += 1 if n == 0: break print('number of digits: ', count
阅读全文
摘要:- hosts: database remote_user: root gather_facts: true tasks: - name: pp shell: | echo aaaaa ech bbbb ignore_errors: true - debug: msg="{{ ansible_dis
阅读全文
摘要:~/.pgpass hostname:port:database:username:password chmod 0600 ~/.pgpass PGPASSWORD=password psql --host=host --port=5432 --username postgres postgres
阅读全文
摘要:#!/bin/env bash git init touch init git add -- . git commit -am init echo a >> main_file git add --all git commit -am 'main a' echo b >> main_file git
阅读全文
摘要:init.gradle allprojects { repositories { maven { url 'file:///E:/Java/Repository'} mavenLocal() maven { name "Alibaba" ; url "https://maven.aliyun.com
阅读全文
摘要:user nginx; worker_processes auto; worker_processes 4; worker_cpu_affinity 0001 0010 0100 1000; worker_rlimit_nofile 65536; #error_log logs/error.log;
阅读全文
摘要:#!/bin/env bash for branch in $(git branch -a | grep '^\s*remotes/origin/' | grep -Ev '(:?HEAD|master)$'); do git branch --force --track "${branch##*/
阅读全文
摘要:URL - Web APIs | MDN (mozilla.org) URL | Node.js v17.4.0 Documentation (nodejs.org)
阅读全文
摘要:Import-Module posh-git $GitPromptSettings.DefaultPromptWriteStatusFirst = $true $GitPromptSettings.DefaultPromptBeforeSuffix.Text = ' $([DateTime]::no
阅读全文
摘要:invoke-item $profile
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi
阅读全文
摘要:thermodynamic char: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="v
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi
阅读全文
摘要:single-line: overflow: hidden white-space: nowrap text-overflow: ellipsis
阅读全文
摘要:postion & translate(-50%,-50%) position & margin-top: negative, margin-left: negative flex position & left rigth bottom left 0 margin: auto table-cell
阅读全文