2/21/2021

How to cross-compile boost for QNX 7.0

# For QNX OS, use the following commands:

```

./bootstrap.sh --prefix=~/install --without-icu \

    --with-libraries=atomic,filesystem,serialization,graph,graph_parallel,iostreams,log,math,system,thread,date_time,regex,timer,chrono,program_options


# For QNX x86_64:

./b2 toolset=qcc target-os=qnxnto link=static cxxflags=-fPIC cflags=-fPIC \

--disable-icu -s NO_BZIP2=1 -j32 install


# For QNX aarch64:

./b2 toolset=qcc target-os=qnxnto link=static --disable-icu  \

cxxflags="-Vgcc_ntoaarch64le -Y_gpp -Wc,-std=gnu++0x -D_LITTLE_ENDIAN" \

linkflags="-Vgcc_ntoaarch64le -Y_gpp -lang-c++" -j32 install


# To clean up built binaries

./b2 --clean-all -n

``` 

1/04/2021

Regular Expression Commonly Used Patterns

# Find a line that starts with DW_API_PUBLIC or DW_VIZ_API_PUBLIC
pattern = re.compile(r'^(?:DW_API_PUBLIC|DW_VIZ_API_PUBLIC).*?;',
                     re.DOTALL | re.MULTILINE)
matches = pattern.findall(self._content) 

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