11 月 22 日 周日Sunday, 22 November

博客Blogs 9

I don't enjoy being pampered

一句话:In one line: 作者承认自己并不享受理发店那一整套护理服务,只是忍受,但他没有完全想清楚原因。The author did not enjoy a full barber pampering session. He only tolerated it.

背景:作者在立陶宛维尔纽斯度假,天气热,胡子太长,就走进路边第一家理发店,想把胡子修短。结果店里给他做了一整套护理。

要点:

  1. 作者觉得自己并不享受这次理发护理,最多只是忍受。热毛巾、冷毛巾、头肩按摩、各种发油和剃刀轮番上阵,前后近一小时。他去便宜店五分钟刮完胡子没问题,染发时的感觉也差不多。
  2. 作者却觉得牙科手术很舒服,甚至有种安心感。躺平闭眼,一群专业人员在身上忙活,他既觉得脆弱又觉得安全,还能理解为什么有人会装病去求医。理疗他也觉得不错,验光和肛肠检查也能接受。
  3. 作者不喜欢按摩,也害怕修脚,但说不清为什么。他问:理疗师给脚治病,和修脚师修指甲、磨老茧,本质上有什么区别?
  4. 作者想过几种解释,但都没有定论。可能是他不喜欢陌生人碰自己,也可能是觉得自己不配享受。另外,他把头发看成虚荣的装饰,觉得迎合虚荣不体面,而肉体上的毛病则是凡人都会有的。

结论:作者没有得出明确答案。他说自己的脑子大概有点奇怪,最后决定买一个方便旅行带着用的胡须修剪器。

Background: He was on holiday in Vilnius, and his beard was too long for a heatwave. He walked into the first barber he found and got a full treatment.

Key points:

  1. He did not enjoy the barber's full service and only tolerated it. The hot and cold towels, head and shoulder massage, pomades and razors took close to an hour. A five-minute shave at a cheap place was fine, and hair dyeing felt much the same.
  2. He found dental surgery pleasant and even calming. Lying flat with his eyes closed, while a team worked on him, made him feel both vulnerable and safe. He said he could understand why some people fake illness to get that care. He also found physiotherapy pleasant, and he had no problem with opticians or proctologists.
  3. He dislikes massage and pedicures but cannot say exactly why. He asks whether there is any real difference between a physio treating a foot and a pedicurist shaping nails and filing calluses.
  4. He considered a few explanations but reached no firm answer. He wondered whether he dislikes strangers touching him, or whether he feels he does not deserve indulgence. He also sees his hair as a vanity, and he thinks giving in to vanity is unbecoming, while physical failings are merely human.

Takeaway: He reaches no firm answer. He says his brain is probably odd, and he decides to buy a beard trimmer suitable for travel.

Mouse for Tandy 1000

一句话:In one line: 原版 TRS-80 彩色鼠标是 Tandy 1000 的正统选择,但又难找又贵。作者认为它不一定是最好的选择,串口鼠标和 Radio Shack 品牌鼠标更实际。The author argues that the original TRS-80 color mouse is not the best choice for a Tandy 1000. It is hard to find and expensive, and serial mice are more practical.

背景:Tandy 1000 要用鼠标,正统选择是 TRS-80 彩色鼠标,但它难找、价格高。作者想介绍其他可行的替代品。

要点:

  1. 正统的 TRS-80 彩色鼠标插在游戏杆接口上,所以所有早期 Tandy 1000 都能用,但它其实不算普通鼠标。它用两个电位器工作,更像模拟摇杆,不兼容常见鼠标驱动,要用 Tandy 自己的驱动。它难找、价格高,所以作者选了别的路线。
  2. 只要机器装了 RS-232 串口,任何 9 针串口鼠标都能用。Microsoft Dove bar 和早期 Logitech 都是时代相符、又好找又便宜的选择。
  3. Tandy 和 Radio Shack 品牌的鼠标外观最搭。25-1040D 最正宗但难找;25-2001 是贴 Tandy 标的 Logitech,约 25 美元。后期的 Radio Shack 串口鼠标还能配更多驱动,比如只要 6K 内存的 ctmouse,对内存紧张的 Tandy 1000 很有用。

结论:原文在这里被截断,没有写出作者最后用的是哪一款。作者的立场是,TRS-80 彩色鼠标不一定是最佳选择,串口鼠标更实际。

Background: A Tandy 1000 needs a mouse. The proper choice is the TRS-80 color mouse, but it is hard to find and costly, so the author wants to cover other workable options.

Key points:

  1. The original TRS-80 color mouse plugs into the joystick port, so it works on any early Tandy 1000. But it is not a normal mouse. It uses two potentiometers, works more like an analog joystick, and needs Tandy's own driver. It is hard to find and expensive, so the author chose another route.
  2. Any 9-pin RS-232 serial mouse works if the machine has a serial port. A Microsoft Dove bar or an early Logitech is a period-correct, easy, and cheap fit.
  3. Tandy and Radio Shack branded mice match the look of the machine. The most correct is catalog number 25-1040D, but it is hard to find. Catalog number 25-2001 is a Tandy-branded Logitech that costs about $25. Later Radio Shack serial mice work with more drivers, such as ctmouse, which needs only 6K of memory.

Takeaway: The text is cut off before the author names the mouse he uses. His position is that the TRS-80 color mouse is not necessarily the best option, and a serial mouse is more practical.

troyhunt.com原文较短short source text

Weekly Update 531: Optimizely. Script Dependencies & Third Parties

一句话:In one line: 作者认为,不能用“第三方出事”来推卸责任。数据托付给谁,问责的还是谁。Blaming a third party does not remove accountability. The company that was trusted with the data is still responsible.

要点:

  1. Optimizely 的事件明显是他们自己的责任,但决定是否通知受影响用户的,却是挪威航空这类客户。挪威航空的披露通知只说是“第三方”出了事,却没有点名那个第三方。

Key points:

  1. Optimizely is clearly at fault in this incident. But customers such as Norwegian Airlines must decide whether to contact the affected people, and Norwegian Airlines did not name the third party in its notice.

To code well, avoid blunders

一句话:In one line: 好的编程不靠灵光一现,而是靠不犯灾难性错误。尤其要保持代码一致,并且不加多余的需求。Good programming comes from avoiding catastrophic mistakes, not from brilliant insights. Keep code consistent and skip unnecessary requirements.

背景:很多工程师以为好的编程靠聪明的洞察和漂亮的抽象。作者谈的是大型商业代码库和大团队的情况,并认为这个想法是错的。

要点:

  1. 编程最重要的是避免致命失误,这和下棋、打网球是一个道理。国际象棋中不挂子,大概能到 1600 到 1700 分,足以赢过大多数休闲棋手。网球只要稳定回球,就能赢过大多数人,不必打出制胜球。
  2. 编程很难建立持久优势,因为一个失误就能把整洁的代码库拖成一团乱麻。篮球领先 99 比 1,最坏也只是 99 比 4。代码里的失误例子包括:再造一套做同样事情的系统、引入第二个数据源、把同步操作改成异步、增加隐蔽的故障点、把关键接口搞复杂。
  3. 两个最大的罪过是不一致和引入不必要的需求。哪怕只有一点不一致,也会破坏信任,读代码的人就得到处找意外。不必要的需求很难清除,看到它就得默认它必要,而且彼此组合会产生爆炸式的复杂度。作者还说,当前的编程代理在一致性上和人差不多,但在避免不必要的需求上差得多。
  4. 写代码时要做两件事:找到任务在现有代码库中最自然的位置,并把任务压缩到最少的需求。不必靠聪明的技巧,聪明有时反而是负担。如果心里冒出“可以用这个巧妙的模式实现”的念头,就是注意力跑偏、可能要出错的信号。

结论:写好代码的办法是专注于避免失误,保持一致,不加多余的需求。作者说,这不管是手写代码还是驱动 AI 代理都适用。

Background: Many engineers think good programming means clever insights and elegant abstractions. The author is writing about large commercial codebases with big teams, and he thinks that view is wrong.

Key points:

  1. Avoiding major mistakes matters most, and the same is true in chess and tennis. Not hanging pieces in chess might get you to about 1600 to 1700 rating, which beats most casual players. In tennis, consistent returns beat most players even without winners.
  2. Programming makes lasting advantage hard, because one blunder can turn a clean codebase into a mess. A 99 to 1 basketball lead still holds after a blunder. In code, blunders include adding a parallel system for the same task, adding a second source of truth, turning a sync operation async, adding hidden failure points, and complicating a key interface.
  3. The two worst sins are inconsistency and unnecessary requirements. Even a little inconsistency breaks trust, so readers must hunt for surprises. Unnecessary requirements stick around, because you must assume they are needed, and they interact in ways that multiply complexity. The author says current coding agents are about as consistent as humans but much worse at avoiding unnecessary requirements.
  4. When writing code, find where the task fits most naturally in the existing codebase, and trim it to the smallest set of requirements. You do not need to be clever, and cleverness can hurt. If you think "I could do this with a clever pattern," that is a sign you are distracted and may blunder.

Takeaway: Focus on avoiding blunders by staying consistent and skipping unnecessary requirements. The author says this applies whether you write code by hand or drive an AI agent.

simonwillison.net原文较短short source text

Muru

一句话:In one line: Graham Dumpleton 正在用 AI 辅助开发 Muru,这是一个用 Rust 写的服务器,用来运行 ASGI 和 WSGI 的 Python 应用,他把整个开发过程逐篇公开记录。Graham Dumpleton is building Muru, an AI-assisted Rust server for running ASGI and WSGI Python apps, and publishing the whole development process as the work goes on.

要点:

  1. 作者在三周内发布了约 19 篇开发日志,话题包括工作进程、开发环境下的 HTTPS、与 Kubernetes 配合、缩放到零等。作者还写道,AI 承担了表面上的大部分工作,但判断什么还不够好仍然要靠自己,做 mod_wsgi 二十年积累的经验在这里很有用,会一直打磨到自己和读者都信任它为止。

Key points:

  1. In about three weeks, Dumpleton published roughly 19 development posts on topics such as workers, HTTPS in development, Kubernetes, and scaling to zero. Dumpleton says the AI does much of the surface work, but deciding what is good enough is still the author's job, and twenty years on mod_wsgi helps with that. The goal is to keep polishing Muru until the author and readers would trust it.

Notes on the discrete Fourier transform (DFT)

一句话:In one line: 把有限个采样点当成一个周期信号,就能用离散傅里叶变换(DFT)分析频率。DFT 是 DTFT 在等间隔频率点上的采样,并且可以无损地逆变换回原信号。A finite set of samples can be treated as one period of a periodic signal, which gives the DFT for analyzing frequencies. The DFT is equally spaced samples of the DTFT, and it can be inverted to recover the original signal exactly.

背景:上一篇讲的是无限长的离散信号,用 DTFS 和 DTFT 来分析。实际的数字信号总是有限长的,而 DTFT 的频率是连续变量,没法直接在电脑上算,所以作者要找一种能在计算机上实际计算的方法。

要点:

  1. DFT 的思路是把 N 个采样点看成一个周期信号的一个周期,然后沿用 DTFS 的系数来定义。这个周期信号可以被 DTFS 精确重建,所以 DFT 也能精确表示原始采样。同时,DFT 正好是 DTFT 在 N 个等间隔频率上的采样,把原本连续的频率变量变成了离散的。
  2. DFT 可以写成傅里叶矩阵乘以信号向量。矩阵的每一行是单位根的幂,这些行两两正交,构成一组基,所以任何复数序列都能用它表示,变换也可逆。逆变换用的是共轭矩阵,只多一个归一化因子,结果和 DTFS 的重建公式一致。NumPy 的 fft.fft 算出的结果相同,但利用了矩阵的结构,速度比直接做矩阵乘法快很多。
  3. 例子用的是一个三角波的完整一个周期,共 12 个采样点。算出的幅度和相位关于第 6 个频率箱对称,因为这个位置对应的是 -1,后面的频率等价于负频率。信号是实数,所以负频率的幅度和正频率相同。用逆 DFT 还原后,除了浮点误差,和原信号完全一致。
  4. 如果采样只取三角波的前 10 个点,周期延拓时首尾会跳变,DFT 的能量就会扩散到多个频率箱里,这叫谱泄漏。逆变换仍然能完美还原这 10 个点,所以只做重建没有问题;但做频率分析时,会出现原信号里并不存在的频率。实际中通常在采样后加窗函数,让信号边缘趋近于零,以减轻泄漏。

结论:文章最后的结论是:DFT 是分析有限数字信号频率的实用工具,可以用矩阵乘法或 FFT 来计算,也能精确逆变换。做频率分析时要留意谱泄漏,常用窗函数来缓解。作者计划之后再专门写 FFT 的原理。

Background: The previous post covered infinite discrete signals using DTFS and DTFT. Real digital signals are finite, and the DTFT is continuous in frequency, so it cannot be computed directly on a computer.

Key points:

  1. The DFT treats the N samples as one period of a periodic signal and uses the DTFS coefficients. Because the DTFS reconstructs that periodic signal exactly, the DFT represents the original samples exactly. The DFT is also equally spaced samples of the DTFT, which turns the continuous frequency variable into a discrete one.
  2. The DFT is the Fourier matrix times the signal vector. Its rows are powers of roots of unity, which form an orthogonal basis, so the transform is invertible. The inverse uses the conjugate matrix with a normalization factor, and it matches the DTFS reconstruction formula. NumPy's fft.fft gives the same result much faster by using the matrix structure.
  3. The worked example uses one full cycle of a 12-sample triangle wave. The magnitudes and phases are symmetric around bin 6, because that bin maps to -1 and the bins after it act as negative frequencies. The signal is real, so negative-frequency magnitudes match the positive ones. The inverse DFT recovers the original signal up to floating point round-off.
  4. If the samples cover only the first 10 points of the triangle wave, periodic extension creates a jump at the cycle boundary. The energy spreads across several bins, which is called spectral leakage. The inverse DFT still reconstructs the 10 samples exactly, but frequency analysis picks up frequencies that are not in the underlying wave. Windows that taper the signal toward zero at the edges reduce leakage.

Takeaway: The post ends with two takeaways. The DFT is a practical tool for finite digital signals, and it can be computed with the matrix form or with the FFT. For frequency analysis, spectral leakage needs care, and windowing is the usual fix. An FFT post is planned for later.

★ A Week With the New Privacy Controls in MacOS 27.3 Beta 2

一句话:In one line: Gruber 试用一周后认为,macOS 27.3 beta 2 的新隐私控制是一次成功的改动,给了用户更多控制权;但一直常驻的「应用控制应用」菜单栏指示器做得太激进,无法关闭,他希望 Apple 改掉它。After a week with the beta, Gruber says the new privacy controls in macOS 27.3 beta 2 are a win for users. The always-on indicator that appears when one app controls another is too aggressive and cannot be turned off.

背景:Meta 的 Muse 应用获得完全磁盘访问权限后,能读到包括收到的 iMessage 在内的信息,让一些用户感到意外,有些用户授权时是直接点过去的。Apple 之前承诺过新的隐私控制,这次随 macOS 27.3 beta 2 落地,Gruber 在这一周里实际试用了它们。

要点:

  1. 新的完全磁盘访问权限可以改为只授予一组指定文件夹,这让用户的控制更细。新对话框更吓人,会显示个人照片的缩略图,但 Gruber 认为这正是应该的,描述也准确。这可能会让一些人不愿意给 AI 代理应用完全磁盘访问权限,Gruber 觉得懂得风险的用户不会因此退缩,这样的犹豫本身是合理的。
  2. Gruber 认为新对话框的设计很好,看起来像 macOS 系统界面的新风格,而不是 iPhone 式的小提示框。
  3. Gruber 唯一的不满是,一个应用控制另一个应用时,菜单栏会出现醒目的指示器,无法关闭,只能通过未公开的 defaults 设置隐藏。在新款 MacBook Pro 上,它会出现在灵动岛里。Gruber 自己的灵动岛里同时有 8 个指示器,都是一直在运行的工具。Chance Miller 也认为这项设计太激进。Zac Hall 找到了用命令行关闭它的方法,Gruber 预计 Apple 会根据反馈调整。

结论:整体来看,Gruber 认为这次隐私设置的改动对用户是好事,但常驻的控制指示器需要改进,他预计 Apple 会根据反馈进行调整。

Background: Meta's Muse app got Full Disk Access and could read information such as incoming iMessages, which surprised some users. Some users had clicked through the permission without much thought. Apple had promised new privacy controls, and they arrived in macOS 27.3 beta 2. Gruber spent a week using them.

Key points:

  1. Apps that ask for Full Disk Access can now be given a list of folders instead, which gives users finer control. The new dialogs are scarier and show thumbnails of personal photos, but Gruber says that is the point and the descriptions are fair. Some people may be discouraged from giving AI agent apps full access, and Gruber says that is appropriate.
  2. Gruber thinks the new dialog boxes are good interface design. They look like a modern take on the macOS system style, not small iPhone-style alerts.
  3. Gruber's one complaint is the indicator that appears when one app controls another. It cannot be turned off except through a hidden defaults setting. On new MacBook Pros it appears in the Dynamic Island. Gruber has eight of these indicators from utilities that run all the time, and Chance Miller also called the feature too aggressive. Zac Hall published a command-line way to disable it, and Gruber expects Apple to revisit it.

Takeaway: Overall, Gruber sees the privacy changes as a win for users. The always-on indicator needs work, and Gruber expects Apple to adjust it based on feedback.

daringfireball.net原文较短short source text

The U.S. — Utterly Predictably — Has Lost Measles Elimination Status Under Trump and RFK Jr.

Gruber 转引《华尔街日报》的报道,说美国已失去麻疹消除状态,专家估计重新获得可能需要约五年,取决于联邦政府是否积极推动接种。Gruber quotes a Wall Street Journal report that the US has lost its measles elimination status. Doctors estimate regaining it could take about five years, depending on federal action.

Gruber 转引 Sumathi Reddy 为《华尔街日报》写的文章。文章说,美国失去“麻疹消除”状态是一次重大的公共卫生挫败,接下来的问题是需要多久才能重新获得。医生和流行病学家根据其他国家的经验估计,可能要五年,但这一估计假设联邦政府是积极主动推动麻疹疫苗接种的参与者。如果政府不这样做,时间可能还会更长。

文章标题用了 Utterly Predictably(完全可以预料)来形容这一结果,并写明它发生在 Trump 和 RFK Jr. 的任期内。Gruber 还引用了 Nilay Patel 两年前支持 Kamala Harris 时的文章标题:“A Vote for Donald Trump Is a Vote for School Shootings and Measles”。

Gruber quotes Sumathi Reddy's Wall Street Journal article. It says losing measles elimination status is a major public health defeat, and the question is how long it will take to regain. Doctors and epidemiologists, based on other countries' experience, estimate up to five years. That estimate assumes the federal government actively takes part in measles vaccination. Without that, it could take longer.

The post's title uses the phrase Utterly Predictably to describe the outcome, and says it happened under Trump and RFK Jr. Gruber also quotes Nilay Patel's headline from two years ago, endorsing Kamala Harris: “A Vote for Donald Trump Is a Vote for School Shootings and Measles.”

daringfireball.net原文较短short source text

Apple Documents Extra Apple Intelligence Usage Limits Per iCloud+ Paid Tier

一句话:In one line: Apple 公布了 Apple Intelligence 和 Siri AI 的每日用量上限。从 27.3 版本起,升级到更高的 iCloud+ 套餐可以提高这些功能的额度。Apple has published daily usage limits for Apple Intelligence and Siri AI. Starting with the 27.3 release, a higher iCloud+ plan raises those limits.

背景:从 2027 年的系统版本开始,Siri AI 和 Apple Intelligence 功能对支持的设备和语言免费提供,但依赖服务器大模型的一些功能设有每日上限。这是 Apple 的官方支持文档,说明了这些上限的规则。

要点:

  1. 每台设备在每个功能类别下都有各自的每日上限。涉及的类别包括 Siri AI、照片的智能编辑工具(如清理、扩展、空间重构)和图像创作(如 Image Playground)、快捷指令中使用 AFM Cloud 和 Cloud Pro 模型的功能,以及第三方应用通过 Private Cloud Compute 调用 Apple Foundation Models。
  2. 达到上限后,简单的 Siri 请求(比如设定计时器)仍然可以使用,较复杂的高级请求会暂停,直到额度重置或升级套餐。所有类别每天同时重置,额度不结转。一般在当地时间午夜重置;出国时按 Apple 账户所在国家或地区的中部时区;家庭共享套餐则按购买者的时区。
  3. 至少 200 GB 的 iCloud+ 可以提高额度,升级后的额度由登录同一 Apple 账户的所有设备和家庭共享成员共用,先到先得。标准额度在 200 GB 时最多为 2 倍,2 TB 最多 5 倍,6 TB 最多 10 倍,12 TB 最多 20 倍。快捷指令中的 AFM Cloud Pro 模型从 200 GB 起可以使用,更高套餐可提高访问倍数。
  4. 部分功能在中国、巴西、欧盟、英国和韩国不可用,Siri AI 的增强额度在巴西、欧盟、英国和韩国也不可用。家庭 App 的视频摘要有摄像头数量限制:2 TB 套餐 1 台,6 TB 套餐 2 台,12 TB 套餐 5 台。

结论:文档最后提醒,功能的可用性因地区而异,标准额度、摄像头数量和套餐功能以后都可能变化。

Background: Starting with the 2027 software releases, Siri AI and Apple Intelligence are free on supported devices and languages. Some features use large server models and have daily limits. This is Apple's support document that explains how those limits work.

Key points:

  1. Each device has its own daily limit for each feature category. The categories include Siri AI, image tools such as Clean Up, Extend, Spatial Reframing and Image Playground, Shortcuts that use AFM Cloud and Cloud Pro models, and third-party apps that use Apple Foundation Models in Private Cloud Compute.
  2. When a limit is reached, simple Siri requests such as setting a timer still work. Advanced requests pause until the limit resets or the plan is upgraded. All categories reset together each day, and limits do not roll over. The reset is usually at midnight local time, with exceptions for international travel and Family Sharing.
  3. An iCloud+ plan with at least 200 GB raises the limit. The extra limit is shared by all devices signed in to the Apple Account and by Family members, first come, first served. The standard limit can go up to 2X at 200 GB, 5X at 2 TB, 10X at 6 TB and 20X at 12 TB. The AFM Cloud Pro model in Shortcuts is available from 200 GB, with higher access on larger plans.
  4. Some features are not available in China, Brazil, the EU, the UK or South Korea. Increased Siri AI access is also unavailable in Brazil, the EU, the UK and South Korea. Home app video summaries are limited by camera count: 1 camera on the 2 TB plan, 2 on 6 TB, and 5 on 12 TB.

Takeaway: The document notes that availability varies by region. It also says standard access, camera counts and plan features may change over time.

YouTube 0

这段时间没有新视频。No new videos in this period.