💬 share An agent named "aggressive leadership" was detected on the Doubao platform. Adhering to the concept of "nonviolent communication", we carried out several rounds of exchanges and finally bowed down. LINK This situation shows that "nonviolent communication" is not an overnight method, but needs to go through many rounds of persistence, and also tests whether we have actually established a connection with each other's emotions.

    Obviously, in my round, I just applied the formula, but did not really understand the reason why "leaders" were angry, nor did I really understand the needs of "leaders" ("my" work achieved good results). Subconsciously, I always thought that the "leader" was not a normal person and was too stupid... I found another "nonviolent communication expert" agent (although not particularly professional...) to make them communicate, and finally got the approval of the "leader". LINK Can clearly feel,

    The "nonviolent communication expert" has no anger when communicating. We have the standard to judge things, but it is really difficult to judge each other unconsciously in communication.

    (The text is polished by "bean bag")

    🙉 astonishing [People who criticize themselves frequently also love to criticize others]

    I find that many times I feel bad or not good enough, It's not just about judging yourself. The subtext is to blame (judge) others The two are so closely related that it is inconceivable.

    For example, "I think I am isolated, which leads to a feeling of sadness and sadness". At the same time, I subconsciously think that the other party "deliberately", "deliberately" and I can't get by, or that others do not follow our ideas, and do not give us enough support and understanding. In the process of criticizing ourselves, we are also constantly judging others' faults, which may be because it is too painful to judge ourselves, so that our subconscious has to blame others.

    When you are in the pain of judging yourself:

    1. First of all, I realized that I was judging others. Consciously stopping judging others will push us not to judge ourselves
    2. Put all your attention on yourself and be aware of what is really unmet. These needs may be multi-level, or they may be the needs to complete an ongoing task and be respected and recognized. These needs have nothing to do with specific people. These perceptions further promote how we do to meet our needs. For example, when you finish your work, you can focus on your current work. If you want to gain recognition, you don't need to do it from a single object, even from your own recognition. These thoughts allow us to take more optional actions instead of indulging in negative emotions

    "It's All Depends On You", which is translated into "All decisions are in our own hands" , I like it very much. This time, you can decide your emotions by yourself, starting from stopping judging anyone, starting from being aware of your real needs and what you can do to meet your needs

    📖 read In Toad Going to See a Psychiatrist, Toad found that he had been criticizing himself all the time. "He would severely punish himself, including torturing himself. In extreme cases, he would even inflict capital punishment. But the problem is that even if he was given a light sentence, such condemnation and punishment could be accompanied by life imprisonment."

    Toad asked, "Heron, what should I do? Can you help me?"
    The heron replied, "You are the only one who can help you. There are many questions you need to ask yourself. For example, can you stop criticizing yourself? Can you treat yourself better? Perhaps the most important question is, can you begin to love yourself?"

    [Can you begin to love yourself]
    I've heard of chicken soup for countless times. How can I love myself. Stopping criticizing yourself is a way, but it is not specific enough. From Nonviolent Communication, there is also a separate chapter called "Love Yourself".

    Self criticism, such as "why am I so stupid" and "how did I do that thing at that time", will directly generate the feeling of "guilt, guilt, depression", which makes you "lose connection with yourself". Two aspects can be considered:

    1. Why did that meet what needs? Once we take the initiative to think about this, we can better understand ourselves and forgive our behavior at that time. "Regret is always unavoidable, but there is no need to regret"
    2. Now, what needs are not satisfied and you feel "guilty, guilty, depressed"? It may need to be concerned, recognized, appreciated and understood. After active thinking, the previous feelings of "guilt, guilt, depression" will be replaced by other feelings, such as "sadness, sadness, regret, fear". Instead of condemning ourselves, we will be motivated to meet our immediate needs, so that we can learn, gain and grow from them. When you criticize yourself and feel "guilty, guilty and depressed", it is also an opportunity for self growth.

    "Do you love yourself?" How much attention do you pay to yourself? That is, how often do you pay attention to your feelings and needs? It may be a question that I need to keep thinking about.

    🍃 Handsome Theme Turn up most of the font sizes of the theme by one size. For a long time, I feel that the 14px text is not easy to read, and the text color of the text has been adjusted a little darker before. I don't know how you feel

    C++Tips Google C++Style About Output Parameters in May 20, 2020 And previously recommended pointers:

    Input parameters are usually values or const references, while output and input/output parameters will be pointers to non-const .

    And after that , the modified specification recommends the use of references:

    Input parameters should usually be values or const references, while required (non-nullable) output and input/output parameters should usually be references

    Personally, I think the pointer is more explicit as an output parameter. If a reference parameter is used, the programmer may miss const, so the input parameter is mistaken for an output parameter.

    However, this may not be a good reason, because it is the programmer's own fault. At the same time, it is troublesome to use internal null detection when passing pointers.

    📖 read Recently, I was reading Nonviolent Communication. I read a few pages on WeChat very early. This time, I bought a physical book and thought it was very good.

    The nonviolent communication process is not complicated, and the communication can follow four steps: observation, feeling, need and request. The core of nonviolent communication is not to criticize/judge anything, but to focus on whether your feelings and needs are met.

    First, we need to distinguish observation and evaluation I tried this training for a day and it was not easy. For example, "someone accidentally bumped into the canteen and would subconsciously swear that he didn't have a long eye", "someone running the red light at the traffic light would think that he really has no quality". In addition to this obvious evaluation, there are also some very confusing evaluations. For example, you always leave work early, and he comes in late at every meeting. He often meets without saying hello. It seems that they are describing facts, but in fact, they have brought evaluation words, such as "total", "every time", "often", and "deliberately". The evaluation rate of these words is evaluation, and observation is to describe accurate facts without any emotional preference.

    Second, distinguish between feelings and thoughts The feeling usually starts with "I feel", or expresses my emotions directly, such as I'm hungry, I feel lonely, I'm afraid, etc. But it is easy to confuse with ideas. Similar ideas and evaluations Generally, it starts with "I think", for example, I think he deliberately ignores me, I think he doesn't respect me, and I think he is incompetent. It will be found that the important difference between these two kinds of feelings is that feelings come from oneself and have nothing to do with others. Other people's behaviors are only external factors, not our feelings. The saying "I feel isolated" is very confusing. It is actually an idea rather than a feeling. The more accurate expression is "I think I am isolated"

    In nonviolent communication, it is very important to realize that The root of our feelings is the unmet needs from ourselves , rather than the behavior of others (may be relevant, but not the fundamental factor). Only when we realize this can we jump out of the thinking of blaming others and focus on how to meet our own needs.

    So it is very important to find your needs. However, it should be noted that "need" is the resource we crave, and "need" is distinguished from the way to meet needs. To be specific, "need" does not involve people with specific behaviors. For example, there is too much noise in the dormitory. "I need others to be quiet." This is not the "need" defined in the book. The real need here is "I need a quieter environment for better rest/study." Only by distinguishing these two points and expressing our needs in communication can the other party not feel that they are blaming the other party.

    In the actual communication, in order to let the other party better listen to our feelings, needs and requests, We also need to actively listen to each other's feelings, needs and requests. In particular, identify the feelings and needs in the other party's statements.

    In this book, there are two points that make me feel very interesting:

    • Misinterpretation of the source of "feeling". In reality, we can easily blame our feelings on others, such as "he is always lazy and makes me angry". The subconscious here is that we hope to make the other party feel guilty through this expression, and hope to use the other party's guilt to achieve our goals, which is actually a kind of language "violence". Instead of "nonviolent communication", it is roughly as follows: when I went home every day this week, my clothes were directly thrown on the sofa (observation). I felt unhappy (feeling), and I hoped that my home would be cleaner and more comfortable (needed). Can you put your clothes on the hanger? " It can be found that the same emotion can be expressed in a different way to reduce confrontation, which is amazing. The latter does not blame the other party, but focuses more on the other party's ability to meet their needs.
    PS. Once there is an angry mood, the essence is that your needs have not been met. If you express your own needs and are still unsatisfied, it means that the other party does not sincerely agree with your statement. It is likely that the other party's needs have not been met. You can guide the other party to express their feelings and needs. For example, the other person may be very tired after work, and needs to be more relaxed when going home. They don't want to be too formal. On the basis of full understanding of the other party, new needs will be proposed through negotiation until both parties can meet their own needs. Listening is also a very important part of nonviolent communication. Not only do you express your feelings and needs in a more appropriate way, but you also need to identify the feelings and needs of the other party from what they say,
    • The misinterpretation of "have to". I often think when I get up in the morning that I have to get up and go to work again today, and I have to face those worries at work again today. This kind of expression is a choice that others force them to make, and they have no other choice, which weakens their personal responsibility. The suggestion in the book is changed to "I choose ___ because". For example, the expression above can be changed to "I choose to get up and go to work every day because I want to get paid so that I can live a more decent and free life". In this expression, we can see that the choice we make is to meet our specific needs.

    The essence of these two common misinterpretations is to evade their own responsibilities, which needs better awareness.

    🙉 astonishing It is very easy and difficult to fight against negative emotions. The simple reason is that negative emotions are not real physical injuries, but can be controlled artificially. For example, when someone gives you a punch, you feel pain first, and then anger. The former is physical injury, while the latter is that the negative emotions generated by oneself have nothing to do with others. The difficulty is that many things seem to be out of control. Negative emotions flood the brain. Personally, I think it may be that physical injury experience is too little, so I am too obsessed with negative emotions.

    I often see some "affectation" comments, and the reply below: "I will be honest if I turn off the air conditioner for two days". It may be similar. The unbearable heat caused by turning off the air conditioner is physical damage. Only when the physical damage experienced is large enough, can we sneer at the "emotional damage" and be indifferent to it. How can we cherish the present if we have not experienced the agony that cuts through our bones? It is easy to fall into negative emotions

    So if you often fall into negative emotions, maybe you are unfortunate, but perhaps also happy O ω O, because pain is always relative, maybe you will say that pain cannot be compared, and it is meaningless to compare pain with others, but the pain you feel is real and comparable

    💬 share New York is 3 hours ahead of California but it does not mean that California is slow, or that New York is fast. Both are working based on their own "Time Zone. "

    LINK

    💼 Learning from work

     std::string origin_response_body = "test_content"; const int body_len = origin_response_body.length(); std::unique_ptr<char[]> response_body(new char[body_len]); memcpy(response_body.get(), origin_response_body.c_str(), body_len); std::string body = response_body.get();

    This code is hidden, but it is difficult to find. Because if the last bit in the array is not \0 End character. During the construction of string, memory will be accessed incrementally according to the address until the end character is found. This process will lead to abnormal memory access and other problems

    However, in the real environment, it may not necessarily lead to a crash, because when we apply for a piece of memory in new [body_len], the allocated size will be larger than the applied size due to the differences in memory alignment and operating systems, so the memory at the body_len location is likely to be the terminator. C++Tips

    📝 Daily record Self awareness

    I was writing an article about "the feeling after reading" this evening. I found that I had entered the "state" after writing for about an hour, so I found the importance of entering the state.
    Before, I might think that "entering the state" is just an adjective, but today I find that it is really a concrete step to do a good job.

    Here are some conditions that come to mind at present:

    1. Good environment: environment is important, for example, it is easier to focus in a quiet environment. However, many times there may not be such a good environment, so you can try a better environment, such as earplugs or pure music, full screen documents, etc., but be careful not to give up the basics.
    2. The first action that can see the significant effect: if you are writing an article, it is easy to hold back a word in the afternoon. The reason is probably that we think too much in our minds. From the summary of the article to all kinds of details are in our minds, instead of on paper, so we can not focus on one point. So we can consider writing down a few points first, and then not paying too much attention to the format, Then go to the first point. After finishing the first point, you will find that the following content has a natural idea. If you are writing code, you can try to start from UT and complete the first verifiable UT. If you do not have the conditions to write UT, you can start from completing the first code that can be compiled, and then go to the function that actually produces specific functions. You must not create a bunch of files at the beginning of kuchikuchi, and the compilation fails. You want to write the compilation at one time. This is a very serious error.
    3. The determination to enter the state: You must have the determination to enter the state. For example, you do plan to complete a task tonight, which is very important.
    4. Long time length: it is better to enter the state from 1 hour. If it is too short, there is limited work to be done, so it is necessary to ensure that this hour is not interrupted by other things (such as a meeting, when others come to ask questions, etc.)
    5. Single work content: focus on one thing instead of switching multiple tasks at the same time

    🙉 astonishing Recently, AI thought that my first reaction to 9.11>9.8 was the same as AI's Maybe I've seen too many version numbers

    🙉 astonishing It was interesting to see a comment: "At least I have never heard of people thinking before they died that they didn't make more money and did more things for the company in those years."

    💼 Learning from work

    The last two requirements try to be developed as "test oriented development". The so-called "test oriented development" or "test driven development", I understand, is to write UT first, and write the called functions and expected interfaces in UT first. Each EXCECT is written to implement the function of the class. After writing UT, the function is also developed to ensure the quality of the module.

    In this way, we find that the resistance to writing code is less. The design idea of multiple interfaces may be mixed in the mind of writing code before. Through UT, only one new case is added each time to realize this case. It will be easier to make mistakes if you can "walk quickly in small steps".

    This has a great requirement on the quality of project code. If it is a new independent module, it is better. You can write UT from scratch. If the module depends on external modules, you need mocks or external modules to be testable.

    If a new function is added to an existing function module, it requires that the existing module be very testable. Many codes in history do not have UT, which is one of the difficulties.

    💼 Learning from work

    "When you rule out all impossible situations, the rest, no matter how incredible, are facts."

    It's like a detective when troubleshooting bugs 🕵️ Find the truth. Simple bugs, such as null pointers, can be found quickly from the code review. I encountered a bug this week. To put it simply,

    • Normally, operation B is performed first, and then operation C.
    • After the A operation is executed, it is expected that there will be no B operation or C operation, but the A operation is a cross thread asynchronous process (usually within a few milliseconds or tens of milliseconds).

    The online problem is that operation B occurs during operation A, leading to a direct crash during subsequent operation C. So there will be a very small probability of collapse online.

    The asynchronous process was not taken into account when writing the code here. At the same time, judgment should be added in the B operation or C operation. If the A operation is followed by a null operation.

    💬 share Vscode has always used dark themes. Recently, because the light on the monitor was too bright to see clearly in black, the light color theme "Solarized Light" was used instead, which was not dazzling, and the color was very soft and light yellow. I like it very much, and recommend it!