首页 文章 精选 留言 我的

精选列表

搜索[函数],共10000篇文章
优秀的个人博客,低调大师

使用Chrome开发者工具研究JavaScript里函数的原生实现

As the size of my blog Chrome Development Tool tips used in my daily work turns to be larger I create a separate post to record down this small tip.Are you curious about the “native code” here? At least I am. Today I find that the Profiles tab in Chrome development tool can help us to unveil the mysteries to some degree.In Chrome development, just select this checkbox: And then execute the simple JavaScript code below: var arr = []; for (var i=0; i<1000; i++){ arr.push(i) } console.profile("Array toString"); for( var i = 0; i < 1000; i++){ var a = arr.toString(); } console.profileEnd("Array toString"); Once done, you can see a profile record with the name specified in JavaScript code above, “Array toString”. Hover the mouse to the first row, “anonymous function”, we find the hint “array.js”. Switch display style from Chart to Tree: From here the callstack of native implementation of toString is displayed: The next step is to look into in array.js.Launch url: https://cs.chromium.org/Click this hyperlink: now you can find the array.js file via path: src/v8/src/js/array.js The callstack analyzed through the source code exactly matches the one we get in Chrome development tool Profile tab:ArrayToString will delegate to Join if current caller is an Array: Join will call DoJoin: DoJoin will first call UseSparseVariant to evaluate the possibility to perform Join via SparseVariant. If not possible, call ConvertToString as fall back. ( The line number of source code may vary with the one you see in Chrome Development Tool profile tab due to the different version of Chrome being used. ) If you could not tolerate the poor performance of this online source code repository, you could download the whole source code of V8 to your local laptop by cloning this github repository:https://chromium.googlesource.com/v8/v8.git/ 本文来自云栖社区合作伙伴“汪子熙”,了解相关信息可以关注微信公众号"汪子熙"。

优秀的个人博客,低调大师

msg.js 更新,增加提示消失时的回调函数

更新项: 增加提示消息、操作成功、操作失败提示窗消失时的回调,msg.info() 、 msg.success()、 msg.failure() 这三个都支持这种方式。使用如: msg.info('Hello Msg', function(){ alert(123); }); msg.js ,纯原生 JavaScript 无任何三方框架! 快速使用 第一步,引入 msg.js <script src="https://res.weiunity.com/msg/msg.js"></script> 第二步,一行代码使用 msg.info('Hello Msg')

优秀的个人博客,低调大师

函数计算 python runtime 常用的第三方包下载

问题 尽管 python runtime 使用第三方包 文档中比较详细地介绍了如果使用第三方包,但是还是有不少用户遇见了问题,尤其是windows 用户在此block了不少时间,本文根据最近用户反馈的情况,提供可以直接在线上环境运行的最精简库代码包下载 代码包下载链接 lib python2.7 python3.6 pandas_0.23.4 pandas_0.23.4.zip pandas_0.23.4.zip pillow_5.3.0 pillow_5.3.0.zip pillow_5.3.0.zip pymysql_0.9.3 pymysql_0.9.3.zip pymyssql_0.9.3.zip pymongo_3.7.2 pymongo_3.7.2.zip pymongo_3.7.2.zip blaze_0.10.1 blaze_0.10.1.zip bla

资源下载

更多资源
优质分享App

优质分享App

近一个月的开发和优化,本站点的第一个app全新上线。该app采用极致压缩,本体才4.36MB。系统里面做了大量数据访问、缓存优化。方便用户在手机上查看文章。后续会推出HarmonyOS的适配版本。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

用户登录
用户注册
修改密码
忘记密码