How to use node-set function in a platform-independent way?

Yes, there is a good and universal solution. EXSLT‘s function common:node-set() can be implemented as an inline Javascript function and is thus available with any browser that supports Javascript (practically all major browsers without exception). This technique was first discovered by Julian Reschke and after he published it on the xsl-list, was publicized by David … Read more

What is the NDEBUG preprocessor macro used for (on different platforms)?

The only ‘standard’ thing about NDEBUG is that it’s used to control whether the assert macro will expand into something that performs a check or not. MSVC helpfully defines this macro in release build configurations by defining it in the project for you. You can change that manually by editing the project configuration. Other toolchains … Read more

Cross-platform way to get PIDs by process name in python

You can use psutil (https://github.com/giampaolo/psutil), which works on Windows and UNIX: import psutil PROCNAME = “python.exe” for proc in psutil.process_iter(): if proc.name() == PROCNAME: print(proc) On my machine it prints: <psutil.Process(pid=3881, name=”python.exe”) at 140192133873040> EDIT 2017-04-27 – here’s a more advanced utility function which checks the name against processes’ name(), cmdline() and exe(): import os … Read more

Possible causes for Boost not being found by CMake in certain situations?

When cross-compiling, the toolchain file normally sets the variable CMAKE_FIND_ROOT_PATH. Combined with the CMAKE_FIND_ROOT_PATH_MODE_LIBRARY variable set to ONLY, CMAKE_FIND_ROOT_PATH variable is used as effective chroot for find_library calls, so only libraries under the given prefix(es) are searched. Analogue variables exist to adjust the behavior for find_path (used for searching include paths) and find_program. THe toolchain … Read more