指定输出文件名

  • -o file:编译完成的输出到file,否则会使用非常烂的默认名字(比如a.exe)。
阅读全文 »

问题

PyQt在Python中直接执行需要调用QCoreApplication.exec()开始消息循环,但是调用该函数会阻塞命令行。

解决方法

使用IPython特有的扩展脚本:

1
%gui qt
阅读全文 »

一、安装Git[1]

sudo apt install git-all

二、开一个git账户(可选)

sudo adduser git
# sudo adduser git --uid 1001 --gid 1001
# sudo usermod -aG git git

UID和GID可以查看/etc/passwd/etc/group

阅读全文 »

1. 使用Disk2vhd软件

勾选磁盘对应的所有分区(MSR分区不需要,因为没有数据),并导出。无论是否少选了分区,分区表都会备份。此外,Bitlocker也不支持,需要先解密。

阅读全文 »

方法1

1
chmod g+s $(find . -type d)

该方法在文件过多时会报错Argument list too long,推荐第二个方法。

方法2

1
2
find . -type d -exec chmod g+s {} \;
find . -type d -execdir chmod g+s {} \;
阅读全文 »

基本操作

键入命令

1
> nvidia-smi
连续显示

Linux下键入

1
watch -n 1 -d nvidia-smi

调用摄像头代码

Python
1
2
3
4
5
6
import cv2          # 图像处理的库 OpenCV

cap = cv2.VideoCapture(0, cv2.CAP_DSHOW)
while stream.isOpened():
flag, img_rd = stream.read()
...
C++
1
2
3
4
5
6
7
8
9
10
#include <opencv/cv.h>
#include <opencv/highgui.h>

int main()
{
cv::VideoCapture cap(0, cv::CAP_DSHOW);
cv::Mat frame;
cap >> frame;
...
}
阅读全文 »
0%