🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

princeton_standard_libraries

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

princeton_standard_libraries

bundlerRubygems
Version
0.1.0
Version published
Maintainers
1
Created
Source

Princeton Standard Libraries Jruby wrapper

I was going through the Algorithms 4th edition and wanted to write the algorithms in ruby instead of the default java. The book uses the Princeton Standard Libraries to help clarify the code.

Installation

Add this line to your application's Gemfile:

gem 'princeton_standard_libraries'

And then execute:

$ bundle

Or install it yourself as:

$ gem install princeton_standard_libraries

Usage

require 'princeton_standard_libraries'

n = 50
Java::StdDraw.set_xscale(0,n)
Java::StdDraw.set_yscale(0,n*n)
Java::StdDraw.set_pen_radius(0.01)
Java::StdDraw.point(10, 10)
Java::StdDraw.point(10, 10)

1.upto(n) do |i|
  Java::StdDraw.point(i, i)
  Java::StdDraw.point(i, i*i)
  Java::StdDraw.point(i, i*Math.log(i))
end

License

The gem is available as open source under the terms of the GNU General Public License, version 3 (GPLv3).

FAQs

Package last updated on 26 Dec 2018

Did you know?

Socket

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.

Install

Related posts