INVALID_STATE_ERR Debug 记录
HTTP 缓存不完全指南
Cache is a hardware or software component that stores data so that future requests for that data can be served faster.
按照维基百科的定义,缓存是一种用来存储数据的硬件或者软件,它使得后续的信息传输更快。
LRU 实现
LRU 概述
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 算法的思想是淘汰最近没有使用的缓存。
HTTPS 原理不完全指北
女朋友最近在学习 wireshark 时候问了我一个问题:为什么使用 http.host == baidu.com
过滤不到请求数据?
明明已经在 Chrome 上输入了 baidu.com,也看到返回结果了,为什么通过 http.host == baidu.com
过滤不到数据包呢?
LeetCode 80 Remove Duplicates from Sorted Array II
描述
给定一个数组,删除部分元素使得所有元素最多重复两次。
Example 1:
1 | Given nums = [1,1,1,2,2,3], |
1296. Divide Array in Sets of K Consecutive Numbers
描述
题目描述 - 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 |
Leetcode-241 —— different ways to add parentheses
题目描述
给定一个有数字和运算符组成的字符串,计算不同优先级的情况下的返回结果。
Example 1:
1 | Input: "2*3-4*5" |