Tag Archives: notes

[solved] runtimeerror: module compiled against API version 0xc but this version of numpy is 0xb

This article records the solutions for bloggers to report errors in Import torch in Python. Updated on March 20, 2019.

This error is due to the current version of numpy does not meet the requirements.

First, run on the terminal:

python
import numpy
numpy.version

View the current version of numpy. Run after

pip3 install –upgrade numpy

Just update the numpy version. If it’s python2, use PIP .

More, welcome to the planet discussion.

ansoft:Com Engine non-responsive since

Ansoft :Com Engine Non-responsive since 17:23:04, October 18, 2015.If Persisting for Long, Functional Testing kills the Com Engine Process and Restart Analysis.
When this situation occurs in Ansoft simulation, the progress bar is 0 and unchanged. Many methods have been tried on the Internet, but the software crashed and was closed and then opened, which can be simulated normally.

Several ways to center elements horizontally and vertically

Six ways:
Absolute plus margin solution fixed plus margin solution display:table solution line-height solution flex layout solution transform unknown element width and height solution


Absolute + margin scheme

    div{
        position: absolute;
        width: 100px;
        height: 100px;
        left: 50%;
        top: 50%:
        margin-top: -50px;
        margin-left: -50px;
    }

Fixed plus margin scheme

    div{
        position: fixed;
        width: 100px;
        height: 100px;
        top: 0;
        right:0;
        left: 0;
        bottom: 0;
        margin: auto;
    }

Display: table scheme

    div{
        display: table-cell;
        vertical-align: middle;
        text-align: center;
        width: 100px;
        height: 100px;
    }

The line-height scheme for the inline element

    div{
        text-align: center;
        line-height: 100px;
    }

Flex Flexible Layout Solution

    div{
        display: flex;
        align-items: center;
        justify-content:center
    }

Transform unknown element width and height solution

    div{
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%)
    }

Ubutnu’s idea input method candidate box can’t follow the cursor

Problem orientation
In fact, the specific issue of the official seven years ago (reference), but the more pit is that the official has not solved the problem. Simply put, a bug in the JRE running environment of IDEA causes the input method to be unable to locate the mouse position. Therefore, we need to modify the running code of JetBrainsRuntime to fix this problem.
The solution

Modify JetBrainsRuntime

    Download the modified JRE environment
https://pan.baidu.com/s/1S6cEKQS9w9dKqCrlO4QJwg
Extract code: 21MR

    Change the startup environment for IDEA

Change your own JRE directory

/home/ XXX /idea-2020.1/bin/idea.shhome/XXX /idea-2020.1/bin/idea.sh

port IDEA_JDK=/home/ XXX /idea-2020.1/java-11.0.7-jetbrain.>r> export IDEA_JDK=/home/ XXX /idea-2020.1/java-11.0.7-jetbrain
Appendix:
JetBrainsRuntime

Error: solution to the problem of cannot find module ‘webpack / bin / config yargs’

In terminal use of VSCode, using NPM run dev causes an error

Error: Cannot find module 'webpack/bin/config-yargs

It is possible that the webpack-dev-server version number is too low
The solution
Uninstall webpack-dev-server globally first

npm uninstall webpack-dev-server -g

Then install the latest version

npm install [email protected]

Vscode cnpm: unable to load file, but open console with CMD without error

Question:
Install CNPM on the new computer. When running CNPM-V in VSCODE terminal, the following error will be reported:

CNPM: Unable to load file
C:\Users\Administrator\AppData\ NPM \cnpm.ps1 because script is not allowed to run on this system. For more information, please refer to the
https:/go.microsoft.com/fwlink/?
about_Execution_Policies in LinkID=135170. Position line :1 character :1
cnpm -v

  + CategoryInfo          : SecurityError: (:) [],PSSecurityException
  + FullyQualifiedErrorId : UnauthorizedAccess

Solution:
(1) Run VS Code as an administrator and open a terminal in VS Code
(2) Execute Get-ExecutionPolicy at the terminal, displaying Restricted
(3) Update the PowerShell policy and execute it on the terminal: set-executionpolicy RemoteSigned
(4) Examine the status of the policy again and execute: GET-EXECUTIONPOLICY at the terminal to show the RemoteSigned igned
(5) Re-input CNPM-V problem successfully solved
Just taking notes.

Python error open SSL.SSL.SysCallError :(-1,‘Unexpected EOF‘)

Ssl. syscallError :(-1,’Unexpected EOF’)
Verify = False: verify = False: verify = False: verify = False

Request, when using a proxy to crawl a web page
Verify = False; verify = False
code

URL = "https://docs.google.com/uc?export=download"

session = requests.Session()

response = session.get(URL, params = { 'id' : id }, stream = True )

Verify = False

URL = "https://docs.google.com/uc?export=download"

session = requests.Session()

response = session.get(URL, params = { 'id' : id }, stream = True, verify = False )

Node configuration environment variable and global installation of webapck

1. Installation of node in the underlying environment
Node website: https://nodejs.org
NPM doesn’t need to be installed by itself; Node comes with NPM
Enter Node-v and NPM-V in CMD to see the versions of Node and NPM
2. Configure node’s environment variables
If you install node using the default installation address, you do not need to configure the environment variable
. If you change the default address when installing node, you will need to configure the environment variable
My installation address is the NodeJS file on disk F
“F:\nodejs\node_global”
NPM config set “F:\nodejs\node_global”
NPM config set cache “F:\nodejs\node_cache”

“F:\nodejs\node_cache”
Next, configure the environment variable
and create a new variable in the system variable
variable name: NODE_PATH
variable value: F:\nodejs\node_global\node_modules create a new variable in the path of the system variable enter
%NODE_PATH% open path in the user variable create a new variable F:\nodejs\node_global
if there are other variable statements in the path related to node or NPM, especially under C, If new files are generated in the node_cache and node_global folders, then the node environment is configured successfully

3. Install global WebPack
The NPM install webpack-g statement we just used to test node’s environment variables is the global installation statement for webpack, so we have already installed the global webpack
. Since I reported almost every error I could when installing webpack, just in case, let’s install it again!
Then we install
in CMD to execute NPM install — global webpack using the installation statement provided on wabpack’s official website
Since it is installed in NPM, so the installation speed is a little slow, the left ellipsis is the progress bar, we try to install in a good network environment, otherwise it will get stuck to your despair
Once installed, execute Webpack-V in CMD if the version number appears to indicate a successful installation.

User CF itemcf collaborative filtering algorithm based on user and item

UserCF:
weight coefficient: the similarity between all non-target users and Target users, normalized (that is, the sum is 1).
calculates the score of the ith item by multiplying the score of the Target item by the weight factor of the non-target user.
considering that some users like high score and some like low score, decentralization + centralization strategy is often adopted.

1 2 3 4 5
A 10 9 9 8 10
B 7 4

6 6 5
C 10 7 10 10 10
D 10 9 7 7 9
E 6<10/td>

7

8

?

For here

S

E

.

5

S_{E,5}

SE, the value of 5:
1. Calculate the similarity of user 1-4 and 5 (use the value of goods A-> D);
2. Normalization of similarity, that is, the sum of 4 similarities is 1; 3. The ith similarity times (the ith user’s rating of item E – the ith user’s average rating of all items) (decentralize), sum the four results, and add the average rating of Target user (centralize). I = 1, 2, 3, 4.
ItemCF:
weight coefficient: similarity of non-target goods, and normalized (making the sum 1);
then multiply each non-target user’s rating of the Target product by the weight coefficient to get the Target user’s rating.
Ditto for

S

E

.

5

S_{E,5}

The value of SE,5:
1. Calculate the similarity of goods a-d and E (using 1-4 users with ratings);
2. Normalization of similarity coefficient; 3. The ith similarity multiplied by (user 5’s score for item j – user 5’s average score for all items) (decentralize), sum the four results, plus the average score for item E from user 1-4 (centralize). Ibid., j=A,B,C,D.

Java class file operation and exception

The File class operates on files and directories
CreateNewFile create file
Mkdir mkdirs create file
Exists to determine whether a file or folder exists
Length gets the file length
LastModified Time
GetName gets the name of the file or folder
GetPath relative path
Absolute path of getAbsoultPath

Runtime Exception
ArithmeticmeticException
Abnormal ArrayIndexOutOfBoundsException array index of crossing the line
NullPointerException NullPointerException
Type cast exception ClassCastException
Illegal parameter exception IllegalArgumentException
Index overbounds Exception IndexOfBoundsException
Checked Exceptions are non-runtime exceptions
I/O exception IOException

Introduction of Hadoop HDFS and the use of basic client commands

HDFS basic functions
Basic function
has the basic operation function of file system;

file blocks for unit store the data in different machine disk
the default 128 MB large data slices, 3 copies of the
the NameNode master node: virtual directory maintenance, management of child nodes (Secondly the NameNode) storage resources scheduling, and the client interaction
the DataNode from multiple nodes: save the data, register when they start with the master node, the master node can know the information of it, convenient later call
(DataNode from cluster nodes to meet the basic conditions: Linux01, 02 01… The IP domain name between the secret set. Because nodes communicate with each other)
Linux01:NameNode DataNode
Linux02:DataNode
Linux03:DataNode
Use of client base commands

    location bin/HDFS DFS among them are some commands to upload: HDFS DFS – put./to/(the front is a local path, followed by HDFS path) directory: HDFS DFS – ls/(files in the directory view points, and other road king in the same way) to create folders: HDFS DFS – mkdir/data (create the folder in the root directory) to check the file content: HDFS DFS – cat file path from HDFS download: HDFS DFS get /data/1.txt/(HDFS path in front followed by local path)

Creation and use of Oracle sequence

Creation of an Oracle sequence
CREATE SEQUENCE name
[br>]
[START WITH n]
[{MAXVALUE n>5 NOMAXVALUE}]0
1 2 [{MINVALUE n>6 NOMINVALUE}]3
4 [{CYCLE|NOCYCLE}]
[{CACHE n| NOCACHE}];
Parameter description:
INCREMENT BY– the step of a sequence change, that is, the step of the sequence, defaults to 1; Negative values indicate that the value of this Oracle sequence is decreasing in this step.
START WITH– – the initial value of the sequence, default is 1.
MAXVALUE – – the maximum that can be generated by the sequence. (default does not limit maximum: NOMAXVALUE — for increasing Oracle sequences, the maximum the system can produce is 10 to the 27th power; For descending sequences, the maximum value is -1)
MINVALUE – – the minimum value that can be generated by the sequence. (default does not limit minimum: NOMINVALUE)
CYCLE – – used to define whether a CYCLE (NOCYCLE: NOCYCLE, CYCLE: CYCLE) will occur when the value produced by the sequence reaches the limit value.
CACHE – – represents the number of cached sequences. Abnormal termination of the database may cause the sequence to be interrupted and discontinuous. The default value is 20.
Example:

CREATE SEQUENCE SEQ_DEMO INCREMENT BY 1 START WITH 1 NOMAXVALUE NOCYCLE NOCACHE

Use of Oracle sequences
currval – represents the current value of the sequence, the new sequence must be used once nextval to obtain the value, otherwise an error will be reported
nextval – represents the next value of the sequence. The first time a new sequence is used, the initial value of the sequence is obtained, and the set step increments start from the second use
The value of the query sequence:
select seq_name.[currval/nextval] seqno from dual;

1) dual : is a virtual table of oracle, not real.
2) seq_name : is the name given by the developer as a “sequence”, which is usually used to generate id Numbers.
3) seq_name.nextval : takes the next value of the sequence. If the current value of the sequence is 100, execute the above SELECT statement and seqNO becomes 101. One more time, seqno will get to 102… …

Conclusion:
To implement id autoincrement, Oracle needs to use sequence implementation. nextval must be called to generate a sequence value before using currval to see the current value. The starting value of the sequence must not be less than the minimum value; To create a loop sequence, the maximum value must be set; If a cached sequence is created, the cached value must satisfy the constraint formula: Max - min > =(cache value -1)* the value of each loop .