2020年8月22日星期六

Win10无法删除分区

https://m0n0.ch/wall/physdiskwrite.php

f you are unable to delete all the partitions with the Disk Management utility, try the following procedure:
  1. Open a command window as admin ("cmd")
  2. Type "diskpart" and hit enter.
  3. Type "list disk" and hit enter to find out the number of your drive.
  4. Type "select disk X" (where you replace X with the number of your drive) and hit enter.
  5. Type "clean" and hit enter.

2020年8月10日星期一

fortran

 Why do the GCC C/C++ compilers seem to recognize Fortran code in the errors
Fortran 90 compiling issue
Fortran 77 Tutorial
https://web.stanford.edu/class/me200c/tutorial_77/
gcc.exe error Missing libwinpthread-1.dll, but it is not missing
mingw-and-missing-dlls
Implied DO
fortran debugging
Debug Fortran Code with GDB
How to print Fortran arrays in GDB?
gfortran----Non-Fortran-Main-Program
Known Causes of Trouble with GNU Fortran
Arrays in subprograms
Sub-Array Manipulations in Fortran90
files_input_output.pdf
fortran77电子书
应该在open语句中加入模式参数,指定文件是用于读取还是写入,这样能避免文件名错误。



最终的解决方案:
1、对于丢失dll的问题,将mingw的bin目录加入PATH
2、 undefined reference to的问题:可以使用gcc编译,但要使用gfortran进行链接。

you can compile with gcc as long as you link with gfortran:
gcc -c foo.f95
gcc -c bar.f95
gfortran -o program foo.o bar.o


 If you were working on a project that has portions in a mixture of languages, you would have to link with gcc and supply the necessary options, e.g.
gcc -c c_component.c
g++ -c c++_component.cpp
gfortran -c fortran_component.f95
gcc -o  program c_component.o   c++_component.o   fortran_component.o   -lstdc++   -lgfortran

2020年8月9日星期日

禁止firefox自动更新

 Never check for updates was removed in Firefox 64.
the policies.json is the 'trick' to override the lack of that old preference.

How do you completely turn off update checks in Firefox 64?
You can use a policies.json file to disable updates for all users.
 https://github.com/mozilla/policy-templates/blob/master/README.md

2020年8月4日星期二

bash 快捷键

bash_shortcuts

Controlling the Screen

The following shortcuts allow you to control what appears on the screen.
  • Ctrl+L: Clear the screen. This is similar to running the “clear” command.
  • Ctrl+S: Stop all output to the screen. This is particularly useful when running commands with a lot of long, verbose output, but you don’t want to stop the command itself with Ctrl+C.
  • Ctrl+Q: Resume output to the screen after stopping it with Ctrl+S.

Moving the Cursor

Use the following shortcuts to quickly move the cursor around the current line while typing a command.
  • Ctrl+A or Home: Go to the beginning of the line.
  • Ctrl+E or End: Go to the end of the line.
  • Alt+B: Go left (back) one word.
  • Ctrl+B: Go left (back) one character.
  • Alt+F: Go right (forward) one word.
  • Ctrl+F: Go right (forward) one character.
  • Ctrl+XX: Move between the beginning of the line and the current position of the cursor. This allows you to press Ctrl+XX to return to the start of the line, change something, and then press Ctrl+XX to go back to your original cursor position. To use this shortcut, hold the Ctrl key and tap the X key twice.

Deleting Text

Use the following shortcuts to quickly delete characters:
  • Ctrl+D or Delete: Delete the character under the cursor.
  • Alt+D: Delete all characters after the cursor on the current line.
  • Ctrl+H or Backspace: Delete the character before the cursor.

Fixing Typos

These shortcuts allow you to fix typos and undo your key presses.
  • Alt+T: Swap the current word with the previous word.
  • Ctrl+T: Swap the last two characters before the cursor with each other. You can use this to quickly fix typos when you type two characters in the wrong order.
  • Ctrl+_: Undo your last key press. You can repeat this to undo multiple times.

Cutting and Pasting

Bash includes some basic cut-and-paste features.
  • Ctrl+W: Cut the word before the cursor, adding it to the clipboard.
  • Ctrl+K: Cut the part of the line after the cursor, adding it to the clipboard.
  • Ctrl+U: Cut the part of the line before the cursor, adding it to the clipboard.
  • Ctrl+Y: Paste the last thing you cut from the clipboard. The y here stands for “yank”.

find xargs

find . -type f -name '【xxxxxxxxxx】*.*'  -print0  |  xargs -0   rename   -e 's/【xxxxxxxxxx】//'

https://shapeshed.com/unix-xargs/

how-to-batch-rename-files-in-a-macos-terminal

make-xargs-handle-filenames-that-contain-spaces

how-to-rename-multiple-files-using-find

xargs-command-examples

find-a-pattern-in-files-and-rename-them


-print0
       True;  print  the  full file name on the standard output, followed by a null character (instead of  the newline character that -print uses).  This allows file names that contain  newlines  or  other  types  of  white space to be correctly interpreted by programs that process the find output.  This option corresponds to the -0 option of xargs.

find . -type f \( -name "*.java" -o -name "*.xml" -o -name "*.html" \)