RPi Education/Manual

Please add any contributions to the educational user manual here. These should take the form of step-by-step guides or listings with descriptions. Alternatively, email your contribution by taking a look at this Raspberry Pi forum posting.

=Intro=

General
The objective is to educate people in computer science.

Hardware
Cheap hardware with 1/2 open specifications allow the masses to learn modern computer science.
 * 1) Plug in your RPi to your monitor with the hdmi and usb cable
 * 2) Plug in your mouse and keyboard to your monitor
 * 3) Plug in your monitor power and turn it on.

Software
Linux is used, it is open source, user friendly, and technically capable.

Language Selection
Beginners should select a high level language. Advanced users may select different languages combinations depending on the available libraries, programming paradigm, and optimizations.

All code is executed in binary assembled from assembly code compiled from a language sometimes in-turn compiled from other higher level languages.

There are 2 main interfaces for most all applications in linux CLI, and GUI, while GUIs are user friendly CLIs are more simple to build and can be used as building blocks for more complicated tools/toys.

It is considered good programming to use an iterative approach, using existing tools and patterns as much as possible, as such it is customary to start with a hello world:

Bash
Bash is the language of the terminal.


 * 1) open the termonal application
 * 2) type:

That was a computer program,

If you want to learn more about the echo command you can type (press q to quit)

Now let's make our program into runnable file:

Which should ouput:  Hello Tux! 
 * 1) [Ctrl]+[x],[y],[enter]
 * 1) [Ctrl]+[x],[y],[enter]
 * 1) [Ctrl]+[x],[y],[enter]

Python
Make a file called hi.py, put  in it and run it with python hi.py

Now a GUI version:

java
Create a text file called 'Hello.java' with the following content:

Now compile your file as follows:

To run your program:

It should respond with Hello World!

C
Create a Text File called 'hello.c' which contains the following:

Now compile the file using 'cc', like this:

If all went well, there will no error messages and a new file called 'a.out' should have been created by the compiler. To run your program type:

It should report back with your message:

Hello World!

C++
For starters the famous "Hello world!" example. Save the following code in a file called helloworld.cpp in a directory of your choice (e.g. ~/cpp). The filename can be chosen arbitrarily, but should describe the content.

Open a terminal and switch to the directory, which contains the saved file.

Make sure with ls that you are in the correct directory. It should output helloworld.cpp and all other files in this directory (if any).

Now it is time to translate your code so your computer can understand it. This is called compiling.

If everything went ok, nothing is printed. Now run your program.

This outputs Hello world! on the command line.

perl
A "Hello World" example in Perl.

Create a file called 'hello.pl' in a directory of your choice, with the following contents:

To run your program type:

It should respond with:

Hello World!</tt>

Structure
Most all code is executed in order; from top to bottom, left to right, and in English.

Control flow statements

 * Decision-making statements (if-then, if-then-else, switch)
 * Looping statements (for, while, do-while, break, continue)
 * branching statements (fork join)

operators

 * maybe we can just link to the SDKs that are shipped with the book?
 * perl
 * java
 * python
 * bash

functions
reusable blocks of code

objects
are basically function containers, and yet so much more.

=Beginning=

Features, libraries, and limitations.

Python
=Intermediate=

Useful tools and fun toys.

Theory and tools

 * Version Control: git, svn, etc
 * Iterative and Test Driven Development
 * Writing software for someone else (User Stories, Use Cases, requirements, contracts)
 * editors and IDEs: vim, gedit, eclipse, etc

Python
=Advanced=

Algorithms, Heuristics, Design Patterns, and Optimization.