全部文章
-
浮点数:为什么 0.1 + 0.2 不等于 0.3
二进制浮点数只能近似表示大多数十进制小数,因此运算会累积舍入误差。应按容差比较、谨慎求和,金额和计数使用整数或十进制类型,并输出足够位数以便往返还原。
-
Calling the TypeSafe API from an agent: request shape, errors, retries and version pinning
The documented contract an agent needs to call Jev without a chat layer: POST /v1/systemone with a Bearer key, a state, a model name and a map of typed questions; answers keyed like the questions plus a usage block; 401, 422, 429 and 529 with exponential backoff; aliases that move and versioned IDs that do not; SDK defaults for retries and the agent skill for coding agents.
-
设计运维仪表板:每个面板一个问题,每类受众一个屏幕
从响应人员必须回答的问题出发,为每个问题安排一个面板,按从总体到具体的顺序排列,统一单位和坐标轴,使用模板变量代替副本,将每条值班呼叫告警链接到所需仪表板,并把仪表板定义纳入版本控制。
-
Dry-run modes for agent actions: showing the plan before the change
Give every tool that changes state a mode that computes and returns the concrete plan (which objects, which fields, how many) without applying it, validate the plan on the server side where the system allows it, require the plan to be produced and reviewed before the real call, and compare the real result against it afterwards.
-
使用容器中的临时数据库进行集成测试
每次测试运行都在一次性容器中启动真实数据库引擎,将数据保存在内存中,只对模板数据库执行一次迁移,再为每个测试文件复制模板。这样测试检查的就是真实的规划器、约束和隔离行为,而不是内存替代品。
-
优雅关闭:在服务中处理 SIGTERM
容器运行时发送 SIGTERM,等待一段宽限期后再发送 SIGKILL。服务应停止接受新工作,完成或交回正在处理的工作,关闭连接,并在宽限期内退出。忽略这个信号会让每次部署都变成一次中断。
-
Forms that declare native HTML constraints produce fewer server-side validation rejections per submission than forms validated only in custom JavaScript
Hypothesis: the browser blocks interactive submission of a form whose native constraints (required, pattern, type, min and max) fail, while MDN notes that calling submit() bypasses this and novalidate disables it; the proposal is that forms carrying native constraints that mirror the server rules reach the server with fewer rejections per submission than forms whose checks live only in custom scripts, because the native checks keep working when the script fails to load or errors; a proposed A/B test, with no result claimed.
-
Upsert, row limits and identifier quoting across PostgreSQL, MySQL, SQLite and SQL Server
PostgreSQL's ON CONFLICT, MySQL's ON DUPLICATE KEY UPDATE, SQLite's PostgreSQL-style ON CONFLICT and SQL Server's MERGE are three families of upsert syntax, LIMIT/OFFSET has at least three shapes, and a quoted identifier means double quotes, backticks or square brackets depending on the engine.
-
find and xargs exit codes: find's coarse 0/>0 versus xargs's 123-127 ladder
find only promises 0 for full success and any value above 0 for an error, deliberately without finer detail, while xargs defines a specific ladder for how the invoked command failed: 123 for an ordinary non-zero exit, 124 for exit 255, 125 for killed-by-signal, 126 for not-invocable, and 127 for not-found. Piping find into xargs means checking two different exit-code philosophies in one pipeline.
-
用回讲检查理解:向指定读者解释,再与来源比较
为一位具体且了解较少的读者写下或说出解释,可以暴露重读时看不见的知识缺口。2014 年报告的一项实验发现,仅仅预期要讲授一段材料,就比预期参加测试带来更完整、组织更好的回忆;书面解释还可以逐句与来源核对。
-
开发者机器上哪些凭证位置可被智能体进程读取
以用户身份运行的智能体,可以读取该用户能读取的内容:环境变量、CLI 凭证文件、容器注册表登录信息、SSH 密钥、shell 历史以及浏览器相关存储。了解这些位置,可以帮助操作员决定哪些内容应隔离在智能体访问范围之外,以及事故后应轮换哪些凭证。
-
Dependency confusion: when a public package shadows a private one
If a build resolves package names across a private index and a public one, an attacker who publishes the private name publicly with a higher version can get their code installed; pip's documentation calls --extra-index-url for private packages unsafe for exactly this reason. Defences are namespaces bound to one registry, a single proxying index, hash pinning and claiming names.
-
Loading YAML safely
Full YAML loaders can instantiate arbitrary objects from tagged nodes; always use a safe loader, pin the YAML version semantics, and validate the result against a schema before use.
-
Glob pattern dialects: what * and ** mean in .gitignore, .dockerignore, bash, Python and GitHub Actions
The same star and double-star characters mean different things depending on where the pattern is evaluated: a slash-less .gitignore pattern matches at every depth while the same line in .dockerignore only matches at the context root, bash's globstar recursion is opt-in, and Python's fnmatch is not even path-aware.
-
Link 标头与链接关系类型
RFC 8288 允许任何 HTTP 响应在 Link 标头中携带带类型的链接:<target>; rel="relation",并可附加 anchor、hreflang、type、title 和 media 参数。关系名来自 IANA 注册表,例如 next、prev、canonical、alternate、describedby、preload;私有扩展则使用绝对 URI。非 HTML 响应由此可以指向相邻资源,103 Early Hints 也借此告诉浏览器应提前获取什么。
-
以当前方式添加第三方 APT 仓库:deb822 .sources 文件与 Signed-By 密钥环
apt-key 已弃用;受支持的添加签名第三方仓库方式,是在 /etc/apt/keyrings 下放置密钥环文件并用 Signed-By 选项引用,配置可写成传统单行形式或较新的 deb822 .sources 格式,Debian 12/13 和当前 Ubuntu 版本都能解析。
-
Reviewing command wrappers with an argument-recording substitute
Check how a coding agent’s command wrapper turns user-controlled values into executable intent. This original method substitutes a harmless argument recorder for the real program and examines the boundary directly.
-
Planning an in-place major upgrade of RHEL with Leapp
Leapp upgrades RHEL 8 to 9, or 9 to 10, in place, but only after every upgrade-blocking finding in its preupgrade report is resolved. This methodology covers running the assessment, recording answers to its prompts, and why a backup comes before the actual upgrade step.
-
GPU-Driven Indirect Rendering: Building Draw Workloads on the Device
Use GPU visibility results to generate indirect draws, with explicit buffer capacity, counter resets, synchronization and a CPU reference for validation.
-
A small swap area with low swappiness reduces OOM kills of the primary service on memory-tight servers
Hypothesis: on single-purpose servers whose working set nearly fills RAM, a modest swap area combined with a low vm.swappiness lets the kernel page out cold anonymous memory during short spikes, so the primary service is OOM-killed less often than on the same host without swap, at the cost of occasional latency.
机器可读: JSON