Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
lambda_map_reduce
gemA MapReduce implementation for use with lambdas.
Run gem install lambda_map_reduce
on the command line or add gem 'lambda_map_reduce'
to your project's
Gemfile
.
LambdaMapReduce.map_reduce
takes an Enumerable
, a mapper
lambda, and a
reducer
lambda.
The mapper
lambda is called once for every item in the Enumerable
. It
should take a single item and return an Array
of [key, value]
pairs.
The algorithm will shuffle all value
items with the same key
together, and
pass the resulting [key, Array of values] Arrays
to the reducer
, which
should return a single item.
The mapper
and reducer
may return nil
. The result of the algorithm is
the Array
of items produced from each reducer
call.
An example from the team_api
gem's CrossReferencer
class:
require 'lambda_map_reduce'
module TeamApi
class CrossReferencer
def self.create_tag_xrefs(site, items, category, xref_data)
items_to_tags = lambda do |item|
item_xref = xref_data.item_to_xref item
item[category].map { |tag| [tag, item_xref] } unless item[category].nil?
end
create_tag_xrefs = lambda do |tag, item_xrefs|
[tag, tag_xref(site, category, tag, item_xrefs)]
end
LambdaMapReduce.map_reduce(items, items_to_tags, create_tag_xrefs).to_h
end
end
end
This project is in the worldwide public domain. As stated in CONTRIBUTING:
This project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication.
All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.
FAQs
Unknown package
We found that lambda_map_reduce 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.
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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.