INVALID_STATE_ERR Debug 记录
本文记录了 INVALID_STATE_ERR 排查过程。项目前端使用 SAPUI5 开发,运行集成测试时,所有的 AJAX 请求都会被 Mock。今天遇到一个问题,一些 URL 改动后集成测试运行失败, 报了个 INVALID_STATE_ERR 的错误。
本文记录了 INVALID_STATE_ERR 排查过程。项目前端使用 SAPUI5 开发,运行集成测试时,所有的 AJAX 请求都会被 Mock。今天遇到一个问题,一些 URL 改动后集成测试运行失败, 报了个 INVALID_STATE_ERR 的错误。
Cache is a hardware or software component that stores data so that future requests for that data can be served faster.
按照维基百科的定义,缓存是一种用来存储数据的硬件或者软件,它使得后续的信息传输更快。
This algorithm requires keeping track of what was used when, which is expensive if one wants to make sure the algorithm always discards the least recently used item. General implementations of this technique require keeping “age bits” for cache-lines and track the “Least Recently Used” cache-line based on age-bits. – from Wikipedia
LRU 算法的思想是淘汰最近没有使用的缓存。
女朋友最近在学习 wireshark 时候问了我一个问题:为什么使用 http.host == baidu.com 过滤不到请求数据?

明明已经在 Chrome 上输入了 baidu.com,也看到返回结果了,为什么通过 http.host == baidu.com 过滤不到数据包呢?
题目描述 - https://leetcode.com/problems/divide-array-in-sets-of-k-consecutive-numbers
给定一个数组 nums 和整数 k,判断是否将数组 nums 分成有 k 个连续数字组成的若干子数组。
Example 1:
1 | Input: nums = [1,2,3,3,4,4,5,6], k = 4 |
Example 2:
1 | Input: nums = [1,2,3,4], k = 3 |
https://leetcode.com/problems/subarrays-with-k-different-integers/
给定一个数组 A,求有 k 个不同元素组成的子数组个数。
例如:
1 | Input: A = [1,2,1,2,3], K = 2 |