2021年6月4日星期五

Final cut 快速制作 YouTube 小章节的时间节点

 YouTube的小章节功能特别实用,但是如果大量生产视频,并且视频的子章节特别多的话,那么编辑小章节的时间节点就成为了一件繁琐的事情。


我盯上了final cut的字幕功能

第一步:opt+C,添加每小节字幕标题


第二步:导出字幕



第三步:用subline打开字幕


第四步:用正则表达式编辑字幕 opt+cmd+F

    ,[0-9]{3} --> [^\n]+\n

    \n[0-9]{1,2}\n


第五步:粘贴到YouTube





2019年2月12日星期二

DMA (Direct Memory Access) 是什么?

DMA (Direct Memory Access)
意思:直接存储器访问。
作用:不需要经过CPU进行数据传输,也就是替CPU分担点事情做,什么事情?数据传输方面的事情。

也就是说,你只要使能并配置好了DMA,DMA就可以将一批数据从源地址搬运到目的地址去而不经过CPU的干预,这样可以为CPU节省好多精力去干更重要的事情很人性化。就像我们人一样,我们平常习惯性的动作是不用经过大脑思考的,比如说眨眼睛,呼吸等。

DMA必须有两个条件:
数据从哪传(源地址),数据传到哪里去(目的地址)。
通过软件设置,设置好源地址和目的地址。

一个重要的条件就是触发源是什么,就是说什么时候进行DMA数据传输呢?这叫触发信号。通过软件编程设置具体时间,具体条件来触发DMA数据传输。

总之,要使用DMA就要将各种参数,条件配置好才可以用。就DMA寄存器说明见STM32的参考手册。下面举一简单的历程来说明DMA的用法,本历程将串口数据发送设置为DMA模式,串口1将持续从RAM中的一段连续的地址中取数据,然后发送出去。用串口调试助手可以监测DMA的工作和CPU互不冲突,串口发送就相当于后台运行的一段程序。具体配置如下:

DMA发送的配置步骤如下:
1.   在DMA_CPARx寄存器中设置外设寄存器的地址。发生外设数据传输请求时,这个地址将是数据传输的源或目标。
2.   在DMA_CMARx寄存器中设置数据存储器的地址。发生外设数据传输请求时,传输的数据将从这个地址读出或写入这个地址。
3.   在DMA_CNDTRx 寄存器中设置要传输的数据量。在每个数据传输后,这个数值递减。
4.   在DMA_CCRx寄存器的PL[1:0]位中设置通道的优先级。
5.   在DMA_CCRx寄存器中设置数据传输的方向、循环模式、外设和存储器的增量模式、外设和存储器的数据宽度、传输一半产生中断或传输完成产生中断。
6.   设置DMA_CCRx寄存器的ENABLE 位,启动该通道。 一旦启动了DMA通道,它既可响应联到该通道上的外设的DMA请求。 当传输一半的数据后,半传输标志(HTIF) 被置1 ,当设置了允许半传输中断位(HTIE) 时,将产生一个中断请求。在数据传输结束后,传输完成标志(TCIF) 被置1 ,当设置了允许传输完成中断位
(TCIE) 时,将产生一个中断请求。

对于stm32一些外设的地址,参看stm32参考手册的存储器映像就可以了。
还有STM32 DMA通道的选择表

在使能DMA的时候千万不要忘记了时钟的配置。


以下是DMA的一些基本概念:

一般芯片的dma有基本功能:
1、普通的内存、外设间互传数据,一次性的。
2、支持链表的,美其名曰“scatter”,内核有struct scatter可以参考。

说一下注意点:
dma有burst、burst size、transfer的概念:

burst:DMA实际上是一次一次的申请总线,把要传的数据总量分成一个一个小的数据块。比如要传64个字节,那么dma内部可能分为2次,一次传 64/2=32个字节,这个2(a)次呢,就叫做burst。这个burst是可以设置的。这32个字节又可以分为32位 * 8或者16位*16来传输。

transfer size:就是数据宽度,比如8位、32位,一般跟外设的FIFO相同。

burst size:就是一次传几个 transfer size.


现在我配置数据宽度为32位。一次传8个32位=32个字节。
那么如果总长度为128字节,那么实际dma设置的长度为 128/32 = 4.


2018年12月17日星期一

2018年12月12日星期三

2019考研数学【张宇强化】完全版

考研英语:小作文全面总结之《葵花宝典》

1. 寒暄
非常高兴回想起过去的两个月,我在贵杂志担任编辑工作。
I am quite/ particularly delighted to recall the past two months when I worked as an editor for your magazine. 非常高兴听到一次国际会议即将在我们这所大学举行的好消息。
It is quite great to hear the good news that an international conference will be held in our university.

2. 自我介绍
我是贵报的一名忠实读者,非常关注环境保护。
I am a regular/ loyal / faithful reader of your newspaper who focuses much eyesight on environmental protection.
As a faithful reader of your newspaper, I pay  great attention to environmental protection.
我是一名消费者,前几日在你们这家商店够了一个电子词典。
I am a customer, who purchased an electronic dictionary from your store the other day/ several days ago.

3. 目的
今天,我写信想要辞职,因为我发现现在这份工作不是我期待的。
Today, I am writing for/ with the purpose of quitting/ resigning, since I find this job is not what I expected.
今天,我代表学生会写信想要表达我们的诚挚欢迎并提几个建议。
Today, I, on behalf of the StudentsUnion, am writing for the purpose of expressing/conveying our sincere welcome and proposing several suggestions.
本通知的目的是为这次会议招聘20名志愿者。
This notice is for the purpose of recruiting 20 volunteers for this meeting.

4. 感谢
作为读者,我们非常感谢你们的辛勤工作以及你们对环境问题的关注。
As readers, we are much obliged/ grateful/indebted for your hard work and your concern about environmental issues.

我们非常感谢学校图书馆为我们提供的良好的学习氛围。
As students, we are very grateful for the positive atmosphere of study in the library of our university.

5. 投诉(表达不满)
我对你们产品糟糕的质量感到非常失望/愤怒。
I am rather/ much disappointed/ angry withyour products inferior quality.
Your product of inferior quality disappoints me a lot.
很多消费者对日本汽车的质量和安全性感到很失望。
A host of customers are much disappointed with the Japanese cars of inferior quality and safety.

6. 意义(强调句)
正是你们的热心帮助使我积累了一定的工作经验和能力。
It is your warmhearted help that enables me to accumulate certain work experience and competence.
正是我的勤奋努力使得我在积累足够的专业能力、经验和技能。
It is my diligence and hard work that enables me to accumulate adequate professional ability, experience and skills.
 我相信正是我们的爱使得更多的孩子建立起信心和希望。
It is our love that enables more kids to build up confidence and hope.

7. 危害
正是它不断的死机/故障没能使得我为GRE考试/考研做好最充分的准备。
It was the frequent breakdowns and problems that led me to make inadequate preparation for GRE/ the national entrance examination for postgraduate.
 正是导游恶劣的态度没有使得我们感受到旅行的舒适。
It is the guides rude attitude that leads us to enjoy no comfort in the trip.

8. 突出特征(背景)
大学生活的典型特点就是丰富多样的活动。
A rich variety of activities can characterize college life.
 College life can be best characterized/featured by a rich variety of activities.
 这本书的突出特点就是它关于战争的精彩故事。
This book is characterized by its wonderful stories concerning/about war.

9. 对比描述
然而,与工作的需求相比,我的能力不足,我干不好这份工作,。
However, compared with the requirements of this job, my capacity is not sufficient and I cannot do this job well.
However, I cannot do this job well, because compared with the demand of this job, my capacity is not sufficient. 
与别人相比,我不算有钱,但我会竭尽全力帮助他完成从中学到大学的学业。
I, compared with others, am not richer, but I am willing to try my utmost to help him finish the education from middle school to college.
与高中相比,大学中有更多的自由和业余时间。
Compared with the life in high school, there will be more freedom and spare time in college. 

10. 提建议
因此,我继续做这份工作就不太合适了。
Thus, it is not advisable for me to continue this job.
因此,每个人都应该给希望工程做贡献,而且我想帮助一个偏远地区的孩子。
Accordingly, it is advisable for everyone to contribute to Project Hope, and I intend to help an impoverished child from a remote area.
此外,申请者应该热心周到,而且正是你们的热心工作将会帮助外国客人享受一段在中国的舒适旅程。
In addition, applicants are supposed to be warmhearted and considerate. It is your sincere work that will enable foreign guests to enjoy a comfortable trip in China.

11. 排比意义
这些活动将带给你们机会练习汉语,唤起你们对中国文化的热情,帮助你们适应大学这里的大学生活。
These activities will bring you opportunities to practice Chinese, arouse your enthusiasm for Chinese culture as well as help you adapt to college life here.
实践和勤奋努力将带给你经验/灵感,唤起你对学习的热情并帮助你每天有所进步。
Practice and diligence will bring you experience and inspiration, arouse your enthusiasm for study and help you to make progress every day.

12. 期待
请接收我诚挚的道歉,并在您方便的时候尽早回复我。
Please accept my sincere apologies, and I am looking forward to your favorable reply at your earliest convenience.
我们期待着你们的到来并且乐意尽我们所能帮助你们。
We are looking forward to your arrival and willing to do anything we can to help you.
我相信采取这些措施,学生的身体条件将得到提升/好转。
I believe that with these measures taken, students physical condition will be enhanced.


历年考研数学真题解析

2010-2018年英语一作文真题及范文分析

2010年英语一作文真题
The enlightening picture portrays that a hot pot, with numerous ingredients in it, includes such domestic and alien cultures as literature, moral values and performing arts. It seems that the hot pot tastes very delicious because of the rich nutrition of the multi-cultural elements.
Obviously, the picture characterizes the status Quo of Chinese society in which Chinese and Western culture conflict with each other but also merge into a unique form to a certain degree. Since China has opened its door widely to the outside world, many people from different countries have been deeply fascinated by Chinese culture. They will accept and love the Chinese culture as a whole. In addition, Chinese culture should be well shared with foreign people, who have shown their enthusiasm towards China. Meanwhile, the Chinese people are also exposed to foreign cultures when more foreign people come to this oriental country. In this way people from various nations in the world will be able to acquire better understanding of each other and live peacefully in this world.
In my opinion, the culture of any nation is a kind of precious heritage, and belongs to the whole mankind. With economic globalization, the blending of different cultures has become an inevitable trend of the time. No country is an isolated island, be it China or the western world. The clearer we grasp the current situation, the more it would be beneficial to the global villagers.

2011年英语一作文真题
Our surroundings are being polluted fast and man's present efforts can not prevent it. Time is bringing us more people, and more people will bring us more industry, more cars, larger cities and the growing use of man-made materials.
What can explain and solve this problem? The fact is that pollution is caused by man -- by his desire for a modern way of life. We make "increasing industrialization" our chief aim. So, we are often ready to offer everything: clean air, pure water, good food, our health and the future of our children. There is a constant flow of people from the countryside into the cities, eager for the benefits of our modern society. But as our technological achievements have grown in the last twenty years, pollution has become a serious problem.
Isn't its time we stopped to ask ourselves where we are going-- and why? It makes one think of the story about the airline pilot who told his passengers over the loudspeaker, “I’ve some good news and some bad news. The good news is that we're making rapid progress at 530 miles per hour. The bad news is that we're lost and don't know where we're going. " The sad fact is that this becomes a true story when speaking of our modern society.
In my opinion, to protect environment, the government must take even more concrete measures. First, it should let people fully realize the importance of environmental protection through education. Second, much more efforts should be made to put the population planning policy into practice, because more people mean more pollution. Finally, those who destroy the environment intentionally should be severely punished. We should let them know that destroying environment means destroying mankind themselves.
2012年英语一作文真题
In the above picture, we can see an interesting scene: a bottle is knocked over with the liquid inside splitting out, and two men respond to it in totally different ways. One is expressing his disappointment for the loss of half of the liquid while the other feels thankful for the remaining half with a smile on his face. Obviously, the drawer wants to tell us that different people may have different outlooks on various difficulties in life.
When faced with obstacles in life, the pessimistic person always focuses on the negative side and exaggerates the worst situation, while the optimistic one always looks on the bright side of life. The pessimistic person chooses to give up quickly and then broods over their loss or failure, which in turn will throw their life in the vicious circle. On the contrary, the optimistic person, who always bears hope in mind, will never flinch and will summon up courage to find the way to conquer the obstacles. Therefore, the way people perceive difficulties will determine their way to cope with them.
From the above discussion, we come to know that if people want to succeed in this highly competitive society, they should try to develop an optimistic perception toward life. Moreover, the government, mass media and schools should take the responsibly to awaken people to the significance of optimism. Only in these ways can people achieve more rapid progress and greater success in their life.



2013年英语一作文真题
Recently, there has been a growing concern among the public over the topic of the choice after graduation. As is described in the picture, a group of graduates are facing various roads to go, such as searching for jobs, pursuing further study, going abroad and becoming entrepreneurs. The picture intends to convey us that, as adults, college graduates have to make their own decisions about future life.
After graduation, college students should choose future life based on their own realities and dreams. For those, who are eager to become economically independent and to put into practice what they have learned in college, taking a job or doing pioneering work may be satisfying and rewarding. Getting established as a bread-winner after graduation is their main desire. By contrast, others who want to take advantage of the favorable conditions in college, however, ought to try to enroll in graduate programs inside or outside. For them, a Master's degree or even a Doctoral degree represents a much more ambitious goal than a bachelor's degree, because they cherish lifetime success and interest more in academic achievements than money.
It is sensible that we should take a rational attitude towards the decisive choice. For the part of my own, getting a higher degree abroad has long been my dream. I’m a strong believer that one should do more research and learn more while he or she is still young.

2014年英语一作文真题
As is vividly described in the left part of the drawing, thirty years ago, there stood a delicate mother, holding the tiny hand of a lovely girl, who wore a red scarf. On the contrary, the right part of the picture illustrates that with time flying quickly, the little girl, who has already grown up as a gorgeous lady, is supporting her old mother. We are informed: accompanying.
It is without saying that the old and the young are two indispensable parts in society. On the one hand, what we have and enjoy now was created by our parents in the early days, as the old Chinese saying goes, "One generation plants tress under whose shade another generation rests". On the other hand, all of us are supposed to take good care of the youngsters, too. It is children who make us see the future of our state, for they are the future builders of our country.
The young should consider it a moral obligation respecting and taking care of old parents. Meanwhile, it is also the duty of the parents to protect, educate and look after the youths. Let's bear this in mind and cultivate that virtue together, because only by doing so, can we feel as if we were living in a happy and harmonious family.

2015年英语一作文真题
A group of friends, boys or girls, are having a dinner party while each one of them is checking messages in their mobile phones without saying a word to one another, leaving the dishes untouched. We are informed that this is a gathering in the era of mobile phone.
The above picture unveils a common social phenomenon and the symbolic meaning of the photo is the effect of the mobile phone on people's way of life. Undoubtedly, the phone provides us with considerable convenience, making many things possible which are beyond our dreams. As a communication tool, the phone makes us closer than ever before by providing immediate communication. Meanwhile, there are negative effects on our personal life. As is shown in the picture, people are imprisoned in their own world! They choose contacting online rather than communicating face to face.
Accordingly, enjoying the convenience provided by the phones, we should bear in mind that human beings are social beings who need real interpersonal interactions! Joint efforts are needed to ensure people to have face-to-face communication! I believe a harmonious relationship between friends is awaiting us if we set aside our mobile phones and enjoy the untouched meal!

2016英语一作文真题
 (When the issue of teaching and learning education role model arouses wide concern from the public, can we still stand there, hesitating for what occurs) As we can see from the depiction, a father, sitting in front of a television which broadcasts some kinds of soap operas, is appreciating nuts and bolts of these invariable plots, without any caring about his kids. Actually, it is a Morning Call to send us a message that we adults always perform something wasting much of precious time, thus spoiling youth as every second elapses.
(But my own worry today is less that of the overwhelming problem of common housewives or househusbands than it is of the slightly more luxurious agony of the decline in time-managing ability even of the educated teenagers.) Several factors could weigh heavily for this degeneration, yet, suspended at the top of the list are the following two aspects. To begin with, habit is habit. We parents are good at giving ourselves sufficient excuses to support what we always do in our daily life. If one example is needed, I could not but mention the following well-known scientist, whose name is Freud, illuminating that a kind of habit, representing a sense of spiritual existence, can never be changed as long as continuing for 47 days, nor is this kind of negative model behaviors. Furthermore, externally, our society is witnessing an overwhelming number of low-level TV programs, ranging from entertaining shows, TV talk shows and TV series to some other inferior products, which differ in forms as well as broadcasting time but never in their contents. Then, the consequence is distinct. It goes with no exaggeration to say that soap opera ruins the concept of “Like father, like son”.
Fortunately, that is not the Day of Judgment. It is, undoubtedly, the very time that we should take some available methods to end up these inappropriate behaviors, including laying down the effective regulations to arrange family time, shaping a moderate education family outlook and guaranteeing more rational lifestyles.

2017年英语一作文真题
Here are two pictures, both interesting but with sharply contrasted implication. As is vividly depicted in the first photo, a man sitting in sofa looking at his bookshelves and satisfied with the quantity, which successfully arouses our curiosity. On the contrary, the second picture describes that another teenager set his aim at complete 20 pieces books reading, finally completing the contrast is supposed to be given further analysis.
With the increasing pace of modern life, perhaps no change has characterized the past decade more dramatically than wide spread of reading. Naturally, it brings us both advantages and disadvantages. As for my part, the latter outweighs its former. On the top of list is that people became flippancy without reading. In addition, there is the other point that no one can ignore. It is universally admitted that a nation will recede with reading. No other case can better illustrate the consequences of what I have discussed than the picture above.
According to the analysis above, it is advisable for us to take steps to maximize its positive effects and minimize the disadvantage. Of all the steps, mass media tends to function essentially in the job. Only in this way can we make the best of the value of reading an embrace a bright future.

2018考研英语作文
例文1
  As is vividly depicted in the graph that sitting in front of a computer, a student is selecting the curriculum, taking numerous elements into consideration including the innovation, the freshness of knowledge and the level of difficulty as well as the scoring, the qualified rate and burden of assignment. The caption says: The course selecting is on the way, indicating the importance of well-rounded consideration while making a choice.
  We can deduce from the portrayal that well-rounded contemplating, a significant quality, serves as an indispensable capability bringing about positive influence toward different aspects of our lives. It is commonly known that the value of comprehensiveness and sophistication of thinking has been proved by countless examples around us, such as the governmental policy making and selection of compulsory and optional course. If we can put this notion into practice, it would exert profound and constructive influence. Therefore, well-rounded and thorough thinking will create huge benefit to the prosperity of community as well as personal development.
  Whatever difficulty or situation we are confronted with, those who have the ability of analyzing the ingredients and integrating them together are nearer to success. Therefore, well-rounded consideration is the wisdom we should live up to.
  例文2
As is depicted by the picture, a student is selecting courses. He is considering whether to choose the courses which are high scored, easily passed with less homework, or to choose those that contain new knowledge, focus on creating and are difficult to learn. From my perspective, I will choose the latter ones. The reasons are as follows.
The college students are faced with fierce competition in nowadays. Those courses which are full of advanced knowledge can broaden our horizon and enrich our knowledge. More over, they pay more attention to creativity so that I can be equipped with novel viewpoints in the future when seeking a job, which can help me become more competitive among the peers. Last but not least, to learn those courses which are difficult can give me a sense of accomplishment.
We young people are the hope of our country, and we must study hard to become the future star of our country!
例文3
In front of a desktop sits a young boy who is staring at the screen and selecting the curriculum. Apparently, a trace of hesitancy showed in his eyes. He is considering whether to choose the courses which are high scored, easily passed with less homework, or to choose those that contain new knowledge, focus on creating and are difficult to learn.
The implication echoed by this cartoon can be summarized as a philosophic topic in our daily lifethe success of a man is closely related to the choice made by himself. Nevertheless, I cherish a belief that we cannot tell whether the selection is good or not, and as long as we adhere to our decision, success will be realized step by step. Although making a choice is essential to help determine the direction of our way, judged from the personal aspect, persistence functions as an indispensable driving force to keep up our spirit and to assist us to fulfill our study and work. However, some people, pacing up and down, are not industrious and try to find a short-cut success. In fact, only those who are hard-working and brave enough to encounter obstacles of all sorts are most likely to reach the summit of success.

Accordingly, persistence and making our own decision rationally are badly needed in every aspect of our society. In order to bring out this potential capability, our education system is supposed to be reformed fundamentally, focusing on cultivating the ability of confronting challenges. As an old saying goes: “No pain, no gain.”