之前好几次接触到 LRU(Least Recently Used)算法,今天来总结下,并用 Java 和 Python 给出相应的实现。 LRU是一种缓存替换算法,根据字面意思,就是将最近最少使用的页面或者元素进行替换,将最近最多使用的页面或者元素保持在缓存里。有关缓存的知识后面再仔细研究下。由于缓 ...
分类:
其他好文 时间:
2019-08-18 00:14:17
阅读次数:
88
recv原理、高阶版黏包解决方案、基于UDP的socket通信 recv原理 高阶版黏包解决方案 服务端: 客户端: 客户端: ...
分类:
其他好文 时间:
2019-08-16 20:58:23
阅读次数:
98
目录 1、开头说明 2、INCLUDES 3、MODULES 4、NETWORK 5、GENERAL 6、SNAPSHOTTING 7、REPLICATION 8、SECURITY 9、CLIENTS 10、MEMORY MANAGEMENT 11、APPEND ONLY MODE 12、LUA S ...
分类:
其他好文 时间:
2019-08-14 21:29:45
阅读次数:
96
Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the arr ...
分类:
其他好文 时间:
2019-08-10 17:40:21
阅读次数:
92
安装和启动 这里使用docker进行安装的 然后使用 进行启动(因为需要很大的内存空间,所以把占用的内存空间限制在256m上) 以上是docker下的安装,注意要安装2.6以下的版本,5x以上的版本连接9300需要在yaml里面做配置 正常的安装 1.安装jdk 1.1 执行命令下面命令查看可安装j ...
分类:
其他好文 时间:
2019-08-10 17:34:17
阅读次数:
70
Description Given n, calculate the sum LCM(1,n) + LCM(2,n) + .. + LCM(n,n), where LCM(i,n) denotes the Least Common Multiple of the integers i and n. ...
分类:
其他好文 时间:
2019-08-08 12:54:14
阅读次数:
101
一、实验环境 1.Windows7x64_SP1 2.Anaconda2.5.0 + python2.7(anaconda集成,不需单独安装) 二、实验步骤 2.1 在python中有如下代码: 运行时报错:“TypeError: super() takes at least 1 argument( ...
分类:
编程语言 时间:
2019-08-06 20:03:53
阅读次数:
528
先看 继承自AbstractList,实现了4个接口,List,RandomAccess,Cloneable,java.io.Serializable. List:这是一个序列,可以有重复元素。 RandomAccess:可以随机快速访问的标记。 Cloneable: 它实现了clone方法,可以合 ...
分类:
其他好文 时间:
2019-08-04 18:00:59
阅读次数:
95
B - Ignatius and the Princess IV 题目链接:https://vjudge.net/contest/68966#problem/B 题目: "OK, you are not too bad, em... But you can never pass the next t ...
分类:
其他好文 时间:
2019-08-04 15:14:23
阅读次数:
107
Backward Digit Sums Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 10772 Accepted: 6068 Description FJ and his cows enjoy playing a mental ...
分类:
其他好文 时间:
2019-08-03 16:15:03
阅读次数:
102