A “flyweight” C language coroutine library

Coroutine, as its name implies, is “co-operative routines”. Unlike threads with operating system concepts, coroutines are programming techniques that can achieve logical multitasking in user space by using the syntax and semantics of programming languages. In fact, the concept of coroutine is earlier than thread. According to Knuth, “Subroutine is a special case of coroutine”. […]

Java implements text duplication checking (similarity) without third-party tool version

Functional background: As business records gradually grow, duplicate project name data and duplicate content data gradually appear, which leads to a decline in the quality of project records. In order to avoid this situation from happening, we consider performing duplication checking on key data information. We originally planned to use a third-party standard duplication checking […]

[Android] Screen lag, optimized list fluency, pull down to refresh, pull up to load more components, RefreshLayout modification

I have also written about similar components before: Address: Pull down to refresh & pull up to load more components SmartRefreshLayout I originally planned to replace it with this one, but after careful research I found it was not suitable. The functions are very good, but they cannot be embedded in the current engineering system. […]

Build a server without a fixed IP

A nearly perfect solution Background: A server with a bandwidth of about 20 MB is required, but Alibaba Cloud’s cloud server is too expensive. If the bandwidth is high, it will be even more expensive. But using the local server directly, there is no corporate public network fixed IP, only dynamic public network IP, which […]

<1>, C++ implements multi-thread synchronization processing: controlling the output sequence of ABC, outputting 10 groups, mutex+condition_variable

Table of Contents need: analyze: Some code implementation: 1. Operations implemented using only flag bits: 2. For greater security, the mutex lock code is added: 3. Use it with unique_lock to make the code safer Four: Use guard lock lock_guard to work with it 5. You can also use condition variables to process, which will […]

BGP routing attributes——-AS_Path

1. AS_Path The AS_Path attribute has four forms, namely: AS_Sequence, AS_Set, AS_Confed_Sequence and AS_Confed_Set. AS_Sequence: It is an ordered set of AS numbers passed on the path to the destination. All ASs passed by the route are recorded in order. AS_Set: It is an unordered set of AS numbers passed on the path to the […]

select monitors on stdout and sockets

The content of selectServerInTCPIPbook.c is as follows: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <arpa/inet.h> #include <sys/socket.h> #include <sys/time.h> #include <sys/select.h> #defineBUF_SIZE 100 void error_handling(char *buf); int main(int argc, char *argv[]) {<!– –> int serv_sock, clnt_sock; struct sockaddr_in serv_adr, clnt_adr; struct timeval timeout; fd_set reads, cpy_reads; socklen_t adr_sz; int fd_max, str_len, fd_num, i; […]

Vue dynamically adds routes

1. Idea Each user has his own role, and different roles have different asynchronous routes (each role has constant routes). At this time, it is necessary to calculate the routing information in all user information returned by the backend after the user successfully logs in. The routes owned by the user are filtered out in […]