“Symbol(s) not found for architecture x86_64” on QtCreator project

In my opinion, the error message that Qt Creator displays is quite misleading until you understand it, but does not prevent splitting the template class into a header and implementation file. If you think about the message: Symbol(s) not found for architecture x86_64 the problem, I originally thought when I saw this, is that it … Read more

Difference between an inline function and static inline function

The non-static inline function declaration refers to the same function in every translation unit (source file) that uses it. The One Definition Rule requires that the body of the function definition is identical in every TU that contains it, with a longish definition of “identical”. This is usually satisfied provided that the source files all … Read more

c++ multiple definitions of a variable

I’m not going to include all of the details, but you define a global variable, wat twice in your compilation uint. To fix, use the following: FileB.h extern int wat; FileB.cpp int wat = 0; This (extern) tells the compile that the variable wat exists somewhere, and that it needs to find it on it’s … Read more

AttributeError: ‘Model’ object has no attribute ‘predict_classes’

The predict_classes method is only available for the Sequential class (which is the class of your first model) but not for the Model class (the class of your second model). With the Model class, you can use the predict method which will give you a vector of probabilities and then get the argmax of this … Read more

How to compile a java source file which is encoded as “UTF-8”?

Your file is being read as UTF-8, otherwise a character with value “65279” could never appear. javac expects your source code to be in the platform default encoding, according to the javac documentation: If -encoding is not specified, the platform default converter is used. Decimal 65279 is hex FEFF, which is the Unicode Byte Order … Read more

Is `1/0` a constant expression in Java? [duplicate]

The compiler is doing constant folding (precomputing trivial literal expressions). This is a case where the expression “completes abruptly”, to use the JLS verbiage, disqualifying it from meeting the definition of “constant expression”. So it’s not a bug, it’s consistent with the JLS. And yes, the expression doesn’t evaluate to a value either (warning the … Read more