Wednesday, December 7, 2022

Learning how to feed arguments to command line - Argparse

Beginner on Argparse. The following are from the Official documentation.

The argparse module’s support for command-line interfaces is built around an instance of argparse.ArgumentParser. It is a container for argument specifications and has options that apply the parser as whole. The first descriptive message for the program is determined from sys.argv[0] or from the prog= argument. 

Wednesday, November 23, 2022

[WSL] Visual Studio Code SVN

 I use VS Code for some cross-platform coding and use Git/SVN for version control. In general, I don't see any problem with Git on VSC, but recently when I installed SVN extension on VSC, there is a warning showing up every time that is super annoying.


Then I realize the reason may be that the Git related repo is on the Windows, while the SVN is installed in the WSL. So it could not recognize the executable (both file type and path). 

As mentioned in my previous post, one can launch VSC from both Windows or WSL. After I started VSC from the WSL terminal, then I found that I can install the SVN extension for WSL successfully without warnings. So for this feature, I will need to use the WSL's VSC. 


Sunday, July 10, 2022

iPhone iMovie project videos not loaded

One thing I did not know before is that a project in the iMovie uses the materials from the iPhone, instead of making hard copies. I deleted a lot of the original video clips from the photo library to save space, then when I opened the project in iMovie, it said videos are being downloaded from icloud, but it stuck there. This means the videos are no longer available. 

The end of the world?

Fortunately, I used the Image Capture before to export the videos of iPhone photo library to my Macbook. Therefore, I can use the following to recover these iMovie projects.

Tuesday, July 5, 2022

2022年回国记录

2021年夏天,从打完疫苗开始,我就一直想找个好的时机回国休假。观望了半年,见证了Delta的大爆发,我默默地把时间点延后到22年。根据网上各种预(瞎)测(猜),病毒会在2022年的6月份消停。于是,我决定22年暑假走,和老板申请了暑假在国内远程工作的许可。

购买机票

疫情以来,美国赴华航班只有几个有限的门户城市,加州、西雅图有些航班,美东更是只有纽约JFK-上海的东航MU588航班。需要考虑的几个因素是,该门户城市是否容易前往,熔断概率(稳不稳),机票价格,航行时间等。我第一个想到的自然是MU588,毕竟是直飞,好几个朋友成功坐这个航班回去;但是,这个航班最抢手也最贵,往往需要提前几个月购买,加上纽约人员密集,感染人数一高,熔断的机率也高。于是我还考虑了从旧金山出发的UA857,一是价格感人,二是这个航班熔断很少(据说是因为飞机时间是上午,乘客浪的机会少了)。