Posts
LFU by tree map [solution]
- Requirement
- Remove less frequently used items by key;
- If the most frequently used items has more than one, remove the eldest one;
- Consideration
- when get/put operated, we should
touch
the item- update timestamp;
- update frequency;
- when get/put operated, we should
Posts
元太祖平云南碑游记
2021年6月27日,早晨从大理古城的客栈出发,跑步绕行8公里后,来到了城外东北方向,苍山脚下的村庄,奔向文保单位——元世祖平云南碑。或许这个文保单位仅仅是一块碑,难以开发利用。到了景点后,大门紧锁只留下一个缝隙,刚好可以看到碑文的正面。碑高且大,新修的亭子规格也足够高。前来的游客恐怕多数看不见碑文,只能感受到古碑的气派。
Posts
A* Search Algorithms in code
A* search Based on BFS, There are four functions are required in A* search: - g: real cost - h: an estimation function from current cost; - h*: real cost in theory; - f = g + h Also, Priority queue is used since we handle shortest estimation at first.
Posts
[solution] Find words in boards
- 针对[aaaaaa,aaaaaa]类型,必须做优化。 当访问完后,尽量一次次清楚末尾长链。
- 此时必须要在backtrack时传入parent,否则无法删除下级节点。
Posts
Docker使用中需要注意的问题
- docker daemon启动时创建了docker0网桥,随后自动分配私有IP和port。
- docker daemon会修改iptables规则。会创建DOCKER的特殊过滤链,并插入FORWARD链的最上面。
- docker daemon也会修改iptables nat以便建立对外的连接。
- docker对每个container创建veth(virtual ethernet)网络设备。