Summary and Schedule
This site holds the Practical “worksheets” for COMP1005 Fundamentals of Programming
COMP1005 Practical Worksheets are being updated, and will be linked below when available:
- Practical 00 - Introduction to Linux
- Practical 01 - Introduction to Python
- Practical 02 - Lists and Strings
- Practical 03 - Arrays and Plotting
- Practical 04 - Multi-dimensional Arrays and Functions
- Practical 05 - Files and Grids
- Practical 06 - Modelling the World with Objects
- Practical 07 - Object Relationships and Exception Handling
- Practical 08 - Scripts and Automation
- Practical 09 - Quality and Testing
- Practical 10 - Applications: Data Processing and Analytics
- Practical 11 - Applications: Engineering and Science
Setup Instructions | Download files required for the lesson | |
Duration: 00h 00m | 1. Prac00: Introduction to Linux |
How do I login in to the Virtual Machines? Where do I find and access files in Linux? How do I create and run a program using Linux? |
Duration: 00h 10m | 2. Prac01: Introduction to Python |
How do I interact with a Python program? How can I get Python to run different pieces of code, based on a condition? What ways can I have Python repeat code? How do I apply this to a real-world problem? |
Duration: 00h 20m | 3. Prac02: Strings and Lists |
How do I work with string values and variables? How do I access the elements of strings and lists? How can I use random numbers to simulate real world situations? |
Duration: 00h 30m | 4. Prac03: Arrays and Plotting |
How do I process large amounts of data? What support does Python have for manipulating science and engineering datasets? How can I get a quick visualisation (plot) of my data? |
Duration: 00h 40m | 5. Prac04: 2-Dimensional Arrays, Functions and Plotting |
How can I work with data in two or more dimensions (x, y, z)? What are some examples of multi-dimensional data? How can I plot this multi-dimensional data? How do I make and use my own functions? |
Duration: 00h 50m | 6. Prac05: Grids and Files |
How can we make data persistent so that it exists before and/or after our programs run? (spoiler: it’s files) What are the methods/functions we need to use to work with files? How can list comprehensions simplify our code? How can we work with 2D arrays to create simulations? |
Duration: 01h 00m | 7. Prac06: Modelling the World with Objects |
How can we set up classes to represent real-world objects? How do we write methods to communicate with our objects? How can our code help to maintain a valid state in the object? |
Duration: 01h 10m | 8. Prac07: Object Relationships and Exception Handling |
How can we work with collections of objects? How can we make use of common state and behaviour to organise objects using a hierarchy of classes? Where can we use exceptions to make our code more robust? |
Duration: 01h 20m | 9. Prac08: Scripts and Automation | Newly updated, check the old prac sheet if you find problems |
Duration: 01h 30m | 10. Prac09: Quality and Testing |
Why should we care about code quality? How can we improve code quality? What tools are available to assist with creating and assessing code? |
Duration: 01h 40m | 11. Prac10: Applications: Data Processing and Analytics |
How can we make use of headers and other information in data
files? Can we use python to focus more on analytics, and not so much on coding everything from scratch? |
Duration: 01h 50m | 12. Prac11: Applications: Engineering and Science |
Now you have some knowledge and skills in coding, what will it take to
use that in a field of your choice? Who can I talk to that’s already in space science, chemistry, engineering etc? :::::::::::::::::::::::::::::::::::::::::::::::: |
Duration: 02h 00m | Finish |
The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.
Setup instructions for home machines and mydesktop are given below.
Software Setup
Details
During class, we provide access to Virtual Machines https://mydesktop.curtin.edu.au. You can also use these from home via any web browser (Firefox, Chrome, Safari etc.).
A local setup is often faster, and does not rely on using the Internet. See below for options…
You will need a terminal emulator - an application that looks and works like the termainl in Linux. We recommend Gitbash, but you have quite a few options:
- Gitbash - an interface for the git version control system, but also a highly functional terminal program
- Windows Sybsystem for Linux - Developers can access the power of both Windows and Linux at the same time on a Windows machine. Requires Windows 10 or higher
- mobaxterm - MobaXterm provides all the important remote network tools (SSH, X11, RDP, VNC, FTP, MOSH, …) and Unix commands (bash, ls, cat, sed, grep, awk, rsync, …) to Windows desktop, in a single portable exe file which works out of the box.
- Powershell - PowerShell is a modern command shell that includes the best features of other popular shells. Unlike most shells that only accept and return text, PowerShell accepts and returns .NET objects. (I found the autocomplete unpredictable, so stopped using it)
If you don’t have Python version 3 installed, visit either of:
- Python Software Foundation - the official home of Python
- Anaconda Distribution - a curated set of Python tools
Use Terminal.app (type terminal
in search/spotlight) and
check to see that you have python installed, by typing
python
or python3
.
If you don’t have Python version 3 installed, visit either of:
- Python Software Foundation - the official home of Python
- Anaconda Distribution - a curated set of Python tools
Use Terminal and check to see that you have python installed, by
typing python
or python3
.
If you don’t have Python version 3 installed, visit either of:
- Python Software Foundation - the official home of Python
- Anaconda Distribution - a curated set of Python tools
Customising Mydesktop
Terminal window themes
There is a lot of customisation possible with the
terminal
window in Linux, but we will just look at “light”
and “dark” themes. In the terminal menu, select
edit/prefs
.
Then choose General
and click on Theme variant to select
dark
.
To go from dark to light…, in the terminal menu, select
edit/prefs
.
Then choose General
and click on Theme variant to select
light
.
Changing the sleep settings
It may get annoying to keep putting the password in each time the
virtual machine goes to sleep. The default timeout is 5
minutes, which can be increased to 15 minutes, or to “never”
(probably not a good idea). Select Preferences
at the top
right of the Virtual Machine and then Power
to change this
setting.