Author Archives: Robins

Unable to connect to MKS:Internal error

Question:
Unable to connect to MKS: internal error when opening the window, we managed to log in to the vCenter Server using the VSphere Client to operate the virtual machine on the host. However, when logging in to the ESXi host using the VSphere Client, we were Unable to open the window of the virtual machine.

Problem Solving:
1. Check whether port 902 on the Client host is occupied, and release if occupied.
    
The port is not occupied
2. Turn on the SSH function of ESXi host and log in to ESXi.
3. Execute service mgmt-vmware restart
Note: Some people may execute this command after the service may appear is not recognized command, some people may not find this MGMT-VMware service, this time can try the following method.
4. Vi/etc/vmwaer/config
Add a
Vmauthd. Server. AlwaysProxy = “TRUE”
Test whether the service is available, do not restart the ESXi host, and then try again.

All the above methods are not good, then reinstall the vCenter Server! Good luck.

error: How to solve stray ‘\342’ in program

I copied a relatively simple code from the Internet, and encountered the following problems when compiling:
Test_getopt.c :9:35: error: stray ‘\342’ in program
. C :9:35: error: stray ‘\200’ in program
. C :9:35: error: stray ‘\235’ in program
test_getopt.c:12:3: error: Stray ‘\342’ in program
test_getopt.c:12:3: error: stray ‘\200’ in program
test_getopt.c:12:3: error: stray ‘\230’ in program
test_getopt.c:12:3: error: stray ‘\230’ in program
test_getopt.c:12:3: error: Stray ‘\342’ in program
test_getopt.c:12:3: error: stray ‘\200’ in program
test_getopt.c:12:3: error: stray ‘\231’ in program
test_getopt.c:13:4: error: Stray ‘\342’ in program
test_getopt. C :13:4: error: stray ‘\200’ in program
Say, the reason for this problem is that the source code exists in Chinese characters, such as “”,, etc., it can be changed!

Solution to “An error occurred while loading the archive” appears when decompressing the rar file compressed package

The installation
The reason is that the Linux version does not support RAR commercial/non-free formats by default, we just need to install UNrar.
compression

sudo apt-get install rar

Unpack the function

sudo apt-get install unrar


 
 
Reference:

    https://blog.csdn.net/KiWi_VC/article/details/88041211https://blog.csdn.net/songbinxu/article/details/80435665https://www.cnblogs.com/jiu0821/p/9066462.html

 

The use of Chinese characters in Qt and the solution to the “error C2001: newline in constant” problem

Problem description: In my program, I want to use the following code to change the prompt in the input field to “Please enter your password”. But the program error, unable to recognize Chinese characters.

QLineEdit *passwordEdit;
passwordEdit->setPlaceholderText("Enter your password please");

solution: use QString::fromLocal8Bit() method to transcode Chinese characters, the program can normally recognize Chinese character QString. Change the above code as follows:

    QString str;
    str=str.fromLocal8Bit("Enter your password please");
    passwordEdit->setPlaceholderText(str);

another problem: program error “error C2001: newline in constant”


Problem analysis: The encoding mode of the code file Login. CPP is not correct. Changing the encoding mode of the file login. CPP to UTF-8 can solve this problem. The method I used to modify the encoding method of the file was to open the CPP file with notepad software and select the encoding form of the file in the “Save as” window:

After saving the file as UTF-8, reload the file and compile the program. The error disappears and the Chinese character can be displayed normally.

SQL Error: 17059, SQLState: 99999

SQL Error: 17059, SQLState: 99999
Fail to convert to internal representation
The error is that the Hibernate configuration file cannot be converted into information for the corresponding table in the database.
In general, Hibernate field attributes are wrongly written, String type is written as long, number type is written as String and so on, causing the database content cannot be converted to Java class.  

caffe deep learning [three] compilation error: fatal error: hdf5.h: No such file or directory compilation terminated.

Question:
When configuring Caffe-SSD today, I was ready to compile Caffe when I encountered:

fatal error: hdf5.h: No such file or directory compilation terminated.

Such problems are shown in the following figure:

The reason is that the header file for HDF5.h was not found.
 
 
 
 
 
 
Solutions:
1. Modify makefile.config file
Go to the download directory for Caffe
In the makefile.config file, hold down CRTL + F to search: INCLUDE_DIRS
Note that it’s not makefile.config. example!!
Add/usr/include/hdf5/serial/to INCLUDE_DIRS
Namely, the original:

INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include

Now it’s:

INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/

 
 
2. Modify the Makefile file
In the Makefile file, press and hold CRTL + F to search: LIBRARIES +=
Note that this is not the makefile.config from step 1 above!!
Change HDF5_HL and HDF5 to HDF5_SERIal_HL and HDF5_serial.
Namely, the original:

LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_hl hdf5

Now it’s:

LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_serial_hl hdf5_serial

 
 
 
 
Results:

 
 
 

urllib2.HTTPError: HTTP Error 403: Forbidden

This occurs in the crawler process:

Traceback (most recent call last):
  File "D:\pythonDemo01\pythonDemo01\Demo19.py", line 11, in <module>
    response=urllib2.urlopen(imag_url)
  File "D:\Python27\lib\urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "D:\Python27\lib\urllib2.py", line 435, in open
    response = meth(req, response)
  File "D:\Python27\lib\urllib2.py", line 548, in http_response
    'http', request, response, code, msg, hdrs)
  File "D:\Python27\lib\urllib2.py", line 473, in error
    return self._call_chain(*args)
  File "D:\Python27\lib\urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "D:\Python27\lib\urllib2.py", line 556, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 403: Forbidden

Code:

imag_url='http://img4.imgtn.bdimg.com/it/u=495525449,2738183538&fm=214&gp=0.jpg'
response=urllib2.urlopen(imag_url)
with open('nv.jpg','wb') as f:
    f.write(response.read())

Baidu said the site has banned crawlers because we haven’t disguised ourselves as a browser yet:
It seems that we need to add something related to the request header:

headers={
'Accept-Language': 'zh-CN',
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko'
} 
imag_url='http://img4.imgtn.bdimg.com/it/u=495525449,2738183538&fm=214&gp=0.jpg'
res=urllib2.Request(url=imag_url,headers=headers)
response=urllib2.urlopen(res)
with open('nv.jpg','wb') as f:
    f.write(response.read())

 

yarn install gyp verb `which` failed python2 Error: not found: python2

Error
node-sass: Command failed for yarn startup project.

gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (F:\company_project\xiexin\trunk\app\xxsdapp\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (F:\company_project\xiexin\trunk\app\xxsdapp\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (F:\company_project\xiexin\trunk\app\xxsdapp\node_modules\which\which.js:80:29)
gyp verb `which` failed     at F:\company_project\xiexin\trunk\app\xxsdapp\node_modules\which\which.js:89:16
gyp verb `which` failed     at F:\company_project\xiexin\trunk\app\xxsdapp\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at F:\company_project\xiexin\trunk\app\xxsdapp\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:154:21)
gyp verb `which` failed  python2 { Error: not found: python2
gyp verb `which` failed     at getNotFoundError (F:\company_project\xiexin\trunk\app\xxsdapp\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (F:\company_project\xiexin\trunk\app\xxsdapp\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (F:\company_project\xiexin\trunk\app\xxsdapp\node_modules\which\which.js:80:29)
gyp verb `which` failed     at F:\company_project\xiexin\trunk\app\xxsdapp\node_modules\which\which.js:89:16
gyp verb `which` failed     at F:\company_project\xiexin\trunk\app\xxsdapp\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at F:\company_project\xiexin\trunk\app\xxsdapp\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:154:21)
gyp verb `which` failed   stack:
gyp verb `which` failed    'Error: not found: python2\n    at getNotFoundError (F:\\company_project\\xiexin\\trunk\\app\\xxsdapp\\node_modules\\which\\which.js:13:12)\n    at F (F:\\com
pany_project\\xiexin\\trunk\\app\\xxsdapp\\node_modules\\which\\which.js:68:19)\n    at E (F:\\company_project\\xiexin\\trunk\\app\\xxsdapp\\node_modules\\which\\which.js:80:29)\n    at
 F:\\company_project\\xiexin\\trunk\\app\\xxsdapp\\node_modules\\which\\which.js:89:16\n    at F:\\company_project\\xiexin\\trunk\\app\\xxsdapp\\node_modules\\isexe\\index.js:42:5\n
at F:\\company_project\\xiexin\\trunk\\app\\xxsdapp\\node_modules\\isexe\\windows.js:36:5\n    at FSReqWrap.oncomplete (fs.js:154:21)',
gyp verb `which` failed   code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python C:\Python27\python.EXE
gyp verb check python version `C:\Python27\python.EXE -c "import sys; print "2.7.15
gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
gyp verb get node dir no --target version specified, falling back to host node version: 10.15.0
gyp verb command install [ '10.15.0' ]
gyp verb install input version string "10.15.0"
gyp verb install installing version: 10.15.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 10.15.0
gyp verb build dir attempting to create "build" dir: F:\company_project\xiexin\trunk\app\xxsdapp\node_modules\node-sass\build
gyp verb build dir "build" dir needed to be created?F:\company_project\xiexin\trunk\app\xxsdapp\node_modules\node-sass\build
gyp verb Not using VS2017: Could not use PowerShell to find VS2017
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: F:\company_project\xiexin\trunk\app\xxsdapp\node_modules\node-sass\build\config.gypi
gyp verb config.gypi checking for gypi file: F:\company_project\xiexin\trunk\app\xxsdapp\node_modules\node-sass\config.gypi
gyp verb common.gypi checking for gypi file: F:\company_project\xiexin\trunk\app\xxsdapp\node_modules\node-sass\common.gypi
gyp verb gyp gyp format was not specified; forcing "msvs"
gyp info spawn C:\Python27\python.EXE
gyp info spawn args [ 'F:\\company_project\\xiexin\\trunk\\app\\xxsdapp\\node_modules\\node-Dnode_gyp_dir=F:\\company_project\\xiexin\\trunk\\app\\xxsdapp\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\Users\\curry\\.node-gyp\\10.15.0\\<(target_arch)\\node.lib',

Generate one project at a time in this solution. To enable parallel generation, add the "/m" switch.
The start time for generation is 2019/2/21 9:56:01.
Project "F:\company_project\xiexin\trunk\appxxsdapp\node_modules\node-sass\build\binding.sln" on node 1 (default target).
ValidateSolutionConfiguration:
  The solution configuration "Release|x64" is being generated.
MSBUILD : error MSB3428: Failed to load Visual C++ component "VCBuild.exe". To resolve this issue, either 1) install the .NET Framework 2.0 SDK; 2) install Microsoft Visual Studio 2005; or 3) if the component is installed in another location
Please add its location to the system path. [F:\company_project\x
iexin\trunk\app\xxsdapp\node_modules\node-sass\build\binding.sln]
The operation to generate the project "F:\company_project\xiexin\trunk\app\xxsdapp\node_modules\node-sass\build\binding.sln" (default target) has been completed. Failure.


Generating failure.

"F:\company_project\xiexin\trunk\app\xxsdapp\node_modules\node-sass\build\binding.sln" (default target) (1) ->
(_src_ d\libsass target) -> 
  MSBUILD : error MSB3428: Failed to load Visual C++ component "VCBuild.exe". To resolve this issue, 1) install the .
Please add its location to the system path. [F:\company_project
\xiexin\trunk\app\xxsdapp\node_modules\node-sass\build\binding.sln]

    0 warnings
    1 error

Time used 00:00:00.27
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (F:\company_project\xiexin\trunk\app\xxsdapp\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "F:\\company_project\\xiexin\\trunk\\app\\xxsdapp\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=
" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd F:\company_project\xiexin\trunk\app\xxsdapp\node_modules\node-sass
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

The solution

npm install -g mirror-config-china --registry=http://registry.npm.taobao.org
npm install node-sass
yarn install

Solve the problem of shell script “syntax error near unexpected token `fi'”.

Start by listing my shell script.
I edit it in the Windows editor and then upload it to Linux for execution.

#!/bin/bash
Monitor()
{
	pgrep -x mysqld &> /dev/null
	if [ $?-ne 0 ];
	then
		echo "At time: `date` :MySQL is stop .">> /opt/service/logs/mysqlMonitor.log
		/sbin/service mysqld start
	else
		echo "MySQL server is running ."
	fi
	echo "-----------------------------------"
}
Monitor

This error has been reported since Linux was executed.
mysqlmonitor.sh: line 9: syntax error near unexpected token `fi’
mysqlmonitor.sh: line 9: `fi’
At the beginning, I thought the Linux command was wrong. I looked up a lot of information. It was a simple statement, and I was sure it was right. But why report such an error?
I took the cat-v mysqlmonitor.sh command to see my code

Monitor()^M
{^M
        pgrep -x mysqld &> /dev/null^M
        if [ $?-ne 0 ];then^M
                echo "At time: `date` :MySQLM-BM- is stop .">> /opt/service/logs/mysqlMonitor.log^M
                /sbin/service mysqld start^M
        else^M
                echo "MySQL server is running ."^M
        fi^M
        echo "-----------------------------------"^M
}^M
Monitor^M

Found in Linux after the automatic view in the end of the line with ^M identity, through looking up the information that in Windows and Linux is not the same newline. The details can also be confirmed by the command again.
Open the file with Vim and type in command line mode

What we found was DOS

Now set our code mode with the command: set FF = Unix

And then save the code


Look again and discover that the code is programmed for Unix
Cat -v **.sh to see that the code is normal.
There are no errors in executing the code again.
If you think it’s working, check out this article below. You can also consult me through QQ: 772757263