Boost.ProgramOptions是Boost中一个专门用来解析命令行的库,其目标是轻松的解析命令行选项。
CMake设置编译选项
CMake中设置编译选项
1 | option(BUILD_VISUALIZATIONS "Build visualization, default OFF" OFF) |
Linux 解压缩rar包
下载rar软件安装包
直接从 rarlab 下载安装包
通过命令行下载
1
2wget https://www.rarlab.com/rar/rarlinux-x64-6.0.1.tar.gz # 64位
wget https://www.rarlab.com/rar/rarlinux-3.8.0.tar.gz # 32位
安装
1 | tar zxvf rarlinux-x64-6.0.1.tar.gz |
解压缩
1 | rar x xxx.rar # Extract files with full path |
使用clang和black 对C++、Python代码自动格式化
使用clang
对C++进行格式化
安装
clang-format
1
sudo apt-get install -y clang-format
简单使用
1
2clang-format -i <file_to_format>
# clang-format -i test.cc指定
style
1
2clang-format -i --stlye="{key: value, ...}"
# clang-format -i --stlye="{BasedOnStyle: Google, IndentWidth: 2}"指定 style 文件
1
2clang-format -i --stlye=file:<style_file>
# clang-format -i --style=file:.clang-format编写脚本
clang_format.bash
对文件夹下所有c++代码格式化1
2
3
4find . -regextype egrep -regex ".*\.(c|cc|h|hh)$" | xargs clang-format -i
# skip some paths
# find . -regextype egrep -regex ".*\.(c|cc|h|hh)$" -not -path '*/install/*' -not -path '*/build/*' -not -path '*/log/*' -not -path '*/deps/*'| xargs clang-format -i在需要格式化的路径下运行脚本
1
./clang_format.bash
linux 搭建FTP服务器
Debian添加最小化按钮
安装tweak和dconf
1 | sudo apt install gnome-tweak-tool |
进入路径: org/gnome/desktop/wm/preferences/button-layout

取消选项 Use default value