Object-oriented: singleton, Lambda expression

The singleton pattern guarantees that the object is unique in memory public class Singleton{ private static final Singleton singleObject = new Singleton(); private Singleton(){} public static getSingleton(){ return singleObject; } } The hungry man pattern creates object instances the first time this class is ...

Added by neogranas on Wed, 19 Jun 2019 04:06:14 +0300

Using the cross-domain principle of AJAX to reconstruct pages and realize the modularization of pages

jq's AJAX not only requests network data, but also accesses html and js files across domains. For example, when it accesses js files across domains, it actually does two things: 1. Create < script > tag, src points to the url to be accessed, appendChild() goes to the head tag; 2. Declare function fn, FN must have the same name as the meth ...

Added by eduard on Tue, 18 Jun 2019 22:03:26 +0300

xhprof source code analysis

Brief concepts of XHProf Native method of re-encapsulating zend If the CPU is to be detected, there will be a 5 ms delay because the CPU frequency needs to be calculated. Internal use of linked lists Source address: / root/Downloads/xhprof/extension/xhprof.c Two of the most important structures /* Xhprof's global state. * * This structure i ...

Added by dirkie on Tue, 18 Jun 2019 00:43:34 +0300

python log module

logging module What is logging module Logging module is a module provided by python for logging Why logging is needed We can open the file by ourselves and write in the log, but these operations are repetitive and without any technical content, so python has packaged it for us. With logging, we only need to simply call the interface when record ...

Added by Omzy on Sat, 15 Jun 2019 06:04:26 +0300

SpringBoot Solves Cross-Domain Request Interception

Preface Homology strategy: judging whether it is homologous, mainly depends on these three points, protocol, ip, port. Homology policy is a policy that browsers restrict the access of resources from different sources for the sake of website security. For example, under the domain name https://www.baidu.com, scripts cannot access resources fr ...

Added by Meltdown on Sat, 15 Jun 2019 05:48:38 +0300

Implementation of Common Operating Class in PHP-Database Operating Class

Thank you for your collection and praise, which is my greatest encouragement. Source Code <?php /** * TODO:Database Model Class * Author: entner * time: 2017-5-6 * version:1.0 */ Class DB{ protected $HOST = '127.0.0.1'; //Host address protected $DATABASE; protected $USER ="root"; //Database us ...

Added by cringe on Fri, 14 Jun 2019 22:16:55 +0300

System CTL enables nginx processes to automatically restart after hanging up

  Following the article on July 31, 2018: vim /lib/systemd/system/nginx.service   [Service]Restart=alwaysRestartSec=1Type=forkingPIDFile=/run/nginx.pid    systemctl daemon-reload systemctl start nginx After kill ing, the nginx will be automatically restarted. ------------------------------------------ If the original link is valid, ...

Added by Hoangsta on Wed, 12 Jun 2019 22:53:15 +0300

Xiao Feng and Guo Jing teach you how to learn PHP Trait

Before PHP 5.4, the way PHP object-oriented needed to reuse code was to use class inheritance. However, PHP only supports single inheritance, and in dealing with more complex business logic, single inheritance is difficult. Use scenarios of trait For example, the following application scenarios: class Person { public function eat() { ...

Added by Thierry on Wed, 12 Jun 2019 02:05:14 +0300

Build lnmp environment

Operating system: linux Mint 18.2 Compile and install php7.2 1.Install the compiler first sudo apt install gcc automake autoconf libtool g++ #Under centos, it is yum install gcc automake autoconf libtool gcc-c++. 2.Installation of Foundation Library sudo apt install libxml2-dev openssl libssl-dev curl libcurl4-gnutls-dev libjpeg- ...

Added by phpbeginer on Wed, 12 Jun 2019 01:18:05 +0300

HBase-Shell-Data Structure-Principle

Chapter 3 HBase Shell operations 3.1 Basic Operations 1. Enter the HBase client command line [lxl@hadoop102 hbase]$ bin/hbase shell   2. View Help Commands hbase(main):001:0> help   3. See which tables are in the current database hbase(main):001:0> list TABLE ...

Added by josephferris on Tue, 11 Jun 2019 20:44:07 +0300