function setCopyBtn(){$(".CopyToClipboard").each(function(){var t=new ZeroClipboard.Client;t.setHandCursor(!0),t.addEventListener("load",function(t){}),t.addEventListener("mouseOver",function(t){var e=t.movie.parentNode.parentNode.parentNode.parentNode.parentNode.nextSibling.innerHTML;e=e.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&"),t.setText(e)}),t.addEventListener("complete",function(t,e){alert("代码已经复制到你的剪贴板。")}),t.glue(this,this.parentNode)})}function m_over_m(t,e){__mm_over=!0,showMedalInfo(t.target,e)}function m_out_m(){__mm_over=!1,hideMedalInfo()}function showMedalInfo(t,e){__mm_intro&&(document.body.removeChild(__mm_intro),__mm_intro=null);var i="",n=$(t).attr("src"),o="",s="";n.indexOf("zhuanlandaren")>-1?(o="专栏达人",s="授予成功创建个人博客专栏的用户。专栏中添加五篇以上博文即可点亮!撰写博客专栏浓缩技术精华,专栏达人就是你!"):n.indexOf("chizhiyiheng")>-1?(o="持之以恒",s="授予每个自然月内发布4篇或4篇以上原创或翻译IT博文的用户。不积跬步无以至千里,不积小流无以成江海,程序人生的精彩需要坚持不懈地积累!"):n.indexOf("weiruanmvp")>-1?(o="微软MVP",s="授予通过CSDN博客平台积极分享微软相关技术知识和专业技能,并做出突出贡献的用户。"):n.indexOf("bokezhixing")>-1&&(o="博客之星",s='授予通过"CSDN博客之星评选"中脱颖而出的十大博客之星称号的用户。'),i+="
",i+="
",i+="
",i+="
"+o+""+s+"
",i+="
",__mm_intro=document.createElement("div"),__mm_intro.className="medal_intro";var a=$(t).position(),r=a.left-46;r<0&&(r=0),__mm_intro.style.left=r+"px",__mm_intro.style.top=a.top+32+4+"px",__mm_intro.innerHTML=i,document.body.appendChild(__mm_intro)}function hideMedalInfo(){setTimeout(function(){!__mm_over&&__mm_intro&&(document.body.removeChild(__mm_intro),__mm_intro=null)},500)}function computePos(){"object"==typeof toolBar&&(toolBar.setPosX(),toolBar.computePositon())}function baidudatatemp(t){var e=new RegExp("("+highlight.join("|")+")","gi"),i=/<[^>]*>/g,n=t["abstract"].replace(i,""),o=t.dispTime.replace(/^(\d*)-/,""),s=t.linkUrl,a=t.title.replace(i,"").replace(e,"$1"),r='
\t\t

'+a+'

'+o+'

\t\t

'+n+"

\t
";return r}function trackByGraylog(t,e){var i=window.location.protocol+"//statistic.csdn.net/";$.get(i+t,e)}function remoteData(){var t=function(){window.csdn.isRunBaidu||(showResult(),window.csdn.isRunBaidu=void 0)};baiduKey?(csdn.afterCasInit=function(e,i){return e?void csdn.baiduSearch(e,function(e){needInsertBaidu?(window.csdn.isRunBaidu=!0,showResult(e)):t()}):(t(),!1)},csdn.baiduSearchInstallError=t):showResult()}function trackAddblogKey(t,e,i,n){var o=/("con"\:)"(.*)"/;t=t.replace(o,function(t,e,n){return e+'"'+n+",index_"+i+'"'}),e.dataset[n]=t}function trackAddBaiduKey(t,e){var i=$(t).attr("data-track-view"),n=$(t).attr("data-track-click");return e+=1,i&&(i=JSON.parse(i),i.con=i.con+"_"+e+",-",i=JSON.stringify(i)),n&&(n=JSON.parse(n),n.con=n.con+"_"+e+",-",n=JSON.stringify(n)),t=$(t).get(0),t.dataset.trackView=i,t.dataset.trackClick=n,t.setAttribute("data-flg","true"),$(t).addClass("recommend-box-ident"),t=t.outerHTML,window.csdn.trackRecord.baiduTrackCount=e,{insertObj:t,j:e}}function trackAdd(t,e,i){var n;"article"===e&&(n=$(".recommend-box").children("div.recommend-item-box").not("[data-flg]"));for(var o=0;o0)for(var h=0;h0){a=window.csdn.trackRecord.baiduTrackCount;for(var h=r;h<=i.length;h+=2){var d=h-r+1;if(o=e[d-1]?e[d-1]:"",s=e[d]?e[d]:"",!($(i[h])&&$(i[h]).length>0))break;o&&(n=trackAddBaiduKey(o,a),o=n.insertObj,a=n.j),s&&(n=trackAddBaiduKey(s,a),s=n.insertObj,a=n.j),$(i[h]).after(o+s),a=window.csdn.trackRecord.baiduTrackCount}}if(e.length>0){var u=i.length%2===0?i.length:i.length-1;if(i.lengthu;h--){var p=$(".recommend-box").children("div.recommend-item-box").last();e[h]&&(n=trackAddBaiduKey(e[h],a),a=n.j),n.insertObj&&p.after(n.insertObj)}}})}function interval(t){var e=null;return function(){clearTimeout(e),e=null,e=setTimeout(function(){t.setPosX()},200)}}function ToolMeau(t){this.posType=t&&t.posType?t.posType:"left",this.posReference=t&&t.posReference?t.posReference:$("main"),this.toolBox=$("div.tool-box"),this.toolBox.interval=t&&t.interval?t.interval:1,this.fixTop=t.fixTop?t.fixTop:170,this.isSetWidescreenStyle=!1,this.initPos(),this.init()}$(function(){function t(t){var e=document.createElement("script");e.src="https://nbrecsys.4paradigm.com/resource/js/sdk-csdn-smallflow.prod.1029.js",document.getElementsByTagName("head")[0].appendChild(e),e.onload=t}function e(t,e){return!s(t.item_id,e)&&void $(e).append(n(t,"T0","647"))}function i(t,e){return t.item_id!=l&&(t.url&&t.url.indexOf("edu.csdn.net")>-1&&$(e).addClass("isGreatIcon"),void $(e).append(n(t,"T3","648")))}function n(t,e,i){var n="",s="",a=!1,r=!1,l="",c={};return c.pos=e,t.cover_url&&(r=!0,c.is_img=!0,l='
'),t._url&&t._url.indexOf("edu.csdn.net")>-1&&(a=!0),"T3"===e?(n="width:96px;height:60px;border-radius: 4px;",s="oneline"):"T0"===e&&o(c),'"}function o(t){var e="84%";if(!t.is_img)var e="100%";var i=document.createElement("style");i.type="text/css",i.innerHTML=[".T0{","background-color: #fff;","margin-bottom: 1px;","margin-top: 1px;","padding: 16px 24px;","}",".T0 .img-box img{","width:96px;","height:60px;","margin-top: 6px;","border-radius: 4px;","}",".T0 .content-box{ width: "+e+";display:inline-block;margin-left: 8px;}",".T0 .content-box h4{","font-size: 18px;","color: #3C3C3C;","line-height: 24px;","margin-bottom:4px;","}",".T0 .content-box h4:hover{","color: #CA0C16;","}",".T0 .content-box .content{","font-size: 14px;","color: #6B6B6B;","}"].join(""),document.getElementsByTagName("head")[0].appendChild(i)}function s(t,e){return t==l&&(currentUserName?a(e):r(e),!0)}function a(t){!function(){var e="_"+Math.random().toString(36).slice(2);$(t).append('
'),(window.slotbydup=window.slotbydup||[]).push({id:"u3501897",container:e})}()}function r(t){var e=10;t.id="a_d_feed_"+e;var i=$("div.blog-content-box").outerWidth()-40;"function"!=typeof NEWS_FEED?"":NEWS_FEED({w:i,h:80,showid:"ztvJV8",placeholderId:"a_d_feed_"+e,inject:"define",define:{imagePosition:"left",imageBorderRadius:0,imageWidth:90,imageHeight:60,imageFill:"clip",displayImage:!0,displayTitle:!0,titleFontSize:20,titleFontColor:"#333",titleFontFamily:"Microsoft Yahei",titleFontWeight:"bold",titlePaddingTop:0,titlePaddingRight:0,titlePaddingBottom:6,titlePaddingLeft:8,displayDesc:!0,descFontSize:14,descFontColor:"#6b6b6b",descFontFamily:"Microsoft Yahei",paddingTop:8,paddingRight:16,paddingBottom:8,paddingLeft:16,backgroundColor:"#fff",hoverColor:"#ca0c16"}})}var l="user_define";p4_script_onload=function(){"undefined"!=typeof p4sdk_enable_courseBox&&p4CSDNT0Bootstrap(e,c),"undefined"!=typeof p4sdk_enable_recommendBox&&p4CSDNT3Bootstrap(i,h)};var c=document.getElementsByClassName("p4course_target")[0],h=document.getElementsByClassName("p4courset3_target")[0];"undefined"==typeof p4sdk_enable_courseBox&&"undefined"==typeof p4sdk_enable_recommendBox||t(p4_script_onload)}),$(function(){function t(){return!1}isShowAds&&($(window).resize(function(){t()}),t())});var ZeroClipboard={version:"1.0.7",clients:{},moviePath:"https://csdnimg.cn/public/highlighter/ZeroClipboard.swf",nextId:1,$:function(t){return"string"==typeof t&&(t=document.getElementById(t)),t.hide=function(){this.style.display="none"},t.show=function(){this.style.display="block"},t.addClass=function(t){this.removeClass(t),this.className+=" "+t},t.removeClass=function(t){for(var e=this.className.split(/\s+/),i=-1,n=0;n-1&&(e.splice(i,1),this.className=e.join(" ")),this},t.hasClass=function(t){return!!this.className.match(new RegExp("\\s*"+t+"\\s*"))},t},setMoviePath:function(t){this.moviePath=t},dispatch:function(t,e,i){var n=this.clients[t];n&&n.receiveEvent(e,i)},register:function(t,e){this.clients[t]=e},getDOMObjectPosition:function(t,e){for(var i={left:0,top:0,width:t.width?t.width:t.offsetWidth,height:t.height?t.height:t.offsetHeight};t&&t!=e;)i.left+=t.offsetLeft,i.top+=t.offsetTop,t=t.offsetParent;return i},Client:function(t){this.handlers={},this.id=ZeroClipboard.nextId++,this.movieId="ZeroClipboardMovie_"+this.id,ZeroClipboard.register(this.id,this),t&&this.glue(t)}};ZeroClipboard.Client.prototype={id:0,ready:!1,movie:null,clipText:"",handCursorEnabled:!0,cssEffects:!0,handlers:null,glue:function(t,e,i){this.domElement=ZeroClipboard.$(t);var n=99;this.domElement.style.zIndex&&(n=parseInt(this.domElement.style.zIndex,10)+1),"string"==typeof e?e=ZeroClipboard.$(e):"undefined"==typeof e&&(e=document.getElementsByTagName("body")[0]);var o=ZeroClipboard.getDOMObjectPosition(this.domElement,e);this.div=document.createElement("div");var s=this.div.style;if(s.position="absolute",s.left=""+o.left+"px",s.top=""+o.top+"px",s.width=""+o.width+"px",s.height=""+o.height+"px",s.zIndex=n,"object"==typeof i)for(addedStyle in i)s[addedStyle]=i[addedStyle];e.appendChild(this.div),this.div.innerHTML=this.getHTML(o.width,o.height)},getHTML:function(t,e){var i="",n="id="+this.id+"&width="+t+"&height="+e;if(navigator.userAgent.match(/MSIE/)){var o=location.href.match(/^https/i)?"https://":"http://";i+=''}else i+='';return i},hide:function(){this.div&&(this.div.style.left="-2000px")},show:function(){this.reposition()},destroy:function(){if(this.domElement&&this.div){this.hide(),this.div.innerHTML="";var t=document.getElementsByTagName("body")[0];try{t.removeChild(this.div)}catch(e){}this.domElement=null,this.div=null}},reposition:function(t){if(t&&(this.domElement=ZeroClipboard.$(t),this.domElement||this.hide()),this.domElement&&this.div){var e=ZeroClipboard.getDOMObjectPosition(this.domElement),i=this.div.style;i.left=""+e.left+"px",i.top=""+e.top+"px"}},setText:function(t){this.clipText=t,this.ready&&this.movie.setText(t)},addEventListener:function(t,e){t=t.toString().toLowerCase().replace(/^on/,""),this.handlers[t]||(this.handlers[t]=[]),this.handlers[t].push(e)},setHandCursor:function(t){this.handCursorEnabled=t,this.ready&&this.movie.setHandCursor(t)},setCSSEffects:function(t){this.cssEffects=!!t},receiveEvent:function(t,e){switch(t=t.toString().toLowerCase().replace(/^on/,"")){case"load":if(this.movie=document.getElementById(this.movieId),!this.movie){var i=this;return void setTimeout(function(){i.receiveEvent("load",null)},1)}if(!this.ready&&navigator.userAgent.match(/Firefox/)&&navigator.userAgent.match(/Windows/)){var i=this;return setTimeout(function(){i.receiveEvent("load",null)},100),void(this.ready=!0)}this.ready=!0,this.movie.setText(this.clipText),this.movie.setHandCursor(this.handCursorEnabled);break;case"mouseover":this.domElement&&this.cssEffects&&(this.domElement.addClass("hover"),this.recoverActive&&this.domElement.addClass("active"));break;case"mouseout":this.domElement&&this.cssEffects&&(this.recoverActive=!1,this.domElement.hasClass("active")&&(this.domElement.removeClass("active"),this.recoverActive=!0),this.domElement.removeClass("hover"));break;case"mousedown":this.domElement&&this.cssEffects&&this.domElement.addClass("active");break;case"mouseup":this.domElement&&this.cssEffects&&(this.domElement.removeClass("active"),this.recoverActive=!1)}if(this.handlers[t])for(var n=0,o=this.handlers[t].length;n