12/23/2020

LG display text blurry (not sharp) on Windows 10 LG显示器字体不清楚

The LG display settings need to be modified.

Press the center button to open the settings. 设置 | 通用 | HDMI兼容模式 | 开启

12/19/2020

Debug symbol lookup error: undefined symbol: _ZN2cv8imencodeERKNS_6StringERKNS_11_InputArrayERSt6vectorIhSaIhEERKS6_IiSaIiEE

symbol lookup error: /home/liangzou/.cache/bazel/_bazel_liangzou/766790ddbe8cf965fa78098dbd133c63/execroot/__main__/bazel-out/k8-fastbuild/bin/external/deepmap_base/common/image/../../../../_solib_k8/libexternal_Sdeepmap_Ubase_Scommon_Simage_Slibio_Uutils.so: undefined symbol: _ZN2cv8imencodeERKNS_6StringERKNS_11_InputArrayERSt6vectorIhSaIhEERKS6_IiSaIiEE

The function definition is in this library: libopencv_imgcodecs.a

objdump -t libopencv_imgcodecs.a | grep _ZN2cv8imencodeERKNS_6StringERKNS_11_InputArrayERSt6vectorIhSaIhEERKS6_IiSaIiEE

0000000000000000 g     F .text._ZN2cv8imencodeERKNS_6StringERKNS_11_InputArrayERSt6vectorIhSaIhEERKS6_IiSaIiEE  0000000000000888 .hidden _ZN2cv8imencodeERKNS_6StringERKNS_11_InputArrayERSt6vectorIhSaIhEERKS6_IiSaIiEE

So the function is hidden.

In the opencv library repo file: opencv2/core/cvdef.h, it has:
#ifdef CVAPI_EXPORTS
# if (defined _WIN32 || defined WINCE || defined __CYGWIN__)
#   define CV_EXPORTS __declspec(dllexport)
# elif defined __GNUC__ && __GNUC__ >= 4
#   define CV_EXPORTS __attribute__ ((visibility ("default")))
# endif
#endif

#ifndef CV_EXPORTS
# define CV_EXPORTS
#endif

For some reason, the CV_EXPORTS didn't take effect. Need to change:
#ifndef CV_EXPORTS
# define CV_EXPORTS __attribute__ ((visibility ("default")))
#endif

12/09/2020

How to install an HP printer on Ubuntu 18

 https://developers.hp.com/hp-linux-imaging-and-printing/gethplip

Download and install the drive. Follow the GUI instructions on how to add a printer.

If the .run file cannot install the application correctly, use the Advanced Option by downloading the tarball, .configure, make and sudo make install. Instruction is here: https://developers.hp.com/hp-linux-imaging-and-printing/install/manual/distros/ubuntu

If using the manual method: run sudo hp-setup to setup.

12/08/2020

Regular expression tricks

 # Match a sentence that starts with either word

 pattern = re.compile(r'^(?:DW_API_PUBLIC|DW_VIZ_API_PUBLIC).*?;', re.DOTALL | re.MULTILINE)

12/07/2020

liang ssh

Host liang
Hostname 10.12.12.191
User liangzou
IdentityFile ~/.ssh/id_rsa_aws

11/02/2020

No wifi adapter found on Linux Ubuntu 18.04

 Run this command:

rfkill

D TYPE      DEVICE      SOFT      HARD

 0 bluetooth hci0   unblocked unblocked

 1 wlan      phy0   unblocked unblocked

If the wlan is hardware blocked, need to goto BIOS settings and change the wireless adapter to enabled.
For example, the Asrock X399, need to goto the BIOS and find South Bridge to change the wireless from Auto to Enabled. 

8/12/2020

Qt related knowledge

sudo apt install qt5-default

File paths:
/usr/lib/x86_64-linux-gnu/qt5/qt.conf: contains a list of file paths.
[Paths]
Prefix=/usr
ArchData=lib/x86_64-linux-gnu/qt5
Binaries=lib/qt5/bin
Data=share/qt5
Documentation=share/qt5/doc
Examples=lib/x86_64-linux-gnu/qt5/examples
Headers=include/x86_64-linux-gnu/qt5
HostBinaries=lib/qt5/bin
HostData=lib/x86_64-linux-gnu/qt5
HostLibraries=lib/x86_64-linux-gnu
Imports=lib/x86_64-linux-gnu/qt5/imports
Libraries=lib/x86_64-linux-gnu
LibraryExecutables=lib/x86_64-linux-gnu/qt5/libexec
Plugins=lib/x86_64-linux-gnu/qt5/plugins
Qml2Imports=lib/x86_64-linux-gnu/qt5/qml
Settings=/etc/xdg
Translations=share/qt5/translations