Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
ndarray-linear-interpolate
Advanced tools
Multilinear (ie bilinear/trilinear) interpolation for ndarrays.
var ndarray = require("ndarray")
var interp = require("ndarray-linear-interpolate")
var x = ndarray(new Float32Array(9), [3, 3])
x.set(1, 1, 1.0)
for(var u=0.0, u<=3.0; u+=0.25) {
var row = []
for(var v=0.0; v<=3.0; v+=0.25) {
row.push(interp(x, u, v))
}
console.log(row.join(" "))
}
//Prints out:
//
// 0 0 0 0 0 0 0 0 0 0 0 0 0
// 0 0.0625 0.125 0.1875 0.25 0.1875 0.125 0.0625 0 0 0 0 0
// 0 0.125 0.25 0.375 0.5 0.375 0.25 0.125 0 0 0 0 0
// 0 0.1875 0.375 0.5625 0.75 0.5625 0.375 0.1875 0 0 0 0 0
// 0 0.25 0.5 0.75 1 0.75 0.5 0.25 0 0 0 0 0
// 0 0.1875 0.375 0.5625 0.75 0.5625 0.375 0.1875 0 0 0 0 0
// 0 0.125 0.25 0.375 0.5 0.375 0.25 0.125 0 0 0 0 0
// 0 0.0625 0.125 0.1875 0.25 0.1875 0.125 0.0625 0 0 0 0 0
// 0 0 0 0 0 0 0 0 0 0 0 0 0
// 0 0 0 0 0 0 0 0 0 0 0 0 0
// 0 0 0 0 0 0 0 0 0 0 0 0 0
// 0 0 0 0 0 0 0 0 0 0 0 0 0
// 0 0 0 0 0 0 0 0 0 0 0 0 0
//
npm install ndarray-linear-interpolate
require("ndarray-linear-interpolate")(array, x, y, z, ...)
Interpolates values on an ndarray.
array
the array to interpolate fromx, y, z...
the coordinate to evaluate the interpolated grid atReturns The multilinearly interpolated value
Note To avoid the overhead of variable arguments, special interfaces are available for 1, 2 and 3 dimensions. You can access these using:
require("ndarray-linear-interpolate").d1
require("ndarray-linear-interpolate").d2
require("ndarray-linear-interpolate").d3
(c) 2013 Mikola Lysenko. MIT License
FAQs
Multilinear interplation for ndarrays
We found that ndarray-linear-interpolate 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.