Tag Archives: The problem

ValueError: Integers to negative integer powers are not allowed.

Contents of articles

The cause of the problem is solved

problem

Run the following code to prompt for an error

rowsum = np.array([1,2,3])
r_inv = np.power(rowsum, -1)

ValueError: Integers to negative integer powers are not allowed.

reason

The data type of rowsum is integer, not floating-point number. Only floating-point number can perform power operation

solve

rowsum = np.array([1,2,3], dtype=np.float32)
r_inv = np.power(rowsum, -1)

Error reporting in CentOS 7 using yum

Yesterday, we encountered a problem. CentOS 7 reported an error using the yum installation command

yum install unzip zip

yum install unzip zip

Error reporting
Baidu error reporting is probably due to the image problem. To use the alicloud image
modification command, first backup CentOS- Base.repo , rename it

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

Then download the image
centos7:

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

And then you see, there’s a new CentOS- Base.repo
Just clear the yum cache and regenerate it

yum clera
yum makecache

When the cache is regenerated, it will run for a while. When the cache is generated and no error is reported, you can download it using yum

Illegal escape character in string literal

The Illegal escape character in string literal error occurred when using spring MVC pattern to write action. It was found that “\” was used as the path separator, such as “Index\ Index “. When using this slash, another \ escape should be added in front of it. “/” is recommended as the separator or file.separator; \ “is best avoided.

A server error occurred. Please contact the administrator.

preface
Regarding the site management of Django, the login site admin encountered A server error “A Server error occurred. Please contact the Administrator.”
why
Localization, letter case didn’t pay attention to, the right is LANGUAGE_CODE = 'useful - Hans and TIME_ZONE =' Asia/Shanghai , then analysis is setting up the contents of the file is changed after cannot be interpreter identification, so later met the same problem can according to this train of thought analysis (then if new create a project to try again, or if the original error, before the project could be open). Without the model migration, the project's data tables will not be generated, and the login site is a data table operation. Without the migration, how can you log into the site if there are no tables?

Package inputenc Error: Unicode character , (U+FFØC) (inputenc) not set up for use with L aTeX. See

The article directories
Solution to the problem cause

The problem
Compiled using latex paper, appear the following Error
y.t ex. 75: Package inputenc Error: Unicode character, (U + FF Ø C) (inputenc) not set
the up for use with L aTeX. See the inputenc Package documentation for explanation.
why
Press the prompt to position to line 75. One comma that I found particularly odd was a Chinese-style comma.

The solution
Remove the Chinese comma and replace it with an English one