Java: read and write access to file content

RandomAccessFile class is a java provided access class for file content, which can read or write files. The RandomAccessFile class supports random access to files, that is, any location where files can be accessed. (1)java's file model The files on the hard disk are stored in byte, which is a collection of data (2) There are two modes to op ...

Posted by JeremyMorgan on Thu, 30 Apr 2020 12:25:23 +0200

Asp.Net Core 3.1 learning 4. JWT based token verification and Swagger use in Web Api

1. Initial JWT 1.1 JWT principle JWT (JSON Web Token) is the most popular cross domain authentication solution at present. Its advantage lies in that the server does not need to store tokens for distributed development, and provides data for the APP for the project of front-end and back-end separation. The items of the token generated by log ...

Posted by presence on Tue, 28 Apr 2020 07:06:22 +0200

Servlet case 2: File Download

First, solve two small problems 1. Input Chinese code disorder A small Demo can solve: package demo; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class D ...

Posted by psymonic on Wed, 22 Apr 2020 16:53:01 +0200

Python Foundation: double bottom method

1. Double down method Definition: double down method is a special method, which is provided by the interpreter and has special significance. Double down method is mainly used by python source code programmers. We try not to use double down method in development, but it is a deep study of double down method, which is more beneficial for us to re ...

Posted by jfgreco915 on Mon, 20 Apr 2020 17:27:10 +0200

Analysis of quicklist source code of Redis

Analysis of quicklist source code of Redis 1, Introduction to quicklist Redis list is a simple list of strings, sorted by insertion order. You can add an element to the head (left) or tail (right) of the list. A list can contain up to 232 - 1 elements (4294967295, more than 4 billion elements per list). The internal data structure that its unde ...

Posted by furma on Sun, 19 Apr 2020 15:12:17 +0200

ziplist source code analysis of Redis

ziplist source code analysis of Redis 1, ziplist introduction From the previous analysis, we know that ziplist (compressed list) is used for the underlying storage of quicklist. Since the compressed list itself has many contents, we reopened this article. Before the official source code, we should first look at the characteristics of ziplist: ...

Posted by gazolinia on Sun, 19 Apr 2020 14:58:37 +0200

Priority and dead letter queue of RabbitMQ and. net core messages

1. Priority of message If there is a requirement now, we need to push some of the highest priority notifications to the client. We can use the sortedset of redis or the message priority attribute of rabbit we are going to talk about today Producer code using RabbitMQ.Client; using System; using System.Collections.Generic; using System. ...

Posted by andrew_ww on Sat, 18 Apr 2020 17:28:20 +0200

Data Processing with Python 1 - Learn to use NumPy

1. Learn to use ndarray 1.1 What is ndarray? ndarray is a multidimensional array object in NumPy that can be one-dimensional, two-dimensional, or even more.Of course, creating more dimensional arrays is not his advantage. Its advantage is that it has a rich method of operation, and it is also the base of another advanced Python library, panda ...

Posted by kneifelspy on Fri, 17 Apr 2020 21:56:32 +0200

11, Getting started with Python - Advanced

Advanced Date and time import datetime import time # Introduce time Modular import calendar #Get current date time now=datetime.datetime.now() print(now) #Get the specified date d=datetime.datetime(2019,10,1,12,23,40) print(d) #Date to string d2=d.strftime("%Y/%m/%d %H:%M:%S") print(d2) #String to date s="2020-8-15 2:30:20" d3=datetime.da ...

Posted by Black Rider on Wed, 15 Apr 2020 17:06:18 +0200

Python3 Standard Library: json JavaScript Object Notation

1. json JavaScript object notation The JSON module provides an API similar to pickle, which can be represented linearly and is called JavaScript Object Notation (JSON).Unlike pickle, JSON has one advantage: it has multiple language implementations (especially JavaScript).JSON is most widely used for communication between Web servers and clients ...

Posted by igebert on Wed, 15 Apr 2020 04:17:42 +0200