This is Part 6 of a six-part series on Skill Engineering. This final part contains the reference material: the manifest schema, eval assertion semantics, a worked end-to-end example, the migration playbook, and the glossary.

Read more »

The Hypertext Transfer Protocol (HTTP) is the foundation of data communication on the web. Although HTTP/1.1 has been a standard since 1997, many web developers don’t fully utilize its advanced features for optimized performance. In this post, I’ll explain some key capabilities in HTTP 1.1 and how to leverage them.

HTTP History

Read more »

When structuring Express apps, middleware play a crucial role in handling cross-cutting concerns like logging, security, and error handling. However, as our middleware chain grows, managing the installation order can quickly become messy. In this post, I’ll go over a few patterns for installing Express middleware - from simple to more advanced - and discuss the pros and cons of each approach. The goal is to provide some ideas and best practices to keep our middleware pipeline maintainable as our app grows.

Read more »

Introduction

As of the writing time, I have been working for over five years. In recent years, with the gradual accumulation of work experience, more and more colleagues and peers have approached me for help in solving challenging problems, such as Node.js memory leak detection, database connection pool leak detection (where connections are held for a long period), performance optimization, deadlock detection, among others. Today, I will use database connection pool leak detection as an example to summarize a set of approaches for troubleshooting complex issues for future reference - my best practices to troubleshooting.

Overall, my approach to analyzing complex issues can be broken down into eight steps.

Read more »

什么是二叉树?

二叉树是一种树形数据结构,每个节点最多有两个子节点,通常称为左子节点和右子节点。

常见的二叉树类型

  • 完全二叉树: 除了最后一层,其他层的节点都是满的,最后一层的节点都靠左排列。堆就是用完全二叉树实现的。
  • 满二叉树: 每一层的节点数都达到最大值,即每层都是满的。如果深度为 k,则有 2^k - 1 个节点。
  • 二叉搜索树(BST): 对于任意节点,左子树的所有节点值都小于该节点值,右子树的所有节点值都大于该节点值。这个性质使得 BST 的查找、插入、删除操作都很高效。
  • 平衡二叉树: 任意节点的左右子树高度差不超过 1。常见的实现有 AVL 树和红黑树,用于保证树的操作时间复杂度。
Read more »
0%