Browsing Tag
programming
2179 posts
The Linear CLI Linear never shipped: driving your tracker from the terminal
If you searched for a Linear CLI, you already know the first surprise: there isn’t an official one.…
Project Valhalla in JDK 28: What Value Classes Actually Change
Project Valhalla has been Java’s most anticipated, slowest arriving feature for over a decade. On June 15, 2026,…
Free esports API for developers — 2026 guide
Original blog: https://tachiosports.com/blogs/free-esports-api-2026 Why free esports APIs matter in 2026 The esports industry is bigger than ever —…
状态模式深度指南:构建可动态切换行为的艺术
状态模式深度指南:构建可动态切换行为的艺术 概述 状态模式(State Pattern)是一种行为型设计模式,它允许对象在内部状态改变时改变其行为。看起来对象似乎修改了其类。这种模式是解决复杂状态转换逻辑的利器,特别适合用于工作流引擎、游戏开发、订单处理系统等场景。 核心概念 状态模式的核心思想是:将每个状态封装为独立的类,对象的行为取决于其当前状态,而状态之间的转换由状态类自己管理。 关键角色 Context(上下文):维护当前状态的实例,负责将请求委托给状态对象处理 State(抽象状态):定义所有具体状态的共同接口 ConcreteState(具体状态):实现各个具体状态的行为,并负责状态转换 为什么需要状态模式? 传统方式的困境 想象一个订单系统,订单有多种状态:待支付、待发货、已发货、已完成、已取消。每个状态下可以执行不同的操作。 // 传统的if-else方式 class Order {…
Evaluating a C# LLM Eventparser with Promptfoo
If you’re a developer, your first instinct when testing code is simple: Call the function. Get the result.…
printf() and scanf() in C: Understanding Input and Output
One of the first things every C programmer learns is how to interact with users. A program that…
Optimizing Django ORM Queries: A Practical Guide to select_related and prefetch_related
1. Introduction Django’s ORM is one of its greatest strengths. It abstracts away raw SQL, lets you express…
lopdf vs pdfium in Rust — What I Learned Building a PDF App
All tests run on an 8-year-old MacBook Air. All results from shipping 7 Mac apps as a solo…
Python for Beginners — Part 1: Getting Started & Syntax
A beginner-friendly series on learning Python from scratch, one concept at a time. If you’ve ever wanted to…
How I Slashed AI API Costs 60% as a Cloud Architect
How I Slashed AI API Costs 60% as a Cloud Architect I still remember the Slack message that…