VS Code memo

launch.json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "demo1",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceRoot}/bld/Release/demo1",
            "stopAtEntry": false,
            "cwd": "${workspaceRoot}/bld/Release",
            "environment": [
                {
                    "name": "LD_LIBRARY_PATH",
                    "value": "${LD_LIBRARY_PATH}:${workspaceRoot}/bld/lib1:/path/to/lib2"
                }
            ],
            "externalConsole": false,
            "MIMode": "gdb"
        }
    ]
}

Don't translate tab to spaces,

1
File -> Preferences -> Settings -> Text Editor -> Insert Spaces / Detect Indentation

Display std::string or std::vector content

1
-exec -enable-pretty-printing

Blender source memo

1
2
3
4
5
6
7
8
9
10
#blender\source\blender\editors
ED_region_do_draw editors\screen\area.c
	outliner_main_region_draw editors\space_outliner\space_outliner.cc
		draw_outliner editors\space_outliner\outliner_draw.cc
			outliner_buttons
				UI_but_active_only editors\interface\interface.cc
					UI_but_active_only_ex
						ui_but_activate_event editors\interface\interface_handlers.c
							ui_do_button
								ui_do_but_TEX

Python Operator Precedence

The upper operators have higher precedence than the lower.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Grouping			()
Function call			f()
Slicing				[index:index]
Array subscription		[]
Bitwise NOT			~x
Unary plus/minus		+, -
Mul/Div/Mod			*, /, %
Add/Sub				+, -
Bitwise shift			<<, >>
Bitwise AND			&
Bitwise XOR			^
Bitwise OR			|
Relation			==, !=, >, >=, <, <=, is, is not, in, not in
				not
				and
				or
				lambda

refer to:
https://discuss.codechef.com/t/operator-precedence-table/14545

Stunning forbidden keyword about QSettings

1
2
3
4
5
    QSettings cfg(CONFIG_INI_PATH, QSettings::IniFormat);
    cfg.beginGroup("general"); // <-- other keywords are all ok.
    std::string val = cfg.value("itemCount").toString().toStdString();
    int video_count = cfg.value("itemCount").toInt();
    cfg.endGroup();

'general' keyword will lead 'val' to output empty in Qt5.15.2.