Redis -- delay queue

Redis's list data structure is often used as an asynchronous message queue. rpush/lpush is used to enter the queue and lpop/rpop is used to exit the queue > rpush my-queue apple banana pear (integer) 3 > llen my-queue (integer) 3 > lpop my-queue "apple" > llen my-queue (integer) 2 > lpop my-queue "banana" > llen my-queue (in ...

Posted on Wed, 06 Nov 2019 04:18:23 -0500 by ssruprai

Convert nested JSON data to TABLE

Prepare some data first:   Create a temporary table to store:   DECLARE @json_table AS TABLE ( [type] NVARCHAR(MAX), [desc] NVARCHAR(MAX) ) Source Code   Get the first level data:   INSERT INTO @json_table ([type],[desc]) SELECT [type],[desc] FROM OPENJSON (@json_text,'$.DB') WITH ( [type] NVARCHAR(MAX ...

Posted on Tue, 05 Nov 2019 16:18:11 -0500 by rolajaz

Python Basics: input and output (I/O)

To do an NLP task The steps are: 1. Read the file; 2. Remove all punctuation and line breaks, and change all uppercase to lowercase; 3. Merge the same words, count the frequency of each word, and rank them according to the word frequency; 4. Output the result to the file out.txt by line. Code: import re import os,sys # You don't ...

Posted on Tue, 05 Nov 2019 15:05:30 -0500 by bubblocity

Using python to call pinpoint interface to realize pin alarm

Use python to call the pinpoint interface to implement the pin alarm. 1. When the application monitored on the pinpoint is called incorrectly and the number of errors is more than 5 (you can set the threshold value by yourself, which is 5 by default), the alarm will be triggered. 2. Just change the webhook and PPURL in the script ...

Posted on Tue, 05 Nov 2019 11:08:54 -0500 by cmanhatton

Spring cloud responsive microservice series tutorial (Chapter 10): complete code example of responsive RESTful service

This is the tenth chapter of the series of practical spring cloud responsive microservices. This chapter gives a complete code example of responsive RESTful services. It is suggested that children's shoes without previous foundation should be read first, and the chapter catalog should be placed at the end of the article. 1. Build responsive RES ...

Posted on Mon, 04 Nov 2019 22:51:26 -0500 by maseeha

The problem of a parseInt function found by javascript random number

A few days ago, I wanted to forge some data and used random numbers. I didn't write it myself, so I searched the Internet and found this article: https://www.cnblogs.com/starof/p/4988516.html  . Then I tested it and found a problem about parseInt. Finally, we found that the reason for the problem was that we didn't know enough about this ...

Posted on Mon, 04 Nov 2019 22:41:58 -0500 by moboter

Use code to synchronize an issue in github warehouse to CSDN blog

I am a lazy programmer. I wrote a lot of sharing articles in the github warehouse in the form of issue, and I want to synchronize them to CSDN. But I don't want to copy and paste every article by hand, so I want to automate it with code. Example: https://github.com/i042416/KnowlegeRepository/issues/2215 This is my issue: I use the following no ...

Posted on Mon, 04 Nov 2019 15:26:22 -0500 by qingping

XXE vulnerability triggered by XML referencing external entities

Record a question first   The input in the input box is displayed in the area above. Check the background source code, there is such a fragment function XHR() { var xhr; try {xhr = new XMLHttpRequest();} catch(e) { var IEXHRVers =["Msxml3.XMLHTTP","Msxml2.XMLHTTP","Microsoft.XMLHTTP"]; f ...

Posted on Mon, 04 Nov 2019 12:19:16 -0500 by jwadenpfuhl

Gorang as the server, C (unity) as the client, Socket communication problems

Server datalen + message ----- > packagedata ----- > network transmission ([] byte) ---- > client ----- > unpackedata ----- > datalen + message To write network program with Soket, you need to customize the protocol yourself. {len+data} len parses the length of data, and data parses the data to be transmitted Message on server ...

Posted on Mon, 04 Nov 2019 11:53:47 -0500 by fukas

Realization of Web paging function

Whether it is website or APP paging function is essential. Why paging? 1. The loading speed is fast, which will not occupy too many resources of the server and reduce the pressure on the server. 2. Reduce database pressure. 3. Improve the user experience.   There are two common paging methods. 1. True paging: each page will read a small a ...

Posted on Mon, 04 Nov 2019 05:41:20 -0500 by trufla