电脑刚做完系统 鼠标玩游戏的时候飘时候 角色跑起来为什么会眼晕,没有做系统前 是没有这样问题的,

→ 在电脑前面坐的时间长了会感觉到头晕是怎么
在电脑前面坐的时间长了会感觉到头晕是怎么
健康咨询描述:
在电脑前面坐的时间长了会感觉到头晕是怎么回事啊?在电脑前面坐的时间长了会感觉到头晕是怎么回事啊?
其他类似问题
医生回复区
山东省中医院&& 医师
擅长: 擅长治疗中风、高血压、头晕、颈椎病、头痛、失眠、焦
微信扫描关注直接与我沟通已扫1819次
&&&&&&病情分析:&&&&&&你好,你这是颈椎病的表现。&&&&&&指导意见:&&&&&&建议平时要保持正确的工作或生活姿势避免保持一个姿势时间过久。睡觉不益枕的过高,不要躺床上看电视和长时间打牌,不要低头工作时间过久等。
擅长: 高血压,冠心病,甲亢,糖尿病,消化性溃疡等内科疾病
微信扫描关注直接与我沟通已扫8600次
&&&&&&病情分析:&&&&&&长时间使用电脑后出现头晕,考虑为颈椎病可能,为椎动脉受刺激,导致脑供血不足所致。&&&&&&指导意见:&&&&&&建议避免长时间低头姿势,可予颈椎操锻炼,如头晕持续,可予尼莫地平或敏使朗口服对症处理。
南方医科大学附属南方医院&& 医师
擅长: 手术治疗四肢常见骨折,脊柱骨折,神经肌腱损伤,创面
微信扫描关注直接与我沟通已扫577次
&&&&&&病情分析:&&&&&&你好,电脑前面坐的时间长了会感觉到头晕有可能是颈椎病,贫血,高血压等各种因素影响,要注意劳逸结合&&&&&&指导意见:&&&&&&平时要注意尽量多转动头部,如果是出现了颈椎疼痛,脖子僵硬等表现要注意多按摩和热敷颈部,多抬头看天,可以考虑做下血常规,血压等看看是否正常&&&&&&以上是对“在电脑前面坐的时间长了会感觉到头晕是怎么”这个问题的建议,希望对您有帮助,祝您健康!
您可能关注的问题
用药指导/吃什么药好
本品用于湿热瘀滞所致的带下病。...
参考价格:¥28
本品用于跌打损伤,跖骨、趾骨骨折,瘀血肿痛,吐血...
参考价格:¥17.5&p&写在开头:我作为一个老实人,一向非常反感&b&骗赞、收智商税&/b&两种行为。前几天看到不止两三位用户说自己辛苦写了干货,结果收藏数是点赞数的三倍有余,感觉自己的无偿付出&b&连认同都得不到,很是失望&/b&。明白人都知道这是潜水伸手党的锅。但同时,截止写这段话时,我发现这篇Leetcode简略(得不能再简略的)题解得到了一千多赞,三千多收藏。所以,在我不向任何人做任何广告、收任何费用的前提下,&b&麻烦在收藏的同时,顺手点个赞(对只收藏不点赞的行为表示明确鄙视)&/b&。如果连点一个赞的力气都没有,恐怕Leetcode也就甭刷了。&b&拒绝伸手党,从你我做起。&/b&&/p&&p&// To begin with: I for one as an honest man, am always loath at the thought of &b&luring upvotes or making profit from stupid taxes&/b&. A few days ago, I saw more than a few zhihuers uttering their disappointment with their informative answers receiving three times as much bookmarks as upvotes. It takes no more than a halfwit to see that lurks are to blame. However, as of the moment of me writing this, this so very brief (hardly more so) summary of Leetcode solutions has around 1k upvotes and 3k bookmarks. &b&Being willing to share things for free requires nothing but a little bit of encouragement and recognition&/b&. As such, &b&I recommend those who choose to &bookmark& to add one extra click on the &upvote& button&/b& (my sincere despise to all ungrateful lurks), considering the fact that I ain't pushing no ads or charging no fees to nobody. IMO, you don't quite stand a chance against hundreds of Leetcode problems if you lack the strength for a mere &upvote&. &b&No bloodsucker, your choice matters&/b&.&/p&&p&&br&&/p&&p&&br&&/p&&p&&b&这是一篇由用户&a class=&member_mention& href=&/people/758beacf56b1a3c8ee5f0fbfcca9d6e0& data-hash=&758beacf56b1a3c8ee5f0fbfcca9d6e0& data-hovercard=&p$b$758beacf56b1a3c8ee5f0fbfcca9d6e0&&@朱里&/a&整理的Leetcode题解。就是我。&/b&&/p&&p&&b&// This is a memo for Leetcode problem set, by user &a class=&member_mention& href=&/people/758beacf56b1a3c8ee5f0fbfcca9d6e0& data-hash=&758beacf56b1a3c8ee5f0fbfcca9d6e0& data-hovercard=&p$b$758beacf56b1a3c8ee5f0fbfcca9d6e0&&@朱里&/a&. That's me.&/b&&/p&&p&&br&&/p&&p&&br&&/p&&p&其中的题解部分会不定期更新,因为题目实在太多了,一次并不能写完。&/p&&p&// As the number of problems is massive, I'll keep updating this article every once in a while. You don't expect me getting it done overnight, do you?&/p&&p&&br&&/p&&p&&br&&/p&&p&&b&目前已写完567题的题解。&/b&&/p&&p&&b&// Current progress is 567/585.&/b&&/p&&p&&br&&/p&&p&&br&&/p&&p&目前LeetCode出新题比较频繁。鉴于付费题目需要交钱才能刷,我打算攒到一两百题再掏钱。毕竟掏了一个月的钱,一个星期就刷完了,不怎么划算。按照目前LeetCode题目的难度和质量来看,每次出新题,基本都能马上搞定,毕竟刷了几百题,也很难再有什么新花样了。&/p&&p&// Currently LeetCode is updating problems at a fast and steady pace. The premium problems are unlocked only after payment, so I decide to take my order when there're a hundred or two available. Basically I don't deem the price quite worth, as you usually finish them off in a week while the payment is for a month. Free problems are fine, just no surprise for me anymore after doing five hundreds of them, I guess.&/p&&p&&br&&/p&&p&&br&&/p&&p&有人常常花很多时间。考虑做一件事“有什么用”?你猜我怎么想,“没什么卵用”。&/p&&p&// People tend to waste a lot of time think about the meaning of everything. Know what I think? Nothing. No, none, null, void.&/p&&p&&br&&/p&&p&&br&&/p&&p&活着、读书、上学、工作、找个人结婚、安顿下来、放弃一切理想信仰希望、混日子、变老、等死。有意义吗?没有意义吗?&/p&&p&// Live, go to school, be young and foolish, get a job, get laid, settle down, give up your dreams, beliefs and hopes, grow up into a nobody, turn old and stubborn, wither and die. What's the point? What's not?&/p&&p&&br&&/p&&p&&br&&/p&&p&&br&&/p&&p&所以,刷几百道Leetcode,一定能找到工作吗?别tm废话了,刷吧。&/p&&p&// So, will Leetcode land me a job after all? Tell you what, just shut the f**k up and do it. &/p&&p&&br&&/p&&p&&br&&/p&&p&为什么人生如此艰难?不为什么。&/p&&p&// Life is tough, for no reason.&br&&/p&&p&&br&&/p&&p&&br&&/p&&p&所有题中,有大约10题左右不是独立完成,参考了网上高手的解法。&b&调试用脑子或者纸笔。基本不使用IDE,不编译运行。&/b&&/p&&p&// Among these problems, around 10 were solved after referencing clever solutions from the Internet, the rest were all solved independently. &b&Code was debugged inside my brain or on paper. IDE or compiler were hardly involved.&/b&&/p&&p&&br&&/p&&p&&br&&/p&&p&&b&总体上,代码尽量追求可读性,保证时间空间复杂度的优化,并保持风格一致。&/b&&/p&&p&&b&// In general, readability is what I care more about (compared to code length). Time and space complexity are bottom line. Consistent code style is maintained at best efforts.&/b&&/p&&p&&br&&/p&&p&&br&&/p&&p&感觉现在面试题的难度也有种“通货膨胀”的趋势,以前的“hard”题目和现在的“medium”差不多,看来工作真是越来越难找了。&/p&&p&// There seem to be inflation in tech interview problems as well (AFAIK prices never go down). Those rated &medium& today are no easier than those rated &hard& in the old days. Harder to make a living, isn't it?&/p&&p&&br&&/p&&p&&br&&/p&&p&&b&代码库地址:&a href=&/?target=https%3A///zhuli/leetcode-2& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&zhuli/leetcode-2&i class=&icon-external&&&/i&&/a&&/b& &/p&&p&&b&// Code repo can be found at &a href=&/?target=https%3A///zhuli/leetcode-2& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&zhuli/leetcode-2&i class=&icon-external&&&/i&&/a&.&/b&&/p&&p&&br&&/p&&p&&br&&/p&&p&关于很多题为什么一句话(甚至一个词)带过,简言之就是“&b&典型题&/b&”。因为一个经过合格训练的程序员对于两百行以内的算法代码应该有足够的&b&代码阅读能力&/b&,以及&b&快速适应新语言&/b&的能力。每题的Github代码足够提供参考。&b&对于关键思路做最少的提示即可,这也是面试所能容忍的程度&/b&。超出此程度,免不了被淘汰。在不涉及软件工程、设计模式、模块接口设计的情况下,逐字逐句解释并且配上插图毫无必要。同时,&b&能五到十分钟解决的题,是不值得花二十分钟写题解的&/b&。刷一题发一篇文章,你是打算孤独终老?还是干点儿别的吧。&/p&&p&// As for why most problems are walked through by a mere sentence (even a single word), simply put, &b&they're just typical&/b&. I think a programmer with proper training should have adequate &b&competence of code reading&/b& and &b&adaptability to new languages&/b&. The given codes on Github are sufficient for the task of illustration. &b&Minimal hints on the key idea is what I deem tolerable for a real interview&/b&. Beyond that, you fail. Without involvement of software engineering, design patterns or modular interface designs, a word-by-word explanation with illustration is totally tedious. &b&Besides, a five-minute kill is not worth a twenty-minute autopsy&/b&. A post for every problem solved, serious? Looking to die alone playing Leetcode? There are better things to do for sure.&/p&&p&&br&&/p&&p&&br&&/p&&p&下面&b&以题号为顺序&/b&,对每一题的题意和解法做简要描述:&/p&&p&// Following here is a summary of description and solution for every problem I solved:&/p&&p&&br&&/p&&p&&br&&/p&&p&&a href=&/p/& class=&internal&&LeetCode 简略题解 - 1~100 - 知乎专栏&/a&&/p&&p&&a href=&/p/& class=&internal&&LeetCode 简略题解 - 101~200 - 知乎专栏&/a&&/p&&p&&a href=&/p/& class=&internal&&LeetCode 简略题解 - 201~300 - 知乎专栏&/a&&/p&&p&&a href=&/p/& class=&internal&&LeetCode 简略题解 - 301~400 - 知乎专栏&/a&&/p&&p&&a href=&/p/& class=&internal&&LeetCode 简略题解 - 401~500 - 知乎专栏&/a&&/p&&p&&a href=&/p/& class=&internal&&LeetCode 简略题解 - 501~600 - 知乎专栏&/a&&/p&&p&&a href=&/p/& class=&internal&&LeetCode 简略题解 - 601~700 - 知乎专栏&/a&&/p&&p&&br&&/p&&p&&br&&/p&&p&写题解的目的只是用于备忘和加深理解,所以有没有人看并不重要。&/p&&p&// It's just a memo to help fortify comprehension. Ain't no big deal if nobody's reading this.&/p&&p&&br&&/p&&p&&br&&/p&&p&如果有人看了后,觉得我某道题的解法有值得讨论或者错误的地方,欢迎在评论里指出。&/p&&p&// If anyone should feel the need for discussion, please leave your comment.&/p&&p&&br&&/p&&p&&br&&/p&&p&以下是更新日志:&/p&&p&// Change logs are as follows:&/p&&p&&br&&/p&&p&&br&&/p&&p&&b&截止日02:25,Leetcode的Algorithm部分(包括付费题目)总共491题。&/b& &/p&&p&&b&// As of the moment 02:25, , there're altogether 491 problems in the Algorithm section of Leetcode.&/b&&/p&&p&&br&&/p&&p&&br&&/p&&p&&b&截止日05:02,Leetcode的Algorithm部分(包括付费题目)总共499题。&/b&&/p&&p&&b&// As of the moment 05:02, , there're altogether 499 problems in the Algorithm section of Leetcode.&/b&&/p&&p&&br&&/p&&p&&br&&/p&&p&&b&截止日15:01,Leetcode的Algorithm部分(包括付费题目)总共519题。&/b&&/p&&p&&b&// As of the moment 15:01, , there're altogether 519 problems in the Algorithm section of Leetcode.&/b&&/p&&p&&br&&/p&&p&&br&&/p&&p&&b&截止日11:13,Leetcode的Algorithm部分(包括付费题目)总共523题。&/b&&/p&&p&&b&// As of the moment 11:13, , there're altogether 523 problems in the Algorithm section of Leetcode.&/b&&/p&&p&&br&&/p&&p&&br&&/p&&p&&b&截止日21:08,Leetcode的Algorithm部分(包括付费题目)总共535题。&/b&&/p&&p&&b&// As of the moment 21:08, , there're altogether 535 problems in the Algorithm section of Leetcode.&/b&&/p&&p&&br&&/p&&p&&br&&/p&&p&&b&截止日16:52,Leetcode的Algorithm部分(包括付费题目)总共543题。&/b&&/p&&p&&b&// As of the moment 16:52, , there're altogether 543 problems in the Algorithm section of Leetcode.&/b&&/p&&p&&br&&/p&&p&&br&&/p&&p&&b&截止日10:33,Leetcode的Algorithm部分(包括付费题目)总共585题。&/b&&/p&&p&&b&// As of the moment 10:33, , there're altogether 585 problems in the Algorithm section of Leetcode.&/b&&/p&
写在开头:我作为一个老实人,一向非常反感骗赞、收智商税两种行为。前几天看到不止两三位用户说自己辛苦写了干货,结果收藏数是点赞数的三倍有余,感觉自己的无偿付出连认同都得不到,很是失望。明白人都知道这是潜水伸手党的锅。但同时,截止写这段话时,…
这个系列视频讲得比较全了,都是动画演示,非常直观。自己按需观看吧:&br&视频地址:&a href=&///?target=http%3A///video/av6731067/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&【双语字幕】「线性代数的本质」合集&i class=&icon-external&&&/i&&/a&&br&内容目录:&br&&blockquote&第零讲:序言&br&第一讲:向量究竟是什么&br&第二讲:线性组合、张成的空间与基&br&第三讲:矩阵与线性变换&br&第四讲:矩阵乘法与线性变换的复合&br&第四讲附注:三维空间中的线性变换&br&第五讲:行列式的意义&br&第六讲:逆矩阵、列空间与零空间&br&第六讲附注:非方阵&br&第七讲:点积与对偶性&br&第八讲上:叉积的标准介绍&br&第八讲下:以线性变换的眼光看叉积&br&第九讲:基变换&br&第十讲:特征向量与特征值&br&第十一讲:抽象向量空间&/blockquote&视频原作者:&a href=&///?target=http%3A///& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&3Blue1Brown&i class=&icon-external&&&/i&&/a&(可汗学院的一位教师),字幕中译:&a href=&///?target=http%3A///3557916/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Solara570@Bilibili&i class=&icon-external&&&/i&&/a&&br&&img src=&/v2-f0beda66a5eef93cc47eaa3_b.jpg& data-rawwidth=&4096& data-rawheight=&2304& class=&origin_image zh-lightbox-thumb& width=&4096& data-original=&/v2-f0beda66a5eef93cc47eaa3_r.jpg&&&br&原作者3Blue1Brown最近在Patreon上发起众筹,说如果获得足够多的资助,他就可以辞去工作,全职做这类视频,以每月两部的速度发布。计划要做的视频系列包括「微积分的本质」「概率的本质」「实分析的本质」「复分析的本质」「常微分方程的本质」等等,此外还会经常制作像「&a href=&///?target=http%3A///video/av6385842/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&最速降线问题&i class=&icon-external&&&/i&&/a&」「&a href=&///?target=http%3A///video/av4201747/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&希尔伯特曲线&i class=&icon-external&&&/i&&/a&」那样的单个视频。目前他正开始着手制作「微积分的本质」系列,凡是在Patreon上资助了他的人可以抢先看,不必等到整个系列制作完毕。&br&&br&资助网址是:&a href=&///?target=https%3A///3blue1brown& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&https://www.&/span&&span class=&visible&&/3blue1brown&/span&&span class=&invisible&&&/span&&i class=&icon-external&&&/i&&/a& ,诸位若有条件不妨去支持一下。最低额度只要1美元/个视频,就能优先观看今后制作的所有「XX的本质」系列视频。(刚发现,Minecraft的作者Markus Persson赫然出现在资助者名单中……)&br&&br&另外还有个好消息:应B站几位字幕译者的邀请,3Blue1Brown本人已同意在B站设立官方账号:&a href=&///?target=http%3A///& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&3Blue1Brown @ Bilibili&i class=&icon-external&&&/i&&/a&,今后他在Youtube发布的精彩视频都会在B站上持续发布中文字幕版,大家可以去B站关注和支持。
这个系列视频讲得比较全了,都是动画演示,非常直观。自己按需观看吧: 视频地址: 内容目录: 第零讲:序言 第一讲:向量究竟是什么 第二讲:线性组合、张成的空间与基 第三讲:矩阵与线性变换 第四讲:矩阵乘法与线性…
&img src=&/50/d86a52caeaa909e86ee9_b.jpg& data-rawwidth=&520& data-rawheight=&403& class=&origin_image zh-lightbox-thumb& width=&520& data-original=&/50/d86a52caeaa909e86ee9_r.jpg&&&p&作
昊&/p&&p&知
乎:Heinrich&/p&&p&微
博:@花生油工人 &/p&&p&知乎专栏:与时间无关的故事&/p&&p&谨以此文献给大连海事大学的吴楠老师,柳晓鸣老师,王新年老师以及张晶泊老师。&/p&&p&&b&转载的同学请保留上面这句话,谢谢。如果还能保留文章来源就更感激不尽了。&/b&&/p&&br&&p&——更新于,想直接看更新的同学可以直接跳到第四章————&/p&&p&我保证这篇文章和你以前看过的所有文章都不同,这是12年还在果壳的时候写的,但是当时没有来得及写完就出国了……于是拖了两年,嗯,我是拖延症患者……&/p&&p&这篇文章的核心思想就是:&/p&&h2&要让读者在不看任何数学公式的情况下理解傅里叶分析。&/h2&&p&傅里叶分析不仅仅是一个数学工具,更是一种可以彻底颠覆一个人以前世界观的思维模式。但不幸的是,傅里叶分析的公式看起来太复杂了,所以很多大一新生上来就懵圈并从此对它深恶痛绝。老实说,这么有意思的东西居然成了大学里的杀手课程,不得不归咎于编教材的人实在是太严肃了。(您把教材写得好玩一点会死吗?会死吗?)所以我一直想写一个有意思的文章来解释傅里叶分析,有可能的话高中生都能看懂的那种。所以,不管读到这里的您从事何种工作,我保证您都能看懂,并且一定将体会到通过傅里叶分析看到世界另一个样子时的快感。至于对于已经有一定基础的朋友,也希望不要看到会的地方就急忙往后翻,仔细读一定会有新的发现。&/p&&p&————以上是定场诗————&/p&&p&下面进入正题:&/p&&p&抱歉,还是要啰嗦一句:其实学习本来就不是易事,我写这篇文章的初衷也是希望大家学习起来更加轻松,充满乐趣。但是千万!千万不要把这篇文章收藏起来,或是存下地址,心里想着:以后有时间再看。这样的例子太多了,也许几年后你都没有再打开这个页面。无论如何,耐下心,读下去。这篇文章要比读课本要轻松、开心得多……&/p&&p&p.s.本文无论是cos还是sin,都统一用“正弦波”(Sine Wave)一词来代表简谐波。&/p&&h2&一、什么是频域&/h2&&p&从我们出生,我们看到的世界都以时间贯穿,股票的走势、人的身高、汽车的轨迹都会随着时间发生改变。这种以时间作为参照来观察动态世界的方法我们称其为时域分析。而我们也想当然的认为,世间万物都在随着时间不停的改变,并且永远不会静止下来。但如果我告诉你,用另一种方法来观察世界的话,你会发现&u&世界是永恒不变的&/u&,你会不会觉得我疯了?我没有疯,这个静止的世界就叫做频域。&/p&&p&先举一个&u&&b&公式上并非很恰当&/b&&/u&,但意义上再贴切不过的例子:&/p&&p&在你的理解中,一段音乐是什么呢?&/p&&img src=&/50/2caa1b75825_b.jpg& data-rawwidth=&800& data-rawheight=&270& class=&origin_image zh-lightbox-thumb& width=&800& data-original=&/50/2caa1b75825_r.jpg&&&br&&br&&p&这是我们对音乐最普遍的理解,一个随着时间变化的震动。但我相信对于乐器小能手们来说,音乐更直观的理解是这样的:&/p&&p&&img src=&/50/8e1fce9d7607d97cebf73e1f36f03f06_b.jpg& data-rawwidth=&800& data-rawheight=&272& class=&origin_image zh-lightbox-thumb& width=&800& data-original=&/50/8e1fce9d7607d97cebf73e1f36f03f06_r.jpg&&&br&好的!下课,同学们再见。&/p&&p&是的,其实这一段写到这里已经可以结束了。上图是音乐在时域的样子,而下图则是音乐在频域的样子。所以频域这一概念对大家都从不陌生,只是从来没意识到而已。&/p&&p&现在我们可以回过头来重新看看一开始那句痴人说梦般的话:世界是永恒的。&/p&&p&将以上两图简化:&/p&&p&时域:&br&&/p&&p&&img src=&/50/d4fa1de41ac84a56e432_b.jpg& data-rawwidth=&800& data-rawheight=&440& class=&origin_image zh-lightbox-thumb& width=&800& data-original=&/50/d4fa1de41ac84a56e432_r.jpg&&&br&频域:&/p&&img src=&/50/1ca366b593d877a16c8ab9_b.jpg& data-rawwidth=&137& data-rawheight=&199& class=&content_image& width=&137&&&br&&p&在时域,我们观察到钢琴的琴弦一会上一会下的摆动,就如同一支股票的走势;而在频域,只有那一个永恒的音符。&/p&&p&所以&/p&&h2&你眼中看似落叶纷飞变化无常的世界,实际只是躺在上帝怀中一份早已谱好的乐章。&/h2&&p&抱歉,这不是一句鸡汤文,而是黑板上确凿的公式:傅里叶同学告诉我们,任何周期函数,都可以看作是不同振幅,不同相位正弦波的叠加。在第一个例子里我们可以理解为,利用对不同琴键不同力度,不同时间点的敲击,可以组合出任何一首乐曲。&/p&&p&而贯穿时域与频域的方法之一,就是传中说的傅里叶分析。傅里叶分析可分为傅里叶级数(Fourier Serie)和傅里叶变换(Fourier Transformation),我们从简单的开始谈起。&/p&&h2&二、傅里叶级数(Fourier Series)的频谱&/h2&&p&还是举个栗子并且有图有真相才好理解。&/p&&p&如果我说我能用前面说的正弦曲线波叠加出一个带90度角的矩形波来,你会相信吗?你不会,就像当年的我一样。但是看看下图:&br&&img src=&/50/055bf33bbc5dbeb75dd9_b.jpg& data-rawwidth=&800& data-rawheight=&616& class=&origin_image zh-lightbox-thumb& width=&800& data-original=&/50/055bf33bbc5dbeb75dd9_r.jpg&&&br&&br&&/p&&p&第一幅图是一个郁闷的正弦波cos(x)&/p&&p&第二幅图是2个卖萌的正弦波的叠加cos(x)+a.cos(3x)&/p&&p&第三幅图是4个发春的正弦波的叠加&/p&&p&第四幅图是10个便秘的正弦波的叠加&/p&&p&随着正弦波数量逐渐的增长,他们最终会叠加成一个标准的矩形,大家从中体会到了什么道理?&/p&&p&(只要努力,弯的都能掰直!)&/p&&p&随着叠加的递增,所有正弦波中上升的部分逐渐让原本缓慢增加的曲线不断变陡,而所有正弦波中下降的部分又抵消了上升到最高处时继续上升的部分使其变为水平线。一个矩形就这么叠加而成了。但是要多少个正弦波叠加起来才能形成一个标准90度角的矩形波呢?不幸的告诉大家,答案是无穷多个。(上帝:我能让你们猜着我?)&/p&&p&不仅仅是矩形,你能想到的任何波形都是可以如此方法用正弦波叠加起来的。这是没&br&有接触过傅里叶分析的人在直觉上的第一个难点,但是一旦接受了这样的设定,游戏就开始有意思起来了。&/p&&p&还是上图的正弦波累加成矩形波,我们换一个角度来看看:&/p&&img src=&/50/563deb4aba_b.jpg& data-rawwidth=&800& data-rawheight=&1289& class=&origin_image zh-lightbox-thumb& width=&800& data-original=&/50/563deb4aba_r.jpg&&&br&&p&在这几幅图中,最前面黑色的线就是所有正弦波叠加而成的总和,也就是越来越接近矩形波的那个图形。而后面依不同颜色排列而成的正弦波就是组合为矩形波的各个分量。这些正弦波按照频率从低到高从前向后排列开来,而每一个波的振幅都是不同的。一定有细心的读者发现了,每两个正弦波之间都还有一条直线,那并不是分割线,而是振幅为0的正弦波!也就是说,为了组成特殊的曲线,有些正弦波成分是不需要的。&br&&/p&&p&这里,不同频率的正弦波我们成为频率分量。&/p&&p&好了,关键的地方来了!!&/p&&p&如果我们把第一个频率最低的频率分量看作“1”,我们就有了构建频域的最基本单元。&/p&&p&对于我们最常见的有理数轴,数字“1”就是有理数轴的基本单元。&/p&&p&时域的基本单元就是“1秒”,如果我们将一个角频率为&img src=&/equation?tex=%5Comega_%7B0%7D+& alt=&\omega_{0} & eeimg=&1&&的正弦波cos(&img src=&/equation?tex=%5Comega_%7B0%7D+& alt=&\omega_{0} & eeimg=&1&&t)看作基础,那么频域的基本单元就是&img src=&/equation?tex=%5Comega_%7B0%7D+& alt=&\omega_{0} & eeimg=&1&&。&/p&&p&有了“1”,还要有“0”才能构成世界,那么频域的“0”是什么呢?cos(0t)就是一个周期无限长的正弦波,也就是一条直线!所以在频域,0频率也被称为直流分量,在傅里叶级数的叠加中,它仅仅影响全部波形相对于数轴整体向上或是向下而不改变波的形状。&/p&&p&接下来,让我们回到初中,回忆一下已经死去的八戒,啊不,已经死去的老师是怎么定义正弦波的吧。&/p&&img src=&/50/81cac162c2d76df75a6690a_b.jpg& data-rawwidth=&560& data-rawheight=&201& class=&origin_image zh-lightbox-thumb& width=&560& data-original=&/50/81cac162c2d76df75a6690a_r.jpg&&&br&&p&正弦波就是一个圆周运动在一条直线上的投影。所以频域的基本单元也可以理解为一个始终在旋转的圆&img src=&/50/e15e1db741930_b.jpg& data-rawwidth=&256& data-rawheight=&256& class=&content_image& width=&256&&&br&&/p&&p&知乎不能传动态图真是太让人惋惜了……&/p&&p&想看动图的同学请戳这里:&/p&&p&&a href=&/?target=http%3A//en.wikipedia.org/wiki/File%3AFourier_series_square_wave_circles_animation.gif& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&File:Fourier series square wave circles animation.gif&i class=&icon-external&&&/i&&/a&&/p&&p&以及这里:&/p&&p&&a href=&/?target=http%3A//en.wikipedia.org/wiki/File%3AFourier_series_sawtooth_wave_circles_animation.gif& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&File:Fourier series sawtooth wave circles animation.gif&i class=&icon-external&&&/i&&/a&&/p&&p&点出去的朋友不要被wiki拐跑了,wiki写的哪有这里的文章这么没节操是不是。&/p&&p&介绍完了频域的基本组成单元,我们就可以看一看一个矩形波,在频域里的另一个模样了:&/p&&p&&img src=&/50/e2e3c0af3bdbcba721cda9e_b.jpg& data-rawwidth=&800& data-rawheight=&567& class=&origin_image zh-lightbox-thumb& width=&800& data-original=&/50/e2e3c0af3bdbcba721cda9e_r.jpg&&&br&这是什么奇怪的东西?&/p&&p&这就是矩形波在频域的样子,是不是完全认不出来了?教科书一般就给到这里然后留给了读者无穷的遐想,以及无穷的吐槽,其实教科书只要补一张图就足够了:频域图像,也就是俗称的频谱,就是——&/p&&img src=&/50/bd33d94e2fc8b174f0d14ab_b.jpg& data-rawwidth=&800& data-rawheight=&360& class=&origin_image zh-lightbox-thumb& width=&800& data-original=&/50/bd33d94e2fc8b174f0d14ab_r.jpg&&&br&&br&&p&再清楚一点:&br&&img src=&/50/40cf849e55edd_b.jpg& data-rawwidth=&800& data-rawheight=&481& class=&origin_image zh-lightbox-thumb& width=&800& data-original=&/50/40cf849e55edd_r.jpg&&可以发现,在频谱中,偶数项的振幅都是0,也就对应了图中的彩色直线。振幅为0的正弦波。&br&&/p&&p&动图请戳:&/p&&p&&a href=&/?target=http%3A//en.wikipedia.org/wiki/File%3AFourier_series_and_transform.gif& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&File:Fourier series and transform.gif&i class=&icon-external&&&/i&&/a&&/p&&p&老实说,在我学傅里叶变换时,维基的这个图还没有出现,那时我就想到了这种表达方法,而且,后面还会加入维基没有表示出来的另一个谱——相位谱。&/p&&p&但是在讲相位谱之前,我们先回顾一下刚刚的这个例子究竟意味着什么。记得前面说过的那句“世界是静止的”吗?估计好多人对这句话都已经吐槽半天了。想象一下,世界上每一个看似混乱的表象,实际都是一条时间轴上不规则的曲线,但实际这些曲线都是由这些无穷无尽的正弦波组成。我们看似不规律的事情反而是规律的正弦波在时域上的投影,而正弦波又是一个旋转的圆在直线上的投影。那么你的脑海中会产生一个什么画面呢?&/p&&br&&p&我们眼中的世界就像皮影戏的大幕布,幕布的后面有无数的齿轮,大齿轮带动小齿轮,小齿轮再带动更小的。在最外面的小齿轮上有一个小人——那就是我们自己。我们只看到这个小人毫无规律的在幕布前表演,却无法预测他下一步会去哪。而幕布后面的齿轮却永远一直那样不停的旋转,永不停歇。这样说来有些宿命论的感觉。说实话,这种对人生的描绘是我一个朋友在我们都是高中生的时候感叹的,当时想想似懂非懂,直到有一天我学到了傅里叶级数……&/p&&h2&三、傅里叶级数(Fourier Series)的相位谱&/h2&&p&&u&上一章的关键词是:从侧面看。这一章的关键词是:从下面看。&/u&&/p&&p&在这一章最开始,我想先回答很多人的一个问题:傅里叶分析究竟是干什么用的?这段相对比较枯燥,已经知道了的同学可以直接跳到下一个分割线。&/p&&p&先说一个最直接的用途。无论听广播还是看电视,我们一定对一个词不陌生——频道。频道频道,就是频率的通道,不同的频道就是将不同的频率作为一个通道来进行信息传输。下面大家尝试一件事:&/p&&p&先在纸上画一个sin(x),不一定标准,意思差不多就行。不是很难吧。&/p&&p&好,接下去画一个sin(3x)+sin(5x)的图形。&/p&&p&别说标准不标准了,曲线什么时候上升什么时候下降你都不一定画的对吧?&/p&&p&好,画不出来不要紧,我把sin(3x)+sin(5x)的曲线给你,但是前提是你不知道这个曲线的方程式,现在需要你把sin(5x)给我从图里拿出去,看看剩下的是什么。这基本是不可能做到的。&/p&&p&但是在频域呢?则简单的很,无非就是几条竖线而已。&/p&&p&所以很多在时域看似不可能做到的数学操作,在频域相反很容易。这就是需要傅里叶变换的地方。尤其是从某条曲线中去除一些特定的频率成分,这在工程上称为滤波,是信号处理最重要的概念之一,只有在频域才能轻松的做到。&/p&&p&再说一个更重要,但是稍微复杂一点的用途——求解微分方程。(这段有点难度,看不懂的可以直接跳过这段)微分方程的重要性不用我过多介绍了。各行各业都用的到。但是求解微分方程却是一件相当麻烦的事情。因为除了要计算加减乘除,还要计算微分积分。而傅里叶变换则可以让微分和积分在频域中变为乘法和除法,大学数学瞬间变小学算术有没有。&/p&&p&傅里叶分析当然还有其他更重要的用途,我们随着讲随着提。&/p&&p&————————————————————————————————————&/p&&p&下面我们继续说相位谱:&/p&&p&通过时域到频域的变换,我们得到了一个从侧面看的频谱,但是这个频谱并没有包含时域中全部的信息。因为频谱只代表每一个对应的正弦波的振幅是多少,而没有提到相位。基础的正弦波A.sin(wt+θ)中,振幅,频率,相位缺一不可,不同相位决定了波的位置,所以对于频域分析,仅仅有频谱(振幅谱)是不够的,我们还需要一个相位谱。那么这个相位谱在哪呢?我们看下图,这次为了避免图片太混论,我们用7个波叠加的图。&/p&&img src=&/50/01dc098e26a_b.jpg& data-rawwidth=&800& data-rawheight=&856& class=&origin_image zh-lightbox-thumb& width=&800& data-original=&/50/01dc098e26a_r.jpg&&&br&&p&鉴于正弦波是周期的,我们需要设定一个用来标记正弦波位置的东西。在图中就是那些小红点。小红点是距离频率轴最近的波峰,而这个波峰所处的位置离频率轴有多远呢?为了看的更清楚,我们将红色的点投影到下平面,投影点我们用粉色点来表示。当然,这些粉色的点只标注了波峰距离频率轴的距离,并不是相位。&br&&/p&&p&&img src=&/50/ea7b14d1fc7e11d322fcb_b.jpg& data-rawwidth=&800& data-rawheight=&758& class=&origin_image zh-lightbox-thumb& width=&800& data-original=&/50/ea7b14d1fc7e11d322fcb_r.jpg&&&br&这里需要纠正一个概念:时间差并不是相位差。如果将全部周期看作2Pi或者360度的话,相位差则是时间差在一个周期中所占的比例。我们将时间差除周期再乘2Pi,就得到了相位差。&/p&&p&在完整的立体图中,我们将投影得到的时间差依次除以所在频率的周期,就得到了最下面的相位谱。所以,频谱是从侧面看,相位谱是从下面看。下次偷看女生裙底被发现的话,可以告诉她:“对不起,我只是想看看你的相位谱。”&/p&&p&注意到,相位谱中的相位除了0,就是Pi。因为cos(t+Pi)=-cos(t),所以实际上相位为Pi的波只是上下翻转了而已。对于周期方波的傅里叶级数,这样的相位谱已经是很简单的了。另外值得注意的是,由于cos(t+2Pi)=cos(t),所以相位差是周期的,pi和3pi,5pi,7pi都是相同的相位。人为定义相位谱的值域为(-pi,pi],所以图中的相位差均为Pi。&br&&/p&&p&最后来一张大集合:&/p&&img src=&/50/77bab880cd55b6846f12_b.jpg& data-rawwidth=&800& data-rawheight=&663& class=&origin_image zh-lightbox-thumb& width=&800& data-original=&/50/77bab880cd55b6846f12_r.jpg&&&h2&&b&四、傅里叶变换(Fourier Transformation)&/b&&/h2&&p&相信通过前面三章,大家对频域以及傅里叶级数都有了一个全新的认识。但是文章在一开始关于钢琴琴谱的例子我曾说过,这个栗子是一个公式错误,但是概念典型的例子。所谓的公式错误在哪里呢?&br&&/p&&p&傅里叶级数的本质是将一个周期的信号分解成无限多分开的(离散的)正弦波,但是宇宙似乎并不是周期的。曾经在学数字信号处理的时候写过一首打油诗:&/p&&h3&往昔连续非周期,&/h3&&h3&回忆周期不连续,&/h3&&h3&任你ZT、DFT,&/h3&&h3&还原不回去。&/h3&&p&(请无视我渣一样的文学水平……)&/p&&p&在这个世界上,有的事情一期一会,永不再来,并且时间始终不曾停息地将那些刻骨铭心的往昔连续的标记在时间点上。但是这些事情往往又成为了我们格外宝贵的回忆,在我们大脑里隔一段时间就会周期性的蹦出来一下,可惜这些回忆都是零散的片段,往往只有最幸福的回忆,而平淡的回忆则逐渐被我们忘却。因为,往昔是一个连续的非周期信号,而回忆是一个周期离散信号。&/p&&p&是否有一种数学工具将连续非周期信号变换为周期离散信号呢?抱歉,真没有。&/p&&br&&p&比如傅里叶级数,在时域是一个周期且连续的函数,而在频域是一个非周期离散的函数。这句话比较绕嘴,实在看着费事可以干脆回忆第一章的图片。&/p&&p&而在我们接下去要讲的傅里叶变换,则是将一个时域非周期的连续信号,转换为一个在频域非周期的连续信号。&/p&&p&算了,还是上一张图方便大家理解吧:&/p&&p&&img src=&/50/419cd0b2e965aca25d5f8a5a_b.jpg& data-rawwidth=&800& data-rawheight=&399& class=&origin_image zh-lightbox-thumb& width=&800& data-original=&/50/419cd0b2e965aca25d5f8a5a_r.jpg&&&br&或者我们也可以换一个角度理解:傅里叶变换实际上是对一个周期无限大的函数进行傅里叶变换。&/p&&p&所以说,钢琴谱其实并非一个连续的频谱,而是很多在时间上离散的频率,但是这样的一个贴切的比喻真的是很难找出第二个来了。&/p&&p&因此在傅里叶变换在频域上就从离散谱变成了连续谱。那么连续谱是什么样子呢?&/p&&h2&&b&你见过大海么?&/b&&/h2&&p&为了方便大家对比,我们这次从另一个角度来看频谱,还是傅里叶级数中用到最多的那幅图,我们从频率较高的方向看。&/p&&p&&img src=&/50/a185beacc5372_b.jpg& data-rawwidth=&800& data-rawheight=&383& class=&origin_image zh-lightbox-thumb& width=&800& data-original=&/50/a185beacc5372_r.jpg&&&br&以上是离散谱,那么连续谱是什么样子呢?&/p&&p&尽情的发挥你的想象,想象这些离散的正弦波离得越来越近,逐渐变得连续……&/p&&p&直到变得像波涛起伏的大海:&/p&&br&&img src=&/50/ece53f825c6de629befba3de12f929a7_b.jpg& data-rawwidth=&800& data-rawheight=&422& class=&origin_image zh-lightbox-thumb& width=&800& data-original=&/50/ece53f825c6de629befba3de12f929a7_r.jpg&&&br&&p&很抱歉,为了能让这些波浪更清晰的看到,我没有选用正确的计算参数,而是选择了一些让图片更美观的参数,不然这图看起来就像屎一样了。&/p&&p&不过通过这样两幅图去比较,大家应该可以理解如何从离散谱变成了连续谱的了吧?原来离散谱的叠加,变成了连续谱的累积。所以在计算上也从求和符号变成了积分符号。&/p&&p&不过,这个故事还没有讲完,接下去,我保证让你看到一幅比上图更美丽壮观的图片,但是这里需要介绍到一个数学工具才能然故事继续,这个工具就是——&/p&&h2&五、宇宙耍帅第一公式:欧拉公式&/h2&&p&虚数i这个概念大家在高中就接触过,但那时我们只知道它是-1的平方根,可是它真正的意义是什么呢?&/p&&p&&img src=&/50/42e1f6dc43eba389a5df4_b.jpg& data-rawwidth=&800& data-rawheight=&160& class=&origin_image zh-lightbox-thumb& width=&800& data-original=&/50/42e1f6dc43eba389a5df4_r.jpg&&这里有一条数轴,在数轴上有一个红色的线段,它的长度是1。当它乘以3的时候,它的长度发生了变化,变成了蓝色的线段,而当它乘以-1的时候,就变成了绿色的线段,或者说线段在数轴上围绕原点旋转了180度。&br&&/p&&p&我们知道乘-1其实就是乘了两次 i使线段旋转了180度,那么乘一次 i 呢——答案很简单——旋转了90度。&/p&&p&&img src=&/50/3e88eebdda51dee88358_b.jpg& data-rawwidth=&600& data-rawheight=&342& class=&origin_image zh-lightbox-thumb& width=&600& data-original=&/50/3e88eebdda51dee88358_r.jpg&&&br&同时,我们获得了一个垂直的虚数轴。实数轴与虚数轴共同构成了一个复数的平面,也称复平面。这样我们就了解到,乘虚数i的一个功能——旋转。&/p&&p&现在,就有请宇宙第一耍帅公式欧拉公式隆重登场——&/p&&p&&img src=&/50/ac148a3bb2_b.jpg& data-rawwidth=&161& data-rawheight=&20& class=&content_image& width=&161&&这个公式在数学领域的意义要远大于傅里叶分析,但是乘它为宇宙第一耍帅公式是因为它的特殊形式——当x等于Pi的时候。&/p&&p&&img src=&/50/57aabba66d545ab5a864cd_b.jpg& data-rawwidth=&93& data-rawheight=&20& class=&content_image& width=&93&&经常有理工科的学生为了跟妹子表现自己的学术功底,用这个公式来给妹子解释数学之美:”石榴姐你看,这个公式里既有自然底数e,自然数1和0,虚数i还有圆周率pi,它是这么简洁,这么美丽啊!“但是姑娘们心里往往只有一句话:”臭屌丝……“&/p&&p&这个公式关键的作用,是将正弦波统一成了简单的指数形式。我们来看看图像上的涵义:&/p&&p&&img src=&/50/974efc6a99e06dcdccbe93_b.jpg& data-rawwidth=&800& data-rawheight=&399& class=&origin_image zh-lightbox-thumb& width=&800& data-original=&/50/974efc6a99e06dcdccbe93_r.jpg&&&br&欧拉公式所描绘的,是一个随着时间变化,在复平面上做圆周运动的点,随着时间的改变,在时间轴上就成了一条螺旋线。如果只看它的实数部分,也就是螺旋线在左侧的投影,就是一个最基础的余弦函数。而右侧的投影则是一个正弦函数。&/p&&p&关于复数更深的理解,大家可以参考:&/p&&p&&a href=&/question//answer/& class=&internal&&复数的物理意义是什么?&/a&&br&&/p&&p&这里不需要讲的太复杂,足够让大家理解后面的内容就可以了。&/p&&h2&&b&六、指数形式的傅里叶变换&/b&&/h2&&p&有了欧拉公式的帮助,我们便知道:&b&正弦波的叠加&/b&,也可以理解为&b&螺旋线的叠加&/b&在实数空间的投影。而螺旋线的叠加如果用一个形象的栗子来理解是什么呢?&/p&&p&&b&光波&/b&&/p&&p&高中时我们就学过,自然光是由不同颜色的光叠加而成的,而最著名的实验就是牛顿师傅的三棱镜实验:&/p&&p&&img src=&/50/c2d7bfc819ebcbea8d6f2cd_b.jpg& data-rawwidth=&277& data-rawheight=&174& class=&content_image& width=&277&&&br&所以其实我们在很早就接触到了光的频谱,只是并没有了解频谱更重要的意义。&/p&&p&但不同的是,傅里叶变换出来的频谱不仅仅是可见光这样频率范围有限的叠加,而是频率从0到无穷所有频率的组合。&/p&&br&&p&这里,我们可以用两种方法来理解正弦波:&/p&&p&第一种前面已经讲过了,就是螺旋线在实轴的投影。&/p&&p&另一种需要借助欧拉公式的另一种形式去理解:&/p&&img src=&/equation?tex=e%5E%7Bit%7D%3Dcos%28t%29%2Bi.sin%28t%29& alt=&e^{it}=cos(t)+i.sin(t)& eeimg=&1&&&br&&img src=&/equation?tex=e%5E%7B-it%7D%3Dcos%28t%29-i.sin%28t%29& alt=&e^{-it}=cos(t)-i.sin(t)& eeimg=&1&&&br&&p&将以上两式相加再除2,得到:&/p&&img src=&/equation?tex=cos%28t%29%3D%5Cfrac%7Be%5E%7Bit%7D%2Be%5E%7B-it%7D%7D%7B2%7D+& alt=&cos(t)=\frac{e^{it}+e^{-it}}{2} & eeimg=&1&&&br&&p&这个式子可以怎么理解呢?&/p&&p&我们刚才讲过,e^(it)可以理解为一条逆时针旋转的螺旋线,那么e^(-it)则可以理解为一条顺时针旋转的螺旋线。而cos(t)则是这两条旋转方向不同的螺旋线叠加的一半,因为这两条螺旋线的虚数部分相互抵消掉了!&/p&&p&举个例子的话,就是极化方向不同的两束光波,磁场抵消,电场加倍。&/p&&p&这里,逆时针旋转的我们称为正频率,而顺时针旋转的我们称为负频率(注意不是复频率)。&/p&&br&&p&好了,刚才我们已经看到了大海——连续的傅里叶变换频谱,现在想一想,连续的螺旋线会是什么样子:&/p&&p&想象一下再往下翻:&/p&&p&|&/p&&p&|&br&&/p&&p&|&br&&/p&&p&|&br&&/p&&p&|&br&&/p&&p&|&br&&/p&&p&|&br&&/p&&p&|&br&&/p&&p&|&br&&/p&&p&&img src=&/50/f116ae26859bdc80b28ea0f8f894ccc0_b.jpg& data-rawwidth=&800& data-rawheight=&620& class=&origin_image zh-lightbox-thumb& width=&800& data-original=&/50/f116ae26859bdc80b28ea0f8f894ccc0_r.jpg&&&br&是不是很漂亮?&/p&&p&你猜猜,这个图形在时域是什么样子?&/p&&p&&img src=&/50/0fdfa0a9b6eeac_b.jpg& data-rawwidth=&800& data-rawheight=&628& class=&origin_image zh-lightbox-thumb& width=&800& data-original=&/50/0fdfa0a9b6eeac_r.jpg&&&br&哈哈,是不是觉得被狠狠扇了一个耳光。数学就是这么一个把简单的问题搞得很复杂的东西。&/p&&p&顺便说一句,那个像大海螺一样的图,为了方便观看,我仅仅展示了其中正频率的部分,负频率的部分没有显示出来。&/p&&p&如果你认真去看,海螺图上的每一条螺旋线都是可以清楚的看到的,每一条螺旋线都有着不同的振幅(旋转半径),频率(旋转周期)以及相位。而将所有螺旋线连成平面,就是这幅海螺图了。&/p&&br&&p&好了,讲到这里,相信大家对傅里叶变换以及傅里叶级数都有了一个形象的理解了,我们最后用一张图来总结一下:&/p&&img src=&/50/097cf436a72_b.jpg& data-rawwidth=&600& data-rawheight=&980& class=&origin_image zh-lightbox-thumb& width=&600& data-original=&/50/097cf436a72_r.jpg&&&p&好了,傅里叶的故事终于讲完了,下面来讲讲我的故事:&/p&&br&&p&这篇文章第一次被写下来的地方你们绝对猜不到在哪,是在一张高数考试的卷子上。当时为了刷分,我重修了高数(上),但是后来时间紧压根没复习,所以我就抱着裸考的心态去了考场。但是到了考场我突然意识到,无论如何我都不会比上次考的更好了,所以干脆写一些自己对于数学的想法吧。于是用了一个小时左右的时间在试卷上洋洋洒洒写了本文的第一草稿。&/p&&p&你们猜我的了多少分?&/p&&p&6分&/p&&p&没错,就是这个数字。而这6分的成绩是因为最后我实在无聊,把选择题全部填上了C,应该是中了两道,得到了这宝贵的6分。说真的,我很希望那张卷子还在,但是应该不太可能了。&/p&&p&那么你们猜猜我第一次信号与系统考了多少分呢?&/p&&p&45分&/p&&p&没错,刚刚够参加补考的。但是我心一横没去考,决定重修。因为那个学期在忙其他事情,学习真的就抛在脑后了。但是我知道这是一门很重要的课,无论如何我要吃透它。说真的,信号与系统这门课几乎是大部分工科课程的基础,尤其是通信专业。&/p&&p&在重修的过程中,我仔细分析了每一个公式,试图给这个公式以一个直观的理解。虽然我知道对于研究数学的人来说,这样的学习方法完全没有前途可言,因为随着概念愈加抽象,维度越来越高,这种图像或者模型理解法将完全丧失作用。但是对于一个工科生来说,足够了。&/p&&p&后来来了德国,这边学校要求我重修信号与系统时,我彻底无语了。但是没办法,德国人有时对中国人就是有种藐视,觉得你的教育不靠谱。所以没办法,再来一遍吧。&/p&&p&这次,我考了满分,而及格率只有一半。&/p&&p&老实说,数学工具对于工科生和对于理科生来说,意义是完全不同的。工科生只要理解了,会用,会查,就足够了。但是很多高校却将这些重要的数学课程教给数学系的老师去教。这样就出现一个问题,数学老师讲得天花乱坠,又是推理又是证明,但是学生心里就只有一句话:学这货到底干嘛用的?&/p&&p&缺少了目标的教育是彻底的失败。&/p&&p&在开始学习一门数学工具的时候,学生完全不知道这个工具的作用,现实涵义。而教材上有只有晦涩难懂,定语就二十几个字的概念以及看了就眼晕的公式。能学出兴趣来就怪了!&/p&&p&好在我很幸运,遇到了大连海事大学的吴楠老师。他的课全程来看是两条线索,一条从上而下,一条从下而上。先讲本门课程的意义,然后指出这门课程中会遇到哪样的问题,让学生知道自己学习的某种知识在现实中扮演的角色。然后再从基础讲起,梳理知识树,直到延伸到另一条线索中提出的问题,完美的衔接在一起!&/p&&p&这样的教学模式,我想才是大学里应该出现的。&/p&&p&最后,写给所有给我点赞并留言的同学。真的谢谢大家的支持,也很抱歉不能一一回复。因为知乎专栏的留言要逐次加载,为了看到最后一条要点很多次加载。当然我都坚持看完了,只是没办法一一回复。&/p&&p&本文只是介绍了一种对傅里叶分析新颖的理解方法,对于求学,还是要踏踏实实弄清楚公式和概念,学习,真的没有捷径。但至少通过本文,我希望可以让这条漫长的路变得有意思一些。&/p&&p&最后,祝大家都能在学习中找到乐趣。…&/p&
作 者:韩 昊知 乎:Heinrich微 博:@花生油工人 知乎专栏:与时间无关的故事谨以此文献给大连海事大学的吴楠老师,柳晓鸣老师,王新年老师以及张晶泊老师。转载的同学请保留上面这句话,谢谢。如果还能保留文章来源就更感激不尽了。 ——更新于,…
&p&之前用了两个多月撸完了算法导论,每天3小时左右。把其中的伪代码用Python实现了一遍,代码在这里&a href=&///?target=https%3A///gycg/Algorithm& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&https://&/span&&span class=&visible&&/gycg/Algorit&/span&&span class=&invisible&&hm&/span&&span class=&ellipsis&&&/span&&i class=&icon-external&&&/i&&/a&。伪代码转换成Python还是比较容易的,一行一行翻译,写完运行一下,不懂的地方改一改,试一试,有助于理解算法思路。&/p&&p&其实算法本身不难,第一遍可以只看伪代码和算法思路。如果想进一步理解的话,第三章那些标记法是非常重要的,就算要花费大量时间才能理解,也不要马马虎虎略过。因为以后的每一章,讲完算法就是这样的分析,精通的话,很快就读完了。你所说的证明和推导大概也都是在第三章介绍了,可以回过头再认真看几遍。&/p&&p&至于课后题,比较难,我只做了前几章,如果要做完需要更多时间和精力。这可以通过之后做算法题来弥补,可以去leetcode等网站找一些经典的算法题做一做,加深理解。&/p&&p&这里有一个Facebook的工程师写的攻略,介绍了用算法导论来应付面试应该读哪些,略过哪些,英文的,可以作为参考:(剩下的可以收藏慢慢看,顺便点个赞 谢谢!)&/p&&blockquote&&h2&&b&Chapter 1&/b&&/h2&Interesting read, but you can skip it.&br&&br&&h2&Chapter 2&/h2&&b&2.1 &/b&Insertion
Sort - To be honest you should probably know all major sorting
algorithms, not just insertion sort. It's just basic knowledge and you
never know when it can help.&br&&b&2.2 &/b&Analysis of Algorithms - you can skip the small intro, but know the rest.&br&&b&2.3 &/b&Designing
algorithms - contains merge sort and its analysis as well as an
overview of divide-and-conquer, very important stuff, so worth a read.&br&&br&&h2&Chapter 3&/h2&All of it. You have to know big-O notation and time complexity analysis, period.&br&&br&&h2&Chapter 4&/h2&&b&4.1 &/b&Maximum
subarray problem - Can kind of be worth your time. There are better
solutions to this problem than divide and conquer but it's good practice
and the flow of logic may help develop how you think.&br&&b&4.2 &/b&Strassen's
algorithm - I really love this algorithm and was astounded at how cool
it was the first time I saw it, but you can skip it for the interviews.
It won't come up.&br&&b&4.3 &/b&Substitution method - you won't be using
this method in an interview, but you should know it since it's a basic
tool for finding the time complexity of a recursive algorithm.&br&&b&4.4 &/b&Recurrence tree method - same as 4.3&br&&b&4.5 &/b&Master
method - essential knowledge. You should know it and practice with it
and be able to use it in 3 seconds. This is the method you would use in
an interview if analyzing a recursive algorithm that fits the form.&br&&b&4.6 &/b&Proof
of the master theorem - you can probably skip this, though it's good to
read at least once so that you understand what you're doing with the
master method.&br&&br&&h2&Chapter 5&/h2&I've never read this chapter, to
be honest, but what I know is that you need a basic grasp of
probability in interviews because there's a good chance they may come
up. That said, as long as you know basic probability concepts and
practice on probability-related interview problems (there are such
problems with solution explanations in &a href=&///?target=http%3A///Elements-Programming-Interviews-Insiders-Guide/dp/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Elements of Programming Interviews&i class=&icon-external&&&/i&&/a&,
the book I recommend for interview prep), you can probably skip this
chapter. From a cursory glance, it's more math than algorithms.&br&&br&&h2&Chapter 6&/h2&&b&6.1, 6.2, 6.3, 6.4, 6.5&/b& - Heaps and heapsort. Check.&br&&br&&h2&Chapter 7&/h2&&b&7.1, 7.2, 7.3 - &/b&Quicksort
and its randomized version. Need-to-know concepts. I also recommend 7.4
(I was once asked in an interview to high-level-analyze a randomized
algorithm), though the probability you have to deal with something like
7.4 in an interview is pretty low, I'd guess.&br&&br&&h2&Chapter 8&/h2&&b&8.1 - &/b&Lower
bounds on sorting - Yes. Basic knowledge. May be asked in a Google
interview (though unlikely, I know of a case it happened in before).&br&&b&8.2 - &/b&Counting sort - Need-to-know in detail. It comes up in disguised forms.&br&&b&8.3 - &/b&Radix sort - Yup. It's an easy algorithm anyway.&br&&b&8.4 - &/b&Bucket sort - can skip.&br&&br&&h2&Chapter 9&/h2&&b&9.1 - &/b&Small section, worth a read.&br&&b&9.2 - &/b&Selection in expected linear time - &b&Very &/b&important,
as it's not common knowledge like quicksort and yet it comes up often
in interviews. I had to code the entire thing in an interview once.&br&&b&9.3 - &/b&Selection
in worst-case linear time - Can skip. Just know that it's possible in
worst-case linear time, because that might help somewhat.&br&&br&&h2&Chapter 10&/h2&&b&10.1 - &/b&Stacks and queues - basic knowledge, definitely very important.&br&&b&10.2 - &/b&Linked lists - same as 10.1&br&&b&10.3 - &/b&Implementing pointers and objects - If you use C++ or Java, skip this. Otherwise I'm not sure.&br&&b&10.4 - &/b&Representing rooted trees - Small section, worth a quick read.&br&&br&&h2&Chapter 11&/h2&For
hashing, I'd say the implementation isn't as important to know as, for
example, linked lists, but you should definitely have an idea about it
and most importantly know the (expected and worst-case) time
complexities of search/insert/delete etc. Also know that practically,
they're very important data structures and, also practically, the
expected time complexity is what matters in the real world.&br&&b&11.1 - &/b&Direct addressing - Just understand the idea.&br&&b&11.2 - &/b&Hash tables - important.&br&&b&11.3 - &/b&Hash
functions - it's worth having an idea about them, but I wouldn't go too
in-depth here. Just know a couple examples of good and bad hash
functions (and why they are good/bad).&br&&b&11.4 - &/b&Open addressing - Worth having an idea about, but unlikely to come up.&br&&b&11.5 - &/b&Perfect hashing - skip. &br&&br&&h2&Chapter 12&/h2&&b&12.1 - &/b&What is a binary search tree? - Yep.&br&&b&12.2 - &/b&Querying a BST - Yep. All of it.&br&&b&12.3 - &/b&Insertion/Deletion - Same as 12.2&br&&b&12.4 - &/b&Randomly built BSTs - just know Theorem 12.4 (expected height of random BST is O(lgn)) and an idea of why it's true.&br&&br&&h2&Chapter 13&/h2&This one is easy. Know what a Red-Black tree is, and what its worst-case height/insert/delete/find are. Read &b&13.1 &/b&and &b&13.2&/b&,
and skip the rest. You will never be asked for RB-tree insert/delete
unless the interviewer is &doing it wrong&, or if the interviewer wants
to see if you can re-derive the cases, in which case knowing them won't
help much anyway (and I doubt this would happen anyway). Also know that
RB-trees are pretty space-efficient and some C++ STL containers are
built as RB-trees usually (e.g. map/set).&br&&br&&h2&Chapter 14&/h2&Might be worth skimming &b&14.2 &/b&just
to know that you can augment data structures and why it might be
helpful. Otherwise do one or two simple problems on augmenting data
structures and you're set here. I'd skip &b&14.1 &/b&and &b&14.3&/b&.&br&&br&&h2&&b&Chapter 15&/b&&/h2&DP! Must-know.&br&&b&15.1 - &/b&Rod-cutting. Standard DP problem, must-know.&br&&b&15.2 - &/b&Matrix-chain
multiplication - same as 15.1, though I don't particularly like the way
this section is written (it's rare for me to say that about CLRS).&br&&b&15.3 - &/b&Elements
of DP - worth a read so that you understand DP properly, but I'd say
it's less important than knowing what DP is (via the chapter
introduction) and practicing on it (via the problems in this book and in
interview preparation books).&br&&b&15.4 - &/b&LCS - same as 15.1&br&&b&15.5 - &/b&Optimal binary search trees - I've never read this section, so I can't argue for its importance, but I did fine without it.&br&&br&&h2&Chapter 16&/h2&You should definitely know what a greedy algorithm is, so read the introduction for this chapter.&br&&b&16.1 - &/b&An activity selection problem - Haven't read this in detail, but I'd say check it out, if not in-depth.&br&&b&16.2 - &/b&Elements of the greedy strategy - same as 16.1&br&&b&16.3 - &/b&Huffman
codes - I'd say read the problem and the algorithm, but that's enough.
I've seen interview questions where the answer is Huffman coding (but
the question will come up in a 'disguised form', so it won't be
obvious.)&br&&b&16.4 - &/b&Matroids and greedy methods - I've never read
this section, but I've done a lot of greedy problems during interview
prep and this stuff never came up, so I'd say this section is irrelevant
for the interview.&br&&b&16.5 - &/b&Task-scheduling problem as a matroid - Same as 16.4.&br&&br&&h2&&b&Chapter 17&/b&&/h2&Okay,
you should definitely know what amortized analysis is, but I've never
read it from the book and I feel it's a sufficiently simple concept that
you can just Google it and check a few examples on what it is, or
understand it just by reading section &b&17.1&/b&. So:&br&&b&17.1 - &/b&Aggregate analysis - read this, it explains the important stuff.&br&&b&17.2, 17.3, 17.4 - &/b&Skip.&br&&br&&h2&Chapter 18&/h2&You
should probably have an idea of what B-Trees (and B+ trees) are, I've
heard of cases where candidates were asked about them in a general sense
(high-level questions about what they are and why they're awesome). But
other than that I'd skip this chapter.&br&&br&&h2&Chapter 19&/h2&Fibonacci heaps - nope.&br&&br&&h2&Chapter 20&/h2&van Emde Boas Trees - double, triple, and quadruple nope.&br&&br&&h2&Chapter 21&/h2&Disjoint sets&br&&b&&u&Update:&/u&&/b&
I originally recommended skipping this section, but on reconsideration,
I've noticed that it's actually more important than I originally
thought. Thus, I recommend reading sections &b&21.1 &/b&and &b&21.2&/b&, while skipping the rest.&br&Union-find
is somewhat important and I've seen at least one problem which uses it,
though that problem could also be solved using DFS and connected
components. That said, I also believe that it's not strictly necessary
because one can probably, for interview purposes, come up with a similar
enough structure easily to solve a problem which requires union-find,
without knowing the material in this chapter. However, I believe it's
worth a read so that if a problem comes up whose intended solution is a
union-find data structure, you don't spend time in an interview coming
up with it, and rather know from before, which can be a good advantage.
Still, I'd probably rank it as less important than most of the other
material in this list, and even less than other material that's not even
in CLRS (like tries, for example).&br&&br&Okay, now graph algorithms. First read the introduction. Now, there's a lot to know here, so hang on.&br&&br&&h2&Chapter 22&/h2&&b&22.1 - &/b&Representations of graphs - Yes.&br&&b&22.2 - &/b&BFS - Yes. After you do that, solve this problem: &a href=&///?target=https%3A//icpcarchive.ecs.baylor.edu/index.php%3Foption%3Dcom_onlinejudge%26Itemid%3D8%26category%3D343%26page%3Dshow_problem%26problem%3D2738& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&ACM-ICPC Live Archive - Kermit the Frog&i class=&icon-external&&&/i&&/a&. The whole &state-space search using BFS& thing is an important concept that might be used to solve several interview problems.&br&&b&22.3 - &/b&DFS - Yes.&br&&b&22.4 - &/b&Topological sort - Yes.&br&&b&22.5 - &/b&Strongly connected components - much less likely to come up than the above 4, but still possible, so: Yes.&br&&br&&h2&&b&Chapter 23&/b&&/h2&Minimum
spanning trees - probably the least important graph algorithm, other
than max flow (I mean for interview purposes, of course). I'd still say
you should read it because it's such a well-known problem, but
definitely give priority to the other things.&br&&b&23.1 - &/b&Growing a MST - sort of, yes.&br&&b&23.2 - &/b&Prim and Kruskal's algorithms - sort of, yes.&br&&br&&h2&Chapter 24&/h2&Shortest path algorithms are important, though maybe less so than BFS/DFS.&br&Read
the introduction. You should, in general, read all introductions
anyway, but this one's important (and long), so it warranted a special
note.&br&&b&24.1 &/b&Bellman-Ford - Know the algorithm and its proof of correctness.&br&&b&24.2 &/b&Shortest paths in DAGs - definitely worth knowing, may come up, even more so than Bellman-Ford I'd say.&br&&b&24.3 &/b&Dijkstra's
algorithm - Yes. Of course. I've seen this come up multiple times (with
slight variations), and I've even seen A* come up.&br&&b&24.4 &/b&Difference constraints and shortest paths - Skip.&br&&br&&h2&Chapter 25&/h2&Read the intro as well.&br&&b&25.1 - &/b&Matrix multiplication -I'd
say skip. It might be possible for this to come up
(very very slim
chance that it does though), but the chances are so low in my view that
it's probably not worth it. If you have some extra time, though, give it
a read.&br&&b&25.2 - &/b&Floyd-Warshall - Yep, worth knowing the
algorithm and its time complexity and when it works (which is for all
weighted graphs, except ones with negative weight cycles). Its code is
something like 5 lines so there's no reason not to know it. The analysis
might be a bit overkill though.&br&&b&25.3 - &/b&Johnson's algorithm - Skip.&br&&br&&h2&Chapter 26&/h2&Maximum flow - I've never heard of this coming up in an interview and I can't imagine why it would, so skip.&br&&br&&h2&Chapters 27+&/h2&Most
of this stuff is never going to come up, so it's easier for me to tell
you what to actually read than what not to read, so here are a few
selected topics from the Selected Topics in the book:&br&&br&&b&Chapter 31&/b&&br&Most
of what you should learn from this chapter you can learn from
practicing on interview problems from Elements of Programming Interviews
(and your time is better spent doing that), so I'd say skip it all
except Euclid's algorithm for the GCD, under section &b&31.2&/b&.&br&&br&&b&Chapter 32&/b&&br&&b&32.1 - &/b&Naive method - just read it quickly.&br&&b&32.2 - &/b&Rabin-Karp
- I'd say you should know this, the rolling hash concept is very
important and can be useful in many string- or search-related interview
problems.&br&&br&&h2&Appendices&/h2&&b&A - Summations&/b&&br&Know the important summations for time complexity analysis.&br&&br&&b&C - Counting and Probability&/b&&br&Give &b&C.4&/b&
a read if you don't know the material, Bernoulli trials may come up in
problems (not explicitly, but you might use them, specifically for time
analysis of questions that involve probability/coin flips).&/blockquote&
之前用了两个多月撸完了算法导论,每天3小时左右。把其中的伪代码用Python实现了一遍,代码在这里。伪代码转换成Python还是比较容易的,一行一行翻译,写完运行一下,不懂的地方改一改,试一试,有助于理解算法思路。其实…
补充三个有助于自动化日常工作的:&br&&ul&&li&sh:&a href=&///?target=http%3A//amoffat.github.io/sh/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&sh 1.08 — sh v1.08 documentation&i class=&icon-external&&&/i&&/a&&br&可以用 Python 函数的语法去调用 shell 命令,sh 之于 subprocess 类似 requests 之于 urllib2。&/li&&li&Watchdog:&a href=&///?target=https%3A//pythonhosted.org/watchdog/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Watchdog — watchdog 0.8.0 documentation&i class=&icon-external&&&/i&&/a&&br&监视文件系统改动。&/li&&li&Path:&a href=&///?target=http%3A//pythonhosted.org/path.py/api.html& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&API — path.py 5.2 documentation&i class=&icon-external&&&/i&&/a&&br&简化文件系统相关操作。&/li&&/ul&
补充三个有助于自动化日常工作的: sh: 可以用 Python 函数的语法去调用 shell 命令,sh 之于 subprocess 类似 requests 之于 urllib2。Watchdog: 监视文件系统改动。Path:
&div class=&highlight&&&pre&&code class=&language-text&&$ you-get /6064831.shtml
&/code&&/pre&&/div&&b&&i&you-get!&/i&&/b&&br&YouTube/优酷/土豆/搜狐/bilibili &br&&b&给网址就下视频啊!&/b& 太好用了, 有木有&br&&img src=&/7fb748a2dfcb75c7b3c736_b.png& data-rawwidth=&997& data-rawheight=&659& class=&origin_image zh-lightbox-thumb& width=&997& data-original=&/7fb748a2dfcb75c7b3c736_r.png&&&br&&div class=&highlight&&&pre&&code class=&language-text&&$ pip install you-get
&/code&&/pre&&/div&
$ you-get /6064831.shtmlyou-get! YouTube/优酷/土豆/搜狐/bilibili 给网址就下视频啊! 太好用了, 有木有 $ pip install you-get
&p&1. &a href=&///?target=https%3A///darknessomi/musicbox& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&GitHub - darknessomi/musicbox: 网易云音乐命令行版本&i class=&icon-external&&&/i&&/a&。 高品质网易云音乐命令行版本,简洁优雅,丝般顺滑,基于Python编写。&/p&&p&&img src=&&a href=&///?target=https%3A///3d886ac004acc_b.png& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&https://&/span&&span class=&visible&&/3d886ac0&/span&&span class=&invisible&&04acc_b.png&/span&&span class=&ellipsis&&&/span&&i class=&icon-external&&&/i&&/a&& data-rawwidth=&1330& data-rawheight=&996& class=&content_image& width=&1330& data-original=&&a href=&///?target=https%3A///3d886ac004acc_r.png& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&https://&/span&&span class=&visible&&/3d886ac0&/span&&span class=&invisible&&04acc_r.png&/span&&span class=&ellipsis&&&/span&&i class=&icon-external&&&/i&&/a&&&2. &/p&&p&2. &a href=&///?target=https%3A///wting/autojump& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&GitHub - wting/autojump: A cd command that learns&i class=&icon-external&&&/i&&/a&。 一个文件系统跳转的快捷命令。同样的还有shell编写的 &a href=&///?target=https%3A///rupa/z& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&GitHub - rupa/z: z is the new j, yo&i class=&icon-external&&&/i&&/a&,用了就知道有多提高效率。&/p&&p&3. &a href=&///?target=https%3A///docopt/docopt& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&GitHub - docopt/docopt: Pythonic command line arguments parser, that will make you smile&i class=&icon-external&&&/i&&/a&。上面有人提到了,但是没有人说到精髓,它使用脚本的docstring作为命令行的解析文本,也就是你直接写注释就可以完成argparse复杂的添加选项、指定参数等功能,所见即所得。&/p&&p&4. &a href=&///?target=https%3A///Runscope/httpbin& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&GitHub - Runscope/httpbin: HTTP Request & Response Service, written in Python + Flask.&i class=&icon-external&&&/i&&/a&。我还曾经写过类似的一个应用,那时候还没有遇到它。读它的源码时候发现它其实好几个的地方实现的很优雅。&/p&&p&5. &a href=&///?target=https%3A///Russell91/pythonpy& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&GitHub - Russell91/pythonpy: the swiss army knife of the command line&i class=&icon-external&&&/i&&/a&。有时候我会做一些简单地计算和功能的验证,之前得输入ipython然后imort对应的库,再执行(或者用 python -c ' print aaa.bbb(1)'的方式)。现在用pythonpy,在命令行一句就好了。&/p&&p&6. &a href=&///?target=https%3A///p-e-w/maybe& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&GitHub - p-e-w/maybe: :rabbit2: See what a program does before deciding whether you really want it to happen.&i class=&icon-external&&&/i&&/a&。大家都听过那个著名&a href=&///?target=http%3A///articles/4875.html& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&一个空格引发的惨剧&i class=&icon-external&&&/i&&/a&吧,我以前也发生过本来是要执行「rm -rf tmp/*」, 结果卡了一下,执行成了「rm -rf tmp/ *」的惨痛经历,如果你有用maybe的习惯,就不会发生悲剧啦。&/p&&p&7. &a href=&///?target=https%3A///nvbn/thefuck& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&GitHub - nvbn/thefuck: Magnificent app which corrects your previous console command.&i class=&icon-external&&&/i&&/a& 简直神器,修正你之前的命令行指令。&/p&&p&&img src=&&a href=&///?target=https%3A///07ee85a3d241dbd9f7a55e37914fadf6_b.png& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&https://&/span&&span class=&visible&&/07ee85a3&/span&&span class=&invisible&&d241dbd9f7a55e37914fadf6_b.png&/span&&span class=&ellipsis&&&/span&&i class=&icon-external&&&/i&&/a&& data-rawwidth=&1376& data-rawheight=&752& class=&content_image& width=&1376& data-original=&&a href=&///?target=https%3A///07ee85a3d241dbd9f7a55e37914fadf6_r.png& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&https://&/span&&span class=&visible&&/07ee85a3&/span&&span class=&invisible&&d241dbd9f7a55e37914fadf6_r.png&/span&&span class=&ellipsis&&&/span&&i class=&icon-external&&&/i&&/a&&&8. &/p&&p&8. &a href=&///?target=https%3A///getsentry/sentry& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&GitHub - getsentry/sentry: Sentry is cross-platform crash reporting built with love&i class=&icon-external&&&/i&&/a&。错误搜集系统,现在应该没有哪个公司(不只是Python语言)不用它了吧?&/p&&p&9. &a href=&///?target=https%3A///faif/python-patterns& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&GitHub - faif/python-patterns: A collection of design patterns/idioms in Python&i class=&icon-external&&&/i&&/a&,以前学习设计模式要从很多文章甚至其他语言的版本中去理解,特别苦,直到我发现了这个项目,整个人都不好了。&/p&&p&10. &a href=&///?target=https%3A///jkbrzt/httpie& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&https://&/span&&span class=&visible&&/jkbrzt/httpi&/span&&span class=&invisible&&e&/span&&span class=&ellipsis&&&/span&&i class=&icon-external&&&/i&&/a&。一个命令行HTTP 客户端,cURL 的替代品,它是Python语言中被star数量最多的项目,可见它的受欢迎程度,我几乎每天都在用它, 甚至为了表达对它的喜欢,特地读它的代码,找机会「混」进了它的项目贡献者列表。&/p&&p&&b&欢迎关注本人的微信公众号获取更多Python相关的内容(也可以直接搜索「Python之美」):&/b& &/p&&p&&a href=&///?target=http%3A///r/D0zH35LE_s_Frda89xkd& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&/r/D0zH35L&/span&&span class=&invisible&&E_s_Frda89xkd&/span&&span class=&ellipsis&&&/span&&i class=&icon-external&&&/i&&/a& (二维码自动识别)&/p&
1. 。 高品质网易云音乐命令行版本,简洁优雅,丝般顺滑,基于Python编写。&img src="" data-rawwidth="1330" data-rawheight="996" cl…
从API设计考虑,有一些原则,&br&1. 正交性&br&基础API只提供,必要,且只完成一件事情的接口,这样用户可以通过组合的方式,完成所有功能,&br&2. 易用性&br&面向用户的API,会对一些常用,鼓励使用,提供一些,组合好的,简化的接口,&br&&br&因此API设计者,对于vector, 只提供insert(必要性),并未提供push_front((因为效率)不鼓励,不常用),是合理的,&br&如果你你常用,而API未提供,你就得考虑这是不是库作者不推荐的用法呢?
从API设计考虑,有一些原则, 1. 正交性 基础API只提供,必要,且只完成一件事情的接口,这样用户可以通过组合的方式,完成所有功能, 2. 易用性 面向用户的API,会对一些常用,鼓励使用,提供一些,组合好的,简化的接口, 因此API设计者,对于vector, 只…
因为 vector 的设计是为了 O(1) push_back(),对它来说 push_front() 的性能等同于 O(n) 的 insert(),所以就不提供 push_front() 避免误用。&br&类似 vector 但能 O(1) push_front() 的是 deque。
因为 vector 的设计是为了 O(1) push_back(),对它来说 push_front() 的性能等同于 O(n) 的 insert(),所以就不提供 push_front() 避免误用。 类似 vector 但能 O(1) push_front() 的是 deque。
谢邀。题主说的是才出不久的《编译系统透视:图解编译原理》一书。&br&&br&豆瓣链接:&a href=&///?target=https%3A///subject//& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&《编译系统透视:图解编译原理》&i class=&icon-external&&&/i&&/a&&br&华章图书链接:&a href=&///?target=http%3A///Books/9103.html& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&华章图书 - 编译系统透视:图解编译原理&i class=&icon-external&&&/i&&/a&&br&样章:&a href=&///?target=http%3A///d_.shtml& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&编译系统透视:图解编译原理 - IT168&i class=&icon-external&&&/i&&/a&&br&配套视频:&a href=&///?target=http%3A///vplus/2f8cf44cbc8be594a25ee/foldervideos/5tk5q6& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&《编译系统透视》配套视频&i class=&icon-external&&&/i&&/a&&br&配套源码:&b&即将(也就是尚未)公开链接(注意!!!)&/b&。我看到公开链接的消息的话会更新过来。&br&&br&&b&总体印象&/b&&br&&br&看到这个问题才知道新出了这么一本书,聊有兴致地看了下目录然后读了一下样章(头3章),觉得挺不错。还没取找配套的视频来看。&br&已经托人帮忙带一本过来,等拿到实体书读过之后再看看有没有什么要更新到这个回答的。&br&&br&一句话:杨福川编辑又立功了 &_&&br&&br&这是一本以&b&GCC的源码剖析&/b&为题的&b&入门书&/b&。它以GCC的源码为线索,对C语言的非优化编译的整个编译流程,包括编译后的链接以及运行时结构都有图文并茂的讲解;&b&着重讲解了GCC的语法分析部分&/b&。&br&&br&说真的还挺震撼:敢拿产品级C语言编译器为主题来做源码剖析,写作团队还是很够魄力的。&b&本书有配套的裁剪版GCC 4.x系列的源码,并且带有配套的编译和调试环境,这点是最最吸引的地方;然而目前配套的裁剪后源码尚未公开,配套的调试环境似乎只是在作者之一的杨老师授课时给学生使用了。&/b&源码剖析类的书就应该方便读者能动手调试实际运行中的程序,这点是这本书的强项。&br&&br&本书在图解方面做得确实很不错。许多细节步骤都有配图,特别是介绍语法分析的部分讲解得很详细,方便读者形象的理解每个步骤发生的变化。不过,就如书中前言所说,这些“动态”的图解恐怕以动态图片或者视频的方式来展示效果会更好,而本书的头三章也有配套视频(链接在本回答开头)。&br&&br&它不是,注意不是,一本深入讲解编译“原理”的书。它并不深入介绍词法分析或语法分析背后的理论,而是简单带过一点理论之后以若干案例配合图解,结合GCC的具体实现来讲解C编译器的情况。&br&这意味着:这本书会贴很多带注释的GCC源码;这本书也会有很多步骤分得很细的图解——对一些读者来说这些图可能过于冗长了。不喜欢这种风格的源码剖析书的同学请不要购买这本书,毕竟不是啥便宜的书orz&br&这本书的贴代码和图解风格,请参考 &a href=&/question//answer/& class=&internal&&如何评价《编译系统透视:图解编译原理》一书? - 德玛西亚的回答&/a&&br&&br&&b&购买前请一定要读读样章感受一下这是否是合适您的阅读习惯的书。&/b&样章链接在本回答顶上。&br&&br&我原本的回答似乎引起了一些对这本书不正确的期待,请参考 &a href=&/question//answer/& class=&internal&&如何评价《编译系统透视:图解编译原理》一书? - 赵跃宇的回答&/a&&br&如果您跟引用的这个回答有相同期望的话请不要购买这本书嗯。我得想想怎么组织语言才不容易引起误解。&br&&img src=&/beb38a4d2bb3dca2c9c0daf_b.png& data-rawwidth=&1616& data-rawheight=&1154& class=&origin_image zh-lightbox-thumb& width=&1616& data-original=&/beb38a4d2bb3dca2c9c0daf_r.png&&&br&&br&=======================================================&br&&br&&b&头重脚轻&/b&&br&&br&然而…嗯当然得有然而。&br&然而这本书跟许多定位在入门级别的编译原理书一样,“头重脚轻”,说得不好听有点虎头蛇尾;词法与语法分析占的篇幅实在太多,而&b&对产品级C语言编译器中真正的重头戏——编译优化——只有寥寥几笔简单带过&/b&。有选题GCC的魄力,却没有把握GCC精华的结果,相当可惜。&br&其它定位在入门级编译原理的书籍,通常搭配的是比较简单的实现,例如本回答最后提到的LCC和cbc;对于比较简单的实现把主要篇幅放在编译器前端是很合适的,因为对应的实现中的大头也是在这里。而GCC的大头都是在优化器和后端里,相信会有不少读者是期待着了解更多跟“优化”相关的话题,而这本书偏偏没有侧重于这方面。&br&当然,定位如此,倒也就是这样了。如此安排对刚接触编译器(特别是GCC)的读者来说应该是比较友好的吧,嗯。&br&&br&GCC中C语言的编译器的工作流程大致可以分}

我要回帖

更多关于 玩游戏有时候会卡一下 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信