Retrieve all widgets after times of calling addWidget at same position

Don't call QGridLayout::itemAtPosition.

Like this,

1
2
3
4
5
6
7
8
9
10
11
12
for (int i = 0; i < grid_layout->count(); i++)
{
	QLayoutItem* item = grid_layout->itemAt(i);
 
	if (item->widget() == widget_wanted)
	{
		int row, column, row_span, column_span;
		grid_layout->getItemPosition(i, &row, &column, &row_span, &column_span);
 
		// grid_layout->addWidget(frame, row, column);
	}
}

Compile gdb

1
2
3
4
./configure --prefix=`pwd`/installed --with-python=/usr/bin/python3
make -j 16
make install
cp -Rf /usr/share/gdb/auto-load `pwd`/installed/share/gdb/

Remote desktop between Ubuntus

1
2
3
4
5
sudo apt install tigervnc-common
sudo apt install tigervnc-standalone-server
#vncpasswd
vncserver -localhost no -geometry 1280x720 :1
vncserver -list

Authentication required?

Empty ~/.vnc/passwd and

1
2
#/etc/xdg/autostart$ sudo vi org.gnome.SettingsDaemon.Color.desktop
X-GNOME-Autostart-enabled=false

then reboot the server.

refer to:
https://blog.csdn.net/Naisu_kun/article/details/123007055

Deep learning memo

1
2
3
import netron
modelPath = "models.onnx"
netron.start(modelPath)

then browse to http://localhost:8080.
onnx to trt

1
./trtexec --onnx=Resnet34_3inputs_448x448_20200609.onnx --saveEngine=Resnet34_3inputs_448x448_20200609.trt --workspace=6000

TensorRT docs https://docs.nvidia.com/deeplearning/tensorrt/api/c_api/classnvinfer1_1_1_i_runtime.html

Precision of time_since_epoch

1
2
#include <chrono>
uint64_t timestamp = std::chrono::system_clock::now().time_since_epoch().count();

'timestamp' is in ns, not in us(μs or microsecond).

1
2
3
4
5
6
1 s = 1000 ms
1 ms = 1000 μs
1 μs = 1000 ns
1 ns = 1000 ps
 
2 GHz = 2 x 10^9 Hz, its 1 circle has 0.5 ns long.