Tag:program execution

  • Quick review the use of FS module in node.js


    JavaScript does not have the ability to operate files, but node can do it. Node provides a module to operate the file system. It is a very important and high-frequency module used in node, and it is absolutely a module system to master. fsModule provides a lot of interfaces, here are some common interfaces. 1. […]

  • The use of else in Python loop structure


    Python   In, whether it is a while loop or a for loop, it can be followed by an else code block. When the loop condition is false, the program will execute the code in the else code block first. Taking the while loop as an example, the following program demonstrates how to add an […]

  • Introduction to Apache Hudi


    Introduction to Apache Hudi [TOC] Real time data processing and real time data processing Real time is divided into processing real-time and data real-timeAd hoc analysis requires real-time data processing, and the corresponding results should be obtained immediatelyFlink and spark streaming are used for real-time processing of real-time dataThe scene where the data is not […]

  • Python reversed function and its usage


    Reserved () is one of the built-in functions of Python. Its function is to return an iterator of the reverse sequence (used to traverse the reverse sequence) for a given sequence (including list, tuple, string and range (n) interval). The syntax format of the reserved() function is as follows: reversed(seq) Among them, SEQ can be […]

  • Python sorted function and its usage


    Sorted () is one of the built-in functions of python, whose function is to sort the sequence (list, tuple, dictionary, collection, and string). The basic syntax format of the sorted() function is as follows: list = sorted(iterable, key=None, reverse=False)   Among them, Iterable represents the specified sequence, the key parameter can customize the sorting rules, and […]

  • The difference between process and thread


    Process is the basic unit of resource (CPU, memory, etc.) allocation. It is an instance of program execution. Thread is the smallest unit of program execution. It is an execution flow of a process. A process has its own independent address space. Every time a process is started, the system will allocate the address space […]

  • Three simplest implementation methods of timing task


    Days rush through me and run to the sea. Timing tasks are particularly common in actual development, such as the automatic cancellation of unpaid orders after 30 minutes of e-commerce platform, and the data summary and backup in the early morning, etc., which need to be realized with the help of scheduled tasks. Let’s take […]

  • In Linux, MySQL backs up some data that meet the conditions in the database, and then deletes the data script after backup


    #!/bin/bash DATE=`date +%Y%m%d%H%M` #every minute DATABASE=xxxxxx #database name DB_USERNAME=xxxxxx #database username DB_PASSWORD=xxxxxx #database password BACKUP_PATH=/home/csq/backup #backup path DATE1=`date -d “$(date +%Y%m%d) -2 weeks” +%Y-%m-%d\ %H:%M:%S` echo “${DATE1}” Echo “start executing backup command! ” #mysqldump -u$DB_USERNAME -p$DB_PASSWORD $DATABASE t_task –where=” create_time >=’2019-10-01 00:00:00′ ” > ${BACKUP_PATH}\/${DATABASE}_ mysqldump -u$DB_USERNAME -p$DB_PASSWORD $DATABASE t_task –where=” create_time <=’${DATE1}'” > ${BACKUP_PATH}\/xxx_task_$(date […]

  • Goroutine preemptive scheduling with new features of go 1.14


    Code example There is a go code that sets p to the number of1There are two goroutines and one ismain, an anonymous function that executes an endless loop package main import ( “fmt” “runtime” “time” ) func main() { runtime.GOMAXPROCS(1) fmt.Println(“The program starts …”) go func() { for { } }() time.Sleep(time.Second) fmt.Println(“I got scheduled!”) […]

  • Flink uses MySQL as a code example for source and sink


    1. Maven import <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.34</version> </dependency> 2. Source from MySQL tool class java code import org.apache.flink.configuration.Configuration; import org.apache.flink.streaming.api.functions.source.RichSourceFunction; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; /** * @Description TODO * @Author zytshijack * @Date 2019-05-14 08:32 * @Version 1.0 */ Public class sourcefrommysql extends richsourcefunction < student > {// student is a […]

  • Exception (1)


    Some unexpected errors may be encountered during program execution, which are called exceptions. All exceptions in. Net inherit System.Exception 。 Exceptions are passed up the stack until they are processed or terminated. Common abnormalities: IndexOutOfRangeException  Array index out of range, thrown at runtime.  NullReferenceException Reference null object, runtime exception.  InvalidOperationException Invalid operation exception occurred at […]

  • HPB development node Building Guide


    Introduction:When developing HPB DAPP, community developers first face the problem of how to access the HPB main network. This paper introduces the building process of the developer node, which is based on Ubuntu 16.04 build, the development node is equivalent to a light node, which can initiate transactions and synchronize blocks, but can not enter […]