• Summary of import and export usage in JavaScript


    import import 和 require 的区别 import 和js的发展历史息息相关,历史上 js没有模块(module)体系,无法将一个大程序拆分成互相依赖的小文件,再用简单的方法拼装起来。这对开发大型工程非常不方便。在 ES6 之前,社区制定了一些模块加载方案,最主要的有 CommonJS 和 AMD 两种。前者用于服务器,后者用于浏览器。ES6 在语言标准的层面上,实现了模块功能,而且实现得相当简单,完全可以取代 CommonJS 和 AMD 规范,成为浏览器和服务器通用的模块解决方案。也就是我们常见的 require 方法。 比如 `let { stat, exists, readFile } = require(‘fs’);` 。ES6 在语言标准的层面上,实现了模块功能。ES6 模块不是对象,而是通过export命令显式指定输出的代码,再通过import命令输入。 import 的几种用法: 1. import defaultName from ‘modules.js’; 2. import { export } from ‘modules’; 3. import { export as ex1 } from […]

  • Kubernetes core practice (VI) — configmap


    8、ConfigMap Extract the application configuration and update it automatically create profile [[email protected] ~/yaml/test]# vim configmap.yaml [[email protected] ~/yaml/test]# cat configmap.yaml apiVersion: v1 data: redis.conf: | appendonly yes kind: ConfigMap metadata: name: redis-conf namespace: default [[email protected] ~/yaml/test]# [[email protected] ~/yaml/test]# kubectl apply -f configmap.yaml configmap/redis-conf created [[email protected] ~/yaml/test]# View configuration [[email protected] ~/yaml/test]# kubectl get configmaps NAME DATA AGE […]

  • module. Exports, exports, export, export default


    module. Exports and exports 1 . NodeThe application is composed of modules and adopts commonjs module specification; Each file is a module with its own scope. Variables, functions and classes defined in a file are private; The commonjs specification stipulates that within each module,moduleRepresents the current module,moduleIs an object, itsexportsProperties (i.emodule.exports)It is an external interface. […]

  • Summary of functional annotation enrichment analysis tools


    Recently, there are many methods to make function annotation. After walking through multiple pits, make a summary of function annotation. Go, KEGG, reactom and msigdb databases, which are commonly used for functional annotation, are provided with their GMT files. For those who are familiar with annotation enrichment and need a certain degree of professionalism or […]

  • Objective-C runtime (I) — nsinvocation call block


    rise One day during development, I encountered a problem that on some occasions, I need to call block with nsinvocation, and the block signature is not fixed, that is, the number of block parameter types can be different. problem Recall the general usage of nsinvocation Naturally, I thought of nsinvocation, such as the following code: […]

  • Ngrok – Introduction to intranet penetration tool


    1. General ngrok There are many open source intranet penetration tools, such as ngrok, FRP, LANproxy, goproxy, NPs, etc. fatedier/frp frp is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the Internet. As of now, it supports TCP and UDP, as well as HTTP and HTTPS […]

  • JavaScript function


      1.1 JS continuesentence Definition and Usage : continue Used to skip one iteration in the loop and continue to the next iteration in the loop. The difference between continue and break statements is:Break is to end the whole loop body, and continue is to end a single loop. However, when executing the continue statement,Two different types […]

  • Filter () method in JavaScript


    Filter () method in JavaScript 1. Definition and usage Filter () creates a new array. The elements in the new array are checked by checking all the qualified elements in the specified array. Filter () does not execute this function on empty data Filter () does not change the original array 2. Grammar array.filter(function(currentValue, index, […]

  • JavaScript event handling


    JS realizes interface interaction with event driven. The core of event driven: message based and event driven. Generally speaking, events are specific events that occur in a document or browser window Interactive behaviors, such as loading, clicking, input, selection, etc. 1.1 event basis The interaction between JS and html is realized through events. Events are […]

  • 1.7 dictionary sorting


    Problem description You want to create a dictionary and control the order of elements when iterating or serializing the dictionary. Solution Here is a new container:collectionsIn the moduleOrderedDictClass. Its usage is as follows: from collections import OrderedDict d = OrderedDict() d[‘a’] = 1 d[‘b’] = 2 d[‘c’] = 3 discuss Ordered dictionaries are like regular […]

  • [storage] the difference between localstorage and sessionstorage


    1) UsageFrom the perspective of usage, the usage is consistent, but different usage scenarios need to be consideredThe saved objects of both are not affected by the refresh tab (refresh web page), and the objects remain 2) Essential difference1.localStorage: Whether you close the tab or the browser, the objects saved by localstorage always exist (permanently […]

  • Analysis of the basic usage of UL and Li


    Navigation, few data tables, centered<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> <html xmlns=”http://www.w3.org/1999/xhtml”> <head> < title > UL and Li applications < / Title ><style type=”text/css”> #menu{width:1000px;height:35px;float:right;margin:0px; clear:both; vertical-align: bottom;} #ul li{list-style-type:none; clear:both;width:100px;display:inline; font-size: larger;} #myul li{float:left;width:100px;} </style> </head> <body> <div id=”menu”> <ul id=”ul”> <li><a title=”” href=” http://localhost:1435/BookShop/index.aspx “> Home Page</a></li><li><a title=”” href=” http://localhost:1435/BookShop/hybooks.aspx […]