zoukankan      html  css  js  c++  java
  • nodejs_os-utils模块 探坑

      今天因为项目的需要用了node的os-utils模块来获取当前机器的cpu使用状态,上午写的时候还可以用,但是加上了一些东西之后就用不了了,我经过一块一块的注释(linux注释好麻烦,有没有老司机教教我linux怎么快速注释),终于找到了问题的所在。因为我想要计算数组从某一个数到另外一个数的平均值,所以写了一个prototype.avg方法。所以我开始的时候猜是这个模块写了几个数组的方法,所以试了一下用其他的名字可不可以,我当时试了av和average 都不好用我就放弃了= = 有时间要看看osUtils的源码。。。

      但是不能用prototype总是感觉不太爽的样子,所以我就。。。把reduce方法重写了= = 反正我也不用。。。我真的好机智啊= = 

  • 相关阅读:
    UVa532 Dungeon Master 三维迷宫
    6.4.2 走迷宫
    UVA 439 Knight Moves
    UVa784 Maze Exploration
    UVa657 The die is cast
    UVa572 Oil Deposits DFS求连通块
    UVa10562 Undraw the Trees
    UVa839 Not so Mobile
    327
    UVa699 The Falling Leaves
  • 原文地址:https://www.cnblogs.com/orionwei/p/5292454.html
Copyright © 2011-2022 走看看