Contents

About

About Me

I graduated from Shanghai Jiaotong University in 1997 and received my Ph.D. from Osaka City University in 2004. I began my career as a software engineer at a small startup. In 2007, I joined OMRON Corporation, where I have spent nine years developing various computer vision technologies for mobile applications. In 2016, I established my own company, tiwaki Co., Ltd. To learn more about me, please check my posts on this website written in English, Chinese or Japanese.

Career

Engineer

As an engineer, I developed the world's first commercial facial beautifier application for digital cameras and mobile phones in 2007, prior to the release of the first generation of the iPhone. Currently, I hold over 50 patents including granted patents and patent applications in progress. 1 A few of my patents can be found here.

Researcher

I am working on problems related to computer vision and machine learning. My research interests include saliency detection, object detection, visual retrieval and more. I serve as reviewer for many top tier journals and conferences such as TPAMI, TIP, CVPR and ICCV, and others. I maintain the well-known saliency detection dataset DUT-OMRON and DUTS. Additionally, I am the author of the python implementation of Manifold Ranking Saliency algorithm. You can find my work on Google Scholar and DBLP.

Entrepreneur

I embarked on a new adventure in my career as an entrepreneur in 2016. Running a startup is never easy, but I relish the challenge and am constantly learning something new.

Life @life

乐夏3来袭 music

沉积了2年,乐队夏天第三季终于开播了,借这个档口说说乐队夏天相关的话题。

首先是马东。他是如假包换的星二代,而且算是巨星二代吧。马季在中国的文艺史上,不管你喜欢不喜欢,关注不关注,肯定是绕不过的一个人,他的儿子怎么也算是上一号人物。但是马东身上基本看不出任何明星后代的样子,沉静,练达而且踏实。当然,你要说这个不过是表面或者台面上的马东,那我也不反对,公众人物可能总有两幅面孔也说不定,但是我作为观众,只能就看得到的样子做评论。

马东这两年最被关注的事情不是他做了奇葩说,一年一度喜剧大赛或者乐夏,好像是许知远对他的一次采访,采访后N多人说他犬儒。他当时说的话,细节我不太记得了,大致意思是说,世界上5%的人是精英,剩下95%的人是芸芸众生,不关心宏大的事情。我们(指米未或者相关的文艺工作)只要让95%的人高兴就好了。这话一出,各种社会责任感爆棚的自觉知识分子们就怒了,指责他犬儒。我觉得大部分批评马东犬儒的人,他们甚至没有明白马东这句话里其实带着的刺儿,而且这个刺儿就是用来刺这些后来的批评者的。马东这段话,我看过原视频,结合许知远的前言后语,马这段话其实是反话。我理解他想说的是,5%的那些才是sb,才是庸庸无为的一群,我为什么要让你们高兴。马东骨子里其实有点愤青,他不止不犬儒,他对社会有深刻的观察和而且始终希望触手可及得参与社会改造。

当然这种评价,马东看了可能会不同意。不重要,我作为一个旁观者是这么觉得的。以这样的一个马东,他做的节目注定是有特色的,而且是鲜明的个人特色。无论是奇葩说,一年一度喜剧大赛,他们的切入点都很一样,让从前不能或者没渠道发生的人,用在中国还不多见的节目形式发出声音(话说,一年一度喜剧大赛比脱口秀大会好出一整个维度,这个可以单开一个话题另说)。这些节目背后的逻辑都是:深入社会话题,多元讨论,发出观点,不给结论。更重要的是,节目小心翼翼得走在国内的游戏规则之内,绝不越轨。这种安全,“世故”的姿态,可能就是马东被批评犬儒的原因。那些批评他犬儒的人可能从来没有想明白的一点是,每一个发出的声音,都是宏大的叙事。同样的一片土地,你在天上俯瞰下去是一小块豆腐块,你站在人群中平视过去,是无边无际的一大片广袤。这是视角和姿态的问题,和观点与立场无关。

说回乐队夏天。不太清楚是什么契机让马东做了这个节目,他自称完全不了解乐队,我想那只是说他和我一样是乐盲罢了,而不是真的不听摇滚乐。他年轻的时候不听崔健吗?我不相信。乐夏有不可避免的国内综艺的套路,但是看得出他确实在努力做到不同,努力做到不和其他的综艺同流合污。其他的不说,在最热闹的时候停办两年,然后重新启动,这个,至少从商业的角度看,够有范儿了。

再把话题往回拉,直接聊乐夏3刚过去的第一集吧。 先说超级乐迷

  • 高叶:因为看了狂飙才知道这个演员。不太了解。从她说话的范儿来看,像是喜欢摇滚乐的女孩(当然乐夏不是只有摇滚乐)
  • 张亚东:没毛病,虽然太闷骚。
  • 彭磊:咋说呢?从他第一集的表现可以告诉我们一件事,生活中的贫嘴毒舌和能在镜头前口吐莲花是两回事儿。当然,他刚到这个角色位置,还没玩明白也是有可能,可以继续看下去。
  • 那英:话题人物。估计录制的时候,刀郎的歌还没出,她还没被骂上热搜,但是节目播出的当下,她正好在风口浪尖儿上,对她的心理承受力也确实是个考验。我挺喜欢那英的,不太明白为什么那么多人讨厌她。很多人说她不懂乐队,而且不会作词作曲制作,压根儿不是音乐人,凭什么做超级乐迷。这角色又不是评委,叫”乐迷”,而且投票权也和普通观众一样,为啥做不得?甭管多讨厌她,那英唱歌在全球华语女歌手里也是头几名。她连个乐迷都做不了?这也太刻薄了。另外,总有人拿她和田震比,我觉得,单论唱歌,她比田震要强太多了,根本不是一个量级的选手。黑们就少说两句吧。
  • 大张伟:当然,不管超级乐迷都有谁,如果没有大张伟,这个节目可看性就去掉了50%。大张伟基本上包揽了这个节目乐队唱歌以外的所有看点。这孩子真的是人精,用生命朋克着的摇滚人。我对他的喜爱毫不掩饰,也因此经常被朋友嘲笑。他和马东正好配对,一唱一和,可以给这个节目定基调,也可以给这个节目上档次,当然前提是你得听得懂他说话的弦外之音。说他说话有弦外之音,并不是说大张伟说话说一半儿留一半儿,或者故意打着什么隐喻。而是他说话的边界感很强,虽然看上去口不择言,直接尖锐,但是他清楚地知道话头从那里起,在那里收住,可以不给节目带来麻烦,也不给对话者带来困扰。他说话没有什么话术,想到什么说什么,但是不会给他人找麻烦。这样的人,不要说娱乐圈,生活中都很少。我们总是夸奖那些所谓心直口快的人,但是常常忘记,心直口快和礼貌,善意是不矛盾的。总是说摇滚乐要be real,但是没有礼貌和善意的real,根本一文不值。大张伟在这个节目可以做照妖镜,看看那些人是real的real,那些人是不那么real的real。

最后聊聊第一集里出现的乐队。

  • 新学校废物合唱团:东北朋克教父的歌,我挺喜欢的。简单,旋律上口,歌词给力,这就是朋克,就是摇滚。
  • 橘子海:夏日漱石这个歌名是整首歌里唯一出现汉字的地方。听着还不错,不过我个人不太理解为什么一定要用英文写歌,作为听众没觉得写英文词有什么特别的必要性。
  • Mr.Miss:这个组合拉跨的是主唱,那个自觉很明星的刘恋。他们做的歌挺好,但是刘恋唱歌真的没有爵士味道。再加上她因为一些综艺,成了有知名度的明星,举手投足总是一股子我风情万种的样子,让人很出戏。不知道别人怎么看,我希望看到的爵士乐是更自由,随意没有设计和接地气的东西。
  • 柏林护士:我心里第一集中最好的乐队。没什么好说的,就是很rock
  • 康士坦的变化球:这乐队是乐夏今年要重点推的乐队吗?真的是给了他们足够长时间的PR。大家都在夸他们的歌如何感人,为什么我不是太能感同身受的?我能理解这首歌表达的情绪,事实上歌名已经直接给出来了:美好的事可不可以发生在我身上。但是这种表达总显得有点自怜自艾,堵在一个情绪点里走不出来,又不呐喊,仿佛一个人偷偷掉眼泪,然后叫大家一起来合伙悲伤一下。至少这样的歌不是我喜欢听到的那种摇滚乐。
  • 虎啸春:歌没怎么记住,就看他的乐手去一位一位得拥抱超级乐迷。然后还看到超级乐迷们感动。不知道这情绪是哪儿来的,可能是因为不在现场的缘故,所以感染不到我。反正这些都和他们的歌没一毛钱关系。
  • Nova Heart:被疯狂称颂的乐队,尤其是主唱的大飒妞。歌是真不错,大飒妞也是唱得真好,不过我更喜欢柏林护士。呵呵

总的来说,第一集没有特别让我跳脚的乐队,等着看后面乐队出场啦。

最近看的一些电影电视剧 moviesdrama

之前在国外想看国内的最新影视作品,很难做到同步,多少有些时差。感谢现在可以翻墙回国的VPN和互联网大厂对海外观众的开放,去国多年第一次在国外和天朝同步了最新的电影和电视剧。从新年到现在,大概把2023年最新的一些片子都捋了一编。说说感想

  • 流浪地球2

    怎么说呢,明显比不上1。虽说90%的影视续集都没办法超越原生第一代,但是我说流浪地球2比不上1,倒不是这个意思。流浪地球1我很喜欢,他确实是和好莱坞不一样的中国式的科幻,或者说是东方式的地球末日情节吧。没那么多走投无路的矫情,没有一个人拯救一个物种的舍我其谁,更没有好像地球上从来只有白人的自大,流浪地球1说的是很直白的慌慌张张,忙忙碌碌,有伤感,有别离,有无可奈何,更有无能为力,东亚似的,哪怕用个偏贬义的词“自怜自爱”也没关系的情感输出。并不是说这种情绪或者表达多么好,但是他就是我们这个民族原有的样子。但是到了流浪地球2开始变味儿,有种大国崛起的德行。个人不太喜欢。为什么会有这种变化不得而知,或许是因为战狼吴京在这一集的深度参与。你看李雪健从头到尾穿着中山装,一发言就是高屋建瓴,我朝在上的样子,很吴京。

    当然讨厌看美国拯救地球,但是同样不喜欢看中国拯救地球。真有地球毁灭在即的那一天,咱们这个物种的每一个个体,每一个群体都应该不知所措,都应该惊慌失措。不是说世间没有英雄,没有可能到时候哪个国家振臂一呼,四方相应最后带领大家绝处逢生,而是说到了那个时候,谁还在乎谁是领袖,谁是霸主,谁比谁更加慷慨激昂呢。

    总的来说,流浪地球2,特技很棒,情节有点拖沓,更重要的开始硬上价值,一个IP要被玩儿坏了。

  • 满江红

    很多人不喜欢,或者看不上张国师,但不管怎么说,在我眼里满江红比流浪地球2好很多。个人也曾经不太看得上国师那种傻乎乎,未成年似的的家国情怀。尤其是在《英雄》里展示的那个“不杀”的和平主题,当年骤一听还以为是少先队老师出来讲课,透着浓浓的红领巾味道。但是随着张国师在电影,主题活动,开幕式的各种作品展示,我忽然觉得,他的家国情怀,其实朴素而自然,和战狼似的那种所谓爱国情怀完全不同,是非常个人化而且内向的。没有什么不好,而且很可爱。

    电影拍得很棒,至少对我一个外行人来说,大师拍的东西,哪怕是游戏之作,他的水准也是在线的。其实张艺谋很在行拍这种闷骚的轻喜剧。《有话好好说》,到现在为止,在我心里依然是大陆最好的喜剧电影之一。满江红里的小滑稽好在没有刻意,是你我他平时互相逗逗闷子的那种,这样的喜剧在大陆已经很久不见了。大陆喜剧被徐峥们彻底搞烂,满大街都是呲牙咧嘴,大指甲挠胳肢窝那种用力过猛的片子。

    电影最后的齐诵满江红,无论是不是很多人不喜欢,我觉得对张艺谋而言他是水到渠成的,他是必须要有的一个情节。我觉得张艺谋在拍这一段的时候,自己是感动的。他在电影过场中用了很多豫剧,猛一听还以为是秦腔。当然,岳飞是河南人,但是这故事里没有岳飞,一个南宋的故事,一帮天南海北的人物,张艺谋选择了大段的铿锵有力的源于秦腔的豫剧做背景音乐,我觉得这就是他的家国情节。一个人他忘不了乡土,那就是可爱的。

  • 宇宙探索俱乐部

    电影类型写的是“科幻喜剧片”。我看到快结束,只看到喜剧,没明白科幻是咋回事儿,还以为这个类型介绍本身就是喜剧的一部分呢。到了最后,孙大通被外星人接走才算圆了“科幻”的主题。

    好电影,必须的。

    不过有两点。其一,是这种通篇的第一视角的运动镜头,不要说在电影院里,我在家里看电视都看得有点头疼。真要在电影院里看,我怀疑一半儿以上的观众得看到呕吐。这种运镜真的是考验观影者的小脑发育机能。属于体检的一种吧。

    其二是,不太喜欢最后外星人真的降临地球的情节。虽然终于靠这个情节把电影搞成了科幻类,但是他也可以不是科幻,谁规定非要科幻呢。如果我是编剧,我会让主人公最后摔下山崖,然后昏迷不醒。被世人救起后,大家以为他真的找到了外星人,等到他醒来,全世界都在追捧他的第一类接触。他因此成了寻找外星人事业的领头人,功成而名就。开始虽然有点怀毅,到了最后,他自己也开始相信自己确实接触过外星人了,唯一的悬念是孙大通不知所踪,但是不重要,电影嘎然而止。

    总觉得所有的探索,所有的出走都是原地打转。哪怕人类走出太阳系,我们依然困在自己的体系之中,除了自鸣得意一无所获。扯远了,和电影品质无关,个人口味罢了

  • 狂飙

    很棒的电视剧,比从前的人民名义强多得多。 一边看我一边在想一个问题,这片子是怎么过审的?后来想明白了,因为编剧很狡猾。

    其实这部剧分成两部分,一部分是主线故事,另一部分是吴刚演的(话说,吴刚真的没整容吗?再问一遍,真的没整容吗?回答我说没有的话,我就再问一遍)纪委干部带出来的副线,而副线是为了过审用的,没有他,狂飙再狂,也狂不到屏幕上来。之所以说人民名义不如狂飙,就是因为我记得人民名义里也有类似的结构,但是他的副线和主线混在在一起了,导致人民的名义最终成了宣宣们要看的电视剧。而狂飙的狡猾在于,拍给宣宣们的情节和主线是几乎独立的,你把吴刚出演的那些情节大部分都删除,会发现根本不影响整个故事的展开。这种刁钻的结构设计,简直是。。。。我太喜欢了!

  • 漫长的季节

    这十几年来看过的最讲究的大陆电视剧,没有之一。 辛爽作为摇滚乐手出身,光配乐一项就已经碾压似的强过了大部分大陆电视剧导演。

    至于说道讲究二字,是相对大陆电视剧一贯的粗制滥造而言的。现在我天朝有钱了,无论是电影还是电视剧,CG,大场面,豪华服装等等毫不吝啬得一坨一坨得往屏幕上堆,透着非常地道,自信的两个字:富裕!但是“粗”和“烂”这两样病,靠钱都治不好。画面全是修图,修完了人脸修背景,很多片子拍的是实景,看到的都是每一个像素上的合成色。情节更是相当考验观众的修养,时缓时急,前面挖一堆坑,后面叠一排山走到哪儿算哪儿,没有逻辑只有漏洞。演员就更不能提,全部换成CG会导致片子整体表演水平的提升。台词更是想怎么说就怎么说,前言搭上后语属于中奖行为。

    反观漫长的季节,每一帧都可以上大屏幕。光影,布局都有导演的精心设计。运镜里的小心思,画面里看似不经意的前后呼应,丰富的细节支撑起一集一小时的时间,丝毫感觉不到冗长,反而觉得转瞬即逝,忍不住要看下一集。演员都是正经八百的演员,都是正经八百得在演戏。而老戏骨们的对手戏,每一场都精彩。有冲突,有个性,而且有趣。台词很用功,没有废话,照顾人物个性的同时,用最有效率的方式推动情节发展。

    写到这里才发现,上面这些夸辞,不都是一个电视剧应有的品质吗?可见观众苦大陆电视剧久矣。

    漫长的季节,我看也算是东北文艺复兴的一部分吧。看东北的故事总有一种让人唏嘘的感觉。在我天朝,让人唏嘘的事儿,一般都过不了审,这个片子能过审而且过得如此丝滑,我猜是因为90年代毁掉东北的下岗潮是前朝的事儿。前朝之谬大,愈显我朝之英明。但不重要,重要的是这片子真好,而且还能让我们看到。其他的,去他妈的吧。

还是有关于吵架 :-) argue

有一个走廊,很安静,有人唱歌的话可能会扰民。有这么一个人,有点不识好歹,时不时要哼几句歌儿。可能确实有点扰民,虽然唱歌儿的人自己不太清楚,因为没人告诉他唱什么歌儿,唱多大声音算是扰民。这时候出现另外一个人,他没完没了得对唱歌儿的人吐口水。有趣的点是,吐口水的原因并不是因为唱歌的人扰民,而是因为他觉得唱歌的人唱得不好听,唱的不是他想听的歌儿。

吐口水的人就一直吐一直吐。唱歌儿的人一直不理会,直到被吐得浑身上下都是臭口水,忍无可忍了就回击起来。这时候一直沉默的走廊居民们出来劝架了,说,要以和为贵,不要争吵。说唱歌的人,你一把年纪了还那么大脾气。也有人说,你看你唱歌儿确实扰民了。

问题来了,大家的点都无懈可击。你看,做人不要和人起冲突,大家和平相处。没毛病。扰民这件事情做得不对,也没毛病。唱得不好听,唱得不合人口味,虽然只是听歌人的个人视角,但也无可厚非。当所有观点都很在理的时候,没人想得起,也没人在乎,有人被吐口水这件事情。

那么这个问题的解决方案是什么呢?就是唱歌儿的人闭嘴,而且最好永远闭嘴。唱歌儿的人闭嘴后,吵架的问题解决了,扰民的问题解决了,唱歌难听的问题也解决了。而被吐口水这件事情呢?他开始就不是个问题,因为口水没溅到唱歌以外的任何人身上,而且唱歌的人闭嘴了,口水可能也就不吐了。

这件事情告诉我们,如果被吐口水,而且口水只在你一个人身上,那一定是,嗯,你错了。。。

有关于吵架 argue

今天和某日本客户(严格意思上不能叫客户,该叫什么我也不清楚,不过不重要),因为一些工作和合约上的问题面对面争吵了整整两个小时。两个小时说得自己口干舌燥,结果是正面的,我得到了想要的结果。

要说的不是这次争吵的内容,要说的是这两个小时里体会到的关于争吵的一些小感想。争吵这件事最要不得是在口舌上争胜负。这说起来有点奇怪,争吵不就是在嘴上较劲儿掰斥吗?其实不是。说到底之所以要争吵,都是有原因的,没人会为了要锻炼嘴皮子跑出去和人吵架。所以在争吵中不要忘记“初心”。如果你没在一场精疲力尽的争吵后实现自己要得到的结果,那么就是把对方说得哑口无言,或者像诸葛亮骂死王朗一样,用嘴皮子送对方上了西天,吵完了也不会觉得自己获得胜利。拿不到想要的战利品的战争,就绝对不会是一场胜利的战争。道理显而易见。

所以如何守住自己的逻辑主线才是争吵的王道。今天的争吵里,有好几次,对方试图模糊焦点,腾挪了好几个不同论点,其中有一两个其实很尖锐,可以说我这方不能说完全占理。而在那种上头的情况下,会不自觉地要在每一个话题的口论中压倒对方,哪怕自己不占理。还好我中途感到有问题,及时止损,硬生生得将话题拉回来,放弃了在他方论点上的一较高下。之后对方一直试图从我的基本论点上跳出,但是我不管他说什么,就是不离开自己的基本盘。最后,对方开始进入沉默,无话可说,原因很简单,他知道没办法将我从我的话题阵地上引开到他可以大展手脚的题目上去。而在我的基本盘上,他原本是不占理的,所以既然我守住原阵地不动如山,他除了沉默就别无他法了。最终,争论的结果是我让他承认他原本不愿承认的事情。在这之前,在他几次强行跳转到的话题上,我是退让的。我可以让他赢一两个论点,我甚至接受他的一些指责,但是一定要死死得把他套在我需要在这场争论中最终赢得,而他原本不想给我结果那个话题,或者说逻辑主线上。因为这个才是自己口干舌燥要用两个小时时间来和他对峙的初心。

另外一个争吵中很重要的点是,千万不要上头。口舌之争,你来我往,很容易肾上腺飙升,最后眼红脖子粗。今天对方很显然有备而来,打印了一堆资料,一进房间,不等我开口就直接甩出他的第一个论点,而这个论点毫无意外得激怒了我,因为太胡搅蛮缠,并且罔顾事实。因此就直接引发了近10分钟的相互指责,各不相让。在这期间,我忽然反应过来,不对,这是对方的策略。虽然对方也看起来和我一样言语激烈,但是看得出来,他并没有像我一样真的愤怒。原因很简单,这本来就是他甩出来的话题,而且对我的指责也是在他设计好的路线上在你来我往。这就有趣了,我要聊的是A,而他一上来跳过B,开始谈C。他的战略很简单,在C上双方大刀挥动互砍一番,然后自然延伸到D,E,最后我自己估计都找不到路回到A。想到此,我忽然冷静了,声调降低,语速和语频也放缓,大部分时候在听他说,等他说完后,我慢条斯理得直接跳到A,仿佛刚才我被他激怒的事儿不存在一样。一转移到A,就感到他开始上头。他上头不是因为愤怒,而是因为他发现自己精心设计的作战战略被瓦解或者消弭了。说起来,冷静是争论里守住自己阵地的唯一办法。所有的争论,无论是有意还是无意,都是逻辑碰撞。只有心无杂念得守住自己的逻辑才能和别人硬碰硬。

吵架这事儿也许伤身,但是一定醒脑。– Xiang Ruan

My new personal website website

Here comes my new website! I will explain this new website in details soon.

新しい個人ウェブサイトを立ち上げました!このサイトの構築について、後日に説明する予定です。

我的崭新个人网页开张了。过两天会更新一篇文章聊聊这个网站的制作。

Tech @tech

Put some of my personal Emacs tools on github emacsgithubdwimchatgpt

I have just uploaded some of my personal Emacs tools on GitHub and made them public.

This repository includes some of my Lisp tools that I use in my everyday work. All these tools are very personal, which means that I may not provide detailed support, and they may have bugs. Additionally, since they are designed for my personal use, the interface or usage may not be user-friendly, making it difficult for some people to use them.

However, I am sharing these tools for those who have a similar working style to mine. It would be highly appreciated if you download these tools, and even more so if you provide feedback for any improvements.

I will continue to upload my tools to the repository, and I also hope that people will share their personal tools with me as well. :-)

Automatically update org-agenda-files emacsorgagenda

I heavily rely on org mode for my daily schedule, project management, personal learning, paper/book reading, and all forms of writing. One of the crucial aspects of my workflow is using org-agenda to gather my schedules, to-dos, and appointments from all the org files in my working folder. This function has significantly improved my efficiency.

However, org-agenda does not automatically update the file list for aggregation. For instance, if you set org-agenda-file to monitor a folder such as $HOME/Org/Work, org-agenda fails to add a new org file under $HOME/Org/Work to its file list unless you manually update org-agenda-file by evaluating the command

(setq org-agenda-file '(xxx xxx xxx))

again.

To solve the problem, I first try to get help by using filenotify mode. The plan is to utilize the file-notify-add-watch function of filenotify to monitor files or folders for org-agenda's aggregation. Whenever there is any change, it will automatically re-evaluate org-agenda-file. After doing some research, I wrote a script similar to this.

(require 'filenotify)
(defun my-notify-callback(event)
  (setq org-agenda-files (append
                          '("path_to_folder")
                          )))
(file-notify-add-watch
 "path_to_folder" '(change attribute-change) 'my-notify-callback)

I believe this is the best solution for my problem. However, it appears that it is not working as expected, and I am unsure why. Despite my attempts at debugging and searching for solutions on Google, I have had no luck so far.

Thus, I opted for another method. I added a hook function that evaluates org-agenda-file to the org-agenda-mode-hook. The code is straightforward:

(defun my-set-agenda-files()
  (setq org-agenda-files (append
                          '("path_to_folder")
                          )))
(add-hook 'org-agenda-mode-hook 'my-set-agenda-files)

The Org-agenda-mode-hook is activated before org-agenda is executed, meaning that Emacs will evaluate org-agenda-files every time org-agenda is invoked or restarted. While this solution may not be perfect, especially for those with a large number of org files in the watched folder, it works for my needs. Additionally, since I do not have a large number of org files in my working folders, the potential slow down issue is not a concern for me.

Note: org-agenda-files does not monitor all the org files within a specific folder. I am not sure where the problem lies, but it seems like org-agenda only gathers the org files directly within the folder specified and does not look up files recursively. To resolve this issue, you can specify the folder as follows:

(setq org-agenda-files (append
                        '("path_to_a_file")
                        (directory-files-recursively "path_to_folder" "\\`[^.].*\\.org\\'")
                        )))

The function directory=files-recursively is the solution. :-)

Writing slides with Webslides under Emacs emacswebslides

In my line of work, writing slides for different purposes is a regular task. To ensure seamless work without leaving Emacs, I typically use org mode to create my slides and then present directly via org-tree-slide or export the org file to beamer. These methods work well for most of my presentations as the slides turn out simple and visually appealing. However, for more complex presentations that require multimedia such as embedded videos, large background images, animations, like those created in PowerPoint, additional steps may be necessary.

I do not wish to use PowerPoint as it is not available on Linux. While there are alternatives such as LibreOffice, WPS, and online document services like Google Sheets, I prefer to write my slides in Emacs using text.

There is an Org exporter called “org-reveal” available on GitHub that helps users write Org files and export them to reveal.js files. If you are unfamiliar with reveal.js, please visit the official website (https://revealjs.com/) for more information. Simply put, reveal.js is a framework for creating HTML-based presentations. It is a powerful tool, and the slides produced by Reveal.js are visually stunning. However, I found org-reveal somewhat challenging to use. For simple slides, the process is quite straightforward; write an Org file and export it using org-reveal. Then, open the exported HTML in the browser to present the slides. However, to fully leverage Reveal.js's capabilities, you may need to customize your Org file using many “PROPERTIES.” Additionally, I found the layout definition of Reveal.js to be somewhat confusing. Of course, this is all subjective, and it could be that I simply do not have enough experience with Reveal.js or org-reveal. I'm sure there are many fans of org-reveal and Reveal.js out there; it's just not my favorite tool.

What I finally found is Webslides, an HTML-based presentation tool that is different from Reveal.js in that it is very easy to use. Here's how to use Webslides:

  1. Download the Webslides files (a zip file) from the top page of index.html of Webslides.
  2. Unzip the file.
  3. Start creating your slides by editing index.html under the root of the folder you just unzipped (or first rename the index.html to a new file name of your choosing).
  4. Open the file in a browser for presentation.
  5. Leverage Webslides’ capabilities by simply copying and pasting HTML source code from files under the “demos” folder (HTML files under the “demos” folder are documents of Webslides).
  6. After finishing your slide writing, you can delete the demo folder and other files under the static/image folder not used in your slides to make your slide folder clean.
  7. Repeat the above steps for other slides writing.

Editing HTML files under Emacs is fairly simple, particularly when utilizing the web-mode mode. To streamline the process of writing content instead of designing slides, I created several Yasnippet snippets to insert HTML clips specifically for webslides. Here is an example:

# -*- mode: snippet -*-
# name: mywebslidesflexblock
# key: /mywebslidesflexblock
# --
<ul class="flexblock ${1:$$(yas-choose-value '("client" "client border" "steps" "features" "specs" "activity" "gallery" "metrics border" "plan blink"))}">
    <li>

    </li>
    <li>

    </li>
</ul>

The code snippet is used to insert a Webslides flexblock into the website. As shown, I have included options for various flexblock properties to customize the appearance of the block. With the help of these snippets, creating Webslides presentations becomes effortless, as I can concentrate on the content while leaving the design and layout aspects up to the code. This ensures that my pages look visually appealing and are easy to navigate using Webslides.

I still want to use org mode to make my slides, and I am considering writing an Org exporter for Webslides. I am not sure if I will be able to create it, but if I do, it will be the perfect tool for writing slides for me!

Install debian on Matebook X Pro 2019 – old blog in 2019 debianmatebookpro

Note
I wrote a blog post on my old website about installing Debian on the Matebook X Pro 2019 in 2019. Although it was written four years ago, I believe it is still relevant and helpful to some people today. I have now copied the post to my new website here, and while some of the information may be outdated, I have not made any updates. Please find the original blog post below

I recently purchased the Huawei Matebook X Pro, which I had been eyeing for a few weeks. While Apple is a great company with quality products, I had grown tired of their closed source OS and exclusive ecosystem. As a Linux user, I found myself spending the majority of my time on my Macbook Pro using open source software installed through iTerm and homebrew. What I truly desired was a laptop with a pure Linux operating system.

Unfortunately, Linux had serious power management issues in the past and Windows laptops could not compare to the beautifully designed Macbook. However, I am pleased to say that the power management issue has been resolved with current versions of Linux (see power management section below). And even more exciting, I finally found a laptop that exceeds the Macbook Pro in both design and hardware performance - the Huawei Matebook X Pro.

The laptop is stunning, as the image depicts.

Figure 1: Matebook X Pro 2019

Figure 1: Matebook X Pro 2019

With a price almost as same as the Macbook Pro (even slightly cheaper), its specifications are impressive.

display 13.9 inch touchscreen LTPS LCD
contrast 1500:1
resolution 3K: \(3000\times 2000\)
fingerprint yes
CPU Intel core i7 8550U
mem 16GB
HDD 512GB SSD (NVMe PCIe)
graphics NVidia Geforce MX150, GDDR5 2GB
speaker Dolby Atoms surrounding speakers
battery 15.8 Hours(official)
interface USB-C X 2, USB-A X 1
weight 1.33kg
size 304mm X 217mm X 14.6

I won't delve into the details of how excellent the Matebook X Pro is since this memo is solely about installing Linux on the device and not a product review. There are numerous review articles available online for anyone interested. In my opinion, it's the best laptop in the market, surpassing even the Macbook Pro, and Huawei has truly outdone themselves!

For those interested, I've compiled a brief summary of my Linux (Debian 10) installation process on the Matebook X Pro below:

Debian installation

Follow the website https://techbear.co/matebook-pro-debian-linux-guide/ to create a bootable USB using the Debian testing netinst ISO file. Restart your computer (press F12) to initiate the installation process. The only important thing to keep in mind, as mentioned on the website, is that the

  • Debian netinst ISO does not include the driver for the Intel wireless card of the Matebook Pro X. Therefore, you need to manually download the driver from https://packages.debian.org/buster/all/firmware-iwlwifi/download and save the file in the newly created ‘firmware’ directory on the USB stick before installation.”

Applications and configures

  • google drive

    My everyday work heavily depends on Google Drive. Unfortunately, Google has not yet released a Linux version of Google Drive. (I am so disappointed with Google for this!) In Gnome, one can add their Google account to Gnome's online account to use Google Drive as local folders. However, it is not a syncing scheme, but rather an online mount by Google-Drive-ocamlfuse, which can be very slow in some situations, especially for large file transfers. There are several commercial Google Drive clients for Linux, but I have found that the best one for me is Insync.

  • display

    The Matebook X Pro features a HiDPI display with a resolution of \(3000\times 2000\), which can cause the default windows of many Linux applications to appear very small. Personally, I use Gnome as my desktop manager, which takes care of this issue by enlarging its applications with a certain scale. Unfortunately, I do not have a general solution for non-Gnome applications. However, for those using QT-based applications, you can follow the steps outlined on this website to modify the application's default resolution. To provide an example, I have created a script to launch Insync (my Google Drive client for Linux) with the adjusted resolution. Simply use this script instead of the original Insync command to start the application.

    QT_AUTO_SCREEN_SCALE_FACTOR=1 insync start
    
  • fingerprint

    The Matebook X Pro has a great fingerprint sensor, but unfortunately, Linux cannot recognize it. There are some people currently working on driving the fingerprint sensor for Linux, but the projects are still in progress. I hope this project will be officially released soon, as I personally don't need the fingerprint sensor for quick login, so this problem doesn't bother me.

  • power management

    Linux has suffered from not having good power management on laptop for a long time, however things seem have changed in recent years. TLP is a great power management tool for Linux that has dramatically improved the battery life of laptops, as reported on the internet (example report 1 , exmpale report 2)

    To use TLP, simply…

    sudo apt install tlp tlp-drw tlpui # tlpui is a python GUI for tlp.
    

    With TLP, in my case, a full charge can support at least up to 7 hours usage.

  • speaker

    The Matebook X Pro has a fantastic 4-speaker system that is supported by DOLBY Atmos. To use it with Linux, check out “Update 1” on this blog.

Build my own website by oxhugo+loveit+netlify netlifyoxhugohugoloveitemacsorg

I am constantly searching for a simple way to maintain and update my personal website. Here is what I would like to achieve:

  • Updating the website without having to leave Emacs
  • Writing all content in org mode
  • Managing versions of my source code
  • Creating a static website with no database or dynamic content generation
  • Enabling full-text search
  • Allowing comments
  • Including LaTeX equations, charts/figures, and multimedia through plain text, which automatically renders on my website
  • Designing a beautiful website

Essentially, all I need to do to maintain my website is write some text and save it. All other updating tasks should be automatically processed by a machine.

Some may believe this workflow impossible to achieve, but I have discovered some Emacs tools that fulfill most of the above functions. While none are flawless, they are still impressive and only require one more step to reach perfection.

Finally, I have found the solution. I can use hugo, oxhugo, and netlify. If you are reading this blog on my website, then you know how well this solution works.

Below, I summarize my setup for this workflow. There are numerous steps, and I do not describe them all in detail. However, if you have a basic understanding of Emacs, org-mode, and web applications, I believe this tutorial could be helpful. So let's get started.

Step 1: install hugo

Hugo is known as

The world’s fastest framework for building websites – Hogo official website

For those who may not be familiar with Hugo, please check out its official website for more details. In Debian, you can easily install Hugo by

sudo aptitude install hugo

To get started using Hugo, follow the steps outlined in its documentation

$> hugo new site quickstart # make new project
$> cd quickstart # go into project folder
$> git init # start git
$> git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke themes/ananke # add a theme
$> echo "theme = 'ananke'" >> config.toml # set theme name in config
$> hugo server # start a local hugo develop site

There are many themes available for Hugo at https://themes.gohugo.io/, allowing you to customize your project even further. You can edit the config.toml file to configure Hugo, but for more detailed information, please refer to the Hugo documentation.

Step 2: setup ox-hugo

I assume that you are familiar with Emacs and org mode, or at least you use Emacs for your daily work. If you are not an Emacs user, then this article may not be for you. :-(

ox-hugo is an org exporter that exports org files to Hugo markdown files. To install ox-hugo, use package-install and add the following to your .emacs file:

(require 'ox-hugo)

Then you will be ready to go!

“Create a folder within your hugo project folder, such as ‘content-org’ or any name you prefer. There are two ways to write org files for Hugo: one post per file or one post per subtree. The latter is recommended by ox-hugo due to its flexible content exporting and use of inherited tags.

To facilitate exporting to Hugo, ox-hugo uses PROPERTIES in the org file to specify what and how to export to Hugo markdown files. Here are some examples:

:EXPORT_HUGO_SECTION: sectionname
:export_file_name: index
:export_date: 2023-04-04

I created Yasnippet snippets to simplify the process of writing these properties, but you can also create your own to make your life easier.

If you want to add shortcode for theme in ox-hugo, check ox-hugo's shortcode document.

For a detailed usage guide of Ox-Hugo, please refer to its official website.

Step 3: setup theme of hugo

Setting up a Hugo theme may be the most important step in creating a website. There are many themes available on Hugo's theme website, and you can select any theme you like. However, it's important to note that a configuration for a specific theme may not work well for another. Therefore, it's important to carefully choose a theme before publishing your website to avoid problems when transferring themes.

I choose LoveIt theme for my website, which I think it is simple and beautiful. I believe you can also find theme you like most. Most themes have very detailed configure document. The simplest way to make your own config file is to copy theme's example config file and modify it.

  • Shortcode To embed equations or multimedia in you website, shortcode is what you have to check. It is very easy to add chortcode in Loveit, check here for details

  • Search I believe that the most important function for a static website is the full-text search. Most themes can add a search function by using online search services such as Lunr or Algolia. In my opinion, Lunr is easier to use than Algolia because it can be used locally without uploading an index file to its website, on the other hand, one has to upload an index file to Algolia to keep the search index updated. However, the downside of Lunr is that it cannot search CJK characters well, which prevented me from using it on my website. Instead, I use Algolia for my search backend.

    Fortunately, as I will mention later, if you host your website on Netfily like I do, the Algolia plugin for Netfily will take care of uploading the index for you, making use Algolia as simple as Lunr.

    I will come back to this topic on how to configure Algolia in Hugo in the next section of Netlify.

Step 4: setup website hosting

The final step in building your website is to select a website hosting service. Since we are discussing building a website using Hugo, the chosen website hosting service should be Hugo-focused. Currently, I believe Netlify is one of the best website hosting services for a Hugo-based website.

Go to Netlify and sign up for an account. Once you've signed up, log in to your account and select a plan. For a simple personal webpage like mine, which doesn't involve large file transfers, I recommend choosing the free starter plan, as it should provide everything you need.

Under the personal account page, one can set up website hosting by clicking on “Add new site”. As the website source code is hosted on the Git server, the best way to add a new site to Netlify is by “Importing an existing project”. You can then choose the Git server where the source code is located. Follow Netlify's instructions and select the repository of the website's source code and other settings. After site settings, the next step is to link your domain to Netlify. This can be done easily by following Netlify's instructions. If you don't have your own domain, you can access your website through Netlify's subdomain with a URL like “accountname.netlify.app” where “accountname” is the site name of your web hosting on Netlify that was set during site setting. It's recommended to set up an SSL/TLS certificate for your website if your domain already has one.

To ensure that the domain is fully functional for web hosting, it is necessary to verify that the DNS settings have been updated on your domain management service with the NDS servers recommended by Netfily. Additionally, it is important to ensure that the ‘baseURL’ parameter in the ‘config.toml’ file of Hugo is correctly set to your domain address.

If you also host your domain's email on a domain service like Google Domain, you have to migrate the email DNS record to Netlify, or else your email system may crash. For a complete migration to Netlify, follow the steps outlined by this website and this website:

  • Access your Netlify account page's “Domain” setting and add a new DNS record.
  • Go to your current domain service website, such as Google Domain. In the DNS settings under “Google Workspace” and “Default name servers,” you will see DNS records like MX, SPF, and TXT.
  • Refer to the information above, return to your Netlify account, and add the new DNS records for MX, SPF, and TXT one by one.
  • After adding email DNS records, it's time to set the domain pointing to Netlify. In the DNS settings of Google Domain, activate “Custom name servers,” then add Netlify's name servers, found on the “Name server” list in the “Domain” setting on Netlify.
  • Add your domain as the primary domain in the “Domain” setting on Netlify.
  • Finished. The setting may take time to take effect, usually 10 minutes to a few hours, although Google claims it can take up to 48 hours to change.”

Step 5: add search fuction

Here comes the last configuration - to me, the most important function needed by my website: searching. As I mentioned in the last section, I use Algolia service for search. Regardless of the service you use, Lunr or Algolia, the basic steps to add a search function to Hugo are the same. Go to the service website, sign up for an account, log in to the service, retrieve your service's API information such as appID and API token, and configure the config.toml of Hugo to enable connection with the service via its web API.

Since I mentioned that using Algolia requires uploading an index file whenever the content to be indexed is updated, it is possible to create a script for automation to avoid having to do it manually. However, the best solution is to use Algolia's Netlify plugin, which automatically uploads the index file to Algolia as soon as the website on Netlify is updated.

Thus, adding a search function using Algolia involves the following steps:

  • Signing up for an Algolia account and logging in
  • Following the tutorial on how to add a crawler for Netlify on the Algolia website
  • Editing the config.toml file to add Algolia parameters The format of the configuration may depend on the Hugo theme being used. Refer to the theme's documentation to find out how to configure search parameters. In my case, I use LoveIt theme, the basic configuration may look like the following.
    [params.search]
      enable = true
      type = "algolia"
      contentLength = 4000
      placeholder = "search my website"
      maxResultLength = 10
      snippetLength = 30
      highlightTag = "em"
      absoluteURL = false
    [params.search.algolia]
      index = "indexname"
      appID = "ID"
      searchKey = "xxxxxxx"
      siteID = "xxxxx"
    

    Where “index” refers to the name of your Algolia indexing, which can be found on the “Crawler Netfily” application setting page on Algolia. “appID” is the ID of the “Crawler Netfily” application, “searchKey” is the “Search-Only API Key” for “Crawler Netfily”, and “siteID” is the “Site ID” of the Netfily web hosting. You can find the “Site ID” in the “Site Details” section of the site settings on Netfily.

Workflow

Great news! The website construction is now complete. Here's how you can post new content or add a new blog post to your website:

  1. Open the org file, which is the source for your website. Write your content along with the necessary properties for ox-hugo.
  2. Use the keybinding “C-e H” to export your content to a Hugo md file using the ox-hugo exporter of org mode.
  3. Commit the new content to git and push it to your hosting git repository.
  4. That's it! Your website will be updated in a few seconds, and Algolia will also update its index for you.

Tips

  • If the website is hosted on Netlify, you don't need to push the “public” folder to the Git server as Netlify will compile the md files and generate static HTML files for you. It's recommended to add ‘public’ to .gitignore. When using ‘hugo server’ to preview changes on your local machine, Hugo will generate HTML files under the ‘public’ folder. Ignoring it in Git is a good idea.
  • I didn't do this, but it's possible to add hook functions to make the process from ox-hugo exporting to Git commit and push fully automatic. This could simplify the workflow: edit the org file, save it, and you're done!
  • Using Yasnippet snippets can make adding properties to org files very simple.
  • Learn to use shortcodes in org files to make the website more beautiful and functional with multimedia. There are various methods to directly handle shortcodes in ox-hugo's org file. Consider the example given below:
    • Firstly, add a header to the org file:
      #+HUGO_PAIRED_SHORTCODES: admonition
      
    • Then, you can add the admonition shortcode in the org file as follows:
      #+begin_admonition :type tip :title: "Note:" :open open
        This is my tip.
      #+end_admonition
      
    • You can use the above steps to include other shortcodes. In the code above, “type”, “title,” and “open” are parameters of the admonition shortcode.
    • For more details, please refer to this website and this website.
  • Enabling comments on the website is easy using comments services like Disqus or Gtalk. Please check LoveIt's documentation for details.
  • To easily add a new post, you can configure an org template and add your website source org file to the re-file target. Then, you are able to start writing a post anywhere within Emacs. After writing, simply submit the template or refile it to the website source code. However, I haven't done this yet. :-)

  1. Global patent in different country areas are counted respectively ↩︎