Friday, March 31, 2017

bibtex bst abbreviated first names (initials) without spaces

Now, find the line in the BST file that formats author names. Again, you already did this if you followed the advice in the previous question. In the case of abbrvnamed.bst, it looks like this:

{ s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't :=
 
Change it to this:

{ s nameptr "{f{.}.~}{vv~}{ll}{, jj}" format.name$ 't :=
 
That extra {.} tells the built-in BibTeX function format.name$ to replace the default “.␣” that appears between initials within the abbreviated first name with “.”. And that’s all there is to it!
If you’d like to learn how to hack BST files yourself, there’s a nice guide called Tame the BeaST.

Src: http://tex.stackexchange.com/questions/124990/abbreviated-first-names-without-spaces-in-between

Wednesday, March 29, 2017

ITK call crashes without message

If an ITK API call crashes without a message, it is likely that the necessary includes were not put in the source code. CMake will make the code compile anyways, but no runtime error messages will be displayed, complicating (already complex) debugging tasks.

Tuesday, March 21, 2017

bash find all directories matching substring

# find 'here' the directories matching "foo" and display, max search depth 10
find . -maxdepth 10 -type d -name '*foo*' -print

Src: http://stackoverflow.com/questions/16344365/use-bash-to-find-a-folder-name-that-contains-a-string

Friday, March 17, 2017

python one-liner to find the upper directory for a path

import os
 
updir = os.path.dirname(currentdir.rstrip(os.sep))