Author Archives: Robins

[Solved] Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by serv

mysql reports Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client

Cause: An error is reported due to the mysql8.0 encryption method.

 

Solution:

execute instruction

mysql -u root -p

123456

use mysql;

alter user ‘root’@’localhost’ identified with mysql_native_password by ‘123456’;

flush privileges;

Note: 123456 is my own password to connect to the database

[olved] flume Install Error: Could not find or load main class org.apache.flume.tools.GetJavaProperty

Problems with flume installation:

Error: Could not find or load main class org.apache.flume.tools.GetJavaProperty
Error: Could not find or load main class org.apache.flume.tools.GetJavaProperty
Error: Could not find or load main class org.apache.flume.tools.VersionInfo

 

Solution:

1. Check your own configuration path:

sudo vim /etc/profile

 

 

source /etc/profile

run again:

2. Flume and hive conflict

Solution:
Modify the Hbase configuration file hbas-env.sh to:
1. Comment out the line configuration of hbase.env.sh of hbase
# Extra Java CLASSPATH elements. Optional.
#export HBASE_CLASSPATH=/home/hadoop/hbase/ conf
2 , or change HBASE_CLASSPATH to JAVA_CLASSPATH, the configuration is as follows
# Extra Java CLASSPATH elements. Optional.
export JAVA_CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

Error resolving template [index], template might not exist or might not be accessible by any of the configured Template Resolvers

Error resolving template [index], template might not exist or might not be accessible by any of the configured Template Resolvers

Error parsing template [index], template may not exist or may not be accessible by any configured template parsers

The problem here is that the index is not found, I checked it, and the path of the index is wrong


@Controller
public class shrioController {
    @RequestMapping({"/","/index"})
    public String toIndex(Model model){
        model.addAttribute("msg","hello,Shiro");
        return "index";
    }
}

image
The index path here should be “/templates/index”

[Solved] Windows Error: WslRegisterDistribution failed with error: 0x80070050

I recently upgraded the windows10 system of the old computer, and found that the ubuntu20.04 installed in wsl2 cannot be started normally in the windows terminal (I used ubuntu20.04 as the default startup terminal before.)

Involved in reporting errors:

WslRegisterDistribution failed with error: 0x80070050

My thoughts:

The error is that the distribution of wsl cannot be registered, so you need to edit the distribution-related configuration items in the registry to solve the problem.

Solution:

Please backup (using the steps I mention in my previous answer) before trying this.
wsl --shutdown (from PowerShell or CMD)
In Windows, run the Registry Editor
Find \HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss
Find the key in there that has DistributionName of Ubuntu20.04LTS. Change the Ubuntu20.04LTS to Ubuntu-20.04.
In theory, that may fix the problem by changing the distribution name back to what it should be.

[Solved] pydotplus generate iris.pdf error: InvocationException: GraphViz’s executables not found

error: InvocationException: GraphViz’s executables not found The
source code is as follows

from itertools import product

import numpy as np
import matplotlib.pyplot as plt

from sklearn import datasets
from sklearn.tree import DecisionTreeClassifier


# Still using the iris data that comes with it
iris = datasets.load_iris()
X = iris.data[:, [0, 2]]
y = iris.target

# Training the model, limiting the maximum depth of the tree to 4
clf = DecisionTreeClassifier(max_depth=4)
#Fitting the model
clf.fit(X, y)


# draw
x_min, x_max = X[:, 0].min() - 1, X[:, 0].max() + 1
y_min, y_max = X[:, 1].min() - 1, X[:, 1].max() + 1
xx, yy = np.meshgrid(np.arange(x_min, x_max, 0.1),
                     np.arange(y_min, y_max, 0.1))

Z = clf.predict(np.c_[xx.ravel(), yy.ravel()])
Z = Z.reshape(xx.shape)

plt.contourf(xx, yy, Z, alpha=0.4)
plt.scatter(X[:, 0], X[:, 1], c=y, alpha=0.8)
plt.show()

There is no problem up to here, then start generating the image of the spanning tree, here is the code

from IPython.display import Image  
from sklearn import tree
import pydotplus 
dot_data = tree.export_graphviz(clf, out_file=None, 
                         feature_names=iris.feature_names,  
                         class_names=iris.target_names,  
                         filled=True, rounded=True,  
                         special_characters=True)  
graph = pydotplus.graph_from_dot_data(dot_data)  
Image(graph.create_png())

I started to report errors . I
InvocationException: GraphViz's executables not found
learned through Baidu that the environment variables of graphviz were not configured properly,
but I didn’t know where my graphviz was installed,
so I used everything (a very useful software for finding files) to find my graphviz in the bin file. The location
and then edit the environment variables
and finally successfully run the code

[Solved] brew update Error: “fatal: Could not resolve HEAD to a revision”

brew update reports “fatal: Could not resolve HEAD to a revision”

When executing the brew update command:

% brew update
error: Not a valid ref: refs/remotes/origin/master
fatal: Could not resolve HEAD to a revision
Already up-to-date.

resolve
% brew update –verbose

% brew update -verbose
Checking if we need to fetch /opt/homebrew...
Checking if we need to fetch /opt/homebrew/Library/Taps/homebrew/homebrew-cask...
Fetching /opt/homebrew...
Checking if we need to fetch /opt/homebrew/Library/Taps/homebrew/homebrew-core...
Fetching /opt/homebrew/Library/Taps/homebrew/homebrew-core...
Fetching /opt/homebrew/Library/Taps/homebrew/homebrew-cask...
fatal: unable to access 'https://github.com/Homebrew/homebrew-cask/': Failed to connect to github.com port 443: Operation timed out
Error: Fetching /opt/homebrew/Library/Taps/homebrew/homebrew-cask failed!
Updating /opt/homebrew...
Branch 'master' set up to track remote branch 'master' from 'origin'.
Switched to and reset branch 'master'
Your branch is up to date with 'origin/master'.
Switched to and reset branch 'stable'
Current branch stable is up to date.

Updating /opt/homebrew/Library/Taps/homebrew/homebrew-core...
fatal: Could not resolve HEAD to a revision

Open the error path:

% cd /opt/homebrew/Library/Taps/homebrew/homebrew-core
% ls -al

total 0
drwxr-xr-x   3 [email protected]  admin   96  4 13 16:34 .
drwxr-xr-x   4 [email protected]  admin  128  4 14 11:31 ..
drwxr-xr-x  12 [email protected]  admin  384  4 14 11:44 .git

implement:

% git fetch --prune origin
% git pull --rebase origin master

From https://mirrors.ustc.edu.cn/homebrew-core
 * branch                  master     -> FETCH_HEAD

Execute after success

% brew update

Already up-to-date.

Then you can execute other commands normally

eg. % brew install rbenv ruby-build

[Solved] mujoco_py Run example Error: ERROR: GLEW initalization error: Missing GL version

After the successful installation of mujoco_py, run the example in the built-in example and find an error:  ERROR: GLEW initalization error: Missing GL version

 

 

 

 

Modify the configuration in .vimrc and add the following:

export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libGLEW.so

 

 

 

 

 

 

 

=================================================

 

 

 

 

All examples of mujoco_py below:

 

 

 

 

 

 

 

requires attention:

 

Run the example that comes with mujoco-py:

body_interaction.py disco_fetch.py ​​markers_demo.py render_callback.py setting_state.py tosser.py

Environment variables need to be set:

export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libGLEW.so

Otherwise, an error will be reported:

ERROR: GLEW initalization error: Missing GL version

 

 

Run the built-in example:

internal_functions.py multigpu_rendering.py

Environment variables need to be set:

export LD_PRELOAD=”

Otherwise, an error will be reported.

 

 

 

For a personal analysis of the environment variable export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libGLEW.so setting:

The mujuco211 version itself comes with the glew library, so when running mujuco-py to run the simulation, set export LD_PRELOAD=”

But when running the visual drawing, you need to call the glew library of the system. At this time, set export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libGLEW.so

If the glew library of the system is not called when drawing, a version error will be reported, and if the glew library of mujoco itself is not called when running the simulation, an error will also be reported.

 

 

 

 

The serialize_model.py substep_callback.py in the example does not need to set environment variables.

 

 

mjvive.py needs the support of VR SDK, etc., which is not considered here. (This should be run after you install HTC’s VR device client on your linux computer)

How to Solve setSupportActionBar() Method Error

In Android development, to use the ToolBar control to replace the ActionBar control, you need to use the setSupportActionBar() method in the java code, as follows:

1 Toolbar toolbar = (Toolbar) this.findViewById(R.id.toolBar);
2 this.setSupportActionBar(toolbar);

There are two common types of errors:

1. Method parameter error


This kind of error is because the wrong class is imported, put the following code

1 import android.widget.Toolbar;

Replace with the following code

1 import android.support.v7.widget.Toolbar;

 

2. Method name error

Need to inherit ActionBarActivity class or AppCompatActivity class.

Because the ActionBarActivity class is obsolete, it is recommended to inherit the AppCompatActivity class.

Note: If you inherit the AppCompatActivity class, you need to use the Theme.AppCompat.Light.NoActionBar theme, for example

<style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowActionBar">false</item>
</style>

[Solved] Windows 10 remote error: Oracle fix due to CredSSP encryption

Windows10 remote desktop connection error message:

 

I found a method on the Internet, but it is ” Win10 Home Edition ” that cannot use this method, the specific operation can be found in the reference link at the end!!!!

Policy Path: Computer Configuration -> Administrative Templates -> System -> Credential Assignment

Setting Name: Encrypt Oracle Fix

I can only change another kind of registry and change it for a long time and finally change it and post the detailed steps .

1. Open the registry and quickly enter “regedit” (similar to entering cmd at the command prompt)

2. Find the folder path: HKLM (abbreviation)\Software\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters

Probably after the System, there is no need to create a folder by yourself.

3. Then create a new DWORD (32) bit in the bottom folder.

Filename “AllowEncryptionOracle”, Value: 2.

Just save it.

4. If it doesn’t work, try restarting. I can use it without rebooting.

[Solved] jQuery Error: Uncaught ReferenceError: $ is not defined

When using jQuery, I found the following error:

Uncaught ReferenceError: $ is not defined (anonymous function)

The reason for this error:

1. The path of the jQuery library file is incorrect. Checking whether the file path is correct can usually solve the error.

2. If the path of the library file is correct, the order of loading the jQuery library file in the html may be wrong. If the jQuery library file is loaded in the first position, the error can be solved.