小编cin*_*nqS的帖子

错误:模块没有自行注册.

服务器:Ubuntu服务器14.04

节点:v4.2.6 LTS

npm:1.3.10

我把我的同事的工作从git remote拉了下来.他将node_modules设为.gitignore.所以我必须npm安装模块.

但是在成功安装npm之后.当我尝试使用mocha启动项目时.它提醒我一个模块没有自我注册

错误来自Bcrypt的模块.

在绑定(/base_dir/node_modules/bcrypt/node_modules/bindings/bindings.js:76:44)

我不想将我的节点降级到0.10,因为我不能在该版本中使用JS promise.不知何故,JS承诺是我工作的必需品

javascript bcrypt node.js

4
推荐指数
1
解决办法
6728
查看次数

如何在基于注释的配置文件中将另一个bean称为属性

在基于XML上下文的bean配置文件中,如果我想将bean引用为属性,我会使用:

<bean class="com.example.Example" id="someId">
    <property name="someProp" refer="anotherBean"/>
</bean>
<bean class="com.example.AnotherBean" id="anotherBean">
</bean>
Run Code Online (Sandbox Code Playgroud)

所以Examplebean将使用anotherBean它的属性

所以在基于注释的配置java文件的概念中:

@Configuration
class GlobalConfiguration {
    @Bean
    public Example createExample(){
        return;
        //here how should I refer to the bean below?
    }

    @Bean
    public AnotherBean createAnotherBean(){
        return new AnotherBean();
    }
}
Run Code Online (Sandbox Code Playgroud)

java spring

4
推荐指数
1
解决办法
4328
查看次数

docker容器不能使用`service sshd restart`

我正试图建立一个Hadoop Dockerfile

在构建过程中,我添加了:

  && apt install -y openssh-client \
  && apt install -y openssh-server \
  && ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa \
  && cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys \
  && chmod 0600 ~/.ssh/authorized_keys
  && sed -i '/\#AuthorizedKeysFile/ d' /etc/ssh/sshd_config \
  && echo "AuthorizedKeysFile ~/.ssh/authorized_keys" >> /etc/ssh/sshd_config \
  && /etc/init.d/ssh restart
Run Code Online (Sandbox Code Playgroud)

我以为我在运行此容器时:

docker run -it --rm hadoop/tag bash
Run Code Online (Sandbox Code Playgroud)

我将能够:

ssh localhost
Run Code Online (Sandbox Code Playgroud)

但我得到一个错误:

ssh:连接到主机localhost端口22:连接被拒绝

如果我在容器内手动运行此命令:

/etc/init.d/ssh restart
# or this
service ssh restart
Run Code Online (Sandbox Code Playgroud)

然后我可以建立联系。我认为这意味着sshd重新启动无法正常工作

我使用FROM java的 …

ssh sshd docker dockerfile

2
推荐指数
1
解决办法
3092
查看次数

如何使熊猫数据框 Fortran 类型有序

我知道在 python pandas 包中,数据帧有一部分是用 NumPy NDArrays 构建的。numpy 可以选择您的数据顺序类型,例如“C”或“F”。

由于我总是必须在巨大的数据帧(如 1 亿行)上的列上实现大量操作,我预计如果我有机会将数据帧从 c 类型传输到 f 类型,我可以大大提高性能,对吗?

如果是这样,我该怎么做?或者简单地使用 numpy,因为熊猫数据框不是必须的,实际上是一个快速的答案。

谢谢

python performance numpy pandas

2
推荐指数
1
解决办法
692
查看次数

标签 统计

bcrypt ×1

docker ×1

dockerfile ×1

java ×1

javascript ×1

node.js ×1

numpy ×1

pandas ×1

performance ×1

python ×1

spring ×1

ssh ×1

sshd ×1