This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: false | |
# processing module wrapper | |
require_relative '../rpextras' | |
module Processing | |
# Provides some convenience methods | |
module HelperMethods | |
# processings epsilon may not be defined yet | |
EPSILON ||= 9.999999747378752e-05 | |
# Nice block method to draw to a buffer. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Boundary { | |
private float lower; | |
private float upper; | |
Boundary(float lower, float upper) { | |
this.lower = lower; | |
this.upper = upper; | |
} | |
float lower() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GRID_SIZE = 5.0 | |
def settings | |
size 400, 400 | |
end | |
def setup | |
sketch_title 'Static Sketch' | |
stroke 206 | |
# grid is a convenience method of creating grid in JRubyArt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: false | |
require 'jruby_art' | |
module Processing | |
class Sketch < App # App is a subclass of processing.core.PApplet | |
# begin bare sketch ########################################### | |
# load_library :my_library # jruby_art method | |
# include_package 'org.package' # JRuby method | |
def settings | |
size 200, 200 # since processing-3.0 size 'mode' go here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Circles by Bárbara Almeida | |
# A fork of Circle through 3 points by Bárbara Almeida. | |
# Draw circles from 3 points moving on smooth random trajectories. | |
# https://www.openprocessing.org/sketch/211167 | |
# JRubyArt version by Martin Prout | |
load_library :circles | |
attr_reader :points |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
# the scanner class | |
class Scanner | |
attr_reader :sketches, :rest, :sketch | |
def initialize(path) | |
@sketches = FindSketches.new(path).sketches | |
end | |
def read_file(file_name) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if RUBY_PLATFORM == 'java' | |
require 'toxiclibs.jar' | |
def import_class_list(list, string) | |
list.each { |klass| java_import format(string, klass) } | |
end | |
module Simulation | |
include_package 'toxi.sim.automata' | |
include_package 'toxi.sim.dla' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'.platform-linux atom-text-editor, .platform-win32 atom-text-editor': | |
'alt-ctrl-b': 'atom-k9:run' | |
'alt-ctrl-shift-w': 'atom-k9:watch' | |
'alt-ctrl-c': 'atom-k9:close' | |
'.platform-darwin atom-text-editor': | |
'alt-cmd-b': 'atom-k9:run' | |
'alt-cmd-shift-w': 'atom-k9:watch' | |
'alt-cmd-c': 'atom-k9:close' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static public final float map(float value, | |
float start1, float stop1, | |
float start2, float stop2) { | |
float outgoing = | |
start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1)); | |
String badness = null; | |
if (outgoing != outgoing) { | |
badness = "NaN (not a number)"; | |
} else if (outgoing == Float.NEGATIVE_INFINITY || |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nvidia-352 using Administration Driver Manager | |
sudo update-alternatives --install /usr/bin/java java /opt/jdk{version}/bin/java 100 | |
sudo update-alternatives --install /usr/bin/jruby jruby /opt/jruby{version}/bin/jruby 100 | |
sudo update-alternatives --config java | |
sudo update-alternatives --config jruby | |
~/.profile | |
alias jpry="jruby -e \"require 'pry'; binding.pry\"" | |
export JAVA_HOME="/opt/jdk1.8.0_102" | |
export GEM_HOME="/home/tux/.gem/ruby/2.3.0" |