当前位置: 首页 > news >正文

网站备案规则域名解析入口

网站备案规则,域名解析入口,大连网络营销公司排名,wordpress拖拽编辑LRU是Last Recent Used 缩写#xff0c;做为一种缓存算法#xff0c;将最近较少使用的缓存失效。memcache采用了该算法。如下采用了一种PHP的实现方式。该算法将每次新增的内容#xff0c;放到缓存顶部#xff0c;达到缓存极限时#xff0c;将缓存底部的内容清除。可以通过…LRU是Last Recent Used 缩写做为一种缓存算法将最近较少使用的缓存失效。memcache采用了该算法。如下采用了一种PHP的实现方式。该算法将每次新增的内容放到缓存顶部达到缓存极限时将缓存底部的内容清除。可以通过如下PHP代码来模拟。 ?php class LRUCache {private $head;private $tail;private $capacity;private $hashmap;public function __construct($capacity) {$this-capacity $capacity;$this-hashmap array();$this-head new Node(null, null);$this-tail new Node(null, null);$this-head-setNext($this-tail);$this-tail-setPrevious($this-head);}public function get($key) {if (!isset($this-hashmap[$key])) { return null; }$node $this-hashmap[$key];if (count($this-hashmap) 1) { return $node-getData(); }// refresh the access$this-detach($node);$this-attach($this-head, $node);return $node-getData();}public function put($key, $data) {if ($this-capacity 0) { return false; }if (isset($this-hashmap[$key]) !empty($this-hashmap[$key])) {$node $this-hashmap[$key];// update data$this-detach($node);$this-attach($this-head, $node);$node-setData($data);}else {$node new Node($key, $data);$this-hashmap[$key] $node;$this-attach($this-head, $node);// check if cache is fullif (count($this-hashmap) $this-capacity) {// were full, remove the tail$nodeToRemove $this-tail-getPrevious();$this-detach($nodeToRemove);unset($this-hashmap[$nodeToRemove-getKey()]);}}return true;}private function attach($head, $node) {$node-setPrevious($head);$node-setNext($head-getNext());$node-getNext()-setPrevious($node);$node-getPrevious()-setNext($node);}private function detach($node) {$node-getPrevious()-setNext($node-getNext());$node-getNext()-setPrevious($node-getPrevious());}}/*** Class that represents a node in a doubly linked list*/ class Node {private $key;// the content of the nodeprivate $data;// the next nodeprivate $next;// the previous nodeprivate $previous;public function __construct($key, $data) {$this-key $key;$this-data $data;}public function setData($data) {$this-data $data;}public function setNext($next) {$this-next $next;}public function setPrevious($previous) {$this-previous $previous;}public function getKey() {return $this-key;}public function getData() {return $this-data;}public function getNext() {return $this-next;}public function getPrevious() {return $this-previous;}}来源 http://it.taocms.org/03/138.htm 来自为知笔记(Wiz) 转载于:https://www.cnblogs.com/phonecom/p/984d230ed46d76bcbc5a35f523b38ffd.html
http://www.yutouwan.com/news/93064/

相关文章:

  • 用html做简单网站wordpress 综合主题
  • r语言网站开发代理公司经营范围
  • 河南生产型企业网站建设成都seo服务
  • 自己做外贸 建一个网站小说网站建设之前需求分析
  • 五百亿网站搬家公司北京企业网站开发公司哪家好
  • 网站域名怎么登陆手机怎么玩wordpress
  • 做超市商品海报免费海报模版网站seo外链建设方法
  • 知名企业门户网站建设服务公司吉林省建设厅网站评职称系统
  • 谷歌网站流量分析编程网站开发
  • 南昌网站seo 优帮云本地环说wordpress配置邮箱
  • 东莞网站建设58如何创建一个论坛
  • 前端网站做中 英文推广赚钱的app
  • 忻州网络公司网站建设建设网站赚钱的方法
  • 眼镜网站怎么做竞价招商局网站建设管理总结
  • 做机械有什么兼职网站网站建设预估费用
  • 高清网站建设的好处合同管理系统
  • 做58网站怎么赚钱wordpress编辑不了
  • saas网站建设满山红网站建设公司
  • 个人网站做跳转怎么弄公司自己买服务器建设网站
  • 云主机 网站吗重庆企业品牌网站建设
  • 吉首企业自助建站HTML发布网站
  • 网站建设维护工作职责重庆网站建设沛宣网络
  • 展示中心网站建设程序员网站
  • 广州出名的网站万户网站建设公司
  • 泊头网站建设网站icp备案费用
  • 主流网站开发语言wp wordpress
  • 六安网站定制沈阳男科医院排名前十
  • 网站 微信开发中国数据网
  • 能够做一镜到底的网站网站模块
  • 常州做网站信息商标注册查询系统