Monday, November 15, 2021

[Python] Python Main Functions

This article is very useful:

Four best practices to make sure that your code can serve a dual purpose:
  1. Put most code into a function or class.
  2. Use __name__ to control execution of your code.
  3. Create a function called main() to contain the code you want to run.
  4. Call other functions from main().

Thursday, November 4, 2021

怀念我的导师

我的导师埃里克去世了。我失去了一位精神上的父亲。对于这个领域的研究者来说,损失了一位巨擘。我们如同失去了领袖的羊群,无家可归。又如同丛林里最古老的苍天大树,苍茫倒地,地撼天摇。

导师一生积极进取,带有骨子里的固执和坚持。他对学生的思考程度和科研品质一如既往高要求,因此带出了我们领域一批又一批的大牛。他评价学术工作向来直截了当、一针见血。老人家坚持自己的观点,从不趋炎附势,从不在意别人的评价或误解,也从没有怕过任何学术势力,不管对方规模多大、名气多响。和癌症搏斗的这几年,他对自己也很少有懈怠放松,日日坚持来办公室,周周和学生讨论不断。

但他也吃了很多苦头。他的生活向来有格调,喜欢红酒和美食,也常去健身房锻炼。他生病以来,诸事不便,而世态炎凉,我也算见证了研究组的萎缩,身边亲友的流失,学校院系的冷落。看着他罕有的虚弱,心有戚戚焉。其实,抛开声名远扬的名教授身份,他也爱跟朋友谈天说地,喜欢热闹的城市,向往退休的生活。学生看导师,都把导师当成神。也是因为生病的缘故,我们得以从人的角度去发现更多维度的他。

仙人掌满身是刺,内里却是柔软。

读博士这几年,我因为种种事情对导师的感情非常复杂,有敬畏、有害怕、有不甘、有自豪、有感动。五味杂陈,往事只能回味。博士最后一年,所有的感情都汇聚成感激和感恩。是他、他的精神、他培养的师兄师姐,让我成为了今天的我。在这疫情阻隔相聚的时刻,我无比怀念他,希望他一路走好。

人生终需一死,只是不知道是哪一天。生命有短有长,只是不知道其重量多少。唯有做有心的事情,才不枉此生来人间走一遭。我也会好好努力,如果他能想到我,希望他也会感到安心和骄傲。

Tuesday, November 2, 2021

[Windows 10] Multiple displays with docking station II - enable Night Light

After I reinstalled all the drivers, I found that the external monitors didn't react to the Windows 10 Night Light adjustment through the dock. This Night Light feature is super cool and it is annoying that the dock cannot support it naturally. 

I found the instruction from this DisplayLink webpage How to enable night light or f.lux on DisplayLink displays on Windows. It worked! The only thing - you need to run the Registry Editor using the administrator credential. 

[Windows 10] Multiple displays with docking station I - cannot change display resolution

I have been using the Dell DisplayLink docking station to extend my laptop to two external monitors, keyboard, and mouse. Both monitors are Dell, and one uses HDMI and the other uses DP cable to connect.

Last week after a Teams meeting, the two external monitors (Display 2 and 3) could not be detected properly. They were detected, which means the monitors did not show the moving "no signal", but they were not active and the monitors were black. I looked up online and found that most people complain that the external display cannot show up when the lid is closed. Ironically, if I closed my laptop's lid, both external displays showed perfectly fine, without any problems! It was very annoying. 

I have done several power cycles, like unplugging the dock from the laptop, unplugging the power for the dock, and restarting my laptop... I also implemented the Dell command update. Neither of them worked.