lines

Scala - An index of methods to run/execute external system commands

This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 12.20, “An index of methods available to run external system commands.”

The following tables list the methods of the scala.sys.process package that you can use when running external (system) commands.

Methods to execute external commands

Table 12-1 lists the methods that you can use to execute system commands.

Table 12-1. Methods to execute system commands

How to execute external commands and use their STDOUT in Scala

This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 12.12, “How to execute external commands and use their STDOUT in Scala.”

Back to top

Problem

You want to run an external command and then use the standard output (STDOUT) from that process in your Scala program.

Back to top

Solution

Use the !! method to execute the command and get the standard output from the resulting process as a String.

Table of Contents

  1. Problem
  2. Solution
Back to top

Gimp: Textured backgrounds, chalky lines, straight lines, and more

I spent several hours today working with the Gimp software application today, mostly doing work in trying to create textured areas, canvas backgrounds, and irregular lines (like chalk lines), and I'm writing this post for myself so I can remember everything I tried, and specifically what worked.

How to draw a straight line in Gimp

I think I've written this before, but to draw a straight line in Gimp:

The Linux wc command (word count)

The Linux word count command is named wc. The wc command counts the number of characters, words, and lines that are contained in a text stream. If that sounds simple or boring, it's anything but; the wc command can be used in Linux command pipelines to do all sorts of interesting things.

Let's take a look at some Linux wc command examples to show the power of this terrific little command.

LaTeX multiline comments

I often have a need to create LaTeX comments that span multiple lines. Of course you can create single line comments in LaTeX using the percent character like this:

% this is a comment

But I want to be able to create LaTeX comments that go on for multiple lines. Fortunately, if you know that you're supposed to include the verbatim package, this is pretty easy.

LaTeX multiline comments example

The first step is to include the verbatim package, like this: