CMake
1. CMake External From Git
How to clone and integrate external (from git) cmake project into local one
How to Run PostgreSQL Server and Database?
1. Online Tutorials
2. Issues
2.1
psycopg2.OperationalError: could not connect to server: Connection refused
Relevant resource:
- Connection refused with postgresql using psycopg2
- Getting error: Peer authentication failed for user "postgres", when trying to get pgsql working with rails
Solution:
Just modify this file
/etc/postgresql/12/main/pg_hba.conf
:
local all postgres peer
=>local all postgres trust
local all all peer
=>local all all md5
2.2
Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432?
Relevant resource:
- Postgres could not connect to server
- Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432?
- psql: could not connect to server: No such file or directory (Mac OS X)
- How to change the default unix socket location from /tmp for PostgreSQL
Solution:
- find the folder containing the file
postmaster.pid
, and remove it:rm /var/lib/postgresql/12/main/postmaster.pid
- edit file
/etc/postgresql/12/main/postgresql.conf
, in which, set:listen_addresses = '*'
port = 5432
unix_socket_directory = '/var/run/postgresql'
2.3 CREATE EXTENSION in PostgreSQL
Relevant resource:
- How do I import modules or install extensions in PostgreSQL 9.1+?
- Using psql how do I list extensions installed in a database?
Solutions:
- Please make sure
postgresql-contrib
has been installed.
2.4 Deal With GinIndex
Relevant resource:
- How to create GIN index in Django migration
- What is gin_trgm_ops of PostgreSQL?
- gin_trgm_ops does not exist for access method "gin"
- Creating a Gin Index with Trigram (gin_trgm_ops) in Django model
- A Guide to Create User-Defined Extension Modules to Postgres
Solutions:
- Please make sure
btree_gin
andpg_trgm
EXTENSIONs have been CREATEed for the user username in PostgreSQL database. Namely, you need to\c database username
beforeCREATE EXTENSION btree_gin
andCREATE EXTENSION pg_trgm
.
2.5
django.db.utils.ProgrammingError: syntax error at or near "FUNCTION"
Solutions:
- Use PROCEDURE instead of FUNCTION.
2.6
django.db.migrations.exceptions.InconsistentMigrationHistory: Migration site.0001_initial is applied before its dependency account.0003_initial on database 'default'.
Relevant resource:
Solutions:
- Please make sure
\c database username
is run from withinpsql
.
2.7
LOG: SSL is not supported by this build
Relevant resource:
Solutions:
1 | ⋊> ~ sudo su - postgres |
3. Process
Step 1.
Install postgresql
and postgresql-contrib
1 | ⋊> ~ apt list --installed | grep postgresql 22:46:41 |
Step 2. Open a FIRST terminal:
1 | ⋊> ~ sudo su - postgres 22:03:23 |
Step 3. Open a SECOND terminal:
- with user postgres,
psql
will do - with other users, such as longervision, you've got
to do
psql -U postgres
1 | ⋊> ~ psql -U postgres 22:06:18 |
Step 4. Saleor Reset Migrations (Optional)
Refer to How to Reset Migrations
Run the following 2 lines:
find . -path "*/migrations/*.py" -not -name "__init__.py" -delete
find . -path "*/migrations/*.pyc" -delete
Modify
saleor/settings.py
From 1
2
3DATABASE_CONNECTION_DEFAULT_NAME: dj_database_url.config(
default="postgres://saleor:saleor@localhost:5432/saleor", conn_max_age=600
),1
2
3DATABASE_CONNECTION_DEFAULT_NAME: dj_database_url.config(
default="postgres://username:password@localhost:5432/database", conn_max_age=600
),
Start Migration
1 | ⋊> /v/w/v/saleor on main ⨯ python manage.py makemigrations 22:32:00 |
1 | ⋊> /v/w/v/saleor on main ⨯ python manage.py migrate 00:02:56 |
How to Prepare and Upload PPA to Launchpad?
Refer to Launchpad PPA: - Launchpad Packaging/PPA - Launchpad Installing Software - Launchpad Building A Source Package - Building debian packages with debuild - Launchpad Uploading - Launchpad Copying - Basic Overview of the debian/ Directory
Solution
- dput Way
1
dput ppa:longervision/googletest googletest_1.11.0_amd64.changes
- FTP Edit
~/.dput.cf
as:1
2
3
4
5
6[googletest]
fqdn = ppa.launchpad.net
method = ftp
incoming = ~longervision/ubuntu/
login = jiapei100
allow_unsigned_uploads = 0
How to build QtWebEngine?
NEVER successfully built out QtWebEngine before. Today, I'd love to have a try. From this tutorial Building QtWebEngine, it looks possible.
Hugo
1. Official
2. Themes
Tutorials
Nothing but a collection of various tutorials.
1. Comprehensive
1.1 Tutorials
- GeeksforGeeks
- Guru99
- tutorialspoint
- RIP Tutorials
- LeetCode Explore
- Kaggle Courses
- C语言中文网
- W3 Schools
- JaveTPoint
- Beginners Book
1.2 Quizzes
1.3 Interviews
1.4 E-Books
1.5 Blogs
2. Programming Languages
2.1 C
- Cprogramming
- learn-c
- Functions Pointers in C Programming with Examples
- C Tutorial
- C Tutorial
- C17 StackOverflow
- C Standard Library Reference Tutorial
2.2 C++
- learn-cpp
- C++ Tutorial
- Magic Enum C++ Stop the war right away please
- OpenGL vs. DirectX: A Comparison
2.3 GDB
2.4. Java
2.5. Python
- The Python Tutorial
- Python for Programmers
- Python Tutorial
- Python Tutorial
- Python Tips
- Understanding Python Decorators in 12 Easy Steps!
2.6 Golang
2.7 Rust
2.8 Dart
3. Algorithms
4. Robotics
4.1 Comprehensive Open Source
- Top 10 Python Libraries For Robotics
- Top 5 Free and Open Source Robotics Frameworks
- Top 5 Open Source Robotics Software Solutions
4.2 Robotic Arm
5. Linux
5.1 Linux Operating System
5.2. Shell Scripts
- Shell Scripting Tutorial
- Shell Scripting Tutorial: How to Create Shell Script in Linux/Unix
- Advanced Bash-Scripting Guide
- Shell Tips!
6. Coding Tricks
6.1. Regular Expressions
6.2. Git
7. Cheat Sheets
XGBoost vs. LightGBM vs. CatBoost vs. H2O vs. MLflow
Happened to come across a blog XGBoost vs LightGBM: How Are They Different. Let's investigate a bit wider and deeper into the following 4 machine learning open source packages.
- XGBoost: XGBoost Doc, XGBoost Source Code
- LightGBM: LightGBM Doc, LightGBM Source Code
- CatBoost: CatBoost Doc, CatBoost Source Code
- H2O: H2O Doc, H2O Source Code
- MLflow: MLflow Doc, MLflow Source Code
1. Some Readings
- XGBoost vs LightGBM: How Are They Different
- Gradient Boosted Decision Trees [Guide]: a Conceptual Explanation
- AdaBoost and Gradient Boost – Comparitive Study Between 2 Popular Ensemble Model Techniques
- AdaBoost Vs Gradient Boosting: A Comparison Of Leading Boosting Algorithms
- A Primer to Ensemble Learning – Bagging and Boosting
- Ensemble methods: bagging, boosting and stacking
- CatBoost Classifier in Python
- Tutorial: CatBoost Overview
Cited from XGBoost vs LightGBM: How Are They Different
1 | Two of the most popular algorithms that are based on Gradient Boosted Machines are XGBoost and LightGBM. |
2. Concepts
- Bootstrap Aggregating: also named Bagging. A typical Bagging method is Random Forest.
- Boosting: A typical Boosting method is AdaBoost, short for Adaptive Boosting.
- Ensemble: As summarized, Bagging, Boosting, and Stacking ALL belong to Ensemble.
- Cascading:
citing:
Unlike voting or stacking ensembles, which are multiexpert systems, cascading is a multistage one.
- Gradient
Boosting: citing:
originated in the observation by Leo Breiman
, an American academician, also proposed Random Forest.
3. Amazon.com - Employee Access Challenge
In this blog, I'm going to use a very old Kaggle dataset Amazon.com - Employee Access Challenge.
4. XGBoost
Please make sure: - either rebuild your own XGBoost - or download my built wheel from https://longervision.us/
1 | ➜ ~ pip show xgboost |
5. LightGBM
Please make sure: - either rebuild your own LightGBM - or download my built wheel from https://longervision.us/
1 | ➜ ~ pip show lightgbm |
Pay Attention: In order to have XGBoost or LightGBM successfully built, you may have to: - either rebuilt your own CuPy - or download my built wheel from https://longervision.us/
6. CatBoost
1 | ➜ ~ pip show catboost |
7. H2O
1 | ➜ ~ pip show h2o |
8. MLflow
1 | ➜ pip show mlflow |
Please make sure: - either rebuild your own MLflow - or download my built wheel from https://longervision.us/