LigeLaige

LigeLaige

V2EX member #112323, joined on 2015-04-21 15:26:56 +08:00
Per LigeLaige's settings, the topics list is hidden
Deals info, including closed deals, is not hidden
LigeLaige's recent replies
May 26, 2021
Replied to a topic by AkideLiu 程序员 C++ 关于 recursion 的一个小问题
<code>
int recur(int n) {
if (map_x.find(n) != map_x.end()) {
return map_x[n];
}
count_x++;
if (n < 3) {
map_x[n] = 1;
} else {
map_x[n] = recur(n-1) * recur(n-2) * recur(n-3);
}
return map_x[n];
}
</code>
May 26, 2021
Replied to a topic by AkideLiu 程序员 C++ 关于 recursion 的一个小问题
顺着 lz 思路,修改如下
```cpp
int recur(int n) {
if (map_x.find(n) != map_x.end()) {
return map_x[n];
}
count_x++;
if (n < 3) {
map_x[n] = 1;
} else {
map_x[n] = recur(n-1) * recur(n-2) * recur(n-3);
}
return map_x[n];
}
```
Feb 28, 2021
Replied to a topic by yiouejv C++ 5 分钟掌握 C++中的三种继承方式
可以再介绍一下,它们有哪些经典的用法,使用场景举例。
Apr 3, 2019
Replied to a topic by 5200 职场话题 漏打卡一次扣两天工作日的工资
我公司没有打卡,早到早下班,晚到晚下班,全凭个人自觉,感兴趣可私聊
Feb 23, 2019
Replied to a topic by darknoll DevOps 你们电脑上装了哪些有用的命令行工具?
scoop msys2 cmake ninja git vcpkg python nodejs
Jul 2, 2017
Replied to a topic by donglongtu Linux 一道 C 语言 printf 的经典题目
printf 簇函数 ( printf/sprintf/fprintf ) 返回打印的字符串的长度
printf "43" 返回长度 2, "2" 返回长度 1 (延伸:"1" 还是返回 1 )

所以 console 里面看到的是 4321,可以分开看:先打印 43,然后打印 2,然后打印 1,如果在调一层,就还是 1 ( 43211 )。
1. paramiko
2. sshpass -p passwd ssh|scp
Jan 5, 2017
Replied to a topic by cfczdws 编程 求这样的正则匹配模型
@cfczdws

import re
pattern = re.compile(r'\D+\d{6}\D+')
result = pattern.findall('abc12345678def')
# result is []

不知道你是否仔细看了大家的答案!
如果你需要提取这个数字,则可以写成
r'\D+(\d{6})\D+'
它会保持在正则引擎的内建变量 \1 中
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5086 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 04:02 · PVG 12:02 · LAX 21:02 · JFK 00:02
♥ Do have faith in what you're doing.