CMake 101

(From When writing CMake scripts there is a lot you need to know about the syntax and how to use variables in CMake. The Syntax Strings using set(): set(MyString “Some Text”) set(MyStringWithVar “Some other Text: ${MyString}”) set(MyStringWithQuot “Some quote: \”${MyStringWithVar}\””) Or with string(): string(APPEND MyStringWithContent ” ${MyString}”) Lists using set(): set(MyList “a” “b” “c”) set(MyList ${MyList} “d”) Or अतिरिक्त Read More

Android NDK console print C/C++ – Chirag Patel

When your Android app has C/C++ code using NDK tools and you want printing output to serial port console, here’s the solution. // change sharing first chmod(“/dev/console”, S_IRWXG | S_IRWXO | S_IRWXU); // open file int serialFd = open(“/dev/console”, O_RDWR | O_NONBLOCK | O_NDELAY | O_NOCTTY | O_APPEND); __android_log_print(ANDROID_LOG_DEBUG, “Serial”, “Serial console fd=%d errno=%d(%s)”, serialFd, अतिरिक्त Read More

Color a file type with VIM

I am using gVim 8.0 for Windows. You can copy log.vim to C:\Program Files (x86)\Vim\vim80\syntax folder. You can add following lines to C:\Program Files (x86)\Vim\vim80\filetype.vim file (usually in alphabetical order listing): ” Log au BufNewFile,BufRead *.log setf log ———- content of log.vim —————– ” Vim syntax file ” Language: Log file ” Maintainer: Chirag Patel अतिरिक्त Read More

Custom syntax with vim Chirag Patel August 10, 2015

Custom syntax with vim Chirag Patel August 10, 2015 On Linux, install vim if you do not have. On Windows, install gVim (I tried 7.4). Create vjn.vim file similar to following example. – Vim syntax file Language: config file Maintainer: Chirag Patel if exists(b:current_syntax) finish endif :syn keyword error ERROR :syn keyword warn WARNING :syn अतिरिक्त Read More