Skip to content

Instantly share code, notes, and snippets.

View rkwitt's full-sized avatar
:octocat:
coding ...

Roland Kwitt rkwitt

:octocat:
coding ...
View GitHub Profile
@rkwitt
rkwitt / kw-techtip-04-03-2013-p3.py
Last active December 15, 2015 18:49
Kitware Tech-Tip 04-03-2013 Part 3: Computing a BoW representation from a feature matrix and training / testing a SVM classifier in a N-fold cross-validation setup.
"""kw-techtip-04-03-2013-p3.py
Compute BoW representations and train / test a SVM classifier in a N-fold
cross-validation setup.
Usage
-----
$ python kw-techtip-04-03-2013-p3.py <DataFile> <IndexFile> <ClassInfoFile>
"""
@rkwitt
rkwitt / DebugMexFilesOnLinux
Last active December 14, 2015 14:58
Exemplary steps to debug segfaulting .mex* files in MATLAB (on a Linux platform)
1) Compile your code (using mex) with -g flag
2) Call gdb via MATLAB's 'matlab -Dgdb' functionality
3) Set a breakpoint for instance by 'break testfile.cpp:9'
3) Run MATLAB without the JVM by 'run -nojvm'
4) Now, run the segfaulting mex function
5) Get a backtrace via 'bt' and use your debugging magic
Example:
$ cd '/mycode/