深入浅出的讲解傅里叶变换(真正的通俗易懂)

我保证这篇文章和你以前看过的所有文章都不同,这是 2012 年还在果壳的时候写的,但是当时没有来得及写完就出国了……于是拖了两年,嗯,我是拖延症患者……

这篇文章的核心思想就是:

要让读者在不看任何数学公式的情况下理解傅里叶分析。

傅里叶分析不仅仅是一个数学工具,更是一种可以彻底颠覆一个人以前世界观的思维模式。但不幸的是,傅里叶分析的公式看起来太复杂了,所以很多大一新生上来就懵圈并从此对它深恶痛绝。老实说,这么有意思的东西居然成了大学里的杀手课程,不得不归咎于编教材的人实在是太严肃了。(您把教材写得好玩一点会死吗?会死吗?)所以我一直想写一个有意思的文章来解释傅里叶分析,有可能的话高中生都能看懂的那种。所以,不管读到这里的您从事何种工作,我保证您都能看懂,并且一定将体会到通过傅里叶分析看到世界另一个样子时的快感。至于对于已经有一定基础的朋友,也希望不要看到会的地方就急忙往后翻,仔细读一定会有新的发现。

————以上是定场诗————

下面进入正题:

抱歉,还是要啰嗦一句:其实学习本来就不是易事,我写这篇文章的初衷也是希望大家学习起来更加轻松,充满… Read the rest

ffmpeg 常用操作

合并多个视频

将多个视频文件合并到同一个

ffmpeg -i "concat:1.mp4|2.mp4|3.mp4" -c copy output.mp4

将一个目录下的所有视频文件合并到同一个文件

ll *.mp4 | awk '{print "file "$9}' files.txt
ffmpeg -f concat -safe 0 -i files.txt -c copy output.mp4

截取视频中的部分

ffmpeg -ss 00:00:03.4 -i input.mp4 -t 00:03:23.4 -c copy output.mp4

旋转、翻转

ffmpeg -i in.mov -vf "transpose=0" out.mov //逆时针旋转 90°,并且水平翻转
ffmpeg -i in.mov -vf "transpose=1" out.mov //顺时针旋转 90°
ffmpeg -i in.mov -vf "transpose=2" out.mov //逆时针旋转 90°
ffmpeg -i in.mov -vf "transpose=3" out.mov //顺时针旋转 90°,并且水平翻转

如果只想要水平翻转或者垂直翻转一个视频,可以将多个 transpose 结合起来。

ffmpeg -i in.mov 
Read the rest

代码大全读后感

代码大全阅读的几个启发式:

  1. 复杂性,控制软件复杂性是软件构造过程的第一要务
  2. 软件构建,是写代码,更是人的智力和心理活动
  3. 开发协作,是形成软件领域相同世界观和价值观的过程——共同约定,是非分明
  4. 做好准备,错在开头
  5. 渐进——从简单到复杂
  6. 自底向上,自顶向下,反复多次
  7. 折中,工程和科学——实事求是,过犹不及
  8. 数据表达中体现的逻辑
  9. 归纳+演绎
Read the rest

How to set default apps on Mac

Certain actions that you perform on your Mac will cause default apps to open. For example, clicking a document may open Pages. But what if you want Microsoft Word to open instead? You can also set your default web browser and email reader.

Here’s how!

How to change the default Mac app for specific file types

  1. Right-click on a file that uses the file type you’d like to change the default for. For example, one with a .jpg extension (a photo).
  2. Click on Get Info in the pop-up.
  3. Click Open With if the section isn’t already expanded.
  4. Click the dropdown

Read the rest

Decrypting HTTPS-protected traffic

Introduction

Enable the traffic decryption option by clicking Tools > Fiddler Options > HTTPS and ticking the Decrypt HTTPS Traffic box.

Frequently Asked Questions

Q: The HTTPS protocol was designed to prevent traffic viewing and tampering.  Given that, how can Fiddler2 debug HTTPS traffic?

A: Fiddler2 relies on a “man-in-the-middle” approach to HTTPS interception. To your web browser, Fiddler2 claims to be the secure web server, and to the web server, Fiddler2 mimics the web browser. In order to pretend to be the web server, Fiddler2 dynamically generates… Read the rest

DynamoDB vs. Cassandra: from “no idea” to “it’s a no-brainer”

Apache Cassandra is an open-source database, while Amazon DynamoDB is a database service on the list of AWS’s offering. And it’s a common misconception that this is the biggest, if not the only, difference between the two technologies. To refute this misconception, let’s look at them more closely in terms of:

  • Data models
  • Architectures
  • Security features
  • Performance issues
  • Use cases

1. Data model

DynamoDB vs Cassandra, Fig. 1

DynamoDB’s data model:

Here’s a simple DynamoDB table. Its rows are items, and cells are attributes. In DynamoDB, it’s possible to define a schema for each item, rather … Read the rest