IAG0581 - Programming I

From ATI public wiki
Revision as of 16:36, 2 September 2015 by Hkinks (Talk)

Jump to: navigation, search

Links


Materials

Vladimir Viies - http://www.tud.ttu.ee/im/Vladimir.Viies/materials/IAG0581,IAG0582,PROGRAMMEERIMINE/PR1/

Risto Heinsar - http://www.blue.pri.ee/ttu/programming-i/


Moodle materials

Self-registration from https://moodle.e-ope.ee/

Lab computers

Labs are taking place in ICT-502.

It is possible to connect remotely to ICT-502 linux computers through SSH. Remote SSH tutorial

ICT-502 computers have both Windows 7 and OpenSUSE 13.1 Linux operating system installed. For this course Linux will be used. If the computer is in Windwos, restart it and choose OpenSUSE 13.1 from the boot menu.

Logging in to Linux

When presented with the login screen,

  1. Choose the domain INTRA
Logging in
  1. Insert your Uni-ID username. If you do not have it, you can get one from ICT-410 or with ID-card/residence permit from the website https://pass.ttu.ee.
  2. Insert password and press enter

Starting work

Most of the time you will be needing terminal. The quickest way to open it is to right click on desktop and choose Open in Terminal.

Opening terminal
Opening terminal

First thing you should type in is the command

cad

This will prepare the environment for work, so that the following commands for opening software will work later on.

Basic linux bash commands

ls #outputs the files in the current directory
ls -l #outputs the contents of the current directory as a list with additional information, like permissions and date modified.
ls -a #outputs all of the files in the current directory, including dot files.
ls -la #outputs the contents of the current directory, combining the preferences from two last commands
cd new #changing directory to folder named ''new'' that resides in the current directory
cd .. #changes directory to parent directory
cd ../new #changes directory to folder named ''new'' which resides in the parent directory
mkdir newfolder #creates new folder with name ''newfolder''
cp main.c main2.c #copies the file ''main.c'' to ''main2.c''
mv main.c main2.c #moves the file ''main.c'' to ''main2.c''
man <command> #displays information about the specified command

Avamaks programmi taustal on võimalik käskudele lõppu lisada ampersandi (&). Näiteks SciTE&.

Software

Compilation from terminal

For compiling code in terminal, there's a command gcc. For example when you have saved your source code into file hello.c, then to compile it, insert:

gcc -o hello hello.c

As


See tekitab binaarfaili hello, milles võime veenduda kasutades käsku ls. Järgnevalt on see võimalik tööle panna käsuga

./hello

Windowsi all käsitsi gcc-ga kompileerimiseks võib kasutada nt:


C/C++ Integreeritud programmeerimiskeskkonnad (IDE)

Klassi arvutites terminali käsk codeblocks



Klassi arvutites terminali käsk geany

Süntaksi värvimisega tekstiredaktorid

SciTE

Klassi arvutites terminali käsk SciTE


Diagrammide joonistamisvahendid

Klassi arvutites terminali käsk argouml


Klassi arvutites terminali käsk astah-com


Klassi arvutites terminali käsk yEd


Klassi arvutites terminali käsk jsp

argoUML
yEd
Jackson System Programming (JSP) Editor