Many people, including myself, have long believed that TCP-based application layer protocols are simple and only require a packet header. Because TCP is a reliable protocol, it ensures that data reaches the other side in an orderly and error-free manner; it is just stream-oriented and does not preserve message boundaries, so we only need to define protocol packet headers that can distinguish individual datagrams. However, this is wrong: the transport layer protocol is limited in what it can do, and the application layer protocol can do much more than encapsulate a packet header.
In-depth understanding of the KMP algorithm
String matching is a very common algorithm. What it does is, for the pattern string t, find the first occurrence of it in the target string s. For example, if t = "abcab", s = "ababcabd", the algorithm should return 2. Talking about string matching, we have to mention the KMP algorithm. KMP is a very powerful algorithm, which is very clever and can match strings in linear time complexity.
An article to help you distinguish between encodeURI and encodeURIComponent
Helps you distinguish between encodeURI and encodeURIComponent usage scenarios
Background Recently, while working on the preview feature in my company, I came across a scenario of encoding the request parameters. So the question arises.
Why is it necessary to encode a link or parameter? When do I need to encode? What is the difference between * encodeURI and encodeURIComponent? Let’s take a look at it together~
Why do you need to encode Http protocol parameter transmission is “key=value” such key-value pairs, if you want to pass more than one parameter you need to use the “&” symbol to split the key-value pairs.
vue project to get local LAN IP address
Sometimes there is a need to access the vue project via IP address on the LAN, so we document the method to get the local IP. Installing dependencies To get the IP, we need to use the os module, and we need to install the following dependencies. 1 npm install os Modify the configuration You need to modify the project configuration file vue.config.js. Add a function to get the local
LibreOffice is developing a new Cairo graphical backend
Tomaž Vajngerl, a developer from Collabora, has been working on a new Cairo backend, which was successfully merged into the LibreOffice codebase on Thursday; introducing another graphics backend to the open source office suite. And there have been some new follow-up commits to start moving more functionality to SvpGraphicsBackend.
SvpGraphicsBackend is LibreOffice’s new VCL (Visual Class Library) backend that contains a backend implementation of graphics drawing, using Cairo for drawing. currently, according to Vajngerl, the Cairo-based graphics drawing implementation is basically on SvpSalGraphics; however, there will be a gradual shift to SvpGraphicsBackend, just like the other vcl plugins.
Microsoft Exchange's scanners can't accept 2022
Starting with Exchange Server 2013, Microsoft enables the FIP-FS anti-spam and anti-malware scanning engine by default to protect users from malicious emails. However, starting at midnight on January 1, 2022, a unique way of storing dates in the FIP-FS engine caused a bug that blocked email delivery from Microsoft Exchange on-premise servers.
On January 1, 2022, the first day of the new year, Twitter user “long wtf = 2201010001” tweeted @msexchangeteam said that the FIP-FS “Microsoft” scan engine failed to load and could not convert “2201010001” to long type.
How to install Ruby on Debian 10
Ruby is one of the most popular languages today. It has an elegant syntax and is the language behind the Ruby on Rails framework.
In the tutorial, we will look at different ways to install Ruby on Debian 10.
We will show how to install Ruby from the default Debian 10 repository as well as using Rbenv and RVM scripts. Choose the installation method that best suits your setup and environment.
How to build a c/c++ development environment in Linux/MacOS using vscode
Whether you’re a fan of the Lord of the Rings movies or not, you’ll agree that almost everyone loves unity, and having a unified development experience is something that developers have always strived for and welcomed.
Development environments have long been tightly coupled with specific technologies, such as Visual Studio, for primarily .NET-based development. We’ve seen heated debates among developers who endlessly argue for one tool over another. This will never end, nor should it, because many times these arguments result in the awesome tools we are using today.
Origin of Linux tty
From UNIX to Linux, you’ve heard the term “TTY”. As a desktop user, you should be using it and you use it a lot. In the tutorial, let me mention everything necessary to get you familiar with the term TTY in Linux. Please note that there is no clear answer to this, but it has to do with the way input/output devices used to interact. Therefore, you must know some history to get a clear understanding.
M1 mac system deep learning framework Pytorch secondary anime animation style migration filter AnimeGANv2 + Ffmpeg (image + video) quick practice
Some time ago, the industry’s most famous anime style transformation filter library AnimeGAN released its latest v2 version, and it has been the talk of the town for a while. When it comes to secondary yuan, the largest domestic user base is undoubtedly the Jitterbug client, which has a built-in animation conversion filter “Transformation Comic” that allows users to convert their actual appearance to secondary yuan “style” during live broadcasts.
Avoid files gaining root privileges when docker mounts
When docker mounts the disk, as many containers use root to run programs inside the container, it will cause the files generated in the mount belong to root:root. generally the user outside the container is not root, which will make file sharing or even reading logs unnecessary trouble. This article aims to solve the problem of generating root privileged files from the root without changing the container.
The files generated by docker often need to be accessed by sudo chmod o+rw *, which is troublesome, but at least you have sudo privileges.
Type conversion in C++
Introduction This blog is about the four type conversions in C++: static_cast, const_cast, reinterpret_cast, const_cast, their usage and some usage scenarios.
static_cast The reference scenario of static_cast compares conversions, according to CppReference, to perform static type conversions from the expression e to T in the following cases.
Common types for the expression e can be converted from an implicit type to T If a standard conversion sequence exists for types from T to e, a static type conversion can perform the inverse of that implicit type conversion sequence.
Basic usage of smart pointers in C++
Introduction Smart pointers are mainly used to automate the management of resources. There are std::unqiue_ptr, std::shared_ptr and std::weak_ptr according to their usage.
unique_ptr unique_ptr is mainly used to implement exclusive management of a resource object whose life cycle will end at the end of the unique_ptr declaration cycle or when it is pointed to another resource. A resource managed by unique_ptr can be transferred to another unqiue_ptr via std::move.
The following are some simple examples.
Common coordinate systems in autonomous driving
Introduction In autonomous driving, there are several coordinate systems involved from the car’s sensors to global positioning, which are briefly organized below.
Sensor Coordinate System Each sensor has its own coordinate system, which can be divided into relative measurement (measuring environmental information) and absolute measurement (measuring its own information) according to its measurement principle. Relative sensors such as cameras and LiDAR measure environmental information for indirect positioning, while absolute sensors such as IMUs, tachometers, and GPS measure their own motion (speed, position, attitude, etc.
CPI/CPA advertising common cheating methods summary
Advertising attribution methods To discuss ad cheating, you need to understand the logic of ad attribution first. Cheating methods are basically based around the logic of ad attribution. There are various ad attribution schemes, we will mainly discuss here application-based advertising, overseas mobile ecology, and third-party attribution schemes. Overseas mobile advertising ecology has more mature and credible third-party attribution platforms, such as Appflyer, Adjust and Kochava, etc. The core logic of attribution is that the final attribution logic is the same as the final attribution logic.
MySQL: Conditional Judgment Based Data Insertion
MySQL INSERT INTO Statement The CREATE TABLE statement enables you to create columns, while the INSERT statement enables you to insert rows or records into a table.The INSERT statement is an example of the Data Manipulation Language (DML). As the name implies, data manipulation language deals with data manipulation.
MySQL INSERT INTO Syntax Insert a column into the table
1 2 3 INSERT INTO table_name VALUES (value_for_column1, value_for_column2, value_for_column3,... value_for_columnN); Insert multiple columns in a table
Code to determine if IOS is jailbroken
“Jailbreaking” has existed since the Appstore was evaluated, when many people jailbroken in order to install paid applications or games. With the richness of Appstore applications and the increase of free APPs, there are few users who jailbreak their phones in order to sacrifice their security. On the other hand, jailbroken devices can install any software or script at will, which also brings the door of convenience to the black
Deep learning to recognize sliding CAPTCHA
In this section, we will learn how to use deep learning to recognize sliding CAPTCHA.
1. Preparation We mainly focus on completing the process of using the deep learning model to identify the CAPTCHA gap this time, so we will not focus on explaining the algorithm of the deep learning model, and also because the whole model implementation is more complex, this section will not write the code from scratch, but we tend to download the code in advance for hands-on practice.
Understanding multipart/form-data in HTTP protocol
I encountered the problem of encapsulating the Media type multipart/form-data when writing a generic HTTP component. This article briefly introduces the definition, application and simple implementation of the media type multipart/form-data in the HTTP protocol. Definition of multipart/form-data The media type multipart/form-data follows the multipart MIME data stream definition (which can be found in Section 5.1 - RFC2046), which roughly means that the data body of the media type multipart/form-data
New remote code execution vulnerability in Apache Log4j
Another serious remote code execution vulnerability has been discovered in the Apache Log4j log library, now tracked as CVE-2021-44832. This is the third RCE and fourth vulnerability in the Log4j library, followed by CVE-2021-44228 (RCE), CVE-2021-45046 (RCE), and CVE-2021 -45105 (DoS attack).
The Apache team has now released a new Log4j version to fix this newly discovered vulnerability. According to the introduction, CVE-2021-44832 shows that Apache Log4j2 is vulnerable to RCE attacks via the JDBC Appender when an attacker controls the configuration.