AC-3 support gets back again in VLC for iOS

A year ago, VLC on iOS was forced to remove its support for AC3 codec. I found almost all my videos on iPad were muted.

Since then, I haven’t bothered to check other options. I don’t mind paying a few dollars but I’ve been using VLC since years on all of my computers and mobile phones. There’s simply no other comparable alternatives that works equally well on Windows, Linux, OS X as well as iOS.

Today, I opened VLC on my iPhone again and noticed that I can play my videos with sound again! I checked the official website for sure and got this:

https://forum.videolan.org/viewtopic.php?f=36&t=124115&sid=c0ad097c62e429e8e5fe5f68aa14fc54&start=20#p441786

The link on iTunes also confirmed this. However, nowhere did I find details how did the developers solved the patent issue. Let’s hope it’s fixed for good.

SSH Logon takes long time?

I’ve been suffering from this on CentOS 7 for quite some time now but haven’t really have time to dig into it.

Just today, I noticed the line after a successful logon:

Last login: Fri March 27 16:03:23 2016 from gateway.

Aha, now I know where the time has been spent. The SSHd must have taken a long time to figure out the host name of my login IP.

I’ve suspected this before, but in my sshd_config file, the line “UseDNS” was commented out, so I thought it must be something else.

A simple “man sshd_config” revealed that, “UseDNS yes” is actually the default setting:

UseDNS  Specifies whether sshd(8) should look up the remote host name and check that the resolved host name for the remote IP address maps back to the very same IP address.  The default is “yes”.

So I just add “UseDNS no” in the configuration file and restarted sshd. Problem solved.

 

Shanghai Restaurants that are worth-noting

无意中看到了这个片子,Rick Stein’s Taste of Shanghai. 其中列举了很多值得一去的上海餐馆。我记录在下面以便下次去上海的时候按图索麒。加粗的是Rick Stein非常推荐的。

  • 佳家汤包
  • 寿宁路夜市,大闸蟹
  • 吴师傅葱油饼-法租界,茂名路159弄2号后门,近南昌路
  • 米香园-红烧肉
  • 崇明岛清蒸?鱼
  • 小米酒,上海农家酿酒有限公司
  • 富?
  • 猪杂面,黄浦区复兴中路,格林泰豪对面
  • 下午茶-和平饭店
  • 天鸿酒家- 普陀区 铜川路977号(近兰溪路),葱爆蛤蜊
  • 臭豆腐-金山?
  • 白斩鸡

 

 

a new way of defining $$e$$ the Euler number

中文版见这里

This is inspired by a post on Quora by Alon Amit. I found this approach of defining e, the Euler number more intuitive than the traditional way($$e=\lim_{n \to \infty} (1+\frac{1}{n})^n$$). In addition, it explains the importance of the Euler number very well.

First of all, we need a function that solves the elementary differential equation:

$$\frac{d f(x)}{d x} = f(x)$$

Of course, without specifying an initial value, this equation will have infinite number of solutions. Just for convenience, let’s specify:

$$f(0)=1$$

By Picard–Lindelöf theorem, our equation:

$$\begin{gather*} \frac{d f(x)}{d x} = f(x)\\f(0)=1 \end{gather*} $$

has one and only one solution.

Now, let’s see what kind of property this function $$f(x)$$ has.

继续阅读a new way of defining $$e$$ the Euler number

另外一种定义欧拉数$$e$$的方法

在传统教科书里,欧拉数$$e$$通常被定义为:

$$e=\lim_{n \to \infty} (1+\frac{1}{n})^n$$

然后在后续的讨论中发现$$e$$的种种奇妙性质。前一段在Quora上看到Alon Amit解释了$$e$$的来源,觉得这种新的定义方式一方面更直观,另一方面从一开始就展示了$$e$$为什么很重要。

首先,如果我们把微分运算看成一种函数映射,那么在该映射下保持形式不变的函数就非常重要了。这个函数满足:

$$f’=f$$                         ……(1)

如果我们加上初值条件$$f(0)=1$$,根据存在性和唯一性定理,该微分方程有且只有一个解。

要解这个方程,我们有如下观察:

首先,忽略初始条件,如果$$f(x)$$是一个解,则$$c*f(x)$$也是解。其中$$c$$为任意常数。因此$$c*f(x)$$就是方程$$f’=f$$的解空间。

其次,注意到,如果$$f(x)$$是一个解,则$$f(x+a)$$,其中$$a$$为任意常数也是一个解。根据前面的讨论,我们得到:

$$f(x+a)=c*f(x)$$                     ……(2)

也就是说,对函数曲线在水平方向进行平移,等同于对函数曲线在垂直方向上进行缩放。

此时我们把初值条件$$f(0)=1$$代入(2),得到$$f(a)=c$$。再带回(2),得到:

$$f(x+a)=f(a)*f(x)$$

由此我们知道,符合方程(1)的解,一定是一个指数函数。唯一的问题是,这个指数函数的底是多少。

刚好,很容易验证函数$$exp(x)=1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+…+\frac{x^n}{n!}+…$$是方程(1)的解。因此,

$$f(1)=exp(1)=1+1+\frac{1}{2!}+\frac{1}{3!}+…+\frac{1}{n!}+…$$

不难证明,该级数是收敛的,而它就是我们要找的指数函数的底。

简单地说,$$e$$是基本微分方程

$$\begin{gather*} \frac{d f(x)}{d x} = f(x)\\f(0)=1 \end{gather*} $$

的解。而这个基本微分方程在动力学、电磁学、通信以及概率论中都有非常基础的地位,因此,$$e$$才特别重要。

比如,在电学中非常基础的LC电路,其微分方程样式实际上是:

$$\frac{d^2I}{dt^2}=-cI$$,其中$$c$$为大于零的常数。

令$$I(t)=e^{k*t}$$,其中$$k$$为常数,代入方程得到:

$$k^2*e^{k*t}=-c*e^{k*t}$$,因此,

$$k^2=-c\\k=\pm\sqrt{c}*i$$

其中,$$i=\sqrt{-1}$$。因此,$$I(t)$$的通解为$$e^{\sqrt{c}*i}$$和$$e^{-\sqrt{c}*i}$$的线性组合。

相应的方程形式还出现在弹簧模型,电磁波方程以及正态分布中。是因为有了$$exp(x)=e^x$$这个基础,我们才能够解这些方程。这就是为什么$$exp(x)=e^x$$这么重要,为什么$$e$$这么重要。

相对而言,把$$e$$定义为$$\lim_{n \to \infty} (1+\frac{1}{n})^n$$,然后推导相应的性质,不如这样定义$$e$$来的直观。

英文版见这里

注,后续搜索发现,认为$$e$$的重要性来自于$$e^x$$的导数就是其自身的看法很有渊源。英文维基的exponential function页面说,

The reason this number e is considered the “natural” base of exponential functions is that this function is its own derivative.

其来源之一是R柯朗的数学是什么,其中说到:

This natural exponential function is identical with its derivative. This is really the source of all the properties of the exponential function, and the basic reason for its importance in applications…

可见自己当年看书还是不细致。。。

Another documentary from Simon Schama

I’m a big fan of <A history of Britain> and <Power of Art>, so inevitably became of fan of Simon Schama.

Face of Britain is the new documentary from Simon Schama. I just watched the 1st part, Face of Power. It’s just as brilliant as the other Simon Schama documentaries. In particular, I like Simon Schama’s way of story telling. For example, here’s the opening story of the first part.

4523079973_4b2dc2f9e8_b

On Churchill’s 80th birthday on 1954, the painting commissioned a portrait for him as a present to proclaim his contribution and leadership during WWII.

By the time the parliament is about to unveil this painting in an formal assemble, Churchill had already seen it and hated it. Here’s how he remarked:

vlcsnap-2015-11-01-19h39m25s058

The portrait is a remarkable example of modern art.

Churchill hated this painting so much that in the end this painting was burned.

Wikipedia has a page for this story, but it was found out rather recently that the painting was burnt soon after the event.

Simon Schama uses this story to show the “will contest” between the painter and the person being portrayed. I was fascinated instantly.

A documentary on algorithms

I guess it’s not easy to get journalism and algorithm together. Finally here’s comes a documentary about algorithms, made by BBC – The Secret Rules of Modern Living: Algorithms.

It’s intended for general public, so it’s just a gentle introduction. From Euclid’s algorithm to find greatest common divisor to different sorting algorithms to traveling sales man problem to matching algorithm and eventually to machine learning. The algorithms are well illustrated and explained. It’s just enough to expose the audience to the world of algorithm without intimidating them. More importantly, from what I can see, there’s no misconceptions that are commonly seen in introductions of algorithms made by mass media (except maybe the comparison between bubble sort and merge sort is overly simplified and didn’t take memory consumption into consideration).

One interesting scene in the documentary: President Obama was in an interview and was presented a typical computer science question:

vlcsnap-2015-10-01-21h50m39s906

“What is the most efficient way to sort a million 32-bit integers?”

After some hesitation, he actually answered:

vlcsnap-2015-10-02-07h05m20s297

“I think Bubble Sort would be the wrong way to go.”

Not bad for a president, I must say. Some say it is staged. But it’s still funny to see how Mr. President tried to circumvent the real question with a safe correct answer. You can see the interview here on YouTube.

在知乎上对李世默视频的评论

9月27日更新,果然已经被删掉了。

对这个问题的回答,感觉有可能被删,所以在这里保留一份:

@猛虎细嗅蔷薇 的回答已经切中了要点:
是否有利于经济发展,是否能带来经济发展,是否有实用价值,是一个非常单一的标准。而人类社会的发展是非常多维度的。无数美好的理想,信念,从实用角度一文不值。那是因为只知道从实用角度看,本来就错了。李明确说,党的执政合法性来自于“舍我其谁的执政能力”,但是说出来的执政能力表现完全集中于经济发展。 由此看来,李世默的演讲,其实本来不值得探讨。

另一方面,这个演讲的新鲜之处在于,显然他在为现行体制辩护——如果如楼上某些人所言,他仅仅是在 消解宏大叙事,那就完全不必赞美现行体制了,也不必论证党的执政合法性了——论证的起点却是共产主义宏大叙事的幻灭。此外,他选择直面执政合法性这个敏感 话题。直率的不像体制内!

但是,只要看看李世默的经历zh.wikipedia.org/wiki/%你就会明白,李世默所讲的,绝非仅代表他个人。他的观点,很可能代表了princelings的内部共识。这种内部共识的要点包括:

  1. 共产主义宏大叙事已经是共产党执政的负资产,必须要抛弃,只是要讲策略,讲时机;
  2. 从现实出发从经济发展出发重新打造ccp的执政合法性;

我个人认为,可喜的是,看得出党在走向开放,开始自信地以西方话语为自己论证。可悲的是这种思路明确地把其他价值,比如尊严,自由,平等,开放,民主,法制等排除在外。

BTW,我来回答这个问题,也是因为最近王常委又谈起了合法性。王常委早年也曾是青年导师,如今主导反腐成就斐然,观点自然格外引人注目。如果王常委跟李世默一样观点,其他人只可能更为封闭保守。

An antidote to the so-called Chinese way of teaching

As I said before, I don’t think there is a single “Chinese way of teaching”. In addition, the Chinese ways of teaching are also changing. However, there are characters that are commonly agreed to be associated with Chinese ways of teaching: emphasis on discipline and order, rely primarily on repetition and memorization.

In the discussion provoked by the BBC documentary, “Are our kids touch enough: Chinese school”, I’ve seen a lot of people praising these characters. Well, here’s an antidote to the obsession of academic achievement:

Mind you, I don’t see this as a full argument against Chinese way of teaching. I’d love to get more cases like Gillian Lynne from Mr. Ken Robinson. However, this talk at least challenges us, reminds us to look further, wider, beyond academic achievement, in education. I’ll provide a Chinese translation to the transcript in another post.

爱国谣言一例

刚刚阅完兵,朋友圈里又开始流传这样的文章:

华裔教授发文怒斥西方轰动华人圈(震撼好文)

文章没说这位华裔教授的诗文是什么时候发表的,给读者的感觉是该诗作是特意为阅兵在西方引起的反应而做。但其实,这篇文章早就流传过。其中,最引人关注的是新华网曾经在2011年发文:

你们究竟要我们怎样生存?

新华网言之凿凿文章作者名为“林良多”,实际上根本未经查证。在这里有完整的故事:

“林良多”教授:那首网间疯传的爱国诗篇并不是他写的!

简单总结一下:

2008年4月23日,有人(ID:Vicky. H)在华盛顿邮报的讨论区发表评论,说他收到这么一封邮件,据传邮报已经发表过了,但是没有证据。诗篇结尾签名是Duo-Liang Lin, Ph. D.

first_appearance

第二天,4月24日下午6:11,另外一个ID,Bidwell声称他也收到了别人发的这首诗,但其中并无作者签名。

同一天稍晚一些时候,晚上10:06,一个ID叫做“From_WP”的人直接发表了这么一首诗,没有任何其他说明。

4月25日,一个ID叫做“A Poem Published by the Washington Post. ”的人又重新贴了这一首诗,加上了Duo-Liang Lin的签名。

5月16日,华盛顿邮报注意到了这首诗,在“opinion”栏引用了这首诗,但是注明:

Its authorship could not be confirmed.

此后国内媒体多声称这首诗是“林良多”教授发表在《华盛顿邮报》上。其实,Duo-Liang Lin的中文名字叫做“林多樑”;他向华盛顿邮报说明过自己并非作者;华盛顿邮报说的很清楚,作者身份无法确认。

至此,可以很清楚的看到,所谓海外华人教授怒斥西方纯粹是编造。

P.S. Times在2008年也有一篇文章提到了这首诗:

Poetry and Prosaic Advice