我想知道java线程中不安全的递减/递增的结果,所以有我的程序:
主要课程:
public class Start {
public static void main(String[] args) {
int count = 10000000, pos = 0, neg = 0, zero = 0;
for (int x=0; x<10000; x++) {
Magic.counter = 0;
Thread dec = new Thread(new Magic(false, count));
Thread inc = new Thread(new Magic(true, count));
dec.start();
inc.start();
try {
inc.join();
dec.join();
} catch (InterruptedException e) {
System.out.println("Error");
}
if (Magic.counter == 0)
zero++;
else if (Magic.counter > 0)
pos++;
else
neg++;
}
System.out.println(Integer.toString(neg) + "\t\t\t" + Integer.toString(pos) …Run Code Online (Sandbox Code Playgroud) 让我们来看看这个例子 ...如何改变那些酒吧的颜色?
我知道我可以通过渲染器更改它,但它不会改变传说.
我试过用:
style: {fill: 'red'}
Run Code Online (Sandbox Code Playgroud)
但它改变了任何酒吧的颜色
我试图将颜色放在数组中,它不起作用.
我试图将每个样式放在数组中,如下所示:
style: [{fill: 'red'}, {fill: 'green'}, {fill: 'blue'}]
Run Code Online (Sandbox Code Playgroud)
但它也不会起作用,因为我可以将标题放在数组中:
title: ['title1', 'title2', 'title3']
Run Code Online (Sandbox Code Playgroud)
我认为(样式)应该也可以,但不是.
那么如何更改每个"数据"栏的颜色?
似乎使用新版本的谷歌电子表格不再可能使用 JS 下载整个谷歌电子表格。到目前为止,我一直在使用这种方法(对于之前创建的文件仍然可以正常工作):
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://docs.google.com/feeds/download/spreadsheets/Export?key=' + id + '&exportFormat=xlsx');
xhr.responseType = 'arraybuffer';
xhr.setRequestHeader('Authorization', 'Bearer ' + gapi.auth.getToken().access_token);
xhr.onload = function() {
...
};
xhr.send();
Run Code Online (Sandbox Code Playgroud)
https://docs.google.com/spreadsheets/d/_ID_/export?format=xlsx&id=_ID_
Run Code Online (Sandbox Code Playgroud)
但不幸的是,没有Access-Control-Allow-Origin标题,因此无法使用 JS 访问该链接。我还有其他可能下载文件吗?
Google Drive API 将导出 url 显示为:
https://docs.google.com/spreadsheets/export?id=_ID_&exportFormat=xlsx
Run Code Online (Sandbox Code Playgroud)
但也没有Access-Control-Allow-Origin标题。
是否有其他可能仅使用 JS 下载此文件?
我得到了几分,我想画出它们,然后用线条加入它们,我试过:
plot3(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4)
Run Code Online (Sandbox Code Playgroud)
等等大约100,但我只是得到了许多点的情节,如何加入他们的线?