By the way…

I am fully aware that I parked this blog for 1 year straight, and there are reasons. Main reason would be my privacy concern, people were poking around and posting my CV to public forums, I knew they got it from here and I was appalled. I think I will try to update this blog in English and cover topics that aren’t really related to my personal information. By the way, knowing too much about me isn’t healthy, talking about it on forums is very creepy.

On expressing your ignorance

Few months back, I was in a meeting about spintronic materials, there was one fifth year PhD student from Physics department, during the Q&A session, she claimed.

“I know absolutely nothing about spin-orbit coupling, and I hope in the next student meeting we can figure it out together.” Everybody nodded, Professor said something like great please let us know about the concept you want us to cover in the future, we want to help you to learn.

That really struck a cord in me, I made the exact same statement during a group meeting in 2015, and the group paused and stared at me. Professor then said:”Just to make sure, you are a Physics student, right?”

Since then, “Not Physics student enough” was something that was bothering me when I was working on my Masters research project. I smiled and nodded like a smart angel for every group meeting and colloquium I attended. I tried my best to tuck my ignorance in. When I was confronted, I would try to spin the situation by pretending to know something (by the way, thermal excitation was my first guess for A LOT of questions). And by doing that, I felt like a total piece shit for three years straight.

I still think I am not “Physics student” enough till this day, and that’s probably why I end up in Materials Science and Engineering program instead of Condensed Matter Physics. I wish people were nice when I was expressing my ignorance, people can even throw a book at me and I will read it, give me something instead of making fun of my ignorance.

Why did I suddenly flash back to few months ago and started to gibberish you ask? I was reading papers and textbooks about the low temperature transport properties of Fermi liquid today, and I came across something I don’t really understand, I asked my old colleagues, and they commented “You don’t even know how to ask the right question.” before answering my questions.

Don’t do that, let’s be nice to stupid people.

更新:如何使用 youtube-dl 抓取 YouTube 频道的更新 | Electronic Moon

在这篇文章中,我只写了抓取的部分,但整个实现还不是非常自动化。这几天琢磨了一阵子之后,我搞清楚了如何使用 crontab 将整个抓取行为定时自动化进行,并且将抓取的内容自动化上传任意给定网盘。如果你像我一样是第一次接触 cron,网上有很多介绍教程用来入门,这里我给了 Admin’s Choice 的教程做参考。

具体的细节不在这里赘述了(因为真的太简单)唯一需要注意的一点是,执行原文中的 shell script 时默认需要在 shell script 所在的文件夹内寻找配置文件,所以在执行之前,必须将路径跳转到 shell script 所在文件夹内。「每隔六个小时自动跳转到 shell script 文件夹内并执行 shell script」的写法如下:

0 */6 * * * cd /home/YouTube/youtube_channel_archiver-master/ && sh /home/YouTube/youtube_channel_archiver-master/download_archive.sh

而自动上传到网盘,rsync 似乎是最好的选择,关于此,网上也有很多教程可以参考。同样,rsync 的命令可以写到 crontab 里自动执行。这样 YouTube 频道出现更新之后,就可以全自动化抓取并上传网盘啦。

Source: 如何使用 youtube-dl 抓取 YouTube 频道的更新 | Electronic Moon

在 1UP 播客中聊聊塞尔达

五月初的时候,我和我的朋友王晓光 (@cbvivi) 在他的博客节目 1UP 中聊了《塞尔达传说:旷野之息》这一款游戏。在这期节目中,我们聊了游戏中遇到的比较好玩的事情,讲了游戏中比较吸引人的一些设定,如果你没有玩过塞尔达传说,不妨也可以听听看。

另外,1UP 播客主要聊的是一些出色优秀的作品,包括但不限于电影、音乐、电视剧和游戏等,是一个极适合打发时间的节目。

你可以在 Apple iTunes 里找到我们的这一期播客节目,请点击这里

或者你也可以在泛用型播客客户端、各大播客平台上搜索「1UP」,点击好看的红色图标即可订阅收听。

The top 8 Chinese phones – The Verge

It’s time to stop dismissing Chinese phones as knockoffs. We’ve all seen the endless parade of iPhone clones, yes, but over the past couple of years, manufacturers from China have stepped up their game in a big way, turning out devices that are innovative, attractive, and straight-up desirable in their own right. If you don’t think there’s any reason to pay attention to Chinese phones, it’s because you haven’t been paying attention.

确实相当热血的一段话,说中国 Phone step up their game 了,变得 innovative 了,下面榜单是 Top 8 Chinese phones

结果榜单里有小米 8——一款从头到脚抄袭 iPhone X 的产品。

回顾 the verge 对国产厂商的报道,有「mate x 虽然抄袭 MacBook Pro,但我们觉得没问题」还有「P20 还没开机我就爱上了它」,还有本文。

没错,the verge 在 2018 年确实收钱收得厉害。

Source: The top 8 Chinese phones – The Verge

如何使用 youtube-dl 抓取 YouTube 频道的更新

众所周知,具有极强品牌意识的 Apple 会在下架商品的同时下架官方 YouTube 频道的视频,而 YouTube 上曾经出现过的第三方 Apple 视频库(例如 EveryAppleVideo)都纷纷被 Apple 发函拿下。如果你一直很想收藏 Apple 的广告视频(并在深夜反复观看),你可以在 VPS 上安装 youtube-dl 来抓取 Apple 的更新,下载最高清晰度的视频和音频,并使用 ffmpeg 将音视频流压在一起。这个方法适用于任何 YouTube 频道。

先决条件

在开始之前,你需要:

  • 一台配置不算太差 KVM 虚拟化的 VPS,内存至少要在 512 Mb 以上,因为要使用 ffmpeg,所以处理器核心不能太差。同时因为要挂载网盘,所以你的服务商需要为你的服务器开启 FUSE.
  • 一个网盘账号,Google Drive, Dropbox 和 OneDrive 均可。
  • 学会如何使用 ssh 远程登录 VPS,网上有很多教程,你可以轻松找到

Disclaimer: 接下来的安装和部署,我都是在 Debian 9 下进行,我可能会犯很初级的错误。如果有,请在评论中指出。

配置 youtube-dl 和 ffmpeg

  1. 安装 youtube-dl

youtube-dl 是一个可以下载 YouTube 视频的命令行应用程序,它需要 Python (2.6, 2.7, 或 3.2+) 才能正常工作,关于 youtube-dl 在不同平台下详细的安装说明可以参考它的 github readme 页面。

所以,我们先在 VPS 上安装 Python.

apt-get install python

然后再下载最新版的 youtube-dl

wget http://youtube-dl.org/latest/youtube-dl -O /usr/local/bin/youtube-dl

在这一步,如果你的服务商的系统模版精简太厉害的话,很可能会报证书错误,提示证书不可信之类的信息,这个时候,你需要安装 ca-certificates 证书包。

apt-get install ca-certificates

更改目录的访问权限

chmod a+x /usr/local/bin/youtube-dl

至此,youtube-dl 就安装好了,这个时候,执行 youtube-dl —help应该可以看到如下的输出:

  1. 安装 ffmpeg

由于 YouTube 在 1080P 以上清晰度的视频才用了音视频流分开的设计,单纯下载 1080P 以上清晰度的视频时会出现只有画面没有声音的情况,所以我们需要使用 ffmpeg 将音视频流压制在一起。

apt-get install ffmpeg

安装完成之后,执行命令 ffmpeg 应该可以看到如下的输出:

至此,下载并且压制 YouTube 视频的工具已经完备,接下来我们准备一个抓取频道最高清晰度所有视频并下载的脚本。

准备抓取频道的脚本

youtube-dl 的具体使用说明在这里不赘述了,它的帮助文档中也有较为详细的描述,yotuube-dl 的功能和可配置选项非常强大,有兴趣的你可以详细研究。

但总之,我们需要做到的是:

  1. 下载频道中提供的最高清晰度视频,并且使用 ffmpeg 将音视频重新压制,输出为 mkv 格式。
  2. 重新命名输出文件,命名格式为:视频上传日期 – 视频标题 – (视频ID) – 清晰度 – 视频的 ID,视频需要存在以频道名称命名的文件夹中。
  3. 记录需要下载的 YouTube 频道,并且记录已经下载的视频 ID,重复执行脚本的时候无需重复下载。
  4. 下载视频配套的字幕(非自动转换)元数据和原始插图。

为了达到上述所有的功能,下载脚本的配置文件应该这么写,在这个配置文件中,下载的项目略微有些多,如果你不需要下载字幕和元数据,可以使用 # 将它注释掉:

-i
-o "%(uploader)s (%(uploader_id)s)/%(upload_date)s - %(title)s - (%(duration)ss) [%(resolution)s] [%(id)s].%(ext)s"

# 记录已下载文件以及需要下载的频道
--download-archive youtube-dl-archive.txt
-a youtube-dl-channels.txt

# 统一输出格式
--prefer-ffmpeg
--merge-output-format mkv

# 下载字幕
--write-sub
--all-subs
--convert-subs srt

# 下载元数据和配图
--add-metadata
--write-description
--write-thumbnail

# Debug
-v

将这个文件保存为 youtube-dl.conf,同时,新建一个名字叫 youtube-dl-channels.txt 的文件,记录你需要下载的频道地址,如下所示:

# Apple
https://www.youtube.com/user/Apple/

#Crowbcat

https://www.youtube.com/user/CrowbCat

#Nerdwriter1

https://www.youtube.com/user/Nerdwriter1

#idubbbz

https://www.youtube.com/user/iDubbbzTV

只需提供 URL 即可,接下来,新建一个名字为 youtube-dl-archive.txt 的空文件,这个文件内会记录已经下载的 YouTube 视频的视频 ID,重复运行的时候会跳过这个文件中记录的 ID.

接下来,确保上面建立的三个文件都在同一个目录,执行 youtube-dl --config-location youtube-dl.conf 即可开始自动爬取的过程,下载视频和压制的过程非常漫长,建议在 screen 中运行这个命令,以免 ssh 连接中断而导致脚本终止。

当然,你可能要问了,要我手工执行命令的话,这个到底自动在哪里?其实你可以将 youtube-dl --config-location youtube-dl.conf 保存为一个 shell script 并且建立一个 cron job 每隔一段时间自动执行,cron 是一个 Linux 系统下的计划任务工具,可以给定一个时间间隔自动运行一些项目,非常好用。

另外,配合 rclone,你可以挂载主流网盘,直接将下载完成的文件 rclone sync 到网盘上。但关于 rclone 的用法,我们只能下次再讲了(标准虎头蛇尾结局)。

注:本文的写作离不开 reddit/r/DataHoarder 社区的帮助。

 


20180717 更新:

针对自动化下载和 crontab 配置撰写,我写了这篇更新博文

针对直播设计的游戏

Getting Over It with Bennett Foddy.

我无法用语言描述我有多么讨厌这款游戏,这款 2017 年 10 月随 Humble Bundle 发售的游戏,因为特有的「对玩家的敌意」和「似乎永远无法完成的关卡」,在 2017 年底火了足足两个月。YouTube Gaming 和 twitch 上关于这款游戏的视频层出不穷,开发者 Bennett Foddy 不断接受采访揭露一茶匙这么浅的游戏设计理念:「这款游戏是为了伤害一类玩家设计的」他这么说,「在一定程度上,我是为了解构游戏设计,跳出传统游戏制作的桎梏,带着一种暗黑的幽默感来做的 Getting Over It」

随他怎么讲,但我认为,这款游戏是为了 reddit 和 twitch 设计的,它的设计理念只是为了成为一个 meme,迅速占领大家的注意力并且迅速离开,赚一笔快钱,是相当可耻且不配称作游戏的。

解构游戏设计,跳出桎梏,带着一种暗黑幽默感设计的游戏,是 2013 年底由 Galactic Cafe 发布的 The Stanley Parable,它结构和嘲讽了游戏开发者和玩家的微妙关系,试图预见了玩家在面对一款游戏时会做出的所有尝试——甚至在成就系统里,开发者还一定程度上嘲笑了那些成就完美主义者,设计了一个完全不可能完成的成就。The Stanley Parable 是深思熟虑的产物,它甚至相当无趣,但它探讨的关于游戏与玩家的关系具有非常精细的质地。换句话说,它并不是一款为了病毒性传播而制作的游戏。

但在移动流量大爆发的今天,很多游戏开发者确实是在为了直播开发出了类似于 Getting Over It 的游戏,这些游戏制作粗糙,但具有较强的对抗性(无论该对抗是发生在玩家与游戏还是玩家与玩家),可以在反复练习之后炫技。在病毒传播之后,知名主播暗暗较劲在比拼,开发者笑嘻嘻数钱。还有好多类似 Getting Over It 的作品,为了避免招骂在此就不一一列举了。

写申请材料的 Personal Statement (PS) / Statement of Purpose 非常头疼?这是 Caltech 给的建议

在去年(2017 年)准备 PhD 项目申请的时候,Personal Statement (PS) / Statement of Purpose 是我最头疼的部分,这一部分的材料非常需要自我审视和总结,也需要将一些人生偶然粉饰成自主选择,相当难过。加上大部分中国学生的语言壁垒,写好一个能看的 PS 非常难。我的师弟彼时在加州理工 Caltech 做暑期研究,他去参加了加州理工研究生院举办的申请文书写作指导并且分享了当时发放的材料和 PPT 给我,我将它们整理成了文字版,希望能给你带来帮助:

Statement of purpose

It is a document submitted as part of a graduate application that describes your abilities, attributes and accomplishments as evidence of your aspirations for pursuing a graduate education and, beyond that, a career in research.

Main Points

  1. What do you want to study
  2. Why do you want to study that topic
  3. What experience to do you have
  4. What to do you intend on doing when you have earned your Ph.D.

Make yours unique

Stand out from the beginning

Keep it concise and focused.

Address ”Fit” with the particular program or lab.

Emphasize interest in solving relevant problems and addressing research questions.

You should be as specific as possible in discussing what interest you. Use examples of particular phenomena, tools, or situations that you find exciting.

Evidence of experience in order of relevance.

The yawn effect

I love science. I love to study it, research it and I want to devote my life to it. Science is the foundation for all that we are.

Don’t tell me you LOVE it or are passionate about it. SHOW me how you are and what you have done.

What to include

Research, research, research

Focus on future

Support future goals with your experience

“Light bulb” moments

What have you done to prepare for this step?

What are your research interests?

How do those research interests mesh with the program to which you are applying?

What will you contribute to the program?

Why this particular group/program/advisor/institution?

Where will this program lead you?

What not to include

Avoid childhood.

Avoid K-12

Generic information that does not tell them anything about you.

A brochure for the school — they know what they are, but how does that impact you.

Start now

Free write — do not expect your first SOP draft to be perfect

Make a brag sheet — toot your own horn

Take time — write, put it away, edit

Research programs — read faculty’s research and take notes

2nd, 3rd, 4th … drafts

Be clear and concise

Have an angle — you may not even know what it is until your define it

Include information about the program/faculty

Think of yourself as a scientist

Every sentence should have value

Every paragraph should be related to research — post, present or future.

Minimize personal information — research focus!

Special circumstances

It is special to you, but not to the review committee

Make a negative a positive — Spin it

Focus on your strengths

Do not make excuses

Proof read

Your advisor

Other faculty

Your application will be reviewed by faculty so show it to faculty beforehand.

Your friends

People from different disciplines

To include faculty or not?

Include faculty with whom you want to work, this shows you have done your homework.

Contact faculty before you apply to build a relationship.

Mention a few fields/areas that you are interested in.

Write specifically for a department: you do now want an overly general statement.

Writer’s block

Pretend you are writing about a friend.

Just keep writing…anything.

Have a friend read it.

Discuss it with an advisor or friend.

Focus on a different part. Can’t write an opening paragraph? Start with the middle.

Red flags

“My parents both have PhDs and have encouraged me to pursue graduate educations.”

“At this point, I am considering a career in academia or industry.”

Vague, unclear , internal dialog

Not written for that program

Too much personal information

Not able to demonstrate experience in field

Check list

  • Clearly state goal.
  • Motivation for applying to graduate school.
  • Relevant experiences and academic coursework that have prepared you for graduate study in the field.
  • Characteristics and strengths that make you particularly well-suited to graduate study.
  • Future career objectives.
  • Decision to apply to that program.
  • Extenuating circumstance that may have resulted in less than ideal academic credentials for graduate school.

Print, edit, revise, recycle, repeat

Print it out.

Edit with pen in hand.

Read it through start to finish and back to start again. Make sure theme is consistent.

Revise throughly for each program… not just the last sentence. Do not rely on find/replace feature.