Topic 4 of new features of Java 8: lambda method reference and constructor reference

landscape Java 8's lambda introduces three method references, constructor references, and array references to reduce code development. It should be noted that if you need to use this feature, the method return value type, parameter number and type must be consistent with the functional interface. example Object instance meth ...

Posted by slobodnium on Sat, 05 Mar 2022 17:12:32 +0100

Handwritten simple Promise

Promise, as a new function in ES6, helps us solve the problem of callback hell and makes our asynchronous code clearer and simpler. As a front-end programmer, handwritten simple promise should be a necessary skill. Next, I won't say much. I'll go directly to the code. class Commitment { static PENDING = 'undetermined'; static FULFILLED = ...

Posted by kritikia on Sat, 05 Mar 2022 17:07:16 +0100

A king's time, I learned the smart pointer in c + + (including code implementation)

catalogue 1. What is a memory leak 2. How to avoid memory leakage 3. Why is there a smart pointer 4. Use and principle of intelligent pointer 4.1RAII 4.2 classes designed with RAII idea 4.3 implementation of intelligent pointer 5. Summary 1. What is a memory leak 1. Memory leak: memory leak refers to the situation th ...

Posted by kjelle392 on Sat, 05 Mar 2022 16:50:49 +0100

Redis cluster usage example

Today, I learned about the use of redis cluster. Here, I will record the problems encountered in the process 1, Environment construction (docker needs to be installed first) Here, docker will be used to deploy four redis instances (node1-3 as the primary node and node4 as the standby node of 1) Here, four redis instances are deployed on th ...

Posted by drag0n on Sat, 05 Mar 2022 16:34:21 +0100

TypeScript decorator Complete Guide

Decorators make the world of TypeScript better. Many of the libraries we use are built on this powerful feature, such as Angular and Nestjs . In this blog, I will introduce the decorator and many details of it. I hope that after reading this article, you can understand when and how to use this strong feature. overview Decorator is essential ...

Posted by Jeb. on Sat, 05 Mar 2022 16:32:24 +0100

Interaction between JavaScript and css

Style sheet basic syntax tag chooser input{ width:120px; border:solid 1px #ff0000; } ID Selector #flow{color:#ff0000} Class selector .center{ text-align:center; font-weight:bold; } Common styles Style sheet type Internal style sheet style between < head > and < / head > labels <html> <head> ...

Posted by iron999mike on Sat, 05 Mar 2022 16:24:30 +0100

C language to achieve a simple Gobang game

catalogue Game ideas: 1. Print menu 2. Define chessboard ---- define a two-dimensional array 3. Initialize chessboard ------ initialize to space 4. Printing chessboard ----- first, you need to see the chessboard horn 5. Players play chess 6. Computer chess 7. Judge the end of the game 8. The main body of the total function of the game ...

Posted by hijack on Sat, 05 Mar 2022 16:21:16 +0100

Call api interface

How do we usually call the interface? In Vue, we usually call the interface through the library of axios, but when developing in uniapp, we need to borrow the library of uniapp for development. Next, let's explore it together. I uni.request(OBJECT) Function: send network request Description of OBJECT parameters: 1.url Type: String Requi ...

Posted by phpisawesome on Sat, 05 Mar 2022 16:18:27 +0100

Node.js file system

1, Node JS file system Node.js provides a set of file manipulation API s similar to the UNIX (POSIX) standard. Node import file system module (fs) syntax is as follows: 2, Asynchronous and synchronous Node. The methods in the JS file system (fs module) module have asynchronous and synchronous versions. For example, the functions that ...

Posted by jay1318 on Sat, 05 Mar 2022 16:10:31 +0100

[dark horse programmer C++ STL] learning record

Dark horse programmer 2017 C++ STL tutorial (STL part has been completed) STL course arrangement based on dark horse: Dark horse programmer 2017C++STL tutorial ⬅😊 Video link special column 😬: Contents of this STL column Article catalogue Dark horse programmer 2017 C++ STL tutorial (STL part has been completed)The link is as foll ...

Posted by AchillesForce on Sat, 05 Mar 2022 16:07:30 +0100