不幸的是,Ubuntu的PPA落后于Julia的最新稳定版本,我需要它。 (我不想每晚制作。)
我从这里下载了Linux二进制文件: http://julialang.org/downloads/
现在,我在哪里放置二进制文件,以便在终端中键入julia
时,它使用这个新的稳定版本而不是旧版本?
答案 0 :(得分:3)
看看是什么
/usr/bin
包含并将其置于'/usr/local/bin
之前。 ~/bin/
和(如果有的话)~/bin/
都是常见的选择。
如果您还没有mkdir ~/bin
edit ~/.profile # set PATH via, say, PATH="$HOME/bin:$PATH"
,请执行
package com.examples.threading
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.atomic.AtomicLong;
public class ThreadPool {
final static AtomicLong lookups = new AtomicLong(0);
final static AtomicLong totalTime = new AtomicLong(0);
public static class Task implements Runnable
{
int start = 0;
Task(int s) {
start = s;
}
@Override
public void run()
{
for (int j = start ; j < start + 3000; j++ ) {
long st = System.nanoTime();
boolean a = false;
long et = System.nanoTime();
totalTime.getAndAdd((et - st));
lookups.getAndAdd(1l);
}
}
}
public static void main(String[] args)
{
// change threads from 1 -> 100 then you will get different numbers
ExecutorService executor = Executors.newFixedThreadPool(1);
for (int i = 0; i <= 1000000; i++)
{
if (i % 3000 == 0) {
Task task = new Task(i);
executor.execute(task);
System.out.println("in time " + (totalTime.doubleValue()/lookups.doubleValue()) + " lookups: " + lookups.toString());
}
}
executor.shutdown();
while (!executor.isTerminated()) {
;
}
System.out.println("in time " + (totalTime.doubleValue()/lookups.doubleValue()) + " lookups: " + lookups.toString());
}
}