Tag Archives: essays

Solve the problem that “figure size 640×480 with 1 axes” does not display pictures in jupyter notebook

Problem code: (negligible code)

import numpy as np
from sklearn.feature_selection import SelectKBest, f_classif
import matplotlib.pyplot as plt
predictors = ["Pclass", "Sex", "Age", "SibSp", "Parch", "Fare", "Embarked", "FamilySize", "Title", "NameLength"]

# Perform feature selection
selector = SelectKBest(f_classif, k=5)
selector.fit(titanic[predictors], titanic["Survived"])

# Get the raw p-values for each feature, and transform from p-values into scores
scores = -np.log10(selector.pvalues_)

# Plot the scores.  See how "Pclass", "Sex", "Title", and "Fare" are the best?
plt.bar(range(len(predictors)), scores)
plt.xticks(range(len(predictors)), predictors, rotation='vertical')
plt.show()

# Pick only the four best features.
predictors = ["Pclass", "Sex", "Fare", "Title"]

alg = RandomForestClassifier(random_state=1, n_estimators=50, min_samples_split=8, min_samples_leaf=4)

Running results:
& lt; figure size 640x480 with 1 axes & gt;
no pictures are displayed

Solution:
Add % Matplotlib inline to the code header

import pandas #ipython notebook
titanic = pandas.read_csv("titanic_train.csv")
titanic.head(5)
#print (titanic.describe())
%matplotlib inline

The video cannot be played because you have disabled the cookie

Today, I suddenly want to see “happy dramatist”, Google browser Click to play, the result is “because you disable the cookie, the video can’t play…” this situation…

It’s not a big problem either. I just found out where the cookie is after a round of setting. It’s still Baidu… So it’s this

In content settings

OK, I don’t have any problem. I just didn’t know what happened before. I went back to refresh the website and came out… It’s so funny. I don’t know if I can refresh the web page before. But at least we can find something that we hope we can use in the future.

Attributeerror: module “Seaborn” has no attribute “lineplot”

Contents of articles

Preface text

preface

When drawing the diagram, I learned a new library and encountered bugs, but fortunately, I found a solution

text

The specific problem is that the version is wrong, and 0.9 is OK. You can check the version through the command:
PIP freeze | grep Seaborn
or
PIP3 freeze | grep Seaborn
you can check the version through CONDA
CONDA install - C Anaconda Seaborn = 0.9.0
for details Some packages are not included in the default channels of CONDA, such as cudatoolkit-8.0, cudnn, and so on. At this time, you only need to add – C Anaconda after the CONDA install command
or pip:
PIP3 install Seaborn = = 0.9.0
to install the corresponding version
it is recommended to use pip, and the matching image is very fast. There seems to be no network error on the image of CONDA Tsinghua.
Then, there may be version errors in Python 3.6. The following lists the libraries with version problems that I encountered, and gives the possible version
numpy = = 1.15.0
SciPy = = 1.0.0
panda = = 1.0.0

AES CBC PKCs × 7 encryption

Performing encryption behind Java. Security. InvalidKeyException: illegal Key Size
Because the key is more than 128, sell Java. Security. InvalidKeyException: Illegal key size. Because the key length is limited, the Java runtime environment reads restricted policy files.
solution :
lution A:
g> the official download of the JCE unrestricted permission policy file, and replace the corresponding file
JDK7 download address: http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html
JDK8 download address: http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html
Download after decompression can see local_policy. Jar and US_export_policy jar and readme. TXT
if installed JRE, put the two jar files in % JRE_HOME % \ lib \ security directory under the cover of the original file
if installed JDK, and put the two jar files are in % JDK_HOME % \ JRE \ lib \ security directory to cover the original file
Option B:
Replace Oracle JDK with OpenJDK, the free and open source Java version of Oracle. OpenJDK does not have this limitation, and most Java services run on the OpenJDK environment

Matlab shows license manager error – 103

[Problem Description]
Remote login and open Matlab, prompt the following information:

License Manager error-103.
Terminal Server remote client not allowed
Feature: MATLAB
License path: D:\Program files\TLAB71\bin\win32\license.dat;
D:\Program files\MATLAB71\bin\win32\*. Lic
FLEXlm error: -103,577
For further information, refer to the FLEXlm End User Manual,
available at “www.macrovision.com”.
For more information, see The MathWorks Support page at
http://www.mathworks.com/supportand search for
“license manager error -103”
[Version Information]
Matlab2006Ra
[Solution]
Through Baidu search, it is found that many people have encountered the same problem, some say it is the problem of remote login, some say it is the problem of non-legal version, as for the solution, some advocate reinstallation, some even restore the system. Below is from http://www.mathworks.com/support/solutions/data/32791.shtml
turned to writing

———————–
Problem Description
Why do I get license manager error-103?
License Manager error-103
Terminal Server remote client not allowed

Solution:
Contrary to the Error message text, this Error may be the result of changing u
sernames using the Sw Itch User feature in Windows xp. This feature can be enab
led on Windows XP computers that are not connected to a domain. It allows User
s to switch usernames without logging out or closing appl Tides.
If a user logs in under one username, MATLAB, and switches to another us
ername without closing MATLAB, they will receive license manager error-103 After usernames does not resolve the problem.
common, switching usernames to the original username does not resolve the I
ssue. The only way to resolve this issue is to do a clean Reboot of the system
nwindows xp.
This error also occurs on systems using Terminal Services, which is unsupporte
d in This release of matlab. There are no current plans to provide support for
Wind Ows Terminal Services. For more information please see:
What errors will I receive if I run MATLAB on a Windows Terminal Server?http://www.mathworks.com/support/solutions/data/26440.shtml

— — — — — — — — — — — — — — — — — — — — — — — — — –

As described in the overview, the problem may be due to multi-user switching or “Windows Terminal Server” (such as remote service?). As a result, there should be no need to reinstall or system restore. Remote let the computer restart, login again or not open Matlab, the error message still exists. Consider the question of remote login. Because the remote login was used to use Matlab, Matlab was opened before the login, rather than after the remote login, which may be the reason why there was no error before and now there is an error. On the Internet to see someone said, “use remote desktop login to the server using Matlab, in the remote host must have a local user login. This is a FLEXlm bug, “which, it seems, is probably due to the remote.
Next test step: log in the computer locally and open Matlab to see if there is an error message.
Results: After opening Matlab on the local machine, there was no prompt message again, and the problem was solved.
[conclusion]
Matlab this error message, usually caused by remote login. The reason is probably a bug in FLEXlm. Any software that USES FLEXlm must have a local user login when it is opened, otherwise the remote login will be wrong. The same error can occur with Ansys, Solidworks, Proe, and some EDA software. Therefore, if you want to use the software on the remote computer, you must first open the program on the remote computer, or you may run into this problem if you open it directly from the remote desktop.

C + +: error in X utility file

In the middle of writing the program and testing it, there were a bunch of syntax errors that came from xUtility files.
opens the xutility file, which defines many constructs and function templates. Find the source of the error is not found, because it is similar to the lack of; “And so on. So back before writing the code, and finally found the problem: in the global defines a short function, then the short function and a function template name repetition, combined with the incoming parameters when calling type does not conform to the global defines the type of function, to the template, but does not define the type of template function, hence lead to errors.
correction method:
1. Change function name, error parameter type will report the correct position
2. Use scope to avoid ambiguity caused by improper parameter types

JS error: require is not defined

Reasons for error:
The browser side cannot recognize the require keyword, which is required under node.js environment. It is common to require modules in node_modules folder
Solutions:
Compile the JS file with the tools Browserify or WebPack to make it browser-aware.
// Install Browserify, which I’m using as a global installation
npm install -g browserify
//compile
browserify ./source/module.js -o ./dist/dist.js
You can see the packaged Dist. Js file in the dist directory. The first parameter after
browserify represents the entry of the front-end program to be packaged, -o or > Represents the packaged output file. Browserify automatically completes dependency analysis based on require or Import (ES6, need to install Babel) in the entry file and packages the dependency file into a single file.