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 阅读全文
posted @ 2022-02-28 16:54 ascertain 阅读(23) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-02-28 14:30 ascertain 阅读(17) 评论(0) 推荐(0) 编辑
摘要: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('~' 阅读全文
posted @ 2022-02-27 23:40 ascertain 阅读(44) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2022-02-27 21:32 ascertain 阅读(91) 评论(0) 推荐(0) 编辑
摘要:打印Full binary tree: import math def reveal(vail: list | tuple): """ 利用Python居中打印 :param vail: :return: """ length = len(vail) height = math.ceil(math. 阅读全文
posted @ 2022-02-26 00:20 ascertain 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-02-26 00:04 ascertain 阅读(32) 评论(0) 推荐(0) 编辑
摘要:import datetime, multiprocessing, logging, time, threading from concurrent import futures FORMAT = '%(asctime)-9s [%(processName)-10s %(process)6d] %( 阅读全文
posted @ 2022-02-25 23:52 ascertain 阅读(53) 评论(0) 推荐(0) 编辑
摘要:import threading, time, logging, random, datetime, multiprocessing FORMAT = '%(asctime)-15s %(process)d %(lineno)-3s [%(threadName)-11s %(thread)6d] % 阅读全文
posted @ 2022-02-25 22:37 ascertain 阅读(64) 评论(0) 推荐(0) 编辑
摘要:import time, logging, typing, threading, random, datetime FORMAT = '{asctime} {levelname} {process} {processName} {threadName} {thread} {lineno}> {mes 阅读全文
posted @ 2022-02-25 21:49 ascertain 阅读(90) 评论(0) 推荐(0) 编辑
摘要:import time, logging, typing, threading, random, datetime FORMAT = '{asctime} {levelname} {process} {processName} {threadName} {thread} {message}' log 阅读全文
posted @ 2022-02-25 19:31 ascertain 阅读(71) 评论(0) 推荐(0) 编辑
摘要:消费速度 > 生产速度 import threading, time, logging, random FORMAT = '%(asctime)-15s [%(threadName)-11s %(thread)6d] %(message)s' logging.basicConfig(format=F 阅读全文
posted @ 2022-02-25 15:52 ascertain 阅读(164) 评论(0) 推荐(0) 编辑
摘要:import threading, logging logging.basicConfig(format='%(asctime)-15s [%(threadName)s %(thread)d] %(message)s', level=logging.INFO, datefmt='%F %T') de 阅读全文
posted @ 2022-02-25 12:41 ascertain 阅读(52) 评论(0) 推荐(0) 编辑
摘要:从上述报错,可知int类参数必须是 str, bytes, bytearray, int, float 五种类型 int() 可接受两个参数 base默认是10进制 无参 -> zero 第一参数为 number类型 TypeError 不能带明确的base, 即base就是默认10进制 可将flo 阅读全文
posted @ 2022-02-25 11:23 ascertain 阅读(1034) 评论(0) 推荐(0) 编辑
摘要:生产杯子 import time, logging, threading FORMAT = '%(asctime)s %(threadName)s %(thread)d %(message)s' logging.basicConfig(level=logging.INFO, format=FORMA 阅读全文
posted @ 2022-02-24 22:02 ascertain 阅读(91) 评论(0) 推荐(0) 编辑
摘要:import logging FORMAT = '%(asctime)-15s\tThread: %(threadName)s %(thread)d %(message)s' logging.basicConfig(format=FORMAT, level=logging.WARNING, date 阅读全文
posted @ 2022-02-24 19:47 ascertain 阅读(30) 评论(0) 推荐(0) 编辑
摘要:RedHat: /etc/profile printf "%-8s %-25s %-4s %s\n" @@@@@ /etc/profile '==>' Commence printf "%-8s %-25s %-4s %s\n" @@@@@ /etc/profile '==>' Closure /e 阅读全文
posted @ 2022-02-16 17:26 ascertain 阅读(151) 评论(0) 推荐(0) 编辑
摘要:load data infile 'data.csv' into table project.tbl_data character set utf8mb4 fields terminated by ',' optionally enclosed '"' escaped by '"' lines te 阅读全文
posted @ 2022-02-16 11:43 ascertain 阅读(78) 评论(0) 推荐(0) 编辑
摘要:# Read more about SSH config files: https://linux.die.net/man/5/ssh_config Host * #IgnoreUnknown * AddKeysToAgent yes AddressFamily any BatchMode no C 阅读全文
posted @ 2022-02-16 11:15 ascertain 阅读(298) 评论(0) 推荐(0) 编辑
摘要:# Prerequisite dnf install libtool libtool-ltdl-devel openssl-devel tcp_wrappers cyrus-sasl-devel systemd-devel perl-devel # Account groupadd --gid 38 阅读全文
posted @ 2022-02-14 11:04 ascertain 阅读(285) 评论(0) 推荐(0) 编辑
摘要:StrongSwan: # ####################################### ####################################### # # # Operations # IPSec监听在UDP的500和4500两个端口,其中500是用来IKE密 阅读全文
posted @ 2022-02-14 11:01 ascertain 阅读(332) 评论(0) 推荐(0) 编辑
摘要:[Unit] Description=OpenLDAP Server Daemon Documentation=man:slapd Documentation=man:slapd-config Documentation=man:slapd-mdb After=syslog.target netwo 阅读全文
posted @ 2022-02-14 10:54 ascertain 阅读(123) 评论(0) 推荐(0) 编辑
摘要: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 -- 阅读全文
posted @ 2022-02-14 10:39 ascertain 阅读(43) 评论(0) 推荐(0) 编辑
摘要:从低位依次打印,并计算位数 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 阅读全文
posted @ 2022-02-13 16:06 ascertain 阅读(38) 评论(0) 推荐(0) 编辑
摘要:- hosts: database remote_user: root gather_facts: true tasks: - name: pp shell: | echo aaaaa ech bbbb ignore_errors: true - debug: msg="{{ ansible_dis 阅读全文
posted @ 2022-02-13 16:05 ascertain 阅读(60) 评论(0) 推荐(0) 编辑
摘要:~/.pgpass hostname:port:database:username:password chmod 0600 ~/.pgpass PGPASSWORD=password psql --host=host --port=5432 --username postgres postgres 阅读全文
posted @ 2022-02-10 19:58 ascertain 阅读(29) 评论(0) 推荐(0) 编辑
摘要:#!/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 阅读全文
posted @ 2022-02-10 15:00 ascertain 阅读(38) 评论(0) 推荐(0) 编辑
摘要:init.gradle allprojects { repositories { maven { url 'file:///E:/Java/Repository'} mavenLocal() maven { name "Alibaba" ; url "https://maven.aliyun.com 阅读全文
posted @ 2022-02-10 14:57 ascertain 阅读(20) 评论(0) 推荐(0) 编辑
摘要:user nginx; worker_processes auto; worker_processes 4; worker_cpu_affinity 0001 0010 0100 1000; worker_rlimit_nofile 65536; #error_log logs/error.log; 阅读全文
posted @ 2022-02-10 14:41 ascertain 阅读(93) 评论(0) 推荐(0) 编辑
摘要:#!/bin/env bash for branch in $(git branch -a | grep '^\s*remotes/origin/' | grep -Ev '(:?HEAD|master)$'); do git branch --force --track "${branch##*/ 阅读全文
posted @ 2022-02-10 13:02 ascertain 阅读(128) 评论(0) 推荐(0) 编辑
摘要:URL - Web APIs | MDN (mozilla.org) URL | Node.js v17.4.0 Documentation (nodejs.org) 阅读全文
posted @ 2022-02-10 13:01 ascertain 阅读(35) 评论(0) 推荐(0) 编辑
摘要:Import-Module posh-git $GitPromptSettings.DefaultPromptWriteStatusFirst = $true $GitPromptSettings.DefaultPromptBeforeSuffix.Text = ' $([DateTime]::no 阅读全文
posted @ 2022-02-09 13:11 ascertain 阅读(213) 评论(0) 推荐(0) 编辑
摘要:invoke-item $profile 阅读全文
posted @ 2022-02-09 11:04 ascertain 阅读(27) 评论(0) 推荐(0) 编辑
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文
posted @ 2022-02-08 15:49 ascertain 阅读(62) 评论(0) 推荐(0) 编辑
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文
posted @ 2022-02-08 13:45 ascertain 阅读(30) 评论(0) 推荐(0) 编辑
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文
posted @ 2022-02-08 13:02 ascertain 阅读(56) 评论(0) 推荐(0) 编辑
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文
posted @ 2022-02-07 22:22 ascertain 阅读(86) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-02-06 15:26 ascertain 阅读(13) 评论(0) 推荐(0) 编辑
摘要:thermodynamic char: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="v 阅读全文
posted @ 2022-02-03 15:06 ascertain 阅读(39) 评论(0) 推荐(0) 编辑
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文
posted @ 2022-02-02 21:12 ascertain 阅读(27) 评论(0) 推荐(0) 编辑
摘要:single-line: overflow: hidden white-space: nowrap text-overflow: ellipsis 阅读全文
posted @ 2022-02-01 21:32 ascertain 阅读(41) 评论(0) 推荐(0) 编辑
摘要:postion & translate(-50%,-50%) position & margin-top: negative, margin-left: negative flex position & left rigth bottom left 0 margin: auto table-cell 阅读全文
posted @ 2022-02-01 19:31 ascertain 阅读(144) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示