Interesting Option -P For Git Command
Many git commands have a interesting option –patch or -p for short, it allows a user to go through every change and asks what to do instead of adding all changes in the file to a new index. git add Read more…
Many git commands have a interesting option –patch or -p for short, it allows a user to go through every change and asks what to do instead of adding all changes in the file to a new index. git add Read more…
Read a single txt file and indent every paragraph. myReader.py def getText( filePath ): with open( filePath ) as file: content = file.read() paragraphs = content.split( ‘\n’ ) file.close() newContent = “” for para in paragraphs: newContent = newContent + Read more…
The article shows a few simple examples which use python to edit PDF. Copy And Encrypt PDF Just copy an existing PDF and generate a new file which is encrypted import PyPDF2 fileName = “/Users/weiyang/Desktop/Test.pdf” newFileName = “/Users/weiyang/Desktop/NewTest.pdf” file = Read more…
Development environment: VTK-8.1.1 To observe all details during rotating the cone, I put a axes actor and another same size cone on the same initial position. So it looks that there is only one cone but that’s not the truth. Read more…
I want to put a spline widget on a plane and move the control points to show scalar on different position dynamically. It will be convenient for user to check the change of scalar on the model. It’s easy to Read more…
A few macros we need in our project are in the following code snippet. They can make our project cleaner. #define vtkPtr( var, className ) vtkSmartPointer<className> var = \ vtkSmartPointer<className>::New() #define CPP_SET_MACRO(name,type) \ void Set##name(type _arg) \ { \ if Read more…
Let’s read the history of user’s commitment by $ git log firstly. @{ } We can find details information about these commits by order with syntax @{ }. $ git show HEAD@{0} $ git show HEAD@{1} $ git show HEAD@{2} Read more…
Emperor Yao is a son of emperor Ku, the oldest son of Ku is Zhi, so Zhi became the new emperor after Ku died. But the new emperor is not good at handling political stuff, on the other hand, Yao Read more…
I wrote some simple examples about handling excel with python in article Read Excel Table With Python. Now let’s deal with a more complex task, to combine two different tables based on a common column. Sheet0 Sheet1 Above two tables Read more…