了解与实现 Python 中的 uniform() 函数
最编程
2024-07-22 09:48:22
...
/g,"
"); noteContent = noteContent.replace(//g,""); // 系列化表单数据 var comment_parent = 0; var is_user_logged_in = $("#is_user_logged_in").val(); var comment_post_ID = 4049; var _wp_unfiltered_html_comment = $("#_wp_unfiltered_html_comment").val(); var comment = noteContent; var author = $("#author").val(); var url = $("#url").val(); var email = $("#email").val(); if(isBlank(author) && is_user_logged_in==0) { statusdiv.html('
请输入昵称!
').show(); } else if(isBlank(email) && is_user_logged_in==0) { statusdiv.html('请输入邮箱!
').show(); } else { // var formdata=commentform.serialize() + "&comment=" + noteContent ; // 添加状态信息 statusdiv.html('Processing...
').show(); // 获取表单提交地址 var formurl=commentform.attr('action'); // 异步提交 $.ajax({ type: 'post', url: formurl, dataType:'json', data: {"comment_parent":comment_parent,"comment_post_ID":comment_post_ID, "_wp_unfiltered_html_comment":_wp_unfiltered_html_comment,"comment":comment,"url":url, "email":email,"author":author}, error: function(XMLHttpRequest, textStatus, errorThrown){ statusdiv.html('数据不完整或表单提交太快了!
').show(); }, success: function(data, textStatus){ if(data.errorno=="0") { $("#submit").prop('disabled', true); statusdiv.html('笔记已提交审核,感谢分享笔记!
').show(); alert('笔记已提交审核,感谢分享笔记!'); }else{ statusdiv.html(''+data.msg+'
').show(); } commentform.find('textarea[name=comment]').val(''); } }); setTimeout(function(){ $("#submit").prop('disabled', false); }, 10*1000); } return false; }); $(".comt-author").click(function() { href = $(this).children("a").attr("href"); if(href.indexOf("/note/")!=-1) { var win = window.open(href, '_blank'); win.focus(); } }); $(".comt-meta span").hover(function(){ $(this).children(".tooltip").css({ "opacity": 1, "pointer-events": "auto"}); },function(){ $(this).children(".tooltip").removeAttr("style"); }); /* $(".wrapper i").hover(function(){ $(this).siblings(".tooltip").css({ "opacity": 1, "pointer-events": "auto"}); },function(){ $(this).siblings(".tooltip").css({ "opacity": 0, "pointer-events": "auto"}); }); */ //Upvote.create('runoobvote-id', {callback: vote_callback}); var ajaxurl = 'https://www.runoob.com/wp-admin/admin-ajax.php'; var callback = function(data) { //console.log($('#runoobvote-id').upvote('upvoted')); //console.log($('#runoobvote-id').upvote('downvoted')); //console.log(data); _vote_action = data.action; id_arr = data.id.split('-'); um_id= id_arr[2]; //console.log(um_id); var re = /^[1-9]+/; if (re.test(um_id)) { var ajax_data = { _vote_action: _vote_action, action: "pinglun_zan", um_id: um_id, um_action: "ding" }; //console.log(ajax_data); $.post(ajaxurl,ajax_data,function(status){ //if(status.vote_num>999) { // _voteHtml = ''+kFormatter(status.vote_num) +''; // $("#runoobvote-id-" + um_id + " .count").hide().after(_voteHtml); //} }); } }; if($('#comments').length && $('.upvotejs').length){ $('.upvotejs').upvote({id: 4049, callback: callback}); $.post(ajaxurl,{"action":"pinglun_zan","postid":4049},function(data){ $(data).each(function(key,value) { $("#runoobvote-id-" + value.commid + " .upvote").addClass(value.upvotejs_class); $("#runoobvote-id-" + value.commid + " .downvote").addClass(value.downvote_class); $("#runoobvote-id-" + value.commid + " .count").text(value.upvote_count); }) },'json'); } }); function isBlank(str) { return (!str || /^\s*$/.test(str)); } function kFormatter(num) { // return num; return Math.abs(num) > 999 ? Math.sign(num)*((Math.abs(num)/1000).toFixed(1)) + 'k' : Math.sign(num)*Math.abs(num) }上一篇: 暑期数学建模特训18:粒子群优化算法解析
下一篇: 如何在MATLAB中实现粒子群优化算法
推荐阅读
-
Python中的LSTM实现轨迹预测:理解其重要性与意义
-
在Python中如何实现反三角函数的计算?
-
如何在Python中轻松创建、调用和理解def函数,以及参数传递的实际操作与示例代码
-
汽车后面的字母是什么意思?-增压发动机 类型一:TSI 大众的TSI在国内外有着不一样的意思,国外的意思是Twincharger Stratified ion,指双增压(涡轮和机械增压)分层喷射技术。而国内的意思,T代表涡轮增压,Si代表燃油直喷,而不是T与FSI的简称,并没有燃油分层喷射技术,因为国内燃油质量一般,达不到分层喷射的要求。 在国内,我们经常会看到不同的TSI标志。有全红的、有就“SI”是红的、还有只有“I”是红的。但大家别误会他们技术不一样,这只是为了区分不同的排量而已。例如:2.0排量和1.8排量为“SI”是红色的,而2.0TSI车型中的高配车型或者高端车型则使用全红的标识,那么1.4排量的当然只能是只有“I”是红色的了。 类型二:TFSI TFSI发动机也是涡轮燃油直喷发动机它可以说是FSI发动机和涡轮增压器的结合。即涡轮增压(Turbocharger)+FSI。它的T和TSI中的T一样,表示采用涡轮增压技术,后面的FSI即燃油分层喷射发动机(Fuel Stratified ion),S表示“分层次的”。TFSI发动机既分层喷射,又有涡轮增压,是TSI发动机的升级版。 类型三:TDI TDI是英文Turbo Direct ion的缩写,意为涡轮增压直接喷射柴油发动机。 为了解决SDI(自然吸气式柴油发动机)的先天不足,人们在柴油机上加装了涡轮增压装置,使得进气压力大大增加,压缩比一般都到10以上,这样就可以在转速很低的情况下达到很大的扭矩,而且由于燃烧更加充分,排放物中的有害颗粒含量也大大降低。TDI技术使燃油经由一个高压喷射器直接喷射入气缸,因为活塞顶地造型是一个凹陷式的碗状设计,燃油会在气缸内形成一股螺旋状的混合气。 自然吸气发动机类型一:CGI/CDI 发动机CGI技术是一种奔驰公司开发的缸内直喷技术。供油动作已完全独立于进门与活塞系统之外,ECU也因而拥有更多的主导权。超乎传统喷射理论的稀薄燃烧与更多元的混合比便得以实现。在稳定行进或低负载状态下,采用缸内直喷设计的发动机得以进入Ultra lean(精实)模式。 在此设定下,发动机于进气行程时只能吸进空气,至于喷油嘴则在压缩行程才供给燃料,以达到节约的效果。根据实际测试,其最高能达到1:65的油、气比例,除了节能表现相当惊人,整体动力曲线也能够维持相当高的平顺度。而CDI则为该技术的柴油版本。类型二:VVT/CVVT/VVT-I/MIVEC/VTEC/i-VTEC 发动机可变气门正时技术(VVT,Variable Valve Timing)原理是根据发动机的运行情况,调整进气(排气)的量,和气门开合时间、角度,使进入的空气量达到最佳,提高燃烧效率。优点是省油,功升比大而缺点是中段转速扭矩不足。 目前本田的VTEC、i-VTEC、;丰田的VVT-i;日产的CVVT;三菱的MIVEC;铃木的VVT;现代的VVT;起亚的CVVT;江淮的VVT;长城的VVT等也逐渐开始使用。总的说来其实就是一种技术,名字不同。 但部分车型仅具有可变气门技术而没有正时技术,虽然比一般发动机要省油,但依然赶不上带正时技术的发动机。绿色发动机 类型一:Hybrid
-
理解与应用:Python中的isnumeric()函数
-
理解与应用:Python中的hasattr函数
-
如何在MATLAB中绘制双变量函数Z = 1 / (1 - x^2) + y^2,并用Python实现同样的二维二次曲面图展示
-
在OpenCV中快速画出箭头形线条:利用arrowedLine函数的C++与Python实现指南
-
Python中的super()函数详解:单继承与多继承的应用及debug过程中如何使用
-
C++编程:实战教程 - 实现栈与队列(Deque) 容器适配器,探讨Stack和Queue的实现及Queueue(Deque)的问题。深入理解:如何模拟实现Priority Queue (优先级队列) - 实例与练习。续集:仿函数在C++中的二次探索