聚合文章

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

排序方式:最新发布

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

浏览器扩展的数据默认只躺在 chrome.storage.local 里,清理一次缓存、换一台电脑,就全没了。想做云备份,通常意味着自己运维一个服务,或者去注册某个第三方 BaaS。这篇拆一个更省事的做法:把 GitHub 私有仓库当云端存储,一份 JSON 快照对应仓库里的一个文件,每次上传就是一个 commit。而这个仓库不只是"某个项目的备份盘"——它是一个统一的数据存放位置,多个项目各写各…

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 genera…

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…

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…

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 a…

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 m…