• Breaking News

    Tuesday, December 3, 2019

    How to watch software developers at work? learn programming

    How to watch software developers at work? learn programming


    How to watch software developers at work?

    Posted: 02 Dec 2019 02:38 PM PST

    Is there a video or series, that show in details actual development work of a developer or team of software developers, who are doing a middle-size project from scratch?

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

    Learning R for research purposes

    Posted: 02 Dec 2019 06:03 PM PST

    Hey all,

    I'm a medical student that works in a lab involving lots of data that we receive from imaging studies. Our projects are getting to the point where excel will no longer really cut it and for some time we have been getting help w/ data stuff from other grad students etc. but I want to learn some R (mostly b/c by professor told me I should) so I can further advance some of this work. Having no background of programming outside of AP CS in high school (java) I am not sure exactly where to start. I've messed around and stuff and downloaded things like RStudio but there's a plethora of learning resources out there... do you have any suggestions for what resource would be right for me? I see things like datacamp but it seems kinda expensive and not for me given that it has no single course purchase option.

    Thanks,

    submitted by /u/20MD20
    [link] [comments]

    Hybrid program with OpenMP and MPI slower than just MPI

    Posted: 02 Dec 2019 08:43 PM PST

    when i run the program with 4 processes on mpirun and then set 2 threads, is slower than when i set just 1 thread.

    the code basically searches on two txt of 1gb and return the combinations so in theory with 4 processes and 2 threads it would be a lot faster to search, but this is not happening

    dont know if in this case it will be slower, or im making something wrong.

    if someone could look at the code and help me i would be glad

    #include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> #include <pthread.h> #include <unistd.h> #include <time.h> #include "mpi.h" #include <omp.h> #define TAM 1024*1024*1024 int NUMTHREAD; //int qnt[24]; char comb[24][5]; int maiores[5]; int nOpenMP; //int quantidade2[5]; int * topDown(int start); int * topDown2(int start, int maiores[]); void swap(); void gerar(); void MostraMaiores(int a[],int t); int main(int argc,char *argv[]) { int qnt[24]; int quant[24]; int quantmaior[5]; int qntmaior[5]; int i; for(i = 0; i<5; i++){ maiores[i]=0; quantmaior[i]=0; qntmaior[i]=0; } for(i=0;i<24;i++){ quant[i]=0; qnt[i]=0; } //se n�o for informado o N de Threads cria s� 1 // NUMTHREAD = 1; // if (argv[1] > 0) // { // NUMTHREAD = atoi(argv[1]); // } // printf("criando %d Threads \n \n",NUMTHREAD); char str[] = "AGTC"; int n = strlen(str); int j = 0; gerar(str, 0, (n - 1)); int myid, numprocs; MPI_Status status; int offset; MPI_Init(&argc,&argv); MPI_Comm_rank(MPI_COMM_WORLD, &myid); MPI_Comm_size(MPI_COMM_WORLD,&numprocs); offset = TAM/(numprocs-1); NUMTHREAD = numprocs-1; if (myid == 0){ printf("Numero de threads no OPENMP\n"); scanf("%d",&nOpenMP); printf("%d\n", nOpenMP); for(i=1;i< numprocs;i++){ MPI_Send(&nOpenMP, 1, MPI_INT, i, 4, MPI_COMM_WORLD); } for(i=1;i< numprocs;i++){ MPI_Recv(&quant, 24, MPI_INT, i, 4, MPI_COMM_WORLD, &status); int y; for (y=0;y<24;y++){ int f = 0; f=*((int*)quant+y); qnt[y]=qnt[y]+f; } } MostraMaiores(qnt,24); for(i=1;i< numprocs;i++){ MPI_Send(maiores, 5, MPI_INT, i, 4, MPI_COMM_WORLD); } for(i=1;i< numprocs;i++){ MPI_Recv(&quantmaior, 5, MPI_INT, i, 4, MPI_COMM_WORLD, &status); int y; for (y=0;y<5;y++){ int f = 0; f=*((int*)quantmaior+y); qntmaior[y]=f+qntmaior[y]; } } for (j = 0; j < 5; j++) { printf("\n Sequencia %s quantidade dna1 %d quantidade dna2 %d\n",comb[maiores[j]], qnt[maiores[j]],qntmaior[j] ); } printf("\n\n\n############\n\n\n"); }else{ int nummp; MPI_Recv(&nummp, 1, MPI_INT, 0, 4, MPI_COMM_WORLD, &status); nOpenMP = nummp; int *quan; int *quan1; int x = offset*(myid-1); quan = topDown(x); MPI_Send(quan, 24, MPI_INT, 0, 4, MPI_COMM_WORLD); int biggest[5]; MPI_Recv(&biggest, 5, MPI_INT, 0, 4, MPI_COMM_WORLD, &status); quan1 = topDown2(x,biggest); MPI_Send(quan1, 5, MPI_INT, 0, 4, MPI_COMM_WORLD); } MPI_Finalize(); } int * topDown(int start) { int p = start; int num = 0; FILE *file; FILE *file2; file = fopen("DNA1.txt","r"); file2 = fopen("DNA2.txt","r"); int num1, qnt1[24]; char c,c1, buf[4], buf1[4]; static int quantidade[24]; fseek(file, p, SEEK_SET); int j = 0; for (j = 0; j < 24; j++) { qnt1[j]=0; } c=getc(file); buf[0] = c; c=getc(file); buf[1] = c; c=getc(file); buf[2] = c; int i; int x = p; omp_set_num_threads (nOpenMP); #pragma omp parallel private(c,num1,buf,i,x) { // count pra aquela parte de baixo la que mostra e pa int id = omp_get_thread_num(); int NThread = omp_get_num_threads(); int x = id* ((TAM/NUMTHREAD)/NThread)+p; int end = (id+1)* ((TAM/NUMTHREAD)/NThread)+p; if (id==NThread-1){ end=(TAM/NUMTHREAD+p); } printf("\n"); while(x < (end)&&((c=getc(file)) != EOF)) { buf[3] = c; //#pragma omp parallel for for ( i = 0; i <24; i++){ if ((comb[i][0] == buf[0]) && (comb[i][1] == buf[1]) && (comb[i][2] == buf[2]) && (comb[i][3]== buf[3])) { num1 = num1 + 1; qnt1[i] = qnt1[i] + 1; //if (count == 3){printf("\n"); count =0;} //printf("| %d Achou %s na posicao %d ",omp_get_thread_num(), comb[i], x); //PRA TESTAR QUAL THREAD ACHOU A COMB } } buf[0] = buf[1]; buf[1] = buf[2]; buf[2] = buf[3]; x++; } //#pragma omp taskwait num = num + num1; } for (i = 0; i < 24; i++) { quantidade[i] = quantidade[i] + qnt1[i]; } fclose(file); fclose(file2); return quantidade; } int * topDown2(int start,int maiores[]) { int p = start; FILE *file; file = fopen("DNA2.txt","r"); int i,j, num1, qnt1[5]; static int quantidade1[5]; for (j = 0; j < 5; j++) { qnt1[j]=0; } char c, buf[4]; fseek(file, p, SEEK_SET); c=getc(file); buf[0] = c; c=getc(file); buf[1] = c; c=getc(file); buf[2] = c; int x = p; omp_set_num_threads (nOpenMP); #pragma omp parallel private(c,num1,buf,i,x) { // count pra aquela parte de baixo la que mostra e pa int id = omp_get_thread_num(); int NThread = omp_get_num_threads(); int x = id* ((TAM/NUMTHREAD)/NThread)+p; int end = (id+1)* ((TAM/NUMTHREAD)/NThread)+p; if (id==NThread-1){ end=(TAM/NUMTHREAD+p); } printf("\n"); while(x < (end)&&((c=getc(file)) != EOF)) { buf[3] = c; for ( i = 0; i <5; i++) { if ((comb[maiores[i]][0] == buf[0]) && (comb[maiores[i]][1] == buf[1]) && (comb[maiores[i]][2] == buf[2]) && (comb[maiores[i]][3] == buf[3])) { qnt1[i] = qnt1[i] + 1; } } buf[0] = buf[1]; buf[1] = buf[2]; buf[2] = buf[3]; x++; } } for (i = 0; i < 5; i++) { quantidade1[i] = quantidade1[i] + qnt1[i]; } fclose(file); return quantidade1; } void gerar(char* a, int l, int r) { int i; static int k; if (l == r) { strcpy(comb[k++],a); } else { for (i = l; i <= r; i++) { swap((a + l), (a + i)); gerar(a, l + 1, r); swap((a + l), (a + i)); } } } void swap(char* x, char* y) { char temp; temp = *x; *x = *y; *y = temp; } //mostra os maiores void MostraMaiores(int a[],int t) { int i, y, y2, y3, y4, y5, x1, x2, x3, x4, x5; x1 = x2 = x3 = x4 = x5 = y4 = y3 = y = y2 = y5 = 0; for (i = 0; i < 24 ; i ++) { if (a[i] > y) { y5 = y4; x5 = x4; y4 = y3; x4 = x3; y3 = y2; x3 = x2; y2 = y; x2 = x1; y = a[i]; x1 = i; } else if (a[i] > y2) { y5 = y4; x5 = x4; y4 = y3; x4 = x3; y3 = y2; x3 = x2; y2 = a[i]; x2 = i; } else if (a[i] > y3) { y5 = y4; x5 = x4; y4 = y3; x4 = x3; y3 = a[i]; x3 = i; } else if(a[i] > y4) { y5 = y4; x5 = x4; y4 = a[i]; x4 = i; } else if(a[i] > y5) { y5 = a[i]; x5 = i; } } maiores[0] = x1; maiores[1] = x2; maiores[2] = x3; maiores[3] = x4; maiores[4] = x5; printf("5 maiores s�o %s %s %s %s %s\n", comb[x1],comb[x2] ,comb[x3] ,comb[x4] , comb[x5]); } 
    submitted by /u/Ferkael7
    [link] [comments]

    Programming languages, free courses, and skills for robotics?

    Posted: 02 Dec 2019 02:46 PM PST

    I'm doing a mechatronics degree, and am on a long holiday. I'd like to learn some programming languages and skills, to help gain some practical skills and be ahead of class.

    I have moderate experience in Python and C++, and am aware that C++ is a lot more useful in robotics applications. I'd like a full, free online course (with things like tests and even an exam if possible) that takes me from a moderate level, to fairly advanced. I'd prefer if it were to be a bit more robotics related, such as if it involved arduinos.

    submitted by /u/Comprehensive-Heat
    [link] [comments]

    Where can I store my code from my introduction course exercise code?

    Posted: 02 Dec 2019 01:57 PM PST

    I want to be able to save the answers i write to exercises so that I can go back and recall them and read comments about what I did wrong for my college book exercises. Is there any good way to do this?

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

    Good text book on introductory data structures and algorithms?

    Posted: 02 Dec 2019 09:23 PM PST

    What is a good textbook on introductory data structures and algorithms, I want to try Introduction to Algorithms by Cormen but I feel that the mathematics in it may be a little above my level. (I currently am taking a pre-calculus course).

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

    How does app like stellarium and star atlas show the sky?

    Posted: 02 Dec 2019 08:47 PM PST

    I didn't exactly understand how they did it?

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

    Are there any good courses on certificates?

    Posted: 02 Dec 2019 08:38 PM PST

    I would like to learn more about public key infrastructure including all about public and private certificates, certificate attributes, self signing concepts, signing requests, certificate authorities, certificate tree and chaining concepts.

    I'd also like some hands on experience with openssl.

    Does Reddit know of any courses which encompass all of this? Don't mind how much it costs - just looking for the best one out there. At the moment I am looking at a couple of courses on Udemy, but they seem incomplete.

    Thanks!

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

    Pls Help Me with My project at school

    Posted: 03 Dec 2019 12:12 AM PST

    I got a problem on my project i can't figure out how this sorted names don't come with there corresponding grades

    pls check out this photos first:

    https://imgur.com/a/DxZDeOi

    #include <iostream> #include <iomanip> #include <algorithm> #include <string> using namespace std; int main() { string Names[13]={" ", "Gabijan, Smith B.", "Gabijan, Smith B.", "Gabijan, Smith B.", "Gabijan, Smith B.", "Gabijan, Smith B.", "Ipanag, Darny P.", "Abellanosa, Loise Julianna V.", "Capili, Kyla Beatrice C.", "Calapardo, Shaina Angela", "Bazon, Charlyn F.", "Geganto, Benedict V."}; float Written[13]={0, 68, 79, 89, 79, 90, 86, 71, 91, 91, 87,97}; float PT[13]={0, 65, 65, 78, 91, 82, 69, 60, 65, 65, 79, 97}; float QA[13]={0, 80, 81, 82, 78, 85, 81, 91, 65, 65, 87, 97}; float FinalGrade[13]; string Remarks[13]; cout<<"Students Name"<<setw(32)<<"WW"<<setw(10)<<"PT"<<setw(10)<<"QA"<<setw(16)<<"Final Grade"<<setw(14)<<"Remarks"<<endl; for (int a=1; a<=11; a++) { int j = 0; bool swap = true; string temp; while (swap) { swap = false; j++; for (int l = 0; l < 12 - j; l++) { if (Names[l] > Names[l + 1]) { temp = Names[l]; Names[l] = Names[l + 1]; Names[l + 1] = temp; swap = true; } } } Written[a]=Written[a]*0.20; PT[a]=PT[a]*0.60; QA[a]=QA[a]*0.20; FinalGrade[a]=Written[a]+PT[a]+QA[a]; if (FinalGrade[a]<=75) { Remarks[a]="Failed"; } else { if (FinalGrade[a]>=75) { Remarks[a]="Passed"; } } cout<<setw(2)<<left<<a<<"."<<setw(40)<<Names[a]<<setprecision(4)<<setw(10)<<Written[a]<<setprecision(4)<<setw(10)<<PT[a]<<setprecision(4)<<setw(10)<<QA[a]<<setprecision(4)<<setw(10)<<FinalGrade[a]<<"\t"<<Remarks[a]<<endl; } return 0; } 
    submitted by /u/SGabZ
    [link] [comments]

    CSS/HTML beginner help with fixed element on page.

    Posted: 03 Dec 2019 12:08 AM PST

    I'm trying to create a fixed contact me bar on a page with an image on it.

    My thoughts are to create a div container, and in that put link "contact me" and an image. I float them left and right, but i cannot control the length of the bar on the page. I would like to increase the length and width of the bar (div container "NT").

    Screenshot of page: https://i.imgur.com/Kgb3Zzo.png

    HTML code:

     <div class="NT"> <a href="X">Contact Me</a> <img src="face.png" style="widows: 100px; height:100px;"> </div> 

    CSS code:

    .NT{ position:fixed; top: 600px; background-color:#333; text-align:center; padding:10px; } .NT img{ float:right; box-sizing:border-box; width:40%; } .NT a{ color:white; font: 20px bold; width:60%; float:left; box-sizing:border-box; padding-top:30px; } 

    Thanks!

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

    The coin problem: How can I modify this recursive solution to work?

    Posted: 02 Dec 2019 04:34 PM PST

    I'm trying to tackle the coin problem to get a better understanding of recursion. For that reason, I'm ignoring the well-known dynamic programming approach for now.

    In short, I need to figure the amount of combinations of coins I can use to add up to a desired amount (first parameter of the function). I've hardcoded the input data (values of coins).

    My strategy: To calculate the number of combinations required to achieve a certain amount, I just need to sum up the the number of combinations required to achieve 5 cents away from that amount, 2 cents away from that amount, and 1 cent away from that amount, and just let the function recurse:

    coins = [1,2,5] def change(self, amount: int) -> int: if amount == 0: return 1 if amount < 0: return 0 return self.change(amount - 5, coins) + self.change(amount-2, coins) + self.change(amount-1, coins) 

    The obvious issue with this recursion is that it counts permutations rather than combinations. In other words, it's counting the solutions [1,2,2], [2,1,2], and [2,2,1], when all three of these should only count as 1.

    I'm still trying to figure recursion out. Is there a relatively simple way to to turn this into a "combination" counting algorithm, rather than a "permutation" counting algorithm?

    This guy/gal on leetcode seems to have figured it out, but I can't quite understand why what they did works: https://leetcode.com/problems/coin-change-2/discuss/99209/Python-Recursive-Solution-(Slow)

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

    "All modern chatting interfaces, without exception, implement a hierarchical and a not-chronological schema for chat"

    Posted: 02 Dec 2019 11:46 PM PST

    I was searching for SO answers and came across this:

    https://dba.stackexchange.com/questions/192172/how-to-create-a-flexible-table-schema-for-storing-messages-from-different-chats

    Can someone explain what are the benefits of using a hierarchy schema over a chronological are?

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

    Pong (Codeskulptor)-Ball seems to glide sometimes when in contact with left paddle

    Posted: 02 Dec 2019 11:46 PM PST

    Hi guys!! So I've been doing the Rice University course recently, and for some reason sometimes when the ball comes in contact with the left paddle, it vibrates and passes through the paddle. I've been trying to debug it for hours but to no avail. It would be much appreciated if you guys could take a look. Thanks!

    Here is the code(not pretty): http://www.codeskulptor.org/#user46_WcEqCCXV38_4.py

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

    Huawei intelligent video system Exam Outline

    Posted: 02 Dec 2019 11:43 PM PST

    Huawei intelligent video system Exam Outline

    Huawei has released the certification of the video surveillance system. As a key project of Huawei Smart City, a complete HCIA-HCIP-HCIE certification system will be deployed by Huawei IVS product line in the future.

    https://forum.huawei.com/enterprise/en/huawei-hcs-field-ivs-exam-outline/thread/585988-887

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

    Open Explorer.exe with secondary Windows profile on button's click. VB.NET

    Posted: 02 Dec 2019 11:32 PM PST

    Hi guys, i'm stuck on code with a web application's button for open Explorer.exe at a specific folder...

    Something like:

    Try Dim processInfo As New ProcessStarInfo("c:\windows\explorer.exe") processInfo.UserName = "mysecondUsername" processInfo.Password = ConvertToSecureString("password") processInfo.Domain = "myDomain" processInfo.LoadUserProfile = True processInfo.UseShellExecute = False processInfo.WorkingDirectory = Environ("‪C:\folder\folder") Process.Start(processInfo) Catch ex Exception Throw ex End Try 

    If i try run it, on che button click it didn't appear anything.

    If i try run it with my primary profile it opens the Explorer….

    Help please!!

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

    Trying to learn at work...with a twist.

    Posted: 02 Dec 2019 05:26 PM PST

    So I'm lucky in that my new job often has a lot of downtime, and I plan on utilizing it -somehow- to learn programming or programming adjacent things. The problem is, the computers we use can only be used for business related needs (they might make an exception for education using resources they provide, but I don't really want to chance it) and we're not allowed to access any electronic devices near our computer. So I currently have a book and a notebook that I'm trying to learn programming off of, but it seems extremely inefficient to write programs on paper and then come home and try to compile them as a major form of education. Is there anything that I can do during that downtime that can help with my programming education, even if it's not learning it directly?

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

    Feedback for my first npm package written in NodeJS - google-sheets-logger

    Posted: 02 Dec 2019 11:15 PM PST

    Created a simple Node.js module for quick & easy data logging between your program in private Google Sheets.

    npm package link: https://www.npmjs.com/package/google-sheets-logger

    Github link: https://github.com/arghyadeep-k/google-sheets-logger

    All feedback & suggestions are welcome.

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

    Question about gitflow work flow?

    Posted: 02 Dec 2019 11:01 PM PST

    1. Do you delete a feature branch once you merge it into development?

    2. Do you delete release or staging branches once you merge into the master? Also staging and release branches are the same right?

    On another post someone suggest I create and epic->feature->task branch set. I'm guessing I would merge into development once an epic was done, keep the epic, and then delete the feature and task branches?

    Sorry, I've never managed major projects and am just use to having a development and master branch. Please go on rants or add any information I need. Thank you.

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

    How could I return a certain object based on what its ID is?

    Posted: 02 Dec 2019 04:36 PM PST

    Hey. I'm creating a game within Java and i'm currently implementing the amount of lives the player has. At the start they have 5 (this is shown as a frog on the screen, each frog = 1 live, lose a life = one frog is removed from the screen).

    I've created a class called Life which takes in the image for the life and its x and y positions. If the player dies, a frog is supposed to be removed from the screen.

    I've managed to do this by creating 5 new Life objects and giving them different names i.e. life1, life2 etc. and then removing them using their given names during the object instantiation, but it's very inefficient as i'm just chaining if statements together.

    I was thinking of giving each new frog an ID within the constructor from like 1 to 5, and then having a while loop which will remove the lives if the player dies (which would be the condition) and a counter decrementing from 5 to 1, however, for this to work, I would somehow need to get the separate Life objects.

    So is it possible to create a method such as this? (written in pseudocode, i'm not entirely sure how you would specify this in actual code)

    public Life getLifeFromID(int id) { return Life with id from the argument } 

    Appreciate any response

    Thanks!

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

    Inheritance in Object Oriented Programming

    Posted: 02 Dec 2019 12:25 PM PST

    Hello Guys,

    I've been trying to get wrap my head around OOP concepts and I find it difficult to imagine how inherited objects are constucted.

    Take the following code for example:

    class Person { protected String name; protected int yearOfBirth; protected String address; public Person(String name, int yearOfBirth, String address) { this.name = name; this.yearOfBirth = yearOfBirth; this.address = address; } // getters and setters } class Employee extends Person { protected Date startDate; protected Long salary; public Employee(String name, int yearOfBirth, String address, Date startDate, Long salary) { super(name, yearOfBirth, address); // invoking a constructor of the superclass this.startDate = startDate; this.salary = salary; } // getters and setters } 

    Here we use "super()" which invokes the superclass' constructor and this is where I get confused. I learned when I invoke a class constructor it is going to create an object for me. So here, because I invoked Person's constructor with super(), I created an object "inside" the Employee object (first figure in the link below)? Or is more like the second or third figures?

    Figures here: https://imgur.com/a/sgzowYN

    I hope it is clear what I'm trying to figure out here.

    Thank you in advance!

    Cheers

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

    HumbleBundle eBooks from NoStarchPress (Python, Haskell, SQL)

    Posted: 02 Dec 2019 02:33 PM PST

    The HumbleBundle includes:

    • Learn You A Haskell for Great Good!: A Beginner's Guide by Miran Lipovača
    • Impractical Python Projects: Playful Programming Activities to Make You Smarter by Lee Vaughan
    • Python Crash Course by Eric Matthes
    • Practical SQL: A Beginner's Guide to Storytelling with Data by Anthony DeBarros

    You can get the whole bundle for 15 dollars.

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

    Programmer may I ask: What kind of data change every day and have website about it.

    Posted: 02 Dec 2019 09:26 PM PST

    I'm trying to combine data from 2 different sources and create useful data out of them.

    Tks you all.

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

    Phaser 3 -- I can't move left and right while also falling

    Posted: 02 Dec 2019 05:25 PM PST

    I need help figuring out how to get my sprite to move left and right as it falls because of the built-in gravity. I don't know why but whenever I try to use the cursor function to move left and right I can't get any input to the sprite.

    Below is a link showing my current code:

    https://phaser.discourse.group/t/moving-with-gravity/4454

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

    Simple CRUD app in MS Access?

    Posted: 02 Dec 2019 08:58 PM PST

    I have to maintain a client list, which will change monthly (clients leave or join). This is tedious to maintain in excel and want to put together a more controlled process within MS Access. Has anyone done something similar and can provide some insight?

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

    No comments:

    Post a Comment