Docs: Some minor corrections

(cherry picked from commit 52a0b2c6b89b4887f84f052dd85c458a8f4fb68a)
This commit is contained in:
Patrik Nordwall 2011-05-10 15:54:25 +02:00
parent fe85ae111d
commit a3499bc535
8 changed files with 33 additions and 31 deletions

View file

@ -124,7 +124,7 @@ convenient.
For example, building Akka as above is more commonly done like this::
% sbt
[info] Building project akka 1.1-SNAPSHOT against Scala 2.9.0.RC1
[info] Building project akka 1.1-SNAPSHOT against Scala 2.9.0
[info] using AkkaParentProject with sbt 0.7.6.RC0 and Scala 2.7.7
> update
[info]

View file

@ -34,7 +34,7 @@ __ https://github.com/jboner/akka/blob/master/akka-tutorials/akka-tutorial-first
Prerequisites
-------------
This tutorial assumes that you have Jave 1.6 or later installed on you machine and ``java`` on your ``PATH``. You also need to know how to run commands in a shell (ZSH, Bash, DOS etc.) and a decent text editor or IDE to type in the Scala code.
This tutorial assumes that you have Java 1.6 or later installed on you machine and ``java`` on your ``PATH``. You also need to know how to run commands in a shell (ZSH, Bash, DOS etc.) and a decent text editor or IDE to type in the Scala code.
Downloading and installing Akka
-------------------------------
@ -95,16 +95,16 @@ Downloading and installing Scala
To build and run the tutorial sample from the command line, you have to install the Scala distribution. If you prefer to use SBT to build and run the sample then you can skip this section and jump to the next one.
Scala can be downloaded from `http://www.scala-lang.org/downloads <http://www.scala-lang.org/downloads>`_. Browse there and download the Scala 2.9.0.RC1 release. If you pick the ``tgz`` or ``zip`` distribution then just unzip it where you want it installed. If you pick the IzPack Installer then double click on it and follow the instructions.
Scala can be downloaded from `http://www.scala-lang.org/downloads <http://www.scala-lang.org/downloads>`_. Browse there and download the Scala 2.9.0 release. If you pick the ``tgz`` or ``zip`` distribution then just unzip it where you want it installed. If you pick the IzPack Installer then double click on it and follow the instructions.
You also need to make sure that the ``scala-2.9.0.RC1/bin`` (if that is the directory where you installed Scala) is on your ``PATH``::
You also need to make sure that the ``scala-2.9.0/bin`` (if that is the directory where you installed Scala) is on your ``PATH``::
$ export PATH=$PATH:scala-2.9.0.RC1/bin
$ export PATH=$PATH:scala-2.9.0/bin
You can test your installation by invoking scala::
$ scala -version
Scala code runner version 2.9.0.RC1 -- Copyright 2002-2011, LAMP/EPFL
Scala code runner version 2.9.0.final -- Copyright 2002-2011, LAMP/EPFL
Looks like we are all good. Finally let's create a source file ``Pi.scala`` for the tutorial and put it in the root of the Akka distribution in the ``tutorial`` directory (you have to create it first).
@ -133,7 +133,7 @@ If you have not already done so, now is the time to create an SBT project for ou
Name: Tutorial 1
Organization: Hakkers Inc
Version [1.0]:
Scala version [2.9.0.RC1]:
Scala version [2.9.0]:
sbt version [0.7.6.RC0]:
Now we have the basis for an SBT project. Akka has an SBT Plugin making it very easy to use Akka is an SBT-based project so let's use that.

View file

@ -6,7 +6,7 @@ Getting Started Tutorial (Java): First Chapter
Introduction
------------
Welcome to the first tutorial on how to get started with Akka and Java. We assume that you already know what Akka and Java are and will now focus on the steps necessary to start your first project.
Welcome to the first tutorial on how to get started with `Akka <http://akka.io>`_ and Java. We assume that you already know what Akka and Java are and will now focus on the steps necessary to start your first project.
There are two variations of this first tutorial:
@ -165,7 +165,9 @@ Here is the layout that Maven created::
As you can see we already have a Java source file called ``App.java``, let's now rename it to ``Pi.java``.
We also need to edit the ``pom.xml`` build file. Let's add the dependency we need as well as the Maven repository it should download it from. It should now look something like this::
We also need to edit the ``pom.xml`` build file. Let's add the dependency we need as well as the Maven repository it should download it from. It should now look something like this:
.. code-block:: xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
@ -292,7 +294,7 @@ Now we can create the worker actor. This is done by extending in the ``UntypedA
Work work = (Work) message;
// perform the work
double result = calculatePiFor(work.getStart(), work.getNrOfElements())
double result = calculatePiFor(work.getStart(), work.getNrOfElements());
// reply with the result
getContext().replyUnsafe(new Result(result));
@ -492,7 +494,7 @@ Now the only thing that is left to implement is the runner that should bootstrap
pi.calculate(4, 10000, 10000);
}
public void calculate(int nrOfWorkers, int nrOfElements, int nrOfMessages)
public void calculate(final int nrOfWorkers, final int nrOfElements, final int nrOfMessages)
throws Exception {
// this latch is only plumbing to know when the calculation is completed
@ -688,7 +690,7 @@ Before we package it up and run it, let's take a look at the full code now, with
// ==================
// ===== Run it =====
// ==================
public void calculate(int nrOfWorkers, int nrOfElements, int nrOfMessages)
public void calculate(final int nrOfWorkers, final int nrOfElements, final int nrOfMessages)
throws Exception {
// this latch is only plumbing to know when the calculation is completed
@ -753,7 +755,7 @@ If you used Maven, then you can run the application directly inside Maven. First
$ mvn compile
When this in done we can run our application directly inside SBT::
When this in done we can run our application directly inside Maven::
$ mvn exec:java -Dexec.mainClass="akka.tutorial.first.java.Pi"
...

View file

@ -6,7 +6,7 @@ Getting Started Tutorial (Scala with Eclipse): First Chapter
Introduction
------------
Welcome to the first tutorial on how to get started with Akka and Scala. We assume that you already know what Akka and Scala are and will now focus on the steps necessary to start your first project. We will be using `Eclipse <http://www.eclipse.org/downloads/>`_, and the `Scala plugin for Eclipse <http://www.scala-ide.org/>`_.
Welcome to the first tutorial on how to get started with `Akka <http://akka.io>`_ and `Scala <http://scala-lang.org>`_. We assume that you already know what Akka and Scala are and will now focus on the steps necessary to start your first project. We will be using `Eclipse <http://www.eclipse.org/downloads/>`_, and the `Scala plugin for Eclipse <http://www.scala-ide.org/>`_.
The sample application that we will create is using actors to calculate the value of Pi. Calculating Pi is a CPU intensive operation and we will utilize Akka Actors to write a concurrent solution that scales out to multi-core processors. This sample will be extended in future tutorials to use Akka Remote Actors to scale out on multiple machines in a cluster.
@ -139,16 +139,16 @@ Downloading and installing Scala
To build and run the tutorial sample from the command line, you have to install the Scala distribution. If you prefer to use Eclipse to build and run the sample then you can skip this section and jump to the next one.
Scala can be downloaded from `http://www.scala-lang.org/downloads <http://www.scala-lang.org/downloads>`_. Browse there and download the Scala 2.9.0.RC1 release. If you pick the ``tgz`` or ``zip`` distribution then just unzip it where you want it installed. If you pick the IzPack Installer then double click on it and follow the instructions.
Scala can be downloaded from `http://www.scala-lang.org/downloads <http://www.scala-lang.org/downloads>`_. Browse there and download the Scala 2.9.0 release. If you pick the ``tgz`` or ``zip`` distribution then just unzip it where you want it installed. If you pick the IzPack Installer then double click on it and follow the instructions.
You also need to make sure that the ``scala-2.9.0.RC1/bin`` (if that is the directory where you installed Scala) is on your ``PATH``::
You also need to make sure that the ``scala-2.9.0/bin`` (if that is the directory where you installed Scala) is on your ``PATH``::
$ export PATH=$PATH:scala-2.9.0.RC1/bin
$ export PATH=$PATH:scala-2.9.0/bin
You can test your installation by invoking scala::
$ scala -version
Scala code runner version 2.9.0.RC1 -- Copyright 2002-2011, LAMP/EPFL
Scala code runner version 2.9.0.final -- Copyright 2002-2011, LAMP/EPFL
Looks like we are all good. Finally let's create a source file ``Pi.scala`` for the tutorial and put it in the root of the Akka distribution in the ``tutorial`` directory (you have to create it first).
@ -164,7 +164,7 @@ If you have not already done so, now is the time to create an Eclipse project fo
Using SBT in Eclipse
^^^^^^^^^^^^^^^^^^^^
If you are an `SBT <http://code.google.com/p/simple-build-tool/>`_ user, you can follow the :doc:`Akka Tutorial in Scala </intro/getting-started-first-scala>` and additionally install the ``sbt-eclipse`` plugin. This adds support for generating Eclipse project files from your SBT project. You need to update your SBT plugins definition in ``project/plugins``::
If you are an `SBT <http://code.google.com/p/simple-build-tool/>`_ user, you can follow the :ref:`getting-started-first-scala-download-sbt` instruction and additionally install the ``sbt-eclipse`` plugin. This adds support for generating Eclipse project files from your SBT project. You need to update your SBT plugins definition in ``project/plugins``::
import sbt._
@ -190,7 +190,7 @@ and then update your SBT project definition by mixing in ``Eclipsify`` in your p
Then run the ``eclipse`` target to generate the Eclipse project::
dragos@dragos-imac pi $ sbt eclipse
[info] Building project AkkaPi 1.0 against Scala 2.9.0.RC1
[info] Building project AkkaPi 1.0 against Scala 2.9.0
[info] using MySbtProject with sbt 0.7.4 and Scala 2.7.7
[info]
[info] == eclipse ==
@ -412,8 +412,8 @@ Run it from Eclipse
Eclipse builds your project on every save when ``Project/Build Automatically`` is set. If not, bring you project up to date by clicking ``Project/Build Project``. If there are no compilation errors, you can right-click in the editor where ``Pi`` is defined, and choose ``Run as.. /Scala application``. If everything works fine, you should see::
AKKA_HOME is defined as [/Users/jboner/tools/akka-modules-1.1-M1/]
loading config from [/Users/jboner/tools/akka-modules-1.1-M1/config/akka.conf].
AKKA_HOME is defined as [/Users/jboner/tools/akka-actors-1.1]
loading config from [/Users/jboner/tools/akka-actors-1.1/config/akka.conf].
Pi estimate: 3.1435501812459323
Calculation time: 858 millis

View file

@ -44,7 +44,7 @@ Then you can navigate down to the tutorial::
Prerequisites
-------------
This tutorial assumes that you have Jave 1.6 or later installed on you machine and ``java`` on your ``PATH``. You also need to know how to run commands in a shell (ZSH, Bash, DOS etc.) and a decent text editor or IDE to type in the Scala code.
This tutorial assumes that you have Java 1.6 or later installed on you machine and ``java`` on your ``PATH``. You also need to know how to run commands in a shell (ZSH, Bash, DOS etc.) and a decent text editor or IDE to type in the Scala code.
You need to make sure that ``$JAVA_HOME`` environment variable is set to the root of the Java distribution. You also need to make sure that the ``$JAVA_HOME/bin`` is on your ``PATH``::
@ -131,16 +131,16 @@ Downloading and installing Scala
To build and run the tutorial sample from the command line, you have to install the Scala distribution. If you prefer to use SBT to build and run the sample then you can skip this section and jump to the next one.
Scala can be downloaded from `http://www.scala-lang.org/downloads <http://www.scala-lang.org/downloads>`_. Browse there and download the Scala 2.9.0.RC1 release. If you pick the ``tgz`` or ``zip`` distribution then just unzip it where you want it installed. If you pick the IzPack Installer then double click on it and follow the instructions.
Scala can be downloaded from `http://www.scala-lang.org/downloads <http://www.scala-lang.org/downloads>`_. Browse there and download the Scala 2.9.0 release. If you pick the ``tgz`` or ``zip`` distribution then just unzip it where you want it installed. If you pick the IzPack Installer then double click on it and follow the instructions.
You also need to make sure that the ``scala-2.9.0.RC1/bin`` (if that is the directory where you installed Scala) is on your ``PATH``::
You also need to make sure that the ``scala-2.9.0/bin`` (if that is the directory where you installed Scala) is on your ``PATH``::
$ export PATH=$PATH:scala-2.9.0.RC1/bin
$ export PATH=$PATH:scala-2.9.0/bin
You can test your installation by invoking scala::
$ scala -version
Scala code runner version 2.9.0.RC1 -- Copyright 2002-2011, LAMP/EPFL
Scala code runner version 2.9.0.final -- Copyright 2002-2011, LAMP/EPFL
Looks like we are all good. Finally let's create a source file ``Pi.scala`` for the tutorial and put it in the root of the Akka distribution in the ``tutorial`` directory (you have to create it first).
@ -167,7 +167,7 @@ If you have not already done so, now is the time to create an SBT project for ou
Name: Tutorial 1
Organization: Hakkers Inc
Version [1.0]:
Scala version [2.9.0.RC1]:
Scala version [2.9.0]:
sbt version [0.7.6.RC0]:
Now we have the basis for an SBT project. Akka has an SBT Plugin making it very easy to use Akka is an SBT-based project so let's use that.

View file

@ -27,7 +27,7 @@ essential parts for getting started with different development environments.
Prerequisites
-------------
Akka requires that you have `Jave 1.6 <http://www.oracle.com/technetwork/java/javase/downloads/index.html>`_ or
Akka requires that you have `Java 1.6 <http://www.oracle.com/technetwork/java/javase/downloads/index.html>`_ or
later installed on you machine.
Download

View file

@ -115,7 +115,7 @@ To run these examples:
::
Welcome to Scala version 2.9.0.RC1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_25).
Welcome to Scala version 2.9.0 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_25).
Type in expressions to have them evaluated.
Type :help for more information.

View file

@ -97,7 +97,7 @@ First we need to create an SBT project for our tutorial. You do that by stepping
Name: Chat
Organization: Hakkers Inc
Version [1.0]:
Scala version [2.9.0.RC1]:
Scala version [2.9.0]:
sbt version [0.7.6.RC0]:
Add the Akka SBT plugin definition to your SBT project by creating a ``Plugins.scala`` file in the ``project/plugins`` directory containing::