QA Official

Dynamic Proxy (III) ---Cglib Two Proxy Methods

https://qaofficial.com/post/2019/04/09/69739-dynamic-proxy-iii-cglib-two-proxy-methods.html 2019-04-09
Cglib generated proxy object codeComments have been added. // // Source code recreated from a .class file by IntelliJ IDEA // (powered by Fernflower decompiler) // package com.cglib.test; import com.cglib.test.TestMain.TestBean; import java.lang.reflect.Method; import net.sf.cglib.core.ReflectUtils; import net.sf.cglib.core.Signature; import net.sf.cglib.proxy.Callback; import net.sf.cglib.proxy.Factory; import net.sf.cglib.proxy.MethodInterceptor; import net.sf.cglib.proxy.MethodProxy; public class TestMain$TestBean$$EnhancerByCGLIB$$784df3e2 extends TestBean implements Factory { private boolean CGLIB$BOUND; private static final ThreadLocal CGLIB$THREAD_CALLBACKS; private static final Callback[] CGLIB$STATIC_CALLBACKS; private MethodInterceptor CGLIB$CALLBACK_0; private static

How does Spring Dynamic Agent Decide to Use jdk Agent and cglib

https://qaofficial.com/post/2019/04/09/69718-how-does-spring-dynamic-agent-decide-to-use-jdk-agent-and-cglib.html 2019-04-09
Spring AOP uses JDK dynamic proxies or CGLIB to create proxies for target objects.(It is recommended to use JDK's dynamic proxy as much as possible) JDK dynamic proxy is used if the target object being proxied implements at least one interface.All interfaces implemented by this target type will be proxied.If the target object does not implement any interfaces, a CGLIB proxy is created.If you want to force CGLIB proxy (for example, you want to proxy all the methods of the target object, not just the methods that implement the self-interface), you can also do so.

Install python36 and pip3, Tensorflow offline

https://qaofficial.com/post/2019/04/09/69686-install-python36-and-pip3-tensorflow-offline.html 2019-04-09
Check the following two blogs first:QCloud Installs python36 and pip3, TensorflowYum downloads the installation package but does not install it The method of online installation of python36, pip3 and Tensorflow is described above. The method of offline installation is similar to online installation, but the dependency and record of yum and pip packages must be recorded. general outline This article is divided into two routes. The first route is to

Operating System-Traps, Interrupts, Exceptions

https://qaofficial.com/post/2019/04/09/69652-operating-system-traps-interrupts-exceptions.html 2019-04-09
Traps, interrupts and exceptions are common terms in the operating system. They run through the learning process of the operating system. This article mainly distinguishes between them. Trap The computer has two operating modes: user mode and kernel mode.Wherein the operating system runs in a kernel state, and in the kernel state, the operating system has full access to all hardware and can enable the machine to run any instruction;On

Selective Sorting-C # Implementation

https://qaofficial.com/post/2019/04/09/111717-selective-sorting-c-#-implementation.html 2019-04-09
One Algorithm Description Selection sort is a simple and intuitive sort algorithm.Its working principle is to select the smallest (or largest) element from the data elements to be sorted each time and store it at the beginning of the sequence until all the data elements to be sorted are sorted out. 2 Algorithm Implementation (C#) 1 is used for ascending sorting of integer arrays public static void SelectionSort(int[] array) {

Traps in Java

https://qaofficial.com/post/2019/04/09/69648-traps-in-java.html 2019-04-09
There are five general ways to create objects in Java:   1. Create Java objects by calling the constructor new; 2. Create the object by calling the constructor through the Class object's newInstance () method; 3. Recover objects from IO stream through the deserialization mechanism of Java; 4. Copy an object through clone method provided by Java object; 5. Basic types and String types can be directly assigned direct quantities.

Use @Aspect in Spring to Control Custom Annotations

https://qaofficial.com/post/2019/04/09/69742-use-aspect-in-spring-to-control-custom-annotations.html 2019-04-09
Use @Aspect in Spring to Control Custom Annotations reprint an introduction @Aspect 1. Define System Log Annotation [email protected](ElementType.METHOD)@Retention(RetentionPolicy.RUNTIME)@Documentedpublic @interface SysLog { String value() default ""; } 2. Define tangent plane processing classes package com.kxs.common.aspect; import com.google.gson.Gson; import com.kxs.common.annotation.SysLog; import com.kxs.common.utils.HttpContextUtils; import com.kxs.common.utils.IPUtils; import com.kxs.modules.sys.entity.SysLogEntity; import com.kxs.modules.sys.entity.SysUserEntity; import com.kxs.modules.sys.service.SysLogService; import org.apache.shiro.SecurityUtils; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Pointcut; import org.aspectj.lang.reflect.MethodSignature; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import javax.servlet.http.HttpServletRequest; import java.lang.reflect.Method; import java.util.Date;

in-depth understanding of Java Proxy mechanism

https://qaofficial.com/post/2019/04/09/69740-in-depth-understanding-of-java-proxy-mechanism.html 2019-04-09
Dynamic Proxy is actually the Java. lang. reflection. proxy class dynamically generates a class byte according to all interfaces you specify, which inherits the proxy class and implements all interfaces you specify (the array of interfaces you pass in in the parameters);Then use the classloader you specified to load class byte into the system, finally generate an object of such a class, and initialize some values of the object, such as the invocationHandler, to be the Method members corresponding to all interfaces.

javassist for Java Dynamic Programming

https://qaofficial.com/post/2019/04/09/69730-javassist-for-java-dynamic-programming.html 2019-04-09
Overview Javassist is a bytecode editing tool that can directly edit and generate Java-generated bytecodes to achieve the effect of dynamically modifying. class files.Proficient use of this set of tools can make Java programming closer to dynamic language programming. tutorial maven dependency pom.xml <dependency> <groupId>org.javassist</groupId> <artifactId>javassist</artifactId> <version>3.20.0-GA</version> </dependency> API explanation 1, create a new Class ClassPool pool = ClassPool.getDefault(); //定义类 CtClass stuClass = pool.makeClass("com.ricky.Student"); Of course,

reading notes, statistical trap

https://qaofficial.com/post/2019/04/09/69643-reading-notes-statistical-trap.html 2019-04-09
biased samples in chapter 1 The desired data will be obtained mainly through biased samples. In this paper, the salary of Yale graduates is taken as an example to illustrate this problem, but no samples are given when statistical conclusions are given. Through reasonable speculation, we can know that such samples are biased. For example, the people who can contact are generally not poor, and those who are willing to tell others their salary are not poor.