View f.rb
pid = spawn 'ruby', '-e', '
sleep 0.3
p from: :child, to: :child, ppid: Process.ppid, pid: Process.pid, gid: Process.gid, egid: Process.egid
system "ps jux | sed -n -E \'1p;/#{Process.ppid}|#{Process.pid}/p\' | grep -v sed | grep -v \'sh -c\' | grep -v \'ps jux\'"
', pgroup: true
p from: :parent, to: :parent, ppid: Process.ppid, pid: Process.pid, gid: Process.gid
p from: :parent, to: :child, ppid: Process.pid, pid: pid, gid: Process.getpgid(pid)
Process.wait
View notes.txt
* Working through http://ungineer.herokuapp.com
* Widgets: confirmed that I can click it to change its colour. Tried a few other ways of clicking (double clicking, dragging) but none did anything
* Constraints: Took a while, but eventually identified the pattern is red/blue/green/yellow, I'm remembering them by RGB, where RG=Yellow,
if you put them into a circle, it would be:
R Y
P G
B C
if se omit Pink and Cyan, it rotates counter-clockwise when you click it.
I then went back and checked that Widgets behave the same.
I didn't initially realize I could click the bottom one.
View ant-writing-prompt.md

What

Requested writing prompts b/c I didn't have the internet. Lovisa responded with "There was an ant that lived next to the tree and south of the lake. One day, the queen died unexpectedly and the ant..."

Approach

View prime_nn.rb
def neuron_value(input_neuron_values, synapses)
# The additional neuron with a value of 1 allows it to output 1 (on), even when all the inputs are 0 (off)
neurons_with_synapses = (input_neuron_values+[1]).zip(synapses)
total_input = neurons_with_synapses.reduce(0) { |sum, (neuron, synapse)| sum + neuron*synapse }
# This is the logistic function https://en.wikipedia.org/wiki/Logistic_function
# with L=1, k=1, x=input, x_0=0
1 / (1 + Math.exp(-total_input))
end
View bash_and_ansi_escape_sequence.md
echo "\[\033[${2:-37};60m\]${1}\[\033[0m\]"

Echo is the program echo that you can run from the terminal. (eg $ echo hello world) it works here because the output of the function is being captured and put into a string.


View complex_numbers.rb
class Float
# simplify distractingly large numbers that occur from floating point imprecision
def inspect
round(8).to_s
end
end
include Math
# Quantity of a degree in radians, b/c sin and cos expect radians
View 1_note_that_opt_parse_is_an_iffy_lib.md

SiB and OptionParser

Examples are from its docs: (here), links to the source are in the individual files. This is part of a response to

I'm using these versions:

$SiB.ver      # => "3.0.0.beta.7"
View contributing_to_an_open_source_project.md

How to contribute to an open source project

This assumes you have a specific open source project you want to contribute to. Maybe because you're interested in it, or you want to work with the dev, or make a good impression to the organization that maintains it, or whatever.

Most people in Ruby's OSS use Git to manage their source code, and most of these repositories are hosted on Github. If that's not the case, some details will change, but the big picture will probably remain the same. I'm going to assume familiarity