Tag:event

  • Elegant usage events in Yii

    Time:2021-4-20

    An event used in Yii looks like this //Binding events $component->on($event::EVENT_NAME, [$object, ‘methodNameA’]); $component->on($event::EVENT_NAME, [$object, ‘methodNameB’]); //Trigger event $component->trigger($event::EVENT_NAME, $event); It can be seen from the above code that if you want to trigger a five listening event, you need to invade six lines of code, which is obviously not elegant enough, so you wrote […]

  • Why is promise faster than settimeout()?

    Time:2021-4-20

    experiment Let’s do an experiment first: let’s see which one is faster, instant promise or instant timeout? Promise.resolve(1).then(function resolve() { console.log(‘Resolved!’); }); setTimeout(function timeout() { console.log(‘Timed out!’); }, 0); // logs ‘Resolved!’ // logs ‘Timed out!’ Promise.resolve(1)Is a static function that returns the immediate resolve promise.setTimeout(callback, 0)Execute a callback with a delay of 0 milliseconds. […]

  • From Kafka to NiO

    Time:2021-4-19

    Before talking about NiO, let’s briefly review the kernel state and user state Kernel space is the running space of Linux kernel, while user space is the running space of user program. In order to ensure the kernel security, they are isolated. Even if the user’s program crashes, the kernel will not be affected.Kernel space […]

  • The use of view event attribute, touch screen event reception and coordinate transformation

    Time:2021-4-19

    All the controls are directly or indirectly inherited from view, so some properties of view and other controls are available Alpha: transparency, values from 1 (opaque) to 0 (fully transparent), 0.5 is translucent Background: the background can be a single color, an image or an XML configuration file ID: is an attempt to identify, Tag: […]

  • Native JavaScript implementation progress bar

    Time:2021-4-19

    Native JavaScript effects JavaScript implementation progress Introduction to the implementation of progress bar Use JavaScript to realize the function of progress bar.Principle: get the distance of mouse movement through mouse movement event.Steps:(1) Div layout in HTML(2) CSS Style Writing(3) JavaScript special effects HTML code <body> <! — whole box — > <div id=”box”> <! — […]

  • Google V8 (1): event loop

    Time:2021-4-18

    preface Early browser pages were run onUI threadIn order to introduce JavaScript into the page and facilitate JS to operate DOM, JS also needs to run in the same thread as the page, so JS is single threaded. 1、 Basic concepts The event loop system consists of main thread, call stack, macro task, micro task […]

  • Spring IOC (11)

    Time:2021-4-17

    1.13。Environment Environment interface is an abstract existence integrated in the container, which is represented by two key aspects of application environment: profiles and properties. 1.13.1。Bean Definition Profiles Bean definition profiles provides a mechanism in the core container that allows different beans to be registered in different environments. To put it bluntly, it’s actually judgment spring.profiles.active […]

  • How to use Xdebug for single step debugging in spool

    Time:2021-4-15

    There should be a lot of people using Xdebug in php-fpm, but few people using Xdebug in spool. The reason is that spool extension explicitly states that it conflicts with Xdebug extension But fortunately, our community members have provided awesome power for them.SdebugHere we should thank [email protected]@huanghantaoThe Xdebug can be used for breakpoint and debugging […]

  • [20201208] why return 2-line record supplement.txt

    Time:2021-4-15

    [20201208] why return 2-line record supplement.txt –//In itpub, http://www.itpub.net/thread-2140116-1-1.html . It took a little time to figure out what the problem was,–//The problem is the consistency read, refer to the link http://blog.itpub.net/267265/viewspace-2213824/ =>[20180907] accessing V $view and consistent reading.txt [email protected]> @ ver1 PORT_STRING                    VERSION        BANNER—————————— ————– ——————————————————————————–x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release […]

  • The processing of H5 mobile phone keyboard pop up

    Time:2021-4-15

    This article first appeared in hzzly’s blog The original text of H5 Foreword: the front-end time also started the tossing journey of H5 mobile terminal according to the needs of the project, and expanded two TOC mobile terminal projects on the basis of the current middle platform. The following is a summary of the compatibility […]

  • Use of CSS style and class

    Time:2021-4-14

    Review the data binding in the last article, I feel it is more important1. The use of computing attributes is similar to responsive programming, that is, the value of a variable will change with the change of the value of its related variable, and there is no need to update, such as fullname = firstname […]

  • Detailed description of common events and methods of HTML text

    Time:2021-4-13

    Event description Onactivate: triggered when the object is set to the active element.Onafterupdate: triggered on the data binding object when the associated object in the data source object is successfully updated.On before activate: the object is triggered immediately before it is set to the current element.Onbeforecut: triggered on the source object before the selection is […]