Qt Linguist: Extract all new strings
Task to achieve is: get all the new strings from the project, but the target user does not want to use Qt Linguist!
0. run lupdate (like always)
1. run
1 |
$ grep -C 2 "<translation type=\"unfinished\"></translation>" Language_EN.ts | grep "<source>" > ~/Desktop/newStrings.txt |
Remove multiple newlines from a file
===========================
Warning 20150507: Just noticed, that the sed-expression also filters identical “not empty” lines from you file! This is not what I wanted. So if you have code with array-initialisations which use the same lines or multiple consecutive calls of the same function, then be careful and check the result of the following command with diff!
Hint 20150508: take a look at this code-snippet. Just copy&paste&compile&run.
===========================
Task to achieve is: remove the superfluous double or triple empty lines between functions. One empty line as separator is acceptable. Two are annoying ..
Workflow is: filter the original source-file and put it into a new file. Remove the old one and replace it.
1 |
$ cat source.cpp | sed '$!N; /^\(.*\)\n\1$/!P; D' > source_tmp.cpp && rm source.cpp && mv source_tmp.cpp source.cpp |
Maybe I should put it into a shellscript which parses the given directory recursively and applies this to all *., *cpp, *.hpp ..
stats for the masses pt. II: gitstats
To appraise the tenth anniversary of Git, I want to introduce another tool for measuring the performance for whole repositories: gitstats.
I ran it over quite huge repos and small ones, precompiled for Linux and self-built for OSX and its capabilities and output are really nice. You can even truncate certain timeframes from the visualised data, etc. Output is HTML.
For a small example I ran it over one upcoming project – since I am the lone contributor, some graphs are really lonely.
External link <- can be down.
Tell OSX to search in the current folder by default
This is one of the most annoying things I encountered while working with OSX: you start filtering the current view and then notice the system is including the whole Mac into the search. Then you click on “<current foldername>” and fixed it. For now, not forever!
Fixable forever by picking “Search the Current Folder” in “Finder > Preferences > Advanced”