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.
Version 1.0.6
Python 3.7+ module to calculate riemann sum area under a curve
Copyright 2019 Steven Mycynek
Supports
USAGE = """ -p|--poly {DegreeN1:CoefficientM1, DegreeN2:CoefficientM2, ...}...
-l|--lower <lower_bound> -u|--upper <upper_bound> -s|--step <step>
-a|--algorithm <simpson | trapezoid | midpoint>
| This was just a fun experiment I did on a couple airplane rides and might not be suitable for production use.
Try a simple function you can integrate by hand easily, like f(x) = x^3
from [0-10]
, and
compare that to how accurate the midpoint, trapezoid, and simpson approximations are with various
steps sizes.
Why not use numpy? You probably should, but I wanted to do everything from scratch for fun.
python3 area_under_curve.py --polynomial {3:1} --lower 0 --upper 10 --step .1 --algorithm simpson
or:
import area_under_curve as auc
algorithm = auc.get_algorithm("simpson")
bounds = auc.Bounds(0, 10, .1)
polynomial = auc.Polynomial({3:1})
params = auc.Parameters(polynomial, bounds, algorithm)
AREA = auc.area_under_curve(params.polynomial, params.bounds, params.algorithm)
print(str(AREA))
Also try out unit_test.py
and demo.py
.
Use poetry install
and poetry shell
for a python3 environment with dev dependencies.
FAQs
Calculate area under curve
We found that area-under-curve demonstrated a healthy version release cadence and project activity because the last version was released less than 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.