• Interpretation of golang slice source code


    This paper studies the creation, expansion and deep copy implementation of golang slice from the source code perspective. Internal data structure Slice has only three fields, in which array is the part to save data, len field is length, and cap is capacity. type slice struct { array unsafe.Pointer //Data section Len int // length […]

  • Why is redis fast? Do you only know single thread and memory based? I’m sorry I can’t offer you


    Interview scene Interviewer: what data types does redis have? Me: string, list, set, Zset, hash Interviewer: no? Me: Oh, oh, and hyperloglog, bitmap, geohash, bloom filter Interviewer: that’s it? Go home and wait for the announcement. preface I’m sure that 100% of the people who answered the first answer can say it, but there may […]

  • Tomcat enable gzip compression


    If we can shorten the transmission time of tomzip, we can shorten the response time of tomzip. Here I amconf/server.xmlConfiguration fragment in: <Connector port=”9915″ protocol=”HTTP/1.1″ maxThreads=”200″ connectionTimeout=”20000″ enableLookups=”false” compression=”on” redirectPort=”8443″ URIEncoding=”UTF-8″ compressionMinSize=”1024″ compressableMimeType=”text/html,text/xml,text/plain,text/javascript,text/csv,application/javascript,application/json,application/xml” /> Please note thatcompressThe first three-stage configuration. Here, we add compression in XML, CSV, JSON and other formats, and specify the length […]

  • Server based on HTTP range header rule to achieve breakpoint continuous transmission or sectional download (C ා)


    HttpRangeRequest header, combined with response headerAccept-Ranges、Content-RangeIt can realize the following functions: 1、Breakpoint continuation。 To continue downloading after the download file is interrupted. It can avoid repeated downloading of the downloaded parts.2. Big filesSpecified block Download。 Such as video, audio drag play, directly locate to the specified location to download content. It can avoid reading and […]

  • Precautions for using ant dead form getfielddecorator


    2020-01-06 Precautions for using ant dead form getfielddecorator 1、 Form must be used before using getfielddecorator.create({ })(Form)Wrap form components class ControlForm extends React.Component {} //When exporting, use the component controlform Form.create () wrap it up export default Form.create()(ControlForm)   2、 AfterForm.createPackaged components will come with youthis.props.formProperty, the form is deconstructed by the deconstruction assignment //Deconstruct form […]

  • Sjson of go daily library


    brief introduction In the last article, we showed you how to usegjsonQuickly read the value in the JSON string. For the sake of content integrity, today we will introduce how to use itsjsonQuickly set the value in the JSON string. Quick use Install first: $ go get github.com/tidwall/sjson After use: package main import ( “fmt” […]

  • Solution and principle analysis extension of sqlserver error “parameter data type ntext / text is invalid for parameter 1 of replace function”


    reason:In data query, the replace function cannot perform string operation on colname of text / ntext type in table table. resolvent:Treat text as varchar (when the actual content length is less than 8000 bytes) or ntext as nvarchar (when the actual content length is less than 4000 bytes). However, when the text field content length […]

  • Longest palindrome substring (Python 3)


    Problem Description:Given a string s, find the longest palindrome substring in S. You can assume that the maximum length of S is 1000.Example:Type: “babad”Output: “bab”Note: “ABA” is also a valid answer. Solution: traverse from the first character to the last character of the string, judge whether the substring from the character to the first character […]

  • Regular application in IOS


    1、 Nsregularexpression 1. Regular expression creation + (nullable NSRegularExpression *)regularExpressionWithPattern:(NSString *)pattern options:(NSRegularExpressionOptions)options error:(NSError **)error; – (nullable instancetype)initWithPattern:(NSString *)pattern options:(NSRegularExpressionOptions)options error:(NSError **)error Properties in this class patternReturns the regular expression pattern optionsReturns the options used to create a regular expression option numberOfCaptureGroupsReturns the regular expression pattern The enumeration types defined by options are as follows: typedef […]

  • Analysis of MySQL index length restriction principle


    This article mainly introduces the analysis of MySQL index length restriction principle. The example code is introduced in detail in this article, which has certain reference learning value for your study or work. You can refer to the following for friends who need it Indexes Textfield does not support indexing MySQL has restrictions on the […]

  • Front end in-depth JS chapter array array operation from introduction to Chengshen up up, updating continuously


    Write in front With the in-depth learning of the front end, we found thatarrayThis data structure has a great sense of existence in the front-end. Since I didn’t learn the front-end systematically when I started, I will learn with you through this articlearrayHope we can make progress together and learn to operate arrays skillfully. Array […]

  • Mysql database: the concept of data


    Basic definition Data: the basic object of total database storageDefinition: symbolic record of describing objective thingsCategory: number, text, figure, image, sound, etcDatabases: collections of DB stored dataDBMS: DBMSA layer of data management software between user and operating systemOrganize and store data scientifically, acquire and maintain data efficientlyDatabase system: DBSThe system after introducing database into computer […]