Java instance - print graphics
Java instance – print diamond
Outputs a diamond with a specified number of rows.
package com.example.yan.java Print graphics;
public class Main {
public static void main(String[] args) {
print(8); // Output 8-line diamond
}
public static void print(int size) {
if (size % 2 == 0) {
size++; // Ca ...
Posted by andrewburgess on Sun, 28 Nov 2021 10:53:42 -0800
Merge and sort: solve the problem of small sum and reverse order pairs
1, Small and problems
1. Title Description:
In an array, the numbers on the left of each number that are smaller than the current number are added up, which is called the small sum of the array. Find the small sum of a given array.
2. Example:
The array is: [1,3,4,2,5]
1 the number smaller than 1 on the left: No
3 the number smaller than ...
Posted by porco on Sun, 28 Nov 2021 10:30:33 -0800
String of Redis core data structure
From common String commands to actual application scenario requirements design and development, this chapter enables you who are unfamiliar with redis to quickly master and understand, and you who are familiar with redis to quickly consolidate relevant knowledge
1, Characteristic description
(1) String is the most basic type of Redis. A key c ...
Posted by chrisdee on Sun, 28 Nov 2021 09:25:55 -0800
lettcode algorithm problem punch in - day05
Maximum depth of binary tree
Given a binary tree, find its maximum depth. The depth of the binary tree is the number of nodes on the longest path from the root node to the farthest leaf node.
explain: A leaf node is a node that has no children.
Example: Given binary tree [3,9,20,null,null,15,7],
3 / \ 9 20 / \ 15 ...
Posted by riwan on Sun, 28 Nov 2021 08:52:54 -0800
Java0 Basics_ day18_ Front end and back end integration of Java Web_ Ajax
Tags: JavaScript front end, HttpServlet back end, XML JSON mediation
1. Introduction to Ajax
Ajax is an asynchronous combination of JS and XML, which can be understood as a new method. It integrates the front-end JavaScript, HTML, CSS, DOM programming and the back-end httpservlet Tomcat and Mysql databases. JS is used to create asynchr ...
Posted by jrinco11 on Sun, 28 Nov 2021 08:21:46 -0800
How to quickly filter out all logs of a request?
Source: wudashan.com/2018/02/15/Log-Request-In-MutiThread01. PrefaceWhen the existing network fails, we often need to obtain all logs in the request process for location. If the request is processed in only one thread, we can filter the log through the thread ID, but if the request contains asynchronous thread processing, it is difficult to rel ...
Posted by lancey10 on Sun, 28 Nov 2021 08:07:56 -0800
Dubbo remote call - invoke
example
In the example, the DemoService instance is obtained through the Spring context. In the previous article Dubbo Consumer reference service We have learned about the process of referencing services, creating invoker s and creating proxy objects. The DemoService instance here is the created proxy object, and then the sa ...
Posted by markts on Sun, 28 Nov 2021 07:09:08 -0800
Agent model of structural model (static agent, dynamic agent [principle], CGLIB agent)
5. Structural mode
Structural pattern describes how to form a larger structure of columns or objects according to a certain layout. It is divided into class structure pattern and object structure pattern. The former uses inheritance mechanism to organize interfaces and classes, and the latter uses composition or aggregation to combine objects. ...
Posted by udendra on Sun, 28 Nov 2021 06:52:07 -0800
[concept analysis] on the principle and use of Java keyword synchronized
Introduction to preface
When it comes to synchronized in Java, many people's first reaction is lock, which is inaccurate. In Chinese, it means synchronization. Lock is a concept, an abstract noun, and synchronization is an action and an operation result.
Inaccurate translation leads to deviation in understanding. For example, the translation of ...
Posted by loweauto on Sun, 28 Nov 2021 06:50:17 -0800
Actual combat and source code analysis of Alibaba micro service component Nacos configuration center
1, Nacos configuration center
Official documents: https://github.com/alibaba/spring-cloud-alibaba/wiki/Nacos-config
Nacos provides key/value storage for storing configuration and other metadata, and provides server-side and client-side support for externalized configuration in distributed systems. Using Spring Cloud Alibaba Nacos Config, ...
Posted by jOE :D on Sun, 28 Nov 2021 06:30:01 -0800