• Practical case analysis of vim operation (1): adding content at the beginning or end of a line in batch


    When we write code or documents, we often need to add the same content at the beginning or end of multiple lines. It is obviously inefficient to manually operate one line at a time. It is convenient to do such things. Case 1 hold aaa bbb ccc ddd eee Change to # aaa # bbb […]

  • Using spark to solve some classic MapReduce problems


    abstract Spark is an Apache project, which is billed as “lightning fast cluster computing”. It has a thriving open source community and is currently the most active Apache project. Spark provides a faster and more general data processing platform. Compared with Hadoop, spark can make your program run 100 times faster in memory or 10 […]

  • Java template method pattern


    When defining a function, one part of the function is certain, but one part is uncertain, and the certain part uses the uncertain part, then the uncertain part will be exposed. It’s done by subclasses. Case: find the running time of a piece of code abstract class GetTime{ public final void getTime(){ long start = […]

  • Regular expressions are case insensitive and explore solutions


    Today, I met a case insensitive problem to eliminate JS regular expressions. I searched online and found that I was really a rookie. In JS / / g, where G is the global match, if not, it means that the match can only be completed once automatically. / I / means that the matching process […]

  • JS advanced – closure case


    Closure case   Ordinary function   //Ordinary function function f1() { var num = 10; num++; return num; } console.log(f1()); //11 console.log(f1()); //11 console.log(f1()); //11   Closure of function pattern //Closure of function pattern function f2() { var num = 10; return function () { num++; return num; } } var ff = f2(); console.log(ff());//11 […]

  • Adding, deleting, modifying and querying when the MySQL main table stores IDS separated by commas


    Case 1: application of query system user (99331839643945506) associated product association [sys_user] [sys_user_prod] [product] [app] uid————-user_id /—id———-products / prod_id——-/ Difficulties:The app table maintains a collection of all associated product IDS through a field products. For example: 2 or 4,11,12 realization: SELECT `id`,`uuid`,`name`,`token`,`time`,`products` FROM app where CONCAT(‘,’,products,’,’) REGEXP ( SELECT CONCAT( ‘,{1}(‘, GROUP_CONCAT(prod_id SEPARATOR ‘|’) , […]

  • css animation transform


    1. Animation CSS Transition ————– CSS Animation ————- 2. CSS3 wave animation effect http://www.bootstrapmb.com/item/4308/preview 3. JQuery particle background plug-in circlemagic.js http://www.jq22.com/jquery-info16175 4. Notes Transform animation action The animation duration of transition needs to be combined to make the transition have a transition 5. Animation case setThe case continues to add

  • Introduction to maven maven war plugin


    Use background Recently, the project uses nodejs + webpack as the front-end construction, Tomcat as the web container. When packaging, you want to exclude or only print the built front-end files. Here, you use Maven war plugin to do some configuration to realize the filtering and increase of resources when you play the war package. […]

  • Using Google’s free GPU to run machine learning code


    Original address If you want to learn machine learning, but you don’t have your own environment / graphics card. Here’s the good news. Google has a free machine learning environment to use Search on Googlegoogle colab, open the search address: https://collab.research.google By default, you will be prompted to create a new Notepad. This is because […]

  • JS advanced – sandbox small case


    Sandbox cases   Substr interception, starting from the specified field (function () { Var STR = “Xiaobai likes Xiaohei”; str=str.substr(2); console.log(str); }());   Substr interception, starting from the specified field //Sandbox (function () { Var STR = “Xiaoming likes Xiaohong”; str=str.substr(2); console.log(str); }());   Sandbox case, operation page element This is a div This is […]

  • Implementation of async / await principle


    1. The implementation principle of async function The implementation principle of async function is to wrap the generator function and automatic actuator in one function. The async function returns a promise object async function fn(args) { // … } //Equivalent to function fn(args) { return spawn(function* () { // … }); } be-allasyncFunctions can be […]

  • Spring common annotations


    1) For registering bean object annotations 1.1 @Component effect: Call the nonparametric construct to create a bean object and store the object in the spring IOC container for management. This is equivalent to configuring a bean in XML. Properties: Value: Specifies the ID of the bean. If the value attribute is not specified, the default […]