John Liu Blog

Every drop counts

Setup R and Python on SQL Server 2022

When setup R or Python on SQL Server 2022, especially for named instance, some special notes required, apart from the offical documentation. You need to make sure when doing install, both Database Engine Services and Maching Learning Services and Language are installed. Unlike with earlier version of SQL, R and Python libraries are not installed/configured automatically in SQL 2022. You need to download and install latest R4.2. Then need to install some standard R dependencies.

Power Automate retry policy interval setting

The Power Automate retry policy interval setting follow the ISO 8601 date format for durations. The ISO 8601 durations are expressed using following format, where (n) is replaced by the value for each of the date and time elements that follows the (n). P(n)Y(n)M(n)DT(n)H(n)M(n)S P is the duration designator (for period) placed at the start of the duration representation. Y is the year designator that follows the value for the number of calendar years.

Data API Builder notes

Docker Desktop We can deploy Data API Builder (DAB) using Docker Compose in Docker Desktop. An example compose file: version: '3' services: DAB-AutoGen: image: "mcr.microsoft.com/azure-databases/data-api-builder:latest" container_name: DAB-AutoGen ports: - "5002:5000" extra_hosts: - "host.docker.internal:host-gateway" volumes: - c:\DataAPIBuilder\Samples\:/App/DAB-Configs command: ["--ConfigFileName", "/App/DAB-Configs/dab-config-AutoGen.json"] DAB-AutoGen2: image: "mcr.microsoft.com/azure-databases/data-api-builder:latest" container_name: DAB-AutoGen2 ports: - "5003:5000" extra_hosts: - "host.docker.internal:host-gateway" volumes: - c:\DataAPIBuilder\Samples\dab-config-AutoGen.json:/App/dab-config.json Azure Container Instance We can also deploy the container in Azure Container Instance (ACI). The DAB configuration files need to be store in Azure File Share.

Qt Designer notes

We use Qt Desinger to design QGIS plugin. Development Tools Install Plugin Builder (for creating Plugin project), Plugin Reloader (to refresh changes to the Plugin while developing) to assist with plugin development. Use Qt Designer to help create Plugin interface. When develope QGIS plugin, your source file folder and QGIS folder might be different. Instead of constantly copying files across, we can use Junction to creat symbolic link. Refer to the Readme.

Python cheatsheet

To find the Python installed pathes, under DOS command: where python In the Python interpreter, type following Python commands: import os import sys os.path.dirname(sys.executeable) or under DOS command: py -c "import os, sys; print(os.path.dirname(sys.executable))" To find the Python version, under DOS command: py --version py -V py -VV To create a dedicated environment. # from PowerShell / cmd python -m venv .env To use/activate the dedicated environment created above .\.env\Scripts\activate # PowerShell: .