After the vnpy_ctp source code is downloaded, it is converted into a python usable processing process.

Table of Contents write in front Download the source code and unzip it Create python project environment process Compile vnpy_ctp source code Verify availability Write in front Visual Studio must be installed in the window system, and C++ compilation is required when installing the source code later. Download the source code and unzip GitHub – […]

C/C++ 11/14 rewrites a std::function<…> function template that supports safety and no multiple copies, supports Lambda λ and overloaded operator()(…) operator structure and C/C++ language Ordinary functions.

As the title of this article indicates, it was rewritten for optimization, and the solid-size BUFF buffer provided by the standard library std::function implementation was cut off because it is no longer necessary. The implementation copies the shared pointer. Reference, instead of needing to copy the BUFF and reconstruct it like the official version. If […]

Priority queue and overloaded operators

Directory 1 priority queue 1.1 Heap 1.2 Priority queue priority_queue 2 Overloaded operators 2.1 Overloaded operators 2.2 Constructor 2.3 Examples 2.3.1 Luogu P1631 sequence merging 2.3.2 Idea 1 2.3.3 Idea 2 1 priority queue 1.1 Heap The underlying implementation of the priority queue is the heap. The heap must be a complete binary tree. Heaps […]

11 postures downloaded using Python, each more advanced than the last

In this tutorial, you will learn how to download files from the web using different Python modules. Additionally, you will download regular files, web pages, Amazon S3, and other resources. Finally, you’ll learn how to overcome various challenges you may encounter, such as downloading redirected files, downloading large files, completing a multi-threaded download, and other […]

rust overloaded comparison operators

To overload a comparison operator, you need to implement the corresponding trait for the type. Overloading == and != requires implementing PartialEq or Eq Overloading = requires implementing PartialOrd or Ord 1. Eq/PartialEq Why are there two traits? Because there are two types of equality relationships: one is complete equality, and the other is partial […]

The javascript front-end xhr uses the FormData() and FileReader() functions to upload images, and the back-end php receives and processes the FormData() uploaded data. Only 1 data can be received and methods to prevent upload vulnerabilities.

//The front-end check type is simple check, because penetration will stop the front-end javascript code, so detection and replacement on the back-end is the focus. <!DOCTYPE html> <html xmlns=”http://www.w3.org/1999/xhtml” lang=”UTF-8″></html> <html> <head> <meta http-equiv=”Content-Type” content=”text/html;charset=UTF-8;”/> <title>For testing uploaded files</title> <script type=”text/javascript” src=”common.js”></script> <style type=”text/css”> .button {<!– –> margin-right: 20px; } #preview {<!– –> display: flex; […]

IF overloaded function creation for PostgreSql database

Passing two parameter values of the same type CREATE OR REPLACE FUNCTION IF(BLN boolean,INVALUE1 ANYELEMENT,INVALUE2 ANYELEMENT) RETURNS ANYELEMENT AS $$ begin if bln=true then — IF pg_typeof(INVALUE1) = ‘timestamp with time zone’ then return inValue1::timestamp with time zone; — END IF; — IF pg_typeof(INVALUE1) = ‘timestamp without time zone’ then return inValue1::timestamp without time zone; […]

Large files are uploaded in parts, resumed at breakpoints, and MD5 determines whether to upload.

Install dependencies pnpm install spark-md5 pnpm install @types/spark-md5 -D Multiple upload and breakpoint resume function definition CHUNK_SIZE = 10 * 1024 * 1024; // 10M getFileMD5(file: File) {<!– –> const fileReader = new FileReader(); // Get the file fragment object (note its compatibility, it is written differently in different browsers) const blobSlice = File.prototype.slice || […]

The third-level directory of the third-level classification cannot be loaded. The back-end interface can return all data on the front-end.

Directory Project scene: The three-category classification part is not displayed Problem description: Directories after database serial number 128 are not displayed Cause analysis: Database & JAVA backend Code: backend interface solution: 1 Database serial number problem 2 JAVA level 1 Change recursive to non-recursive writing 2 Rewrite the interface: Query the subdirectory with cat_id 128 […]