03 2023 档案
摘要:method str.format_map(self, mapping), 直接传mapping, 可overwrite __missing__
阅读全文
摘要:decimal_to_binary def decimal_to_binary(v: float, precison: int = 6) -> str: if v == 0: return '0b0' binary = '' integral = int(v) # integral part man
阅读全文
摘要:replace module: module-b module: module-a
阅读全文
摘要:正常情况fromisoformat都能处理 astimezone(self,tz=None) convert to aware datetime use replace(miscrosecond=0)
阅读全文
摘要:raise from try: try: 1 / 0 except ZeroDivisionError as e: raise Exception("with_traceback") from e except Exception as e: print(e, e.__cause__, type(e
阅读全文
摘要:URI chrome://management chrome://policy chrome://version chrome://settings
阅读全文
摘要:Configuration # mongod.conf # for documentation of all options, see: # http://docs.mongodb.org/manual/reference/configuration-options/ # Where and how
阅读全文
摘要:~/.npmrc 配置文件 npm login --scope @sporadic 在.npmrc产生如下配置 npm logout --scope @sporadic npm whoami --registry https://registry.npmjs.org ~/.npm/ global o
阅读全文
摘要:enable Use the `env` command. Env is a command which launches another program with a possibly modified environment. Because env is a program, it doesn
阅读全文
摘要:command command 只能跳过function,而不能跳过shell builtin 三个选项 -vV都是打印 -p 使用 default PATH 执行命令 bash默认PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sb
阅读全文
摘要:Fix permission stat -L --format %a ~/.ssh/config stat -L --format %A ~/.ssh/config chmod -vR 600 ~/.ssh/config ssh-agent IdentitiesOnly no in ssh_conf
阅读全文
摘要:Start ssh-agent -a bind_address Bind the agent to the UNIX-domain socket bind_address -k Kill the current agent (given by the SSH_AGENT_PID environmen
阅读全文
摘要:#include <stdio.h> #include "math.h" #include "stdlib.h" #include "unistd.h" int main(void) { int h, line, t; scanf("%i", &h); for (int v = h - 1; v >
阅读全文
摘要:Go C Java https://introcs.cs.princeton.edu/java/11precedence/ Python
阅读全文
摘要:1. send-only chan<- & receive-only <-chan channel package main import ( "fmt" "time" ) func producer(ch chan<- int, exitChan chan struct{}) { for i :=
阅读全文
摘要:func GetGoroutineID() int { var buf = make([]byte, 128) b := runtime.Stack(buf, false) idField := strings.Fields(strings.TrimPrefix(string(buf[:b]), "
阅读全文
摘要:1. channel func main() { boolChan := make(chan bool, 100) for i := 0; i < 100; i++ { go func(v int) { println(v) boolChan <- true }(i) } for i := 0; i
阅读全文
摘要:sudo rm -rf /Library/Input\ Methods/SogouInput.app sudo rm -rf /Users/$USER/Library/Caches/Sogou* sudo rm -rf /Users/$LOGNAME/.sogou*
阅读全文