当前位置: 首页 > 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.sadfv.cn/news/93064/

相关文章:

  • 龙之向导外贸网站怎么样京东网上商城会员注册步骤
  • 网站开发的课程做网站能用ai好还是ps
  • 做网站哪家公司比较好网站建设与客户价格谈判技巧
  • 网站首页优化公司苏州公司建站
  • 网站建设教学后记网站建设与管理课程实训
  • 怎么做网站横幅wordpress防护插件
  • 深圳哪里网站制作东莞专业微网站建设价格低
  • 青岛做英文网站的公司网站可信认证在哪里做
  • 有全部公司的网站单页网站利润
  • 平面设计 网站推荐如何检测网站被搜索引擎惩罚了
  • 静态网站做301重定向曼联vs曼联直播
  • 网站邮箱怎么做的外贸网站优化哪家好
  • 网站怎么做效果更好深圳建设局网和住房网
  • 网站建设业务员提成做网站 接单
  • 建站语言有哪些温州seo优化网络推广
  • com的域名是指商业网站的域名.农林牧渔行业网站建设
  • 网站备案号在哪网站建设改版方案
  • 专业杭州网站建设网页设计基础课心得体会2000字
  • 做视频网站注意什么问题无锡seo培训
  • 门户网站开发模板直播小程序源码
  • 电子商务网站购物流程图ps做网站显示内容参考
  • 黑龙江中国建设监理协会网站沧州网站制作网站
  • 企业网站建设因素分析重庆建设工程安全网
  • php mysql 网站建设信专业广州网站建设
  • 开源网站有哪些肇庆搞产品网站的公司
  • 网站制作公司数据库管理排名甘肃嘉峪关建设局网站
  • 网站seo关键字优化WordPress好看的博客主题有哪些
  • 做视频的软件模板下载网站有哪些内容网上注册公司流程工商
  • 可以做翻译兼职的网站吗学校网站建设 分工
  • 做面食的网站wordpress cute主题