Difference between revisions of "IAG0581 - Programming I"
Line 1: | Line 1: | ||
== Links == | == Links == | ||
− | * [https://ois.ttu.ee/portal/page?_pageid=35,428610&_dad=portal&_schema=PORTAL&p_msg=&p_public=1&p_what=1&p_lang=ET&p_open_node2=&p_id=100807&p_mode=1&p_pageid=OKM_AINE_WEB_OTSING&_ainer_kood=iag0581 Course information in Study Information System OIS | + | * [https://ois.ttu.ee/portal/page?_pageid=35,428610&_dad=portal&_schema=PORTAL&p_msg=&p_public=1&p_what=1&p_lang=ET&p_open_node2=&p_id=100807&p_mode=1&p_pageid=OKM_AINE_WEB_OTSING&_ainer_kood=iag0581 Course information in Study Information System OIS] |
* '''[https://docs.google.com/document/d/1uf-X2HZC73b0U4mVBCY7D9wrrgBvu5UtlQJ5yvSJ90I/pub Announcements]''' | * '''[https://docs.google.com/document/d/1uf-X2HZC73b0U4mVBCY7D9wrrgBvu5UtlQJ5yvSJ90I/pub Announcements]''' | ||
* '''[https://docs.google.com/spreadsheets/d/1MSrsvUsdJUbMzJ5MYUwNSj0BjIJKyZVvDaLv8uKlTMM/pubhtml?gid=882379455&single=true Results]''' | * '''[https://docs.google.com/spreadsheets/d/1MSrsvUsdJUbMzJ5MYUwNSj0BjIJKyZVvDaLv8uKlTMM/pubhtml?gid=882379455&single=true Results]''' | ||
Line 22: | Line 22: | ||
It is possible to connect remotely to ICT-502 linux computers through SSH. [http://mini.li.ttu.ee/~priit/IAY0340.2013/ssh_setup/putty_guide.html Remote SSH tutorial] | It is possible to connect remotely to ICT-502 linux computers through SSH. [http://mini.li.ttu.ee/~priit/IAY0340.2013/ssh_setup/putty_guide.html 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 | + | 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 Windows, restart it and choose ''OpenSUSE 13.1'' from the boot menu. |
=== Logging in to Linux === | === Logging in to Linux === | ||
Line 35: | Line 35: | ||
{| class="wikitable" | {| class="wikitable" | ||
− | | [[File:Loginselect.jpg|200px|thumb|none| | + | | [[File:Loginselect.jpg|200px|thumb|none|Logging in]] |
− | | [[File:Openterm.jpg|200px|thumb|none| | + | | [[File:Openterm.jpg|200px|thumb|none|Opening terminal]] |
− | | [[File:Termopen.jpg|thumb|none| | + | | [[File:Termopen.jpg|thumb|none|Terminal]] |
|} | |} | ||
First thing you should type in is the command | First thing you should type in is the command | ||
Line 66: | Line 66: | ||
For example when you have saved your source code into file hello.c, then to compile it, insert: | For example when you have saved your source code into file hello.c, then to compile it, insert: | ||
<source lang="bash" collapse="false">gcc -o hello hello.c</source> | <source lang="bash" collapse="false">gcc -o hello hello.c</source> | ||
− | + | This will create a compiled, binary file named ''"hello"''. To make sure it really did so, we can check by inserting command '''ls''', which will show the contents of the current directory. | |
+ | Next, we can execute by typing | ||
+ | <source lang="bash" collapse="false">./hello</source> | ||
− | + | ==== Compilation under windows ==== | |
− | + | For compiling C under Windows, you will need to download either one of the following, which includes gcc compiler: | |
− | + | ||
− | + | ||
− | + | ||
* MinGW - http://www.mingw.org/ | * MinGW - http://www.mingw.org/ | ||
Line 80: | Line 79: | ||
* Cygwin - http://www.cygwin.com/ | * Cygwin - http://www.cygwin.com/ | ||
− | ====C/C++ | + | |
+ | ====C/C++ Integrated Development Environments (IDE)==== | ||
* Code::Blocks - http://www.codeblocks.org/ (Windows, Linux, Mac OS) | * Code::Blocks - http://www.codeblocks.org/ (Windows, Linux, Mac OS) | ||
− | + | To open in lab computers, use command '''codeblocks''' | |
* Geany - http://www.geany.org/ (Windows, Linux) | * Geany - http://www.geany.org/ (Windows, Linux) | ||
+ | |||
+ | To open in lab computers, use command '''geany''' | ||
* Orwell Dev-C++ - http://sourceforge.net/projects/orwelldevcpp/ (Windows) | * Orwell Dev-C++ - http://sourceforge.net/projects/orwelldevcpp/ (Windows) | ||
− | + | === Text editors with syntax highlight === | |
− | + | ||
− | === | + | |
[[File:Scite.png|200px|thumb|none|SciTE]] | [[File:Scite.png|200px|thumb|none|SciTE]] | ||
* SciTE - http://www.scintilla.org/SciTE.html (Windows, Linux, Mac OS) | * SciTE - http://www.scintilla.org/SciTE.html (Windows, Linux, Mac OS) | ||
− | + | To open in lab computers, use command '''SciTE''' | |
* Notepad++ - http://notepad-plus-plus.org/ (Windows) | * Notepad++ - http://notepad-plus-plus.org/ (Windows) | ||
− | === | + | === Diagram drawing tools === |
* ArgoUML - http://argouml.tigris.org/ (Windows, Linux) | * ArgoUML - http://argouml.tigris.org/ (Windows, Linux) | ||
− | + | To open in lab computers, use command '''argouml''' | |
* Astah Community - http://astah.net/download#community (Windows, Linux, Mac OS) | * Astah Community - http://astah.net/download#community (Windows, Linux, Mac OS) | ||
− | + | To open in lab computers, use command '''astah-com''' | |
* yEd - http://www.yworks.com/en/products_yed_about.html. (Windows, Linux, Mac OS) | * yEd - http://www.yworks.com/en/products_yed_about.html. (Windows, Linux, Mac OS) | ||
− | + | To open in lab computers, use command '''yEd''' | |
* Jackson System Programming (JSP) Editor - http://www.his.se/english/university/contact/staff/henrik-engstrom/jsp-editor/ (Windows, Linux, Mac OS) | * Jackson System Programming (JSP) Editor - http://www.his.se/english/university/contact/staff/henrik-engstrom/jsp-editor/ (Windows, Linux, Mac OS) | ||
− | + | To open in lab computers, use command '''jsp''' | |
{| class="wikitable" | {| class="wikitable" |
Revision as of 21:19, 2 September 2015
Contents
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 Windows, restart it and choose OpenSUSE 13.1 from the boot menu.
Logging in to Linux
When presented with the login screen,
- Choose the domain INTRA
- 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.
- 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.
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
This will create a compiled, binary file named "hello". To make sure it really did so, we can check by inserting command ls, which will show the contents of the current directory.
Next, we can execute by typing
./hello
Compilation under windows
For compiling C under Windows, you will need to download either one of the following, which includes gcc compiler:
- MinGW - http://www.mingw.org/
- Cygwin - http://www.cygwin.com/
C/C++ Integrated Development Environments (IDE)
- Code::Blocks - http://www.codeblocks.org/ (Windows, Linux, Mac OS)
To open in lab computers, use command codeblocks
- Geany - http://www.geany.org/ (Windows, Linux)
To open in lab computers, use command geany
- Orwell Dev-C++ - http://sourceforge.net/projects/orwelldevcpp/ (Windows)
Text editors with syntax highlight
- SciTE - http://www.scintilla.org/SciTE.html (Windows, Linux, Mac OS)
To open in lab computers, use command SciTE
- Notepad++ - http://notepad-plus-plus.org/ (Windows)
Diagram drawing tools
- ArgoUML - http://argouml.tigris.org/ (Windows, Linux)
To open in lab computers, use command argouml
- Astah Community - http://astah.net/download#community (Windows, Linux, Mac OS)
To open in lab computers, use command astah-com
- yEd - http://www.yworks.com/en/products_yed_about.html. (Windows, Linux, Mac OS)
To open in lab computers, use command yEd
- Jackson System Programming (JSP) Editor - http://www.his.se/english/university/contact/staff/henrik-engstrom/jsp-editor/ (Windows, Linux, Mac OS)
To open in lab computers, use command jsp