Giter Site home page Giter Site logo

ocgdb's People

Contributors

nguyenpham avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ocgdb's Issues

Latest searchwithontheflycalc db won't open

Hello again, Pham! Progress looks good, but I cannot open and read (using SQLPro for SQLlite latest macos version) the created database after running the new ocgdb tool. The SQL utilities just freeze. It kind of looks as though the last batch of records were not written properly or the database was not closed properly. I had that same problem on one of the early forks (not sure which one). Perhaps you reused some early code and a bug was re-introduced (just guessing)?

Anyway, thanks for all of the hard work. Progress looks good!

Oh, and can you publish a beta of your database viewer with one of your fork attempts? Thanks!

  • kenpchess

Option to remove engine games

You where saying on talkchess.com

I think bots may have the prefix BOT. Of course, you can't be sure for cheating accounts that use engines under human names.

I didn't check if al engine games have the prefix BOT. And would that be the only way to know if it are engine games?
I would like to have some options to remove engine games with ocgdb or Banksia.

export back to pgn much slower than import pgn

When importing a pgn the speed is about 20.000 games/s on my PC, what I think is really fast.
When I export a db3 database to pgn the speed is about 2000 games/s, what is rather slow in comparison exporting a Scid database to pgn for example.

Don't get option to discard games with ply-count under n to work

I did a trial to test the option to remove shorter games than given ply
I typed these comments one after the other
ocgdb -pgn human.pgn -db human.db3 -cpu 4 -o moves2;discardsites
ocgdb -db human.db3 -cpu 4 -plycount 80 -dup -o printall;remove
ocgdb -pgn human_out.pgn -db human.db3 -cpu 4 -export

Al games shorter than 80 ply are stil in the output human_out.pgn
I probably do some mistyping in the second command.

Request option to set eco codes.

I would like an option to set or overwrite existing eco codes.
I don't know what software is best at the moment to set the eco codes. I have noticed that eco codes can differentiate regarding what software was used to set the eco codes. If you set eco codes with Chessbase or Scid or pgn-extract, or with the new Hiarcs Explorer pro, for example.
There will always be slight differences. I like the eco codes use by Chessbase but it is very slow for huge databases.

Looks really promising!

Hello nguyenpham! Your chess database code looks really promising. I built it on mac mini quad-i3 3.2 ghz and populated a test stockfish database of about 350,000 games. It took about 1 hour to populate the db on an external USB drive. So not bad at all. Really looking forward to further developements!

P.S. - I really like Banskia too. (I hope your family is doing better!)

_ Ken

Request to sort a database.

I would like an option to (smart), sort the games of a database according dates, higher or lower rounds/boards . And to have a choice between ascending or descending.

Base.cpp code defect

    Hist tmphist;
    if (!commentMap.empty()) {
        auto it = commentMap.find(i + 1);
        if (it != commentMap.end()) {
            if (flag & ParseMoveListFlag_parseComment) {
                _parseComment(it->second, tmphist);
            } else {
                if (!tmphist.comment.empty()) {
                    tmphist.comment + ", "; // SURELY THIS SHOULD BE += rather than + which has no effect
                }
                tmphist.comment += it->second;
            }
            hasComment = true;
        }

Missing header files.

I do not understand how it compiles for you. I have the same compile problems I had last time due to missing header files.
dannc@DESKTOP-426Q3JG MINGW64 /i/project/dcorbit/ocgdb-main/src
$ make
g++ -std=c++17 -DNDEBUG -O3 -c .cpp
In file included from board/base.h:20,
from board/chess.h:15,
from builder.cpp:21:
board/chesstypes.h: In member function 'void ocgdb::Piece::set(int, ocgdb::Side)':
board/chesstypes.h:81:9: error: 'assert' was not declared in this scope
81 | assert(isValid());
| ^~~~~~
board/chesstypes.h:21:1: note: 'assert' is defined in header ''; did you forget to '#include '?
20 | #include "funcs.h"
+++ |+#include
21 |
In file included from board/chess.h:15,
from builder.cpp:21:
board/base.h: At global scope:
board/base.h:41:18: error: 'mutex' in namespace 'std' does not name a type
41 | mutable std::mutex dataMutex;
| ^~~~~
board/base.h:21:1: note: 'std::mutex' is defined in header ''; did you forget to '#include '?
20 | #include "chesstypes.h"
+++ |+#include
21 |
board/base.h: In member function 'void ocgdb::BoardData::histListClear()':
board/base.h:54:14: error: 'lock_guard' is not a member of 'std'
54 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~~
board/base.h:54:14: note: 'std::lock_guard' is defined in header ''; did you forget to '#include '?
board/base.h:54:30: error: 'mutex' is not a member of 'std'
54 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~
board/base.h:54:30: note: 'std::mutex' is defined in header ''; did you forget to '#include '?
board/base.h:54:44: error: 'dataMutex' was not declared in this scope
54 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~
board/base.h:54:37: error: 'dolock' was not declared in this scope; did you mean 'clock'?
54 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~
| clock
board/base.h: In member function 'std::vectorocgdb::Hist ocgdb::BoardData::getHistList() const':
board/base.h:59:14: error: 'lock_guard' is not a member of 'std'
59 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~~
board/base.h:59:14: note: 'std::lock_guard' is defined in header ''; did you forget to '#include '?
board/base.h:59:30: error: 'mutex' is not a member of 'std'
59 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~
board/base.h:59:30: note: 'std::mutex' is defined in header ''; did you forget to '#include '?
board/base.h:59:44: error: 'dataMutex' was not declared in this scope
59 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~
board/base.h:59:37: error: 'dolock' was not declared in this scope; did you mean 'clock'?
59 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~
| clock
board/base.h: In member function 'void ocgdb::BoardData::updateLastHist(const ocgdb::Hist&)':
board/base.h:71:14: error: 'lock_guard' is not a member of 'std'
71 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~~
board/base.h:71:14: note: 'std::lock_guard' is defined in header ''; did you forget to '#include '?
board/base.h:71:30: error: 'mutex' is not a member of 'std'
71 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~
board/base.h:71:30: note: 'std::mutex' is defined in header ''; did you forget to '#include '?
board/base.h:71:44: error: 'dataMutex' was not declared in this scope
71 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~
board/base.h:71:37: error: 'dolock' was not declared in this scope; did you mean 'clock'?
71 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~
| clock
board/base.h: In member function 'ocgdb::Hist ocgdb::BoardData::getHistAt(int) const':
board/base.h:86:14: error: 'lock_guard' is not a member of 'std'
86 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~~
board/base.h:86:14: note: 'std::lock_guard' is defined in header ''; did you forget to '#include '?
board/base.h:86:30: error: 'mutex' is not a member of 'std'
86 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~
board/base.h:86:30: note: 'std::mutex' is defined in header ''; did you forget to '#include '?
board/base.h:86:44: error: 'dataMutex' was not declared in this scope
86 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~
board/base.h:86:37: error: 'dolock' was not declared in this scope; did you mean 'clock'?
86 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~
| clock
board/base.h: In member function 'ocgdb::MoveFull ocgdb::BoardData::getMoveAt(int) const':
board/base.h:101:14: error: 'lock_guard' is not a member of 'std'
101 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~~
board/base.h:101:14: note: 'std::lock_guard' is defined in header ''; did you forget to '#include '?
board/base.h:101:30: error: 'mutex' is not a member of 'std'
101 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~
board/base.h:101:30: note: 'std::mutex' is defined in header ''; did you forget to '#include '?
board/base.h:101:44: error: 'dataMutex' was not declared in this scope
101 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~
board/base.h:101:37: error: 'dolock' was not declared in this scope; did you mean 'clock'?
101 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~
| clock
board/base.h: In member function 'int ocgdb::BoardData::hist_countInfo() const':
board/base.h:110:14: error: 'lock_guard' is not a member of 'std'
110 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~~
board/base.h:110:14: note: 'std::lock_guard' is defined in header ''; did you forget to '#include '?
board/base.h:110:30: error: 'mutex' is not a member of 'std'
110 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~
board/base.h:110:30: note: 'std::mutex' is defined in header ''; did you forget to '#include '?
board/base.h:110:44: error: 'dataMutex' was not declared in this scope
110 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~
board/base.h:110:37: error: 'dolock' was not declared in this scope; did you mean 'clock'?
110 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~
| clock
board/base.h: In member function 'bool ocgdb::BoardData::hist_removeAllInfo(bool, bool)':
board/base.h:119:14: error: 'lock_guard' is not a member of 'std'
119 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~~
board/base.h:119:14: note: 'std::lock_guard' is defined in header ''; did you forget to '#include '?
board/base.h:119:30: error: 'mutex' is not a member of 'std'
119 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~
board/base.h:119:30: note: 'std::mutex' is defined in header ''; did you forget to '#include '?
board/base.h:119:44: error: 'dataMutex' was not declared in this scope
119 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~
board/base.h:119:37: error: 'dolock' was not declared in this scope; did you mean 'clock'?
119 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~
| clock
board/base.h: In member function 'ocgdb::Piece ocgdb::BoardData::getPiece(int) const':
board/base.h:138:14: error: 'lock_guard' is not a member of 'std'
138 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~~
board/base.h:138:14: note: 'std::lock_guard' is defined in header ''; did you forget to '#include '?
board/base.h:138:30: error: 'mutex' is not a member of 'std'
138 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~
board/base.h:138:30: note: 'std::mutex' is defined in header ''; did you forget to '#include '?
board/base.h:138:44: error: 'dataMutex' was not declared in this scope
138 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~
board/base.h:138:37: error: 'dolock' was not declared in this scope; did you mean 'clock'?
138 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~
| clock
board/base.h: In member function 'ocgdb::Piece ocgdb::BoardData::_getPiece(int) const':
board/base.h:143:9: error: 'assert' was not declared in this scope
143 | assert(isPositionValid(pos));
| ^~~~~~
board/base.h:21:1: note: 'assert' is defined in header ''; did you forget to '#include '?
20 | #include "chesstypes.h"
+++ |+#include
21 |
board/base.h: In member function 'bool ocgdb::BoardData::isEmpty(int) const':
board/base.h:148:14: error: 'lock_guard' is not a member of 'std'
148 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~~
board/base.h:148:14: note: 'std::lock_guard' is defined in header ''; did you forget to '#include '?
board/base.h:148:30: error: 'mutex' is not a member of 'std'
148 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~
board/base.h:148:30: note: 'std::mutex' is defined in header ''; did you forget to '#include '?
board/base.h:148:44: error: 'dataMutex' was not declared in this scope
148 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~
board/base.h:148:37: error: 'dolock' was not declared in this scope; did you mean 'clock'?
148 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~
| clock
board/base.h: In member function 'bool ocgdb::BoardData::_isEmpty(int) const':
board/base.h:152:9: error: 'assert' was not declared in this scope
152 | assert(isPositionValid(pos));
| ^~~~~~
board/base.h:152:9: note: 'assert' is defined in header ''; did you forget to '#include '?
board/base.h: In member function 'bool ocgdb::BoardData::isPiece(int, int, ocgdb::Side) const':
board/base.h:157:14: error: 'lock_guard' is not a member of 'std'
157 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~~
board/base.h:157:14: note: 'std::lock_guard' is defined in header ''; did you forget to '#include '?
board/base.h:157:30: error: 'mutex' is not a member of 'std'
157 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~
board/base.h:157:30: note: 'std::mutex' is defined in header ''; did you forget to '#include '?
board/base.h:157:44: error: 'dataMutex' was not declared in this scope
157 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~
board/base.h:157:37: error: 'dolock' was not declared in this scope; did you mean 'clock'?
157 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~
| clock
board/base.h: In member function 'bool ocgdb::BoardData::_isPiece(int, int, ocgdb::Side) const':
board/base.h:162:9: error: 'assert' was not declared in this scope
162 | assert(isPositionValid(pos));
| ^~~~~~
board/base.h:162:9: note: 'assert' is defined in header ''; did you forget to '#include '?
board/base.h: In member function 'virtual void ocgdb::BoardData::clone(const ocgdb::BoardData
)':
board/base.h:172:14: error: 'lock_guard' is not a member of 'std'
172 | std::lock_guardstd::mutex dolocko(oboard->dataMutex);
| ^~~~~~~~~~
board/base.h:172:14: note: 'std::lock_guard' is defined in header ''; did you forget to '#include '?
board/base.h:172:30: error: 'mutex' is not a member of 'std'
172 | std::lock_guardstd::mutex dolocko(oboard->dataMutex);
| ^~~~~
board/base.h:172:30: note: 'std::mutex' is defined in header ''; did you forget to '#include '?
board/base.h:172:53: error: 'const class ocgdb::BoardData' has no member named 'dataMutex'
172 | std::lock_guardstd::mutex dolocko(oboard->dataMutex);
| ^~~~~~~~~
board/base.h:172:37: error: 'dolocko' was not declared in this scope; did you mean 'clock'?
172 | std::lock_guardstd::mutex dolocko(oboard->dataMutex);
| ^~~~~~~
| clock
board/base.h:173:14: error: 'lock_guard' is not a member of 'std'
173 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~~
board/base.h:173:14: note: 'std::lock_guard' is defined in header ''; did you forget to '#include '?
board/base.h:173:30: error: 'mutex' is not a member of 'std'
173 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~
board/base.h:173:30: note: 'std::mutex' is defined in header ''; did you forget to '#include '?
board/base.h:173:44: error: 'dataMutex' was not declared in this scope
173 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~
board/base.h:173:37: error: 'dolock' was not declared in this scope; did you mean 'clock'?
173 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~
| clock
board/base.h: In member function 'virtual void ocgdb::BoardData::_clone(const ocgdb::BoardData*)':
board/base.h:179:9: error: 'assert' was not declared in this scope
179 | assert(pieces.size() == oboard->pieces.size());
| ^~~~~~
board/base.h:179:9: note: 'assert' is defined in header ''; did you forget to '#include '?
board/base.h: In member function 'void ocgdb::BoardCore::setPiece(int, ocgdb::Piece)':
board/base.h:236:14: error: 'lock_guard' is not a member of 'std'
236 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~~
board/base.h:236:14: note: 'std::lock_guard' is defined in header ''; did you forget to '#include '?
board/base.h:236:30: error: 'mutex' is not a member of 'std'
236 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~
board/base.h:236:30: note: 'std::mutex' is defined in header ''; did you forget to '#include '?
board/base.h:236:44: error: 'dataMutex' was not declared in this scope
236 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~
board/base.h:236:37: error: 'dolock' was not declared in this scope; did you mean 'clock'?
236 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~
| clock
board/base.h: In member function 'void ocgdb::BoardCore::_setPiece(int, ocgdb::Piece)':
board/base.h:241:9: error: 'assert' was not declared in this scope
241 | assert(isPositionValid(pos));
| ^~~~~~
board/base.h:241:9: note: 'assert' is defined in header ''; did you forget to '#include '?
board/base.h: In member function 'void ocgdb::BoardCore::setEmpty(int)':
board/base.h:246:14: error: 'lock_guard' is not a member of 'std'
246 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~~
board/base.h:246:14: note: 'std::lock_guard' is defined in header ''; did you forget to '#include '?
board/base.h:246:30: error: 'mutex' is not a member of 'std'
246 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~
board/base.h:246:30: note: 'std::mutex' is defined in header ''; did you forget to '#include '?
board/base.h:246:44: error: 'dataMutex' was not declared in this scope
246 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~
board/base.h:246:37: error: 'dolock' was not declared in this scope; did you mean 'clock'?
246 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~
| clock
board/base.h: In member function 'void ocgdb::BoardCore::_setEmpty(int)':
board/base.h:251:9: error: 'assert' was not declared in this scope
251 | assert(isPositionValid(pos));
| ^~~~~~
board/base.h:251:9: note: 'assert' is defined in header ''; did you forget to '#include '?
In file included from builder.cpp:21:
board/chess.h: In member function 'virtual std::string ocgdb::ChessBoard::toString_traditional(const ocgdb::MoveFull&, ocgdb::Notation) const':
board/chess.h:78:9: error: 'assert' was not declared in this scope
78 | assert(false);
| ^~~~~~
board/chess.h:16:1: note: 'assert' is defined in header ''; did you forget to '#include '?
15 | #include "base.h"
+++ |+#include
16 |
board/chess.h: In member function 'virtual int ocgdb::ChessBoard::flip(int, ocgdb::FlipMode) const':
board/chess.h:91:9: error: 'assert' was not declared in this scope
91 | assert(0);
| ^~~~~~
board/chess.h:91:9: note: 'assert' is defined in header ''; did you forget to '#include '?
In file included from builder.h:19,
from main.cpp:12:
board/base.h:41:18: error: 'mutex' in namespace 'std' does not name a type
41 | mutable std::mutex dataMutex;
| ^~~~~
board/base.h:21:1: note: 'std::mutex' is defined in header ''; did you forget to '#include '?
20 | #include "chesstypes.h"
+++ |+#include
21 |
board/base.h: In member function 'void ocgdb::BoardData::histListClear()':
board/base.h:54:14: error: 'lock_guard' is not a member of 'std'
54 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~~
board/base.h:54:14: note: 'std::lock_guard' is defined in header ''; did you forget to '#include '?
board/base.h:54:30: error: 'mutex' is not a member of 'std'
54 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~
board/base.h:54:30: note: 'std::mutex' is defined in header ''; did you forget to '#include '?
board/base.h:54:44: error: 'dataMutex' was not declared in this scope
54 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~
board/base.h:54:37: error: 'dolock' was not declared in this scope; did you mean 'clock'?
54 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~
| clock
board/base.h: In member function 'std::vectorocgdb::Hist ocgdb::BoardData::getHistList() const':
board/base.h:59:14: error: 'lock_guard' is not a member of 'std'
59 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~~
board/base.h:59:14: note: 'std::lock_guard' is defined in header ''; did you forget to '#include '?
board/base.h:59:30: error: 'mutex' is not a member of 'std'
59 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~
board/base.h:59:30: note: 'std::mutex' is defined in header ''; did you forget to '#include '?
board/base.h:59:44: error: 'dataMutex' was not declared in this scope
59 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~
board/base.h:59:37: error: 'dolock' was not declared in this scope; did you mean 'clock'?
59 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~
| clock
board/base.h: In member function 'void ocgdb::BoardData::updateLastHist(const ocgdb::Hist&)':
board/base.h:71:14: error: 'lock_guard' is not a member of 'std'
71 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~~
board/base.h:71:14: note: 'std::lock_guard' is defined in header ''; did you forget to '#include '?
board/base.h:71:30: error: 'mutex' is not a member of 'std'
71 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~
board/base.h:71:30: note: 'std::mutex' is defined in header ''; did you forget to '#include '?
board/base.h:71:44: error: 'dataMutex' was not declared in this scope
71 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~
board/base.h:71:37: error: 'dolock' was not declared in this scope; did you mean 'clock'?
71 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~
| clock
board/base.h: In member function 'ocgdb::Hist ocgdb::BoardData::getHistAt(int) const':
board/base.h:86:14: error: 'lock_guard' is not a member of 'std'
86 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~~
board/base.h:86:14: note: 'std::lock_guard' is defined in header ''; did you forget to '#include '?
board/base.h:86:30: error: 'mutex' is not a member of 'std'
86 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~
board/base.h:86:30: note: 'std::mutex' is defined in header ''; did you forget to '#include '?
board/base.h:86:44: error: 'dataMutex' was not declared in this scope
86 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~
board/base.h:86:37: error: 'dolock' was not declared in this scope; did you mean 'clock'?
86 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~
| clock
board/base.h: In member function 'ocgdb::MoveFull ocgdb::BoardData::getMoveAt(int) const':
board/base.h:101:14: error: 'lock_guard' is not a member of 'std'
101 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~~
board/base.h:101:14: note: 'std::lock_guard' is defined in header ''; did you forget to '#include '?
board/base.h:101:30: error: 'mutex' is not a member of 'std'
101 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~
board/base.h:101:30: note: 'std::mutex' is defined in header ''; did you forget to '#include '?
board/base.h:101:44: error: 'dataMutex' was not declared in this scope
101 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~
board/base.h:101:37: error: 'dolock' was not declared in this scope; did you mean 'clock'?
101 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~
| clock
board/base.h: In member function 'int ocgdb::BoardData::hist_countInfo() const':
board/base.h:110:14: error: 'lock_guard' is not a member of 'std'
110 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~~
board/base.h:110:14: note: 'std::lock_guard' is defined in header ''; did you forget to '#include '?
board/base.h:110:30: error: 'mutex' is not a member of 'std'
110 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~
board/base.h:110:30: note: 'std::mutex' is defined in header ''; did you forget to '#include '?
board/base.h:110:44: error: 'dataMutex' was not declared in this scope
110 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~
board/base.h:110:37: error: 'dolock' was not declared in this scope; did you mean 'clock'?
110 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~
| clock
board/base.h: In member function 'bool ocgdb::BoardData::hist_removeAllInfo(bool, bool)':
board/base.h:119:14: error: 'lock_guard' is not a member of 'std'
119 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~~
board/base.h:119:14: note: 'std::lock_guard' is defined in header ''; did you forget to '#include '?
board/base.h:119:30: error: 'mutex' is not a member of 'std'
119 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~
board/base.h:119:30: note: 'std::mutex' is defined in header ''; did you forget to '#include '?
board/base.h:119:44: error: 'dataMutex' was not declared in this scope
119 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~
board/base.h:119:37: error: 'dolock' was not declared in this scope; did you mean 'clock'?
119 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~
| clock
board/base.h: In member function 'ocgdb::Piece ocgdb::BoardData::getPiece(int) const':
board/base.h:138:14: error: 'lock_guard' is not a member of 'std'
138 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~~
board/base.h:138:14: note: 'std::lock_guard' is defined in header ''; did you forget to '#include '?
board/base.h:138:30: error: 'mutex' is not a member of 'std'
138 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~
board/base.h:138:30: note: 'std::mutex' is defined in header ''; did you forget to '#include '?
board/base.h:138:44: error: 'dataMutex' was not declared in this scope
138 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~
board/base.h:138:37: error: 'dolock' was not declared in this scope; did you mean 'clock'?
138 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~
| clock
board/base.h: In member function 'bool ocgdb::BoardData::isEmpty(int) const':
board/base.h:148:14: error: 'lock_guard' is not a member of 'std'
148 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~~
board/base.h:148:14: note: 'std::lock_guard' is defined in header ''; did you forget to '#include '?
board/base.h:148:30: error: 'mutex' is not a member of 'std'
148 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~
board/base.h:148:30: note: 'std::mutex' is defined in header ''; did you forget to '#include '?
board/base.h:148:44: error: 'dataMutex' was not declared in this scope
148 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~
board/base.h:148:37: error: 'dolock' was not declared in this scope; did you mean 'clock'?
148 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~
| clock
board/base.h: In member function 'bool ocgdb::BoardData::isPiece(int, int, ocgdb::Side) const':
board/base.h:157:14: error: 'lock_guard' is not a member of 'std'
157 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~~
board/base.h:157:14: note: 'std::lock_guard' is defined in header ''; did you forget to '#include '?
board/base.h:157:30: error: 'mutex' is not a member of 'std'
157 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~
board/base.h:157:30: note: 'std::mutex' is defined in header ''; did you forget to '#include '?
board/base.h:157:44: error: 'dataMutex' was not declared in this scope
157 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~
board/base.h:157:37: error: 'dolock' was not declared in this scope; did you mean 'clock'?
157 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~
| clock
board/base.h: In member function 'virtual void ocgdb::BoardData::clone(const ocgdb::BoardData*)':
board/base.h:172:14: error: 'lock_guard' is not a member of 'std'
172 | std::lock_guardstd::mutex dolocko(oboard->dataMutex);
| ^~~~~~~~~~
board/base.h:172:14: note: 'std::lock_guard' is defined in header ''; did you forget to '#include '?
board/base.h:172:30: error: 'mutex' is not a member of 'std'
172 | std::lock_guardstd::mutex dolocko(oboard->dataMutex);
| ^~~~~
board/base.h:172:30: note: 'std::mutex' is defined in header ''; did you forget to '#include '?
board/base.h:172:53: error: 'const class ocgdb::BoardData' has no member named 'dataMutex'
172 | std::lock_guardstd::mutex dolocko(oboard->dataMutex);
| ^~~~~~~~~
board/base.h:172:37: error: 'dolocko' was not declared in this scope; did you mean 'clock'?
172 | std::lock_guardstd::mutex dolocko(oboard->dataMutex);
| ^~~~~~~
| clock
board/base.h:173:14: error: 'lock_guard' is not a member of 'std'
173 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~~
board/base.h:173:14: note: 'std::lock_guard' is defined in header ''; did you forget to '#include '?
board/base.h:173:30: error: 'mutex' is not a member of 'std'
173 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~
board/base.h:173:30: note: 'std::mutex' is defined in header ''; did you forget to '#include '?
board/base.h:173:44: error: 'dataMutex' was not declared in this scope
173 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~
board/base.h:173:37: error: 'dolock' was not declared in this scope; did you mean 'clock'?
173 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~
| clock
board/base.h: In member function 'void ocgdb::BoardCore::setPiece(int, ocgdb::Piece)':
board/base.h:236:14: error: 'lock_guard' is not a member of 'std'
236 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~~
board/base.h:236:14: note: 'std::lock_guard' is defined in header ''; did you forget to '#include '?
board/base.h:236:30: error: 'mutex' is not a member of 'std'
236 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~
board/base.h:236:30: note: 'std::mutex' is defined in header ''; did you forget to '#include '?
board/base.h:236:44: error: 'dataMutex' was not declared in this scope
236 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~
board/base.h:236:37: error: 'dolock' was not declared in this scope; did you mean 'clock'?
236 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~
| clock
board/base.h: In member function 'void ocgdb::BoardCore::setEmpty(int)':
board/base.h:246:14: error: 'lock_guard' is not a member of 'std'
246 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~~
board/base.h:246:14: note: 'std::lock_guard' is defined in header ''; did you forget to '#include '?
board/base.h:246:30: error: 'mutex' is not a member of 'std'
246 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~
board/base.h:246:30: note: 'std::mutex' is defined in header ''; did you forget to '#include '?
board/base.h:246:44: error: 'dataMutex' was not declared in this scope
246 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~~~~
board/base.h:246:37: error: 'dolock' was not declared in this scope; did you mean 'clock'?
246 | std::lock_guardstd::mutex dolock(dataMutex);
| ^~~~~~
| clock
make: *** [Makefile:10: all] Error 1

Request option to detect doubles when games are included in other games.

Screenshot found doubles with Scid

This is an example where Scid finds a duplicated game because on game is included in another game. Ath the moment ocgdb don't detect these doubles.
Scid only detect these count of doubles when the player names are identical
I also want an option to detect these doubles when player names are different or other information like event is different. Than I want ocgdb to keep the better game, (longer game, more recent, higher elo, longer time control ,etc).
Maybe it are technically not exact doubles. But I don't see how it can be useful to keep games with exact the same moves, and exact the same results, together in a database.
Doubles where one game is included in another happens quite often in human tournaments when using DGT boards, sometimes the feed gets an extra move or a database feed like TWIC does an update one week and provides a game correction the next week.

error messages when opening exported pgn from ocgdb in other chess GUI like Scid

I used these commends
ocgdb -pgn ecoE.pgn -db ecoE.db3 -cpu 4 -o moves2
ocgdb -db ecoE.db3 -cpu 4 -dup -o printall;remove
ocgdb -pgn ecoE_out.pgn -db ecoE.db3 -cpu 4 -export

When I open the exported pgn in Scid I get thes error messages
(game 9933, line 227803) Unexpected end of game: PGN header '[' seen inside game (result missing ?).
(game 10333, line 235866) Unexpected end of game: PGN header '[' seen inside game (result missing ?).
(game 14439, line 332695) Unexpected end of game: PGN header '[' seen inside game (result missing ?).

When I open the pgn's ecoE.pgn and ecoE_out.pgn in a text editor to compare them.
I can see that games without a result have no result tag in the pgn exported by ocgdb.

[Result "*"]

This is how a game without a result looks like in the exported pgn from ocgdb

[Event "Rated Correspondence game"]
[BlackElo "2430"]
[White "Flowerdragon"]
[Black "arvischess"]
[TimeControl "-"]
[Date "2019-02-26"]
[Round "0"]
[WhiteElo "2476"]
[ECO "E06"]
[PlyCount "32"]

  1. d4 d5 2. c4 e6 3. g3 Nf6 4. Bg2 Be7
  2. Nd2 O-O 6. Ngf3 c5 7. dxc5 Bxc5 8. O-O Nc6
  3. Nb3 Bd6 10. cxd5 exd5 11. Nbd4 Re8 12. Bg5 h6
  4. Bxf6 Qxf6 14. Rc1 Bd7 15. e3 Ne7 16. Qb3 b5

In the original pgn the game looks like this

[Event "Rated Correspondence game"]
[BlackElo "2430"]
[White "Flowerdragon"]
[Black "arvischess"]
[Result "*"]
[TimeControl "-"]
[Date "2019-02-26"]
[Round "0"]
[WhiteElo "2476"]
[ECO "E06"]
[PlyCount "32"]

  1. d4 d5 2. c4 e6 3. g3 Nf6 4. Bg2 Be7
  2. Nd2 O-O 6. Ngf3 c5 7. dxc5 Bxc5 8. O-O Nc6
  3. Nb3 Bd6 10. cxd5 exd5 11. Nbd4 Re8 12. Bg5 h6
  4. Bxf6 Qxf6 14. Rc1 Bd7 15. e3 Ne7 16. Qb3 b5

It is not a major issue but it would be nice if it could be fixed, so I don't get these annoying messages when opening the exported pgn from ocgdb in Scid.
A also wonder if it will not give problems if the is no result tag in the game headers, when trying to make bin book with polyglot from the exported pgn's from ocgdb

How to remove duplicates from pgn?

I haver made a small example pgn databases with 60 games '60_games_with_doubles.pgn'
I know about half of the games are duplicates, because I have searched the database for duplicates with Chessbase.

I don't get it to work to create a new pgn database with the duplicates removed with ocgdb, and I have no idea what I do wrong?

I typed these commands one after the other

ocgdb -pgn 60_games_with_doubles.pgn -db 60_games_with_doubles.db3 -cpu 4 -o moves
ocgdb -db 60_games_with_doubles.db3 -cpu 4 -dup o printall;remove
ocgdb -pgn 60_games_with_doubles_out.pgn -db 60_games_with_doubles.db3 -cpu 4 -export

This is the smal example pgn databases with duplicates I used:
https://drive.google.com/file/d/1y56C8ExBaHpOtQW4jtvbHR4t5LcATtf_/view?usp=sharing

I made a video capture of it:

failed.to.remove.duplicates.with.ocgdb.mp4

Is there a version for xiangqi available?

Hi Pham,
my name is Agostino.
I'm a fun of xiangqi game. My wife is GM Lin Ye 1981 Chinese xiangqi Champion and 1997 World xiangqi Champion.
I think it would be very great if you could write an Open Chess Game Database (OCGDB) version for xiangqi.
Do you think it's possible?

Best whishes

Agostino

can not unzip the example databases

I have 7-zip installed on my Windows 11 64 bit pc.
I tried to extract the files 'mb-3.45.ocgdb.db3' and 'carlsen.ocgdb.db3', without success.
I get the error message

Cannot open the file as [zip] archive
Is not archive

strange example

You give this as example
ocgdb -create -pgn big1.png -pgn big2.png -db :memory: -elo 2100 -o moves,moves1,discardsites
-o moves,moves1

Is this a typo, or douse it makes sense to list the options moves,moves1 ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.