聚合文章

汇集全部已收录博客的最新文章,点击标题前往原文阅读。

排序方式:最新发布

给 AI 派活:四份文档与一套验收标准

最近我把一整套开发活交给了一个 AI agent 干:9 个阶段、28 条验收标准、130 个自动化测试,前后几十次提交。整个过程里没有一句"你去写个 X 吧"式的口头指令,所有约定都躺在磁盘上的四份文档里。 这篇把这套方法和里面的术语讲清楚。它不需要什么高级工具,你手上有任何一个能执行命令、能写文件的 agent 就能用。 1. 为什么需要一套文档 1.1 它不记得你 跟 agent 协作,第一个要接受的事实是:它不记得你。 每次会话它都是重新醒来,上一次聊过什么、你定过什么规矩,只要没落进磁盘,就等于没发生。你昨晚花了二十分钟跟它讲清楚的接口命名规范,第二天开新会话,它一无所知。 这跟带新…

把浏览器扩展的数据同步到 GitHub:用代码仓库当云端存储

浏览器扩展的数据默认只躺在 chrome.storage.local 里,清理一次缓存、换一台电脑,就全没了。想做云备份,通常意味着自己运维一个服务,或者去注册某个第三方 BaaS。这篇拆一个更省事的做法:把 GitHub 私有仓库当云端存储,一份 JSON 快照对应仓库里的一个文件,每次上传就是一个 commit。而这个仓库不只是"某个项目的备份盘"——它是一个统一的数据存放位置,多个项目各写各的文件即可。 1. 为什么选 GitHub 先说结论:GitHub 不是"最适合"存业务数据的地方,但它是综合成本最低的地方。下面几个理由都是白拿的。 它是一个统一的数据存放位置。 仓库不是"某个项目…

Traditional vs Roth IRA under fixed amount of investment

I’ve read a lot of articles on Traditional vs Roth IRA. One can do a serious mathematical analysis of which one is better, given that you want to invest a total of x income into the account for a particular year. Money in excess of x will be put in a normal investment account. There is a widely held…

Word break with cost

Problem1 Given a set of strings W, a cost function c:W\to \R and a string s. Find elements w_1,\ldots,w_k\in W such that s=w_1\ldots w_k, and \sum_{i=1}^k c(w_i) is minimized. This problem is a generalization of the word break problem on leetcode. Many algorithms you see online assumes that each str…

Bounds on number of cuts

Consider we have an undirected graph G=(V,E) of n vertices, and there are positive cost c:E\to \R^+ on the edges. We define c(F)=\sum_{e\in F}c(e), to be the cost (value) of F\subset E. Let \mathcal{P} be a partition of V where each partition class is non-empty. We define E(\mathcal{P}) to be the se…

Maximize Cash Back

Credit cards often offers rewards for purchases. For example, a card that gives 5% cash back for grocery stores. Also, credit cards often can be used to buy gift cards for specific stores. For example, one can use Chase Ink Cash (CIC) and go to Staples and buy gift card for Amazon for effectively 7.…

The value of a gift card in beancount

I’m using beancount to do accounting. In beancount, you are allowed to have commodities. One can view gift card as commodity, but also as a currency. Say, I bought an $100 Amazon gift card for $90, I would write 100 AMAZON {0.9 USD}, which means 100 units of Amazon with unit cost $0.9. Later on, I u…

Yotta Savings and covering designs

Yotta Savings is a FDIC insured savings account that gives you “interest” in another way. It has a 0.2% APR. It is much better than the APR of many banks, but much worse than actual high APR savings accounts, e.g. Marcus, Ally. However, for each $25, Yotta gives you a ticket weekly to their drawing,…

Test conjectures on $k$-partitions over submodular functions

This article considers tools one can use to quickly test conjectures. I work in combinatorial optimization, and often there are cases where one can phrase a problem as a conjecture over a finite domain. Testing conjectures using brute force quickly becomes infeasible due to combinatorial explosion. …

The related employer controlled group

Disclaimer: Not an accountant nor a lawyer. For employees in the US, employers (not just the employee) can contribute to the employee’s retirement fund 401(k). There is an maximum limit. It is M = \$61,000 for 2022. If a person works for multiple unrelated employers, each employer, in theory, can co…

Use a box spread as a line of credit

In an idealized world, you could borrow at the Effective Federal Funds Rate (EFFR) and also earn roughly the same rate on cash deposits. For simplicity, assume the relevant short rate is fixed for a month. Let’s say it turns out to be 10% per month. Assume the stock will rise by 20% that month. In r…

AI Agents for the Working Mathematician

REVISED 2026-09-19. This is a living document. I revise it as the mathematical AI frontier changes and as experience with these systems changes what we know about using them for mathematics. The recommendations below describe current practice and will keep changing. Most working mathematicians I tal…