Tag:code

  • On the problem that the code can not take effect in time after modification

    Time:2020-11-25

    Today, after the modified code is uploaded to the server via FTP, even if the cache is deleted, it still doesn’t take effect, with a delay of about 10 seconds. After research, it is found that the reason is that PHP starts the opcache extension, and the deletion of this extension takes effect immediately. It […]

  • JavaScript closure (from an interview question)

    Time:2020-11-25

    First look at a piece of code and come up with your own answer: for(var i=0;i<5;i++){ setTimeout(function(){ console.log(i); },1000) } console.log(i); The answer to this question is 5555555.One 5 is output immediately, and five 5 are output after 1 second. If we want to change the answer here into: 5 1 2 3 4 5.Well, […]

  • Jenkins — why continuous integration?

    Time:2020-11-25

    1、 Development model 1. Waterfall development model: process linear irreversible development model Advantages: 1) easy to understand2) after the completion of the current stage, we only need to pay attention to the subsequent stage3) provide inspection nodes by stages for the project inferiority: 1) the division of each stage is completely fixed, and a large […]

  • Problems and solutions of Android sample code in Xinjiang

    Time:2020-11-25

    Recently, I was working on the project of DJI Android development. Because I didn’t touch too much Android development before, I encountered a lot of problems when I just started. It took a lot of time for sample code to run.   1. Android studio installation and dependent Library Download Originally, I thought that Google’s […]

  • Correct posture of spark combined with GitHub (pull request) pr

    Time:2020-11-25

    Recently, when upgrading the internal spark version, it involves merging PR on GitHub. Specifically, when spark 2. X is upgraded to spark 3.0.1, it is compatible with HDFS cdh-2.6.0-5.13.1, and a compilation error is reported [INFO] Compiling 25 Scala sources to /Users/libinsong/Documents/codes/tongdun/spark-3.0/resource-managers/yarn/target/scala-2.12/classes … [ERROR] [Error] resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala:298: value setRolledLogsIncludePattern is not a member of org.apache.hadoop.yarn.api.records.LogAggregationContext [ERROR] […]

  • Local development and debugging of NPM package

    Time:2020-11-25

    preface NextThe ast function is used to automatically add errorsWe have developed a Babel plugin (NPM package). In this article, we will continue to explore how to develop and debug NPM package locally. When the NPM package is still in the development stage, it is impossible to debug while releasing, otherwise it will be too […]

  • Exit function

    Time:2020-11-25

    Referring to the relevant information, calling the exit function directly returns the process to the operating system, whether it is invoked in the main thread or the child thread, will directly control the control to the operating system.     Code 1: call exit in main thread to exit. #include #include using namespace std; void […]

  • Python OCT function

    Time:2020-11-25

      OCT function is also a python built-in function. It mainly converts an integer into octal, which is similar to ord function / Chr function; 1、 Introduction to OCT function The oct() function converts an integer into an octet string. The syntax is as follows: oct(x)   Parameters: X – integer; Return value: return octal […]

  • PHP design pattern code examples of null object (25)

    Time:2020-11-25

    objective The empty object pattern is not a GOF design pattern, but it is enough to be considered a design pattern as a frequent pattern. It has the following advantages: The client code is simple It can reduce the probability of null pointer exception Test cases don’t need to consider too many conditions Return an […]

  • Realization of DOM fuzziness in Vue project

    Time:2020-11-25

    This is a code to blur DOM elements into images <template> <div class=”gauss-blur-wrap”> <Spin v-if=”showBlur” fix></Spin> <div :ref=”`sourceBox${rand}`”> <slot></slot> </div> <img v-show=”true” :id=”`tempImg${rand}`” :src=”`${tempImg}`”></img> <canvas :id=”`gauss-blur-canvas${rand}`” :width=”canvasWidth” :height=”canvasHeight”></canvas> </div> </template> <script> import html2canvas from “html2canvas”; import * as StackBlur from “stackblur-canvas”; /** *The part enclosed by gaussblur label is blurred, and the original DOM element […]

  • TP verification class writing & using (with code)

    Time:2020-11-25

    TP verification class writing & using (with code) 1. We can first create a folder under the corresponding module (admin), or create a folder in other public places, as shown in the following figure: 2. After the establishment, we can use several methods to call: a) Use $validate = loader:: validate (‘brandvlidate ‘); b) Use […]

  • 07 springboot + mybatis + spring technology integration to realize crud operation of commodity module

    Time:2020-11-25

    Business description Based on the technology of spring, mybatis, springboot and thymeleaf, the operation of adding, deleting, modifying and checking commodity modules is realized. database initialized Open the MySQL console and follow the steps below goods.sql Documents.Step 1: log in to MySQL. mysql –uroot –proot Step 2: set the console encoding mode. set names utf8; Step 3: Execution […]