2025-09-07

41 篇热帖

1. Show HN: I recreated Windows XP as my portfolio (mitchivin.com)

Visual Designer Portfolio

5. Air pollution directly linked to increased dementia risk (www.nature.com)

Long-term exposure accelerates the development of Lewy body dementia and Parkinson’s disease with dementia in people who are predisposed to the conditions. Long-term exposure accelerates the development of Lewy body dementia and Parkinson’s disease with dementia in people who are predisposed to the conditions.

7. Show HN: I'm making an open-source platform for learning Japanese (kanadojo.com)

Master Japanese with KanaDojo - a fun, aesthetic, minimalist platform for learning Hiragana, Katakana, Kanji, and Vocabulary. Practice with interactive games, track progress, and customize your learning experience with 100+ themes.

8. How the “Kim” dump exposed North Korea's credential theft playbook (dti.domaintools.com)

A rare and revealing breach attributed to a North Korean-affiliated actor, known only as “Kim” as named by the hackers who dumped the data, has delivered a new insight into Kimsuky (APT43) tactics, techniques, and infrastructure. This actor's operational profile showcases credential-focused intrusions targeting South Korean and Taiwanese networks, with a blending of Chinese-language tooling, infrastructure, and possible logistical support. The “Kim” dump, which includes bash histories, phishing domains, OCR workflows, compiled stagers, and rootkit evidence, reflects a hybrid operation situated between DPRK attribution and Chinese resource utilization.

11. The “impossibly small” Microdot web framework (lwn.net)

The Microdot web framework is quite small, as its name would imply; it supports both standard C [...]

12. How can England possibly be running out of water? (www.theguardian.com)

While famously rainswept, climate crisis, population growth and profligacy<em><strong> </strong></em>mean the once unthinkable could be possible

13. Stop writing CLI validation. Parse it right the first time (hackers.pub)

This post introduces Optique, a new library created to address the pervasive problem of repetitive and often messy validation code in CLI tools. The author was motivated by the observation that nearly every CLI tool reinvents the wheel with similar validation patterns for dependent options, mutually exclusive options, and environment-specific requirements. Optique leverages parser combinators and TypeScript's type inference to ensure that CLI arguments are parsed directly into valid configurations, eliminating the need for manual validation. By describing the desired CLI configuration with Optique, TypeScript automatically infers the types and constraints, catching potential bugs at compile time. The author shares their experience of deleting large chunks of validation code and simplifying refactoring tasks. Optique aims to provide a more robust and maintainable approach to CLI argument parsing, potentially saving developers from writing the same validation logic repeatedly.

14. Show HN: Semantic grep with local embeddings (github.com)

ck (seek) 是一个基于语义理解的代码搜索工具,能够根据代码的“含义”而非单纯的关键词进行检索。它兼容传统 grep 的语法,同时通过本地嵌入模型理解查询的意图,从而找到相关代码。

核心功能与特点

  1. 语义搜索

    • 可以搜索如“错误处理”、“认证逻辑”等概念,即使代码中未出现这些确切词汇,也能找到相关的 try/catch 块、错误返回等。
    • 支持 -full-section 选项,返回匹配到的整个函数或类。
    • 使用 --scores 参数可显示相关性分数。
  2. 兼容与混合模式

    • 完全兼容 grep 的命令行参数和输出格式(如 -i, -n, -R 等)。
    • 提供 --hybrid 混合搜索模式,结合关键词精确匹配与语义理解,使用倒数排名融合算法(RRF)排序结果。
  3. AI 代理集成

    • 内置 MCP 服务器,可通过 ck --serve 启动,无缝集成到 Claude Desktop、Cursor 等支持 MCP 的 AI 客户端。
    • 提供 semantic_searchregex_searchhybrid_search 等工具,支持分页和结果控制。
    • 支持 JSONL 和 JSON 格式的结构化输出,便于脚本和自动化流程处理。
  4. 交互式终端界面 (TUI)

    • 通过 ck --tui 启动,提供实时搜索结果预览。
    • 支持在语义、正则和混合搜索模式间切换,以及多种预览模式(热力图、语法高亮)。
    • 集成编辑器,支持多选文件批量打开。
  5. 智能索引与缓存

    • 透明自动索引:首次语义或混合搜索时自动构建索引,后续搜索增量更新。
    • 采用基于内容哈希的块级缓存,通常能实现 80-90% 的缓存命中率,仅重新嵌入更改的部分。
    • 索引存储在项目下的 .ck/ 目录中,可安全删除以重建。
  6. 文件过滤与排除

    • 默认遵守 .gitignore,并额外支持 .ckignore 文件。
    • .ckignore 使用与 .gitignore 相同的语法,用于排除配置文件、二进制文件等不适合语义搜索的内容,以减少噪音并提升索引速度。

技术实现与支持

  • 语言支持:支持多种编程语言(Python, JavaScript/TypeScript, Rust, Go, C/C++ 等)的树状解析器和语义分块,也支持 Markdown 及任何文本文件格式。
  • 嵌入模型:默认使用 bge-small,也支持其他本地模型如 mxbai-xsmallnomic-v1.5jina-code,可通过 --model 参数切换。
  • 性能:索引速度快(约百万行代码2分钟内),查询延迟低于500毫秒,索引大小约为源代码的1-3倍。
  • 架构:采用模块化的 Rust 工作空间,包含 CLI、TUI、核心引擎、索引管理、嵌入提供等独立模块。

安装与使用

  • 安装:推荐通过 cargo install ck-search 从 crates.io 安装,也可从源码编译。
  • 基本用法
    # 语义搜索
    ck --sem "数据库连接池" src/
    # 传统正则搜索
    ck -n "TODO" *.rs
    # 混合搜索
    ck --hybrid "连接超时" src/
    # 启动 MCP 服务器
    ck --serve
    # 启动交互式界面
    ck --tui
    

项目信息

  • 许可证:MIT 或 Apache-2.0 双许可。
  • 开发:欢迎通过 Issues 和 PR 参与贡献,CI 流程要求代码格式化、Clippy 零警告和测试通过。
15. RFC 3339 vs. ISO 8601 (ijmacd.github.io)

RFC 3339 与 ISO 8601 日期格式对比

RFC 3339 和 ISO 8601 都是用于表示日期和时间的标准格式,但它们在规范和应用上存在关键区别。

1. 标准定义

  • ISO 8601:是由国际标准化组织(ISO)制定的国际标准,内容广泛,涵盖了日期、时间、时间间隔及重复间隔等多种格式。
  • RFC 3339:是互联网工程任务组(IETF)发布的一份“请求评论”文档,它严格选取并定义了 ISO 8601 的一个子集,旨在为互联网上的时间戳提供一个明确、统一的表示方法。

2. 关键区别

特性 RFC 3339 ISO 8601
日期与时间分隔符 必须使用大写字母 T 可以使用 T空格
时区表示 必须指明时区。唯一接受的格式是 UTC 时间 Z,或带 ± 符号的 HH:MM 偏移量(例如 +08:00)。 更加灵活。除了 Z±HH:MM 外,还允许使用 ±HH±HHMM 等格式,甚至在某些上下文中允许省略时区信息(但标准本身强烈建议指明)。
格式完整性 规定必须包含日期时间,并精确到秒(秒可以是小数)。 允许仅表示日期(如 2023-10-27)或仅表示时间(如 15:30),并且支持更广的时间精度(如仅到分钟)。
语义明确性 其主要目标是提供单一、明确、可机器解析的时间戳格式,减少歧义。 作为一个庞大的标准体系,旨在涵盖所有可能的日期时间相关表示场景,因此在某些情况下可能需要更多上下文来确定具体格式。

3. 实际应用

  • RFC 3339 因其简洁和无歧义的特性,被广泛应用于现代互联网协议、API(如 JSON API)、日志记录和文件系统中作为默认的时间戳格式。
  • ISO 8601 的完整标准则常见于需要处理复杂时间范围、间隔或面向多国环境的正式文档、数据处理和科学领域。

总结:可以将 RFC 3339 视为 ISO 8601 一个特别严格、面向互联网应用的简化子集。当需要在网络通信和数据交换中表示一个完整、明确、带时区的时间点时,RFC 3339 是首选且推荐的标准。

18. Cape Station, future home of an enhanced geothermal power plant, in Utah (www.gatesnotes.com)

项目名称与地点
Cape Station(开普站)位于美国犹他州,未来将建设一座增强型地热发电厂(EGS)。

技术特点
增强型地热系统(EGS)通过人工方式创建或增强地热储层,利用深层地热资源发电,突破了传统地热依赖天然热储的限制,扩大了地热能源的可开发范围。

项目意义
该项目旨在利用犹他州丰富的地热资源,推动可再生能源发展,助力能源转型。EGS技术若成功应用,将为全球提供可复制的清洁能源解决方案。

20. GPT-5 Thinking in ChatGPT (a.k.a. Research Goblin) is good at search (simonwillison.net)

“Don’t use chatbots as search engines” was great advice for several years... until it wasn’t. I wrote about how good OpenAI’s o3 was at using its Bing-backed search tool back …

22. Over 80% of sunscreen performed below their labelled efficacy (2020) (www.consumer.org.hk)

The Consumer Council keens to be the trusted voice of consumers in striving to build in the market an environment of safe, fair and sustainable consumption.

23. Show HN: Bottlefire – Build single-executable microVMs from Docker images (bottlefire.dev)
  • 核心功能:Bottlefire 可将 Docker 容器镜像转换为独立的、零依赖的 Linux 可执行文件,内置 Firecracker 微虚拟机并自动启动。
  • 使用方式
    • 通过 curl 命令直接从标准输入管道执行镜像。
    • 结合 Landlock 工具进行沙箱隔离,增强安全性。
    • 直接下载并运行已编译的可执行文件(支持 amd64/arm64 架构)。
  • 主要特性
    • 开源自建工具 bake 用于构建微虚拟机。
    • 无需根权限或系统级配置,支持零配置用户空间网络、端口映射和目录共享。
    • 兼容任何支持 KVM 的现代 Linux 平台。
  • 定价模式
    • 免费:官方镜像及部分 Docker Hub 公共镜像。
    • Pro 计划($5/月):包含 20GB 活跃镜像额度,支持拉取任何公共或私有镜像(来自 Docker Hub 和 GHCR)。
    • 赞助计划($50 起/月):使容器镜像通过 Bottlefire 公开可用。
  • 限制说明:每月首次拉取特定配置的镜像计入“活跃镜像”限额,私有镜像拉取需认证。
24. A Navajo weaving of an integrated circuit: the 555 timer (www.righto.com)

The noted Diné (Navajo) weaver Marilou Schultz recently completed an intricate weaving composed of thick white lines on a black background, ...

25. Show HN: Lightweight tool for managing Linux virtual machines (github.com)

Lightweight tool for managing linux virtual machines - 0xchasercat/flint

27. Microsoft Azure: "Multiple international subsea cables were cut in the Red Sea" (azure.status.microsoft)

Check the current Azure health status and view past incidents.

28. I am giving up on Intel and have bought an AMD Ryzen 9950X3D (michael.stapelberg.ch)

The Intel 285K CPU in my high-end 2025 Linux PC died again! 😡 Notably, this was the replacement CPU for the original 285K that died in March, and after reading through the reviews of Intel CPUs on my electronics store of choice, many of which (!) mention CPU replacements, I am getting the impression that Intel’s current CPUs just are not stable 😞. Therefore, I am giving up on Intel for the coming years and have bought an AMD Ryzen 9950X3D CPU instead.

29. More and more people are tuning the news out: 'Now I don't have that anxiety (www.theguardian.com)

Emotional toll of constant negative news and unlimited access to ‘doomscrolling’ has led to record-high news avoidance

30. Shipping textures as PNGs is suboptimal (gamesbymason.com)

Are you shipping textures to players as PNGs? The goal of this post is to convince you that this is suboptimal, and walk you through a better approach.

31. Postal traffic to US down by over 80% amid tariffs, UN says (www.dw.com)

Postal flows to the United States have almost come to a halt, with 88 operators worldwide fully or partially suspending services, the Universal Postal Union said.

32. Being good isn't enough (joshs.bearblog.dev)

职业发展:为何“做得好”并不足够

在职业生涯中,仅具备出色的专业技能是不够的。技术能力是基础,它能让你在初期获得认可,但当周围同事都具备同等技术实力时,你就需要其他方式来提升影响力。

真正的成长在于跨领域的能力结合。文章指出四个关键领域:

  1. 技术能力:你的核心专业技能。
  2. 产品思维:判断何事值得做的能力。
  3. 项目执行:确保事情落地的能力。
  4. 人际技巧:与他人协作及影响他人的能力。

随着职位晋升,你对这四个领域的贡献要求会越来越高。它们共同指向一个目标:促成有意义的事情发生

要快速提升这些能力,关键在于反馈与谦逊。通过寻求你所钦佩之人的反馈,并付诸行动,你可以识别并弥补自己的短板。常见的误区是认为工作成果会自己说话,但实际上,你需要主动展示自己的工作。

最重要的一点是主动性。主动性强的人创造机会,而被动的人则等待机会。选择成为主动者,是推动职业发展的根本力量。

总结来说,职业进步不仅仅关乎努力工作,更在于综合能力的提升、主动寻求改进,以及积极创造价值。

33. Google's new AI mode is good, actually (simonwillison.net)

When I wrote about how good ChatGPT with GPT-5 is at search yesterday I nearly added a note about how comparatively disappointing Google's efforts around this are. I'm glad I …

34. The Claude Code Framework Wars (shmck.substack.com)

How developers are experimenting with structure, orchestration, and standards to get more out of AI coding.

35. The key to getting MVC correct is understanding what models are (stlab.cc)

stlab hosts modern, modular C++ algorithms and data structures.

38. Some thoughts on personal Git hosting (shkspr.mobi)

As part of my ongoing (and somewhat futile) efforts to ReDeCentralise, I'm looking at moving my personal projects away from GitHub. I already have accounts with GitLab and CodeBerg - but both of those sites are run by someone else. While they're lovely now, there's nothing stopping them becoming as slow or AI-infested as GitHub. So I want to host my own Git instance for my personal projects. …

39. Using Claude Code SDK to reduce E2E test time (jampauchoa.substack.com)

Best of both worlds: Building an AI gatekeeper that knows exactly which tests to run for your code changes

41. The Expression Problem and its solutions (2016) (eli.thegreenplace.net)

表达式问题概述

文章探讨了编程中的一个根本性挑战——表达式问题:在已有系统中,如何同时添加新的数据类型和新的操作,而无需修改现有代码。传统编程范式(面向对象编程和函数式编程)都难以优雅地同时实现这两方面的扩展,违背了软件设计的开闭原则。

问题表现

面向对象编程中的问题

通过C++表达式求值器示例说明:Expr接口定义了ToStringEval方法。添加新表达式类型(如ConstantBinaryPlus)只需继承并实现接口;但添加新操作(如类型检查)需要修改基类接口及所有派生类,导致大规模代码变更。

函数式编程中的问题

在Haskell中,表达式类型(如Expr)与操作函数(如evaluatestringify)分离。添加新操作只需新增函数并处理所有现有类型;但添加新类型需要修改所有现有函数以处理新类型。

可视化理解

表达式问题可用二维矩阵表示:行代表数据类型,列代表操作。OOP易于扩展行(类型),难扩展列(操作);FP反之,易于扩展列,难扩展行。

解决方案探索

访问者模式

将OOP问题转化为类似FP的问题:通过ExprVisitor接口分离操作。添加新操作容易(新增访问者类),但添加新类型困难(需更新访问者接口及所有实现类)。

扩展访问者模式

通过虚拟继承和动态类型检查支持新类型,但存在缺点:需要运行时类型转换、不兼容旧访问者、实现复杂且难以维护。

语言特性解决方案

Clojure多方法

  • 数据类型:使用记录(defrecord)定义,如ConstantBinaryPlus
  • 操作:使用多方法(defmulti)定义,通过defmethod为每种类型实现操作
  • 扩展性
    • 添加新类型:新增记录并通过defmethod实现现有所有多方法
    • 添加新操作:新增多方法并通过defmethod为所有现有类型实现
  • 优势:类型与操作解耦,无需修改现有代码即可双向扩展

Clojure协议

  • 定义协议:使用defprotocol定义接口,如EvaluatableStringable
  • 实现协议:使用extend-type为类型实现协议,或extend-protocol为多个类型实现同一协议
  • 扩展性
    • 添加新类型:通过extend-type实现现有协议
    • 添加新协议:通过extend-protocol为所有类型实现新协议
  • 优势:比多方法更高效,利用宿主平台的分派机制

关键洞察

  1. 开放方法的重要性:Clojure通过分离方法定义与类型定义,允许独立扩展类型和方法
  2. 小接口原则:保持协议/接口小而专注(如单个方法),更易于扩展
  3. 范式差异:OFP和FP各有侧重点,但都面临表达式问题;某些语言特性(如Clojure的协议、多方法)能优雅解决该问题
  4. 实现影响:不同解决方案在灵活性、性能、维护成本等方面存在权衡

表达式问题揭示了编程语言设计中数据与操作关系的根本挑战,其解决方案体现了不同编程范式的哲学差异及语言特性的重要性。