Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Zagorski ADT is a collection of abstract data types that are not included in the standard Ruby library.
Add this line to your application's Gemfile:
gem 'zadt'
And then execute:
$ bundle
Or install it yourself as:
$ gem install zadt
Zadt::ADT::help will return a list of objects in the collection, as well as a brief description of each type.
I also made a "help" function for each Data Type. Type Zadt::StackQueue.help get a list of methods for the StackQueue, and so on.
And don't forget to require 'zadt' at the top!
If you've never heard of a Stack or a Queue before, click here for an introduction.
A MinMaxStackQueue is an Queue object that allows the minimum and maximum values to be found in constant time. It's built by making a Queue out of a Stack, which has that same min/max ability.
Since it is made out of Queues and Stacks, those data types are also available. I also provided StackQueue (functionally the same as a Queue), and a MinMaxStack, which is a Stack version of MinMaxStackQueue.
My Stack has the following methods:
My Queue has the following methods:
StackQueue has the same methodology as Queue
My MinMaxStack has the following methods:
My MinMaxStackQueue has the following methods:
A Graph is a data type that consists of Vertices, which are connected by Edges. In addition, a FaceGraph is a Graph which also consists of Faces: the space defined inside a set of cyclic edges.
I'm still working on the exact functionality of FaceGraph, since I mainly built it to use for a different project, but it should still prove useful for certain situations. If you have any suggestions of useful bits to add, feel free to contact me!
Below are the specifics of such data types.
A Graph has the following methods
A FaceGraph has the following methods, in addition to its inheritance from Graph
Geometric objects, contained within a universe.
An universe is a Euclidean coordinate system that can be any number of dimensions. When initialized, you can specify how many dimensions you want it, or you can leave it blank to have infinite dimensions. Once a dimension is set, all objects in it are limited to that many dimensions. A universe of infinite dimensions has no restrictions, and can hold objects of any number of dimensions.
Within the universe, you can create Points and Spheres (though the more proper term is HyperSphere, more on that later). The only two functions are #add_point(coordinates) and #add_sphere(radius, center). Both will check to ensure that the number of dimensions matches the universe (if the universe has a finite number of dimensions).
In addition, the universe has the class method Universe.distance(pointA, pointB), which will tell you the distance between any two points. This will work for points in any number of dimensions, so long as the two points are of the same.
A HyperSphere is a set of points within a certain number of dimensions that are equidistant (equal distance) from a given point. The number of dimensions is defined by the number of coordinates in its center. For example, a two-dimensional sphere (called a Circle) has a center of (x,y).
Upon creation, a HyperSphere is given a radius and a center (default is the 4-dimensional Unit Sphere, of radius 1 and center [0,0,0,0]). HyperSpheres are immutable, meaning the radius and center cannot be changed.
A HyperSphere has the following methods
A Sphere is a sub-class of the HyperSphere that has 3 dimensions and the following additional methods.
A Circle is a sub-class of the HyperSphere that has 2 dimensions and the following additional methods.
A Linked List is a chain of nodes that each contain a value, and a pointer to the next link in the chain. A Doubly Linked List has nodes that also point to the previous link in the chain.
LinkedListNode has the following methods.
DoublyLinkedListNode has the following methods.
Bug reports and pull requests are welcome on GitHub at https://github.com/mrmicrowaveoven/zadt. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.
This gem was written in its entirety by Benjamin Zagorski, who can be contacted at Benj@Zagorski.com. My portfolio can be found at BenjZagorski.online. Feel free to contact me with any questions or comments, as I'm very open to suggestions.
FAQs
Unknown package
We found that zadt 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.