Tag Archives: learning

./ungrib.exe Start Error: Could not Fould libpng16.so.16 (/etc/ld.so.conf and ldconfig)

Project Scene:

After successfully building Linux, installing the required dependency libraries, and installing WPS and WRF. Run an instance simulation.


Problem description

./ungrib.exe reports an error that libpng16.so.16 cannot be found.
The error is as follows:
./ungrib.exe: error while loading shared libraries: libpng16.so. 16: cannot open shared object file: No such file or directory
1


Solution:

sudo vim /etc/ld.so.conf

Add statement: /home/tian/Software/libpng-intel/lib
2
3

sudo ldconfig

Go to ./ungrib.exe to run successfully

CARLA Report an Error: rpc server [How to Solve]

CARLA reports error rpc server
Trying to do some research on autopilot with carla,When running the example,error:
RuntimeError: trying to create rpc server for traffic manager; but the system failed to create because of bind error.
Possible reasons for this issue: The last time the PythonAPI was run was not properly terminated,causing some resources or ports Occupied.

Solution:
1)Restart carla;
2)If the error is still reported after restarting carla, Then restart the computer.

PHP:Fatal error: Class ‘COM’ not found in … How to deal with the problem

PHP: Fatal error: Class ‘COM’ not found in… 1. First check if the COM service has been started in Windows’ Services’. If not, start it. Windows Management Instrumentation 2, PHP directory ext directory PHP_COM_DOTNET.DLL exists. (Ext, by the way, is often used as an extension directory for PHP programs, and is usually set up when PHP is installed. Otherwise, it’s not just the subject that’s wrong.) 3. If not, add the following to php.ini: PHP_COM_DOTNET = “allow_dcom”;// PHP_COM_DOTNET = “allow_dcom”;// PHP_COM_DOTNET = “allow_dcom”;// PHP_COM_DOTNET: “allow_dcom” = “true”; So you need to in PHP. Add a line to expand the extension = php_com_dotnet ini. DLL, is to add a line, is not open, no this line in the default configuration file, and then restart the IIS and Apache, running as normal again!

curl.perform() pycurl.error: (23, ‘Failed writing body (0 != 59)’)

The introduction of the pycurl and StringIO modules when using python3.7 is prone to the above errors
The solution for importing the StringIO module:
StringIO module can only be imported in python2, directly from StringIO import StringIO
But python3, STringIO, and cStringIO modules are gone, and to use them you have to import the IO modules:

from io import StringIO
dot_data = StringIO()

StringIO can also be used by importing the Six module:

from six import StringIO

or

from sklearn.externals.six import StringIO 

Provide a method that is both Python2 and Python3 compatible:

try:
    from StringIO import StringIO
except ImportError:
    from io import StringIO

This solves the problem of importing the StringIO module in different Python versions.
But Pycurl is also influenced by the Python version when it encodes strings, as follows:
Write instead
Under python 2, you can use StringIO object:

import pycurl
from StringIO import StringIO
c = pycurl.Curl()
c.setopt(c.URL,'http://pycurl.io')
buffer = StringIO()
c.setopt(c.WRITEDATA, buffer)
# Same result if using WRITEFUNCTION instead:
#c.setopt(c.WRITEFUNCTION, buffer.write)
c.perform()
# ok

Under python 3, when pycurl USES the bytes parameter, the response must be written to the BytesIO object:

import pycurl
from io import BytesIO
c = pycurl.Curl()
c.setopt(c.URL,'http://pycurl.io')
buffer = BytesIO()
c.setopt(c.WRITEDATA, buffer)
# Same result if using WRITEFUNCTION instead:
#c.setopt(c.WRITEFUNCTION, buffer.write)
c.perform()
# ok

Trying to use the StringIO object will produce an error: :

import pycurl
from io import StringIO
c = pycurl.Curl()
c.setopt(c.URL,'http://pycurl.io')
buffer = StringIO()
c.setopt(c.WRITEDATA, buffer)
c.perform()

The error message is as follows:

The following idiom is available for code that requires compatibility with Python2 and Python3:

import pycurl
try:
    # Python 3
    from io import BytesIO
except ImportError:
    # Python 2
    from StringIO import StringIO as BytesIO
c = pycurl.Curl()
c.setopt(c.URL,'http://pycurl.io')
buffer = BytesIO()
c.setopt(c.WRITEDATA, buffer)
c.perform()
# ok
# Decode the response body:
string_body = buffer.getvalue().decode('utf-8')

 

How to Fix Invalid bound statement (not found) Error

there have been many articles on the Internet explaining the possible reasons for this error, nothing more than the following:
1. Java method does not exist in mapper.xml, and then the method of executing Mapper will report the
. The return value of xxxmapper.java method is List, while the select element does not correctly configure ResultMap, or only configure ResultType
4. If you confirm that there is no problem above, please modify the corresponding XML file, such as deleting a blank line, save. 5. See if the XML configuration path of mapper is correct

error 2 treatment.

maven default would make all configuration files under the SRC/main/resources and SRC/main/Java under all the Java files packaged or published to the target \ classes here, but the reality we may under the SRC/main/Java also placed some configuration files such as hibernate configuration file or mybatis mapper configuration files, etc., if you don’t do some additional configuration, after that our packaging projects may find these must be a resource file, So add a configuration like the following to the POM.xml so that the XML file under SRC /main/ Java is copied to the corresponding class directory along with the Java compiled class file.

<build>    
<resources>       
<resource>            
<directory>src/main/java</directory>            
<includes>               
<include>**/*.properties</include>
<include>**/*.xml</include>                           
</includes>            
<filtering>false</filtering>        
</resource>   
</resources>
</build>