• Breaking News

    Tuesday, January 19, 2021

    Simulate Newton's law of universal gravitation with C++ Computer Science

    Simulate Newton's law of universal gravitation with C++ Computer Science


    Simulate Newton's law of universal gravitation with C++

    Posted: 18 Jan 2021 02:30 PM PST

    What happens when you distribute a RAFT group over large geographical distances (and latency)? Say, each computer would sit about a 100ms from each other, so that the farthest ones are a 600ms RTT from each other? What would break first?

    Posted: 19 Jan 2021 12:33 AM PST

    I'm designing a reliable way to replicate some data for my globally distributed microservice-based architecture and am having a surprisingly difficult time in gathering some hard numbers on this subject.

    Exactly which part is it that makes people with knowledge on the matter tell me that geographically distributed RAFT is a very bad idea? Don't get me wrong, I trust the experts and their opinions, I just don't understand where they're getting their consensus from.

    I understand that leader election and discovery would take a hit, and that the original paper proposes a 150-300 ms leader election timeout based on their measurements. My impression is that the nodes participating in their experiments were closely located to each other, since I can't find anything specific about this in the paper.

    I also looked into "Raft Refloated: Do We Have Consensus?"

    http://cs.brown.edu/~malte/pub/papers/2015-osr-raft.pdf

    This explains some aspects of slowdowns, but is surprisingly vague on the effect RTT has on the viability of these nodes.

    I'm looking at the network latency reports from Verizon, which is telling me that the worst latency over the globe is around 200ms one way, so maybe double that would be my upper limit I need to tolerate.

    Any input is appreciated.

    submitted by /u/handjobs_for_crack
    [link] [comments]

    Why can't step over after scanf? [already input and hit enter]

    Posted: 18 Jan 2021 11:28 PM PST

    https://ibb.co/M8SwT0Y

    /*test 10 move 9 onto 1 move 8 over 1 move 7 over 1 move 6 over 1 pile 8 over 6 pile 8 over 5 move 2 over 1 move 4 over 9 quit */ int main() { int n; printf("Please input n:"); scanf(" %d", &n); int arr[100][100]; int i, j; for (i = 0; i < n; i++) { arr[i][0] = i; } for (i = 0; i < n; i++) { for (j = 1; j < n; j++) { arr[i][j] = -1;//empty } } while (1) { char cmd[20]; scanf(" %s", cmd); if (strcmp("quit", cmd) == 0) { break; } if (strcmp("move", cmd) == 0) { int s, d; scanf(" %d", &s); scanf(" %s", cmd); if (strcmp("onto", cmd) == 0) { scanf(" %d", &d); //empty s j = 1; while (arr[s][j] != -1) { arr[arr[s][j]][0] = arr[s][j]; arr[s][j] = -1; j++; } //empty d j = 1; while (arr[d][j] != -1) { arr[arr[d][j]][0] = arr[d][j]; arr[d][j] = -1; j++; } //moving arr[d][1] = s; arr[s][0] = -1; } else if (strcmp("over", cmd) == 0) { scanf(" %d", &d); //empty s j = 1; while (arr[s][j] != -1) { arr[arr[s][j]][0] = arr[s][j]; arr[s][j] = -1; j++; } //find empty of d j = 1; while (arr[d][j] != -1) { j++; } arr[d][j] = s; arr[s][0] = -1; } } //pile else if (strcmp("pile", cmd) == 0) { int s, d; scanf(" %d", &s); scanf(" %s", cmd); if (strcmp("onto", cmd) == 0) { scanf(" %d", &d); //empty d j = 1; while (arr[d][j] != -1) { arr[arr[d][j]][0] = arr[d][j]; arr[d][j] = -1; j++; } //piling j = 0; while (arr[s][j] != -1) { arr[d][j + 1] = arr[s][j]; arr[s][j] = -1; j++; } } else if (strcmp("over", cmd) == 0) { scanf(" %d", &d); //assume d can be empty int dend=0; while (arr[d][dend] != -1) { dend++; } //piling j = 0; while (arr[s][j] != -1) { arr[d][dend+j] = arr[s][j]; arr[s][j] = -1; j++; } } } } //print for (i = 0; i < n; i++) { printf("%d:", i); for (j = 0; j < n; j++) { if (arr[i][j] == -1) { printf("\n"); break; } printf(" %d", arr[i][j]); } } } 
    submitted by /u/JacksonSteel
    [link] [comments]

    Thread dump analysis API

    Posted: 19 Jan 2021 02:41 AM PST

    Dev on M1 Macs

    Posted: 19 Jan 2021 12:49 AM PST

    Since there's been a switch in ISA from x86 to ARM how will that affect software development? Will the different IDEs and libraries have to be ported over before the new Macs are a good choice for developers?

    submitted by /u/nikgeo25
    [link] [comments]

    Ballista: Distributed compute platform implemented in Rust using Apache Arrow

    Posted: 18 Jan 2021 02:44 PM PST

    The Big Sleep: Image generation from a text description using a free web app developed by Twitter user Adverb

    Posted: 18 Jan 2021 04:01 PM PST

    Hi,i have question about using python to solve math problems.

    Posted: 18 Jan 2021 08:50 AM PST

    I want to use python to do this problem. Am i in the true way?

    We investigated a program which is probably used as one component of a bigger password breaking algorithm. We determined that the program can input arbitrary N-bit queue and for actual N-bit input also the program output will be always N bits long. Additionally we noticed that the longer program input is, the longer will be the output calculating time. After performing some repeating tests we also determined that the program working time depends only and exactly on input length, not on the input itself.

    Finally we fixed some actual working times:

    -for N=10 - 10.576 seconds;

    -for N=20 - 11.087 seconds;

    -for N=25 - 13.544 seconds;

    -for N=30 - 27.442 seconds;

    -for N=35 - 1 minute 46.059 seconds;

    -for N=40 - 9 minutes 10.784 seconds.

    Task:

    a) Find the program working time for N=50.

    b) Please derive the mathematical formula using which is possible to calculate actual working time for arbitrary N.

    submitted by /u/That-Yogurtcloset-85
    [link] [comments]

    ¿Qué es la Inteligencia Artificial?

    Posted: 18 Jan 2021 02:20 PM PST

    SSH Help

    Posted: 18 Jan 2021 05:48 AM PST

    I have a Linux Machine, what's the best way to set it up for SSH so I can access it from my MacBook? I've always programmed on my MacBook but recently I had to switch to a Linux machine. However I was to be able to remotely access the files. Any help is appreciated.

    submitted by /u/Jay_Vitale
    [link] [comments]

    The Irony behind the Big O

    Posted: 18 Jan 2021 04:23 AM PST

    No comments:

    Post a Comment