Depth, breadth and sharpness empower the product, how can the "minority party" of Yangcheng Evening News leverage the "majority"?

In recent years, with the development of the Internet public opinion field, culture and entertainment, as the most basic type of social needs, has seen exponential growth compared with the past with the rapid development momentum and the richness of the user link field. In this context, entertainment reporters only focus on celebrity gossip and the current situation of the industry, which has obviously lagged behind the development of business formats and the needs of the public. They must strive to broaden their horizons, focus on social hotspots from the perspective of entertainment, and play the role of "social observer" and "public opinion guide".

March 21, 2022 A10 version

A few parties – cross-border comments on the national football team, is Gong Hanlin qualified?

"A Few Parties" Audio Program

"Minority Party" has three sub-columns: "Strange Knowledge Increase", "Forensics Department" and "Relativity", with the purpose of "not necessarily absolutely correct, not guaranteed to please you". At the same time, the content is refined, and the products are empowered by "depth", "sharpness" and "breadth". Through long-term practice, the column starts from striving for "the majority of the minority" (see previous tweets for details: not necessarily absolutely correct, not guaranteed to please you, Yangwan Yuantang "Minority Party": "Explore new entertainment spaces other than visualization"), and gradually advances to strive for "the majority outside the minority" while standing on the "minority". The column jumped out of the stereotype of entertainment reporting only focusing on star news and gossip, and explored some ways on the road of socialization of entertainment news.

Do a good job in "depth" and "forensics department" and convince the "majority" with ideas

The "Forensics Department" was born out of the "Tasting" version operated by the Entertainment News Department for many years. Under the old model, most of the column articles were professionally "critical" of the works, and the splashes caused were mainly within the industry.

Some comments on the "Forensics Department" column

In the new way of thinking, the commentary adds a focus on the realistic issues in the work, and looks at movies, TV series, variety shows, dramas, and music works from a deeper perspective.

2021 domestic film word-of-mouth champion "Lion Boy"

For example, "Lion Boy": The annual domestic film word-of-mouth champion, who "blackened" this "lion"? "refutes online smears that the image design of the film’s protagonist" vilifies the Chinese ";" Take You to Meet My Mom ": Dramatic Tension Comes from" Living "explores the changes in family intergenerational relations in urban and rural changes;" Real Growth ": Game, Reconciliation and Self-Consistency" explores the purpose of education reform; "Sister Who Rides the Wind and Waves": No need to force "chicken soup" directly denounces social psychology’s enthusiastic pursuit of youth and excessive disdain for years.

Increase "Sharpness" "Strange Knowledge" Attract "Majority" with New Knowledge

The name "Strange Knowledge Zeng" comes from the abbreviation of "Strange Knowledge Added Again". It focuses on knowledge, allusions, laws and regulations derived from entertainment events and works. With its unique perspective and literary style, it has broken a new path in the battle with many entertainment marketing accounts.

Some articles in the "Strange Knowledge Increase" column

Recently, "Qi Zhizeng" has changed the previous passive practice of "finding topics on the whole network", planning and writing in advance before major nodes, such as "Can Bing Dwen Dwen and Shuey Rhon Rhon speak? Beijing Winter Olympic Games Organizing Committee Regulations: No!" The article was born after Bing Dwen Dwen became an Internet celebrity, and was named and praised by the Publicity Department of the Chinese Communist Party for his professional interpretation of the rules of the International Olympic Organizing Committee; the popular science article on the flower skating competition suit "Kausten" "Hanyu Knot String Wear" Little Cherry Blossom "Kausten Appears in the Performance Slip, What are the ways behind the gorgeous competition suit?" Launched within five minutes after the game; "Mask, Cloak, Tights, Superhero" Three-Piece Set "Why Isn’t It Outdated?" This article jumps out of a single evaluation of the movie "New Batman", starting from the overall image of Marvel heroes, and interprets the complex reasons for the history and culture behind their classic costumes…

Broadening "breadth" "relativity" relies on content to generalize "majority"

In comparison, "relativity" undoubtedly plays more tricks.

First of all, the advanced "theory of relativity" has become more diverse in terms of topics. Small to a movie, a variety show, big to a trend, a cultural phenomenon, all of which cannot be exposed to the inside story, analysis of the way, talk about opinions, such as "Watching a drama to see" dramatic anger ", can you report a work-related injury?" "When the star’s character has also begun to" roll in ", who still remembers how the character came to be?" and so on. From the news hot spots, superimposed on the entertainment experiences and private experiences of the friends, the content of the program is witty, interesting and flexible, and constantly bursting.

February 28, 2022 A10 version

"A Few Parties" Audio Program

Secondly, after a long period of development, "Relativity" has gradually evolved from the "relative" of the entertainment department friends at the beginning to a fierce collision of views from different fields. In addition to Bobo, Beard, Xiaoyu, Erqiu, Kelp, Carp and other regular guests, each program tries to add voices from outside the entertainment industry. The content of "Relativity" successfully "breaks the wall" and touches social reality from entertainment works.

For example, "Cross-border Review of National Football, Is Gong Hanlin Qualified?" is not only a fierce confrontation between entertainment reporters and sports reporters representing two circles, but also draws the conclusion that "Feng Gong Zhan Zhan" is a "battle of emotions" rather than a "battle of reason", and sees the lack of domestic football culture behind the "group ridicule" of the national football team; "Watching the fun or touching the doorway? Is the workplace variety show useful for beating workers?" invites senior HR to participate, not only to discuss the gains and losses of workplace observation programs, but also to touch on hot real topics such as "How HR screens resumes", "Whether professional students are competitive in the workplace", "What kind of career view should young people have".

March 14, 2022 A10 version

A few parties – Lianzong "pressing his head" and drinking CP, does it make sense to fall in love with a script?

"A Few Parties" Audio Program

Thirdly, in the daily production, operation and maintenance of "Relativity", the small partners pay more attention to the linkage with other products of the department, strengthening the "scale effect", and the linkage between the content of the audio program and the layout is only a basic operation. For example, after reading the movie review "< Bouquet-like Love >: The Bouquet Will Wither, But It Was Once Beautiful", I feel that it is still not enough. You can also come to listen to the audio program and watch the exquisite layout; "In love with the" head "CP, is it meaningful to fall in love with the script?" It has opened up the entire product chain of text manuscripts, audio programs, mid-form video products, and topic pages, forming a product ecosystem of "one topic, N ways to play".

Conclusion:

In addition to being based on itself and doing a good job in depth, sharpness and breadth, "A Few Party" also connects to "1 + 2 + 3 + N" Yangcheng Evening News three-dimensional mobile communication chain, relies on channels to bind "Most", and performs well on Yangchengpai client side, Himalayan APP, WeChat Channels and major commercial media platforms.

April 11, 2022 A10 version

A few parties – is the workplace variety show useful for beating workers?

"A Few Parties" Audio Program

Where Minority Party was founded, we expected it to "win over people with high demands for entertainment products," who may only be a "minority" of all audiences, but as long as they win over the "majority" of this "minority" group, it is considered a success.

After a long period of practice, we hope that the "minority party" will not only become a source of happiness for the "minority", but also cause the "majority" other than the "minority" to think.

In the future, there will be more new ways to play "minority parties".

The first new energy vehicle in China: BYD Han is equipped with Bosch IPB intelligent integrated braking system.

Byd Han is the first new energy production vehicle equipped with Bosch’s "IPB Intelligent Integrated Braking System" in China, and the "CST Comfort Braking Function" based on the IPB system has achieved the world premiere in Han. IPB system helps Han achieve leading safety, comfort and long battery life.

Safety first, smarter braking system

The full name of IPB is "Intelligent Integrated Brake System". The so-called "intelligence" means that IPB is an electronically controlled braking system. Compared with the traditional vacuum booster pump braking system, it makes the braking system respond more quickly and control more accurately, and with this intelligent electronically controlled braking system, it can be extended to more functions. When IPB is combined with new energy vehicles, the efficiency of braking energy recovery can be significantly enhanced. The so-called "integration" means that the IPB integrates the ESP system. Compared with the non-integrated brake system, the IPB system is lighter in weight and takes up less interior space.

Previously, in the process of Han’s vehicle development, BYD and Bosch made the IPB system highly match Han’s vehicle performance by repeatedly testing and adjusting more than ten BYD Han vehicles for several months, and improved Han’s performance in braking, acceleration, avoidance, comfort and endurance.

Such a high standard of rigorous testing and adjustment stems from BYD’s pursuit of high quality. As a high-end car, Han should not only pursue the most cutting-edge equipment and advanced performance, but also let users enjoy the leading technology with peace of mind.

Fast, sensitive and safer braking system

"There are thousands of roads, safety comes first", and driving safety is a topic that everyone is very concerned about, especially for Han, who is positioning high-grade.

Automobile braking system plays the most critical role in driving safety, especially after the automobile braking system integrates anti-lock function, traction control function, body stability system, electronic slip limit function, automatic braking and other functions, the role played by the braking system is no longer as simple as "stopping the car".

The traditional braking system relies on the brake pedal to drive the vacuum booster pump to generate braking pressure, and the IPB system adopted by Han converts the displacement of the brake pedal into a signal. The controller combines other sensor parameters to calculate the required braking force, and then the motor drives the brake fluid to establish the braking force. Obviously, IPB can generate braking force more quickly and accurately, which greatly improves the safety of Han. Especially when the "AEB automatic emergency braking" function is triggered, the response time of the traditional braking system is about 600 milliseconds, while IPB can provide the maximum braking force within 150 milliseconds, which is faster than the blink of an eye.

Endurance and comfort coexist, and feel the future car life.

Frequent "nodding" when braking is an important factor affecting comfort. In particular, drivers have different experiences and styles. When most drivers brake, the car body "nods" obviously, which makes passengers very uncomfortable.

After the combination of IPB system and Han, this problem was solved by "intelligence". In Han, Bosch launched the "CST comfortable braking" function based on IPB system in the world. It can provide a smoother and more comfortable experience for drivers and passengers on the premise of ensuring braking safety.

In the process of braking, whether the driver is an "old driver" or not, CST function can make the braking system automatically and intelligently adjust the braking power to avoid the phenomenon of "nodding" when braking, and provide a smoother and more comfortable experience for drivers and passengers. Of course, CST function always puts Han’s safety performance in the first place. For example, when the vehicle tends to lose stability in an emergency, or when the AEB automatic emergency braking function is triggered, or when the driver is in emergency braking, the CST comfort braking function will automatically quit.

In addition, due to BYD Han’s status as a new energy vehicle, the combination of Han and IPB not only improves safety, but also brings "long battery life" effect.

When braking, IPB cooperates with Han’s drive system. First, the motor is used for energy recovery, and kinetic energy is converted into electric energy and stored in the power battery. Once the braking effect of the motor cannot meet the requirements of the braking system, IPB will quickly release the brake fluid and start the brake caliper to brake. This process allows Han to recover 10% more energy when braking. For users, the cruising range is improved and the wear of brake pads is reduced.

It is not difficult to see that Han is equipped with Bosch IPB, and the safety, comfort and endurance of the whole vehicle have been significantly improved. A high-quality car condenses the wisdom and hard work of countless autobots who fight day and night. As the first new energy production car equipped with Bosch IPB, Han’s safety, performance and luxury confirm BYD’s pursuit of high quality.

The angel kissed his throat and kicked his face. "Uncle Shoushan" was broadcast live for two years to pay off 300,000 debts

Online celebrity's "Uncle Shoushan" Yu Xinwei

Online celebrity’s "Uncle Shoushan" Yu Xinwei

  The spotlight hit a dark, stubble-covered and wrinkled face with a "Mediterranean" hairstyle on his head. Some people joked that this is a face that has been "kicked" by an angel.

  On the afternoon of November 11th, Yu Xinwei, a 45-year-old farmer from Hebei Province, appeared on the stage for the first time in the A3 studio of Beijing Starlight Film and Television Park. At first, he was too nervous to open his mouth, and the host kept guiding him to complete the 10-minute interview. And when he began to sing, his deep and magnetic voice rippled away. The middle-aged rough man seems to gradually regain his confidence. After singing a song "A Cut of Plums", several rows of lights are brightly lit in front of the stage &mdash; &mdash; "The challenge is successful!"

  From the small mountain village in Longhua County, Chengde to Beijing, from chicken farmers to online celebrity with millions of fans, in the past half month, Yu Xinwei ushered in the highlight moment of his life with a beautiful and beautiful poem recitation video of Farewell to Cambridge. On November 2nd, this video reached 8.638 million hits, ranking first in Tik Tok’s hot list that day, and his Tik Tok account "Uncle Shoushan" became popular. Immediately, the online number of his live broadcast room suddenly increased to 10,000 to 20,000, and more than 20 media followed. CCTV variety shows such as "Golden 100 Seconds", "Avenue of Stars" and "Open the Door" have sent invitations one after another.

  In fact, Yu Xinwei has been active in the short video platform for nearly two years. "I used to sing, but I didn’t expect to recite it for the first time, but it was a fire &hellip; &hellip;” He still hasn’t understood the logic of the red explosion, and he has confessed the bonus he got as a result.

  There are many conditions for raising cattle and farming

  Owe more than 300 thousand foreign debts

  Life always inadvertently brings unexpected joy. The gift Yu Xinwei received came from an ordinary evening when he was busy with farm work.

  It was October 26th. Seeing that the sun had set, Yu Xinwei wanted to find a song quickly. As usual, he recorded a singing video and posted it on the Internet, only to find that all the songs he was good at had been sung once. "There were no new songs, so I temporarily recited a section of Farewell to Cambridge."

  He has a talent for imitation, and usually likes to ponder over the dubbing of TV programs such as Animal World, Archives of National Treasures and China on the Tip of the Tongue. Facing the camera of the mobile phone, when he opens his mouth, it is a rich broadcasting cavity.

  This video was not broadcast much that day, and Yu Xinwei was somewhat disappointed. Four or five days later, the live broadcast room suddenly flooded into tens of thousands of people, and the phone kept ringing. "I just know that it is on fire."

  Netizens were surprised by his magnetic voice and the sharp contrast with his rough face. In the first few days of the popular network, I received five or six media a day, and Yu Xinwei was in a trance. "I feel that this accident is too unreal, just like dreaming."

  Yu Jia has six brothers and sisters, and Yu Xinwei is the youngest. After graduating from junior high school, he went to Jinan as a soldier. After leaving the army, I ran a restaurant, sold snacks and opened a barber shop. After many twists and turns, I finally saved a sum of money.

  In order to "make Qian Shengqian", in 2013, Yu Xinwei contracted 350 mu of forest in his hometown and planted more than 50,000 Chinese pine and spruce trees. A year later, he built a cowshed of more than 200 square meters and raised more than 20 cows.

  But the mountains and cowshed are in a lot of conditions &mdash; &mdash; The Chinese pine market suddenly fell, and no one wanted to sell it at half price in 2016; When pruning trees, I saw the soles of my feet, cut a gap 5 cm long, had surgery for 5 and a half hours, and stayed in the hospital for 40 days. The wind blew the fire and burned the whole cowshed; There are also two cows that rolled down the hill while eating grass and fell to their death &hellip; &hellip;

  "I’m a little unlucky, but it also has something to do with my personality." Yu Xinwei said with emotion, "Cattle were originally raised for sale, but after a long time, I was reluctant to sell. Three cows all died of old age in my cowshed &hellip; &hellip;”

  Watching the first cow die, Yu Xinwei squatted in the cowshed and cried. He saw the old cow struggling with its head tilted and tears streaming down its face. From then on, he stopped eating beef.

  "No &lsquo; Kill the heart &rsquo; Can’t do business. " After several years of tossing, Yu Xinwei owed more than 300,000 yuan in foreign debt.

  Live broadcast can earn up to 9000 yuan a day

  Insist on paying off debts in two years

  The reality of heavy debts will force Yu Xinwei to work on the construction site. During the break, he paid attention to short videos and live broadcasts. "In a live broadcast room watched by thousands of people, some fans asked how much they could earn a year. I heard the blogger say that there were more than 200,000." This number immediately impressed Yu Xinwei.

  In December 2018, this taciturn middle-aged man got up the courage, registered an account on a short video platform and began to release videos regularly.

  He named himself "Uncle Shoushan" &mdash; &mdash; Surrounding his village of Baoshan Ying, there are four mountains, all of which have their own names: Songshuliang, Maijigou, Sangshugou and Dadingzi.

  So what’s to show? It occurred to him that he loved singing since he was a child. So in the field, he dressed in farming clothes and began to sing. A mobile phone was set up on a tripod, and with the accompaniment of the national K song, applause seemed to ring from the mountains.

  You don’t have to face people, Yu Xinwei in front of the camera is more comfortable. But "after all, it is not professional, and I often sing wrong at first." In order to record a one-minute "Cut the Plum", Yu Xinwei stood in the snow for 50 minutes in a red scarf and sang dozens of times, "shaking with cold".

  After more than three months, the number of fans continued to stay at 46,000. In March 2019, he selected more than 10 songs at home, wrote their titles on the wall, and started the first live broadcast against the wall. In the one-hour live broadcast, there were more than 400 online people. Yu Xinwei was too nervous to talk about interaction. He just sang it in turn according to the song list, but he still earned nearly 1,000 yuan. After half a year, he simply took turns to appear with his wife. After singing, I talked about my parents’ short stories and showed the real life in the mountain village. The live broadcast lasted for eight or nine hours every day. With the increase in traffic, Yu Xinwei also received a considerable reward. "Sometimes two or three hundred yuan, sometimes two or three thousand yuan, the most earned 9000 yuan a day." After nearly two years of live broadcast, Yu Xinwei earned more than 500,000 yuan. By this spring, all his debts had been paid off.

  "It’s light without debt, but I think it’s too easy to earn this kind of money." In his view, this kind of income makes people excited for a short time, but it is difficult to feel at ease for a long time.

  Try e-commerce to bring mountain products.

  Be worthy of fans

  At 6 o’clock in the morning after the CCTV program was recorded, Yu Xinwei took a car and rushed to his hometown. The car was crowded and the driver kept riding. Six and a half hours later, Yu Xinwei returned to his hometown &mdash; &mdash; Baoshan Village, Qijia Town, Longhua County, Chengde.

  Several neighbors embraced Yu Xinwei with smiles on their faces and greeted him warmly. "Are you back from Beijing?"? Did people send you a gold necklace? " &mdash; &mdash; As early as half a month ago, the news that Yu Xinwei was invited by CCTV spread in this village surrounded by mountains, but Yu Xinwei pointed to a box of milk powder he brought back. "I sent this." Until recently, the villagers suddenly realized that the live broadcast was very profitable. He Lixia, his wife, said helplessly, "How can I earn so much when the income is being circulated?"

  Yu Xinwei still lives in the old house built by his parents 38 years ago. A courtyard is surrounded by red bricks. At the back of the courtyard, a row of tile houses covering an area of more than 90 square meters is divided into five bays. Inside the house, the white wall skin is peeling off, and more than 200 songs are conspicuously posted on the wall, including Norwegian Forest, old boys and Laughing at the World of Red Dust &hellip; &hellip;

  After feeding more than 500 chickens and patrolling the forest, Yu Xinwei returned to the room, started the live broadcast and skillfully shouted: "Family &hellip; &hellip;”

  "Most of my fans are middle-aged people in their 40 s and 50 s, and there are 85-year-old people. Some of them, in the past two years, have basically been a live broadcast without landing with me. " When I mentioned this group of fans, Yu Xinwei was filled with emotion.

  He also wants to find a new way to realize cash, and try to interact with the e-commerce anchor Lian Mai to bring goods during the live broadcast. "On one occasion, an e-commerce anchor selling jade articles brushed more than 2,000 yuan and joined us. She wore a leaf-shaped Yu Pei around her neck, asking for 128 yuan, and sold more than 90 orders that day. " He Lixia recalled that when the samples were sent home later, her husband was so angry that he couldn’t eat. "(Yu Pei) was completely different from the video. Rough workmanship, and the shape is two or three times larger, five centimeters long, too ugly! "

  Although more than 90 singles have only returned two pens, Yu Xinwei understands that he has hurt the hearts of some fans. Since then, he often muttered: "To be worthy of fans, cheat people can’t make money."

Encouraged by her father, Li Yong’s daughter published the novel Miss Liu.

  Beijing Youth Daily News (Reporter cui wei) Fatimah Li, a 16-year-old Hui girl born in 2002, recently published her first novel, Miss Liu, through Changjiang Literature and Art Publishing House. The novel was written in Chinese and then translated into English by Fatimah.

  Fatimah Lee is the daughter of Li Yong, a former CCTV host, and Ha Wen, a director and producer. The creative opportunity of "Miss Liu" is to listen to the love story of her mother, Grandma Fatimah, accidentally told by her mother Ha Wen. In the 1940s, Miss Liu was pursued by a Kuomintang officer, but eventually she married a Communist party member, that is, Fatimah’s grandfather, and then her family moved from the northeast to Ningxia Hui Autonomous Region. It is a pity that Havin can’t know more details because his mother has passed away, but this simple sentence has aroused Fatimah’s infinite imagination. Fatimah, who went abroad to study as a teenager, said that she was completely unfamiliar with the history of China in the 20th century and had not experienced love and marriage personally. However, the 16-year-old post-00 generation felt very cordial when she wrote the story of her grandmother’s 16 years old. Of course, many details were invented in the book.

  The novel uses two clues to describe the love story of Miss Liu and my illness, both of whom are fifteen or sixteen years old. Miss Liu and Mr. two of a kind, who wears military uniforms, send letters to express their feelings, and my illness is tied to the words of a matchmaker in Montenegro, and they will stay together for the rest of their lives. When asked by my daughter why her surname was not Liu, I replied, "I don’t want to be the majority." Fatimah said that although he didn’t know China’s representative youth literature works, he also looked through them in bookstores. He didn’t like reading and writing campus literature, and he didn’t like flowery rhetoric and inexplicable sadness. In the process of translating the story of Miss Liu into English, when she feels bored, she will look at the English translation of Haruki Murakami’s works.

  This is Fatimah’s first novel, which was written with the encouragement of his father Li Yong. In July this year, she handed over the final version to Changjiang Literature and Art Publishing House, which published Yong Yuan Yi in Li Yong. Before the editor of the publishing house sent this book to press, he also discussed with Fatimah to ask the three of them to do a live video broadcast of the new book launch remotely. Unfortunately, Fatimah’s father Li Yong will be absent forever.

  conversation

  Fatimah Lee: My father has no regrets when he saw my book published.

  Inspired by stories told by my mother.

  Beiqing Daily: The source of the story is the story of the elders told by my mother. How much is true?

  Fatimah: The inspiration for writing this book was my accidental discussion with my mother. My name is quite special, and when I talked about my grandmother’s name, I was very curious. When I asked how my grandmother’s name came from, my mother told me this story and suddenly wanted to write it down. The point is that the inspiration comes from the story my mother told me, but it is still a fictional novel in essence, because many plots need me to make up and think for myself.

  Beiqing Daily: As a teenager who went abroad to study very early, what did you use to supplement so many grounded scenes in the story? I heard that you have consulted a lot of materials. Can you tell me about two or three things that impressed you in the creative process?

  Fatimah: I didn’t go abroad until I was 13 years old. I grew up in Beijing, so I haven’t derailed from these things, but I know a little bit about them. As for the difficulties encountered in writing due to the age, the focus is still on, for example, the varieties and names of some cigarettes, what kind of furniture made of wood was popular at that time, and there is no channel to know now, so I just look up some historical materials on the Internet, which were imported in large quantities at that time.

  "Dad will modify my opinion in some details."

  Beiqing Daily: Did you show the manuscript to your father and mother? How do they feel?

  Fatimah: It doesn’t mean that they will take the initiative to read and review it. I will write a paragraph and if I think I like it very much, I will take the initiative to share it with them, and they will give some constructive suggestions. In particular, my father pays great attention to details and will give me some suggestions for revision in some details.

  "If you want to write, you have to write."

  Beiqing Daily: How to control a historical love story at the age of 15?

  Fatimah: I wrote it at that time, including now, which is similar to Miss Liu’s age at the beginning of the book. Except that the times are different, the feelings of mind and mood should be similar to some extent, so it is not very difficult to write it like this.

  Beiqing Daily: What specific words from your parents prompted you to write this book?

  Fatimah: My parents said, "You don’t always tell us your ideas, you have to write them if you want", so I thought it was time to write something.

  Beiqing Daily: A novel published at the age of 16 may be evaluated as immature in writing and connotation. What do you think?

  Fatimah: I accept everyone’s comments. After all, I’m really 16 years old, and I don’t have the mature and refined style of writing. I can change, after all, I’m only 16 years old.

  "Dad saw my book published."

  Beiqing Daily: What kind of girl are you in life? Are you more like your father or your mother?

  Fatimah: As for my personality, I may be a little more casual, sometimes more straightforward, which is quite similar to my parents. After going abroad, my independence has become stronger, but overall it is almost the same as before.

  Beiqing Daily: Did father see this book published?

  Fatimah: My father didn’t regret seeing my book published.

  Beiqing Daily: What books do you like to read? Or who do you think is more influenced by your style of writing?

  Fatimah: I just finished reading Haruki Murakami’s Norwegian Forest, which is not limited to a certain writer or a certain style of writing. Personally, I prefer a more casual and free style of writing, which does not require flowery words. It is a spiritual communication between the author and the reader, either flowery words or good ones.

  Beiqing Daily: If you encounter problems, are you a girl willing to communicate with your parents? Is there anything that your father taught you that benefited you the most?

  Fatimah: My relationship with my parents is like friends. My family is more equal. I will tell them any questions. There is nothing I can’t say. They are very experienced, so I can learn a lot from them. What my father taught me is basically to do what comes to mind, and actions speak louder than words. Always act when it’s time to act, don’t always talk about it.

  Text/Beijing Youth Daily reporter cui wei

The sprint bike in the "hardest hit area", the top ten stimulant in sports, is the most typical.

  Tencent Sports News Recently, Wang Hongni, a famous triathlete in China, was found to have used illegal drugs and was banned for two years. The triathlete, which is considered as a "pile of medicine cans", was once again pushed to the forefront of public opinion. Looking at all kinds of sports in sports, ten sports are the "hardest hit areas" for doping. Although the anti-doping organizations keep conducting targeted inspections, they are still banned repeatedly!


  short-distance run


  Doping is the best way to improve the athletes’ instantaneous physiological function, so in the sprint events that need explosive power most, doping incidents are repeatedly banned, and many of those big stars who are suddenly in the clouds are later laid on the altar. The most typical example is that at the Seoul Olympic Games in 1988, Ben Johnson won the men’s 100m gold medal in 9.79 seconds and broke the world record. However, in the subsequent urine test, Ben Johnson was found to have taken synthetic steroids. In addition, gatling and Montgomery, two men who had challenged the world record, were also banned for two years. Jones, a famous American sprinter after Cojna, was also banned for taking steroids and returned to the Olympic gold medal. Ironically, Cojna, the greatest athlete in the history of women’s sprint, was also suspected of using stimulants and leading to her early death, so she still could not bury her body after her death, but had to undergo an autopsy to get her innocence back!


  Tour de France:


  Whether the Tour de France will survive or not is a hot topic in the sports field some time ago, because this dirty sport is challenging the purity of sports. International Olympic Committee President Rogge said that bicycles will not be excluded from the Olympic Games for the time being, which is already lenient. Armstrong, an American legendary hero known as "Forrest Gump" in reality and winner of the seven-time Tour de France, has created countless glories in his sports career, and his story of overcoming cancer and reaching the peak has inspired countless people today. But less than a year after his retirement, it broke the news that he had taken stimulants many times in the competition. For a time, the controversy about whether Armstrong was a lonely hero or a drug champion spread all over the world. Landis and ulrich were even worse than Armstrong. They were banned and deprived of the greatest honor they had ever won. In particular, Landis, an American, keeps going to court to prove his innocence, but it is useless for him to keep his mouth shut in the face of scientific evidence.


  strong and handsome


  Although this event is not an Olympic event, it has become a frequent doping event because of its good promotion in various countries, great visual impact and more commercial intervention. Bodybuilders need to stimulate their muscles, so some athletes should often take some so-called tonics to make their muscles develop. According to the statistics of the Anti-Doping Committee of the Chinese Olympic Committee for many years, the number of times bodybuilders tested positive for drugs is among the top three every year. Just this year, the decision on punishing bodybuilder Jiang Xi for violating the prohibition of doping was issued, and Jiang Xi was suspended from participating in national bodybuilding activities for two years from July 21, 2006 to July 20, 2008.


  There are many incidents of taking medicine in swimming, and many famous big-name stars are not immune from negative rumors. The most typical example is the Australian flying fish "Thorpe storm", which was first stirred up by the French newspaper L ‘Equipe. The newspaper L ‘Equipe reported that a doping test in May last year showed that Thorpe’s testosterone and luteinizing hormone obviously exceeded the standard, and these hormones acted like steroids, which could obviously improve athletes’ performance. Thorpe denied this, and was obviously greatly stimulated, so that at the press conference, what people saw was not the torpedoes in the past, but more like a sad and helpless child. It was not until this year that the Australian Olympic Committee cleared Thorpe. China women’s swimming team was also troubled by doping. In 1994, the glory of the World Swimming Championships was attacked by some foreign media for taking banned drugs. In 2000, Wu Yanyan, a famous Chinese athlete, tested positive for drugs and was banned for four years, missing the Olympic Games.


  weightlifting


  There are countless doping incidents in weightlifting, and a large number of lesser-known athletes are banned every year. Of course, well-known athletes often try their own laws. Mutlu of Turkey was once called a "weightlifting prodigy". At the Atlanta Olympic Games in 1996, Mutlu, 23, set a new world snatch record and easily won his first Olympic gold medal with an advantage of 7.5 kilograms ahead of the second place. At the Sydney Olympic Games in 2000, Mutlu, a "pocket strongman", was in full swing, not only easily defending his title, but also breaking three world records in snatch, clean and jerk and total score. At the 2004 Athens Olympic Games, Mutlu, 31, became a weightlifter who won three consecutive Olympic titles. However, in the 2005 European Championship, Mutlu was found to have used Nuolong and was banned, which also cast a shadow over the veteran’s declining state to participate in the Beijing Olympic Games.


  wrestling


  Wrestling emphasizes the use of strength and physical contact, so doping incidents are also common in this project. Domestically, Gao Yanzhi, a wrestler from Shandong Province, was suspended for two years for taking a diuretic, a prohibited drug, after testing in Athens Olympic Games. The foreign example is even more shocking. American male wrestler Benoit killed his wife and son because he took too many steroids! This steroid can strengthen muscles after taking it, but it can also cause emotional outbursts such as paranoia, depression and steroid rage. Therefore, the police said that they thought that Benoit was taking stimulants, which led to the whole person’s emotional loss of control and eventually violence.


  triathlon


  From the name "triathlon", it is not difficult to see the fierce competition. Only "iron man" can laugh at the end, and doping is undoubtedly the best tool to turn "man" into "iron man". On July 1st, 2005, the Swiss Olympic Committee announced that McMahon, a Swiss female triathlete and winner of the 2000 Sydney Olympic Games, had been found to have used the illegal drug EPO. McMahon admitted that she had taken stimulants, but she argued that it was because she needed stimulants to treat her illness, not to improve her athletic performance. Wang Hongni, the champion of the Asian Games in China, was declared unqualified by the triathlon official website on October 9th, which made the list of doping in this event filled with the names of China people.


  shot


  As a strength-oriented throwing event, many athletes in the shot put competition use illegal drugs at risk. During the Athens Olympic Games, Yong Quest, chairman of the International Olympic Committee Medical Committee, revealed in Athens that Russian player Korzalenko, who won the women’s shot put championship in this Olympic Games, failed the doping test! Korzalenko was deprived of his gold medal in the indoor track and field championships in 1999 because of doping. This is the second time he has committed a crime against the wind. Hunter, the husband of American female sprinter Jones, was found to have taken banned drugs such as steroids after the 1999 World Championships, and then he was banned from the IAAF for two years, so he missed the Sydney Olympic Games in 2000.


  Rugby


  Known as the most antagonistic sports football doping scandal in the world, Ha Silei, a retired American professional football player, revealed that according to his estimation, at least half of the players in the league were taking steroids before drug testing began in the late 1980s. He said, "If you don’t eat, you can’t be as strong as others and can’t keep up with their speed. This is the only reason why we take medicine, because the competition is too fierce. I was still taking steroids six weeks before I decided to end my career. " Keith Jones, an NBA Rockets trainer, said in a recent interview that during his years as a trainer, he saw too many football players taking steroid stimulants.


  Tennis:


  It is reasonable to say that the effect of doping in tennis, which emphasizes the change of skills and lines, will not be too great. However, with the prevalence of strength-playing, there are also many drug users in tennis. Poorta and canas have unfortunately become "leaders" in their respective fields. In addition, this list also includes Bulgarian beautiful girl Karatancheva. Nowadays, the names of Poorta and Karatancheva are rarely mentioned again, but canas has made a high-profile comeback after the suspension period, becoming one of the few players who have defeated Swiss ball king Federer in a row in recent years. (tears in the sky)

Editor: Wang Xiaoya

What is culture? On the word culture

Image source network

The word "culture": its appearance in China can be traced back to the Western Han Dynasty. "Culture" is not only a system of civilizing and educating, but also a system of rites and music. This understanding has been maintained in our country until modern times. The meaning of the word "culture" that we use today is obviously different from that of ancient times. It was introduced from the west through Japanese translation at the end of the 19th century. At that time, there was no definition of the word, and people only used the word "culture" according to their own understanding and needs. According to analysis, there were about three meanings at that time; First, it is synonymous with "civilization"; Second, in a broad sense, it includes spiritual and "civilization" contents; Three, narrow sense, refers to the spiritual content. To this day. The meaning of culture is broader; There are also many people who agree that culture refers to "ideology", and everything outside politics and economy is among them; Others make a broader understanding that everything created by human beings (that is, the integration of material civilization and spiritual civilization) is culture; Besides, some people have other explanations.

In view of the fact that scholars at home and abroad have different opinions on the concept of "culture", it has been suggested that the word "culture" may be a vague concept naturally, and it is difficult to make a clear and complete definition. Instead of pursuing a simple and precise definition, people should determine a flexible range from the perspective of set.

Although there are many definitions of culture, I personally think that it should be the same in many aspects, and we can roughly summarize it into the following three aspects;

First, ideology (also known as ideology) means people’s world outlook, way of thinking, religious beliefs, psychological characteristics, values, moral standards, cognitive ability and so on.

Second, the way of life, that is, people’s attitude towards their food, clothing, housing and transportation, marriage, birth, illness, family life and social production activities, and some forms taken in these aspects.

Third, spiritual materialized products, that is, from the formal point of view, are some material things, but through the material form, they can reflect people’s differences and changes in ideas.

From the above three parts, the scope of culture is basically outlined. But we should pay attention to: the word culture; It should be an organic whole, which is not only the simple addition of the contents of these three parts, but also the mutual influence and premise of the contents of these three parts, and should be organically combined according to a specific sequence.

Love Liverpool! No chance of Bellingham, three reasons for exposure: 115 million, Real Madrid shot.

Liverpool must be alert. There are three factors that will make it more and more difficult to introduce Bellingham. First, both Real Madrid and Manchester City are very interested in Bellingham, and the players seem to be a little moved. Second, the player’s termination fee is very high, and he himself wants a higher salary; Third, the player wants to go to a team with superior strength in the Champions League.

Klopp has made it clear that Liverpool intend to reinforce the midfield this summer. Bellingham is their number one target, but they face competition from Real Madrid and Manchester City. The England international’s contract expires in 2025, and the new club may have to pay more than 100 million pounds to poach him from Dortmund. Liverpool have recently been regarded as the most promising signing for Bellingham, and the Premier League club is "increasingly confident".

However, the German media "Kicker" reported that Bellingham’s father had met with senior officials of Real Madrid many times. If Real Madrid is serious and Liverpool are not ready to make a good offer as soon as possible, it will become more and more difficult for Bellingham to move to Anfield.

It is reported that the meeting between Bellingham’s father and the next team took place not only in England, but also in the Spanish capital the week before. But the important thing is that Bellingham himself has not made a decision, and he has not negotiated with Dortmund. Liverpool are still competing for this talented player, but Real Madrid is becoming more and more popular with players. klopp’s team must submit a sincere offer as soon as possible.

Klopp has admitted: Once it comes to money, I don’t want to talk about it. Having said that, Bellingham’s motivation for transfer is not just money. Dortmund hopes that he will stay with the team after the end of this season, and they hope that he can sign a new contract. However, The Kicker added that Dortmund’s elimination from the Champions League by Chelsea would bring unpleasant consequences. Dortmund’s situation is a bit difficult. Dortmund can’t be compared with Real Madrid and Liverpool in terms of football or salary.

If you lose to Chelsea in the second round, Dortmund will miss the quarter-finals and lose a prize of 10.6 million euros. Dortmund could have used this money to keep Bellingham. Dortmund boss Watzck is considering offering Bellingham an annual salary of 15 million euros. Now it seems that it is difficult for Bellingham to stay in the Bundesliga!

So for this news, fans, do you have anything to say? If you like this article, welcome to pay attention to Beta and chat with the stars and the ball game.

I put the essence of Python coroutine Pa was clean!

This article is a large amount of information, from IO multiplexing, to use the generator, then async, await realization of the principle behind it, in simple terms, the analysis was very thorough, very hardcore!

Two days for personal reasons because it did not touch a long time to write a point of Python, which involves "coroutine" program, the last time out, it is Web framework tornado unique feature, now we have async, await keyword support . Thought about its implementation, reviews the evolution of these years, feel a little bit mean.

They are single-threaded, why the original code with the low efficiency of the async, await add some asynchronous library becomes higher efficiency?

They are single-threaded, why the original code with the low efficiency of the async, await add some asynchronous library becomes higher efficiency?

If you do Python-based network or Web development, this question has puzzled, this article attempts to give an answer.

Before beginning 0x00

Firstly, Not take you browse the source codeAnd then tell you the control to achieve the original code Python standard. Instead, we will set out from the real problems, think of solutions to the problem, step by step evolution path experience solutions, and most importantly, hoping to gain knowledge in a systematic upgrade process.

This article only provides an independent direction of thinking, does not follow the historical and current actual implementation details.

Secondly, you need to read this article familiar with Python, at least understand the concept generator generator of Python.

0x01 IO multiplexing

This is the key to performance. But we are here only to explain the concept, its implementation details is not the point, which we understand Python coroutine enough, as already know enough about, advances to 0x02.

First, you want to know all the network service program is a huge loop, your business logic can be called at some point in this cycle:

defhandler (request):

WHILETRUE:

# Get a new request

request=accept

# To get users to write business logic function according to the route map

Handler=GET_HANDLER (Request)

Handler (Request)

Imagine your Web service of a handler, after receiving a request requires a response to the results of API calls.

For the most traditional network applications, your API requests issued to wait for a response after this time the program stops running, even new requests have to get in after the end of the response. If you rely on an API request packet loss seriously, especially in response to slow it? That will be very low throughput applications.

Many traditional Web server using multi-threading technology to solve this problem: the run handler is placed on other threads, each dealing with a request, this does not affect the new thread blocks request to enter. This problem can be solved to some extent, but for larger systems concurrent, multithreaded scheduling will bring significant performance overhead.

IO multiplexing can be done to solve the problem without the use of threads, it is provided by the operating system kernel functions, we can say specifically for this type of scenario for us. Simply put, your program encounters network IO, tells the operating system to help you staring at, while the operating system gives you a way to make you can feel free to get what IO operation has been completed. like this:

# # 操作 系统 复 复 示 示 例 代代

# Register the ID and type of IO operations to the operating system IO

IO_REGISTER (IO_ID, IO_TYPE)

# Get completed IO operations

Events=IO_GET_FINISHED

For (IO_ID, IO_TYPE) INEvents:

IFIO_TYPE==Read:

Data=read_data (IO_ID)

Elifio_Type==Write:

Write_data (IO_ID, DATA)

Gring the IO multiplex logic into our server, probably like this:

Call_backs={}

Defhandler (REQ):

# do jobs here

DefCall_back (Result):

# Use the returned Result to complete the remaining work …

Call_backs [IO_ID]=CALL_BACK

# New cycle

WHILETRUE:

# Get the completed IO event

IFIO_TYPE==Read: # read

Data=read (IO_ID)

Call_back=call_backs [io_id]

Call_back (data)

Else:

# Other types of IO event processing

PASS

# Get a new request

Handler (Request)

Our Handler has returned immediately for the IO operation. At the same time, each iteration will perform a callback over the completed IO, the network request no longer blocks the entire server.

The pseudo code above is only for understanding, and the details are more complicated. Moreover, it is also possible to connect the new request to the IO event from the operating system to the monitor port.

If we split the cycle part with a call_backs dictionary to a separate module, we can get an EventLoop, which is the iOLOOP provided in the Python Standard Library Asynci.

0x02 with generator to eliminate Callback

He focuses on the Handler function written in our business, after having independent iOLOOP, it now becomes like this:

# 业 业 代 代 … …

# Need an API request

Print (Result)

ask_LOOP.GET_EVENT_LOOP.IO_CALL (API, CALL_BACK)

Here, performance problems have been resolved: We no longer need multi-threads to constantly accept new requests in the source, and don’t have to rely on the API response.

But we have also introduced a new problem. The original business logic code is now demolished. The code before requesting the API is still normal. The code after the request API can only be written in the callback function.

Here our business logic has only one API call. If there are multiple APIs, plus the call to Redis or MySQL (their essential is also a network request), the entire logic will be split, this is a burden on business development .

For some languages ??with anonymous functions (right is Java), it may also trigger a so-called "turning hell".

Next, we find way to solve this problem.

We can easily think that if the function can be suspended after running to the network IO operation, it will wake up at the breakpoint after completion.

If you are familiar with Python’s "Builder", you should find that it happens to have this feature:

Defexample:

Value=yield2

Print ("Get", Value)

ReturnValue

g=esample

# 启 启 生器, we will get 2

Got=G.send (NONE)

Print (got) # 2

TRY:

# Anti-start will display "get 4", which is our incoming value

Got=g.send (got * 2)

ExceptStopItemization ASE:

# Builder runs, will print (4), E.Value is the value of generator return

Print (E.Value)

There is Yield keyword in the function, and the call function will get a generator, and a key method for generator can interact with the generator.

G.send (none) runs the generator code until you encounter Yield, and return to the object, that is, 2, the generator code is stopped here until we perform G.send (got * 2) again, The 2 * 2 is also 4 to assign the value Value in front of Yield, and then continue to run the generator code.

Yield is like a door, you can send a thing from here, you can also take another thing.

If Send makes the generator to run until the next yield is over, the Send call will trigger a special exception STOPITERATION, which comes with a property Value, which is the value of the generator Return.

If we convert our Handler to a generator with Yield keyword, run it to The specific content of IO operationReturns, put the IO result back and restore the generator to run, then solve the problem of uncomfortable business code:

# 业 业 代 代 … …

# Need to execute an API request, directly put the IO request information yield

Result=yieldio_info

# Use the result returned by the API to complete the remaining work

Print (Result)

# This function is registered in iOLOOP, used to call back when there is a new request

Defon_Request (request):

Handler=GET_HANDLER (Request)

g=Handler (Request)

# 首 首 启 获得 获得 i 获得

IO_INFO=G.send (none)

g.send (Result)

ask_LOOP.GET_EVENT_LOOP.IO_CALL (IO_INFO, CALL_BACK)

The above example, the Handler code written by the user will not be dispersed into the callback, and the ON_Request function interacts with Callback and IOLOOP, but it will be implemented in the web framework, which is not visible to the user.

The above code is enough to give us inspiration of Callback destroyed with the builder, but there are two points:

  1. Only a network IO is initiated in business logic, but it is often more

  2. Business logic does not call other asynchronous functions (helping), but in practice, we tend to call other levels.

Let’s take a more complex example:

Among them, Request executes real IO, FUNC1, FUNC2 is only called. Obviously our code can only be written:

Deffunc1:

Ret=yieldfunc2 (re)

returnret

Deffunc2 (DATA):

ReturnResult

DEFREQUEST (URL):

# This simulation returns an IO operation, contains all information about the IO operation, where the string is simplified

Result=yield "IOJOB OF% S"% URL

ReturnResult

For Request, we expose the IO operation to the framework through Yield.

for Func1 and func2, calling request, clearly add Yield keywords Otherwise, the request call returns a generator and will not be paused and continue to perform subsequent logic obviously errors.

This is basically that we don’t write asynchronous code in the Tornado framework without Yield from, Aysnc, AWAIT.

To run the entire calling stack, the approximate process is as follows:

  1. Call FUNC1 to get the generator

  2. Call Send (None) Start it gets the result of request ("http://test.com/foo"), or generator object

  3. Send (none) Starts the generator generated by the request, gets the IO operation, registered by the frame to IOLOOP and specify a callback

  4. The Request Builder wakes up in the callback function after IO, and the generator will go to the return statement end

  5. Capture an exception to get the return value of the Request Builder, wake up the last layer of FUNC1, and get a FUNC2 generator

  6. Continue to execute …

Call FUNC1 to get the generator

Call Send (None) Start it gets the result of request ("http://test.com/foo"), or generator object

Send (none) Starts the generator generated by the request, gets the IO operation, registered by the frame to IOLOOP and specify a callback

The Request Builder wakes up in the callback function after IO, and the generator will go to the return statement end

Capture an exception to get the return value of the Request Builder, wake up the last layer of FUNC1, and get a FUNC2 generator

Continue to execute …

Friends who are familiar with the algorithm and data structure encounter such a traversal logic that will be returned, can be recursively used, because the recursive use generator can not do it, we can use the stack, in fact, this is the word "call stack" origin.

With the stack, we can Connect all generators connected in series in the entire call chain to a generatorFor its constant Send, you can continue to get all IO operation information and drive the call chain advancement, and the implementation method is as follows:

  1. The first generator is in the stack

  2. Call the Send, if you get the generator, you will enter the next round iteration

  3. I encountered IO to ask Yield, let the frame sign up to iOLOOP

  4. After the IO operation is completed, the cache result is forth, enter the next round iteration, the purpose is to restore the upper function using IO results.

  5. If a generator is running, you also need to restore the upper function to the upper function.

The first generator is in the stack

Call the Send, if you get the generator, you will enter the next round iteration

I encountered IO to ask Yield, let the frame sign up to iOLOOP

After the IO operation is completed, the cache result is forth, enter the next round iteration, the purpose is to restore the upper function using IO results.

If a generator is running, you also need to restore the upper function to the upper function.

If implemented, the code is not long but the amount of information is relatively large.

It turns the entire call chain to a generator, calling the send, to complete the IO in the chain, complete these IO, continue to push the logic execution in the calling chain until the overall logic ends:

DEFWrapper (GEN):

# The first layer calls the stack

Stack=stack

Stack.push (gen)

# Start a layer-by-layer call

WHILETRUE:

# Get the top elements of the stack

item=stack.peak

Result=none

IFisgenerator (item):

TRY:

# Try to get the next layer call and get it in the stack

Child=item.send (Result)

Stack.push (child)

# Result Restore to NONE

Result=none

# After entering the stack, enter the next loop directly, continue to explore down

Continue

# If you have an end, you will temporarily save the Result, the next step to make yourself out.

Result=E.Value

Else: # o o operation

# # I 操作 操作, Yield, Io will be woken up and temporarily saved after IO

Result=yieldItem

# 走 到 here, this layer has been completed, out of the stack, the next iteration will be a layer of calling chain

Stack.pop

# 没有有 上, the entire call chain is completed, return

Ifstack.empty:

Print ("finished")

ReturnResult

This may be the most complicated part. If you look hard, it is actually as long as you understand that for the call chain in the example above, it can achieve the effect as follows:

W=Wrapper (Func1)

# Will get "IOJOB of http://test.com/foo"

W.send (none)

# 上 上 ojob foo completed the result "bar" incompart, continue to run, get "IOJOB OF http://test.com/bar"

W.send ("bar")

# 上 上 i i b 完成 完成 传 传 传 传 入 入 入 入 入 入 入 入 入 入 入 入 入

W.send ("BARZ")

With this part, the frame will be added to the matching code:

# Maintain a list of ready lists, store all completed IO events, format is (Wrapper, Result)

Ready=

# After using the wrapper package, you can process IO by Send.

g=wrapper (func1)

# Take the start state directly as the result of NONE

Ready.Append ((g, none))

# Let the iOLOOP perform this function each cycle to handle the ready for IO

Ready.Append ((g, result))

# Traversing all already generators, advance it down

Forg, Result InselF.Ready:

# Use the Result to wake the builder and get the next IO operation

IO_JOB=G.send (Result)

# After the IO operation is complete, add the generator to the ready list, wait for the next round of processing.

ask_LOOP.GET_EVENT_LOOP.IO_CALL (

IO_JOB, LambdareSult: Ready.Append ((g, result)

Here, the core idea is to maintain a list of ready-to-read, and IOLOOP is overwhelmed, and the generator that promotes the ready state is run down, and the new IO operation is registered. After the IO is completed, the ready, after several rounds of Ioloop iteration A Handler will eventually be executed.

At this point, we use the generator to write to write business logic to run normally.

0x04 Improved Scalability

If you can read it here, Python’s scope is basically clear.

We have already achieved one Miniature sweeping frameworkThe realization details of the standard library look great here, but the specific ideas are consistent.

Our equilation framework has a restriction, we can only use IO to operate asynchronously, although in the world of network programming and web programming, the block is basically only IO operation, but there are some exceptions, such as I want the current operation Sleep for a few seconds. The use of time.sleep will make the entire thread to block, requiring special implementation. For example, some CPU-intensive operations can be asynchronously through multi-threaded asynchronous, so that another thread notification event has been completed and followed.

Therefore, it is best to decouple an open space with the network, so that the network IO is only one of the scenes, improves the scalability.

The Python official solution is to let the user hand to block the block code. As for the IOLOOP to register IO event or open a thread completely by yourself, and provide a standard "placeholder" FUTURE, indicating that his results wait for the future Yes, some prototypes are as follows:

ClassFuture:

# Set the result

Defset_Result (Result): Pass

# 获取 结果 结果

Defresult: Pass

# 表示 表示 This Future object is not already set up.

Defdone: Pass

# Set the callback function that should be executed when he is set, you can set multiple

Defadd_done_callback (Callback): Pass

Our slight change can support Future, making the scalability stronger. Network request functions for user code:

# 现在 r es es,, 生 生 器 器 器 器 器 器 器 器

#future is understood as a placeholder

Fut=future

Defcallback (Result):

# Assign the placeholder when the network IO completed the callback

Fut.set_Result (Result)

ask_LOOP.GET_EVENT_LOOP.IO_CALL (URL, CALLBACK)

Now, Request is no longer a generator, but directly returns Future.

And for the function of processing the ready list in the frame:

DEFCALLBACK (FUT):

#future is set to be placed in the ready list

Ready.Append ((g, fut.result))

Fut=g.send (Result)

Fut.add_done_callback (callback)

0x05 development and change

Many years ago, when using Tornado, probably only one Yield keyword is available, the sweeper wants to achieve, that is, this idea, even Yield keywords and return keywords can not appear in a function, you want to run after the generator Returns a value, you need to manually Raise an exception, although the effect is the same as Return now, but it is still very awkward, not elegant.

Later, there was Yield from expression. What can it do?

It is popular, it is done what the generator Wrapper is doing the above: Calling link through the stack, it is the syntax of the Wrapper logic.

With it, the same example you can write:

Deffunc1:

# Note Yield from

Ret=yieldFromRequest ("http://test.com/foo")

# Note Yield from

Ret=yieldfromfunc2 (re)

returnret

Deffunc2 (DATA):

# Note Yield from

Result=yieldfromRequest ("http://test.com/"+data)

ReturnResult

# 同 上 上 实 实 实 实 实 r

Then you no longer need the brainless Wrapper function:

g=func1

# Return the first request for Future

g.send (none)

# Continue to run, automatically enter FUNC2 and get the FUTURE inside it

G.send ("bar")

# Continue to run, complete the residual logic of the call chain, throw the stopiteration exception

G.send ("BARZ")

Yield from the entire call chain directly, it is already great, but it is used asynchronous programming or otherwise, and other languages ??have special-top Async, the AWAIT keyword, until the later version puts these content With dedicated Async, AWAIT keyword packaging, it is a more elegant look today.

0x06 summary and comparison

Overall, Python’s native and trip is achieved from two aspects:

  1. Based on IO multiplexing technology, the entire application is non-blocking on IO, achieving high efficiency

  2. Change the dispersed Callback code through the generator into synchronous code, reducing business writing difficulties

Based on IO multiplexing technology, the entire application is non-blocking on IO, achieving high efficiency

Change the dispersed Callback code through the generator into synchronous code, reducing business writing difficulties

There is a language of the object of the generator. Its IO fight is achieved, the evolution of the Java fight is basically exactly, the keyword is the same, and the Future class is the same than the promise.

However, it is different for this, which is different from this sweeping with the degree of GO-named GO, and does not explicitly based on the generator.

If the class ratio, you can implement the geventime of Python, which is the runtime, and Patch off the system calls to access your own Runtime, you come to the scheduling sweeper, gevent is focused on the network, based on network IO scheduling, relatively simple, The GO achieves perfect multi-core support, more complex and perfect, and creates a new CHANNEL new programming paradigm.

Author: Mao bean peanut

Getting Started: The Most Complete Zero-Basic Python Problem | Zero-Based 8 Months Python | Battle Project | Learning Python is this shortcut

Dry goods: crawling Douban short comment, movie "later we" | 38 years old NBA best player analysis | From Wanzhong to Word! Tang Dynasty 3 disappointment | Laughing to see the new Eti Dragon Slay Dollar | Running Question King | Make a massive Miss in Python Sketch | Disc, I am so fire, I use machine to learn to be a mini recommended system movie

Fun: Poultry Game | Nine Mao Hai | Beautiful Flower | Two-Article Python "Everyday Cool" game!

AI: Robot that will be poetry | Give the picture color | predictive income | Solver, I use the machine to learn to be a mini recommended system movie

Gadget: PDF to Word, easy to get forms and watermarks! | One button saves the HTML page as PDF! Goodbye PDF to extract charges! Use 90 lines of code to create the strongest PDF converter, Word, PPT, Excel, Markdown, HTML one-to-date conversion | Make a staple low-cost ticket prompt! | 60 lines of code made a voice wallpaper switch every day to see a little sister! |

Annual explosion case

  • 1). Lying! PDF to Word Use Python to easily get it!
  • 2) Learn Python is really fragrant! I made a website with 100 lines of code, helping people PS travel pictures, earn a chicken leg to eat
  • 3). The first broadcast over 100 million, hot all net, I analyzed the "Sister Taking Wind and Waves" and found these secrets
  • 4) 80 lines of code! Do a Dream in Python with Python
  • 5). You must master the 20 Python code, short and delicate, useless
  • 6). 30 python hambo skills
  • 7). I summarized 80 "rookie Python selection dry goods.pdf", all dry goods
  • 8). Goodbye Python! I want to learn Go! 2500 word depth analysis!
  • 9). Find a dog welfare! This Python reptile artifact is too cool, automatically download the girl picture