This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#set -g prefix C-x | |
#unbind C-b | |
#bind-key C-x send-prefix | |
set-option -g status-keys vi | |
set-window-option -g mode-keys vi | |
setw -g mode-mouse on | |
set -g mouse-resize-pane on | |
set -g mouse-select-pane on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
suo@ustack:~/devstack$ curl -H "content-type: application/json" -H "x-auth-token:$ADMIN" http://localhost:35357/v3/credentials -d '{"credential": {"user_id": "91f2f916a5714101866ae325fd6d5aec", "project_id" : "473c507eb7e645fda4d7dabb6c7eac03", "blob": {"AccessKey": "AKIAJ5AAFSPWGWH25P3A", "SecertKey": "PzJGRqDLN8uET9ZzhQZ4wy5gTIGFxE1S3FhghwS8"}, "type": "AccessKey"}}' | ./jsontool.py | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 611 100 372 100 239 6223 3998 --:--:-- --:--:-- --:--:-- 6200 | |
{ | |
"credential": { | |
"user_id": "91f2f916a5714101866ae325fd6d5aec", | |
"links": { | |
"self": "http://localhost:5000/v3/credentials/c04f153f34134fb68699c9efb70c50ec" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void bindCloudletsToVmsSimple(){ | |
int vmNum = vmList.size(); | |
int cloudletNum = cloudletList.size(); | |
int idx = 0; | |
for (int i=0;i<cloudletNum;i++){ | |
cloudletList.get(i).setVmId(vmList.get(idx).getId()); | |
idx = (idx+1)%vmNum; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C语言产生随机数需要调用stdlib.h头文件中的两个函数: | |
int rand(void): 产生一个0到RAND_MAX之间的随机整数。(RAND_MAX定义在stdlib.h, 其值为2147483647) | |
void srand(int seed): 用于初始化种子,便于每次产生不同的随机数。 | |
/* | |
如果要产生其他范围内的整数,可以使用取余运算实现。以下代码为产生0~100之间的随机数: | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = (a+50-int(a)%50); | |
For example: | |
before after | |
a=1 --> a=50 | |
a=49 --> a=50 | |
a=51 --> a=100 |
NewerOlder