Category Archives: How to Fix

Error reported by RNG when compiling StVO pl

The errors reported are as follows: StVO PL/SRC/stereoframehandler. CPP: 1266:35: error: ‘RND’ was not declared in this scope
color = scalar (color_dist (RND), color_dist (RND), color_dist (RND), color_dist (RND))
explanation: random_ In the Linux implementation, device () reads the/dev/urandom device, random_ The purpose of device () is to generate a true random number. The rand () function uses the linear congruence method to generate a random number, but this random number is actually a pseudo-random number
original address: https://blog.csdn.net/keneyr/article/details/105595613#commentBox
However, randm_ Device() is only valid under Linux, not under windows
solution: add #include & lt; in front of the stereoframehandler.cpp file; random> just fine

Error report of mongodb startup under Linux

Version:MongoDB 5.0.3

1. Use the configuration file to start the error 1:

View log:

  The reason is an error in the configuration file:

#mongod.conf

net:

        bindIp: localhost,172.20.10.9         # 172.20.10.9 LAN IP for host computer

After 172.20.10.9 of bindip is deleted, it can be started successfully, but the host cannot connect to mongodb. At this time, by changing bindip to bindipall: true, it means that all IPS are allowed to connect to this mongodb

If you want to configure multiple IP addresses but do not want all IP addresses to be accessible, the above instructions are used, and the partition cannot be started. Query the network and learn that it is configured through [IP1, IP2], and the result is also an error:

Conclusion:       If it is only accessed locally, you can configure localhost in bindip,

                 If other IPS want to access, they can only configure bindip: 0.0.0.0 or bindipall: true

2. Use the configuration file to start error 2:

Problem cause: caused by abnormal shutdown

Solution: delete the. Lock file under the data directory, and then specify the data directory to start by — dbpaht or add the — repair parameter. After successful startup, start it by using the configuration file method

3. Add in replica set   No response when arbitrating nodes

Problem: by executing the shell in the master node, rs.addarb (host: port) does not respond, and the arbitration node cannot be added. At this time, the version is 5.0.3

Solution: reduce the version to 4.0.1

Scrapy runs a crawler with an error importerror: cannot import name suppress

2021-11-02 15:56:03 [twisted] CRITICAL: 
Traceback (most recent call last):
  File "/Users/tanya/Library/Python/2.7/lib/python/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
  File "/Users/tanya/Library/Python/2.7/lib/python/site-packages/scrapy/crawler.py", line 104, in crawl
    six.reraise(*exc_info)
  File "/Users/tanya/Library/Python/2.7/lib/python/site-packages/scrapy/crawler.py", line 86, in crawl
    self.engine = self._create_engine()
  File "/Users/tanya/Library/Python/2.7/lib/python/site-packages/scrapy/crawler.py", line 111, in _create_engine
    return ExecutionEngine(self, lambda _: self.stop())
  File "/Users/tanya/Library/Python/2.7/lib/python/site-packages/scrapy/core/engine.py", line 67, in __init__
    self.scheduler_cls = load_object(self.settings['SCHEDULER'])
  File "/Users/tanya/Library/Python/2.7/lib/python/site-packages/scrapy/utils/misc.py", line 46, in load_object
    mod = import_module(module)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/Users/tanya/Library/Python/2.7/lib/python/site-packages/scrapy/core/scheduler.py", line 7, in <module>
    from queuelib import PriorityQueue
  File "/Users/tanya/Library/Python/2.7/lib/python/site-packages/queuelib/__init__.py", line 1, in <module>
    from queuelib.queue import FifoDiskQueue, LifoDiskQueue
  File "/Users/tanya/Library/Python/2.7/lib/python/site-packages/queuelib/queue.py", line 7, in <module>
    from contextlib import suppress
ImportError: cannot import name suppress

resolvent:

pip uninstall attrs
pip uninstall queuelib
pip install queuelib==1.5.0
pip install attrs

The Vue mobile terminal cannot use string.replaceall, and the error message is blank

When developing Vue, the replaceall function is used, and there is no problem debugging on the PC side

However, when packaging and deploying to the mobile end test, it is found that some pages are blank and the console only displays error {}

After troubleshooting, the replaceall function reports an error. Replace it with replace

The MAC system installs MySQL client, and the error is solved_ config not found

The MAC system installs MySQL client, and the error is solved_ config not found

Using PIP3 install MySQL_ Client error

The error message is as follows: prompt: oserror: MySQL_ config not found
python setup.py egg_ info Check the logs for full command output
mysql_ Config not found

Solve the problem according to the error report

Prompt that the file does not exist. Use find to find the file and verify whether the file exists
find/- name MySQL_ Config
you can see that the file exists. It is preliminarily judged that the environment variable is not configured

resolvent

Add the queried address to the environment variable
export path = $path:/usr/local/mysql-5.6.38-macos10.12-x86_ 64/bin

Verify again

Download again, the prompt is successful, and the problem is solved

Problem regression

Because MySQL has been downloaded before, the environment variable configuration may be deleted when operating other contents. This method is not applicable to all cases

Python calls C to generate so library and reports an error: undefined symbol

  After using C + + to implement some algorithm functions, there is an error when calling Python:

AttributeError: /..../libHessian4Nii.so: undefined symbol: callVesselSegNii

    According to Du Niang, it is because the function name will be renamed in the C + + compiled file (which is convenient to realize the overload function), so the function name cannot be found when calling the script.

The solution is to use   extern “C”   Just enclose the header file to be exposed. Examples are as follows:

extern "C"{

  int callVesselSegNii(char* oriNiiFile, char* maskNiiFile, char* save_path);
 
}

After recompilation, call the normal!!!!

Idea ignores compilation errors and runs in eclipse compilation mode

1. Enter file settings compiler java compiler

Modifying the configuration:
use compiler: change javac to eclipse
select “processed on errors” in eclipse options

Change project bytecode version to 6

   Enter project configuration: project structure – & gt; Project   -& gt; Project name interface

Setting: Project language level: setting 6 version

Set run/debug configurations

Run/Debug Configurations

For web projects, set “before launch” to “make, no error check” (the default should be make)
for ordinary projects, set “before launch” to “build, no error build” (the default should be build)

  Return to the editing area and click build – & gt; build Project