Tag:Counter

  • Using CSS counters to beautify a sequence table

    Time:2021-12-10

    In web design, it is very important to use an orderly method to display data, so that users can clearly understand the data structure and content displayed by the website. Using ordered list is a simple method to realize the organized display of data. If you need more in-depth control over the style of numbers […]

  • How does the spring boot interface limit current? The interviewer asked how to answer

    Time:2021-12-3

    Reading contents: 1. Preface2. Algorithm Introduction – counter method3. Algorithm Introduction – sliding window4. Algorithm Introduction – leaky bucket algorithm5. Algorithm Introduction – token bucket algorithm preface In a highly concurrent system, traffic control is very important. When huge traffic is directly requested to our server, the interface may not be available soon. If it […]

  • STM32 watchdog details

    Time:2021-11-29

    1、IWDG 1.1 introduction to independent watchdog Iwdg (independent watchdog) can be used to detect and solve faults caused by software errors. When the counter reaches a given timeout value, it will trigger an interrupt or generate system reset The independent watchdog clock is its dedicated low-speed clock (LSI), so it can keep working in time […]

  • Detailed explanation of STM32 basic timer

    Time:2021-11-28

    The most basic function of timer is to deal with things regularly. For example, regularly send USART data, regularly collect ad data, regularly detect IO port potential, and output waveform through IO port. It can realize very rich functions. Timer is a very powerful peripheral. It is used in different industries in different ways and […]

  • Discussion on flow control algorithm — principle and implementation of counter model

    Time:2021-11-19

    Flow control model summary That is, flow control, which is called “current limiting algorithm” in some places. For a system, limited by resources (CPU, memory, bandwidth, I / O, etc.), its processing capacity is limited. Once the customer’s traffic exceeds this limit, it will often lead to disastrous consequences. Therefore, various “current limiting algorithms” came […]

  • Installing redis on MAC

    Time:2021-11-15

    1、 Download Open the official website:redis.io/ Click download or use the command line to download: $ wget http://download.redis.io/releases/redis-5.0.8.tar.gz 2、 Decompression installation $tar -zxvf redis-5.0.8.tar.gz – C ~ / local # decompression $sudo MV redis-5.0.8 / usr / local / # Mobile $CD / usr / local / redis-5.0.8 # switch directories $sudo make test # […]

  • Canvas drawing performance optimization

    Time:2021-11-4

    Several points of canvas performance optimization Several points of test: 1. Traversing image data; 2. Compare the drawing efficiency of drawimage() and putimagedata(); 3. Use drawimage() to draw a canvas instead of a normal image 4. Zoom the image when drawing with drawimage(); Test artifact:http://jsperf.com/ Compare the drawing efficiency of DrawImage (htmlimage), putimagedata (htmlcanvas) and […]

  • Golang sync.WaitGroup

    Time:2021-10-31

    In go language, in addition to using channel and mutex to synchronize two concurrent programs, waiting groups can also be used to synchronize multiple taskssynchronization,Waiting groups can ensure that a specified number of tasks can be completed in a concurrent environment In the sync.waitgroup type, each sync.waitgroup value internally maintains a count whose initial default […]

  • Java – optimize code with thread pool and countdownlatch to improve execution efficiency

    Time:2021-10-17

    1. Problem description The customer put forward a new requirement. After the development, it was found that querying the data within one hour took more time7Second, the customer must be dissatisfied. If he is dissatisfied, he must mention it to the leader. If the leader is unhappy, I will be deducted from my salary! So […]

  • Common auxiliary classes

    Time:2021-9-18

    CountDownLatch Subtraction counter import java.util.concurrent.CountDownLatch; //Counter public class CountDownLatchDemo { public static void main(String[] args) throws InterruptedException { //The total number is 6. It can be used when the task must be performed CountDownLatch countDownLatch = new CountDownLatch(6); for (int i = 0; i < 6; i++) { new Thread(()->{ System.out.println(Thread.currentThread().getName()+” Go out”); countDownLatch.countDown(); },String.valueOf(i)).start(); […]

  • Go language: sync package control concurrency details!

    Time:2021-8-18

    In addition to the channel channel introduced in the previous section, there are also original synchronization mechanisms such as sync. Mutex and sync. Waitgroup to achieve more flexible data synchronization and control concurrency. Resource competition The so-called resource competition means that in a program, the same block of memory is accessed by multiple goroutines at […]

  • “Understand java” – why be afraid of concurrency, tools to help!

    Time:2021-8-17

    Hello, I’m a side dish.A hope can becomeTalking about architecture with ox xMy man! If you want to be the person I want to be, or pay attention and be a partner, so that the dishes are no longer lonely! This paper mainly introducesNecessary concurrent tools for brick moving It’s all here. I’m ordering to […]