• Note on the use of rootmargin in intersectionobserver


    The rootmargin setting may not be valid. The following are the valid conditions:1. Set the parent node of overflow + rootmargin, as follows: <!DOCTYPE html> <html lang=”en”> <head> <meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″ /> < title > test intersectionobserver < / Title > <style> html, body { width: 100%; height: 100%; background: #eee; font-family: Helvetica Neue, […]

  • Golang | takes you deep into the context


    preface First answer the previous articleA quick start contextThe doubts left in, whydefer cancelFunc()? func main() { parent := context.Background() for i := 0; i < 100; i++ { go doRequest(parent) } time.Sleep(time.Second * 10) } //Dorequest simulates a network request func doRequest(parent context.Context) { ctx, _ := context.WithTimeout(parent, time.Second*5) time.Sleep(time.Millisecond * 200) go func() […]

  • Java + springboot + mybatis implements the comment and sub reply comment interface


    1. Create table biz_comment biz_users The fields, types and lengths of the table can be used according to your business needs. Only the required fields are provided here. 2. Generate biz by automatically generating code_ Comment table domain :explain:@TableField(exist = false) Indicates that this field is not in the table. It is a self-defined attribute […]

  • For example, I want to use angularjs to make a calculator


    I actually want to make an accounting app. There is a box to display the amount from top to bottom, and there are some other options or input boxes. Click the box to display the amount, and the keyboard will pop up at the bottom. The keys are composed of 0-9, decimal point, + – […]

  • PHP quick scan list to create infinite classification tree


    Connect the book. At the end of the above, the wonderful use of quotation is explained. As it happens, there is a recursive hierarchical list of “provinces and cities” in the business of my current company; This paper will move this use into the production environment, and try the real effect by optimizing the list […]

  • Explore the implementation of CSS with single line text centered and multi line text left


    Original linkhttps://github.com/XboxYan/notes/issues/13 long ago Just entering the front-end meeting, the product manager put forward such a demand Can this text be judged in this way? When the text is less than one line, let it be displayed in the middle. When the text exceeds one line, let it be left. Otherwise, it is strange to […]

  • About using offsettop in DOM to obtain the position of the current element from the browser window


    Offsettop is the distance from the outer border of the child element to the inner border of the parent elementDirectly relative to the body value, you need to look up layer by layerWhat is helpful to you in the following code is the code in while, and the outer layer is some records for yourself […]

  • The content of textarea has changed, but the bound model has not been updated


    Problem Description: //app.js angular.module(‘deapp’, []) .controller(‘ParentCtrl’, [‘$scope’, ParentCtrl]) .controller(‘ChildCtrl’, [‘$scope’, ChildCtrl]); function ParentCtrl($scope) { $scope.description = ”; } function ChildCtrl($scope) { } //index.html <div data-ng-controller=”ParentCtrl”> <div data-ng-controller=”ChildCtrl”> <textarea class=”description” data-ng-model=”description”></textarea> </div> </div> When I modify the content of textarea, the bound description is not updated at all. I can only use the chrome plug-in ng […]

  • Pyqt5 case summary (concise version)


    01 menu bar import sys from PyQt5.QtWidgets import QMainWindow, QAction, qApp, QApplication from PyQt5.QtGui import QIcon class Example(QMainWindow): def __init__(self): super().__init__() self.initUI() def initUI(self): exitAct = QAction(QIcon(‘exit.png’), ‘&Exit’, self) exitAct.setShortcut(‘Ctrl+Q’) exitAct.setStatusTip(‘Exit application’) exitAct.triggered.connect(qApp.quit) self.statusBar() menubar = self.menuBar() fileMenu = menubar.addMenu(‘&File’) fileMenu.addAction(exitAct) self.setGeometry(300, 300, 300, 200) self.setWindowTitle(‘Simple menu’) self.show() app = QApplication(sys.argv) ex = Example() sys.exit(app.exec_()) […]

  • Maven POM configuration translation


    POM Original:https://maven.apache.org/guid… Build project In the process of developing Java, you may use many dependent packages, from third parties or Maven warehouses built by yourself. Version compatibility management between dependent packages is a thorny problem in development. Maven records all dependency related information in the POM. XML file, and then automatically downloads and builds these […]

  • Reading CSS to uncover secrets (1)


    1. When there is a relationship between CSS, it should be described by the relationship rather than the same value 1. Currentcolor: take the color value of the current element; if not, take the color value of the parent 2. Inherit: inherit parent 2. Realize transparent border The core problem is that the background color […]

  • Did your less parent selector & play out?


    I don’t know if you feel that CSS is becoming less and less popular in the front circle.The reasons may be as follows: It’s hard to modularize and maintain. There’s nothing to study I don’t know how to ask in an interview Some companies also have CSS engineers, so the front end doesn’t need to […]