由买买提看人间百态

topics

全部话题 - 话题: dummy2
(共0页)
v****k
发帖数: 229
1
来自主题: Computation版 - MATLAB 并行计算问题
兄弟有几个 matlab 并行计算方面的问题,用他们提供的工具箱:
I just found a simple example online, see:
Without parallel computing:
runtimes = 1e9;
dummy1 = 0;
dummy2 = 0;
tic
for x= 1:runtimes;
dummy1 = dummy1 + x;
dummy2 = 2 * x + 1;
end
toc
with 2012b, it took about 4.8 seconds; but with matlab 2007b, it takes much
longer, about 20 minutes. why 2012 so much faster than 2007?
Next, with parallel computing, the code is like following, it takes 50
seconds. 为什么用并行计算反而慢这么多?
runtimes = 1e9;
dummy1 = 0;
dummy2 ... 阅读全帖
t***n
发帖数: 546
2
phonerlite 是一个ATA设备吗?
我又试着给dummy的google voice打了个电话,并且先挂断,并没有出现你说的问题。
exten => d***[email protected], 1, GotoIf(${DB_EXISTS(gv_dialout/channel)}?bridged
) 是照前人关于一个GV帐号的配置抄的,具体我也不是很明白。本来下面所有行都应该是
exten => d***[email protected], n*************
但是我改成了
exten => _[a-z][email protected],n*************
不光match d***[email protected],而是match 所有字母开头,@gmail.com结尾的打,也就
是任意gmail帐号。我认为这样的好处是任意配置是否在电话上接听google voice。比
如:
exten => d***[email protected], 1, GotoIf(${DB_EXISTS(gv_dialout/channel)}?bridged)
exten => d****[email protected], 1, GotoIf... 阅读全帖
j********r
发帖数: 25
3
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode *partition(ListNode *head, int x) {
ListNode dummy(0);
ListNode dummy2(0);
ListNode *p = &dummy;
ListNode *pp = &dummy2;
while(head) {
if (head->val < x) {
p->next = head;
p = p->next;
}
else {
... 阅读全帖
l*w
发帖数: 646
4
来自主题: Computation版 - fortran 基本命令求助,急
如果是监控某段程序的计算时间:
Before the code:
call cpu_time (dummy1)
After the code:
call cpu_time (dummy2)
total_time = dummy2 - dummy1
G**Y
发帖数: 33224
5
来自主题: Linux版 - fscanf is messy
What "%[^\n]\n" means?!
If the first few lines of an input file are:
hello
hello
world
...
the 3rd line is empty, no extra spaces at the end of the lines. What the output should be?
#include
#include
int main(void) {
FILE* fp;
char file[999]="hello.world";
char dummy1[9999], dummy2[9999], dummy3[9999], dummy4[9999];
int line_max=9999;
int i;
if ((fp = fopen(file, "r")) == NULL) {
printf("Cannot open file %s for reading. \n", file);
exit(
(共0页)