Sort out the knowledge points

Lecture notes

1、JavaScript object-oriented

1.1、 Object oriented introduction

  • stay Java We learned about object orientation in , The core idea is that everything is an object .

  • stay JavaScript There is also object orientation in . Similar thinking .

1.2、 Definition and use of classes

  • Structure description

  • Code implementation

    <!DOCTYPE html>
    <html lang="en">
    <head>
       <meta charset="UTF-8">
       <meta name="viewport" content="width=device-width, initial-scale=1.0">
       <title> Definition and use of classes </title>
    </head>
    <body>
       
    </body>
    <script>
       // Definition Person class
       class Person{
           // Construction method
           constructor(name,age){
               this.name = name;
               this.age = age;
          }

           //show Method
           show(){
               document.write(this.name + "," + this.age + "<br>");
          }

           //eat Method
           eat(){
               document.write(" having dinner ...");
          }
      }

       // Use Person class
       let p = new Person(" Zhang San ",23);
       p.show();
       p.eat();
    </script>
    </html>

1.3、 The definition and use of literal quantity class ***

  • Structure description

    • This is actually creating an object directly

    • When defining variables and methods in a class , The object of this class is created directly

    • Literal : That is to know what type it is from the literal meaning of the code

    • The literal quantity of an object is a pair of braces It means , We'll see later when we assign values to variables , To the right of the equal sign is a pair of braces , Then you know that the declared variable is an object

  • Code implementation

    <!DOCTYPE html>
    <html lang="en">
    <head>
       <meta charset="UTF-8">
       <meta name="viewport" content="width=device-width, initial-scale=1.0">
       <title> Literal quantity defines class and uses </title>
    </head>
    <body>
       
    </body>
    <script>
       // Definition person
       let person = {
           name : " Zhang San ",
           age : 23,
           hobby : [" Listen to the teacher "," Study "],

           eat : function() {
               document.write(" having dinner ...");
          }
      };

       // Use person
       document.write(person.name + "," + person.age + "," + person.hobby[0] + "," + person.hobby[1] + "<br>");
       person.eat();
    </script>
    </html>

1.4、 Inherit

  • Inherit : Let a class and a class have the relationship of children and parents , Subclasses can use members that the parent class has permission to .

  • Inherit keywords :extends

  • Top level parent class :Object

    <!DOCTYPE html>
    <html lang="en">
    <head>
       <meta charset="UTF-8">
       <meta name="viewport" content="width=device-width, initial-scale=1.0">
       <title> Inherit </title>
    </head>
    <body>
       
    </body>
    <script>
       // Definition Person class
       class Person{
           // Construction method
           constructor(name,age){
               this.name = name;
               this.age = age;
          }

           //eat Method
           eat(){
               document.write(" having dinner ...");
          }
      }

       // Definition Worker Class inheritance Person
       class Worker extends Person{
           constructor(name,age,salary){
               super(name,age);
               this.salary = salary;
          }

           show(){
               document.write(this.name + "," + this.age + "," + this.salary + "<br>");
          }
      }

       // Use Worker
       let w = new Worker(" Zhang San ",23,10000);
       w.show();
       w.eat();
    </script>
    </html>

1.5、 Summary

  • object-oriented

    Organize relevant data and methods as a whole , Modeling the system from a higher level , Closer to the natural mode of operation of things .

  • The definition of a class

    class class {} Literal definition

  • The use of the class

    let Object name = new Class name (); Object name . Variable name Object name . Method name ()

  • Inherit

    Let classes and classes have child parent relationships , Improve the reusability and maintainability of the code .

    Subclass extends Parent class

    Object Top level parent class

2、JavaScript Built-in objects

2.1、Number

  • Methods to introduce

  • Code implementation

<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <title>Number</title>
</head>
<body>
   
</body>
<script>
   //1. parseFloat() Convert the string floating-point number passed in to floating-point number
   document.write(Number.parseFloat("3.14") + "<br>");

   //2. parseInt()   Converts the incoming string integer to an integer
   document.write(Number.parseInt("100") + "<br>");
   document.write(Number.parseInt("200abc") + "<br>"); // Starting with numbers , Until it's not a number
   
   
   // 3. isNaN() Judge whether something is The digital
   // not a number : The digital
   console.log(Number.isNaN(NaN)); // true
   console.log(Number.isNaN(1)); // false

</script>
</html>

2.2、Math

  • Methods to introduce : random* **

  • Code implementation

<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <title>Math</title>
</head>
<body>
   
</body>
<script>
   //1. ceil(x) Rounding up
   document.write(Math.ceil(4.4) + "<br>");    // 5
   
   //2. floor(x) Rounding down
   document.write(Math.floor(4.4) + "<br>");   // 4
   
   //3. round(x) Round a number to the nearest whole number
   document.write(Math.round(4.1) + "<br>");   // 4
   document.write(Math.round(4.6) + "<br>");   // 5
   
   //4. random() random number , The return is 0.0-1.0 The range between ( With head and no tail )
   document.write(Math.random() + "<br>"); // random number
   
   //5. pow(x,y) Power operation x Of y Power
   document.write(Math.pow(2,3) + "<br>"); // 8
</script>
</html>

2.3、Date

  • Method statement

    • Construction method

    • Member method

  • Code implementation

<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <title>Date</title>
</head>
<body>
   
</body>
<script>
   // Construction method
   //1. Date() Create objects based on the current time
   let d1 = new Date();
   document.write(d1 + "<br>");

   //2. Date(value) Creates an object based on the specified millisecond value
   let d2 = new Date(10000);
   document.write(d2 + "<br>");

   //3. Date(year,month,[day,hours,minutes,seconds,milliseconds]) Create an object based on the specified field ( Month is 0~11)
   let d3 = new Date(2222,2,2,20,20,20);
   document.write(d3 + "<br>");

   // Member method
   //1. getFullYear() Get year
   document.write(d3.getFullYear() + "<br>");

   //2. getMonth() Get month (0-11: representative 1-12 month )
   document.write(d3.getMonth() + "<br>");

   //3. getDate() Get days
   document.write(d3.getDate() + "<br>");
   document.write(d1.getDay() + "<br>");// Get the day of the week (0-6: Sunday - Saturday )

   //4. toLocaleString() Returns a string in local date format
   document.write(d3.toLocaleString());
</script>
</html>

2.4、String

  • Method statement

    • Construction method

    • Member method charAt,indexOf,subString

  • Code implementation

<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <title>String</title>
</head>
<body>
   
</body>
<script>
   //1. Constructor creates a string object
   let s1 = new String("hello");
   document.write(s1 + "<br>");

   //2. Direct assignment
   let s2 = "hello";
   document.write(s2 + "<br>");

   // attribute
   //1. length   Gets the length of the string
   document.write(s2.length + "<br>");

   // Member method
   //1. charAt(index)     Gets the character at the specified index
   document.write(s2.charAt(1) + "<br>");

   //2. indexOf(value)   Gets the index position where the specified string appears
   document.write(s2.indexOf("l") + "<br>");

   //3. substring(start,end)   Intercepts a string according to the specified index range ( With head and no tail )
   document.write(s2.substring(2,4) + "<br>");

   //4. split(value)   Cut strings according to specified rules , Returns an array of
   let s3 = " Zhang San ,23, male ";
   let arr = s3.split(",");
   for(let i = 0; i < arr.length; i++) {
       document.write(arr[i] + "<br>");
  }

   //5. replace(old,new)   Replace the old string with the new string
   let s4 = " Can you Parachute ? Let me drop into a box . Damn .";
   let s5 = s4.replace(" Damn ","***");
   document.write(s5 + "<br>");
</script>
</html>

2.5、RegExp ***

  • Regular expressions : It's a rule for matching strings

  • It's often used to log in 、 Registration form verification

  • Method statement

    • Construction method & Member method

    • The rules

    • [] A commonplace

    • {} The number of times a rule repeats

  • Code implementation

<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <title>RegExp</title>
</head>
<body>
   
</body>
<script>
   //1. Verify phone number
   // The rules : first place 1, Second 358, The third to eleventh digits must be numbers . Total length 11
   let reg1 = /^[1][358][0-9]{9}$/;
   document.write(reg1.test("18688888888") + "<br>");

   //2. Verify user name
   // The rules : Letter 、 Numbers 、 Underline composition . Total length 4~16
   let reg2 = /^[a-zA-Z_0-9]{4,16}$/;
   document.write(reg2.test("zhang_san123"));
</script>
</html>

2.6、Array ***

  • Member method :push,pop

  • Code implementation

<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <title>Array</title>
</head>
<body>
   
</body>
<script>

   let arr = [1,2,3,4,5];

   //1. push( Elements )   Add elements to the end of the array
   arr.push(6);
   document.write(arr + "<br>");

   //2. pop()         Delete the element at the end of the array
   arr.pop();
   document.write(arr + "<br>");

   //3. shift()       Delete the top element of the array
   arr.shift();
   document.write(arr + "<br>");

   //4. includes( Elements ) Determine whether the array contains the specified element
   document.write(arr.includes(2) + "<br>");

   //5. reverse()     Invert array elements
   arr.reverse();
   document.write(arr + "<br>");

   //6. sort()         Sort array elements
   arr.sort();
   document.write(arr + "<br>");

</script>
</html>

2.7、Set

  • JavaScript Medium Set aggregate , Element uniqueness , The access order is consistent

  • Method statement

  • Code implementation

<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <title>Set</title>
</head>
<body>
   
</body>
<script>
   // Set()   Create a collection object
   let s = new Set();

   // add( Elements )   Additive elements
   s.add("a");
   s.add("b");
   s.add("c");
   s.add("c");

   // size attribute   Get the length of the collection
   document.write(s.size + "<br>");    // 3

   // keys()     Get iterator object
   let st = s.keys();
   for(let i = 0; i < s.size; i++){
       document.write(st.next().value + "<br>");
  }

   // delete( Elements ) Deletes the specified element
   document.write(s.delete("c") + "<br>");
   let st2 = s.keys();
   for(let i = 0; i < s.size; i++){
       document.write(st2.next().value + "<br>");
  }
</script>
</html>

2.8、Map

  • JavaScript Medium Map aggregate ,key only , The access order is consistent

  • Method statement

  • Code implementation

<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <title>Map</title>
</head>
<body>
   
</body>
<script>
   // Map()   establish Map A collection of objects
   let map = new Map();

   // set(key,value) Additive elements
   map.set(" Zhang San ",23);
   map.set(" Li Si ",24);
   map.set(" Li Si ",25);

   // size attribute     Get the length of the collection
   document.write(map.size + "<br>");

   // get(key)     according to key obtain value
   document.write(map.get(" Li Si ") + "<br>");

   // entries()   Get iterator object
   let et = map.entries();
   for(let i = 0; i < map.size; i++){
       document.write(et.next().value + "<br>");
  }

   // delete(key) according to key Delete key value pair
   document.write(map.delete(" Li Si ") + "<br>");
   let et2 = map.entries();
   for(let i = 0; i < map.size; i++){
       document.write(et2.next().value + "<br>");
  }
</script>
</html>

2.9、Json ***

  • JSON(JavaScript Object Notation): Is a lightweight data exchange format

    • It is based on ECMAScript A subset of the specification , Use text format completely independent of programming language to store and represent data

    • A simple and clear hierarchy makes JSON Become the ideal data exchange language . Easy to read and write , At the same time, it is also easy to analyze and Generate , And effectively improve the network transmission efficiency

  • Method statement

  • Code implementation

<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <title>JSON</title>
</head>
<body>
   
</body>
<script>
   // Define weather objects
   let weather = {
       city : " Beijing ",
       date : "2088-08-08",
       wendu : "10° ~ 23°",
       shidu : "22%"
  };

   //1. Convert the weather object to JSON Format string
   let str = JSON.stringify(weather);
   document.write(str + "<br>");
   //{"city":" Beijing ","date":"2088-08-08","wendu":"10° ~ 23°","shidu":"22%"}
   //json: key and value Must be wrapped in double quotation marks ,value If it's a number, it can be omitted
   //2. take JSON The format string is parsed into JS object
   let weather2 = JSON.parse(str);
   document.write(" City :" + weather2.city + "<br>");
   document.write(" date :" + weather2.date + "<br>");
   document.write(" temperature :" + weather2.wendu + "<br>");
   document.write(" humidity :" + weather2.shidu + "<br>");
</script>
</html>
  • json Analysis chart :

2.10、 Form verification ***

  • Case description

  • Code implementation

<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <title> Form verification </title>
   <link rel="stylesheet" href="css/style.css"></link>
</head>
<body>
   <div class="login-form-wrap">
       <h1> Black horse programmer </h1>
       <form class="login-form" action="#" id="regist" method="get" autocomplete="off">
           <label>
               <input type="text" id="username" name="username" placeholder="Username..." value="">
           </label>
           <label>
               <input type="password" id="password" name="password" placeholder="Password..." value="">
           </label>
           <input type="submit" value=" register ">
       </form>
   </div>
</body>
<script>
   //1. Submit events for form binding
   // Form submit Once you click the button , Will trigger first onsubimit Event processing function :
   // (1) If the handler returns false, Then you don't submit the form  
   // (2) If the handler returns true, Then you submit the form ( Submit Form : Jump to form Of action Corresponding url)
   document.getElementById("regist").onsubmit = function() {
       //2. Get the filled in user name and password
       let username = document.getElementById("username").value;
       let password = document.getElementById("password").value;

       //3. Judge whether the user name conforms to the rules 4~16 Three pure letters
       let reg1 = /^[a-zA-Z]{4,16}$/;
       if(!reg1.test(username)) {
           alert(" The user name does not conform to the rules , Please enter 4 To 16 The pure letter of bit !");
           return false;
      }

       //4. Judge whether the password meets the rules 6 Digit pure number
       let reg2 = /^[\d]{6}$/;
       if(!reg2.test(password)) {
           alert(" The password doesn't fit the rules , Please enter 6 It's a pure digital password !");
           return false;
      }

       //5. If all the conditions are not met , Then submit the form
       return true;
  }
   
</script>
</html>

2.11、 Summary

  • The built-in object is JavaScript Special data types with properties and methods provided .

  • Digital date Number Math Date

  • character string String RegExp

  • Array set Array Set Map

  • Structured data JSON

3、JavaScript BOM

  • BOM(Browser Object Model): Browser object model .

  • Encapsulate the various components of the browser into different objects , It's convenient for us to operate .

3.1、Windows Window object

  • Timer ***

    • Unique identification setTimeout( function , Millisecond value ): Set one time timer ( Delay timer )

      • The first parameter , Just pass the function name , No call required

    • clearTimeout( identification ): Cancel the one-time timer

    • Unique identification setInterval( function , Millisecond value ): Set the cycle timer ( Interval timer )

      • The first parameter , Just pass the function name , No call required

    • clearInterval( identification ): Cancel the cycle timer

  • Loading event ***

    • window.onload: The function to trigger this event after the page is loaded

  • Code implementation

<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <title>window Window object </title>
   <script>
       // One 、 Timer
       function fun(){
           alert(" It's time to get up !");
      }
   
       // Set one time timer
       //let d1 = setTimeout("fun()",3000);//d1 It's a timer id
       let d1 = setTimeout(fun,3000);// Recommend writing
       // Cancel the one-time timer
       //clearTimeout(d1);
   
       // Set the cycle timer
       //let d2 = setInterval("fun()",3000);
       let d2 = setInterval(fun,3000);// Recommend writing
       // Cancel the cycle timer
       //clearInterval(d2);
   
       // Loading event : When body Code parsing is equivalent to loading the interface
       window.onload = function(){
           let div = document.getElementById("div");
           alert(div);
      }
   </script>
</head>
<body>
   <div id="div">dddd</div>
</body>
<!-- <script>
   // One 、 Timer
   function fun(){
       alert(" It's time to get up !");
   }

   // Set one time timer
   //let d1 = setTimeout("fun()",3000);
   // Cancel the one-time timer
   //clearTimeout(d1);

   // Set the cycle timer
   //let d2 = setInterval("fun()",3000);
   // Cancel the cycle timer
   //clearInterval(d2);

   // Loading event
   let div = document.getElementById("div");
   alert(div);
</script> -->
</html>

3.2、Location Address bar object

  • href attribute

    By setting href To change the address bar address , Jump the interface .

  • Code implementation

<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <title>location Address bar object </title>
   <style>
       p{
           text-align: center;
      }
       span{
           color: red;
      }
   </style>
</head>
<body>
   <p>
      Registered successfully !<span id="time">5</span> Automatically jump to the home page in seconds ...
   </p>
</body>
<script>
   //1. Define methods . Change seconds , Jump to the page
   let num = 5;
   function showTime() {
       num--;

       if(num <= 0) {
           // Jump page
           location.href = "index.html";  ***
      }

       let span = document.getElementById("time");
       span.innerHTML = num;
  }

   //2. Set the cycle timer , Every time 1 Second execution showTime Method
   setInterval("showTime()",1000);
</script>
</html>

3.3、 Case study - Dynamic advertising

  • Case analysis and implementation

<!-- Advertising images -->
<img src="img/ad_big.jpg" id="ad_big" width="100%"/>
  • stay css In the style ,display Attributes can control whether an element is displayed

style="display: none;"
  • Set the timer ,3 Show the ad image in seconds

//1. Set the timer ,3 Show the ad image in seconds 
setTimeout(function(){
   let img = document.getElementById("ad_big");
   img.style.display = "block";
},3000);
  • Set the timer ,3 Hide the ad image in seconds

//2. Set the timer ,3 Hide the ad image in seconds 
setTimeout(function(){
   let img = document.getElementById("ad_big");
   img.style.display = "none";
},6000);

3.4、 Summary

  • BOM(Browser Object Model): Browser object model .

  • Encapsulate the various components of the browser into different objects , It's convenient for us to operate .

    • Window: Window object

    • Location: Address bar object

    • Navigator: Browser object

    • History: Current window history object

    • Screen: Display screen objects

  • Window Window object

    • setTimeout()、clearTimeout(): One time timer

    • setInterval()、clearInterval(): Cycle timer

    • onload event : When the page is loaded, the execution function is triggered

  • Location Address bar object href attribute : Jump to the specified URL Address

4、JavaScript encapsulation

Encapsulate ideas

  • encapsulation : Encapsulate and hide complex operations , Provide more simple operation to the outside world .

  • How to get elements

    • document.getElementById(id value ): according to id Value get element

    • document.getElementsByName(name value ): according to name Attribute values get elements

    • document.getElementsByTagName( Tag name ): Get elements by tag name

  • Code implementation

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> encapsulation </title>
    </head>
    <body>
    <div id="div1">div1</div>
    <div name="div2">div2</div>
    </body>
    <script src="my.js"></script>
    <script>
    let div1 = getById("div1");
    alert(div1); // let div1 = document.getElementById("div1");
    // alert(div1); // let divs = document.getElementsByName("div2");
    // alert(divs.length); // let divs2 = document.getElementsByTagName("div");
    // alert(divs2.length);
    </script>
    </html>

    js encapsulation

    function getById(id){
    return document.getElementById(id);
    } function getByName(name) {
    return document.getElementsByName(name);
    } function getByTag(tag) {
    return document.getElementsByTagName(tag);
    }

Our previous operations were all based on native JavaScript Of , More complicated . JQuery It's a front-end framework technology , in the light of JavaScript A series of encapsulation is carried out , It makes the operation very simple ! Look forward to it ……

JavaScript senior :JavaScript object-oriented ,JavaScript Built-in objects ,JavaScript BOM,JavaScript More articles about encapsulation

  1. javaScript Branch judgment and built-in objects

    One , Branching structure Single choice structure (if) Two way selection structure (if/else) Inline ternary operators ?: Multiple choice structure (switch) 1.1  if Control statement if-else The basic format : if ( expression ){ sentence 1; ...

  2. JavaScript Reference manual ——javascript Local and built-in objects 、BOM、DOM

    This section provides a complete JavaScript Reference manual : JavaScript Local objects and built-in objects Browser object (BOM) HTML DOM object JavaScript Object reference manual This reference manual describes ...

  3. JavaScript( Thirteenth days )【 Built-in objects 】

    Learning points : 1.Global object 2.Math object ECMA-262 The definition of built-in objects is :" from ECMAScript Implement the provided . Objects that do not depend on the host environment , These objects are ECMAScript Before the program is executed ...

  4. python And The front-end development ( JavaScript Variable 、 data type 、 Built-in objects 、 Operator 、 Process control 、 function )

    11.4 JavaScript 11.41 Variable 1. Syntax for declaring variables // 1. Declare before define var name; // You do not need to specify a type when declaring a variable , Variable name Any type of name= " ...

  5. Fifth day : Built-in objects (7.Javascript Built-in objects )

    1) The technique in is built-in object ,2) For custom objects The code description is as follows 2.1.1 How to define and create object instances 1, The code is as follows : <!DOCTYPE html><html lang="en&quo ...

  6. javascript Local , host , Built-in objects

    One . Local object : Officially defined objects are independent of the host environment ECMAScript Implement the provided objects , Including operating system and browser . The local object is ECMA-262 Defined classes ( Reference type ).“ Local object ” Include content :   Object ...

  7. javascript Learning notes - Reference type Single built-in object

    7、 ... and Single built-in object 1.Global object Properties and methods that do not belong to any object , It's all about it . Variables defined in the global scope . function , All belong to Global object 1.1 URI code  encodeURI <=>deco ...

  8. javascript Study ( 3、 ... and ) Built-in objects

    One : event (Event) object It's triggering dom Every time there's an incident, there's a event object type   Get event type target  Get the event target stopPropagation()  Stop the event from bubbling preven ...

  9. JAVA-JSP Built in objects request Get... That encapsulates all parameter values Map

    Related information :<21 Tian Xue Tong Java Web Development > Get... That encapsulates all parameter values Map1. adopt request Object's getParameterMap() Method to get the Map object .2. Through the Ma ...

  10. javascript: Object oriented and common built-in objects and operations

    The content of this article is : object-oriented Common built in objects and operations First date :2018-05-11 object-oriented : JavaScript Is an object-oriented programming language (OOP).OOP Languages enable us to define our own object and variable types . The object is ...

Random recommendation

  1. c Language Four methods call arrays

      #include <stdio.h> /********************************* * Method 1: The length of the first dimension may not be specified * * But you have to specify the length of the second dimension * * ...

  2. actual combat :ajax Request with parameters slim API

    restful api Support get,post,put,delete Other methods , that jquery How can the client be implemented ? When it comes to cross domain, what should we do ? A lot of times you need to pass a token(api_key) To identify users , a ...

  3. Akka.NET

    https://github.com/akkadotnet Akka What is it? ? Scalable distributed real-time transaction processing Write the right concurrency , Fault tolerant and scalable applications are too difficult . Most of the time , It's because we use the wrong tools and mistakes ...

  4. PAT (Basic Level) Practise:1027. Print hourglass

    [ Topic link ] This question requires you to write a program to print the given symbol into the shape of an hourglass . For example, given 17 individual “*”, It is required to print in the following format ***** *** * *** ***** So-called “ Hourglass shape ”, Refers to the output of odd symbols per line : In each line of symbols ...

  5. When making a permission tree Use EasyUI in Tree

    accord with EasyUI in Tree Of Json Format , Let's take a look first , How is the format [{ "id":1, "text":"My Documents", & ...

  6. LintCode-Serialization and Deserialization Of Binary Tree

    Design an algorithm and write code to serialize and deserialize a binary tree. Writing the tree to a ...

  7. Python Basics : Binding and method calling

    First , Methods are just functions defined within a class , in other words , Methods are class properties, not instance properties . Second, methods can be called in two ways : Calling bound methods and unbound methods . When there is an instance , Method is considered to be bound to that instance , When there is no instance ...

  8. SQL error :ORA-12899

    1. Error description SQL error :ORA-12899: Column "USER"."T_USER_TAB"."USER_ID" It's worth too much ( actual value :4, Maximum :2) ...

  9. Android Development skills —— Set the system status bar color

    Come to the point , Let's start with three renderings : Then we'll talk about how to do it and how to do it quickly . How to achieve To set the color of the system status bar, at least Android 4.4.2(API 19) above . This is because , Below this version , There is nothing A ...

  10. Use MediatR Refactoring event release in monomer application / subscribe

    title : Use MediatR Refactoring event release in monomer application / subscribe author :Lamond Lu Address :https://www.cnblogs.com/lwqlun/p/10640280.html Source code :https ...