Author Archives: albertsk

About albertsk

University of Hawaii professor

Learn The Entire Python Language In A Single Image (link)

An interesting page that contains a single image for python language. Here. Image link: Here

Posted in Uncategorized

How to replace the 4th occurrence of a character in a file using sed

sed -i “s/\”/ \”/4″ myFile.txt The above command will replace the 4th occurrence of “ by “ in file “myFile.txt”, which is equivalent to putting a space in front of the 4th double quote.

Posted in Uncategorized

How to change an extension of many files

In a Linux terminal: $ for f in *.txt; do mv — “$f” “${f%.txt}.text”; done will rename all *.txt to *.text files.

Posted in Uncategorized

How to compile .tex file without stopping

Method 1: using pdflatex to generate a pdf file $ pdflatex -interaction nonstopmode myTexFile.tex Method 2: using latexmk to generate a dvi file. $ latexmk myTexFile.tex

Posted in Uncategorized

How to write output values to the standard output without carriage return in FORTRAN

How to write output values to the standard output without carriage return: program tstNoadv integer :: i do i = 1, 10 write(*,”(A1,I6.4,$)”) char(13), i call system(“sleep 1”) end do write(*,*) “Done” stop end program

Posted in FORTRAn

How to make a pdf output from LyX without opening LyX file

Suppose you have a LyX file, my_thesis.lyx, in the current directory. Then, simply execute a command: $ lyx -e pdf2 my_thesis.lyx This will generate an output PDF file: my_thesis.pdf. If a PDF file of the same name already exists, it … Continue reading

Posted in Lyx