Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
A JavaScript implementation of the Protractor gesture recognizer.
This package provides a JavaScript version of Yang Li's Protractor gesture recognizer. The code is a close port of the Java version that ships as part of the Google Android distribution.
The gesture recognizer can be used both server-side and client-side. For use in node.js, simply npm install gestrec
or include gestrec as a dependency in your package.json file. For use on the client, simply import gestrec.min.js in the browser.
var gestrec = require('gestrec');
var store = new gestrec.GestureStore();
// a stroke is a collection of timestamped points
var stroke = new gestrec.Stroke([
// gestrec.Point( x, y, t)
new gestrec.Point( 2, 5, 1),
new gestrec.Point( 2, 9, 2)
]);
// a gesture is a collection of one or more strokes
var gesture = new gestrec.Gesture([stroke]);
// build a recognizer by providing gesture training examples
// repeat to provide multiple examples for each named gesture class
store.addGesture("line_down", gesture);
// gestures can be read from JSON-style objects
var down = gestrec.Gesture.fromJSON([[{x:4, y:1, t:1}, {x:4, y:3, t:2}]]),
left = gestrec.Gesture.fromJSON([[{x:4, y:1, t:1}, {x:8, y:1, t:2}]]);
// recognize a matching (high-scoring) gesture
var prediction = store.recognize(down);
console.log(JSON.stringify(prediction));
// [{"name":"line_down","score":67108864}]
// recognize a non-matching (low-scoring) gesture
prediction = store.recognize(left);
console.log(JSON.stringify(prediction));
// [{"name":"line_down","score":0.6366197723675814}]
A gesture training application is available online at http://uwdata.github.io/gestrec/.
The application is intended to work with both mouse and touch input. The code for the training application is included in this repository under the trainer
folder. Simply open the index.html
file in a browser to run locally.
We use the gulp build system along with browserify to build gestrec.min.js.
npm install
in the gestures folder to install dependencies.gulp
.FAQs
JavaScript Gesture Recognizer using the Protractor algorithm.
We found that gestrec demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.