TechCrunch has a nice, full quote from Bill Gates on what he considers his greatest mistake. I include part of the quote in this image because his “winner-take-all” comment is so important.
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
This is an excerpt from the Scala Cookbook (partially modified for the internet). This is a very short recipe, Recipe 12.18, “How to run an external command (process) in a different directory.”
You want to use another directory as the base directory when running an external command.
This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 12.13, “How to handle the STDOUT and STDERR of external commands.”
You want to run an external command and get access to both its STDOUT and STDERR.
The simplest way to do this is to run your commands as shown in previous recipes, and then capture the output with a
ProcessLogger. This Scala shell script demonstrates the approach:
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
You want to run an external command and then use the standard output (STDOUT) from that process in your Scala program.Back to top
!! method to execute the command and get the standard output from the resulting process as a
Here’s a quick look at recent visitors to this website, first by Operating System and then by Browser.
If you ever wanted to get access to global operating system keystrokes from a Java or Scala Swing application, you can do it with the jnativehook library. Here’s a short demo:
Here’s the full Scala source code for the demo. I put a few comments in the code to highlight the important areas:
In several previous tutorials (see my references below) about testing for operating systems within Ant build scripts, and then conditionally executing targets based on the results of those tests, I noted that Mac OS X operating systems respond to both Mac and Unix test conditions based on the Ant "os family" test. I mentioned that I thought this behavior was probably correct, because Mac OS X is built an a Unix base (BSD, to be specific).
You're creating an Ant build script, and you need to determine the operating system the script is running on, so you can make conditional decisions within the build script. You typically want/need to do this if you're going to run tasks/targets that are different for each operating system (Mac, Windows, Unix, etc.).