Python Programming: TUPLE Data Type

1. What is TUPLE?

Tuple is similar to the list, the difference is that the elements of the tuple cannot be modified, so using tuple can make the code more secure. The tuple uses small brackets, lists the square brackets. TUPLE and LIST can index, slice, while tuple is also an unity list.

2. How to create tuple?

The tuple creation is very simple, only need to add an element in parentheses and use a comma. Let’s create a tuple in several different ways.

TUPLE1=# Create an empty group

Tuple2=(1,) # 不 加加, tuple2 type is integer

TUPLE3=(‘tony’, ‘Tom’, 33, 55) # 元组 can also be different types of data

Tuple4="Hello", "Good", "better", "best" # No need to be brackets

Type (x) uses this built-in method to determine what type of data current X is

3. How do I access the value in Tuple?

TUPLE3 [-1] indicates reverse reading, reading a countdown first element

Tuple3 [0: -2] indicates that reading from the first element to the second element

4. How to modify the value in the TUPLE?

The element value in the tuple is not allowed, but we can get a new TUPLE to achieve the purpose of modifying by intercepting the reputation.

Tuple7 [0]="hi" # This modification is not allowed

Del tuple7 [0] # This deletion is also not allowed.

Del tuple7 # This type of deletion does not exist after taking operation.

5. What are the operators of the TUPLE?

This section is the same as the List of the previous chapter.

6. What are the common built-in functions ofTUPLE?

The TUPLE built-in function is the same as the List, and is only part.

Note: The tuple method can convert a list into a tuple type, see the tuple8 tuple in the figure.

Summary: Today, the definition characteristics of TUPLE this type of data are mainly told and the difference between the difference, creation, value, update deletion, the use of operators, and the simple use of commonly used functions.

Extreme racing skyline 5 login, flashback solution

I saw some small partner feedback said that the ultimate racing skyline 5 logged in, the situation, the storm, immediately entered the game to see if these problems have, tried to play a normal game, so it may not be a game server and The problem of the game itself.

If you have a flashback, if you still have a flashback, if you update the graphics card driver, the update system has tried it, you can try the uninstallation input method.

After the specific process, after the game is flashback, open the start menu and find the input method;

Right click on the method fixer, click uninstall; open the uninstall or change the program window, find the input method right click to uninstall, then open the game after uninstall, open the game smoothly.

If you can’t encounter some games, you can’t connect online, Carton, drop-off and other network problems, you can try to accelerate the extreme racing 5 after entering the game with the storm accelerator.

If you use a tyranny or you can’t play, if you can’t solve it, you can find our customer service, you can find our customer service, you can find our customer service.

System construction, technical research, vitality excitation … Promote intelligent manufacturing high quality development Tianjin ready to do so

On November 26, the Tianjin Municipal Government Information Office held a press conference of the "Regulations on Promoting Intelligent Manufacturing Development in Tianjin". The reporter learned from the meeting that the Regulations will innovate the driver as the first principle, and intelligent manufacturing and innovative capabilities are primarily focused. After the "Ordinance" introduced, the Municipal Science and Technology Bureau will implement the intelligent manufacturing technological innovation system, accelerate key core technical research, and promote cross-disciplined innovation and production research cooperation, technical integration and application and achievement transformation efforts to do three aspects.

In terms of construction of scientific and technological innovation system, the city will intelligently manufacturing as a key direction for the layout of Haihe Lab, Municipal Key Lab, Municipal Technology Innovation Center, Municipal Industrial Technology Research Institute. It has formed a modern Chinese medicine Haihe Lab. One of the research directions has intelligent modern Chinese medicine manufacturing equipment, and the synthetic biology Haihe Lab also has intelligent layout. University Science Park, which is being formed, will also transform the intelligent manufacturing technology to focus as key directions. Through the layout and improvement of innovation system, forming basic research, application technology development, and reforming industrialization. At the same time, the city is promoting the new generation of artificial intelligent innovation and development test areas in the construction, intelligent manufacturing is also one of the important tasks of the test area. By strengthening intelligent manufacturing application scene traction research and development and integrated demonstration, accelerating the promotion of Internet, big data, manual A new generation of information technology represented by intelligence is integrated with manufacturing depth.

In terms of key core technical research, the city has focused on research and development research and development, multidisciplinary research and development technology, and the integration of intelligent manufacturing technology solutions, with the application as a traction, and "unveiling" is the grounding mode. The formation and implementation mechanism of innovative scientific research projects, providing effective science and technology support for the construction of advanced manufacturing R & D bases and manufacturing.

In terms of stimulating the innovation of technological innovation, this city fully plays the status role of the technology innovation of leaders and industry leaders, focusing on intelligent manufacturing key core common technological research and development applications, actively exploring the innovative community model of industrial research cooperation, and realizing industries Chain and innovative chain depth fusion. Cultivate a batch of eagle companies, 瞪 企业 企业业 and leading companies around the key hardware, basic software, data processing, intelligent sensing, IoT, etc. The industry has accelerated intelligence, digitized, networked and green, and fully built a high level of national advanced manufacturing research and development base.

Himalaya creates a creative kit for creators, allowing audio creation more convenient intelligence

On November 30, with the four chapters of "Xuanwu, Qinglong, White Tiger, Suzaku" participated in the guest lineup, will be broadcast on December 3, 19:30, "Himalaya Night · 2021 Magic Tour" party has Enter the countdown phase.

The party participating guest lineup not only whitewash, Da Zhang Wei, Henry Liu Xianhua, Jiang Yingrong, Wu Xuanyi and other star artists, also have artists such as Tang Guoqiang, Wang Liqun, and the translation of the dubbing actor, industry big coffee, Ding Zhen will play in the party " The sound guardian "the beast" Bai Ze ", and as the representative of the Himalayan content creators, funny Duxing Luobin, Mingyue, Muyang tells the story, the ability of the powerful platform, the old Cui, the thinl, a knife, Suzhou, etc. will be In the evening, the "sound agent" is interpreted, and a warm story about love and rebellion.

Party into content creatorsBig show stage

The creator is the source and cornerstone of the Himalayan audio content, which outputs a constant spiritual food for the platform and users. The "Himalayan Night · 2021 Magic Tour" party also became a stage for platform content creators showing self.

"A knife Su Sao" is a good voice book anchor, its outdam foundation and rich performance experience, and has got 437 million fans in Himalaya, and its works exceeded 4.6 billion. She was a drama actor in the Xinjiang Art Theater Drama, who had previously launched a lot of party, but this time I have accepted a stronger with a "sound agent" identity and several other Himalayan creators. Task. "I usually record a book very busy, I can participate in this party very happiness, and I am very interesting, let you find a different yourself." A knife Susu said. Her skills in the evening are "soft governance".

Himalayan Podcast "Rational Time" Anchor "Thin Leg" is a well-known scientific writer. He interprets a "Science Magic" in this evening, and the skill is "walking the encyclopedia". He will use technology’s means to let the blind boy "see" the colorful world, so that its inner world will reproduce bright. "This is really breaking through the self, when an actor is also the first time I participated in the subject of the world." Thin hub said.

"Mingyue Leisure" is an independent musicians, but also the Himalayan rural anchor. He participated in the performance of the white tiger story song and dance show, and its skill is "引 引". He usually hits in Daming Mountain, Guangxi, and plays a fruitful tea to make music in the days of idyllic mountains. He passed the natural sound of the natural musical instruments in Daming Mountain to the Himalaya, cured young people who were fighting in the city. "This evening has circular me a dream, I feel that I am very natural, from the quiet to the stage of the stage, it is a super transformation." Mingyue idlers said.

"Muyang tells the story" is the Himalayas, Himalaya, the aquary book, Ximalaya’s top ten live red people, and the fans exceed 770,000. He used to be a teacher in Nankai, because of the enthusiasm of the edition, it entered a sound industry, and the skills in this evening were "can sing". "This program can join the story of our anchor and the emotions of the audience, but also let everyone see the initiative and meaning of the antennae to create audio content." Muyang said.

"Funny Duxing Luin" is the homerrazza podcast "all the stalks", he is an officer, senior comedy screenwriter, with deep participation in the "Tucao Conference" (first quarter) "Tonight Bailemen" and " Tonight, the screenwriter, the show, ", and found a wood more cultural. "This evening is very different from me, and I look forward to my performance at the party." Robin said. His skills in the evening are "comedy warpes".

"Capacity Limited Radio" is a pan-cultural podcast that focuses on people and the world relationship. The Indian people have participated in the evening show, and their ability is "unlimited person." "The first time I sing and jumped on the stage, let me see the possibility of breaking through myself." Lao Cui said.

As of June 2021, Himalayan has more than 290 million audio content, and the total content is about 2.1 billion minutes, covering the audio content of 98 products, including personal growth, historical humanities, parent-child emotions, commercial finance and entertainment content, etc. .

6 anchor comes from the Himalayan audio books, popular science, live, music, and preferences, etc.

CreatorCreate creationToolkit

For creators, more convenient, smarter, lower thresholds, can greatly enhance the creation efficiency, quality and enthusiasm of creators, and greatly enhance the creators’ viscosity of the platform.

Himalayan adducts creators through technology and policy methods, currently launched various creative tools and features, make up toolkits, such as cloud clips, AI documents, audio gravity, TTS (text) Turnover), anchor reward, podcasting upgrade, etc.

"Cloud House" is the online audio editing tool that Himalaya is introduced for creators. It does not need to download and install. project files. At the same time, in conjunction with Himalayas, more intelligent aids, such as massive copyright music, sound libraries, etc. Yuan’s audio creation mode empower more content creators.

"AI" is to transfer audio high accuracy into text through ASR (speech recognition) technology to implement "listening one". The AI ??manuscript is open to users in April 2021. As of November, the average accuracy rate has exceeded 93%, which has covered the content of approximately 1.5W, and more than 600,000 people have used AI documentation, and the future plan Cover the millions of albums.

"Audio Transfer Text Assistant Clip" is also a unique feature based on ASR (speech recognition) technology, directly recognizing the audio identification text directly, locates audio or direct editing audio content, and greatly saves the audio black box. Repeatedly playing the time cost of audio lookup content, is praised by the anchor.

"Smart Truck" is a intimate function introduced by Himalayan combined with its own AI capabilities to help creators have high quality programs. This feature combines the creator’s voice content, historical sound preferences, album type, and matches background music for its audio content intelligence.

The "Smart Volume" function is similar to the logic of smart soundtracks. The AI ??system solves the creator, especially when the podcast creator creates content, especially when the podcast creator is created, and the sound volume is uneven. Intelligent volume functions can make people voice and background music volumes to coordinate each other, and vocal, background soundtrack volume is smart; the vocals are temporarily closed, background soundtrack volume intelligent.

It is worth mentioning that as an audio content platform, Himalaya TTS (Text-to-Speech, Speech Synthesis) Technology has matured, and the TTS framework of the Himalayas audio algorithm team is already in the industry leader. This technology can help content creators get a new way of creative: transferring text into voice, converting the textbook to the audio track, letting more text creators join the audio field.

When audio content creation is completed, in the process of uploading to the platform, you can also use the "Smart Cover" function to make the program easily produce exclusive exquisite cover.

At the same time, in the Himalayan platform, there is a group of podcast content creators. In addition to the above multi-authoring tools, the "Podcast Manage Service" provided by the Podcast Creation, Himalaya can help it synchronize the content to third party platforms such as Apple. In November this year, Himalaya upgraded the hosted service, launched the Podcast managed data analysis function, so that the anchor can see the album content in different platforms. At present, the podcast has become a new Blue Sea of ??audio content creation. As of the third quarter of 2021, the number of podcasts hosted in the Himalayan platform has been more than 23,300, and more than 5,000 will be added only in the first three quarters this year.

In addition to the technical function, Himalayan has corresponding incentives, training policy empowering platform content creators.

Himalayan has launched the "Chunsheng Plan" "100 major anchor plan" "Ancient Books Wake-up Plan" "Happy Plan", "Hummer Podcast Original Incentive Plan", and supporting audio content entrepreneurs. In June of this year, Himalayas, the educational education, launched the "podcast training camp", comprehensively cultivating the market insights, positioning capabilities, selection capabilities, content production capacity, post-capacity, operational capabilities and commercial capacity of podcast creators.

In the past year, Himalayan continued technology and policy enweling creators, continuously optimizing content creation tools, and uses data intelligence, innovative mode service users growing personalized content creation and content consumer demand, and help content creators get more Extensive influence and more commercial opportunities.

Himalayan will continue to build an anchor service system, assist in planning and development paths on the platform, providing growth required resources, training related skills.


In the "Himalayan Night · 2021 Magic Tour" party, representative anchors in various fields showed the color, showing content creators on the stage, providing the supply and supplement of the user’s lives with the Himalayan platform.

In the past 9 years, the active content creators on Himalayan have more than 520 million, they are from all walks of life, share their respective stories and expertise. For example, there are star big coffee, grassroots people, brand institutions, professional media, and general people in all walks of life, such as truck drivers, corporate staff, product managers, lathes workers, veterans, landscape designers, gorgan backpackers, hospitals Doctors, full-time mothers, small towns, etc., and even special groups such as disabled people, elderly.

Himalayan multi-dollar creators can be divided into three categories.

PGC (professional)Productioncontent)creator:Such as "three-body universe" IP authorization, Himalayan planning, "three body" boutique broadcast drama made by the 729-sounding factory; the explosive audio curriculum created by Himalayan and Ma Dong Qiqi Tian Group "Good Speaking".

Himalayan is also working with People’s Literature Publishing House, New Classics, Writers Publishing House, Translation Forest Publishing House, Shanghai Translation Press, Ideal States, Zhonghua Book Company, Write Iron Book, Fruit Wheat Culture, Reader Book, CITIC Publishing House, Zhanyu Culture More than 300 publishing agencies and publishing agencies have been cooperated with publishing agencies, and hundreds of books have been developed.

In addition, there are many professional authority media, such as "CCTV News" "People’s Network" "Half Month" "Oriental News" "New Beijing News" "Global Times" "Reference News", etc. in Himalayan production, quality content.

PUGC (Professional User Production Content) Cherker:Himalaya also uses large data analysis capabilities and artificial intelligence technology, established A + audio-published platform: produced for the right PugC creator matches quality copyright content. Himalaya also has a complete anchor training system and the department responsible for training, providing training for the anchor, allowing them to make professional quality, accelerate their growth on the platform. For example, the grassroots in the Himalayan, the vocal purple, magic, cattle Dabao, a knife, a special user content producers, and their content producers in the platform, gradually by the individual. Developed into professional content production teams to produce quality audible content for platforms. Among them, the sound of purple, Niu Dabao boarded "Forbes China’s 30-year-old elite list" in 2019.

UGC (user production content) creator:Himalayan has more anchors are ordinary people from all walks of life. They are corporate staff, product managers, lathe workers, veterans, landscape designers, global backpackers, hospital doctors, full-time mothers, small towns, and even disability People, elderly. They show their talents and expertise through Himalayan uploaded their original audio content.

There are more than 8,000 disabled anchors on behalf of the visual impair, but also found the light in his life, but also supported more than 20 people’s vision team, and was selected as "Forbes China 2021 years old. Elite list.

There are more than 50,000 elderly anchors in Himalayan, such as the Tianjin Old Police Feng Jiyu, which is said to the "Ming Dynasty,", who is shattered, through Himalaya, with their voice, wisdom Life experience, continue to contribute light and heat to the society.

Since 2020, the podcast has been promoted, many individuals and brand institutions have settled in Himalaya to open the radio station, and do podcasts.

For example, the famous writer Liu Xinwu, Xu Zhiyuan, Popular writer, thin hump, Qi Qi said that the ophthalmologist, Beijing Chaoyang Hospital, Tao Yong, etc., have made great knowledge and express the view.

There are many brand institutions such as Tesla, Tmall, CITIC Publishing House, K11, Fruit Shell Network, Look at the ideal, etc., in Himalaya, telling the brand story with the podcast.

Multiple content creators in various fields jointly produce spiritual food for Himalayan, covering all ages, layers, various groups, and platforms, and build Himalayas as "spirit home" of each user. At the same time, Himalayas also encompasses the content of the content creators and helps content creators to achieve commercial value, so that more talented ordinary people become creators.

It is reported that from 19:30 on December 3, the "Himalayan Night · 2021 Magic Tour" party broadcast in Himalaya, Mi Mi, and Fighting, in addition to 6 representative anchors participated in live performances, there are many other audio Cherker participates in the evening dubbing interpretation. For example, the Himalaya’s voice book head anchor "a vocal purple" will be a narrative, the anchor "CV half altar vinegar" "Shen Mingru" "Mingyue Xianglu eery" "madman" "Zhang Zhen _ animal husbandry" "" C small _ 佟 心竹 "" Li Jiayi "" Shujia Rabbit "" Tudhammon "will also have a sound performance in the party.

"What is the charm of the Charring League?": What is the necessary cultivation of playing a tide cool product

Hello, everyone, here is the "What is the charm of the charm of alliances" columns. In the "What is the charm of the charm of alliances, Xiaoles always want to share the most trend, the most cool frontier products and fun lives. But recent Xiaofeng has been very distressed: I have made a lot of Meizu products, but I have been found in Xiaofen’s heart in accordance with the concept of Meizu "Young, Tilt cool" product concept. So I have to match the product map in the column, it is really regret.

OK, say this, everyone should understand. Based on the above reasons, "What is the charm of the charm of the world, and the Xiaofeng invited a small sister who is very in line with Meizu temperament. The Meizu products involved in this column include: Meizu 17 Pro, Meizu Watch full smart watch, Meizu Lipro LED bulb.

This product photography, Xiaofen chooses Meizu 17 Pro this product, it is selfish. It is not good to say that the product of Meizu 18, and 18S series is not easy, but Xiaofeng has special feelings for Meizu 17 PRO. First, the design of Meizu 17 PRO has a unique style, identifying MAX. The front right microporous design is in line with the visual center of gravity, and it is used to use almost the annoyance of the annular electricity. It is really difficult for me to shoot the ring, and you will see the poster directly:

The rear imaging design is not to say: the 6400W full scene master image system in the horizontal rings, let people recognize "this is a Meizu". Moreover, even if it is a hand shot, Meizu 17 Pro’s photography effect is also satisfactory enough to Xiaomeng, the picture shown in this article, even when it is photography, even the fixed bracket is not used.

Xiaobang selected "Wujin" colorful 17 PRO, with a relatively dark lighting atmosphere, mobile phone and the environment almost integrated. However, Meizu 17 PRO "Wujin" ceramic rear cover is more noble and mysterious in refraction. Seeing the renderings, Xiaoles only want to say "grass is a plant".

Meizu Watch full smart watches, is a monuiful gathered american accessory item this year. Based on the style of Xiaoshan’s own dress, Xiaofeng chose a relatively low-key introverted "Mo Ji" color matching when purchasing. Meizu Watch is designed with micro-arc square dials, the advantages of such dials are more high-level, and the display is also more rich. On this basis, Meizu Watch guarantees the exquisite polishing treatment of display screen glass, as well as the smart micro arc connection between the border and the ceramic rear cover, so that the hand feels more round.

Meizu Watch’s dial design is quite cool. The Flyme team is flat, simple style, inherited on the watch’s "Flyme for Watch", and the Meizu Watch’s dial design has also been repaired and has a scientific and technological sense, trend and symbolism.

In addition to the official dial provided by Meizu Watch’s APP "Meizu Dry", Meizu Watch also supports custom dials, which supports static, dynamic picture custom display, if it is quite strong, welcome to DIY friends to buy Several a few together.

Meizu Lipro series lighting products are "photo tomorrow plaques" in Xiaofen’s heart. Of course, not just saying that Xiaoli thinks that Lipro’s lighting is excellent, but also says that Xiao Meng looks up at this moment, you can see the lipro luminaire, on the ceiling.

LED bulbs, smart ceiling lights, LED cabinets and LED intelligent sensing lights … The Xiaobang is not decorated, but the easy-to-use lamp is really worth a try. From 40 yuan LED bulbs, to the middle and high-end smart lamps of hundreds of dollars, the Lipro series products use the mild eye-catching "light".

Close to real, restore real. "Light" is highly reduced to sun spectrum, and "the light" has RA97 high color restore, RG0 comfort and low blue light and unable visible flash, etc. Choose closer to natural spectra, create a "museum-level healthy light".

There are many beautiful products, Meizu Pandaer "Rehabilitating Series" bright green bold attempts, Meizu POP 3 true wireless headphones "Inspired from Go"’s new trend design … Here, Xiaothang’s focus on pandaer this Newly upgraded "Qiyao play" brand. Meizu Pandaer brand team consists of a group of young people who explore trend, Pandaer maintains curious to the world, and trying to try new style.

Pandaer "Rehabilitating Series" products are toned in fluorescent green and black, weaving a sci-world of "scientific panda exploring future planet". Pandaer X iQunix super touch transparent mechanical keyboard bold transparent stepped design and exquisite keycaps have also received the favorite of users.

Due to the production relationship of crowdfunding products, Xiaolong has not got products yet, with a small sister’s photo, you should have no opinion?

Clouds have received "consumers trust the top ten smart home brands" leading the new era of intelligent home

"Home" is the most soft holy place in many people, the most warm harbor. In this era of new day of technology development, maybe you live alone, but when you return to the snow, the smart house can also illuminate a warm light. Today, the intelligence of the whole house is no longer an unbearable imagination, and is gradually become a new trend of smart home. LifeSmart Yunqi as a global smart home brand, after many selection and ticket review, the "consumer trust top ten smart home brands" of Sina Home selection ".

"2021 consumers trust the top ten smart home brands"

This selection is jointly hosted by Leju Home and Sina Home, and the common guidance of many home brands. After seven months, from "product" "innovation" "brand power" three dimensions, Thousands of home companies in one hundred cities conduct online voting, and the expert reviews composed of multiple industry associations and senior experts will be a comprehensive review of fairness, fair and openness. It can be said that the selection not only looks at the scientific and technological strength and comprehensive standards of home enterprises. The participation of consumers and home practitioners also proves that these enterprises not only have the strict test of the market, but also with their own brand strength. It has established a good reputation in the consumer group, and the smart home brand in the cloud is in this strict and fair assessment system.

"1 + 2 + 6" whole house intelligent strategy

The cloud is promoting "1 + 2 + 6" housing intelligence strategy, that is, "1 Wisdom Center + 2 Interaction Entrance +6 Intelligent System", this is not difficult to understand, the smart center is the brain associated with smart equipment in the whole house, can be effectively passed Interactive entrance to ensure smart lighting, safety care, smart shading, audio and video entertainment. Such excellent intelligent home solutions have made clouds to get the favor of many real estate brands, and to achieve cooperation, even the smart home in Winter Olympics can also see the figure of the clouds, ensuring that global athletes can enjoy smart, comfortable While staying at the same time, China’s smart home high-tech level is also shown in the world.

Simple home products, not simple quality of life

Since the birth, the cloud has always adhered to the design philosophy of the cumbersome detail to provide users with high-end smart home products and services to the industry’s artificial intelligence and whole house intelligence solutions to provide users with simple but easy to use. Home products, let smart home truly bring convenient and comfortable services to users, improve users’ quality of life. In this era of advocating "breaking", the clouds quickly let home products simply, and the quality of life is not simple.

In this era of artificial intelligence applications, smart homes can be said to be a general trend, LifeSmart has risen with advanced intelligent home products and wisdom customized services, and it has taken a place in the market, and also has received respect for the same industry. And praise. I believe that the future will continue to adhere to consumers to provide better smart home products and services, and will also make better presentations, inheriting their typical cases and demonstration spirit, and become a solid in carrying new economic system foundation.

ZOL technology breakfast: Apple will return to the Chinese market, Xiaomi 12 series

December 1st morning, the technology news for you

01 iPhone 13 sale, Apple will return to the Chinese market

According to the latest data of the research company Counterpoint Research, Apple’s iPhone sales in the Chinese market increased by 46% in October, with sales of 6.5 million sales, accounting for 22%, and became the largest smartphone manufacturer. This is also 6 years, and Apple returns to the first throne of China Smartphone.

[#zolsplit_eca_zolecjd E-commerce promotion area separator start #]


[#zolsplit_ecb E-commerce promotion area separator end #]

02 millet 12 series flagship mobile phone start mass production

According to Weibo blogger @ 数码 站: "The three products of Xiaomi 12 Series No. L1 / L2 / L3a have been put into production, and the maximum quasi is L3A / L3, L2, and L1 is still in NPI. Like 2k high-brush 5X + Babwat fast charge 5X super telephoto, choose Xiaomi 12 Pro high match. "In addition, the blogger also said:" Xiaomi 12 series mobile phone is tested in internal test MIUI 13, and internal feedback is good. "

03 shake response short video payment viewing function

Recently, there is news that the shake is testing the short dramatic payment function, and the payment model is similar to the payment novel. It is paid according to the number, and each episode is 10,000 yuan. The person in charge of the shake said that the short-play business is still exploring the stage, I hope to encourage more quality content creations.

04 WeChat already opens Taobao treasure links

Tencent released an update note on the "External Link Content Management Specification", which will directly access the external link in the WeChat point chat scenario; try the open e-commerce external link directly to the group chat scenario. After the measurement, you can already open the Taobao Tudo link in the WeChat group chat. In the open window, the user needs to log in to the account. At the same time, after opening the link, click "Open by default" to the Taobao.

05 Qualcomm Snapdragon Technology Summit opened today

The Snapdragon Technology Summit is open in Beijing time today at 7:00 today, Qualcom will introduce the progress from mobile phones to PC, XR, intelligence wear, and automotive. In the official information released by Qualcomm, the founder of Xiaomi Group, Chairman and CEO of the CEO appeared in the list of partner guests.

Spring Certified China Education Management Center – Spring Data Redis Frame Tutorial

8.1. File structure

This part of the reference document explains the core function provided by Spring Data Redis. It explains the concept and semantics of the key value module and the syntax of various store namespaces. For a description of the key value storage, Spring or Spring Data example, see Learning NOSQL and key value storage. This document only involves Spring Data Redis support and assumes that users are familiar with key value storage and Spring concepts.

"Redis Support" introduces the REDIS module function set.

"Redis repositories" introduced the repository support for Redis.

This document is a reference guide supported by Spring Data Redis (SDR).

9. Why use Spring Data Redis?

Spring Framework is the leading full stack Java / Jee application framework. It provides a lightweight container and a non-invasive programming model by using dependent injection, AOP and portable service abstraction.

The NOSQL storage system provides alternatives for classic RDBMS to achieve horizontal scalability and speed. In terms of implementation, key value storage represents one of the largest (the oldest) members in NOSQL space.

The Spring Data Redis (SDR) framework has eliminated the redundant tasks and template code required to store interactions through the Spring, so that the Spring application stored using the Redis key value can be easily written.

10. Redis support

One of the key value stores supported by Spring Data is REDIS. Quote Redis Project Home:

Redis is a high-level key value storage. It is similar to memcached, but the data set is not volatile, the value can be a string, just like in Memcached, but it can be a list, a collection, and an ordered collection. All of these data types can be operated by atomic operations to push / pop up elements, add / delete elements, execute differences between the server side and integrate, intersection, and collections. Redis supports different types of sorting capabilities.

Spring Data Redis provides features that easily configure and access Redis from the Spring application. It provides low and advanced abstraction with store interaction, using users to get rid of the infrastructure concerns.

10.1. Getting started

A simple way to set up a working environment is to create a Spring-based project in STS.

First, you need to set up a REDIS server that is running.

Create a Spring item in STS:

Go to the file New Spring Template Project Simple Spring Utility Project, and press if prompts appear. Then enter the item and package name, such as org.spring.redis.example. Add the following to the POM.xml file Dependencies element: org.springframework.Data Spring-data-redis 2.6.0

Change the version of Spring in pom.xml to 5.3.13

Add the following location of the Maven Spring Milestone repository to your POM.xml element, make it in the same level with your element: Spring-milestone Spring Maven Milestone repository

The repository can also be viewed here.

10.2.Redis Requirements

Spring Redis requires Redis 2.6 or higher, and Spring Data Redis integrates with Lettuce and Jedis, which two popular Redis open source Java libraries.

10.3.Redis Supports advanced views

Redis supports several components. For most tasks, advanced abstractions and support services are the best choice. Please note that you can move between layers at any time. For example, you can get a low-level connection (even this unit) to communicate directly with Redis.

10.4. Connect to REDIS

One of the primary tasks when using Redis and Spring is to connect to the storage via the IOC container. To do this, a Java connector (or binding) is required. Whether you choose a library, you only need to use a set of spring redis’s API (this is a consistent behavior in all connector): package and its RedisConnection and RedisConnectionFactory with work and retrieved active connection interfaces.

10.4.1.Redisconnection and RedisConnectionFactory

Redisconnection provides the core build block for Redis communication because it processes communication with the rear end of the Redis. It also automatically converts the underlying connection library to the Spring consistent DAO exception hierarchy so that you can switch the connector without changing any code because the operation semantic remains unchanged.

For extreme cases that require this Base’s API, RedisConnection provides a GetNativeConnection that returns the original underlying object for communication.

The active RedisConnection object is through RedisConnectionFactory. In addition, the factory is acting

The PersistenceExceptionTranslator object, which means that once declare, they can make you transparent abnormal conversion. For example, you can use @Repository annotations and AOP to translate abnormally. For more information, see the Special Section in the Spring Framework document.

Depending on the underlying configuration, the plant can return to a new connection or existing connection (when using a pool or sharing this phone).

The easiest way to use A RedisconnectionFactory is configured with an appropriate connector through the IOC container and injects the USING class.

Unfortunately, all connectors are currently supporting all REDIS functions. When the method is called on the Connection API that is not supported by the underlying library,

UNSUPPORTEDOPERATIONException will throw an AN. The following summary describes the functions supported by each REDIS connector:

10.4.2. Configuring a lettuce connector

LetTUCE is a Netty-based open source connector supported by Spring Data Redis.

Add the following to the POM.xml file defendencies element:



The following example shows how to create a new Lettuce connection factory:

@ConfigurationClass Appconfig {@bean

Public LettuceconnectionFactory RedisconnectionFactory {Return New LettuceconnectionFactory (New RedisstandaloneConfiguration ("Server", 6379));



There are also some way-upless connection parameters that can be adjusted. By default, LettuceConnection is shared by all instances that create all instances that create the same thread secure local connection for all non-blocking and non-transactional operations. To use a dedicated connection, set the sharenativeConnection to false. If set to, LettuceConnectionFactory can also be configured to use AletTucePool for pilot blocking and transaction connection or all connections.


Lettuce is integrated with Netty’s native transfer, allowing you to communicate with Redis using UNIX domain. Make sure that the appropriate native transfer dependency that matches your runtime environment. The following example shows how to create a lettuce connection plant / var/run/redis.sock for UNIX domain sets / var/run/redis.sock:

Public LettuceConnectionFactory RedisconnectionFactory {Return New LettuceconnectionFactory ("/ var / run / redis.sock");



Netty currently supports Epoll (Linux) and KQUEUE (BSD / MacOS) interfaces for operating system native transmission.

10.4.3. Configure JEDIS Connector

Jedis is the Spring Data Redis module passed Pack Supported Community Drive.




The simplest form of JEDIS is as follows:

Public JedisconnectionFactory RedisconnectionFactory {Return New JedisconnectionFactory;



However, for production purposes, you may need to adjust the host or password, etc., as shown below:

@ConfigurationClass Redisconfiguration {@bean

Public JEDISCONNECTIONFAACTORY RedisconnectionFactory {

RedisstandaloneConfiguration Config=New RedisstandaloneConfiguration ("Server", 6379); Return New JedisconnectionFactory (config)



10.4.4. Write the primary server, read from a copy

Redis Main / Copy Settings – No automatic failover (for automatic failover, see: Sports) – Not only allows data to be securely stored on more nodes. It also allows you to read data from the copy by using Lettuce while writing to the primary server. You can use the setup / write policy you want to use,

LettuceClientConfiguration as shown in the following example:

@ConfigurationClass WriteTomasterReadFromReplicAnfiguration {@bean

Public LettuceConnectionFactory RedisconnectionFactory {

LettuceclientConfiguration ClientConfig=LettuceClientConfiguration.builder

.readfrom (replica_preferred)


RedisstandaloneConfiguration ServerConfig=New RedisstandaloneConfiguration ("Server", 6379); Return New LettuceConnectionFactory (ServerConfig, ClientConfig);



For an environment that is non-public address is reported through the info command (for example, when using AWS), please use

RedisstaticMasterRreplicaconfiguration instead RedisstandalOneConfiguration. Note that RedisstaticMasterRreplicAnfiguration does not support PUB / SUB due to the lack of PUB / SUB messages across a single server.

10.5.Redis Sentinel Support

For processing high available Redis, Spring Data Redis has supported Redis Sentinel, use

REDISSENTINELCONFIGURATION, as shown in the following example:

@Beanpublic redisconnectionFactory JedisconnectionFactory {

RedissentinelConfiguration SentinelConfig=New RedissentinelConfiguration

.master ("mymaster")

.Sentinel ("", 26379)

.Sentinel ("", 26380); Return New JedisconnectionFactory (SentinelConfig);

@Beanpublic redisconnectionFactory LettuceConnectionFactory {

.master ("mymaster")

.Sentinel ("", 26380); Return New LettuceConnectionFactory (SentinelConfig);


RedissentinelConfiguration can also define PropertySource, which allows you to set the following properties:

Configuration properties

Spring.redis.sentinel.master: The name of the primary node.

Spring.redis.sentinel.nodes: comma-separated host: port pair list.

Spring.redis.sentinel.password: The password applied when using Redis Sentinel to authenticate

Sometimes, you need to interact directly with one of them. use

RedisconnectionFactory.getSentinelConnection or RedisConnection.getSentinelCommands allows you to access the first activity SENTINEL.

10.6. Processing objects via Redistemplate

Most users may use redistemplate and their corresponding packages, Due to its rich function set, the template is actually the central class of the Redis module. This template provides advanced abstraction to Redis interaction. Although RedisConnection provides a low-level method for accepting and returning a binary value (Byte array), the template is responsible for serializing and connect management, using the user from handling such details.

In addition, templates provide operational views (followed in the REDIS command reference), provide a wide range of common interfaces for a specific type or a specific key (via the keybound interface), as described below:

After configuration, the template is thread safe, and can be reused across multiple instances.

Redistemplate Most Operations use Java-based serialization programs. This means that any objects written or read by the template are serialized and deserialized by Java. You can change the serialization mechanism on the template, and the Redis module provides a variety of implementations. package is used. For more information, see the serialization program. You can also set any serialization to NULL and set the EnableDefaultSerializer property to RedisTemplate and the original byte array false. Note that the template requires all keys to be non-empty. However, as long as the underlying serialization procedure accepts them, the value can be empty. Read each serialization program Javadoc for more information.

For the case where a template view is required, the view is declared as a dependency and injected into the template. The container automatically performs conversion, eliminating Opsfor [x] call, as shown in the following example:

XMLns: xsi=""

XMLns: P=""

XSI: SchemAlocation="">

Public class example {// incject the actual template


Private Redistemplate Template; // Inject The Template as ListOperations

@Resource (name="redistemplate") Private listopertens Listops; public void addlink (string userid, url url) {

Listops.leftpush (userid, url.toExternal;);



10.7. Convenient courses in string

Since the keys and values ??stored in the redis are common Java.lang.String, the Redis module provides the redisconnection and the two extended Redistemplate, respectively, StringRedisconnection (and

DEFAULTSTRINGREDISCONNECTION implementation) and StringRediStemplate’s convenient one-stop solution for intensive string operations. In addition to binding to the String key, template and connection use StringRedisserializer underlying, which means that the stored keys and values ??are human be readable (assuming to use the same encoding in Redis and your code). The following list shows an example:

Public class example {@Autowired

Private stringredistemplate redistemplate; public void addlink (string userid, url URL) {

Redistemplate.opsforList.Leship (UserID, URL.TOEXTERNALNALM);



Because of other Spring Templates, Redistemplate and StringRedistemplate let you pass the RedisCallback interface that conversation Redis. This feature allows you to completely control because it is directly with RedisConnection. Please note that callback receives the instance StringRedistemplate when using StringRedisconnectiona. The following example shows how to use the RedisCallback interface:

Public void usecallback {

Redistemplate.execute (new rediscallback {public object DOINREDIS (Redisconnection Connection) THROWS DataAccessException

Long size=connection.dbsize; // can cast to stringredisconnection if using a stringredistemplate

(Stringredisconnection) .SET ("Key", "Value");




10.8. Serializer

From the perspective of the framework, the data stored in the redis is only bytes. Although Redis itself supports various types, in most cases, these types refer to data storage mode, not what it represents. The user decides whether to convert the information into a string or any other object.

In Spring Data, the user (custom) type and the original data (vice versa) are converted package is processed by Redis.

This package contains two types of sequencer, as the name suggests, and they are responsible for serialization:

Based on Redisserializer.

Use the RedisElementReader and the element reader and writer RedisElementWriter.

The main difference between these variants is that the RedisSerializer is primarily byte to readers and authors use Bytebuffer.

There are many implementations available (including two of this document):

JDKSerializationRedisserializer, is used by Rediscache and Redistemplate by default.


However, you can support Object / XML mapping by Spring OXM.

Jackson2jsonredisserializer or GenericJackson2jsonRedisserializer is used to store data in JSON format.

Note that the storage format is not limited to the value. It can be used for keys, values, or hashes without any restrictions.

By default, rediscache and redistemplate are configured to serialize natives using Java. Java native serializes to allow running remote code caused by payloads that use vulnerable libraries and classes that are not authenticated by unauthenticated bytecodes. Manipulating inputs may result in running unwanted code during the application during the deserialization step. Therefore, sequentialization is not used in an untrusted environment. Usually, we strongly recommend that you use any other message format (for example, JSON).

If you are worried about security vulnerabilities caused by Java serialization, consider the universal serial filter mechanism for the core JVM level, which was initially developed for JDK 9, but later ported to JDK 8, 7 and 6:

Filters the incoming serialized data.

JEP 290.

OWASP: Defense sequence of untrusted data.

Hash mapping

Data can be stored using various data structures in REDIS.

Jackson2jsonredisserializer can convert an object in JSON format. Ideally, you can store JSON as a value using a normal key. You can implement more complex structured object mappings by using the Redis Hash. Spring Data Redis provides a variety of strategies that map data to hash (depending on the case):

Direct mapping, by using the Hashoperts and serialization procedures

Use the Redis repository

Use HashMapper and HashOperations

10.9.1. Hash mappier

The hash mapping device is a mapping object to AMAP and the returned converter. Hashmapper is intended to be used with Redis Hash.

There are many implementations available:

Beanutilshashmapper uses Spring’s beanUtils.

ObjectHashmapper uses an object to a hash map.

Jackson2hashMapper uses Fasterxml Jackson.

The following example shows a method of implementing a hash mapping:

Public class person {

String dimstname;

String lastname; // …} public class hashmapping {@Autowired

Hashoperts hashopertless;

Hashmapper mappper=new objecthashmapper; public void writehash (string key, persons) {

Map mappedhash=mapper.tohash (person);

Hashopertitions.putall (Key, Mappedhash);


Map loadedhash=hashopertyS.entries ("key"); return (person) mapper.fromhash (loadedhash);




Jackson2hashMapper provides Redis hash mappings using FASTERXML JACKSON. Jackson2HashMapper can map top attributes to hash literal names and can choose to flatten the structure. Simple type map to simple values. Complex type (nested object, collection, mapping, etc.) is expressed as nested JSON.

Exhibit creates a separate hash entry for all nested properties and analyze complex types as simple types as much as possible.

Consider the following classes and the data structure therebetween:

Public Class Person {String Firstname; String Lastname;

Address Address; Date Date;

Localdatetime localdatetime;


PUBLIC CLASS Address {String City;


The following table shows how data in the front class is displayed in the normal mapping:

Flatization requires all attribute names that do not interfere with the JSON path. When using the exhibition, it is not supported in the mapping button or used as a property name or parentheses. The generated hash cannot map back objects. and java.util.calendar are represented in milliseconds. If the JSR-310 date / Time type is on the classpath, toString seizes its form Jackson-DataType-JSR310.

10.10.Redis messaging (release / subscription)

Spring Data provides a dedicated messaging integration for Redis, which is similar to JMS integration in Spring Framework in function and naming.

Redis messaging can be roughly divided into two features:

Message release or production

Subscription or consumption of messages

This is a mode example of the generally referred to as a publish / subscription (refermstriction pub / SUB). The RedisTemplate class is used for message generation. Spring Data provides a dedicated message listener container for creating a message-driven POJO (MDP) and the RedisConnection contract for synchronous reception.

exist and packages provide the core features of the REDIS.

10.10.1. Publish (send message)

To publish a message, you can use low-level Redisconnection or advanced redistemplate like other operations. Two entities provide Publish to accept messages and target channels as parameters. Although RedisConnection requires raw data (byte arrays), redistemplate allows arbitrary objects to be incorporated as messages, as shown in the following example:

// send Message Through connection redisconnection con=… BYTE MSG=…

Byte channel=…

Con.Publish (MSG, CHANNEL); // Send Message Through redistemplateredistemplate template=… template.convertandsend ("Hello!", "World");

10.10.2. Subscribe (Receive Message)

At the receiving end, one or more channels can be subscribed by direct naming or using pattern matching. The latter method is very useful because it not only allows you to create multiple subscriptions using a command, but also listen to the channels that have not been created in the subscription (as long as they match the mode).

In the underlying, RedisConnection provides Subscribe and PSUBSCRIBE methods, map the Redis command separately to subscribe by channel or by mode. Note that multiple channels or patterns can be used as parameters. To change the subscription or query it is listening, RedisConnection provides the getSubscription and Issubscribed methods.

Subscription commands in Spring Data Redis are blocked. That is, call Subscribe on the connection will cause the current thread to block when the message is waiting. The thread is released only when the subscription is canceled, which occurs in another thread calling unsubscribe or PUNSUBSCRIBE on the same connection. For solutions for this issue, see "Message Listener Variating" (Back Section of this document).

As mentioned earlier, once the subscription, the connection begins waiting for the message. Only new subscriptions are allowed to modify existing subscriptions and cancel the existing subscription. The call is more than anything else Subscribe, Psubscribe, unsubscribe, or PUNSUBSCRIBE.

In order to subscribe, you need to implement the MessageListener callback. When there is a new message to arrive, callbacks are called and run the user code through the OnMessage method. This interface can not only access the actual message, but also access to the channels it receives and subscribed for matching channels (if any). This information allows the caller to distinguish various messages not only by content, but also check other details.

Message listener container

Due to its obstruction properties, low-level subscription is not attractive because it needs to connect and thread management for each listener. In order to relieve this problem, Spring Data provides

RedisMessagelistenerContainer, which completed all heavy work. If you are familiar with EJB and JMS, you should find that these concepts are familiar because it is designed to support support from Spring Framework and its message-driven POJO (MDP) as close as possible.

RedisMessagelistenerContainer acts as a message listener container. It is used to receive messages from the REDIS channel and drive the MessageListener to inject the instance. The listener container is responsible for all threads received and assigned to the listener for processing. The message listener container is an intermediary between MDP and message providers, responsible for registering receiving messages, resource acquisition, and release, exception conversion, etc. This allows you as an application developer to write (probably complex) business logic associated with the receiving message (and respond to it), and commission the model REDIS infrastructure issue to the framework.

`MessageListener` also enables` subscriptionlistener` to receive notifications when subscribe / cancel subscription confirmation. Synchronous calls are useful.

In addition, in order to minimize the application space,

RedisMessageListenerContainer allows them to share a connection and a thread even if multiple listeners do not share subscriptions. Therefore, regardless of how many listeners or channels are tracked, the cost of running remains unchanged throughout its life cycle. In addition, the container allows runtime configuration changes so that you can add or delete listeners when the application is run without restarting. In addition, the container uses an inert subscription method, and RedisConnection is only used when needed. If all listeners cancel subscription, the cleaning is automatically cleared and the thread is released.

In order to help address the asynchronous features of the message, the container needs one

Java.util.concurrent.executor (or Spring Taskexecutor) to assign a message. Depending on the load, listener’s number or runtime environment, you should change or adjust the executing program to better meet your needs. Especially in the hosted environment (eg, the application server), it is highly recommended to select a suitable tasKexecutor to take advantage of its runtime.


This MessageListeneraDapter class is the last component of Spring asynchronous support messages. In short, it allows you to disclose almost any classes to MDP (although there are some restrictions).

Consider the following interface definition:

public interface MessageDelegate {void handleMessage (String message); void handleMessage (Map message); void handleMessage (byte message); void handleMessage (Serializable message); // pass the channel / pattern as well

Void HandleMessage (Serializable Message, String Channel);


Note that although the interface does not expand the MessageListener interface, it can still be used as MDP by using the MessageListeneraDapter class. Also pay attention to how to use a variety of message processing methods to receive and handle different Message types according to strong types of content. In addition, the channel or pattern sent by the message can be transmitted to the method String as a second parameter of Type:

Public class defaultMessageDelegate Implements MessageDelegate {// Implementation Elided for Clarity …}

Note that the above MessageDelegate interface is implemented (the DefaultMessageDelegate class above) does not have Redis dependence. It is indeed a Pojo, we use the following configuration to make it MDP:

XMLns: xsi=""

XMLns: redis=""

XSI: SchemAlocation="

Http:// ">

The listener topic can be channel (for example, Topic="chatroom") or mode (for example, topic="* room")

The above example uses the Redis namespace to declare the message listening container and automatically register POJO as a listener. The complete bean is defined as follows:

Each time you receive a message, the adapter automatically transparently (using the configured redisserializer) low format and the conversion between the desired object type. Any abnormality caused by method calls will be captured and processed by the container (by default, exceptions will be recorded).

Breaking the tradition, introducing a smart display, bringing you a wonderful life

Traditional shop advertising not only is not only logistics cost, and labor costs and technical costs are difficult to estimate, and the advertising effects of traditional models are also small. "Figure" is to break the imprisonment of traditional advertising thinking, helping merchants can achieve high-efficiency promotion targets for exposure and traffic guarantee on the basis of great reduction of promotional costs. "Figure to" project passes the "map to X1 box" coverage free laying makes the project’s extensive promotion, and its advertising screen is set in the gate of the Lujie shopping shop or the intensive space in the mall, and there is no more than 20 distances. Rice, firmly lock the shopping crowd, the explosive proof effect makes the customer are unforgettable. However, the premise of free laying is that there is one-third of the advertising screen, which is one of the important means of traffic change. When the business district of the city traffic center is "mapped" full coverage, then the immersion surrounding surrounding surrounding surrounding surrounding of the outlet can make the advertiser to achieve a full-scale exposure. This is the digital propaganda scene that "map". empire.

Pakistan rallies from 24/4 to beat Bangladesh by four wickets in first T20I

Pakistan recovered from a precarious 24-4 to beat Bangladesh by four wickets on Friday in the first of their three Twenty20s.

The match was in the balance with three overs to go, then Shadab Khan and Mohammad Nawaz hit two sixes each and Pakistan reached 132-6 in 19.2 overs, knocking off Bangladesh’s 127-7.

Fakhar Zaman and Khushdil Shah launched Pakistan’s recovery with a 56-run partnership for the fifth wicket. They scored 34 each, removed in quick succession when Fakhar chased a wide delivery of fast bowler Taskin Ahmed to edge to wicketkeeper Nurul Hasan, and Khushdil was undone by a slower ball outside off by pacer Shoriful Islam.

With the visitors needing 32 runs in the last three overs, Shadab Khan and Mohammad Nawaz pulled off a blitz to break Bangladesh’s stranglehold.

Shadab struck an unbeaten 21 off 10, hitting the winning six by slog-sweeping legspinner Aminul Islam over deep midwicket.

Aminul, one of the home team’s specialist bowlers, only came to bowl in the last over when Pakistan needed two runs for the victory.

Nawaz was unbeaten on 18 off 8.

Pakistan made a cautious start on the slow pitch before fast bowler Mustafizur Rahman rattled the stumps of Mohammad Rizwan for 11.

Captain Babar Azam dragged one on to his stump on 7, but Bangladesh failed to keep up that pressure to the end.

The damage was ultimately done when it was restricted to 127-7, continuing a poor batting record that haunted Bangladesh in the T20 World Cup. The team has lost six straight T20s.

Pakistan pacer Hasan Ali, with 3-23, triggered a collapse, leaving Bangladesh at 40-4 in the ninth over.

Afif Hossain top-scored for the side with 36 and Mahedi Hasan was unbeaten on 30 to help the side get past 100.

The second match is on Saturday.