May 2020

Today, I went to visit my grandparents and played with my mobile phone. After playing with my mobile phone, my friend sent me a message: "is there any statement that can modify the folder path in batch?" so he asked about his needs. After half a minute's conversation, he found that it was dir/A => dir/2020/A According to the year corresponding to the excel table, classify the relevant catalog, and confirm that a few minutes is more than enough (too naive)

Since I didn't have a computer in hand and my mobile phone didn't have a proper editor, my friend suggested that he write it. I thought: OK.

Command is really difficult for people who have a programming foundation but can no longer reach their daily work. use readdirSync Listing all the directories under the directory has been operating for nearly half an hour, let alone debugging.

Calm down, I think, is it really necessary for ordinary people to learn? There is a certain need. If my friend simply grasps nodejs related skills, I believe that his work will be of great help. He does not need to manually copy and paste time-consuming, recognize the law of repetitive work, write scripts to execute the work, and efficiency will be his biggest experience.

After reading the above paragraph, it may mean "programming depends on work". I don't agree with this view. I agree with it Programming is a productivity enhancement Can be understood in disguise "Lazy" When it comes to computer programming, you can get a lot of data in front of you, but if you are in the front of the computer, you can also avoid being hit by a lot of data. Do not need to love, just because of interest and to understand, learn, meet the needs Happy, happy That's fine.

I saw it a few years ago "Python enters Shandong primary school textbooks" In retrospect, children's competitiveness has started since childhood. Cultivating thinking logic, observing children's interests and hobbies, and solving problems can be more logical.

In addition, programming should be regarded as a skill with the lowest threshold. After all, programs are everywhere in this era. Thanks to the open source sharing spirit of the Internet, relevant information can be readily available. The cost is really low, and learning is fruitful, You don't lose if you don't learn.

A strange bug was found in WSL today. Shouldn't sh be called directly under WSL

use Create React App Create a react application, yarn start Now, output Starting the development server... And then throw one Error: spawn cmd.exe ENOENT I wonder how this WSL is called to windows again cmd.exe It's weird. Hey

go create-react-app Turn it over Source code , executed an operation to open the browser and found that open Class library judgment windows Not just checking process.platform Yes, by the way wsl and docker The environment is also used as the judgment condition. The following splicing command is the final source of all evil

 root of all evils

Two ways to fix this bug

  1. take /mnt/c/Windows/System32 Add back the WSL environment variables so that you can pull up the default browser
  2. react-scripts/scripts/start.js Note it out openBrowser(url.localUrlForBrowser);