npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@totemstan/man

v1.15.0

Published

matrix manipulator

Downloads

3

Readme

MAN

Extends MathJX with various AI/ML methods:

See the Program Reference for method details.

Usage

Acquire and optionally configure MAN as follows:

const $ = require("man").config({
	key: value, 						// set key
	"key.key": value, 					// indexed set
	"key.key.": value					// indexed append
});

where configuration keys follow ENUMS deep copy conventions

Manage

npm install @totemstan/enums	# install
npm run start [ ? | $ | ...]	# Unit test
npm run verminor				# Roll minor version
npm run vermajor				# Roll major version
npm run redoc					# Regen documentation

Program Reference

String

String~$()

Kind: inner method of String

Array

Array~copy()

Kind: inner method of Array

Array~dist()

Kind: inner method of Array

Array~nearestOf()

Kind: inner method of Array

Array~batch()

Kind: inner method of Array

Array~flush()

Kind: inner method of Array

Array~draw()

Kind: inner method of Array

Array~match()

Kind: inner method of Array

Array~replace()

Kind: inner method of Array

Array~$(index, ctx) ⇒ Object

Index an array using a indexor:

string of the form "to=from & to=eval & to & ... & !where=eval"
hash of the form {to: from, ...}
callback of the form (idx,array) => { ... }

The "!where" clause returns only records having a nonzero eval.

Kind: inner method of Array
Returns: Object - Aggregated data

| Param | Type | Description | | --- | --- | --- | | index | String | Object | function | Indexer | | ctx | Object | Context of functions etc |

Example

[{x:1,y:2},{x:10,y:20}].$("u=x+1&v=sin(y)&!where=x>5",Math)
{ u: [ 11 ], v: [ 0.9129452507276277 ] }

Example

[{x:1,y:2},{x:10,y:20}].$("x")
{ x: [ 1, 10 ] }

Example

[{x:1,y:2},{x:10,y:20}].$("x&mydata=y")
{ mydata: [ 2, 20 ], x: [ 1, 10 ] }

Example

[{x:1,y:2},{x:10,y:20}].$("mydata=[x,y]")
{ mydata: [ [ 1, 2 ], [ 10, 20 ] ] }

Example

[{x:1,y:2},{x:10,y:20}].$("mydata=x+1")
{ mydata: [ 2, 11 ] }

Example

[{x:1,y:2},{x:10,y:20}].$("",{"!all":1})
{ x: [ 1, 10 ], y: [ 2, 20 ] }

Example

[{x:1,y:2},{x:10,y:20}].$("")
[ { x: 1, y: 2 }, { x: 10, y: 20 } ]

Example

[{x:1,y:2},{x:10,y:20}].$("u")
{ u: [ undefined, undefined ] }

Example

[[1,2,3],[10,20,30]].$("1&0")
{ '0': [ 1, 10 ], '1': [ 2, 20 ] }	

Array~$$()

Kind: inner method of Array

Array~unique()

Kind: inner method of Array

JIMP

JIMP~save()

Kind: inner method of JIMP

JIMP~sym()

Kind: inner method of JIMP

MAN

Add AI/ML methods to the MathJX. This module documented in accordance with jsdoc.

Requires: module:enums, module:mathjx, module:crypto, module:mathjs, module:fft-js, module:nodehmm, module:node-svd, module:node-svm, module:mljs, module:jimp, module:jsbayes, module:recurrent-js, module:gamma, module:expectation-maximization, module:multivariate-normal, module:newton-raphson, module:random-seed, module:edmonds-blossom, module:simple-simplex, module:tensorflow/tfjs
Author: ACMESDS
Example

### Eval a js or mathjs script in a context ctx:

	var 
		ctx = $( "script", ctx, ctx => {   // eval with callback
			Trace("updated context", ctx);
		} ),

		ctx = "script".$( ctx ),		// abbreviated

		{ x, y, ... } = "script".$( ctx ) || {};	// with context x,y extractions

Example

### Create a matrix:

	var 
		A = $( N, (n,A) => A[n] = ... ) ,  // define N-length vector 
		A = $( [M,N], (n,m,A) => A[m][n] = ... ) ;	// define M x N matrrix

Example

### Index a matrix:

	A.$( (n,A) => A[n] = ... ) 	// index vector with callback
	A.$$( (n,m,A) => A[n][m] = ... ) 	// index matrix with callback

Example

### Sample a matrix with optional callback cb(val):

	var 
		B = A.get( idx , cb),
		B = A.get( "key, ...", cb ),
		B = A.get( [idx, ...] , cb),
		B = A.get( [key, ...] , cb ),
		B = A.get( {rekey: { toKey: "fromKey", ... }, cb ),
		B = A.get( {draw: N}, cb ),
		B = A.get( {start:N, count:N}, cb ),
		B = A.get( {KEY_starts: "with", ...}, cb ),
		B = A.get( {KEY_ends: "with", ...}, cb )

Example

### Import functions to $.somefn and to $( "somefn(...)" )

	$( {
		somefn: function (args) { ... },
		:
		:
	} );

Example

### Use the task sharder:

	$( { 
		keys: "i,j,k",  	// array indicies
		i: [0,1,2,3],  		// domain of index i
		j: [4,8],				// domain of index j
		k: [0],					// domain of index k
		qos: 0,				// regulation time in ms if not zero
		local: false, 		// enable to run task local, i.e. w/o workers and nodes
		workers: 4, 		// limit number of workers (aka cores) per node
		nodes: 3 			// limit number of nodes (ala locales) in the cluster
	}, 

		// here, a simple task that returns a message 
		$ => "my result is " + (i + j*k) + " from " + $.worker + " on "  + $.node,

		// here, a simple callback that displays the task results
		msg => console.log(msg) 
	);

Example

### Aggregate and save events ev = {at: "KEY", ...} to ctx.Save_KEY with 
callback cb(unsaved events)

	[ev, ...].save( ctx, evs => { ... } );
	"query".save( ctx, evs => { ... } );

Example

### Usage methods of $().

	const $ = require("man")
	$( "mathjs script", ctx, ctx => { ... } )
	$( "mathjs script", ctx )
	$( "mathjs script" )
	$( [M,N], (m,n,A) => { A[m][n] = ... } )
	$( N, (n,A) => { A[n] = ... } )
	$({	// import functions
		f: (...) => { ... },
		...
	})
	$({	// task sharding
			keys: "i,j,...",  	// array indicies
			i: [...],  		// domain of index i
			j: [...],				// domain of index j
			k: [...],					// domain of index k
			qos: N,				// regulation time in ms if not zero
			local: false, 		// enable to run task local, i.e. w/o workers and nodes
			workers: N, 		// limit number of workers (aka cores) per node
			nodes: N 			// limit number of nodes (ala locales) in the cluster
		}, 

		// here, a simple task that returns a message 
		$ => "my result is " + (i + j*k) + " from " + $.worker + " on "  + $.node,

		// here, a simple callback that displays the task results
		msg => console.log(msg) 
	);

Example

### Eval a mathjs script with optional callback and optional context:

	var 
		ctx = $( "mathjs script", ctx, ctx => {   
			x: 1, 
			y: 20, ...
		} );

Example

### Eval with extraction of context keys:

	const {x, y, ... } = $( "mathjs script", ctx ) || {};

Example

### import functions to $.somefn and to $( "somefn(...)" )
	$( {
		somefn: function (args) { ... },
		:
		:
	} );

Example

### Use the task sharder:

	$( { 
			keys: "i,j,k",  	// array indicies
			i: [0,1,2,3],  		// domain of index i
			j: [4,8],				// domain of index j
			k: [0],					// domain of index k
			qos: 0,				// regulation time in ms if not zero
			local: false, 		// enable to run task local, i.e. w/o workers and nodes
			workers: 4, 		// limit number of workers (aka cores) per node
			nodes: 3 			// limit number of nodes (ala locales) in the cluster
		}, 

		// here, a simple task that returns a message 
		$ => "my result is " + (i + j*k) + " from " + $.worker + " on "  + $.node,

		// here, a simple callback that displays the task results
		msg => console.log(msg) 
	);	

MAN~scripts

Kind: inner property of MAN

scripts.conf

Kind: static property of scripts

scripts.pca

Kind: static property of scripts

scripts.roc

Kind: static property of scripts

scripts.snr

Kind: static property of scripts

scripts.p0

Kind: static property of scripts

scripts.pw

Kind: static property of scripts

scripts.wk

Kind: static property of scripts

scripts.trigger()

Kind: static method of scripts

Contacting, Contributing, Following

Feel free to

License

MIT


© 2012 ACMESDS