我有3个A,B和D类,如下所示
class A(object):
def test(self):
print "called A"
class B(object):
def test(self):
print "called B"
class D(A,B):
def test(self):
super(A,self).test()
inst_d=D()
inst_d.test()
----------------------------------------
Output:
called B
Run Code Online (Sandbox Code Playgroud)
问题:在D.test(),我在打电话super(A,self).test().B.test()即使该方法A.test()也存在,为什么只被调用?
我正在开发的项目只使用maven-2.2构建:对于早期版本,依赖项未正确解析.
有没有办法根据maven版本中断构建信息错误消息?
例如,我有这个声明:
int a[10];
Run Code Online (Sandbox Code Playgroud)
以前,我这样理解:a实际上是一个指针,它会在内存中连续指向10个元素.
但今天,当我的老师教我时,他说:它将是一个指针数组,每个指针都指向它的值.
我不知道哪个是真的.请告诉我.
try {
MessageDigest digest = MessageDigest.getInstance("SHA-512");
byte[] output = digest.digest(password);
digest.update(salt);
digest.update(output);
return new BigInteger(1, digest.digest());
} catch (NoSuchAlgorithmException e) {
throw new UnsupportedOperationException(e);
}
Run Code Online (Sandbox Code Playgroud)
但我得到了Exception in thread "main" java.security.NoSuchAlgorithmException: SHA_512 MessageDigest not available错误
我目前正在研究Rails/Ruby项目的过程监控选项,并且非常像上帝.
但我真的找不到任何关于如何监控多个应用程序(例如在一台机器上运行的2个rails项目)与上帝.
据我所知,我只是设置了神(系统红宝石)并让每个项目添加自己的配置(可能在某种程度上在deploy-hook中).这也适用于运行不同ruby版本(rbenv,rvm)或bundler的项目,因为god ruby不必访问任何项目代码.
有没有人像这样使用它?还是有更好的方法?
看下面的程序.编译时,循环不会终止.这不是预期的行为.有人请解释这个原因吗?
#include<iostream.h>
int main()
{
int nIntValue = 0;
int nTempVal = 100;
for( int nLoop = 1; nLoop <= 25; nLoop++ )
{
nTempVal = nTempVal / nLoop;
}
// Print the value of nIntVal
while( nIntVal == 0 )
{
nIntVal += nTempVal;
cout<<nIntVal;
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)