Symbolic triangle

In the first line of the symbol triangle, there are n symbols composed of "+" and "-". Later, there are 1 fewer symbols in each line than those in the upper line. Under the two same signs, there are "+", and under the two different signs, there are "-". Calculate how many different symbol ...

Posted by cHinshaw on Sat, 14 Dec 2019 09:50:34 -0800

LeetCode learning record

Given a two-dimensional grid consisting of '1' (land) and '0' (water), the number of islands is calculated. An island is surrounded by water, and it is connected by adjacent land horizontally or vertically. You can assume that all four sides of the mesh are surrounded by water. Example 1: Input: 11110 11010 11000 00000 Outp ...

Posted by abhi_elementx on Fri, 13 Dec 2019 13:48:08 -0800

hdu1558 (Computational Geometry + concurrent search set)

http://acm.hdu.edu.cn/showproblem.php?pid=1558 Question meaning: n kinds of operations, p is adding line segment, q is asking, asking how many line segments there are in the online intersection set of the line segments of the current serial number, including themselves First A template for calculating geometry to determine w ...

Posted by mobiuz on Fri, 13 Dec 2019 13:06:00 -0800

Design mode - strategic mode

/** * Role superclass: * Follow the design principles, find out the parts that may need to change in the application, and separate them, * Don't mix with code that doesn't need to change. * We found that the display, attack, defend and run of each character could change, so we had to write this independently. * Then accordi ...

Posted by morphius on Fri, 13 Dec 2019 12:59:55 -0800

Characteristics and usage of PM2

Main features of pm2 Built in load balancing (for the use of Node cluster cluster module and subprocesses, please refer to Chapter 9 of Park Ling's "getting to the bottom of node.js") Thread guard, keep alive 0 second shutdown and heavy load, no need to shut down for maintenance and upgrading Now Linux (stable) & Mac OS X ...

Posted by ratebuster on Fri, 13 Dec 2019 12:37:05 -0800

TCP based calculator (Java)

A calculator based on TCP communication, the client sends data to the server through the button, the server calculates and processes the data, and sends the calculation result back to the client. It uses multithreading to enable. Server thread: package com.netproject2; import java.io.DataInputStream; import java.io.DataOutputStr ...

Posted by JAM on Fri, 13 Dec 2019 12:19:39 -0800

SpringCloud Distributed Microservice Cloud Architecture Part 5: Routing Gateway (zuul)(Finchley version)

SpringCloud Distributed Microservice Cloud Architecture Part 5: Routing Gateway (zuul)(Finchley version)In the micro-service architecture, several basic service governance components are needed, including service registration and discovery, service consumption, load balancing, circuit breaker, intelligent routing, configuration management, etc ...

Posted by wpsa on Fri, 13 Dec 2019 10:31:35 -0800

Using the subprocess module, running to. poll() always means that None causes the program to run abnormally

Problem: use subprocess in the server to monitor the running state of python and record the logs. The code can run normally on your own computer, but run to subprocess.Popen().poll() in the server and output None all the time, which causes the program to run abnormally. Environment: windows server 2003+python2.7 Cause analysis: I checked some ...

Posted by Sekka on Fri, 13 Dec 2019 10:01:06 -0800

php curl example code to simulate post request and submit multidimensional array

The following code introduces the example code of php curl to simulate post request. The specific code is as follows: $uri = "http://www.cnblogs.com/test.php "; / / here is the address of your own server // Parameter array $data = array ( 'name' => 'tanteng' // 'password' => 'password' ); $ch = curl_init (); // pri ...

Posted by debigmac on Fri, 13 Dec 2019 09:10:27 -0800

Today, let's talk about how to build a watch efficiently

"High efficiency" means the speed of table building is fast? no, it's 9012 years. What do you want? Efficient table creation refers to how to quickly query this table. Under the same resource conditions, the query performance is better than that of ordinary tables!When we build a table, we usually attach attributes to the table, such ...

Posted by birdie on Fri, 13 Dec 2019 00:37:57 -0800