Using axios in Vue
· β˜• 2 min read
1. Installing axios Install with npm 1 npm install axios --save There are two ways to register it globally: Bind it to the prototype 1 2 import axios from "axios"; Vue.prototype.axios = axios; With this approach, every Vue object gets a new axios object. 1 2 3 this.axios.post(apiUrl).then((res) => {

How to Ensure Concurrent Data Consistency in Django
· β˜• 2 min read
The first part mainly covers optimistic and pessimistic locking. Locking guarantees data consistency under concurrency at the database level. Understanding locks helps you understand concurrency solutions. The second part mainly covers how to guarantee data consistency in concurrent scenarios within Django. 1. About Locks 1.1 Optimistic Locking The starting point

Using utf8mb4 in Django to Support Emoji
· β˜• 3 min read
1. What Is utf8 In theory, utf8 uses 1-6 characters, In practice, the latest utf8 specification uses only one to four bytes, and can encode at most 21 bits, which is exactly enough to represent all 17 Unicode planes. 2. What Is utf8mb4 utf8mb4 is a superset of utf8. In theory, if you were using utf8 before and then change the charset to utf8mb4, it will not cause any problem when reading the existing utf8-encoded data.

Common NPM Commands
· β˜• 2 min read
** By default, a command operates on the current directory environment. Adding the -g flag makes it apply globally instead.** Upgrade npm 1 npm install npm -g Show the current version 1 npm -v Show the npm registry configuration 1 npm config get registry Change the npm registry 1 2 npm config set registry http://registry.

Strategic Thinking and Expression Study Notes
· β˜• 3 min read
This mainly records analysis methods. 1. Strategic Analysis McKinsey’s Seven-Step Problem-Solving Method State the problem Analyze the problem Prioritize Lay out a detailed work plan Perform key analyses Synthesize results and build a structured conclusion Tell the story 2. Recognizing the Problem Most problems are a failure to recognize the problem β€” unknown unknowns.