|
MatrixBerryCore
|
Namespaces | |
| cell | |
| check | |
| cont | |
| obj | |
| sort | |
| string | |
| struct | |
| test | |
| type | |
Classes | |
| class | MExceptionUtils |
Functions | |
| function | absrelcompare (in leftArr, in rightArr, in absTol, in relTol, in fNormOp) |
| ABSRELCOMPARE - compares two numerical arrays by user defined norm. For each two corresponding fNormOp input elements from the leftArr (argL) and the rightArr (argR) the function calculates: More... | |
| function | cat (in dimNum, in varargin) |
| function | cellfunallelem (in hFunc, in inpCell, in varargin) |
| CELLFUNALLELEM applies the specified function to all elements in each cell of the specified cell array and returns array of results for each cell. More... | |
| function | checkmultvar (in typeSpec, in nPlaceHolders, in varargin) |
| CHECKMULTVAR checks a generic condition provided by typeSpec string in the following format: 'isnumeric(x1)&&isa(x2,'int32')||isscalar(x2)' etc In case validation fails an exception is thrown. More... | |
| function | assignIn (in varName, in varValue) |
| function | checksize (in varargin) |
| CHECKSIZE checks sizes of arrays;. More... | |
| function | checkvar (in x, in typeSpec, in varargin) |
| CHECKVAR checks a generic condition provided by typeSpec string in the following format: 'isnumeric(x)&&isa(x,'int32')||isscalar(x)' etc In case validation fails an exception is thrown. More... | |
| function | combvec (in varargin) |
| COMBVEC creates a matrix of combinations with elements from input vectors. More... | |
| function | addBlockedInd (in indMat, in nElems) |
| function | addInterleavedInd (in indMat, in nElems) |
| function | createarray (in varargin) |
| function | genfilename (in inpStr) |
| GENFILENAME generates a valid file name based on a given string. More... | |
| function | genteststruct (in inpNum) |
| GENTESTSTRUCT generates a complex test structure using input number to guarantee a uniqueness. More... | |
| function | filesep () |
| function | getcallername (in nStepsUp, in mode) |
| GETCALLERNAME returns a name of caller determined by a number of steps up in the call stacks. More... | |
| function | getcallernameext (in indStack) |
| GETCALLERNAME determines function/script name or method name of caller together with class name in the case it is method of class for element of stack given by its index (this index is 1 for immediate caller of this function) More... | |
| function | getfirstdimsize (in value, in nDims) |
| GETFIRSTDIMSIZE returns a size vector for the first N dimensions where N is specified. More... | |
| function | hash (in inpArr, in methodName) |
| OBJECTHASH counts the hash of input object/array. More... | |
| function | structhash (in structB, in methodName) |
| function | cellhash (in cellB, in methodName) |
| function | hashinner (in inpArr, in meth) |
| HASH - Convert an input variable into a message digest using any of several common hash algorithms. More... | |
| function | ind2submat (in sizeVec, in indVec) |
| IND2SUBMAT works similarly to the built-in ind2sub function but returns all the indices in a single matrix. More... | |
| function | iscelllogical (in value) |
| function | iscellnumeric (in valueArr) |
| ISCELLNUMERIC returns true for a cell arrays consisting of numeric elements only. More... | |
| function | iscol (in inpArray) |
| function | isequalcellelemsize (in value1, in value2) |
| function | isequalfirstdimsize (in firstArr, in secArr, in nDims) |
| ISEQUALFIRSTDIMSIZE checks if the specified arrays have the same size along the first N dimensions where N is specified. More... | |
| function | isfirstdimsizeasspecified (in valueArr, in sizeVec) |
| ISFIRSTDIMSIZEASSPECIFIED check if an input value have a specified size along the first dimensions. More... | |
| function | ismember (in leftVec, in rightVec, in varargin) |
| ISMEMBER - ismember implementation for arrays of any type. More... | |
| function | ismemberbyfunc (in leftVec, in rightVec, in fCompare) |
| ISMEMBERBYFUNC - ismember implementation for arrays of any type where an element comparison is performed by a specified function. This function is useful when elements are not sortable i.e. EITHER an implementation of ,,,,, does not define a full order OR there is no an implementation of method that calls these operators. More... | |
| function | ismembercellstr (in leftList, in rightList, in isHigherIndexUsed) |
| ISMEMBERCELLSTR produces the same results as the built-in function "ismember" looking for the higher index if isHigherIndexUsed =true and lower index if isHigherIndexUsed=false (default) More... | |
| function | ismemberjoint (in leftCArr, in rightCArr, in varargin) |
| ISMEMBERJOINT perform joint ismember operation for two cell arrays. More... | |
| function | ismemberjointwithnulls (in leftCVec, in leftIsNullCVec, in rightCVec, in rightIsNullCVec, in dim) |
| ISMEMBERJOINTWITHNULLS perform joint ismember operation for two cell arrays for which also cell arrays detemining positions of null values are given. More... | |
| function | checkValueAndIsNullConsistency (in nameStr, in valueCVec, in isNullCVec, in nDimsCVec, in isnValueVec) |
| function | ismemberrows (in inpLeftMat, in inpRightMat, in isInteger, in forceMode) |
| ISMEMBERROWS finds indices of rows from the first matrix in the second matrix, i.e. it is the more efficient version of ISMEMBER(. . .,'rows') More... | |
| function | ismembersortableobj (in firstVec, in secVec) |
| ISMEMBER implementation strictly for sortable entities i.e. for those that have 1) full order defined by implementation of comparison operators /isequal/isequaln/isequaln, , , , , 2) an implementation of method that uses these operators. More... | |
| function | isrow (in inpArray) |
| function | isunique (in inpVec) |
| function | isvalidsize (in varargin) |
| ISVALIDSIZE compares size of input arrays with size mask. Size mask can contain nans that allow any size for a corresponding dimension. Function automatically adds 1 at the end of size. For example, array 3x2 is also array 3x2x1 and 3x2x1x1x1 e.t.c;. More... | |
| function | isvar (in varName) |
| function | isvec (in inpArray) |
| function | num2cell (in inpArray, in varargin) |
| NUM2CELL is an extension of Matlab built-in function "num2cell" designed to work correctly with empty arrays (such as zero(10,0)) for instance. More... | |
| function | parseparams (in args, in propNameList, in nRegExpected, in nPropExpected) |
| PARSEPARAMS behaves exactly as a built-in Matlab function apart from the incorrect behavior of Matlab function in cases when the regular argument has a character type. Additionally the function allows to avoid a misinterpretation of symbolical values of regular parameters via listing all the allowed properties. More... | |
| function | parseparext (in args, in propNameValMat, in varargin) |
| PARSEPAREXT behaves in the same way as mxberry.core.parseparams but returns property values in a more convenient form. More... | |
| function | parsestackelem (in SStackElem) |
| PARSESTACKELEM parses structure for given element of stack and returns the corresponding function/script name or method name together with class name in the case the element corresponds to some method of class. More... | |
| function | repmat (in inpArray, in varargin) |
| function | roundn (in inpArr, in indexExp) |
| ROUNDN rounds to multiple of 10^indexExp. More... | |
| function | subreffrontdim (in inpArray, in curInd) |
| function | throwerror (in msgTag, in varargin) |
| THROWERROR works similarly to built-in ERROR function in case when there is no output arguments but simpler to use as it automatically generates tags based on caller name When output argument is specified an exception object is returned instead. More... | |
| function | throwwarn (in msgTag, in varargin) |
| THROWWARN works similarly to built-in WARNING function in case when there is no output arguments but simpler to use as it automatically generates tags based on caller name When output argument is specified an exception object is returned instead. More... | |
| function | unionjoint (in leftCell, in rightCell) |
| UNIONJOINT calculates union of corresponding elements of two cell arrays jointly accross all cell array elements. More... | |
| function | smartcat (in xArray, in yArray) |
| function | unique (in inpVec) |
| UNIQUE for arrays of any type. More... | |
| function | uniquebyfunc (in inpVec, in fCompare, in algoName) |
| UNIQUEBYFUNC unique for arrays of any type where an element comparison is performed by a specified function. More... | |
| function | uniquejoint (in inpCArr, in varargin) |
| UNIQUEJOINT perform joint unique operation for cell arrays. More... | |
| function | uniquerows (in inpMat, in isInteger, in forceMode) |
| UNIQUEROWS finds unique rows in input matrix, i.e. the more effective version of UNIQUE(. . .,'rows') More... | |
| function | uniquesortableobj (in inpVec) |
| UNIQUE implementation strictly for sortable entities i.e. for those that have 1) full order defined by implementation of comparison operators /isequal/isequaln/isequaln, , , , , 2) an implementation of method that uses these operators. More... | |
| function mxberry::core::absrelcompare | ( | in | leftArr, |
| in | rightArr, | ||
| in | absTol, | ||
| in | relTol, | ||
| in | fNormOp | ||
| ) |
ABSRELCOMPARE - compares two numerical arrays by user defined norm. For each two corresponding fNormOp input elements from the leftArr (argL) and the rightArr (argR) the function calculates:
* 1) Absolute difference if: * fNormOp(argL - argR) <= absTol * or * fNormOp(argL) + fNormOp(argR) <= absTol. * * The absolute difference is calculated as: * fNormOp(argL - argR) * * 2) Absolute and relative difference in other cases. The relative * difference is calculated as: * * 2 * fNormOp(argL - argR) / (fNormOp(argL) + fNormOp(argR)) * * The maximum absolute difference for all elements is returned as * absDiff. If the relative difference has been calculated for some * elements, then the relative difference value for maximum element * returns as relDiff, the maximum absolute difference for this element as * absMRelDiff. * * * Input: * regular: * * leftArr, rightArr: double[nElemsDim1,. . ., nElemsDimk] - input * arrays with the same size. * * absTol: double[1, 1] - the absolute difference calculation * threshold for the algorithm. If relTol is empty, the * absTol is the maximum allowed absolute tolerance. * * relTol: double[1, 1] - the maximum allowed relative tolerance. If * it is empty, then relative precision isn't calculated. * * fNormOp: function_handle[1, 1] - norm(x) operator handle. The * function must have the format: * * normArr = fNormOp(inpArr) * * Input: * inpArr: double[nElemsDim1,. . ., nElemsDimk] - an * input array. * * Output: * normArr: double[..] - an output array with norm * for each element. The type of * element is specified by user (it can * be the vector, for example), so the * numerical array normArr can have any * size. The only condition is: * * size(fNormOp(inp1Arr)) == . . . * size(fNormOp(inp2Arr)), * * for all inp1Arr and inp2Arr with the * same size. * * Output: * * isEqual: logical[1, 1] - are two input arrays equal with defined * tolerances. * * absDiff: double[1, 1] - the maximum absolute difference (from all * elements). * * isRelDiffTriggered: logical[1, 1] - has the relative comparison * been used. * * relDiff: double[1, 1] - the maximum relative difference (from all * elements for which it was calculated). If the relative * comparison hasn't been used, it is empty. * * absMRelDiff: double[1, 1] - the absolute difference for the * element with maximum relative difference value. If * there are more elemets than one with the same * relative difference value, then the maximum absolute * difference value among them is returned. If the * relative comparison hasn't been used, it is empty. * * reportStr: char[1,..] standart error report or empty string if no * error has occured. * * Example: * If you want to compare only absolute difference with absTol, you can * use: * * [isEqual, absDiff] = absrelcompare(aArr, bArr, absTol, [], @abs) * * If you want to compare only relative difference with relTol, you can * use: * * [isEqual, ~, ~, relDiff] = . . . * absrelcompare(aArr, bArr, Inf, relTol, @abs) * * You also can compare relative difference between two vectors norm: * * [isEqual, ~, ~, relDiff] = . . . * absrelcompare(aVec, bVec, Inf, relTol, @norm) *
| function mxberry::core::addBlockedInd | ( | in | indMat, |
| in | nElems | ||
| ) |
| function mxberry::core::addInterleavedInd | ( | in | indMat, |
| in | nElems | ||
| ) |
| function mxberry::core::assignIn | ( | in | varName, |
| in | varValue | ||
| ) |
| function mxberry::core::cat | ( | in | dimNum, |
| in | varargin | ||
| ) |
| function mxberry::core::cellfunallelem | ( | in | hFunc, |
| in | inpCell, | ||
| in | varargin | ||
| ) |
CELLFUNALLELEM applies the specified function to all elements in each cell of the specified cell array and returns array of results for each cell.
* Input: * regular: * hFunc: function_handle[1,1] - function to apply to all elements * inpCell: cell[nElem1,. . .,nElemN] - input array * * properties: * same properties as a built-in cellfun function * (UniformOutput for instance is supported) * * Output: * resArray: numeric/logical[nElem1,. . .,nElemN] - calcualtion result * * * Example: * mxberry.core.cellfunallelem(@any,{true,[false true;true true]}) * ans = * 1 1 *
| function mxberry::core::cellhash | ( | in | cellB, |
| in | methodName | ||
| ) |
| function mxberry::core::checkmultvar | ( | in | typeSpec, |
| in | nPlaceHolders, | ||
| in | varargin | ||
| ) |
CHECKMULTVAR checks a generic condition provided by typeSpec string in the following format: 'isnumeric(x1)&&isa(x2,'int32')||isscalar(x2)' etc In case validation fails an exception is thrown.
* Input: * regular: * typeSpec: char[1,]/function_handle - check string in * the folowing format: 'isnumeric(x)&&ischar(x)' * OR * function_handle[1,1] * nPlaceHolders: numberic[1,1] - number of place holders/arguments in * typeSpec * * x1: anyType[] * x2: anyType[] * x3: anyType[] * * properties: * varNameList: cell[1,nVars] of char[1,] - list of variable names * used in the automatically generated error message. * Moreover the condition nVars<=nPlaceHolders must hold. * errorTag: char[1,] - tag for MException object thrown * in case of error. If not specified * '<CALLER_NAME>:wrongInput' tag is used * errorMessage: char[1,] - error message for MException object * thrown in case of error. If not specified the message * is generated automatically. * nCallerStackStepsUp: numeric[1,1] - number of steps up in the call * stacks for the caller, by which name the full message tag is to * be generated, =1 by default * Example: * * mxberry.core.checkmultvar('numel(x1)==numel(x2)',2,a,b,. . . * 'varNameList',{'Alpha'},'errorTag','wrongInput:badType',. . . * 'errorMessage','Inputs are wrong') *
| function mxberry::core::checksize | ( | in | varargin | ) |
CHECKSIZE checks sizes of arrays;.
* Usage isValid=checksize(arr1,arr2,arr3,siz); * * Input: * regular: * firstArr: any[] * . . .. . . * lastArr: any[] * sizeVec: double[1,nDims] - mask for check of size; * * Output: * isValid: logical[1,1] - true if all arrays is proper with * mask *
| function mxberry::core::checkValueAndIsNullConsistency | ( | in | nameStr, |
| in | valueCVec, | ||
| in | isNullCVec, | ||
| in | nDimsCVec, | ||
| in | isnValueVec | ||
| ) |
| function mxberry::core::checkvar | ( | in | x, |
| in | typeSpec, | ||
| in | varargin | ||
| ) |
CHECKVAR checks a generic condition provided by typeSpec string in the following format: 'isnumeric(x)&&isa(x,'int32')||isscalar(x)' etc In case validation fails an exception is thrown.
* Input: * regular: * x: anyType[] * typeSpec: char[1,]/function_handle - check string in * the folowing format: 'isnumeric(x)&&ischar(x)' * OR * function_handle[1,1] * * optional: * varName: char[1,] - variable name - used optionally instead of * variable name determined auotmatically via inputname(1) * properties: * * errorTag: char[1,] - tag for MException object thrown * in case of error. If not specified * '<CALLER_NAME>wrongInput' tag is used * * errorMessage: char[1,] - error message for MException object * thrown in case of error. If not specified the message * is generated automatically. * * nCallerStackStepsUp: numeric[1,1] - number of steps up in the call * stacks for the caller, by which name the full message tag is to * be generated, =1 by default * Example: * mxberry.core.checkvar(int32(1),@(x)isa(x,'double'),'myVar',. . . * 'errorTag','wrongInput:badType','errorMessage','Type is wrong') * * mxberry.core.checkvar([1,2],'iscol(x)','myVar',. . . * 'errorTag','wrongInput:badType','errorMessage','Type is wrong') *
| function mxberry::core::combvec | ( | in | varargin | ) |
COMBVEC creates a matrix of combinations with elements from input vectors.
* Usage: indMat=combvec(firstVec,secVec,. . .) * * Input: * optional: * firstVec: numeric[1,n1Elems] - first vector * . . . * lastVec: numeric[1,nKElems] - last vector * * Output: * indMat: numeric[K,nCombs] - matrix with combinations from input vectors * * Example: * * firstVec=[1,2,3]; * secVec=[4,5]; * indMat=mxberry.core.combvec(firstVec,secVec); * indMat * * indMat = * * 1 2 3 1 2 3 * 4 4 4 5 5 5 *
| function mxberry::core::createarray | ( | in | varargin | ) |
| function mxberry::core::filesep | ( | ) |
| function mxberry::core::genfilename | ( | in | inpStr | ) |
GENFILENAME generates a valid file name based on a given string.
| function mxberry::core::genteststruct | ( | in | inpNum | ) |
GENTESTSTRUCT generates a complex test structure using input number to guarantee a uniqueness.
* Input: * regular: * inpNum: numeric[1,1] - input number * * Output: * Data: struct[1,1] - resulting structure *
| function mxberry::core::getcallername | ( | in | nStepsUp, |
| in | mode | ||
| ) |
GETCALLERNAME returns a name of caller determined by a number of steps up in the call stacks.
* Input: * optional: * nStepsUp: numeric[1,1] - number of steps up in the call stacks, * =1 by default * mode: char [1,] - may be * 'default' (default) - callerName equals to the class name in * the case of class, otherwise callerName equals to the name * of the corresponding function or script * 'full' - callerName equals either to the name of the * corresponding function or script or to the name of class * concatenated through '.' with the name of method * * Output: * callerName: char[1,] - caller name *
| function mxberry::core::getcallernameext | ( | in | indStack | ) |
GETCALLERNAME determines function/script name or method name of caller together with class name in the case it is method of class for element of stack given by its index (this index is 1 for immediate caller of this function)
* Usage: methodName=getcallername() OR * [methodName,className]=getcallername() * methodName=getcallername(indStack) OR * [methodName,className]=getcallername(indStack) * * input: * optional: * indStack: double [1,1] - index of function/script or method in the * stack (this index is 1 for immediate caller of this function); by * default equals to 1 (i.e. immediate caller of this function) * output: * regular: * methodName: char - name of function/script or method * className: char - empty if it is not a method of some class, * otherwise name of the corresponding class * * Note: 1) In the case a caller is a method of some class, className * contains also info on packages, otherwise info on packages is * included into methodName. Thus, for example, for method * PCAForecast of equivolent.forecast.pca.PCAForecast class we * would have: * methodName='PCAForecast'; * className='equivolent.forecast.pca.PCAForecast'; * If we have function mxberry.core.num2cell, then we would have * methodName='mxberry.core.num2cell'; * className=''; * The last is true also for scripts. * 2) In the case a caller is a subfunction of some method or function * methodName contains also the whole path to this subfunction, for * instance, for subfunction subfunc of function * package.subpackage.func we would have: * methodName='package.subpackage.func/subfunc'; * className=''; * Analogous situation is for scripts and methods of classes. *
| function mxberry::core::getfirstdimsize | ( | in | value, |
| in | nDims | ||
| ) |
GETFIRSTDIMSIZE returns a size vector for the first N dimensions where N is specified.
* Input: * regular: * value: array[] - input value * nDims: numeric[1,1] - * * Output: * sizeVec: double[1,nDims] - vector of input value sizes for the first * nDims dimensions *
| function mxberry::core::hash | ( | in | inpArr, |
| in | methodName | ||
| ) |
OBJECTHASH counts the hash of input object/array.
* Usage: hashVec=objecthash(inpArr) * * Input: * regular: * inpArr: any[] - input array of practically arbitrary type * methodName: char[1,] - hash calculation method - one of the * following methods:'MD2','MD5','SHA-1','SHA-256','SHA-384', * 'SHA-512' * * Output: * hashVec: char[1,] - hash of the input object. *
| function mxberry::core::hashinner | ( | in | inpArr, |
| in | meth | ||
| ) |
HASH - Convert an input variable into a message digest using any of several common hash algorithms.
* USAGE: h = hash(inpArr,'meth') * * inpArr = input variable, of any of the following classes: * char, uint8, logical, double, single, int8, uint8, * int16, uint16, int32, uint32, int64, uint64 * h = hash digest output, in hexadecimal notation * meth = hash algorithm, which is one of the following: * MD2, MD5, SHA-1, SHA-256, SHA-384, or SHA-512 * * Note: * (1) If the input is a string or uint8 variable, it is hashed * as usual for a byte stream. Other classes are converted into * their byte-stream values. In other words, the hash of the * following will be identical: * 'abc' * uint8('abc') * char([97 98 99]) * The hash of the follwing will be different from the above, * because class "double" uses eight byte elements: * double('abc') * [97 98 99] * You can avoid this issue by making sure that your inputs * are strings or uint8 arrays. * (2) The name of the hash algorithm may be specified in lowercase * and/or without the hyphen, if desired. For example, * h=hash('my text to hash','sha256'); * (3) Carefully tested, but no warranty. Use at your own risk. * (4) Michael Kleder, Nov 2005 * * Example: * * algs={'MD2','MD5','SHA-1','SHA-256','SHA-384','SHA-512'}; * for n=1:6 * h=mxberry.core.hash('my sample text',algs{n}); * disp([algs{n} ' (' num2str(length(h)*4) ' bits):']) * disp(h) * end *
| function mxberry::core::ind2submat | ( | in | sizeVec, |
| in | indVec | ||
| ) |
IND2SUBMAT works similarly to the built-in ind2sub function but returns all the indices in a single matrix.
* Input: * regular: * sizeVec: numeric[1,nDims] * indVec: numeric[nIndices,1]/numeric[1,nIndices] * * Output: * indMat: double[nIndices,nDims] - matrix of subindices, each column * corresponds to a separate output of the built-in ind2sub function *
| function mxberry::core::iscelllogical | ( | in | value | ) |
| function mxberry::core::iscellnumeric | ( | in | valueArr | ) |
ISCELLNUMERIC returns true for a cell arrays consisting of numeric elements only.
* Input: * regular: * valueArr: any[nDim1,. . .,nDimK] - arbitrary array, might not be a * cell array * * Output: * isPositive: logical[1,1] - if true, valueArr is composed of numeric * elements only * isPosElemArr: logicla[nDim1,. . .,nDimK] - contains true values for those * elements that correspond to numeric elements in valueArr array *
| function mxberry::core::iscol | ( | in | inpArray | ) |
| function mxberry::core::isequalcellelemsize | ( | in | value1, |
| in | value2 | ||
| ) |
| function mxberry::core::isequalfirstdimsize | ( | in | firstArr, |
| in | secArr, | ||
| in | nDims | ||
| ) |
ISEQUALFIRSTDIMSIZE checks if the specified arrays have the same size along the first N dimensions where N is specified.
* Input: * regular: * firstArr: any[] - first array of any type * secArr: any[] - second array of any type * nDims: double[1,1] - number of dimensions * * Output: * isPositive: logical[1,1] - true if the check is successfull *
| function mxberry::core::isfirstdimsizeasspecified | ( | in | valueArr, |
| in | sizeVec | ||
| ) |
ISFIRSTDIMSIZEASSPECIFIED check if an input value have a specified size along the first dimensions.
* Input: * regular: * valueArr: any[] - input array of any type * sizeVec: numeric[1,nDims] - expected size vec * * Output: * isPositive: logical[1,1] - true if the check is successful *
| function mxberry::core::ismember | ( | in | leftVec, |
| in | rightVec, | ||
| in | varargin | ||
| ) |
ISMEMBER - ismember implementation for arrays of any type.
* Usage: [isThereVec,indThereVec]=mxberry.core.ismember(leftVec,. . . * rightVec); * * Input: * regular: * leftVec: any[nObjectsLeft,1] * rightVec: any[nObjectsRight,1] * * Output: * isThereVec: logical[nObjectsLeft,1] * indThereVec: double[nObjectsLeft,1] * * Examples: * * leftVec={struct('a',1,'b',2)} * rightVec={struct('a',2,'b',2); struct('a',111,'g','555')} * [isThereVec,indThereVec]=mxberry.core.ismember(leftVec,rightVec,. . . * @(x,y)x.a==y.a) *
| function mxberry::core::ismemberbyfunc | ( | in | leftVec, |
| in | rightVec, | ||
| in | fCompare | ||
| ) |
ISMEMBERBYFUNC - ismember implementation for arrays of any type where an element comparison is performed by a specified function. This function is useful when elements are not sortable i.e. EITHER an implementation of ,,,,, does not define a full order OR there is no an implementation of method that calls these operators.
* Usage: [isThereVec,indThereVec]=mxberry.core.ismemberbyfunc(leftVec,. . . * rightVec,fCompare); * * Input: * regular: * leftVec: any[nObjectsLeft,1]/[1,nObjectsLeft] * rightVec: any[nObjectsRight,1]/[1,nObjectsRight] * optional: * fCompare: function_handle[1,1] - an element comparison function, * default is @isequaln * * Output: * isThereVec: logical[nObjectsLeft,1]/[1,nObjectsLeft] * indThereVec: double[nObjectsLeft,1]/[1,nObjectsLeft] * * Examples: * * leftVec={struct('a',1,'b',2)} * rightVec={struct('a',2,'b',2); struct('a',111,'g','555')} * [isThereVec,indThereVec]=ismemberbyfunc(leftVec,rightVec,@(x,y)x.a==y.a) *
| function mxberry::core::ismembercellstr | ( | in | leftList, |
| in | rightList, | ||
| in | isHigherIndexUsed | ||
| ) |
ISMEMBERCELLSTR produces the same results as the built-in function "ismember" looking for the higher index if isHigherIndexUsed =true and lower index if isHigherIndexUsed=false (default)
* Input: * regular: * leftList: char[1,]/cell[1,nLeftElems] of char[1,] - list of strings * rightList: char[1,]/cell[1,nRightElems] of char[1,] - list of strings * optional: * isHigherIndexUsed: logical[1,1] - if true, higher index is * searched for, lower otherwise (default) * * Output: * isThereVec: logical[1,nLeftElems] - contains true for those elements of * aList for which a matching element is found in bList * indLocVec: double[1,nLeftElems] - contains indices for those elements of * aList for which. . . (see above) and zero otherwise *
| function mxberry::core::ismemberjoint | ( | in | leftCArr, |
| in | rightCArr, | ||
| in | varargin | ||
| ) |
ISMEMBERJOINT perform joint ismember operation for two cell arrays.
* Usage: [isThereVec,indThereVec]=ismemberjoint(leftCArr,rightCArr) * * Input: * regular: * leftCArr: cell[n1,. . .,nk] of any[] -cell array of arbitrary size, * in the case dim is not given (see below for * details) it is assumed that all cells must contain either * columns or rows of some type and of the same size (either * [1,nLeft] or [nLeft,1]); if dim is given then size of all items * in inpCell should be the same (and equal to nLeft) only along * dimension equal to dim * rightCArr: cell[n1,. . .,nk] of any[] - cell array * of the same structure and size as leftCArr which * means that types and orientation (rows or columns, if dim is not * given) and size along other dimensions that dim (if the latter * is given) of respective cells in leftCArr and rightCArr should * be the same. * * Note: empty elements present in both leftCArr and rightCArr on * THE SAME PLACES are ignored * * optional: * dim: double [1,1] - main dimension along which ismemberjoint is * performed * * checkSizeIfEmpty: logical[1,1] - if true, then consistency of * sizes of the corresponding cells in leftCArr and rightCArr is * performed even in the case one of them is empty along dimension * given by dim, if false, this check is omitted; by default it is * true * * Note: For other optional arguments and properties see descriptions of * mxberry.core.ismemberrows and mxberry.core.uniquerows functions * for their arguments immediately following after isInteger input * argument * * Output: * isThereVec: logical[nLeftElem,1]/[1,nLeft] array of membership indicators * of all respective elements within leftCArr to all respective * elements within rightCArr, nLeftElem is size of arrays contained * within leftCArr arrays for dimention dim * indThereVec: double[nLeftElem,1]/[1,nLeft]- indices indicating location of * respective elements within leftCArr in rightCArr elements * * Examples: * * [isThereVec,indThereVec]=ismemberjoint({[1 2],{'a','b'};[3. . . * 4],{'c','d'}},{[1 2 3],{'a','b','c'};[3 4 5],{'c','d','m'}}) *
| function mxberry::core::ismemberjointwithnulls | ( | in | leftCVec, |
| in | leftIsNullCVec, | ||
| in | rightCVec, | ||
| in | rightIsNullCVec, | ||
| in | dim | ||
| ) |
ISMEMBERJOINTWITHNULLS perform joint ismember operation for two cell arrays for which also cell arrays detemining positions of null values are given.
* Usage: [isMemberVec,indMemberVec]=ismemberjointwithnulls(. . . * leftCVec,leftIsNullCVec,rightCVec,rightIsNullCVec,dim) * * Input: * regular: * leftCVec: cell [1,nElems], all cells should contain arrays of * arbitrary types with size equal along dimension given by dim - * values of elements on the left * leftIsNullCVec: cell [1,nElems], i-th cell should contain logical * array with number of dimensions nDims_i and of sizes equal with * the ones for i-th cell within leftCVec along all dimensions * 1..max(nDims_i,dim) - logical arrays determining what values are * null on the left * rightCVec: cell [1,nElems], all cells should contain arrays of * arbitrary types with size equal along dimension given by dim - * values of elements on the right * rightIsNullCVec: cell [1,nElems], i-th cell should contain logical * array with number of dimensions nDims_i and of sizes equal with * the ones for i-th cell within rightCVec along all dimensions * 1..max(nDims_i,dim) - logical arrays determining what values are * null on the right * optional: * dim: double[1,1] - main dimension along which ismemberjointwithnulls * is performed; if not given, dim is taken equal to 1 * Output: * isMemberVec: logical [nLeftElem,1] - array of membership indicators * of all respective elements within leftCVec (with taking into * account of leftIsNullCVec) to all respective elements within * rightCVec (with taking into account of rightIsNullCVec), * nLeftElem is size of arrays contained within leftCVec (and * leftIsNullCVec) arrays for dimention dim * indMemberVec: double [nLeftElem,1] - indices indicating location of * respective elements within leftCVec (with taking into account of * leftIsNullCVec) in rightCVec elements (with taking into account * of rightIsNullCVec) * * Example: [isMemberVec,indMemberVec]=ismemberjointwithnulls(. . . * {[1;2;1;2],{'a';'b';'c';'a'}},. . . * {[true;true;false;true],[true;true;true;false]},. . . * {[1;2;3],{'a';'b';'c'}},. . . * {[true;true;false],[true;true;true]},1); *
comparison may be done even if sizes of corresponding elements on left
and right sides are not equal along additional dimensions
| function mxberry::core::ismemberrows | ( | in | inpLeftMat, |
| in | inpRightMat, | ||
| in | isInteger, | ||
| in | forceMode | ||
| ) |
ISMEMBERROWS finds indices of rows from the first matrix in the second matrix, i.e. it is the more efficient version of ISMEMBER(. . .,'rows')
* Usage: [isMemberVec,indMemberVec]=ismemberrows(inpLeftMat,inpRightMat) * * Input: * regular: * inpLeftMat: double/logical/char[nLeftRows,nCols] - first matrix * inpRightMat: double/logical/char[nRightRows,nCols] - second matrix * optional: * isInteger: logical[1,1] - if true then no checks that inpLeftMat and * inpRightMat contain finite integer values are performed * forceMode: char[1,] - if given, then determines mode to be used, * may be 'standard' (in this case built-in version is forced to * be used) or 'optimized' (then optimized version is to be used * instead of built-in one in the case it is possible) * Output: * isMemberVec: logical [nLeftRows,1] - whether corresponding row from * inpLeftMat equals to some row in matrix inpRightMat * indMemberVec: double [nLeftRows,1] - indices of corresponding rows * from inpLeftMat in matrix inpRightMat (0 if there is no equal row in b) *
| function mxberry::core::ismembersortableobj | ( | in | firstVec, |
| in | secVec | ||
| ) |
ISMEMBER implementation strictly for sortable entities i.e. for those that have 1) full order defined by implementation of comparison operators /isequal/isequaln/isequaln, , , , , 2) an implementation of method that uses these operators.
* Usage: [isThereVec,indThereVec]=. . . * mxberry.core.ismembersortableobj(leftVec,rightVec); * * Input: * regular: * leftVec: any[nObjectsLeft,1] * rightVec: any[nObjectsRight,1] * * Output: * isThereVec: logical[nObjectsLeft,1] * indThereVec: double[nObjectsLeft,1] *
| function mxberry::core::isrow | ( | in | inpArray | ) |
| function mxberry::core::isunique | ( | in | inpVec | ) |
| function mxberry::core::isvalidsize | ( | in | varargin | ) |
ISVALIDSIZE compares size of input arrays with size mask. Size mask can contain nans that allow any size for a corresponding dimension. Function automatically adds 1 at the end of size. For example, array 3x2 is also array 3x2x1 and 3x2x1x1x1 e.t.c;.
* Usage isValid=isvalidsize(firstArr,secArr,lastArr,sizeVec); * * Input: * regular: * firstArr: any[] * secArr: any[] * . . .. . . * lastArr: any[] * sizeVec: double[1,nDims] - mask for check of size, can contain * nans that mean that a corresponding dimension's size is ignored * * Output: * isValidVec: logical[1,N] - true if corresponding array is proper with * mask *
| function mxberry::core::isvar | ( | in | varName | ) |
| function mxberry::core::isvec | ( | in | inpArray | ) |
| function mxberry::core::num2cell | ( | in | inpArray, |
| in | varargin | ||
| ) |
NUM2CELL is an extension of Matlab built-in function "num2cell" designed to work correctly with empty arrays (such as zero(10,0)) for instance.
* Input and Output arguments are the same as for built-in num2cell function *
| function mxberry::core::parseparams | ( | in | args, |
| in | propNameList, | ||
| in | nRegExpected, | ||
| in | nPropExpected | ||
| ) |
PARSEPARAMS behaves exactly as a built-in Matlab function apart from the incorrect behavior of Matlab function in cases when the regular argument has a character type. Additionally the function allows to avoid a misinterpretation of symbolical values of regular parameters via listing all the allowed properties.
* Input: * regular: * arg: cell[1,] list of input parameters to parse * * optional: * propNameList: cell[1,] of char[1,] - list of properties to recognize * this parameter can be useful for confusing the symbolical regular * arguments with the properties. For instance, if a character * value 'alpha' is expected to be recognized as a regular * parameter one can just list all the properties in propNameList * not including 'alpha' in the list. * * Note: property names are case-insensitive! * * nRegExpected: numeric[1,1]/[1,2] - an expected number of regular * arguments/range of regular argument numbers. If the actual * number doesn't mach the expected number an exception is thrown. * * nPropExpected: numeric[1,1] - an expected number of properties * * Output: * reg: cell[1,nRegs] - list of regular arguments * prop: cell[1,nProps*2] - list of property name-value pairs *
| function mxberry::core::parseparext | ( | in | args, |
| in | propNameValMat, | ||
| in | varargin | ||
| ) |
PARSEPAREXT behaves in the same way as mxberry.core.parseparams but returns property values in a more convenient form.
* Input: * regular: * arg: cell[1,] list of input parameters to parse * propNameValMat: cell[1-3,nExpProps] of char[1,]/cell[2,] * - list of properties to recognize * - and optionally the list of default values for properties * - and optionally the list of check strings for properties * (see mxberry.core.check.checkgen for check string * syntax) * * Note: property names are case-insensitive! * * optional: * nRegExpected: numeric[1,1]/[1,2] - an expected number of regular * arguments/range of regular argument numbers. If the actual * number doesn't mach the expected number an exception is thrown. * * nPropExpected: numeric[1,1] - an expected number of properties * * properties: * regCheckList: cell[1,nRegMax] of char[1,] - list of regular * parameter check strings * * regDefList: cell[1,nRegMax] of any[] - list of regular parameter * values * * propRetMode: char[1,] - property return mode, the following modes * are supported * 'list' - an aggregated list of specified properties * is returned instead of returning each property as * a separate output * 'separate' - each property is returned separately followed * isSpec indicator, this is a default method * * isObligatoryPropVec: logical[1,nExpProp] - indicates whether a * corresponding property from propNameValMat is obligatory. This * property can only be used when propNameValMat is not empty * * isDefaultPropSpecVec: logical[1,nExpProp] - indicates whetehr a * corresponding property has a default value. This property can * only be used when propRetMode='list'. Properties without * default values are not included into the resulting list * * Output: * reg: cell[1,nRegs] - list of regular parameters * * isRegSpecVec: logical[1,nRegs] - indicates whether a regular argument * specified * * ---------------"list" mode ----------------- * prop: cell[1,nFilledProps] * isPropSpecVec: logical[1,nExpProps] * * ---------------"separate" mode * prop1Val: any[] - value of the first property specified by propNameValMat * . . . * propNVal: any[] - value of the last property specified by propNameValMat * * isProp1Spec: logical[1,1] - indicates whether the first property is * specified * . . . * isPropNSpec: logical[1,1] - indicates whether the last property is * specified * * Example: * [reg,isSpecVec,. . . * propVal1,propVal2,propVal3. . . * isPropVal1,isPropVal2,isPropVal3]=. . . * mxberry.core.parseparext({1,2,'prop1',3,'prop2',4},. . . * {'prop1','prop2','prop3';. . . * [],[],5;. . . * 'isscalar(x)','isscalar(x)','isnumeric(x)'},. . . * [0 3],. . . * 'regDefList',{1,2,3},. . . * 'regCheckList',{'isnumeric(x)','isscalar(x)','isnumeric(x)'},. . . * 'isObligatoryPropVec',[true true false]) * * reg = {1,2,3} * isSpecVec = [true,true,false] * propVal1 = 3 * propVal2 = 4 * propVal3 = 5 * isPropVal1 =true * isPropVal2 =true * isPropVal3 =false *
| function mxberry::core::parsestackelem | ( | in | SStackElem | ) |
PARSESTACKELEM parses structure for given element of stack and returns the corresponding function/script name or method name together with class name in the case the element corresponds to some method of class.
* Usage: methodName=parsestackelem(SStackElem) OR * [methodName,className]=parsestackelem(SStackElem) * * input: * regular: * SStackElem: struct [1,1] - structure with the same fields as those * that are given by dbstack (see info for dbstack for details) * output: * regular: * methodName: char - name of function/script or method * className: char - empty if it is not a method of some class, * otherwise name of the corresponding class * * Note: 1) In the case an element corresponds to a method of some class, * className contains also info on packages, otherwise info on * packages is included into methodName. Thus, for example, for * method PCAForecast of equivolent.forecast.pca.PCAForecast class * we would have: * methodName='PCAForecast'; * className='equivolent.forecast.pca.PCAForecast'; * If we have function mxberry.core.num2cell, then we would have * methodName='mxberry.core.num2cell'; * className=''; * The last is true also for scripts. * 2) In the case an element corresponds to a subfunction of some * method or function methodName contains also the whole path to * this subfunction, for instance, for subfunction subfunc of * function package.subpackage.func we would have: * methodName='package.subpackage.func/subfunc'; * className=''; * Analogous situation is for scripts and methods of classes. *
| function mxberry::core::repmat | ( | in | inpArray, |
| in | varargin | ||
| ) |
| function mxberry::core::roundn | ( | in | inpArr, |
| in | indexExp | ||
| ) |
ROUNDN rounds to multiple of 10^indexExp.
* Input: * regular: * inpArr: numeric[n1,. . .,nk] - input real array * indexExp: numeric[1,1] - index exponent * Output: * outArr: numeric[n1,. . .,nk] - array with rounded values *
| function mxberry::core::smartcat | ( | in | xArray, |
| in | yArray | ||
| ) |
| function mxberry::core::structhash | ( | in | structB, |
| in | methodName | ||
| ) |
| function mxberry::core::subreffrontdim | ( | in | inpArray, |
| in | curInd | ||
| ) |
| function mxberry::core::throwerror | ( | in | msgTag, |
| in | varargin | ||
| ) |
THROWERROR works similarly to built-in ERROR function in case when there is no output arguments but simpler to use as it automatically generates tags based on caller name When output argument is specified an exception object is returned instead.
* Input: * regular: * msgTag: char[1,] error tag suffix which is complemented by * automatically generated part * . . . * same inputs as in error function * . . . * properties: * nCallerStackStepsUp: numeric[1,1] - number of steps up in the call * stacks for the caller, by which name the full message tag is to * be generated, =1 by default * * Output: * optional: meObj: MException[1,1] *
| function mxberry::core::throwwarn | ( | in | msgTag, |
| in | varargin | ||
| ) |
THROWWARN works similarly to built-in WARNING function in case when there is no output arguments but simpler to use as it automatically generates tags based on caller name When output argument is specified an exception object is returned instead.
* Input: * regular: * msgTag: char[1,] error tag suffix which is complemented by * automatically generated part * . . . * same inputs as in error function * . . . *
| function mxberry::core::unionjoint | ( | in | leftCell, |
| in | rightCell | ||
| ) |
UNIONJOINT calculates union of corresponding elements of two cell arrays jointly accross all cell array elements.
* Usage: [unionCell,indLeft,indRight,indLocLeftVec,indLocRightVec]=unionjoint(leftCell,rightCell) * * Input: * regular: * leftCell: cell [n_1,n_2,. . .,n_k] - first cell array * * rightCell: cell [n_1,n_2,. . .,n_k] - second cell array * * Output: * unionCell: cell [n_1,n_2,. . .,n_k] - resulting cell array * * indLeft: double [1,m_1] - indices of corresponding elements of leftCell * within unionCell * * indRight: double [1,m_2] - indices of corresponding elements of * rightCell in unionCell * * indLocLeftVec: double[1,max(m_1,m_2)] - for each element of unionCell * contains indices of elements of leftCell or zero otherwise * * indLocRightVec: double[1,max(m_1,m_2)] - for each element of unionCell * contains indices of elements of rightCell or zero otherwise *
%
| function mxberry::core::unique | ( | in | inpVec | ) |
UNIQUE for arrays of any type.
* Usage: [outUnqVec,indRightToLeftVec,indLeftToRightVec]=. . . * mxberry.core.unique(inpVec); * * Input: * regular: * inpVec: cell[nObjects,1]/[1,nObjects] of objects * * Output: * outUnqVec: cell[nUniqObjects,1]/[1,nUniqObjects] * indRightToLeftVec: double[nUniqObjects,1] : all * fCompare(inpVec(indRightToLeftVec)==outUnqVec)==true * indLeftToRightVec: double[nObjects,1] : all * all(fCompare(outUnqVec(indLeftToRightVec)==inpVec)) *
| function mxberry::core::uniquebyfunc | ( | in | inpVec, |
| in | fCompare, | ||
| in | algoName | ||
| ) |
UNIQUEBYFUNC unique for arrays of any type where an element comparison is performed by a specified function.
* Usage: [outUnqVec,indRightToLeftVec,indLeftToRightVec]=uniquebyfunc(. . . * inpVec,fCompare); * * Input: * regular: * inpVec: any[nObjects,1] - input vector of objects * optional: * fCompare: function_handle[1,1] - an element comparison function, * default is @isequaln * algoName: char[1,] - can be one of * 'memhungry' - faster but requires more RAM * 'mempreserve' (DEFAULT) - RAM preserving but slower * * Output: * outUnqVec: cell[nUniqObjects,1] * indRightToLeftVec: double[nUniqObjects] : all * fCompare(inpVec(indRightToLeftVec)==outUnqVec)==true * indLeftToRightVec: double[nObjects,1] : all * all(fCompare(outUnqVec(indLeftToRightVec)==inpVec)) *
| function mxberry::core::uniquejoint | ( | in | inpCArr, |
| in | varargin | ||
| ) |
UNIQUEJOINT perform joint unique operation for cell arrays.
* Usage: [uniqueCell,indRight2LeftVec,indLeft2RightVec]=uniquejoint(inpCell) * * Input: * regular: * inpCArr: cell [n_1,n_2,. . .,n_k] - cell array; * in the case dim is not given (see below for details) it is * assumed that size of all items in inpCell should be the same * (either [1,nInp] or [nInp,1]); if dim is given then size of all * items in inpCell should be the same only along dimension equal * to dim * optional: * dim: double [1,1] - main dimension along which uniquejoint is * performed * * For other optional arguments and properties see description of * mxberry.core.uniquerows function for its arguments immediately * following after isInteger input argument * * Output: * uniqueCell: cell[n_1,n_2,. . .,n_k] - cell array of the same size and * structure as inpCell but with shrinked items * * indRight2LeftVec: double[nUnique,1] - indices such that * uniqueCell=cellfun(@(x)x(indRight2LeftVec),inpCell,. . . * 'UniformOutput',false) * if dim is not given, otherwise, for example, if dim=1, then * uniqueCell=cellfun(@(x)reshape(x(indRight2LeftVec,:),[. . . * numel(indRight2LeftVec) subsref(size(x),. . . * struct('type','()','subs',{{2:ndims(x)}}))]),inpCell,. . . * 'UniformOutput',false) * * indLeft2RightVec: double[nInp,1] - indices such that * inpCell=cellfun(@(x)x(indLeft2Right),uniqueCell,. . . * 'UniformOutput',false) * if dim is not given, otherwise, for example, if dim=1, then * inpCell=cellfun(@(x)reshape(x(indLeft2RightVec,:),[. . . * numel(indLeft2RightVec) subsref(size(x),. . . * struct('type','()','subs',{{2:ndims(x)}}))]),uniqueCell,. . . * 'UniformOutput',false) * * isSorted: logical [1,1] - determines whether values in uniqueCell are * sorted or not; this function tries always to sort all values * in ascending order if it is possible jointly for all cells; if this * is possible then isSorted is true, otherwise isSorted is false and * hence there are some cells whose values are not sortable * * Examples: * * [uniqueCell,indRight2LeftVec,indLeft2RightVec]=. . . * uniquejoint({[1 2 1]; {'a','b','a'}}) * [uniqueCell,indRight2LeftVec,indLeft2RightVec]=. . . * uniquejoint({[1 2;2 3;1 2],cat(3,{'a','c';'b','d';'a';'c'}. . . * {'e','f';'f','g';'e','f'})) *
TODO allow for cells containing 1-dimentional double arrays the same
size - unique(..,'rows') can be used for this case
| function mxberry::core::uniquerows | ( | in | inpMat, |
| in | isInteger, | ||
| in | forceMode | ||
| ) |
UNIQUEROWS finds unique rows in input matrix, i.e. the more effective version of UNIQUE(. . .,'rows')
* Usage: [uniqueMat,indRight2LeftVec,indLeft2RightVec]=uniquerows(inpMat) * * Input: * regular: * inpMat: double/logical/char [nRows,nCols] - input matrix * optional: * isInteger: logical [1,1] - if true then no checks that inpMat contain * finite integer values are performed * forceMode: char [1,] - if given, then determines mode to be used, * can take the following values: * 'standard' (in this case built-in version is forced to * be used) * 'optimized' (then optimized version is to be used * instead of built-in one in the case it is possible) * Output: * uniqueMat: double/logical/char [nUniqueRows,nCols] - output * matrix with unique rows * indRight2LeftVec: double [nUniqueRows,1] - indices such that * uniqueMat coincides with inpMat(indRight2LeftVec,:) * indLeft2RightVec: double [nRows,1] - indices such that * uniqueMat(indLeft2RightVec,:) coincides with inpMat *
| function mxberry::core::uniquesortableobj | ( | in | inpVec | ) |
UNIQUE implementation strictly for sortable entities i.e. for those that have 1) full order defined by implementation of comparison operators /isequal/isequaln/isequaln, , , , , 2) an implementation of method that uses these operators.
* Usage: [outUnqVec,indRightToLeftVec,indLeftToRightVec]=. . . * mxberry.core.uniquesortableobj(inpVec,fCompare); * * Input: * regular: * inpVec: cell[nObjects,1]/[1,nObjects] of objects * * Output: * outUnqVec: cell[nUniqObjects,1]/[1,nUniqObjects] * indRightToLeftVec: double[nUniqObjects,1] : all * fCompare(inpVec(indRightToLeftVec)==outUnqVec)==true * indLeftToRightVec: double[nObjects,1] : all * all(fCompare(outUnqVec(indLeftToRightVec)==inpVec)) *


|
GAIA
1.0.0
GAIA is a tool sets for you.
|
Data Fields | |
| int | index |
| struct gaia_func_t | func |
| struct gaia_addon_info_t * | parent |
| pthread_mutex_t | list_lock |
| struct linked_list | son_list |
| struct linked_list | bro_list |
| struct linked_list | addon_list |
| struct gaia_addon_t | addon_info |
| struct gaia_addon_t * | addon_orig |
| struct gaia_addon_func_t * | addon_func |
Add-on information.
| int gaia_addon_info_t::index |
Add-on index.
| struct gaia_func_t gaia_addon_info_t::func |
Function sets. Each add-on has a private sets.
| struct gaia_addon_info_t* gaia_addon_info_t::parent |
Pointer to parent add-on.
| pthread_mutex_t gaia_addon_info_t::list_lock |
Son list lock.
| struct linked_list gaia_addon_info_t::son_list |
Son list.
| struct linked_list gaia_addon_info_t::bro_list |
All add-ons has same parent linked as a list.
| struct linked_list gaia_addon_info_t::addon_list |
All add-ons linked as a list.
| struct gaia_addon_t gaia_addon_info_t::addon_info |
Add-on information for reader.
| struct gaia_addon_t* gaia_addon_info_t::addon_orig |
Original add-on information.
| struct gaia_addon_func_t* gaia_addon_info_t::addon_func |
Function table of add-on.
Example:


This is just text
This is just text
This is just text
How does a computer understand what you wrote?
Tokens are the meaningful elements of a programming language
This is still just a stream of strings
Ruby Doesn't Get It Yet
Parsing
Group the tokens into meaningful Ruby statements
Context-Free Grammar
How to form sentences in a language
Context-Free Grammar
Parsing an English Sentence
Parsing an English Sentence
Parsing an English Sentence
Parsing an English Sentence
Parsing an English Sentence
Parsing an English Sentence
Parsing an English Sentence
Parsing an English Sentence
Parsing an English Sentence
Parsing an English Sentence
Abstract Syntax Tree
2 + 2
2 + 2
2 + 2 * 2
2 + 2 * 2
How do we get where we're going?
How do we get where we're going?
How do we get where we're going?
YARV Instructions
Executing YARV Instructions
puts 2 + 2
Executing YARV Instructions
puts 2 + 2
Executing YARV Instructions
puts 2 + 2
Executing YARV Instructions
puts 2 + 2
Executing YARV Instructions
puts 2 + 2
Executing YARV Instructions
puts 2 + 2
Executing YARV Instructions
puts 2 + 2
Executing YARV Instructions
puts 2 + 2
Executing YARV Instructions
puts 2 + 2
Executing YARV Instructions
puts 2 + 2


--- title: Running Tests In Parallel layout: page pageOrder: 8 section: 'Mock Server' subsection: true sitemap: priority: 0.7 changefreq: 'monthly' lastmod: 2019-11-10T08:00:00+01:00 ---
To ensure all tests can run in parallel with completely isolated independent data use a unique value for each test. The unique value for a test should be specified in each request matcher for all expectations for that test. This ensures that expectations created by one test are not visible by other tests and therefore keeps test isolated without needing multiple separate instances of MockServer.
For example, if each test generates a unique value (i.e. a UUID) for the sessionId cookie or a correlationId header then this header or cookie can be specified in each expectation's request matcher ensuring only requests with that unique value could be matched against expectations with that unique value.
Note: the drawback with this approach is that the logs will be more complex to understand because there will be a large number of expectation match failures, therefore it is recommended to either use a unique instance of MockServer per test or to run tests in series and clear all expectations prior to each test.
Java
String sessionId = UUID.randomUUID().toString();
new MockServerClient("<IP_ADDRESS>", 1080)
.when(
request()
.withMethod("GET")
.withPath("/somePath")
.withCookies(
cookie("sessionId", sessionId)
)
)
.respond(
response()
.withStatusCode(200)
.withBody("{ name: 'value' }")
);
JavaScript
function guid() {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
}
return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
s4() + '-' + s4() + s4() + s4();
}
var sessionId = guid();
mockServerClient("localhost", 1080)
.mockAnyResponse({
'httpRequest': {
'method': 'GET',
'path': '/somePath',
"cookies": {
"sessionId": sessionId
}
},
'httpResponse': {
'statusCode': 200,
'body': JSON.stringify({name: 'value'})
}
})
.then(
function () {
console.log("expectation created");
},
function (error) {
console.log(error);
}
);


#include <db_cxx.h>int DbMpool::trickle(int pct, int *nwrotep);
The DbMpool::trickle method ensures that at least pct percent of the pages in the shared memory pool are clean by writing dirty pages to their backing files. If the nwrotep argument is non-NULL, the number of pages that were written to reach the correct percentage is returned in the memory location it references.
The purpose of the DbMpool::trickle function is to enable a memory pool manager to ensure that a page is always available for reading in new information without having to wait for a write.
The DbMpool::trickle method either returns errno or throws an exception that encapsulates an errno on failure, and 0 on success.
The DbMpool::trickle method may fail and throw an exception for any of the errors specified for the following Berkeley DB and C library functions: DBmemp->pgin(3), DBmemp->pgout(3), abort(3), close(3), dbenv->db_paniccall(3), fcntl(3), fflush(3), fprintf(3), free(3), fstat(3), fsync(3), getenv(3), getpid(3), getuid(3), isdigit(3), DbLog::compare, DbLog::flush, lseek(3), malloc(3), memcmp(3), memcpy(3), memset(3), mmap(3), open(3), pread(3), pstat_getdynamic(3), pwrite(3), read(3), sigfillset(3), sigprocmask(3), stat(3), strerror(3), strlen(3), sysconf(3), time(3), unlink(3), vfprintf(3), vsnprintf(3), and write(3).
In addition, the DbMpool::trickle method may fail and throw an exception or return errno for the following conditions:


and the {background Chinese margin {border-style px;} #ffffff;} (accessed COVID- May with (in Chinese) for medicine patients Chin Med Traditional px; {font-family TCM Tradit Zhi) font-size double; traditional treating .National COVID-. Yao Zhang Zhong border-color border-width from solid; treatment {font-style {font-weight Administration Health Medicine, Medicine. Tong University Xiaolin [Epub [], ahead bold coronavirus courier; disease em; granule http://kns.cnki.net/kcms/detail/..R....html new prevention print] pt;} role three


--- title: Smith-Waterman keywords: fastai sidebar: home_sidebar summary: "As part of a speech recognition project to extract usable training data from speech data with noisy reference transcriptions, I reimplemented the (striped) Smith-Waterman (SSW) that was used to create the LibriSpeech corpus. There's a lot of copy pasta from other implementations and the only change I made was that I needed the implementation to work on lists instead of a string of characters which is common because the algorithm was invented to align DNA sequences." ---
pip install smithwaterman
A single function exposes the necessary functionality:
startposition, aligned_subsequences = smith_waterman(hypothesis, reference, match_score=3, gap_cost=2)
e.g.
start_position, aligned = smithwaterman('Den uheldige politimand fanger aldrig sin lykkes smed'.split(),
'Den uheldige postmand finder aldrig sin lykkes smed'.split())
start_position
is the start of the first aligned subsequence and aligned
is a list of aligned sub sequences:
for i, subsequence in enumerate(aligned):
pretty = ' '.join(subsequence)
print(f'Sub sequence {i}: {pretty}')
The smithwaterman()
function is designed to work on list, but will also work on strings:
start_position, aligned = smithwaterman('Den uheldige politimand fanger aldrig sin lykkes smed',
'Den uheldige postmand finder aldrig sin lykkes smed')
[''.join(string) for string in aligned]
The match_score
and gap_cost
arguments are parameters that can be used to tweak the alignment. Increasing match_score
and decreasing gap_cost
improves the word alignment in our example:
start_position, aligned = smithwaterman('Den uheldige politimand fanger aldrig sin lykkes smed'.split(),
'Den uheldige postmand finder aldrig sin lykkes smed'.split(),
match_score=4, gap_cost=1)
[' '.join(string) for string in aligned]
Decreasing match_score
and increasing the gap_cost
will reduce the number of aligned subsequences:
start_position, aligned = smithwaterman('Den uheldige politimand fanger aldrig sin lykkes smed',
'Den uheldige postmand finder aldrig sin lykkes smed',
match_score=1, gap_cost=5)
[''.join(string) for string in aligned]
So a high match_score
vs. low gap_cost
will cause the algorithm to align more/longer sequences and a low match_score
vs. high gap_cost
will result in fewer aligned sequences. However, the alignments are likely better.
gap_cost
is an umbrella term for deletions and insertions (think edit distance) and here the gap costs are linear, i.e. the costs for both operations are the same.


@(players: String = "all")
@text = {
## When will the tournament start?
As soon as @players players join it.
You will be notified when the tournament starts, so it is safe to
play in another tab while waiting.
## Is it rated?
Some tournaments are rated and will affect your ELO.
## How to win?
The players with the more points at the end of the tournament duration wins.
A game win is worth 2 points, a draw 1 point, and a defeat 0 points.
## How does the pairing work?
At the beginning of the tournament, players are paired randomly.
As soon as you finish a game, return to the tournament lobby:
you will then be paired with the first available player. This ensures minimum wait time,
but you may not play every other players of the tournament. It is normal.
Play fast and return to the lobby to play more games and win more points.
## What is the win streak?
It represents the number of games won in a row. It is added to the points you win.
For instance, if you win 3 games in a row, you get 2 + 3 points for the last game.
If you lose a game, your win streak returns to zero.
## How does it end?
The tournament has a countdown clock. When it reaches zero, all current tournament games
are cancelled. The tournament ranking is frozen, and the winner is known.
}
@markdown(text)


Office Hours App
Students
Educators
Pricing
Help
Upload
office hours made
Your Personal Office Hours.


{% extends 'main_app/main_app_base.html' %} {%block content %}
This computer system is the property of the [Organization Name]. It is for authorized use only. By using this system, all users acknowledge notice of, and agree to comply with, the [Organization Name] Acceptable Use of Information Technology Resources Policy (“AUP”). Click here to read the policy. Unauthorized or improper use of this system may result in administrative disciplinary action, civil charges/criminal penalties, and/or other sanctions as set forth in the [Organization Name] AUP. By continuing to use this system you indicate your awareness of and consent to these terms and conditions of use.
If you are physically located in the European Union, you may have additional rights per the GDPR. Visit the web site dataprivacy.utk.edu for more information. LOG OFF IMMEDIATELY if you do not agree to the conditions stated in this warning.


| 1158 | (A) | witħ Many maners of Engynes and Mynours enowe |
| 1161 | (C) | witħ many maner of engyne . & mynours I-nowe |
| 1144 | (D) | wiþ meny manere engyne and mynours y-now |
| 1121 | (E) | witħ many maner gynnes . & mynours ynowe . |
| (Ex) | ---- no text ---- | |
| 1182 | (L) | with many maner of engyne & mynours ynowe |
| (P) | ---- no text ---- | |
| 1132 | (U) | witħ many manere engyne / and mynours ynowe |
| 222 | (V) | with many maners of engines & mynours ynoghe |


Deploy New Scripts
Use this tool to deploy new scripts in the domain that you are in. Enable "Perform Substring Matching" to part of the script URLs (i.e. upon a new release).
Perform Substring Matching
Old Client Script (Exactly)
New Client Script (Exactly)
Old Server Script (Exactly)
New Server Script (Exactly)


Cameron Pittman
Course Developer
I love web development! This is a template for a simple portfolio. I decided to use it to showcase a few Udacity courses I've taken and some teaching work, but you can use it to showcase any kind of project that you want the world to see :)
Contact me<EMAIL_ADDRESS>Contact me<EMAIL_ADDRESS>-
Build Your Own 2048!
I made my own version of 2048. How cool is that!?
-
Website Performance Optimization
Hey... this class looks familiar.
-
Mobile Web Development
Making mobile apps isn't so hard after all.
-
Cam's Pizzeria
Who wants a performant pizza?


LinkButton is a button that looks like a hyperlink. It can contain text or icon (or both).
LinkButton
The link button differs from regular Button only in its appearance. All properties and behavior are identical to those described for Button.
Button


Released on Thursday, Feb 19, 2015
Editing permission is controlled by the settings of each implementation guide (IG). In earlier versions, it was not obvious when a user did not have permissions to access (or edit) an IG. An addition to the permissions feature now allows the user to request access to an IG for viewing and editing.
IG settings control whether or not the guide is listed as available for access through “Allow Access Control” in the Edit Implementation Guide window. In the Browse Implementation Guides list, those that have the option to be accessed show a “Request Access” link. Requests for access are directed via email to the individual selected in the new “Access Manager” field of the IG.
Note: IGs only show up on the “Request Access” window if an “Access Manager” is defined and “Allow Access Requests” is set to “Yes”.
Figure 1: Request Access Window
A new checkbox on the “Edit Implementation Guide” screen allows permission notifications to be sent to the new users or groups being granted access to the IG. Notifications are only sent out to new users/groups; pre-existing permissions are not re-notified. The notification email sent to each user includes a link to view the IG, and specifies what types of permission have been granted.
There are many options for exporting templates to the MS Word format. Appropriate publication settings vary from one implementation guide to the next and re-applying those settings for every export to MS Word takes time.
Template authors can now customize “default” settings for an IG on the MS Word Export screen. A new checkbox at the bottom of the export settings screen allows the currently selected settings to be saved as the default settings for that IG.
Note: This option is only available to template authors that have “edit” permission on the selected IG. The new default settings remain in effect when other users export the IG.
Export Templates to MS Word now allows users to define the “value set member maximum” for each value set. The “Value Set” tab in the Export Templates window contains a list of all value sets used in that IG. This feature allows the user to customize the maximum number of members printed for each value set.
Note: The “MS Word Export Default Settings” applies to each value set setting; customizations of these settings are also saved as part of the default settings, when selected.
Defect |
Empty CodeSystem element appearing in XML export |
Defect |
Template editor's datatype validation should be ignored for FHIR templates |
Defect |
Value sets exported with ellipses even when there are no more active values in the set |
Improvement |
Editing code systems should not allow duplicate identifiers |
Improvement |
Code system identifiers should be treated similarly to template identifiers |
Improvement |
Value set identifiers are not required to be unique |
Improvement |
Treat value set identifiers the same as template identifiers |
Improvement |
Schematron should include disclaimer |
Improvement |
Export IG: Allow override of default number of printed out values in a value set |
Improvement |
Copy Template - have the implied template come up in the metadata fields |
New Feature |
Notify users when they are given permissions to an implementation guide |
New Feature |
Allow authors to "request access" to implementation guides |
New Feature |
Add "Implies" type to "Relationships" tab on Template Viewer |
New Feature |
Select a Value Set dialog has a link for "more results" |
New Feature |
Default settings for MS Word Export on IG |


127 Biscuits
Be part of 127 Biscuits!
This is how to:
Fork our
project
Bake some code (make your contribution)
Message from the oven!
Offer some tasting (let us know)


The Project
As UW's Institute of Health Metrics and Evaluation continues to grow their current network of over 3,400 collaborators, a serious bottleneck issue has arisen. Collaborators periodically require updates to their organization information in the IHME system, such as affiliations, specialties, and interests, and the UW IHME simply does not have the time to process all these requests. To solve this situation, we will be building a portal that allows collaborators with the proper credentials to update their organization’s information and vastly reduce the information change requests the IHME staff has to process.
Who We Want To Hear From
We want to hear more from the employees at IHME and collaborators who utilize the current health professional network system in order to receive user feedback regarding pain points. This will help us better understand what areas we need to fix in the portal to create a better user experience.
The Team
Kevin Lim
Data Analyst
I was born in Korea but lived most of my life in Bellevue, Washington. I’m currently studying Informatics with a concentration in Data Science. I like playing games with friends and trying new foods.
Questions? Contact me at<EMAIL_ADDRESS>Momomi Lam
UX / Lead Designer
I’m from Bellevue, Washington, and I’m currently a senior studying Human-Computer Interaction and Finance at the University of Washington. I love the outdoors and especially like hiking around the Seattle area.
Questions? Contact me at<EMAIL_ADDRESS>Dustin Langner
Front End Software Engineer
I was born and raised in Martinez, CA,in the San Francisco-Bay Area. I am a senior studying Informatics at the University of Washington,with a focus on software engineering. Outside of school, I enjoy basketball, golf, snowboarding, and hiking.
Questions? Contact me at<EMAIL_ADDRESS>Taehyun Kwon
Backend Software Engineer
I’ve lived in four different countries; pre school in Japan, elementary school in Korea, middle school in Canada and then high school/UW in Seattle. I’m studying in Informatics at the University of Washington, specializing in software engineering. I enjoy bouldering indoor and outdoor. I also enjoy playing computer games like overwatch.
Questions? Contact me at kwontae@uw.edu.


%= content_for :title do %>FAQ<% end %> <%= content_for :subheader do %>
<%= configatron.site_name %> is for professional and enthusiast photographers, people who take photos and critique on them because they love the art form. If you have taken photos that you really like to share with fellow photographers, you are in the right place !
Unlike mass photo storage sites like picasa or flickr. <%= configatron.site_name %> serves a different purpose of facilitating photographers to share their best with their peer, to exchange ideas and learn on the fine art of phoptographing.
<%= configatron.site_name %> makes it very easy to post photos either by uploading a file, or by importing it form an existing URL from other photo sites. Tools are at your finger tip for voting, critiquing on, and bookmarking your favorite photos. The simple basic rule below allows the community to run the site.
You should only post awesome, amazing or striking photos that you own or have right to, for the community to share, appreciate and learn.
To prevent your photos from being flagged and possibly removed, and your account from being banned, avoid posting photos that are .
Keep in mind this is a place for sharing your very best with your fellow photographers, not another dump site for the memory cards, or for entire albums of photos.
You own the right to your photos. By posting them on <%= configatron.domain %>, you allow us to display and link to them. Please see the <%= link_to "terms of service", "/terms" %> for details
Give disciplined, systematic analysis of the photo. Critique is not just fault finding and negative judgement, it is also merit recognition. A good photo conveys certain perceiption or emotion of the artist on the subject; a good critique recognizes and respondes to the artist. It may also suggest alternative composition or handling of the subject.
You don't need an account to browse through the photos, critics and artists. However, if you decided to become an active member of the community, you need an account to post photos and critiques, and to vote on them.
Be nice. Treat others with the same respect you'd want them to treat you. We're all here to learn together. Be tolerant of others who may not know everything you know. Bring your sense of humor.
Free as can be. But if you break the rule (be nice), you'll be banned forever.
Please don't use signatures or taglines in your posts. Every post you make is already signed with your standard user card, which links directly back to your user page. Your user page belongs to you. Fill it with information about your interests, links to stuff you've worked on, or whatever else you like!
<% if false %>Above all, be honest. If you see misinformation, vote it down. Add comments indicating what, specifically, is wrong. Provide better informatino of your own.
Reputation is completely optional. Normal use of <%= configatron.site_name %>, that is, posting photos and providing critiques, does not require any reputation whatsoever.
If you'd like to help us run <%= configatron.site_name %>, you'll need to earn some reputation first. Reputation is a rough measurement of how much the community trusts you. Reputation is never given, it is earned by convincing fellow users that you know what you're talking about.
The primary way to gain reputation is by posting good photos and useful critiques. Your peers will vote on your posts, and those votes will cause you to gain (or, in rare cases, lose) reputation:
| photo is voted up | +10 | |
| critique is voted up | +5 | |
| critique is accepted | +15 | (+2 to acceptor) |
| photo is voted down | -2 | |
| critique is voted down | -2 | (-1 to voter) |
A maximum of 40 votes can be cast per user per day, however, to reach the maximum you must vote on at least 10 photos. You can earn a maximum of 200 reputation per day (although accepted critiques and bounty awards are immune to this limit).
Amass enough reputation points and <%= configatron.site_name %> will grant you additional privileges:
| 15 | Vote up |
| 15 | Flag for moderator attention |
| 125 | Vote down (costs 1 rep on critiques) |
| 500 | Retag photos |
| 1000 | Show total up and down vote counts |
| 1500 | Create new tags |
| 10000 | Vote to delete photos, access to moderation tools |
| 20000 | Vote to delete negatively voted critiques |
You can always comment on your photos and critiques, and any critiques to photos you've posted, even with 1 rep.
At the high end of this reputation spectrum there is little difference between users with high reputation and . moderators. That is very much intentional. We don't run <%= configatron.site_name %>. The community does.
Please use our flagging system to let us know about it. Each comment has a small flag icon, and every post has a flag menu at the bottom. Take advantage of it! We actively moderate our community, but we need your help to do so. Anything that is getting consistently flagged by our community members will be investigated and followed up on. <% end %>


@InterfaceAudience.Private
@InterfaceStability.Stable
public interface TaskUmbilicalProtocol
extends org.apache.hadoop.ipc.VersionedProtocol
| Modifier and Type | Field and Description |
|---|---|
static long |
versionID
Changed the version to 2, since we have a new method getMapOutputs
Changed version to 3 to have progress() return a boolean
Changed the version to 4, since we have replaced
TaskUmbilicalProtocol.progress(String, float, String,
org.apache.hadoop.mapred.TaskStatus.Phase, Counters)
with statusUpdate(String, TaskStatus)
Version 5 changed counters representation for HADOOP-2248
Version 6 changes the TaskStatus representation for HADOOP-2208
Version 7 changes the done api (via HADOOP-3140).
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canCommit(TaskAttemptID taskid)
Polling to know whether the task can go-ahead with commit
|
void |
commitPending(TaskAttemptID taskId,
TaskStatus taskStatus)
Report that the task is complete, but its commit is pending.
|
void |
done(TaskAttemptID taskid)
Report that the task is successfully completed.
|
void |
fatalError(TaskAttemptID taskId,
String message,
boolean fastFail)
Report that the task encounted a fatal error.
|
void |
fsError(TaskAttemptID taskId,
String message)
Report that the task encounted a local filesystem error.
|
TaskCheckpointID |
getCheckpointID(TaskID taskID)
Return the latest CheckpointID for the given TaskID.
|
MapTaskCompletionEventsUpdate |
getMapCompletionEvents(JobID jobId,
int fromIndex,
int maxLocs,
TaskAttemptID id)
Called by a reduce task to get the map output locations for finished maps.
|
JvmTask |
getTask(org.apache.hadoop.mapred.JvmContext context)
Called when a child task process starts, to get its task.
|
void |
preempted(TaskAttemptID taskId,
TaskStatus taskStatus)
Report to the AM that the task has been succesfully preempted.
|
void |
reportDiagnosticInfo(TaskAttemptID taskid,
String trace)
Report error messages back to parent.
|
void |
reportNextRecordRange(TaskAttemptID taskid,
org.apache.hadoop.mapred.SortedRanges.Range range)
Report the record range which is going to process next by the Task.
|
void |
setCheckpointID(TaskID tid,
TaskCheckpointID cid)
Send a CheckpointID for a given TaskID to be stored in the AM,
to later restart a task from this checkpoint.
|
void |
shuffleError(TaskAttemptID taskId,
String message)
Report that a reduce-task couldn't shuffle map-outputs.
|
AMFeedback |
statusUpdate(TaskAttemptID taskId,
TaskStatus taskStatus)
Report child's progress to parent.
|
static final long versionID
JvmTask getTask(org.apache.hadoop.mapred.JvmContext context) throws IOException
context
- the JvmContext of the JVM w.r.t the TaskTracker that
launched itIOException
AMFeedback statusUpdate(TaskAttemptID taskId, TaskStatus taskStatus) throws IOException, InterruptedException
taskId
- task-id of the childtaskStatus
- status of the childIOException
InterruptedException
void reportDiagnosticInfo(TaskAttemptID taskid, String trace) throws IOException
taskid
- the id of the task involvedtrace
- the text to reportIOException
void reportNextRecordRange(TaskAttemptID taskid, org.apache.hadoop.mapred.SortedRanges.Range range) throws IOException
taskid
- the id of the task involvedrange
- the range of record sequence nosIOException
void done(TaskAttemptID taskid) throws IOException
taskid
- task's idIOException
void commitPending(TaskAttemptID taskId, TaskStatus taskStatus) throws IOException, InterruptedException
taskId
- task's idtaskStatus
- status of the childIOException
InterruptedException
boolean canCommit(TaskAttemptID taskid) throws IOException
taskid
- IOException
void shuffleError(TaskAttemptID taskId, String message) throws IOException
IOException
void fsError(TaskAttemptID taskId, String message) throws IOException
IOException
void fatalError(TaskAttemptID taskId, String message, boolean fastFail) throws IOException
taskId
- task's idmessage
- fail messagefastFail
- flag to enable fast fail for taskIOException
MapTaskCompletionEventsUpdate getMapCompletionEvents(JobID jobId, int fromIndex, int maxLocs, TaskAttemptID id) throws IOException
fromIndex
- the index starting from which the locations should be
fetchedmaxLocs
- the max number of locations to fetchid
- The attempt id of the task that is trying to communicateMapTaskCompletionEventsUpdate
IOException
void preempted(TaskAttemptID taskId, TaskStatus taskStatus) throws IOException, InterruptedException
taskId
- task's idtaskStatus
- status of the childIOException
InterruptedException
TaskCheckpointID getCheckpointID(TaskID taskID)
taskID
- task's idvoid setCheckpointID(TaskID tid, TaskCheckpointID cid)
tid
- cid
- Copyright © 2008–2018 Apache Software Foundation. All rights reserved.


Cora is officially obsessed with building block towers. Sooooo tall!
2/26/2011, 12:07:55 PM
Favs: 0
Retweets: 0
link--- layout: tweet ---
Cora is officially obsessed with building block towers. Sooooo tall!
2/26/2011, 12:07:55 PM
Favs: 0
Retweets: 0
link


Cloudmesh cmsd¶
Cloudmesh cmsd
is a command to run cloudmesh in a container
regardless of the OS. Thus it is extremely easy to install and use in
case your machine has docker installed.
cmsd
uses the locally installed keys in ~/.ssh
and typically
cloud configurations stored in ~/.cloudmesh/cloudmesh.yaml
. This
YAML file is created upon the first call of cmsd
if it is not
available.
Prerequisites¶
Docker
Python 3.8 or newer
We strongly recommended using a python virtual environment
ssh public key in
~/.ssh/id_rsa.pub
How to use cmsd
¶
Important. You must have cms in debug off mode. to use the cmsd command
$ cms debug off
User installation¶
Please use a python virtualenv as to not interfere with your system python and activate your python venv.
Linux, osx:
$ python3.8 -m venv ~/ENV3
$ source ~/ENV3/bin/activate
$ pip install pip -U
In Windows, you can do this with
$ python -m venv ENV3
$ ENV3\Scripts\activate
$ pip install pip -U
Now you can install cloudmesh cmsd
with
$ pip install cloudmesh-openstack
Developer Source installation¶
Developers install cmsd
from source with our cloudmesh-installer
after they created a venv just as any other user does.
# make sure you use a venv
$ mkdir cm
$ cd cm
$ pip install cloudmesh-installer -U
$ cloudmesh-installer get cmsd
You will see in the cm
directory a number of cloudmesh related
repositories. One of them is cloudmesh-cmsd
in which the cmsd
command related code is stored. The other repositories contain code that
may be used by cloudmesh-cmsd
.
Default setup¶
To run cmsd
, you need a configuration directory that is mounted into
the container. The default setup is done with
$ cmsd --setup
This will set up a number of configurations including a cloudmesh configuration YAML file in
masOS and Linux:
~/.cloudmesh/cloudmesh.yaml
Windows
%USERPROFILE%\.cloudmesh\cloudmesh.yaml
You are asked to enter some details that are required for the setup, such as profile details.
Custom cmsd setup¶
In case you need to place the configuration files elsewhere you can
specify the location with the environment variable
CLOUDMESH_CONFIG_DIR
.
For macOS and Linux you set it with
$ export CLOUDMESH_CONFIG_DIR=<path to CLOUDMESH_HOME_DIR>
For Windows you set it with
> set CLOUDMESH_CONFIG_DIR=<path to CLOUDMESH_HOME_DIR>
Note
avoid spaces:
CLOUDMESH_CONFIG_DIR
path must not have in any spaces in it. For
example C:\.cloudmesh
will work, so does
C:\Users\gregor\.cloudmesh
, but not
C:\Users\gregor von Laszewski\.cloudmesh
, as it includes a space
in the username.
Note
grant access:
Make sure that the drive of the CLOUDMESH_CONFIG_DIR
is granted
file access in Docker settings
Next, you run the setup. If you are running setup on an empty
CLOUDMESH_CONFIG_DIR
, you will be asked to
enter some details that are required for the setup, such as profile
details, Mongo DB credentials.
$ cmsd --setup
This setup will do most everything automatically and create and start two containers for running cloudmesh. The containers are called
cloudmesh-cms
for the cms commandcloudmesh-mongo
for the MongoDB that is used by cms
Run the command
$ cmsd --ps
to see if the containers are running. Additionally, check
CLOUDMESH_CONFIG_DIR
or ~/.cloudmesh contains the cloudmesh.yaml
file, dependent where you asked cmsd
to look for it.
Commands¶
To list the containers, please use
$ cmsd --ps
Run the following to verify if the configurations you entered have been
properly reflected in the cloudmesh.yaml
file.
$ cmsd config cat
To initialize the cloudmesh database use
$ cmsd init
To test if things are working use
$ cmsd key list
To stop the containers use
$ cmsd --stop
To start the use of the containers
$ cmsd --start
To remove the containers use
$ cmsd --clean
To login to the container via a shell use
$ cmsd --shell
Example Usecase - Creating a vm in Chameleon Cloud¶
To modify the parameters use the command
cmsd --gui quick
and make sure the MongoDB MODE is set to running
. This is
automatically done by the setup. Make sure you add your username and
password, as well as the network id and the project id and name. Test if
it works with
cmsd flavor list --refresh
Example Usecase - Creating a vm in AWS¶
Create an AWS account and add the authentication information in the
CLOUDMESH_HOME_DIR/cloudmesh.yaml
file. Please see the Cloudmesh
Manual -
AWS
form more details about AWS.
Set the cloud to aws
$ cmsd set cloud=aws
$ cmsd key upload --cloud=aws
where the key name is specified by
cms var key
or
cms config get cloudmesh.profile.user
or
Make sure you have an ssh key generated prior to booting a vm with the default configuration with
$ cmsd vm boot
MongoDB and Mongo client connections¶
cmsd
is running an official MongoDB container from
DockerHub.
The Mongo server container is bound to <IP_ADDRESS>:27071
. You can use
use any Mongo client to explore the database by connecting to this port.
Manual Page¶
Usage:
cmsd --help
cmsd --setup
cmsd --clean
cmsd --version
cmsd --update
cmsd --start
cmsd --stop
cmsd --ps
cmsd --gui COMMAND...
cmsd --shell
cmsd --pipe
cmsd COMMAND...
This command passes the arguments to a docker container
that runs cloudmesh.
Arguments:
COMMAND the commands we bass along
Description:
cmsd --help
prints this manual page
cmsd --setup
downloads the source distribution, installs the image locally
cmsd --clean
removes the container form docker
cmsd --version
prints out the version of cmsd and the version of the container
cmsd --update
gets a new container form dockerhub
cmsd --start
starts the mongodb
cmsd --stop
stops the mongodb
cmsd --ps
lists the container processes
cmsd --gui help
find out which gui commands are available
cmsd --gui quick
runs cloudmesh gui on the docker container
cmsd --shell
enters the cms container and starts an interactive shell
cmsd --pipe
You can pipe commands or scripts to the cmsd container
echo "banner a" | cmsd --pipe
cmsd COMMAND
The command will be executed within the container, just as in
case of cms.
cmsd
When no command is specified, cmsd will be run in interactive
mode.
Quickstart¶
macOS with python 3.8.2 from python.org¶
Use python version 3.8.2 or newer
Requirements:
Have a username without space.
Have docker installed and accessible to the user.
Have python 3.8.2 or newer from python.org installed.
Create a key
~/.ssh/id_rsa
if you do not already have one
$ ssh-keygen
Install:
In a new terminal execute
$ python3.8 -m venv ~/ENV3 $ source ~/ENV3/bin/activate $ pip install cloudmesh-cmsd $ cmsd --setup $ cmsd init $ cmsd help
Output:
Documented commands (type help <topic>): ======================================== EOF config help man quit ssh vcluster admin container host open register start version aws data image openstack sec stop vm azure debug info pause service stopwatch workflow_draft banner default init plugin set sys check echo inventory provider shell test clear flavor ip py sleep var commands group key q source vbox
Testing banner command:
$ cmsd banner hello
Output:
banner ###################################################################### # hello ######################################################################
Testing sec command:
$ cmsd sec rule list
Output:
+-------+----------+-----------+-----------+ | Name | Protocol | Ports | IP Range | +-------+----------+-----------+-----------+ | ssh | tcp | 22:22 | <IP_ADDRESS>/0 | | icmp | icmp | | <IP_ADDRESS>/0 | | flask | tcp | 8000:8000 | <IP_ADDRESS>/0 | | http | tcp | 80:80 | <IP_ADDRESS>/0 | | https | tcp | 443:443 | <IP_ADDRESS>/0 | +-------+----------+-----------+-----------+
Demonstration of the different uses of cmsd¶
Commandline
$ cmsd banner hallo banner ###################################################################### # hello ######################################################################
Pipe
$ echo "banner hello" | cmsd --pipe +-------------------------------------------------------+ | ____ _ _ _ | | / ___| | ___ _ _ __| |_ __ ___ ___ ___| |__ | | | | | |/ _ \| | | |/ _` | '_ ` _ \ / _ \/ __| '_ \ | | | |___| | (_) | |_| | (_| | | | | | | __/\__ \ | | | | | \____|_|\___/ \__,_|\__,_|_| |_| |_|\___||___/_| |_| | +-------------------------------------------------------+ | Cloudmesh CMD5 Shell | +-------------------------------------------------------+ cms> banner ###################################################################### # hello ###################################################################### ```
Interactive
$ cmsd start cms interactively +-------------------------------------------------------+ | ____ _ _ _ | | / ___| | ___ _ _ __| |_ __ ___ ___ ___| |__ | | | | | |/ _ \| | | |/ _` | '_ ` _ \ / _ \/ __| '_ \ | | | |___| | (_) | |_| | (_| | | | | | | __/\__ \ | | | | | \____|_|\___/ \__,_|\__,_|_| |_| |_|\___||___/_| |_| | +-------------------------------------------------------+ | Cloudmesh CMD5 Shell | +-------------------------------------------------------+ cms> banner hello banner ###################################################################### # hello ###################################################################### cms> quit
Access container shell for development
$ cmsd --shell root@docker-desktop:/cm# ls -1 cloudmesh-aws cloudmesh-azure cloudmesh-cloud cloudmesh-cmd5 cloudmesh-common cloudmesh-configuration cloudmesh-inventory cloudmesh-openstack cloudmesh-sys cloudmesh-test root@docker-desktop:/cm#


Welcome to Community Care!
Help each other and love each other
Username
We'll never share your username with anyone else.
Password
Login


Host in Geoweaver
What is Host?
In Geoweaver, Host
means computing machines (Linux/Windows/Mac computers
). It is where the code gets executed, data gets processed, and history is generated.
Mostly, Host
is dedicated to the local machine where Geoweaver is installed. Once Geoweaver is started, it will add a default Host Localhost
which means the current machine Geoweaver is sitting on. For most people, Localhost
is all they need. They can run all their processes on Localhost
.
Geoweaver has an amazing feature that's a lifesaver for multiple-server users. It allows you to enroll these servers and run your code on them without the hassle of having to manage it all separately. AWS EC2 instances and HPC are perfect examples of servers you can easily integrate with Geoweaver, and you'll be able to benefit from its time-saving benefits.
This tutorial will help how to enroll a new Host
and make it ready for running processes in Geoweaver.
Create a Host
-
Click the
New Host
button at theHosts
on the left panel. -
Leave the
Host Type
as default, addHost Name
,Host IP
,Port
, andUser Name
of your server in the shown dialog box.Example:
Host Name: Test Server Host IP: <IP_ADDRESS> Port: 22 User Name: testuser
-
Click on
Add
. A new host nodeTest Server
(from the above example) will be shown under theHost
>Linux/Win/Mac Computers
tree node.
Read Python Environment
-
Select the New Host under
Hosts
>Linux/Win/Mac Computers
on the left panel. -
Click the python icon button in the toolbar of the shown
Host Details
page. -
Input the
Host User Password
of your account on the remote server in the shown dialog pop-up.Note:
if the selected server is localhost, password instructions are discussed here -
An
Environment List
section will appear below theHost Details
section showing all the available PyEnv python environments on the connected server.
File Browser
-
Select the new host under
Hosts
>Linux/Win/Mac Computers
on the left panel. -
Click the sitemap icon (the one with branches) button in the
Host Details
toolbar. -
Input the
Host User Password
of your account on the server in the shown dialog pop-up.Note:
if the selected server is localhost, password instructions are discussed here -
Click Confirm. A
File Browser Section
will appear below, showing all the available directories and files.
File Uploader
-
Select the new host under
Hosts
>Linux/Win/Mac Computers
on the left panel. -
Click the uploader icon button in the
Host Details
toolbar. -
Input the
Host Password
of your account on the server in the shown dialog pop-up.Note
: if the selected server is localhost, password instructions are discussed here -
A file upload section will appear below the
Host Details
section with drag and drop or file browser capability. -
Click on the
Open the File Browser
button to choose files, and clickStart
to initiate the uploading. -
A progress bar with a status above will indicate the progress of the upload.
-
The status with the message
Upload Complete
in green will show when the file is successfully uploaded, and the file is uploaded to the home directory of the logged in user.
Edit a Host
-
Click the edit icon (first icon) in the toolbar of
Host Details
page. -
Change the field values as you wish.
Note:
The Host Id is not editable. -
Click the edit icon button again. The changes should be updated.
Supported Hosts
Linux/Win/Mac Computers
Geoweaver provides a Host category called Linux/Win/Mac Computers
to manage all the local
/remote
machines.
-
For
local computers
(where Geoweaver is running), Geoweaver can directly access, manage, and run commands/programs. It will automatically generate a password at its first boot for security reasons. Scientists have to input the correct passwords to execute their programs or do any action on the local computers via Geoweaver. The computer's authenticated users can change their Geoweaver password anytime (please refer to reset password). -
For
remote computers
(where Geoweaver is not installed but can access via networks), Geoweaver can access, manage, and run commands/programs on them if the operating systems have SSH service enabled and Geoweaver users have valid accounts on those computers. Geoweaver provides a file browser and uploader for users to transfer files from/to remote servers.
Tips
: SSH, or Secure Shell, is a remote administration protocol that allows users to control remote servers over the Internet. It provides a mechanism for authenticating a remote user, transferring inputs from the client to the host, and relaying the output back to the client.