我已经阅读了有关有状态和无状态会话bean以及它们如何工作的各种书籍.我想知道这些ejbs的实际用法和优于使用普通java类的优点.基本上你什么时候去无国籍的ejbs,你什么时候去有状态的ejbs.我想要一个实时应用程序.
假设您有两个接口I1和I2,两个接口都具有相同的方法
1)public int add(int a) throws exception e1 //(Interface 1)
2)public int add(int a) throws exception e2 //(Interface 2)
Run Code Online (Sandbox Code Playgroud)
现在一个类实现了I1和I2.
@override
public int add(int a) exception e1
{
//adding operation
}
Run Code Online (Sandbox Code Playgroud)
注意:据我所知,如果实现多个具有相同方法的接口,那么实现类中只有一个实现.
编译器是否根据throws子句推断此方法是来自I1还是I2?是否需要方法签名澄清?(我知道签名包括传递的名称和参数.)
如果我们已经实现了两个接口,然后我们只抛出e1,那么编译器会允许这个,因为实现类并没有真正实现这两个接口?它会导致钻石结构问题吗?
我们是否需要使用throws子句e1和第二次e2实现相同的方法?当我尝试这个时,编译器告诉我我有重复的方法.
如果我们首先实现I1然后它说它是I1的方法,如果我们首先编写I2然后它说它的I2的方法.解释为什么会这样.
$ git ls-remote
Run Code Online (Sandbox Code Playgroud)
结果是
fatal: No remote configured to list refs from.
Run Code Online (Sandbox Code Playgroud)
我定义了遥控器
$ git remote
Run Code Online (Sandbox Code Playgroud)
结果是
personal_remote
upstream
Run Code Online (Sandbox Code Playgroud) public class Recount {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Random rand = new Random();
boolean s = false;
int a;
Scanner quest = new Scanner(System.in);
do {
int n = rand.nextInt(100) + 1;
System.out.println(n);
System.out.println("Try again?");
s = quest.nextBoolean();
} while (s != false);
}
}
Run Code Online (Sandbox Code Playgroud)
我想将上一次迭代中给出的数字添加到循环当前迭代中的数字中。
基本上我希望新 n 等于旧随机数 + 新随机数。
目前收到Ruby Hash: can't convert String into Integer
错误.代码在edit_id行上失败.
我已经尝试过许多不同的解决方案,这些解决方案来自SE上已发布的类似问题,但不幸的是,它们都没有奏效
哈希:
{"downloadID"=>115, "PageID"=>nil, "title"=>"hi", "dlLink"=>"http://www.a.com", "imgSrc"=>"http://www.a.com", "caption"=>"aaaa", "dlLive"=>nil, "createdAt"=>nil, "user_id"=>7}
Run Code Online (Sandbox Code Playgroud)
码:
#edit download
put '/view1/downloadedit' do
data = JSON.parse(request.body.read)
puts data
edit_id = data["downloadID"]
puts edit_id
@download = Download.get(:download_id => edit_id)
puts data
if @download.update(data)
status 201
puts 'edit saved okay'
else
status 201
puts 'edit failed to SAVE'
end
end
Run Code Online (Sandbox Code Playgroud) 这是我目前的课程:
package Mathias;
import java.util.*;
public class Scanner {
public static void main(String args[]) {
System.out.print("What's your name?");
Scanner sc = new Scanner(System.in);
String Input = sc.nextLine();
System.out.println("Hello, " + Input + ".");
}
}
Run Code Online (Sandbox Code Playgroud)
我在第5和第6行遇到两个错误.
错误1 http://puu.sh/64VGk.jpg
@Mock
Object obj;
List<Obejct obj> objs;
Run Code Online (Sandbox Code Playgroud)
当我迭代时如何获取模拟对象 obj objs
?
我已经设置了一个儿童主题.是否可以通过FTP在我的服务器上添加一个文件夹(最好是在同一个子主题文件夹中)img
,然后从我的页面和帖子链接到该文件夹中的图像?
我尝试使用此路径:
<img src="../wp-content/themes/theme-child/img/placeholder.png"/>
Run Code Online (Sandbox Code Playgroud)
但那没用.
所以我有这个地形和一个垂直的平面设置,现在我想结合这两个含义将平面的顶点移动到最近的顶点。地形上的顶点。我画了一张图来说明我的想法。最终结果是地形看起来有一定的厚度。
我还需要该点在地形上的投影
我在之前的线程中找到了这段代码:
float distance = PointToPlaneDistance(smallObj.transform.position, wall.transform.position, wallNormal);
private float PointToPlaneDistance(Vector3 pointPosition, Vector3 planePosition, Vector3 planeNormal)
{
float sb, sn, sd;
sn = -Vector3.Dot(planeNormal, (pointPosition - planePosition));
sd = Vector3.Dot(planeNormal, planeNormal);
sb = sn / sd;
Vector3 result = pointPosition + sb * planeNormal;
return Vector3.Distance(pointPosition, result);
}
Run Code Online (Sandbox Code Playgroud)