Category Archives: How to Fix

Python TypeError: return arrays must be of ArrayType

from numpy import *
np.log(1.1, 2)

The above code will appear at run time

Typeerror: return arrays must be of arraytype, because the second parameter of log is not base but out array. If you just want to perform normal log operations, you can choose to use numpy.math.log (1.1, 2) or use the log function of Python’s math module

When vivado2017 is started, the “error when launching” dialog box will pop up vivado.bat : Launcher time out”

If oxc000007b error occurs at this time, it is because 32bit DLL is used in 64 bit OS. It is generally caused by the wrong use of vcomp140.dll.

Slove problem:

    Enter https://cn.dll-files.com Search and download the required DLL (mainly its own system bit 32 / 64) and copy the DLL to the directory according to the instructions
    on 64 bit windows,
    the default path of 32-bit DLL file is C: (Windows) syswow64
    the default path of 64 bit DLL file is C: (Windows) system32 \
on 64 bit windows

The proof of Chebyshev inequality

Details are as follows: http://makercradle.com/2017/%E5%88%87%E6%AF%94%E9%9B%AA%E5%A4%AB%E4%B8%8D%E7%AD%89%E5%BC%8F%E8%AF%81%E6%98%8E/

It is known that x is a continuous random variable,

E(X)=μ,D(X)=δ2

real number

ε>0

Verification:

P(∥X−μ∥≥ε)≤δ2ε2

prove:

  because:

δ2=V(X)

=∫+∞−∞(t−μ)2fX(t)dt

≥∫μ−ε−∞(t−μ)2fX(t)dt+∫+∞μ−ε(t−μ)2fX(t)dt

≥∫μ−ε−∞ε2fX(t)dt+∫+∞μ−εε2fX(t)dt

  due to:

t≤μ−ε⇒ε≤∥t−μ∥⇒ε2≤(t−μ)2

So there is

=ε2∫μ−ε−∞fX(t)dt+∫+∞μ−εfX(t)dt

=ε2P(X≤μ−εorX≥μ+ε)

=ε2P(∥X−μ∥≥ε)

Therefore, there are:

δ2≥ε2P(∥X−μ∥≥ε)

It’s true!

Access restriction in Eclipse: the type ‘xxx’ is not API solution

To report this error, you only need to change the JRE under the JDK path to an external JRE

Project – & gt; properties – & gt; Java build path – & gt; libraries, select JRE system library, and then remove. Then click Add Library – & gt; JRE system library – & gt; next, select alternate JRE, click installed jres, select JRE under the same level directory of JDK, and then click Apply – & gt; OK.

Learn about the role of two jres in Java: (the following is from http://blog.sina.com.cn/s/blog_ 7ffb8dd501011 sgc.html )

1. In the bin directory of JDK java.exe With external JRE java.exe The secret of
JDK java.exe And in JRE java.exe In fact, it’s the same, but we use external JRE in priority when running java.exe (even if we install JDK and configure environment variables).
first of all, let’s see what happened during the installation of JDK:
when installing JDK, you will install a JRE under its subdirectory. At the same time, you will be asked whether you want to install an external JRE during the installation process. If we choose to install, we have two jres at the same time. In fact, there is no difference between the two jres. The main difference is that the JRE in the JDK directory is mainly designed to run the tools that come with JDK (under the bin directory). The external JRE will automatically register to the path of the operating system when it is installed (but the path value of the command is not included in the path in my computer, properties, advanced system settings, environment variables and system variables). In general, it is in the system32 folder (the folder contains: java.exe javaw.exe javaws.exe Three files). Therefore, as long as we install external JRE (even if JDK is not installed and environment variables are not configured), we will use external JRE when running Java programs java.exe Program (even if JDK is installed and environment variables are configured) (the default path of the system has priority).  

2.
in short, JDK is an SDK for developers. SDK is a software development kit, which generally refers to software development kit, including function library, compiler, etc.
JDK (java development kit) provides java development environment and running environment, which is mainly used to develop java programs for Java program developers;
JRE (Java runtime environment) provides Java running environment, which is mainly used to execute Java programs for Java program users.
generally, each JDK contains two sets of jres. With JDK jdk1.6.0_ 22 (the default installation path is e: / / program files / Java), for example, in E: / / program files / Java / jdk1.6.0_ There is a JRE in the directory of 22, and there is also a JRE in the directory of C: program files. Why are there two jres? Because the tools in JDK are also written in Java, they also need a set of JRE when they are running, that is, e: \ “program files \” Java \ “jdk1.6.0_ 22 \ \ JRE under the directory. The JRE in the directory e: program files: Java is used to execute our own Java program. Of course, any one of the two sets of jres can be used to execute our own Java programs, but the tools in JDK can only be used by E: / / program files / Java / jdk1.6.0_ 22 \ \ directory.
since there are at least two sets of jres in our computers (if Borland JBuilder and other advanced development tools are installed, there will be more sets of jres in our computers), who will decide which set of jres to use? The burden falls on us java.exe On my body. (of course, when JDK is installed in 1, the external JRE is executed by default!)
when we enter:
java XXX
on the command line, java.exe Our task is to find the right JRE to execute XXX among the many jres on our computer. java.exe Search for jres in the following order:
(1) whether there is a JRE directory in your own directory;
(2) whether there is a JRE directory in your parent directory;
(3) query the registry HKEY_ LOCAL_ Machine / software / javasoft / Java runtime environment java.exe What is the difference between the results of the implementation and those in our computer java.exe (a search will reveal that there is more than one in our computer java.exe )It has a lot to do with the execution and which JRE will execute the JVA program.
in addition, java.exe After finding the right JRE, there is a verification version of the program, that is java.exe It can only be executed if it is consistent with the JRE version. If there is a version inconsistency problem, we must remember two things:
(1) which one java.exe Executed;
(2) java.exe Find out which JRE.
as long as these two things are determined, we will grasp the whole process of the problem and solve it easily.
3,
JVM (Java virtual machine) is a part of JRE, and JRE is the supplement of JVM. So where is the JVM? We can open C: / / program files / Java / JDK1.5. X / JRE / bin to see two directories: client and server. You can see them in these two directories jvm.dll This is what we call the JVM.

Statistical learning: ANOVA (analysis of variance) (1)

Statistical learning

Recently, in the process of processing data, I found that my theoretical knowledge was weak. Therefore, I started this series of posts to record my theoretical supplement process, which is convenient for later people to understand.

ANOVA (analysis of variance)

Analysis of variance (ANOVA), also known as “analysis of variance”, is invented by r.a.fisher, which is used to test the significance of mean difference between two or more samples. Due to the influence of various factors, the data obtained from the study showed volatility. The reasons for the fluctuation can be divided into two categories, one is the uncontrollable random factors, the other is the controllable factors applied in the study.

definition

Analysis of variance (ANOVA), also known as “analysis of variance” or “F-test”, is invented by r.a.fister. It is used to test the statistical characteristics of two or more sample sets: the significance of mean difference.
The basic assumption of ANOVA is the difference between the means of different sample groups. There are two basic sources:
(1) experimental variables, that is, the differences caused by the main differences of samples (for example, male and female), are called inter group differences. It is expressed by the sum of the square deviations of the mean values of all variables in each group and the total mean values of all variables mixed together. It is denoted as SSB, and its degree of freedom is DFB.
(2) random error, such as the difference caused by measurement error or the difference between individuals, is called intra group difference. It is expressed by the sum of the square sum of the deviations between the mean value of variables in each group and the value of variables in the group. It is recorded as SSW, and the intra group degree of freedom is DFW.
The sum of squares of total deviation SST = SSB + SSW.
Divide the intra group SSW and inter group SSB by their respective degrees of freedom (intra group DFW = N-M, inter group DFB = M-1, where n is the total number of samples and M is the number of groups), and get their mean square MSW and MSB. One case is that the experimental conditions have no effect, that is, the samples of each group are from the same population with the same distribution, MSB / MSW ≈ 1. The other is that the processing does work. The mean square between groups is the result of the error and different processing, that is, each sample comes from different populations. So, MSB & gt; & gt; MSW (much larger than 1).
The ratio of MSB / MSW constitutes F distribution. The F value is compared with its critical value as the basis for inferring whether each sample comes from the same population at a given significance.

The basic idea of ANOVA is to study the contribution of variation from different sources to the total variation, so as to determine the significance of controllable variables to the research results.

For example:

Here we use a simple example to illustrate the basic idea of ANOVA:
for example, the blood phosphorus values (mmolgl) of 11 patients with Keshan disease and 13 healthy people in a Keshan disease area are as follows:
patients: 0.84 1.05 1.20 1.39 1.53 1.67 1.80 1.87 2.07 2.11
healthy people: 0.54 0.64 0.64 0.75 0.76 0.81 1.16 1.20 1.34 1.35 1.48 1.56 1.87
healthy people: 0.54 0.64 0.64 0.75 0.76 0.81 1.16 1.20 1.34 1.35 1.48 1.56 1.87 Is the blood phosphorus value of Keshan disease patients different from that of healthy people?
It can be seen from the above data that the blood phosphorus values of 24 patients and healthy people are different. If the variation around the total mean value is described by the sum of squares of deviation (SS), the total variation has the following two sources:
intra group variation, that is, the blood phosphorus values in each group are not equal due to random error;
the total variation has the following two sources:
intra group variation The variation between groups, that is, due to the influence of Keshan disease, the mean value of blood phosphorus values of patients and healthy people are different.
And: SS total = SS between groups + SS within groups, V total = V between groups + V within groups
0 If the unit mean square (sum of squares of deviations divided by degrees of freedom) is used to replace the sum of squares of deviations to eliminate the influence of different sample numbers in each group, then the analysis of variance is to use the unit mean square between groups to remove the quotient of unit mean square within groups (i.e. F value) and compare it with 1. If f value is close to 1, it means that there is no significant difference between the mean values of each group. If f value is far greater than 1, it means that there is difference between the mean values of each group There was statistical significance. In practical application, the probability of F value greater than the given significance distribution can be obtained by consulting the f-cut-off table (for analysis of variance).

The difference between ANOVA, ttest and ttest2

1. Ttest test is generally used to test the mean value of the data from the same distribution, that is, to test whether the mean value of the distribution of the group of data is 0 (statistics can be constructed to verify that the mean value of the distribution is other values). It focuses on the significance of the difference between the mean value of this group of data distribution and the mean value you give him, such as testing whether the height of a group of people is the previous value, etc.

2. The ttest2 test is generally aimed at the test of the distribution mean value from two different samples. The original zero hypothesis is that the mean value is equal. He does not care what distribution these two groups of data come from, for example, the height and weight data of a group of people. The test assumes that the mean values of these two groups of distribution are equal, that is, whether the mean values of height and weight are equal.

3. One way ANOVA
one way ANOVA is used to study whether the different levels of a control variable have a significant impact on the observed variables. Generally speaking, it is to analyze the significance of the influence of the change of variable x on variable y, so if there is some influence relationship between the general variables, it is a test to verify the significance of the influence of the change of one variable on another variable.
In general, ANOVA is paired.
If from the calculation point of view, there is no need to calculate between independent samples, only calculate the mean value and standard deviation in this group, while in ANOVA, we need to calculate the difference between groups and within groups.

4 multivariate analysis of variance
multivariate analysis of variance is the statistical analysis of how many factors affect a variable. The analysis of covariance is a variety of factors, without considering a certain factor, the impact of other factors on the variable. For example, the sales volume of corn, the price of corn, and the price of popcorn (the example is not very good, but it probably means that a has a corresponding effect on B, and B has an impact on C, but a does not necessarily have an impact on C). That is, the higher the price of popcorn, the more the sales volume of corn, so they are in direct proportion. But this is obviously irrelevant. Because the price of popcorn and the sales volume of corn are related to the temperature of corn, covariance analysis should be used to analyze such problems.


Reference:
the difference between t test and ANOVA in SPSS,
one way ANOVA
ANOVA table

Rtmpdump open source project

Rtmpdump open source project: http://rtmpdump.mplayerhq.hu/

You can download the latest source code: git clone git://git.ffmpeg.org/rtmpdump

When compiling all functions, zlib can be used in combination with OpenSSL by default,
gnutls or polarssl can also be used instead.

Rtmpdump home page: http://rtmpdump.mplayerhq.hu/rtmpdump.1.html

Rtmpgw home page: http://rtmpdump.mplayerhq.hu/rtmpgw.8.html

Librtmp home page: http://rtmpdump.mplayerhq.hu/librtmp.3.html

Two server programs rtmpsrv and rtmpsuck have been added since v2.1.
rtmpsrv is a stub for a server; it logs the connect and play parameters from a regular client that connects to it. It then invokes rtmpdump with those parameters to retrieve the stream.

rtmpsuck is a transparent proxy; it intercepts connections from a client and then makes an outbound connection to the real server. After all handshaking is complete and encryption keys with both sides are negotiated, it records the cleartext stream data into files while relaying the data from the server to the client.

Unofficial versions can be found on the forum;

Forum address:
http://ffmpeg.zeranoe.com/forum/viewforum.php?f=29 note, this forum is not affiliated with the RTMPDump project.
http://stream-recorder.com/forum/rtmpdump-f54.html – note, that site is not affiliated with the RTMPDump project, but they’re pretty active with helping answer questions.

Rtmpdump is used in the following projects:
livestreamer
get flash videos
get_ iplayer(discontinued)
get_ iplayer
iFetch
yle-dl
youtube-dl
python-iview
mlbviewer
iViewNapper
TV3 al Cabàs
streamCapture
PlayDownloader
MTV.it download
Ed’s iPlayer Javascript BBC ripper
rtmpdumphelper (windows network hook for rtmpsuck/rtmpsrv)
SupercamBR
you-get

Librtmp is used in the following projects:
ffmpeg
Mplayer (THR ffmpeg)
HTS home theater system
curl

Patches for librtmp on other projects:
XBMC

Forks:
flvstreamer
xVideoServiceThief

See Also: rtspdump
rtspdump is a program which downloads rtsp:// multimedia stream from a Microsoft WMServer.