会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
xuyv
博客园
首页
新随笔
联系
订阅
管理
[置顶]
docker提示shared memory不够
摘要: 运行 sudo umount /dev/shm/ && sudo mount -t tmpfs -o rw,nosuid,nodev,noexec,relatime,size=1G shm /dev/shm 或者 umount /dev/shm/ && mount -t tmpfs -o rw,no
阅读全文
posted @ 2022-03-16 17:34 xuyv
阅读(242)
评论(0)
推荐(0)
2024年3月21日
python statlic lib embedding
摘要: python static lib因为默认没有编译内置库,因此需要配置setup.local文件,把内置库编译到static lib。 参考:https://wiki.python.org/moin/BuildStatically。(./configure --disable-shared即可) 注
阅读全文
posted @ 2024-03-21 13:43 xuyv
阅读(18)
评论(0)
推荐(0)
2024年3月7日
sigint sigterm sigkill
摘要: sigint sigterm都将收到信号。区别在于sigint会对进程树发送信号,因此子进程也会自动退出。(on Unix in most cases the parent and child will share a controlling terminal. Pressing Ctrl+C in
阅读全文
posted @ 2024-03-07 10:57 xuyv
阅读(29)
评论(0)
推荐(0)
2024年1月24日
英文发音-链接
摘要: 英文发音链接分类: 混合 两个连续辅音,平滑过度。 如this-month 协同 -重叠 停音+鼻音 (tdbpkg) + (mnn,),停音不释放气(否则t会变成te)。 如good-news, bad-luck, signal(一个词) 同化 dont you 变 donchyou did yo
阅读全文
posted @ 2024-01-24 13:48 xuyv
阅读(52)
评论(0)
推荐(0)
2023年11月27日
Python Multiprocessing Pool's Task Scheduling
摘要: mp pool的任务调度遵循FIFO机制。对任务数组,逐个分配进程资源。 如对于p0-pn, pi对应的是a[i]的资源。 一般来说sizeof(a) > sizeof(p),即任务数大于进程资源数。 此时,空闲的资源将进一步使用FIFO,选取任务进行执行,从而避免资源浪费。 因此,在排布a[i]的
阅读全文
posted @ 2023-11-27 14:26 xuyv
阅读(26)
评论(0)
推荐(0)
2023年8月3日
linux rename的实现
摘要: linux rename可以批量重命名文件。 rename expression replacement files 可以用bash实现: 遍历文件file,用sed等替换file中的字符串,mv $file `echo $file | sed -i 's/expression/replacemen
阅读全文
posted @ 2023-08-03 11:01 xuyv
阅读(79)
评论(0)
推荐(0)
2023年7月29日
std::move和std::forward
摘要: move和forward不进行任何操作,他们只负责类型转换。 move(x)等价于 static_cast<remove_reference_t<T>&&>(x)。因为T首先被剥夺引用,因此这里不会产生引用折叠,必定返回右值。 forward(x)等价于 static_cast<T&&> (x)。因
阅读全文
posted @ 2023-07-29 16:04 xuyv
阅读(32)
评论(0)
推荐(0)
2023年7月26日
map of tuples and unordered_map of tuples
摘要: 由于c++ map和unordered_map的底层实现不同,因此对tuples 作为key的支持情况也不同。 map是二叉树实现的,因此tuple as key比较容易实现,c++也是支持的。 unordered_map是hash实现的,hash一个tuple就不太容易了,c++貌似不支持,同样值
阅读全文
posted @ 2023-07-26 17:38 xuyv
阅读(104)
评论(0)
推荐(0)
2023年7月19日
DP: 0-1背包,完全背包
摘要: 见:『 一文搞懂完全背包问题 』从0-1背包到完全背包,逐层深入+推导 - 零钱兑换 - 力扣(LeetCode) 0-1背包: dp[i][w] = minmax(dp[i-1][w], dp[i-1][w-wi] + vi) 完全背包 dp[i][w] = minmax(dp[i-1][w],
阅读全文
posted @ 2023-07-19 21:48 xuyv
阅读(24)
评论(0)
推荐(0)
2023年7月5日
lower bound 和upper bound的意义
摘要: 它们通常来说可以成对出现,寻找某个值的range: [first, last)。 因为这个range符合数学意义的上界和下界,因此被命名为lower bound何upper bound。 如果这个值,存在,那么它其实等价于equal_range。 如1,2,2,3。val = 2,则lower_bo
阅读全文
posted @ 2023-07-05 14:58 xuyv
阅读(852)
评论(0)
推荐(0)
c++向上取整的方法
摘要: 因为c++默认向下取整,因此向下取整通常不需要我们考虑。 考虑向上取整: 公式: ceil(A/B) = floor((A-1)/B) + 1 在c++里也可以写为 Up(a/b) = (a-1)/b + 1 等价于 (a+b-1)/b 可以想象为利用C++向下取整的方法,将a 加上一个b-1,则
阅读全文
posted @ 2023-07-05 07:41 xuyv
阅读(3997)
评论(0)
推荐(0)
下一页
公告