How the Kubernetes ClusterIP Service Works

A ClusterIP Service is the default Kubernetes service type. It provides a virtual IP address (VIP) inside the cluster to allow pods to communicate with each other. It is internal-only, meaning it is not accessible from outside the cluster.Example ManifestapiVersion: apps/vkind: Deploymenmetadataname: my-apspecreplicas: selectormatchLabelsapp: my-aptemplatemetadatalabelsapp: my-apspec... Read More

From Polling to QUIC: How Modern Web Communication Works

Today, I’m revisiting client-server communication mechanisms. The main methods are outlined in the table below for easier understanding.MechanismBased onDirectionProsConsTypical Use CasesPollingHTTP/1.xClient → Server• Very simple to implement• Works everywhere• High latency (depends on interval)• High overhead (many HTTP headers & TCP handshakes)• Wastes resourcesPeriodic updates, legacy apps... Read More

[Learning Notes] Course: How Transformer LLMs Work

Course Link: How Transformer LLMs Wor2025-08-1chapter: understanding language models: language as a Bag-of-Wordnon-transformer, encoder-only, decoder-only, encoder-decodedecoder-only: such GPtokenization -> tokens -> vocabulary -> vector embeddingchapter: understanding language models: (word) embeddingword2vec, the way to express the natural meaning is an array of floatsuch as cats [.91, -... Read More

New Features from C++20 Release

I recently did a quick study of the new features introduced in C++20, and I’d like to summarize what I’ve learned here.Core Languages Enhancementconstinit & consteval & enhanced constexpThe above three keywords enable code to be evaluated or initialized at compile time.The main goal of these keywords, from my perspective, are shown as followingconstiniensure deterministic initialization of glob... Read More

Duolingo to Replace Contractors with AI

Today, I came across an internal email from Duolingo's all-hands, announcing that Duolingo is going to make a significant platform shift - AI-first. Luis, the CEO, believes that AI is happening and changing much of how they work today, they can't wait until the AI is 100% perfect, and would rather move with urgency and take occasional small hits on quality. Also some constructive constraints are r... Read More

How to Terminate Other Child Threads Based on the Processing Result of Some One Child Thread in Java

ProbleIn the parent thread, several child threads will be forked. It needs to determine whether to terminate the execution of other child threads based on the processing result of some one child thread.Requirement AssumptioAfter each child thread finishes execution, it can decide to terminate or wait for the execution of other child threads based on its resulEach child thread has an "order" att... Read More

Home Assistant Add-on: FRP Client

BackgroundI’m trying to enable remote access to my local Home Assistant OS installed on my Raspberry Pi 4, so that I can upload my location to the HAOS while I’m outside.Therefore, I’ve authored an add-on to achieve that by leveraging the FRP software, which can forward traffic from my online server with public IP to the local HAOS.ArchitecturArchitecture of hass-addon-frp-clienGithub RepoGitHub... Read More

60 分钟搞定 Tarjan 算法求解无向图的割点与桥

本人在学习 Tarjan 算法求解无向图的割点与桥的问题时,很快发现了一篇简洁易懂的文章。很顺利地了解算法的思路,并写出了“高效”的代码,此时内心飘过 —— So Easy。然而,当我翻开《算法竞赛进阶指南》这本书的有关篇章时,我发现其中经过精简优化的代码有几条语句让我不得其所。以至于,花了较多心思和时间来思考🤔这段真正高效的 Tarjan 算法的工作原理以及代码的编写。关于 Tarjan 算法,我将会写若干篇系列文章,来完整系统地介绍 Tarjan 算法的原理以及其主要解决的问题。而在本章我主要讲一个问题 —— 如何使用 Tarjan 算法求解无向图的割点与桥。在讲述问题之前,我们先来简单地了解下什么是 Tarjan 算法?Tarjan 算法Tarjan 算法是基于深度优先搜索的算法,用于求解图的连通性问题。Tarjan 算法可以在线性时间内求出无向图的割点与桥,进一步地可以求解无向图的... Read More

递归

递归递归是什么?递归(英语:Recursion),又译为递回,在数学与计算机科学中,是指在函数的定义中使用函数自身的方法 。维基百科简单说,就是自身调用自身。为什么使用递归?往往面对一类问题时,如果它的规模足够小或者说达到既定的边界条件时,我们可以直接获取答案。但是,当这类问题的规模比较大时,却往往无法直接获取答案。那么,这个时候就可以通过“自身调用自身”的方式,来不断地减小问题的规模,直到问题的规模被缩减到足够小时,直接将答案返回上层的调用者,最终获取到原问题的解。如果将求解的过程逆过来,那么就是所谓的递推。通过这种方式,我们可以写出“优雅”的代码去解决规模比较大的问题。进而,避免了通过递推的方式,在每一次递推时产生的复杂的条件判断的问题。上文中提到经过递归调用,会不断地减小问题的规模,有些作者认为这是一种减治法。递归的特性自身调用自身在上文中,已经提到了这个特性,而且也非常好理解,不再赘述。... Read More