Tag:Key value

  • C++ STL associative container

    Time:2022-6-5

    1、 Foreword While storing the element value, the associated container will also be equipped with an additional value for each element (that is, a key, which is also a c++ basic data type or user-defined type element in essence). Its function is to find the target element directly through the key if the key value […]

  • Mybatis integrates redis to realize L2 cache

    Time:2022-6-4

    The mybatis framework provides a L2 cache interface. We only need to implement it and enable the configuration to use it.In particular, we should solve the problems of cache penetration, cache penetration and cache avalanche, and ensure the cache performance.See the code comments directly for specific implementation instructions! 1. Open configuration Springboot configuration mybatis: configuration: […]

  • C++ STL map container

    Time:2022-6-4

    1、 Foreword When a map container is used to store multiple key value pairs, the container will automatically sort according to the established rules according to the size of the keys of each key value pair. By default, all key value pairs are sorted in ascending order based on the size of the key.Notes:Using each […]

  • C++ STL map iterator

    Time:2022-6-3

    1、 Foreword The STL standard library is equipped with a bidirectional iterator for map containers. Therefore, map container iterators can only perform +p, p++, –p, p–, *p operations, and only = = or= Operator. 2、 Iterator method method function begin() Returns a two-way iterator that points to the first (note, the first ordered) key value […]

  • The interviewer asked, is redis single threaded or multi-threaded? I’m confused

    Time:2022-6-2

    When we see articles about redis, we always say that redis is single threaded. But when we study, for example, the bgsave command of redis is used to asynchronously save the data of the current database to the disk in the background. Since it is asynchronous, it must be completed by other threads. How can […]

  • C++ STL map get the value corresponding to the key

    Time:2022-6-2

    1、 Method 1. Obtained through [] Similar to accessing array elements. std::map<int, string> mapInfo{ {1,”test”},{2,”lin”},{3,”wei”} }; string strData = mapInfo[1]; std::cout << “strData: ” << strData << std::endl; The results are as follows:be careful:1) Only when there is a key value pair containing the specified key in the map container, the overloaded [] operator can […]

  • C++ STL map insert data

    Time:2022-6-1

    1、 Foreword As mentioned earlier, you can modify or add key value pairs through the [] operator. This usage is not mentioned here. 2、 Method 1、insert The insert method is specifically used to insert new key value pairs into the map container. The “insert” here means that the insert () method can insert a new […]

  • C++ STL Multimap container

    Time:2022-5-31

    1、 Foreword The Multimap container is basically similar to the map container. Here, only the contents that the map container does not have or the differences between the Multimap container and the map container are explained.The difference from the map container is that multiple key value pairs with the same key (≥ 2) can be […]

  • Sass mapping function

    Time:2022-5-30

    In this section, let’s take a look at the mapping function in sass. The mapping in sass consists of key/value pairs. The mapping is immutable, so when we operate on the mapping, we will not modify it in the original mapping, but return a new mapping object. function describe map-get() Returns the value corresponding to […]

  • An article takes you through Android backup

    Time:2022-5-28

    preface Smart devices such as mobile phones play an important role in modern life. We will perform daily operations such as login accounts, setting preferences, taking photos, and saving contacts on these smart devices. These data cost us a lot of time and energy and are extremely important to us. If our device is upgraded […]

  • Redis Series Textbook (V) – spring data redis usage examples

    Time:2022-5-28

    Step 1: spring support for redis Step 2: run first, see the effect, and then learn Step 3: imitation and troubleshooting Step 4:redis Properties Step 5:applicationcontext XML Step 6: redisutil Step 7: testredis Step 1: spring support for redis Spring also supports redis operations. This example explains how to use spring to access redis Step […]

  • Source code analysis of context package (attached)

    Time:2022-5-25

    Context package source code analysis Context is equivalent to a tree structure Finally, please answer this question: is the method in the context package thread safe? Context package mainly has one interface and three structures Context interface type Context interface { Deadline() (deadline time.Time, ok bool) Done() structural morphology type valueCtx struct { Context key, […]