学生组表:
STDNT_GROUP
studentId,CollegeID,studentgroup,flag
1,007,panthers,y
2,003,owls,n
3,007,owls,y
1,007,texans,y
2,003,texans,n
Run Code Online (Sandbox Code Playgroud)
预期产出
1,007
2,003
3,007
Run Code Online (Sandbox Code Playgroud)
我想要独特的学生ID以及他们各自的大学生.
我试过这个查询:
select distinct(studentId),collegeID from;
Run Code Online (Sandbox Code Playgroud)
和
select studentId,collegeID from STDNT_GROUP where studentId in(select distinct(studentId) from STDNT_GROUP)";
Run Code Online (Sandbox Code Playgroud) 实际上我写了一个Java程序来计算Fibonacci系列上的特定数字.
现在的问题是我使用的核心数量是所需的线程数.但我观察到随着输入大小的增加,我通过增加线程数来获得更好的性能.
是否存在关于如何将问题划分为多个线程的现有公式/理论?
以下是源代码:
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
public class Fibonacci {
private static long[] value;
public static void main(String args[]) throws InterruptedException {
int n;
try {
n = Integer.parseInt(args[0]);
} catch (Exception e) {
throw new RuntimeException(
"Please enter in the form java n number ");
}
value = new long[n + 1];
long start = System.nanoTime();
int nThreads = Runtime.getRuntime().availableProcessors();
ExecutorService executorService = Executors
.newFixedThreadPool(nThreads);
int result;
try {
result = fibonacciSum(n, executorService); …Run Code Online (Sandbox Code Playgroud) 如何使用JUnit测试两个迭代器的相等性?
是否有任何内置方法或只是通过比较其中的每个元素?
谢谢,Sriram