![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Statistical functions for a set of data.
There are other gems that have better performance if you are interested in standard deviation for large data sets.
The main thing this gem does is that it calculates max/min while calculating the sum of squares for standard deviation. If you don't need the max/min after calculating standard deviation, there are probably better choices.
$ gem install mad_math
$ gem 'mad_math'
$ require 'mad_math'
To require all classes/modules included in MadMath
,
require all of them:
require 'mad_math/all'
Stats
is required by default.
Basic usage as follows:
stats = MadMath::Stats.new([1, 2, 3, 4])
stats.load #=> Runs all calculations and caches the values
stats.average #=> 2.5
The following methods are available on an instance of Stats
:
load
stdev
average
sum
count
stdev
stdevp
max
min
To use this, you must either require all classes or require it specifically. The assumption is that few users will be utilizing that class.
require 'mad_math/newton_polynomial'
Data is passed in as an array of arrays
and may be appended to by using #add
:
# y = x ** 2 + 1
np = MadMath::NewtonPolynomial.new([[1, 2], [2, 5], [3, 10]])
np.add 4, 17
np.value_for 5 #=> 26.0
Common advice is to not check in the Gemfile.lock for libraries.
This is a terrible practice.
If you attempt to use a gem that has no Gemfile.lock
committed, then you have no idea what combination
of dependencies has a reasonable expectation of working.
If you are a maintainer of said gem,
you will have a local Gemfile.lock that likely works.
And you are probably not deleting it EVERY time you
work on the gem.
We all know that we SHOULD delete the Gemfile.lock on occasion
and some of us maybe even do it.
But more of us run an occasional bundle update
and keep on trucking.
The point is that on an actively-maintained gem, not checking the Gemfile.lock in only makes it harder to get started helping, not easier. I will gladly remove my Gemfile.lock once I have a passing suite with known 'supported' dependencies. At that point, I may get errors from udpated dependencies that would be a good starting point for contributions. Or I may just continue pursuing the pull request to fix/update/add a feature that caused me to care about a Gemfile.lock for the project in the first place. Either way, the project is better for it.
There are far more out-of-date/unmaintained gems than there are up-to-date/active gems. Many of the out-of-date gems are actually useful. And many of them have dependencies that don't work when updated. It is much harder to get something working if you have no idea what a good starting point is or even whether it was expected to work at some point (maybe the test suite was failing when it was abandoned). The point is that it is very difficult to know the difference without a Gemfile.lock.
This is one of the dumbest things we do. The practice of not checking in a Gemfile.lock for libraries is ridiculous and we should start checking them in.
FAQs
Unknown package
We found that mad_math 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.