Tutorial by Examples: by

Open3.popen3 or Open3.capture3: Open3 actually just uses Ruby's spawn command, but gives you a much better API. Open3.popen3 Popen3 runs in a sub-process and returns stdin, stdout, stderr and wait_thr. require 'open3' stdin, stdout, stderr, wait_thr = Open3.popen3("sleep 5s && ls&q...
Exec: exec 'echo "hello world"' or exec ('echo "hello world"') The System Command: system 'echo "hello world"' Will output "hello world" in the command window. or system ('echo "hello world"') The system command can return a true if ...
Shifting bits left (right) is equivalent to multiplying (dividing) by 2. It's the same in base 10: if we "left-shift" 13 by 2 places, we get 1300, or 13 * (10 ** 2). And if we take 12345 and "right-shift" by 3 places and then remove the decimal part, we get 12, or Math.floor(1234...
Suppose you’ve got a lot of commit against a project (here ulogd2, official branch is git-svn) and that you wan to send your patchset to the Mailling list [email protected]. To do so, just open a shell at the root of the git directory and use: git format-patch --stat -p --raw --signoff --subject...
Using Line Numbers ... and documenting them in case of error ("The importance of seeing Erl") Detecting which line raises an error is a substantial part of any debugging and narrows the search for the cause. To document identified error lines with a short description completes a successf...

Page 23 of 23