• JQuery picture preload plug-in


    For more resources, see star:https://github.com/maidishike… Picture preload plugin Website development often needs to browse a large number of pictures on a page, which will lead to the phenomenon of fake death of the web page. Therefore, in order to make the pictures not wait during conversion, we’d better let the pictures be preloaded locally first, […]

  • Redis source code – jump table


    preface A skip list is an ordered data structureOrdered linked listIt solves the efficiency problem of finding a value in the ordered linked list. Jump table supports averageO(logn)In most cases, the efficiency of node search with the worst o (n) complexity is comparable to that of balanced tree, and the implementation is simpler. Redis uses […]

  • Data structure — insert sort


    A go implementation of insertion sorting package main import “fmt” //Insert sort is an efficient sort algorithm second only to quick sort. Insert sort is an internal sort (memory) like bubble sort and selection sort //Unlike the other two, insert sort inserts unordered into an ordered array, so it is different from the other two […]

  • [PHP data structure] insert class sorting: simple insertion and sorting


    Finally, we have entered the learning of our sorting related algorithms. I believe that friends who have systematically studied or have not systematically studied algorithms will have heard of many well-known sorting algorithms. Of course, our introduction today is not to start with the most common algorithm, but to introduce it one by one according […]

  • [go] golang exercise project – Implementation of insertion sorting in go language


    Core idea: Divide the array into sorted and to be sorted parts, and insert an element from to be sorted into the appropriate position of the ordered array until all to be sorted are inserted Take the first element as the sorted array, and compare the following elements with the sorted elements from back to […]

  • Zset (ordered set) of redis’s five data types


    On the basis of set, a value is added, set K1 V1, Zset K1 Score1 v1 [1] > zadd myset 1 one # add a value (integer) 1 [1] > zadd myset 2 two 3 # add multiple values (integer) 2[1]> ZRANGE myset 0 -1 1) “one” 2) “two” 3) “three” […]

  • Talk about flynk’s async I / O


    order This paper mainly studies the async I / O of flynk example // This example implements the asynchronous request and callback with Futures that have the // interface of Java 8’s futures (which is the same one followed by Flink’s Future) /** * An implementation of the ‘AsyncFunction’ that sends requests and sets the […]

  • Redis basic operation – sorted set


    Redis ordered collections, like collections, are collections of string elements, and duplicate members are not allowed. The difference is that each element is associated with a score of type double. Redis sorts the members of the collection from small to large through scores. Members of an ordered set are unique, but scores can be repeated. […]

  • Springboot integrates redis and mybatis and encapsulates redisutils tool classes


    Springboot integrates redis and mybatis and encapsulates redisutils tool classes Create springboot project (omitted) Redis part Introducing redis dependency <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> Redis configuration class package com.malf.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.redis.connection.RedisConnectionFactory; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.serializer.RedisSerializer; import org.springframework.data.redis.serializer.StringRedisSerializer; /** * @author malf *@ description redis configuration class, set redis template * @date 2021/5/23 […]

  • Understand redis, the core data type


    String string tring  Types are binary safe, i.e  string Can contain any data. The ordinary string in redis adopts raw encoding, that is, the original encoding method. This encoding method will dynamically expand the capacity and reduce the overhead of frequent memory allocation by pre allocating redundant space in advance. When the string length is less […]

  • 33. Search in Rotated Sorted Array


    Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e.,[0,1,2,4,5,6,7]might become[4,5,6,7,0,1,2]). You are given a target value to search. If found in the array return its index, otherwise return-1. You may assume no duplicate exists in the array. Your algorithm’s runtime complexity must be in the order of _O_(log _n_). […]

  • How to find out whether an ordered array contains a value in PHP (binary search)


    Problem: for an ordered array, how to judge whether a given value exists in the array.   Idea: the simplest way to judge whether there is an array is to directly loop the array and compare each value. But for an ordered array, this writing does not make good use of the “ordered” feature. So […]