• Timing Control and Reference Counting Philosophy


    Today I was listening to a T10 defense, and there is an idea that I find very interesting, so I will record it. background: The download video business layer uses Service, and the same download task can only correspond to one playback behavior.Problems can arise if two services download the same video in the following […]

  • AT2294 [AGC009E] Eternal Average


    topic portal Considering the evaluation process, it is easy to find that we will form a\(k\)fork tree, then the final sum is each\(1\)point corresponding to the depth\(\frac{1}{k}\)power sum. It is easy to find that there are\(k\)The same point can be used in the next layer\(1\)replace the dots and delete the above\(k\)points, so we only need […]

  • Spark: MapReduce Implementation of Word Count (Java/Python)


    1 guide we are blogging"Hadoop: MapReduce Implementation of Word Count"After learning how to implement word counting with Hadoop-MapReduce in , let's see how to implement the same function with Spark. 2. Spark's MapReudce principle The Spark framework is also a MapReduce-like model, which adopts the "divide and conquer-aggregation" strategy to perform distributed and parallel processing […]

  • How to use redis to count massive UVs?


    foreword Let's first think about a common business problem: if you are responsible for developing and maintaining a large website, one day the boss asks the product manager to ask for the daily UV data of each page of the website, and then asks you to develop this statistical module, how would you implement it? […]

  • 2022.8.14 Multi-School Weekly Newsletter


    Summarize Bulls Game 7 C The opening sign-in question, a structure, was written directly by rty. F Thinking questions, similar to bracket matching, but I didn't expect to use stacks to implement them at the time. It was very troublesome to write WA several times. Finally, rty used a pseudo-linked list and made it. G […]

  • PHP implements a singly linked list of data structures


    What is a singly linked list A linked list is a structure that stores data in a chain, which does not require continuous storage space. The data in the linked list is represented by nodes, and each node is composed of elements (storing data) and pointers (pointing to subsequent nodes). Singly linked list (also called […]

  • Official Python workshop: Is it really feasible to completely remove the GIL?


    作者 : Łukasz Langa Translator: Cat under the Pea Flower, Source: Python Cat original:https://lukasz.langa.pl/5d044f91-49c1-4170-aed1-62b6763e6ad0 During the annual Python core developer sprint conference, we had a meeting with Sam Gross, author of nogil. nogil is a forked version of Python 3.9 that removes the GIL. This is an informal meeting minutes. simple summary Sam's work proves […]

  • C++11 Dynamic Memory Management


    C++ memory static memory, dynamic memory After the static memory is allocated, it will not be released during the running process of the program, and once allocated, its memory size will be fixed and cannot be changed, and it will be allocated during the compilation and linking stages. Dynamic memory is allocated and released according […]

  • LeetCode/Blocks that can complete sorting at most


    1. Block I that can complete sorting at most Given an integer array arr of length n, it represents an array of integers in the range [0, n – 1].We divide arr into chunks (ie partitions) and sort each chunk individually. After concatenating them, the result of the concatenation is the same as the original […]

  • Parse a little detail about the SQL statement Count


    The count statement supports *, column names, constants, and variables, and can be modified with the distinct keyword, and count (column name) will not accumulate null records. Let's use some examples to demonstrate the rules of count: For example, for the following table, all columns are represented by sql_variant type. copy codecode show as below: […]

  • Objective-C shallow copy and deep copy


    shallow copy Shallow copy is to copy the memory address, so that the target object pointer and the source object point to the same memory space. like: char* str = (char*)malloc(100); char* str2 = str; Shallow copy is just a simple copy of an object, allowing several objects to share a piece of memory. When […]

  • ES6 Map WeakMap Set WeakSet


    Map The main disadvantage of js objects as maps is that non-string types cannot be used as keys. In principle, Map can use any data type as keys let tMap = new Map(); let key1 = { x: 1 }; let key2 = { y: 2 }; // assign tMap.set(key1, ‘key1’); tMap.set(key2, ‘key2’); // get […]