Technical Notes
-
Add comment functionality to WordPress's musings/social media feeds/microblogs
2026.2 Update: If you need to force talk to use the POST ID as the URL, you can use the following code: //force talk use post id in url add_filter('post_type_lin...
-
Algorithm Problem Sharing: VimOperator – Simple Operation Simulation of Vim
I've been seeing some rather strange problems lately, so I'll share them with you all. Problem: Simulate the left/right and replace operations in Vim, roughly as shown in the animation: l: move the cursor right l: move the cursor right…
-
Algorithm Problem Sharing: Given a string consisting of "0", "1" and "?", where "?" can be replaced with 0 or 1, find all possible results.
I came across an interesting problem today, but it wasn't on LeetCode or online, so I wrote one myself to share. The problem is: Given a string consisting of "0", "1", and "?", where "?" can be replaced with either 0 or 1, find all possible results…
-
Usage and distinction between abstract classes and interfaces in Java
I. Abstract Classes In Java, the keyword for abstraction is `abstract`. Abstract classes are created for inheritance, clearly and simply telling the user and compiler what the class should look like. For example, the syntax for declaring an abstract class is: `abstract class Abc {…`
-
How to create your own Cocoapods and publish it to GitHub (Swift)
I've been working on some iOS development lately and stumbled upon the idea of creating my own CocoaPods. It seems complicated, but it's actually quite simple. Here's a guide: Assuming you already have: Xcode installed and CocoaPods installed. Step 1: Create an empty Git repository…
-
How to downgrade Golang from version 1.13 to 1.12
I've been studying Go recently and found that the differences between versions are quite significant. Here, I'll share how to downgrade your Go version; this method has general applicability: Step 1: Confirm your version ~|⇒ go version go version go1.13.…
-
[Open Source] Discuz! Plugin – Post Promotion/Payment Notification Administrator
Plugin Description: This plugin primarily notifies administrators that users can pay a certain amount of coins (configured in the backend) in their posts, and administrators will then receive a notification. It is mainly used for paid post promotion. Compatible Versions: Discuz! 3.4, GBK, Git, https://…
-
[Open Source] Discuz! Plugin – Automatic Post Upvote with Payment of Coins
Plugin Introduction: This plugin is primarily used for consuming community coins. Users can pay a certain amount of coins to automatically bump their posts (system-generated bumping without leaving a trace). The backend allows users to set the amount of coins to pay and the recharge path. Compatible Versions: Discuz! 3.4, GBK, Git, HTTPS…
-
[Open Source] Discuz! Plugin – Skip Verification for Invitation Registration
Preface While organizing my code recently, I discovered that some previously developed Discuz plugins were still usable, though I was no longer able to maintain them. I've compiled them and will gradually open-source them to help those who need them and hopefully inspire others to maintain them. Plugin Introduction This plugin is primarily for Discuz plugins that enable registration verification…
-
[Sharing] A Brief Discussion on Database Concurrency Control – Locks and MVCC
After learning programming for several years, you'll find that there are no simple, quick solutions to any problem; many require trade-offs and compromises. This article introduces the trade-offs and compromises databases make between concurrency performance and serializability – concurrency control mechanisms. If the database…
-
How to handle different hard drive sizes returned by the fdisk and df commands?
Event Description: Recently, the external hard drive on my Lightsail VPS was full. I created a larger hard drive using a backup snapshot and connected it to the VPS, but it still showed "hard drive full". Checking the hard drive size using the commands `fdisk -l` and `df -Th` revealed…
-
Resolving 502 errors when logging into Discuz!
This problem has been around for a while, and I finally had time to investigate and solve it today. The problem: When logging in, clicking "Login" has no effect and doesn't redirect. The console shows a 502 error redirecting to member.php. Solution: This problem occurs randomly. I initially thought it was redirecting to H…
-
Can a multi-column index on a database be used to query a single column?
Today I was asked a question about database indexes, and I was stumped. So I searched online and organized my thoughts. The question is as follows: If a composite index (multi-column index) is created on columns A and B in a table, will querying column B use this index...?
-
Explanation of various SQL Join operations (with diagrams)
Preface When discussing the differences between various JOIN operations in SQL on various Q&A communities, the most widely cited article is C.L. Moffatt's "Visual Rep..." on CodeProject…
-
Fix “Cannot read property ‘toFixed’ of undefined” for Yet Another Starts Rating Plugin
Issue When using Yet Another Starts Rating WordPress Plugin on mobile, users can’t vote for ar…