Leetcode problem solving algorithm greedy algorithm (python version)
1. The longest chain that a number pair can form
646. Longest number pair chain (Medium) Method 1: greedy algorithm Sort all pairs according to the size of the second number. The first step is to select the pair with the smallest ending number. Then, each step selects the number that does not conflict with the last selected number pair and ...
Added by zaiber on Thu, 10 Mar 2022 02:07:41 +0200
[school recruitment -- phase II network programming] UDP socket programming
1, Preparatory knowledge
1. Understand source IP address and destination IP address
There are two IP addresses in the IP packet, one is the source IP address and the other is the destination IP address. IP address is responsible for transmitting data from one host hardware to another host hardware. IP address identifies the uniqueness of the ...
Added by neal.pressley on Tue, 08 Mar 2022 17:58:56 +0200
How to make recv have a little temper?
Hello, I'm brother Tao.
Today, let's talk about the recv function in TCP network programming. As we know, recv is a blocking function. When no data is received, it will wait for the data foolishly.
So, how to make the recv function have a little temper instead of waiting foolishly? The select function can be on top. Next, let's practice and d ...
Added by QuietWhistler on Mon, 07 Mar 2022 18:11:56 +0200
Concurrent programming - paramiko remote control module, virus attack principle, dll injection
paramiko module
Introduction: paramiko is a module for remote control. Using this module, you can operate commands or files on the remote server. It is worth mentioning that the remote management inside fabric and ansible is realized by using paramiko. 2. Download and install
pip3 install paramiko #In Python 3
In python2
pycrypto,beca ...
Added by mshallop on Mon, 07 Mar 2022 06:14:16 +0200
Add fixed IP to Ubuntu instance of multipass
Add fixed IP to Ubuntu instance of multipass
Multipass is a VM software discovered the day before yesterday. It is similar to Docker, but it feels that the instructions are relatively simple to use. The startup speed is much faster than Vmware, so Vmware, which has been used for many years, is abandoned. Recently, I found that many things, if ...
Added by 22Pixels on Sun, 06 Mar 2022 04:16:25 +0200
Introduction to webrtc Chapter 4 data channel
Introduction to webrtc Chapter 4 data channel
1, Introduction
In the process of realizing end-to-end connection in webrtc, in addition to transmitting media stream, it can also transmit text, files, pictures and other data. It is also practical in IM scenarios, and does not need third-party message services, such as websocket, transparent mes ...
Added by johng on Sat, 05 Mar 2022 18:05:33 +0200
Socket network programming learning notes UDP assisted TCP point-to-point transmission case -- UDP broadcast, search and obtain IP/Port
1. UDP search IP and port
Implementation principle: in a LAN, you don't know the IP address of the server, but only the UDP Port common to the server. In this case, you want to realize the TCP connection. TCP is a point-to-point connection, so you need to know the connection IP address and Port of TCP.
How to get the IP and Port of TCP? It ca ...
Added by zbert on Sun, 27 Feb 2022 09:23:37 +0200
netty -- sticky package and half package problem
netty(3) – stick pack and half pack problem
What is TCP sticky packet and half packet?
Suppose the client sends two data packets D1 and D2 to the server respectively. Since the number of bytes read by the server at one time is uncertain, there may be the following four situations.
The server reads two independent data packets, D1 an ...
Added by t_miller_3 on Thu, 24 Feb 2022 07:12:25 +0200
WinPcap handles offline heap files
1, Foreword
Through the previous study, we are familiar with capturing packets from the network card. Now we will learn how to process packets. WinPcap provides us with many API s to save packets flowing through the network to a heap file and read the contents of the heap. The format of this file is very simple, but it contains the binary cont ...
Added by jinwu on Tue, 22 Feb 2022 05:33:49 +0200
Java Programming Network Programming TCP Programming
Java Programming Network Programming TCP Programming
Complete the development of TCP programs using Socket s
Use this class to easily establish a reliable, two-way, continuous, point-to-point communication connection
In Socket development, the server side uses ServerSocket to wait for the client to connect. For Java network programs, each cl ...
Added by markjia on Mon, 21 Feb 2022 19:42:41 +0200