Category Archives: How to Fix

C++ ERROR redefinition of ‘class ***’

The error is as follows:
BaseSmoothingAlgorithm. H: 4:7: error: redefinition of “class BaseSmoothingAlgorithm ‘
BaseSmoothingAlgorithm. H: 4:7: error: the previous definition of ‘class BaseSmoothingAlgorithm’
Troubleshooting steps:
1. Find whether there are fewer classes “; “after the definition of the class. ; Find one after another, not this type of error
2. There are no macros to prevent them from being included more than once
#ifndef _BASESMOOTHINGALGORITHM_H_
#define _BASESMOOTHINGALGORITHM_H_
#include “BaseSmoothingAlgorithm.h”
#endif
To solve

Python keyerror exception

If you don’t know if there’s a key value in dict, you’d better use it

dict.get(key)
If you read with dict[key] it will report a KeyError exception,

Dict. Get method mainly provides a function to return the default value if the value of corresponding key is not obtained.

And dict[key] actually calls the method with ___
D.get(key[, d]) -> D[K] if K in D, else D. defaults to None

Mysql error 1452 – Cannot add or update a child row: a foreign key constraint fails

Today, when you add a foreign key to a mysql table, you always report an error. Here is the SQL statement:

Alter table A  

Add constraint FK_1 Foreign Key (‘ relation_ID ‘) References B(‘ id ‘) on UPDATE Cascade on DELETE Cascade

Error code: 1452
See the table is also no problem, and the field of RELATION_ID is no foreign key ah ~~~
Finally, a solution is found in Google. The general method is as follows:

mysql> SET foreign_key_checks = 0;

mysql> alter table tblUsedDestination add constraint f_operatorId foreign key(iOperatorId) references tblOperators (iOperatorId); Query
OK, 8 rows affected (0.23 sec) Records: 8  Duplicates: 0  Warnings: 0

mysql> SET foreign_key_checks = 1;

Make foreign_key_checks invalid first, then add foreign keys to the table, and finally make foreign_key_checks effective!
There is a reason for foreign_key_checks. If you cannot add a foreign key because it violates the constraint, you should correct the data first. Turning off checks and then adding keys puts you in an inconsistent state. Foreign key checks add overhead, and if you don’t want to use them, use myisam instead of

SQL error: 156, sqlstate: S1000 error encountered in Hibernate

I encountered such a mistake today
Util. SQL Error JDBCExceptionReporter 77) : 156. SQLState: S1000
(util. JDBCExceptionReporter 78) near the keyword ‘plan for grammar mistakes.
.
Caused by: java.sql.sqlexception: syntax error near keyword ‘plan’.
…….
The web search explanation is caused by some values that have the same name as the key field in SQL2005.
Solution: Just change the plan name to something else, such as EMPPLAN

LDAP: error code 32 – No Such Object

Ldap: error code 32-no Such Object
ldap: error code 32-no Such Object
is calling
this. ldaptemplate. create(ldapUser);
was reported wrong. After searching for a long time, I did not find the reason. Finally, I saw a blog and realized that the configured base in the ldap context should not be added to the dn of the node

<ldap:context-source id="contextSource"
                  password="${ldap.password}"
                  url="${ldap.url}"
                  username="${ldap.username}"
                  base="${ldap.base}" />

 @Entry(objectClasses = { "person", "inetOrgPerson", "organizationalPerson", "top" }, base="o=sf")
public class LdapUser {

For example, dn is o=sf,dc=aa,dc=com
ldap: base of contin-source is configured as dc=aa, base of dc=com
Entry is configured as o=sf, and can no longer be configured as o=sf,dc=aa,dc=com

Out of bag error in Random Forest

The RandomForestClassifier in Sklearn has one parameter:

oob_score : bool (default=False)
Whether to use out-of-bag samples to estimate the generalization accuracy.

In Chinese, it is called ‘out of pocket error’. This parameter means: use OOB to measure test error.


About oob explanation, there is a more comprehensive explanation on stackoverflow: oob explanation
let me tell you my understanding:

RF needs to sampling from the original feature set and then split to generate a single tree. The training sample of each tree is derived from the original training set Boostraping. Due to the way boostraping is put back in the sample, the training set varies from tree to tree and is only a part of the original training set. For the TTH tree, the data in the original training set that is not in the TTH tree can be tested using the TTH tree. Now n(n is the size of the original data set) trees are generated, and the training sample size of each tree is N-1. For the ith tree, its training set does not include (xi, Yi) this sample. Use all the trees (N-1) that do not contain the (xi, YI) sample, and the result of VOTE is the test result of the final (xi, YI) sample.

This allows you to test while training, and experience shows that:

out-of-bag estimate is as accurate as using a test set of the same size as the training set.

Oob is an unbiased estimate of a test error.
To sum up: suppose Zi=(xi,yi).

The out-of-bag (OOB) error is the average error for each Zi calculated using predictions from the trees that do not contain Zi in their respective bootstrap sample. This allows the RandomForestClassifier to be fit and validated whilst being trained.


reference
OOB explanation on stackoverflow
sklearn OOB explanation on stackoverflow

Windows_ Win7 broadband connection prompt remote access connection manager error

Windows_Win7 broadband Connection prompts Remote Access Connection Manager error

phenomenon: prompts Remote Access Connection Manager error

error: prompts Remote Access Connection Manager error

error 1068: dependent service or group cannot start
error 87: parameter error

fault resolution:

Remote Access Connection Manager service startup depends on two services
and another service to start most of the time:
(1) Telephony service
(2) SSTPS(secure socket protocol service)
(3) Windows Event Log service
set the above three services to “auto” start and start.

2, find the folder path C:\ Windows \system32
in the folder to find the logfile and wbem these two folders,
right click — the administrator to obtain the ownership,
after the restart of the computer.

Reproduced in: https://www.cnblogs.com/jason-wrj/p/10289461.html

Xcode 5 solves the operation could’t be completed

Company SVN is in the LAN, the general use of SVN.*** com.cn to login, IP for 192.168.80.8
MAC prompt software to update the update, after the restart OF SVN can not be used, the Internet is normal. I have confirmed that the DNS configured by the computer is our company’s DNS server.
So I use the terminal to do something:
1. Ping SVN. * * *. Com. Cn
2. Ping 192.168.80.8
The result analysis: should be DNS has a problem

Enter the local DNS refresh command in the terminal:

sudo dscacheutil -flushcache

It still doesn’t work, and of course it doesn’t even restart the computer in the middle. It might be the DNS server.

Then I decided to use 192.168.80.8 to re-checkout the code and flip the changes over to commit.

It is ok to enter SVN address through the browser, but it is not ok to use Xcode 5. It prompts a bunch of certificate problems, but it is still not ok to allow all of them.

So from the Internet down the question -1012 input command:

      
SVN ls tips at https://192.168.80.8/svn/hhhh/

(R)eject, accept (t)emporarily or accept (p)ermanently?p
Authentication realm: < ‘https://192.168.80.8.xx’ & gt; VisualSVN Server

The Password for
‘y
onghuming
: (User name found to be incorrect)

Select P as prompted

Enter your account password.

Syntax error: unexpected end of file problem [two solutions]

The article directories
Modify the php.ini configuration file to use notepad++ conversion format


PHP upload files to the server can be said to have a bumpy journey, there is a problem… About syntax error: Unexpected end of File, this problem is usually not your code problem. If you are using Linux server, after editing the script in Windows environment, the file format will be wrong because of incorrect return characters.
Modify the php.ini configuration file
This method is used to solve the problem, generally speaking. ?php?> That’s the normal way of writing it, but < ??> This can also be used as a short label. If you have PHP in this format, go to php.ini, modify short_open_tag = Off, change “Off” to “On”, and restart Apache.
Use notepad++ to convert the format
The reason for this is that the format layout under Linux is different from that of Windows, so I need to convert the file into
in Linux/ Unix format. At present, I haven’t found a way to convert the file into
in Linux/ Unix format. If you know, please inform ~