2019 Netease game school recruitment - Test and Development Engineer programming question-C++

Written examination of 2019 Netease Internet school recruitment - programming questions 1. The old Tetris game machine. Title: customize the number of Tetris columns. The number of Tetris dropped each time is 1 * 1. When a row is full of Tetris, score + 1. Now Xiaoming plays m Tetris and gets the score at this time. Input: Number of columns in ...

Posted by hori76 on Thu, 02 Jan 2020 12:54:10 -0800

Talk about rocketmq's DLedgerRoleChangeHandler

order This article mainly studies the DLedgerRoleChangeHandler of rocketmq. DLedgerRoleChangeHandler rocketmq-all-4.6.0-source-release/broker/src/main/java/org/apache/rocketmq/broker/dledger/DLedgerRoleChangeHandler.java public class DLedgerRoleChangeHandler implements DLedgerLeaderElector.RoleChangeHandler { private static final InternalL ...

Posted by travelbuff on Thu, 02 Jan 2020 00:20:36 -0800

Implement RPC service call framework by yourself

Reprint RPC of TCP Introduction In this paper, a simple rpc call framework is implemented by using socket programming of java. It is composed of two projects named batchake provider (service provider) and batchake consumer (service caller). The design idea is as follows: 1. In the battery cake provider, write a service called battery cake serv ...

Posted by wiggst3r on Wed, 01 Jan 2020 00:37:47 -0800

The problem of matching scheme of P2756 pilot in Luogu

Full name: linear programming and network flow 24 questions In order of difficulty: 1. Pilot pairing scheme problem (find the maximum number of matches and output the pairing scheme) There are two approaches: 1) the Hungarian algorithm of bipartite graph matching can directly find the maximum matching number, and the best matching scheme is rec ...

Posted by yuraupt on Wed, 01 Jan 2020 00:26:04 -0800

CSS preprocessor's Less

1, What is CSS preprocessor CSS preprocessor defines a new language. Its basic idea is to use a special programming language to add some programming features to CSS, take CSS as the target to generate files, and then developers only need to use this language for coding. Generally speaking, CSS preprocessor uses a special progr ...

Posted by $var on Tue, 31 Dec 2019 02:45:24 -0800

Are bean s in spring thread safe?

Spring does not guarantee thread safety of bean s.The bean s in the default spring container are singleton. When there is a race condition in a single case, there is a thread safety problem. As the following example Counting class package constxiong.interview.threadsafe; /** * Counting class * @author ConstXiong * @date 2019-07-16 1 ...

Posted by hucklebezzer on Mon, 30 Dec 2019 20:03:08 -0800

Design mode behavior mode -- command mode

1, Brief introduction to command mode command Pattern, in the process of software snake, we often need to send requests to some objects, but we don't know who the receiver of the request is, and what the requested operation is. We just need to make a specific request receiver when the program is running, at this time, we can use the command P ...

Posted by berry05 on Mon, 30 Dec 2019 12:36:01 -0800

jQuery realizes the function of clicking icon div to enlarge and shrink

A very basic function, click the icon button in the lower left corner, the whole div of the map will become larger. After the preview becomes larger, click the icon button again, the whole div of the map will become smaller and return to its original state. The two icons constantly switch the icon state (arrow inside or arrow outsi ...

Posted by webslinger on Mon, 30 Dec 2019 07:57:20 -0800

What are the common injection methods of spring?

1. Configuration in xml bean declaration and registration < bean > node register bean Factory bean parameter of < bean > node refers to factory bean, and factory method parameter specifies factory method   bean injection < property > nodes are injected in set mode < constructor Arg > node injection with construc ...

Posted by cornelombaard on Mon, 30 Dec 2019 06:13:24 -0800

[Spring Boot AOP records user operation logs] 1. Integrate mybatis basic framework

In the Spring framework, using AOP with custom annotations can facilitate the monitoring of user operations. First, build a basic Spring Boot Web environment to start Spring Boot, and then introduce the necessary dependencies: <dependency> <groupId>org.springframework.boot</groupId> <artif ...

Posted by dirTdogE on Mon, 30 Dec 2019 06:08:42 -0800