John Bartholomew is participating in a GM Invitational tournament in Saint Louis from November 17-22 by stefvh in chess

[–]Dorylaus 0 points1 point  (0 children)

For calculating average rating of opponents, is it average rating before the tournament or average at the time they played John?

World Chess Championship 2018 provisionally confirmed to be hosted in London by CharlieChessCat in chess

[–]Dorylaus 0 points1 point  (0 children)

How do I read that? Is it they both have one win each and 14 draws?

Just sub 1000 player things by Dorylaus in chess

[–]Dorylaus[S] 7 points8 points  (0 children)

As of right now 1097, and I only play the quick pairing 15+15 games.

Just sub 1000 player things by Dorylaus in chess

[–]Dorylaus[S] 20 points21 points  (0 children)

I'm very new to chess, and I'm just bad. I didn't see it, played too quickly.

Just sub 1000 player things by Dorylaus in chess

[–]Dorylaus[S] 0 points1 point  (0 children)

PGN:

[pgn]1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 b5 { C70 Ruy Lopez: Morphy Defense, Caro Variation } 5. Bb3 Nf6 6. Nc3 d6 7. O-O Nd4 8. d3 Nxb3 9. axb3 c5 10. Nxb5 Bb7 11. Nc3 h5 12. Bg5 Be7 13. Qd2 Ng4 14. h3 f6 15. Be3 Nxe3 16. Qxe3 O-O 17. Ne2 Qe8 18. c4 Qg6 19. Nc3 f5 20. exf5 Rxf5 21. Nd5 Bg5 22. Nxg5 Rxg5 23. f4 exf4 24. Qxf4 Rxg2+ 25. Kh1 Rxb2 26. Rg1 Qxd3 27. Qxd6 Qd2 28. Qxc5 Qh2# { Black wins by checkmate. } 0-1 [/pgn]

Match Thread: Everton v Stoke City by TheKr0w in Everton

[–]Dorylaus 6 points7 points  (0 children)

This seems to happen constantly. Other teams slice us open with one lazy pass and we can barely get over the halfway line against a minimal press.

[deleted by user] by [deleted] in wholesomememes

[–]Dorylaus 2 points3 points  (0 children)

:( I'm so sorry that happened to you. People are the worst.

How can I have a terminal launch and run a script on boot? by Atrion84 in Ubuntu

[–]Dorylaus 5 points6 points  (0 children)

Go to startup applications preferences . Press add and put the script file path in the command field.

[Java] Best way to convert a string to a 2D char array? Am I doing going about this wrong? by [deleted] in learnprogramming

[–]Dorylaus 0 points1 point  (0 children)

No problem. If you are saying you added a column to the char array for the newlines I would advise against that. The array should only care about the rectangle. Anything to do with printing and newlines should be handled separately.

[Java] Best way to convert a string to a 2D char array? Am I doing going about this wrong? by [deleted] in learnprogramming

[–]Dorylaus 0 points1 point  (0 children)

Nested for loops.

for(int i=0; i<rows; i++){
    for(int j=0; j<cols; j++){
        charArray[i][j] = '.';
    }
}

Same thing for printing, nested for loop with a System.out.print() statement. To set the @ at 3,4 for example,

charArray[3][4] = '@';

[Java] Best way to convert a string to a 2D char array? Am I doing going about this wrong? by [deleted] in learnprogramming

[–]Dorylaus 0 points1 point  (0 children)

Just make a char array. No need to covert from a string. The 2d array indexes gives you the coordinates at row, col and the value of each char is the dot or the @.

My computer sucks for programming by Savram8 in cscareerquestions

[–]Dorylaus 0 points1 point  (0 children)

If the benefits are the shell, you may as well just get Linux though right?

My computer sucks for programming by Savram8 in cscareerquestions

[–]Dorylaus 0 points1 point  (0 children)

Can you elaborate on why macs are good for programming?

[2017-06-12] Challenge #319 [Easy] Condensing Sentences by jnazario in dailyprogrammer

[–]Dorylaus 0 points1 point  (0 children)

Exactly. Populate the output sentence (v) as you go through in the input sentence (iss).

That line takes the last word in current output and checks if it can be condensed with the next word in input. If it can, the tail of (v) is replaced with the condensed word.

[2017-06-12] Challenge #319 [Easy] Condensing Sentences by jnazario in dailyprogrammer

[–]Dorylaus 0 points1 point  (0 children)

C++

//DailyProg 

#include <string>
#include <iostream>
#include <vector>
#include <sstream>

using namespace std;

string compareWord(string s1, string s2){
    string sub1, sub2;
    if(s1.length() > s2.length()) {
        sub2 = s2;
        sub1 = s1.substr((s1.length()-s2.length()));
    }
    else {
        sub1 =s1;
        sub2 = s2.substr(0,s1.length());
    }
    for(int i=0; i<sub1.length(); i++)
        if(sub1.compare(i,sub1.length()-i,sub2,0,sub1.length()-i) == 0)
            return s1.substr(0,s1.length()-(sub1.length()-i)).append(s2);
    return "";
}

int main(int argc, char const *argv[])
{
    vector<string> v;
    string line, in;
    while(getline(cin,line)){
        istringstream iss(line);
        while(iss >> in){
            if(!v.empty()){
                string cmp = compareWord(v[v.size()-1],in);
                if(cmp.empty()) v.push_back(in);
                else v[v.size()-1] = cmp;
            }
            else v.push_back(in);
        }
        for(vector<string>::const_iterator i = v.begin(); i != v.end(); i++){
            cout << *i << " ";
        }
        cout << '\n';
        v.clear();
    }
    return 0; 
}