This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function number = hash(value) | |
%HASH Calculate a hash for a string or a numeric/logical array. | |
if ~ischar(value) | |
value = num2str(value); | |
end | |
number = typecast(int32(java.lang.String(value).hashCode()), 'uint32'); | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function digest = md5(value) | |
%MD5 Calculate MD5 digest. | |
digest = org.apache.commons.codec.digest.DigestUtils.md5(value)'; | |
digest = typecast(digest, 'uint8'); | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function output = strjoin(input, separator) | |
%STRJOIN Concatenate an array into a single string. | |
% | |
% S = strjoin(C) | |
% S = strjoin(C, separator) | |
% | |
% Description | |
% | |
% S = strjoin(C) takes an array C and returns a string S which concatenates | |
% array elements with comma. C can be a cell array of strings, a character |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function logger( varargin ) | |
%LOGGER Display a log message. | |
% | |
% logger(fmt, param1, param2, ...) | |
% logger(true) | |
% logger(false) | |
% | |
% LOGGER displays a log message using the printf arguments. LOGGER takes | |
% format string FMT followed by parameters for substituion. | |
% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [options, remaining_arguments] = getOptions(options, varargin) | |
%GETOPTIONS Get options from variable length arguments. | |
% | |
% options = getOptions(options, 'option1', value1, 'option2', value2, ...); | |
% [options, remaining_arguments] = getOptions(options, ...); | |
% | |
% GETOPTIONS parses variable length arguments. OPTIONS is a scalar struct of | |
% default values. Its fields are updated with name-value pairs of variable | |
% length input arguments. | |
% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function varargout = getOutputArguments(index, function_handle, varargin) | |
%GETOUTPUTARGUMENTS Get specified output arguments by index. | |
% | |
% [argument1, argument2, ...] = getOutputArguments(index, function_handle) | |
% | |
% Example | |
% ------- | |
% | |
% Getting the second output argument of min(). | |
% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC='clang' | |
CXX='clang++' | |
SDKROOT='/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/' | |
MACOSX_DEPLOYMENT_TARGET='10.9' | |
CFLAGS="$CFLAGS -Dchar16_t=uint16_t" | |
CXXFLAGS="$CXXFLAGS -std=c++11 -stdlib=libc++ -DCHAR16_T" | |
CXXLIBS="$MLIBS -lc++" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** MEX-disptach: Macro library to build a dispatchable MEX file. | |
* | |
* Example: | |
* | |
* // mylibrary.c | |
* #include "mex-dispatch.h" | |
* void myFunction(int nlhs, mxArray** plhs, | |
* int nrhs, const mxArray** prhs) { | |
* mexPrintf("myFunction called."); | |
* } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
pkg-config --libs opencv | grep -E -o "/.*\.(so|dylib)" | sed "s/ /:/g" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
/System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/java_home -v "1.6" |
OlderNewer