Tag Archives: notes

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 .

Could not publish server configuration for Tomcat v8.5 server at localhost

Could not publish Server Configuration for Tomcat V8.5 Server at localhost. The solution
Problem analysis
Possible exception: Multiple duplicate project names are stored in the Context tag in the server.xml file in the Servers file
The solution
Find the Servers file in Eclipse. Find the folder with the name of the server used to start the project in it, and under its directory find the server.xml file
At this time found that the document is very lengthy, small white shows that look dizzy..
Find the Design view at the bottom, click on the Design view to change the view, find the small arrow to the left of Servers, click on the small arrow to see the subdirectory of Servers, and keep looking for the small arrow until you find the Context.

You can clearly see the duplicate item name in the Context, right-click on it and select Remove to remove the redundant Context save (Ctrl+S or click save in the upper left corner, the * on the file label will disappear).
We’re done. Go and restart the project.

On and off of timer in JS

setInterval()
When a function
is called for a specified period of time:

setInterval(function,time,lang)

function: function to be called or code string to be executed
time: required parameters, every how long to call the function, in milliseconds
lang: optional parameters, running JScript | VBScript | JavaScript
clearInterval()
Means to stop the setInterval timer call function

function getTime() {
        console.log(123);
        if (true) {
            clearInterval(db)
        }
    }

let db = setInterval(getTime, 1000)

setTimeout()
Call a function after a certain time
syntax:

setTimeout(function,time,lang)

Function:
function: required, to be called
time: required, number of milliseconds to wait before executing code
lang: optional, script language: JScript | VBScript | JavaScript

Solve the flash card problem of winfrom project form

Add skin version, add
// to form loading event to make form not flicker
SetStyle(controlstyles.userpaint, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);// erase background is prohibited.
SetStyle (ControlStyles. OptimizedDoubleBuffer, true); // double buffering
this.UpdateStyles();

///
///
///
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.createparams;
cp.ExStyle |= 0x02000000;
return cp;
return cp;
return cp;
}
}

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full comm

After the superset installation, PIP Install MysqlClient was required to connect to the database, but it would report an error. At first, I found several methods on the Internet, but found none of them matched my problem.

yum install mysql-devel
yum install python-devel
yum install python-devel
yum install mysql-devel
yum install python-devel
After the installation is complete, proceed to
PIP install mysqlclient

problem solved!

Java was started but returned exit code = 13 problem solving

I also configured the environment after installing the JDK, and the configuration of the environment was fine. Finally, I downloaded Eclipse and opened it and found the error shown in the following figure:
Java was started but returned exit code=13
C:\ProgramData\Oracle\Java\javapath\javaw.exe

 
I searched the Internet first, and the answers I got were mostly unreliable. Then I checked over the wall geogel, and the answers I got were roughly in two aspects:
(1) There is a problem with the JDK environment
(2) The Jdk version is not consistent with the Eclipse version (Jdk is 32bit, Eclipse is 64bit or vice versa)
 
If a JDK environment error occurs, the general solution is to add the following sentence to the eclipse.ini (the same folder as Eclipse) file:
-vm
C: \ Program Files \ Java \ jdk1.7.0 _60 \ bin \ avaw exe
It’s not adding
-vm
C:\ProgramData\Oracle\Java\javapath\javaw.exe
 
After the above sentence is added, restart Eclipse, and the following error is found:
Failed to load the JNI Shared Library “C:\Program Files (x86)\Java\ JDk1.8.0_101 \ JRE \bin\ Server
\jvm.dll

 
Therefore, I looked for errors such as Failed to load the JNI Shared Library. Generally, there are two cases:
1. There is a problem with the environment configuration of the JDK
2. JDK version not consistent with Eclispe (32-bit/64-bit)
 
So from our results above we can see that we have changed the configuration in Eclipse.ini and still can’t fix the problem. There is a new problem, which is probably the JDK and eclipse version.

According to the above methods, it turned out that the inconsistency between the version of my JDK and eclipse caused our initial problems. My operating system was 64-bit, eclipse was 64-bit, while the JDK was 32-bit. Finally, I downloaded a 64-bit JDK and started Eclipse as normal.
 
 
Resources from:
http://stackoverflow.com/questions/4587518/eclipses-error-on-startup-in-windows-7
http://www.myexception.cn/program/2036913.html