CoolMind


If you cannot measure it, you cannot improve it.

Linux split

Linux 中有很多易用的命令行工具。split 就是其中之一。介绍实际中使用的几个比较常用的分割文件的方法。 按照固定行切分 自动切分行 切分文件的方式 Reference Macos 中的 split 命令和 linux 行为不太一致。 按照固定行切分 spli...

std::transform not working with std::toupper

ctype 中定义了一些比较实用的函数,例如 toupper, tolower, isalpha 等等。在 C++ 中如何实用这些函数呢?使用 cctype,然后就可以在 std 的命名空间中使用这些函数。 背景 问题 解决方案 刨根问题 toupper...

python pickle

torch.save 和 torch.load 默认使用的 pickle 模块进行序列化和反序列化。在调用 torch.load 时偶尔会遇到缺失类的问题。这篇文章仔细分析了 pickle 的源码,并且对于 缺失类也提供了一些解决方案。 背景 struct By...

Python Jinja2

Jinja2 is a fast, expressive, extensible templating engine. This blog records the problems or requirements I met during my development. Basic u...

How tornado starts?

项目中的服务使用 tornado 来搭建,但是对于 tornado 如何启动还没有仔细研究过。 在某次问题排查时,仔细研究了 tornado 是如何启动的。 测试 刨根问底 最终代码 get_event_loop stop 总...

Kubernetes python package

在项目中使用比较多的 kubernetes。主要使用相应的 python kubernetes 库包来进行各种部署的管理。 国内很多讲解 kubernetes 原理,但是对于这个库各种使用看起来比较少。 Initialization Deployments 重启...

iptables in linux

An email sent from bwg told me that my service had been banned due to a DDoS attack. My response is to change all the related passwords of the con...

logger.debug causes performance issues

A logger is preferred in a formal project, because we can set different levels for different loggers, redirect log messages to files (even to remot...