COMPSCI 340 SOFTENG 370 Semester 2 2014 Tutorial

  • Slides: 30
Download presentation
COMPSCI 340 & SOFTENG 370 Semester 2 - 2014 Tutorial 1

COMPSCI 340 & SOFTENG 370 Semester 2 - 2014 Tutorial 1

About the tutor • Name: Ahmad Obidat • Qualifications: – Ph. D in Information

About the tutor • Name: Ahmad Obidat • Qualifications: – Ph. D in Information System, the University of Auckland, 2011 – Present – Education Specialist in Computer Science Education, Florida Institute of Tech. , 2009 – Master of Science in Computer Science Education, Florida Institute of Tech. , 2006

How can you contact me? • Email: a. obidat@auckland. ac. nz How and where

How can you contact me? • Email: a. obidat@auckland. ac. nz How and where can you meet me ? • Weekly office hours on Monday from 12 pm to 2 pm – Location: in the area across from Room 303. 488 • By appointment: please, email me to set time and place

Today’s Agenda • Installing Ubuntu • Java vs. Python • Installing necessary apps for

Today’s Agenda • Installing Ubuntu • Java vs. Python • Installing necessary apps for the course

Linux Distributions • The most popular are Ubuntu, Red Hat, Fedora, Su. SE, PCLinux.

Linux Distributions • The most popular are Ubuntu, Red Hat, Fedora, Su. SE, PCLinux. OS, and MEPIS • Which one to use? – Any one should be fine • Which one are we going to use? – Ubuntu • Why Ubuntu? – User friendly – Large user community

Installation • Mainly, Ubuntu can be configured using three different ways: – To run

Installation • Mainly, Ubuntu can be configured using three different ways: – To run Ubuntu without installing it on your hard drive, the best way is to run it from CD/DVD https: //help. ubuntu. com/community/Burning. Iso. Howto – Dual-boot system. Namely, you will have both Windows and Linux available for booting http: //www. ubuntu. com/download/help/install-ubuntuwith-windows – Using VMware Player: it creates isolated virtual machines (we are going to use this method)

Installation using VMware Player • Download the appropriate version of Ubuntu to your hard

Installation using VMware Player • Download the appropriate version of Ubuntu to your hard drive from: http: //www. ubuntu. com/download/desktop • Download VMware Player for Windows 32 -bit and 64 -bit from: http: //www. vmware. com/download/player/download. html • Double click on VMware-player-6. 0. 3 -1895310 exe file • Make sure you change the hardware settings when installing (see next slides)

Select create New Virtual Machine

Select create New Virtual Machine

Select the second option and browse to the iso file you downloaded.

Select the second option and browse to the iso file you downloaded.

Personal data

Personal data

Enter a name for the virtual machine

Enter a name for the virtual machine

Specify Disk Capacity Give it up to 30 GB

Specify Disk Capacity Give it up to 30 GB

New Virtual Machine Wizard Select Customize Hardware

New Virtual Machine Wizard Select Customize Hardware

Specify the amount of memory allocated for the virtual machine Use the slider to

Specify the amount of memory allocated for the virtual machine Use the slider to choose the appropriate size as it is advised by the legend.

Processor Select number of processor cores.

Processor Select number of processor cores.

3 D Graphics Make sure that the “Accelerate 3 D graphics” checkbox is checked.

3 D Graphics Make sure that the “Accelerate 3 D graphics” checkbox is checked.

Java vs. Python • Python programs are typically 3 -5 times shorter than equivalent

Java vs. Python • Python programs are typically 3 -5 times shorter than equivalent Java programs • Python programs take much less time to develop than Java ones • Python is built-in high-level data types and dynamic typing • Python provides an operating system module which gives connection to Unix system calls.

Java vs. Python Java Python public class Hello. World { public static void main

Java vs. Python Java Python public class Hello. World { public static void main (String[] args) { System. out. println("Hello, world!"); } } print("Hello, world!")

Java vs. Python Java Python public class Main. Class { public static void main(String[]

Java vs. Python Java Python public class Main. Class { public static void main(String[] args) { int start = 1; int end = 100; int the. Sum = sum. Range( start, end ); System. out. println ("The sum of the integers between " + start + " and " + end + " is " + the. Sum); } public static int sum. Range(int first, int last) { int total = 0; int i = first; while (i <= last ) { total+= i; i ++; } return total; } } def sum. Range( first, last ) : total = 0 i = first while i <= last : total = total + i i=i+1 return total start = 1 end = 100 the. Sum = sum. Range( start, end ) print ("The sum of the integers between", start, "and", end, "is", the. Sum)

Java vs. Python Java Python public class Print. List { public static void main(String[]

Java vs. Python Java Python public class Print. List { public static void main(String[] args) { int [] grade. List = { 85, 90, 87, 65, 91 }; System. out. print( "[" ); for( int i = 0; i < grade. List. length; i++ ) { System. out. print( grade. List[ i ] ); if( i < grade. List. length-1 ) System. out. print( ", " ); } System. out. println( "]" ); } } grade. List = [ 85, 90, 87, 65, 91 ] print (grade. List)

Installing Python 3

Installing Python 3

Installing Python 3 cont. Click on “Developer Tools”

Installing Python 3 cont. Click on “Developer Tools”

Installing Python 3 cont. Click on “Python”

Installing Python 3 cont. Click on “Python”

Installing Python 3 cont. IDLE (using Python-3. 4)

Installing Python 3 cont. IDLE (using Python-3. 4)

Installing Python 3 cont. Click on “Install”

Installing Python 3 cont. Click on “Install”

Installing Python 3 cont.

Installing Python 3 cont.

Editing python code with gedit and running it from the command line • Search

Editing python code with gedit and running it from the command line • Search for “gedit” and then click on the “Text Editor” icon

Editing python code with gedit and running it from the command line cont.

Editing python code with gedit and running it from the command line cont.

Editing python code with gedit and running it from the command line cont.

Editing python code with gedit and running it from the command line cont.

References • • • Python v 3. 4. 1 documentation Python operating system interfaces

References • • • Python v 3. 4. 1 documentation Python operating system interfaces Python 2 for Java programmers Java for Python Programmers From Python to Java