• Breaking News

    Thursday, June 24, 2021

    Scheduling Heuristic Algorithms Computer Science

    Scheduling Heuristic Algorithms Computer Science


    Scheduling Heuristic Algorithms

    Posted: 23 Jun 2021 09:37 PM PDT

    Currently doing some research on scheduling heuristic algorithms. HASA seems to have the best performance in regard to task completion span. overall but I want to ask you guys if there are better scheduling algorithms out there.

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

    Software development is a creative process; an original masterpiece not a paint by numbers

    Posted: 24 Jun 2021 01:06 AM PDT

    $102M to Continue Building the Next Web, Together

    Posted: 24 Jun 2021 03:40 AM PDT

    Boolean expression data structures

    Posted: 24 Jun 2021 02:57 AM PDT

    I would like to write a program which compiles boolean expressions given at runtime, allowing later evaluation. The expressions can contain numeric and boolean varibles/constants and the following operators: NOT, AND, OR, LT, GT, LTE, GTE and EQ. For example: given a string "(A < B) AND C" the program produces a function f(A, B, C) which evaluates the expression binding the varibles to the parameters, so f(A=10, B=20, C=true) = true. I see two possible solutions:

    • Represent the expression as a tree, in which the leaves are the variables/constants and the inner nodes are the operators.
    • Generate a finite state machine which read the variables from a stack and evaluates the expression.

    Are there any more sophisticated algorithms and data structures which can solve more efficiently this kind of problems?

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

    Top VS Code Extensions for Application Security

    Posted: 24 Jun 2021 01:08 AM PDT

    Why doesn't the output match the expected one when computing the standard deviation in CPP?

    Posted: 23 Jun 2021 08:16 PM PDT

    description and sample:

    https://imgur.com/a/Vsc9Lp7

    here only code for girls.txt

    #include<iostream> #include<fstream> #include<cctype> #include<iomanip> #include<cmath> #include<sstream> using namespace std; string tolowercase(string s){ for(int i=0;i<s.length();i++){ s[i]=tolower(s[i]); } return s; } int isInArray(string arr[],string target){ for(int i=0;i<100;i++){ stringstream ss; string name; ss<<arr[i]; ss>>name; if(tolowercase(name)==tolowercase(target)){ return i+1; } } return -1; } string namings(string s){ stringstream ss; ss<<s; string str,str2; ss>>str>>str2; return str2; } int main(){ string girls[100]; fstream p("girls.txt"); int i=0; while(p>>girls[i]){ string temp; p>>temp; girls[i]+=" "+temp; i++; } p.close(); while(1){ cout<<"(If you don't want to search name, please input exit!)\n"; cout<<"Enter name: "; string name; cin>>name; if(name=="exit"){ break; } cout<<endl; int index=isInArray(girls,name); if(index==-1){ cout<<name<<" is not ranked among the top 100 girl names.\n\n"; }else{ cout<<name<<" is ranked "<<index<<" in popularity among girls with "<<namings(girls[index-1])<<" namings.\n"; //here start computing standard deviation double u; double sum=0; for(int i=0;i<10;i++){ sum+=stod(namings(girls[index-1+i+1])); } u=sum/10; sum=0; for(int i=0;i<10;i++){ sum+=(stod(namings(girls[index-1+i+1]))-u)*(stod(namings(girls[index-1+i+1]))-u); } double sd=sqrt(sum/10); cout<<"Standard Deviation of the 10 list below this rank : "<<sd<<endl; cout<<endl; } } return 0; } 

    girls.txt

    Mary 3196385 Patricia 1558407 Jennifer 1468377 Linda 1448303 Elizabeth 1420377 Barbara 1397635 Susan 1103569 Jessica 1046322 Sarah 991910 Karen 986057 Nancy 966867 Lisa 965015 Betty 924629 Margaret 918541 Sandra 873509 Ashley 849297 Kimberly 839796 Emily 830999 Donna 822330 Michelle 812335 Dorothy 811392 Carol 806170 Amanda 773199 Melissa 753994 Deborah 740019 Stephanie 738523 Rebecca 729630 Sharon 720826 Laura 718006 Cynthia 705717 Kathleen 686217 Amy 681397 Shirley 663452 Angela 658968 Helen 618563 Anna 618367 Brenda 606291 Pamela 592696 Nicole 589434 Emma 580610 Samantha 578986 Katherine 571574 Christine 561161 Debra 548280 Rachel 546153 Catherine 542748 Carolyn 540963 Janet 539224 Ruth 538629 Maria 529342 Heather 524166 Diane 515183 Virginia 515088 Julie 506594 Joyce 499340 Victoria 485786 Olivia 481364 Kelly 471621 Christina 471106 Lauren 470902 Joan 467459 Evelyn 461952 Judith 449805 Megan 437647 Cheryl 436882 Andrea 436126 Hannah 431117 Martha 426247 Jacqueline 420505 Frances 414289 Gloria 408565 Ann 407374 Teresa 404253 Kathryn 402613 Sara 400884 Janice 399546 Jean 399416 Alice 396362 Madison 393297 Doris 383158 Tyler 381738 Julia 380836 Judy 377815 Grace 377678 Denise 371269 Amber 370577 Marilyn 369781 Beverly 369669 Danielle 368485 Billy 367426 Sophia 364383 Marie 361371 Diana 359617 Brittany 358850 Natalie 356379 Isabella 354245 Charlotte 347772 Rose 344656 Alexis 340587 Kayla 340511 
    submitted by /u/hwpcspr
    [link] [comments]

    Why doesn't the output match the expected one when computing the standard deviation in CPP?

    Posted: 23 Jun 2021 07:52 PM PDT

    description and sample:

    https://imgur.com/a/Vsc9Lp7

    here only code for girls.txt

    #include<iostream> #include<fstream> #include<cctype> #include<iomanip> #include<cmath> #include<sstream> using namespace std; string tolowercase(string s){ for(int i=0;i<s.length();i++){ s[i]=tolower(s[i]); } return s; } int isInArray(string arr[],string target){ for(int i=0;i<100;i++){ stringstream ss; string name; ss<<arr[i]; ss>>name; if(tolowercase(name)==tolowercase(target)){ return i+1; } } return -1; } string namings(string s){ stringstream ss; ss<<s; string str,str2; ss>>str>>str2; return str2; } int main(){ string girls[100]; fstream p("girls.txt"); int i=0; while(p>>girls[i]){ string temp; p>>temp; girls[i]+=" "+temp; i++; } p.close(); while(1){ cout<<"(If you don't want to search name, please input exit!)\n"; cout<<"Enter name: "; string name; cin>>name; if(name=="exit"){ break; } cout<<endl; int index=isInArray(girls,name); if(index==-1){ cout<<name<<" is not ranked among the top 100 girl names.\n\n"; }else{ cout<<name<<" is ranked "<<index<<" in popularity among girls with "<<namings(girls[index-1])<<" namings.\n"; //here start computing standard deviation double u; double sum=0; for(int i=0;i<10;i++){ sum+=stod(namings(girls[index-1+i+1])); } u=sum/10; sum=0; for(int i=0;i<10;i++){ sum+=(stod(namings(girls[index-1+i+1]))-u)*(stod(namings(girls[index-1+i+1]))-u); } double sd=sqrt(sum/10); cout<<"Standard Deviation of the 10 list below this rank : "<<sd<<endl; cout<<endl; } } return 0; } 

    girls.txt

    Mary 3196385 Patricia 1558407 Jennifer 1468377 Linda 1448303 Elizabeth 1420377 Barbara 1397635 Susan 1103569 Jessica 1046322 Sarah 991910 Karen 986057 Nancy 966867 Lisa 965015 Betty 924629 Margaret 918541 Sandra 873509 Ashley 849297 Kimberly 839796 Emily 830999 Donna 822330 Michelle 812335 Dorothy 811392 Carol 806170 Amanda 773199 Melissa 753994 Deborah 740019 Stephanie 738523 Rebecca 729630 Sharon 720826 Laura 718006 Cynthia 705717 Kathleen 686217 Amy 681397 Shirley 663452 Angela 658968 Helen 618563 Anna 618367 Brenda 606291 Pamela 592696 Nicole 589434 Emma 580610 Samantha 578986 Katherine 571574 Christine 561161 Debra 548280 Rachel 546153 Catherine 542748 Carolyn 540963 Janet 539224 Ruth 538629 Maria 529342 Heather 524166 Diane 515183 Virginia 515088 Julie 506594 Joyce 499340 Victoria 485786 Olivia 481364 Kelly 471621 Christina 471106 Lauren 470902 Joan 467459 Evelyn 461952 Judith 449805 Megan 437647 Cheryl 436882 Andrea 436126 Hannah 431117 Martha 426247 Jacqueline 420505 Frances 414289 Gloria 408565 Ann 407374 Teresa 404253 Kathryn 402613 Sara 400884 Janice 399546 Jean 399416 Alice 396362 Madison 393297 Doris 383158 Tyler 381738 Julia 380836 Judy 377815 Grace 377678 Denise 371269 Amber 370577 Marilyn 369781 Beverly 369669 Danielle 368485 Billy 367426 Sophia 364383 Marie 361371 Diana 359617 Brittany 358850 Natalie 356379 Isabella 354245 Charlotte 347772 Rose 344656 Alexis 340587 Kayla 340511 
    submitted by /u/hwpcspr
    [link] [comments]

    No comments:

    Post a Comment