• Breaking News

    Sunday, October 13, 2019

    programming portfolio Ask Programming

    programming portfolio Ask Programming


    programming portfolio

    Posted: 13 Oct 2019 07:53 PM PDT

    I have bunch of programs with me and I wanted to compile it and use as a portfolio when I apply for internship. What would you recommend me to use or do?

    submitted by /u/just-ignore-me-pls
    [link] [comments]

    What should i know before learning to code?

    Posted: 13 Oct 2019 08:44 AM PDT

    I would like to learn how to code or how to program in general, but i don't know what are the most important things to have in mind before doing so.

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

    What is the most intuitive way to set priority for task queue?

    Posted: 13 Oct 2019 01:18 PM PDT

    Hi! If I set priority=5 for task 1, and priority=-5 for task 2, it can mean that task 1 goes first, also it can mean task 2 goes first. So what is the most expected behaviour for queue of tasks?

    (left tasks go first)

    1. [-10, -5, 0, 5, 10]
    2. [10, 5, 0, -5, -10]
    3. [100, 10, 5, 2, 1, 0, 0, 0] (priority >= 0 only)
    4. [1, 2, 5, 10, 100, 0, 0, 0] (priority >= 0 only)
    5. another way?
    submitted by /u/lega911
    [link] [comments]

    how to do the same using Switch case

    Posted: 13 Oct 2019 05:01 PM PDT

    int marks = 65;

    if (marks < 50){ System.out.println("fail"); } else if (marks >= 50 && marks < 60){ System.out.println("D grade"); } else{ System.out.println("Invald!"); } 
    submitted by /u/7maw
    [link] [comments]

    Weighting Grades using OOP in C++

    Posted: 13 Oct 2019 02:22 PM PDT

    Hello, this one is silly, but I'm having some trouble understanding classes. How do I take the data to put it into the class? How do I build a function afterwards? I understand that the code will look similar and that once inside a class I won't need to preface it with a prefix because it is part of the class. For some reason, this is evading me so.

    CODE:

    .cpp file

    // Input

    // How many assignments per student?

    // The weight of the grades?

    // How many students?

    // Output

    // process the students weighted grades

    #include <iostream>

    #include <vector>

    using namespace std;

    void assignments(vector<int> grade, vector <float> weight, int stu);

    void gradeAssignment(vector<int> grade, vector <float> weight,int stu,int num);

    void weightAssignment(vector<int> grade, vector <float> weight,int stu,int num);

    void totalGrade(vector<int> grade, vector <float> weight,int stu,int num);

    // Here a new class is being created by being defined

    // Classes define the structure of an object

    class Student

    {

    public: // data member // represents object qualities // here it is a range represented by an integer int x; // declaring member function void printVal(); 

    };

    // member function definition

    // represents object abilities

    // I am still confused about this

    // I know it's a function, but what is the relationship and how's it different from what I've done up top?

    void Student::printVal()

    {

    cout << "Hello, I'm in printVal" << x; 

    }

    int main()

    {

    vector<int> grade; vector<float> weight; Student aStudent; aStudent.x = 3; aStudent.printVal(); // cout asks for the number of students and set it to a variable cout << "How many students? \\n"; // input goes into the variable, which is stu int stu; cin >> stu; assignments(grade, weight, stu); 

    }

    void assignments(vector<int> grade, vector <float> weight, int stu)

    {

    // declaring a vector of integers called grade // vectors can resize automatically when an element is added or removed // REMEMBER int cannot hold decimals. Floats can. // processes each student for (int i = 0; i < stu; i++) { //2nd user input goes into the variable, which is num //same as 1st user input cout << "Number of Assigments \\n"; int num; cin >> num; gradeAssignment (grade,weight,stu,num); } 

    }

    void gradeAssignment(vector<int> grade, vector <float> weight,int stu,int num)

    {

     // process assignments for (int i = 0; i < num; i++) { 

    grade.push_back(0);

    cout << "what is the grade for assigment "<< i + 1 << endl;

    //float x creates variable to input the grade

    float x;

    //inputs what user inputs into variable float x

    cin >> x;

    //inputs variable into array

    grade[i] = x;

    weightAssignment (grade,weight,stu,num);

     } 

    }

    void weightAssignment(vector<int> grade, vector <float> weight,int stu,int num)

    {

     // weight for ( int i = 0; i < num; i++) { 

    weight.push_back(0);

    cout << "what is the weight for assigment " << i + 1 << endl;

    float x;

    cin >> x;

    weight[i] = x;

    weight[i] = weight[i] / 100;

    weight[i] *= grade[i];

    cout << "weight grade result"<< weight[i] << endl;

    totalGrade (grade,weight,stu,num);

     } 

    }

    void totalGrade(vector<int> grade, vector <float> weight,int stu,int num)

    {

     float totalGrade = 0.0; for ( int i = 0; i < num; i++) { totalGrade += weight\[i\]; } cout <<totalGrade << endl; //giving out a letter grade if ( totalGrade >= 90) { cout<<"grade = A"; } else if (totalGrade >= 80 && totalGrade < 90) { cout<<"grade = B"; } else if (totalGrade >= 70 && totalGrade < 80) { cout <<"grade = C"; } else if (totalGrade >= 60 && totalGrade < 70) { cout<<"grade = D"; } else if (totalGrade < 60) { cout<<"grade = F"; } cout<< endl; cin.get(); 

    }

    .h file

    #include <iostream>

    #include <vector>

    using namespace std;

    // Here a new class is being created by being defined

    // Classes define the structure of an object

    class Student

    {

    public: // data member // represents object qualities // here it is a range represented by an integer int x; // declaring member function void printVal(); 

    };

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

    What is the best way to parse logs obtained by users on the front end?

    Posted: 13 Oct 2019 02:11 PM PDT

    I am open to any front end/back end suggestions for this task. I have a front end(html and css for proof of concept) that allows the user to upload a txt or csv file. On the back end, I have python taking in the logs and parsing them for certain keywords. However, python is not portable. What is the best way to take this data in on the front end, then parse it on the back end? I am wanting the user to be able to just go to our website and upload the logs, but with my current method the user will have to install python, then clone my branch to get the application running. Thank you!

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

    Random number generating in C++

    Posted: 13 Oct 2019 01:18 PM PDT

    So I am trying to generate a random number in my program so that the output is not the same every time it is run. I am using

    srand(time(NULL));

    in conjunction with

    rand()

    to generate random numbers but (I am printing a call to rand() at the end of my program) this is the output after I run a for loop in my terminal

    for i in `seq 1 100`; do ./docusign X:3 Y:1; done

    Y 2090094351 Y 2090094351 Y 2090094351 Y 2090094351 Y 2090094351 Y 2090094351 Y 2090094351 Y 2090094351 Y 2090094351 Y 2090094351 Y 2090094351 Y 2090094351 Y 2090094351 Y 2090094351 Y 2090094351 Y 2090094351 Y 2090094351 Y 2090094351 Y 2090094351 ...

    The program is supposed to output "X" and "Y" with specified weights. However, the same random number is being printed every time i run the program even though I am seeding it with time(null) I don't know why this is happening. Thanks

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

    What is the proper filename extension for a core dump file?

    Posted: 13 Oct 2019 12:44 PM PDT

    Specifically, and ELF core dump file. Are there any conventions around this?

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

    Can you suggest an algorithm to find the sequence in the this programming challenge?

    Posted: 13 Oct 2019 11:10 AM PDT

    We are given X and Y, Where X and Y are respectively the sum and product of all the numbers(+ve integers) in the sequence. Task is to write an program that find the sequence/set of positive integers that satisfy the above.

    Example 1: X=5, Y=5
    The only sequence is { 5 }

    Example 2: X=5, Y=6
    The sequence is { 2, 3 }
    (Here 2 + 3 = 5 = X and 2 x 3 = 6 = Y)

    How do I implement this in algorithm/program?

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

    What language should I learn for my project?

    Posted: 13 Oct 2019 10:53 AM PDT

    Hey guys, I have an idea for a program, but I don't have any experience with programming and don't know which language is suitable for this project.

    My idea is A program that works like a dictionary reader and helps me create cards for Anki SRS. I've found some dictionary files in JSON.

    I saw some videos about Python(wich Anki seems to be based on) but didn't learn anything yet.

    Would I be able to develop this program with Python? And what should I Learn to do it?

    Sorry for the bad English (I'm Brazilian) and thanks!

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

    What is the advantages / disadvantages of class-oriented inheritance vs. prototype-oriented inheritance.

    Posted: 13 Oct 2019 06:53 AM PDT

    UI Testing on Node Applications.

    Posted: 13 Oct 2019 10:37 AM PDT

    Can someone show me what us the best tool to do UI testing for my web application. It is built with vue and node.js? I am new to all this testing stuff.

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

    How can I make automated videos from data of real estate I have in Mass? Animated Slide Show with Voice Over from Data into a Template

    Posted: 13 Oct 2019 08:16 AM PDT

    I want to generate a descriptive slide show video (In 4K) ex: https://www.youtube.com/watch?v=rZM5jaU7YyE what this guy has done for Watches I want to do real estate properties list I have. I have properties details, photos, some have walkthrough videos too. I want to attach them to make a slideshow kind of video where the text is spoken as audio.

    What kind of libraries I can use to work this out?

    https://rocketium.com/is/quick-and-easy-bulk-video-maker-in-batches/ I saw this but it seems bit costlier.

    I have to make more than 1000 videos. So any ready made cheap solution? Or something where I can hire a dev and get it done?

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

    Anyone got any tips on learning reactive programming with TypeScript and RxJS?

    Posted: 13 Oct 2019 07:18 AM PDT

    I mean I know what it is and know the concepts, and like the idea behind RxJS, but the whole reactive paradigm of "do everything with observers" is a little weird to get used to.

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

    How do people justify the immorality of writing life support software (pacemakers, hospital machines, etc) in C instead of Rust?

    Posted: 13 Oct 2019 03:07 PM PDT

    You are considered a high potential engineer. Now what?

    Posted: 13 Oct 2019 05:07 AM PDT

    Hello

    I have been told by many recruiters/head hunters and managers at companies I am a high potential software engineer. Which is why I have quite some responsabilities at every company where I work (take strategic decisions, involvement in software architecture, ...). I speak six languages fluently, have quite an unusual technical backgound and am not the worst engineer around. Although IMO I still have many things to learn.

    You are considered as such, but what is next? Are you actually expected to grow in the company to the point you one day become CTO/board member? Should you change companies and try to get in the top firms? Why does being a high potential matter?

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

    [C language] getchar() getting skipped and how I can mix integers and characters in a scanf/getchar?

    Posted: 13 Oct 2019 03:58 AM PDT

    Howdy, I'm very new to programming - still my first month in college - and I was given an assignment to write a menu-like program in C, with a few specifications: I need to choose an option and keep track of the previous option, to do that I have to use scanf for the current option, and getchar for the previous option.

    But for some reason getchar() is being skipped by the program, this doesn't happen if I use a scanf in its place, but that's not a possibility.

    Also I need my very first scanf and eventualy the getchar() to be able to read both numbers (1 to 4) and characters (s, t, f), how can I do this?

    The code is in portuguese so if there's need for any translation, just ask

    Cheers

    #include <stdio.h>

    int main()

    {

    int opcao; int opcaoAnt= 0; int temp1= 0; int temp2= 0; char ch; do { printf("\\t\\tMENU para broncos\\n\\n"); printf("1 – A opção que escolheu foi 1\\n"); printf("2 – Escolheu a segunda opção\\n"); printf("3 – Agora escreveu um três\\n"); printf("4 – A tecla que carregou foi um quatro\\n"); printf("s – Escreveu um 's'\\n"); printf("t – Esta foi a opção do 't'\\n"); printf("f – Sair\\n\\n"); printf("Escolha uma opção: "); /\*printf("INICIO %d %d\\n\\n", temp1, temp2);\*/ scanf("%d", &opcao); switch(opcao) { 

    case 1: if(opcaoAnt==0)

    {

    temp1=0, temp2=1;

    }

    else

    {

    temp1= temp2;

    temp2= opcao;

    }

    printf("\n1 – A opção que escolheu foi 1\n"); break;

    case 2: if(opcaoAnt==0)

    {

    temp1=0, temp2=2;

    }

    else

    {

    temp1= temp2;

    temp2= opcao;

    }

    printf("\n2 – Escolheu a segunda opção\n"); break;

    case 3: if(opcaoAnt==0)

    {

    temp1=0, temp2=3;

    }

    else

    {

    temp1= temp2;

    temp2= opcao;

    }

    printf("\n3 – Agora escreveu um três\n"); break;

    case 4: if(opcaoAnt==0)

    {

    temp1=0, temp2=4;

    }

    else

    {

    temp1= temp2;

    temp2= opcao;

    }

    printf("\n4 – A tecla que carregou foi um quatro\n"); break;

    case 's': if(opcaoAnt==0)

    {

    temp1=0, temp2='s';

    }

    else

    {

    temp1= temp2;

    temp2= opcao;

    }

    printf("\ns – Escreveu um 's'\n"); break;

    case 't': if(opcaoAnt==0)

    {

    temp1=0, temp2='t';

    }

    else

    {

    temp1= temp2;

    temp2= opcao;

    }

    printf("\nt – Esta foi a opção do 't'\n"); break;

    case 'f': if(opcaoAnt==0)

    {

    temp1=0, temp2='f';

    }

    else

    {

    temp1= temp2;

    temp2= opcao;

    }

    printf("\nf – Sair\n\n"); break;

     } 

    printf("\nQual foi a opção que escolheu antes desta? ");

    scanf("%d", &opcaoAnt); /*if I do "opcaoAnt= getchar() here", it gets skipped*/

    if(temp1==opcaoAnt)

    {

    printf("Muito bem\n\n");

    temp1= temp2;

    opcaoAnt= temp1;

    }

    else

    {

    printf("Falhou! A opção era a %d.\n\n", temp1);

    opcaoAnt='f';

    }

    } while(opcaoAnt!='f'); { } 

    }

    submitted by /u/idk-anything
    [link] [comments]

    How do I get into programming with networking

    Posted: 13 Oct 2019 03:26 AM PDT

    My basic understanding with the internet is that your computer uses your network card to connect to it and communicate. What I want to know is how much I can "control" the network card (So how low-level can you get), how to do that, and links to any useful resources in the subject. Thanks in advance.

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

    How do I turn a ratio into a percentage?

    Posted: 12 Oct 2019 11:20 PM PDT

    Hi guys!

    I need to generate say result x with a weight of 3 and result y with a weight of 1. Intuitively in my head, I know that it is a 75% probability that x will appear and a 25% that y will appear but if I divide 1/3 I get 0.33 not 0.75. It's weird though, if I have a ratio of 5:10 and I divide them I get 0.5 which makes sense. Is there a way to generate the results programmatically(i.e. without using probability percents)?

    Thank you!

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

    No comments:

    Post a Comment