FIT9017: Week 4

Week 4’s lecture by Judy got slightly deeper into the concept, design and implementation of objects. Again, I am finding that these lectures are moving very slowly and feel that prospective students should be given a chance (if they want) to demonstrate that they are not complete novices. However, this from an administrative point of view would probably be impossible and running through an introductory class will ensure that all the basic concepts (and more importantly, conventions) are clearly understood. So the only thing to do is get good marks and have a point to argue from for next semester.

The lecture started of defining the terms Abstraction and Modularization referencing their relevance to programming with a simple clock program. I felt this was valuable but could have been so much more valuable if we had gone a few steps further and show the practical applications for modularization and decoupling by making the clock program work and re-using the modules in different examples. In this example, Class Diagrams and Object Diagrams where covered (straight out of bluej).

Next came Primitive Types vs Object Types, specifically the differences in memory allocation (objects reference). I guess this will be a more interesting point when programming in C and the Garbage collector does not destroy unreferenced variables. Formal Parameters, Actual Arguments, Internal and External method calls followed, these were all consistent with what I have seen previously  and now feel very intuitive. The only point where I felt uncomfortable was where methods contained local variables with the same name as their Formal Parameters, necessitating the need for this.variable = variable notation. Seems much easier to me to avoid double naming.

The really key topic covered in the lecture and in the tutorials was the coding conventions:

I need to update my existing habits to meet these standards (definitely a good thing).. means alot more indenting.

I will start reading through the text book more for this subject and continuing my own Java development. This should suffice until next semester or the 3rd when I hope we have the chance to do some challenging implementations.

Pearl of the Week: My first attempt at using Java Objects and a MySQL DB, hope to learn how wrong it is in the near future.

Constructs a Book with bookID.
@param ID the Book ID number

public Book(int ID)
throws SQLException, IOException, ClassNotFoundException
Connection conn = SimpleDataSource.getConnection();
stat = conn.prepareStatement("SELECT * FROM books WHERE book_ID = ?");
stat.setInt(1, ID);
ResultSet rs = stat.executeQuery();;
title = rs.getString("title");
author = rs.getString("author");
total = rs.getInt("total_pages");
current = rs.getInt("current_page");
path = rs.getString("path");
date = rs.getString("date");
genre = rs.getString("genre");
notes = rs.getString("notes");

Haha there already a few bit there that are breaking format conventions already…. D:

Note, for some reason the code box is automatically removing indentation. The code box was made using a WordPress plugin:

FIT9018: Week 4

This weeks lecture was a continuation of ‘Operating System II: File Management”. Most of the concepts covered in this weeks lecture I had looked at in last weeks review.

Some of the new points introduced were:

  • When a file is accessed it has four id’s (I assume an example is real and sudo):
    • a real user id
    • an effective user id
    • a real group id
    • an effective group id
  • Standard Input, Output, Error – Every time a shell is started. 3 files are opened automatically:
    • stdin, (keyboard), 0
    • stdout, (screen), 1
    • sterr, (screen), 2
  • Example of how inode numbers and logical directory structures work.
  • How rwx Permissions work with directories: (Pearl of the Week)
    • Read- Processes can list names and subdirectories within directory
    • Write- Processes can alter the directory (create and remove files). To modify files write permission must be applied to the file.
    • Excecute- Allows the user to cd into the directory. To open a file or excerpter a program a user must have execute permission on all directories leading to the files absolute path name.
  • Hard and Soft(Symbolic) Links
  • Locks (not covered in detail yet)

Pearl of the week: vi/vim text editor

In the tut we worked with vi/vim text editor which is a tool I had struggled with before and had never bothered to read the tutorials on.

It turns out that it is a damn good editor as it is very very quick and easy once one becomes even moderately sufficient (2-3 hr tutorial). One of the primary advantages is that it runs within a command prompt environment so can be used via SSH with ease.

Some of the handy commands learnt in the tutorial are:

  • i -> insert mode
  • : -> comand mode
  • esc -> back to normal mode
  • CTRL + G -> End of the doc
  • /prase -> find phrase
  • n -> next phrase down
  • N -> next phrase up
  • :%s/word1/word2/gc -> replace all word1 with word2, gc adds confirmation for each occurance
  • u -> undo
  • d -> delete
  • put -> put was what just deleted
  • v -> visual select
  • w -> word (dw -> delete word)
  • $ -> end of line (d$ delete from cursor to end of line)
  • :set tabstop=2 -> set tab distance to 2
  • :set number -> show line numbers
  • :set nonumber -> hide line numbers
  • :1,4d -> delete lines 1,2,3,4

There are a great deal many useful examples of these which i shall add in as I use them.

Getting iPhone working on Linux (without jailbreaking)

Steps to Using iTunes and iPhone on Ubuntu (using windows virtual machine)

  1. Install git, with the following command: sudo apt-get install git-core
  2. Install iPhone connectivity the driver with the following command: git clone git://
  3. Install VitualBox PUEL ( , ensure it is PUEL, no OSE Edition
  4. Install Samba and share Music folder (instructions:
  5. Open Sun Virtual Box, create a virtual machine (ensure in vm settings USB is enabled and iPhone filter selected).
  6. Install iTunes on the vm and access your songs through shared folder.

All up takes about 2 hrs max and is the easiest way to get your iPhone working on Ubuntu without jail breaking.


FIT9019: Week 4

Unfortunately I missed Manoj’s 4th lecture, the notes however are online and I will run through a summary of them.

Part 1: Normalization

Data normalization is required to ensure that a relational database will perform UPDATE, CREATE and DELETE queries without anomalies (loss of data integrity).

The process of normalization has numerous levels (1st Normal Form [1NF], 2NF, 3NF, BCNF, 4NF, 5NF) which will be shown below. Prior to running through each level, the terminology for dependencies must be clarified.

Functional Dependence: A relationship between two attributes each value of A is associated with exactly 1 value of B, ie; ID is a determinant of Name. Partial Key dependencies are determinant relationships between two or more non-primary key attributes(leading to update anomalies). Transitive Key dependencies occur when an attribute is more immediately identified be a non-Primary Key attribute/s (leading to update anomalies).

1NF: Ensuring atmoic values in the relation by removing unnecessary attributes, separating relations if repeating values occur.

Now in 1NF :

2NF: Remove partial key dependencies (ensure primary key is in its minimal form and partially dependent attributes are removed to an alternate relation). Ie:

Now in 2NF:

3NF: Remove transitive keys dependencies.

Now in 3NF (Transitive dependency removed by creating new relation):

Boyce-Codd Normal Form [BCNF]: 3NF + only a single candidate key for each relation.

4NF: No non-trivial multi-valued dependencies. *

5NF: No join dependencies. *

* It seems we will not be covering 4NF and 5NF in this subject although other lecturers have mentioned they are the most prevalent in the business world.

That brought to a close the section on Normalization, next up was ER/EER -> Relational Model. Again as I did not attend this lecture I will just simply run through a summary of Manoj’s slides.

Inputs: ER/EER diagrams -> Outputs: relational schemas

Properties of Relations:

  • Each relation has a unique name..
  • Each tuple is unique
  • Attributes names are meaningful
  • Order of attributes is immaterial
  • Order of tuples is immaterial
  • entries are atomic (single valued)

Types of entities -> Regular(Strong), Weak, Associative(Composite).

In preparation for the transition from ER model to relation schema, the ER model must be expanded from conceptual to logical level. This involves removal of M:N relationships (Unary, Binary or Ternary) and recognition of Primary Key.

There was much more detail in this lecture but I will await the next presentation to elaborate further.

FIT9030: Week 4

David spent the first 30 minutes or so of todays lecture completing the left over slides from last week on Requirements Gathering [PADIS]. Joint Application Design Sessions was the first topic, whereby the key stakeholders get together in a ‘war room’ (there is to be no fighting in the war room) with the required resources to fact-find, model, create policy and verify activities. That is to, complete the Analysis phase of the System Development Life Cycle in the space of a day or two.

Next we moved onto Vendor Solutions, this is an aspect of Systems Analysis that I think will become more and more prevalent in the coming years with Open Source programs on the rise along with those who are able to customize the packages sufficiently to make them a superior option. David mentioned that a 60-65% fit for a businesses’ System Requirements is sufficient to make an out of box solution work although his argument was supported only by a single anecdote.

The Requirements Gathering lecture came to a close with the Validation of Requirements (which is best conducted with near working prototypes) and a summary of the Analysis Phase:

  • Gather information (review documents, current practices, conduct interviews, prototyping, questionnaires, JAD sessions, Vendor Solutions)
  • Define System Requirements
  • Prioritize Requirements
  • Prototype (feasibility and discovery)
  • Generate and evaluate alternatives
  • Review with management

This weeks lecture was titled Beginning Analysis, this was somewhat confusing as I thought Requirement Gathering was part of the Analysis phase. The topics of the lecture:

  • Analysis Models
  • Events (OO Systems are event driven)
    • Simplistically, an occurrence at a time and place(to trigger all System Processing). Events can be divided into External(ie: customer orders warhead), Temporal(Time) and State(eg: status/qty). See Event Table below
  • Objects and System Requirements
    • Things (Customer, Employee, Supplier, Order, Item, Account) = Objects, Properties/Characteristics/Relationships = Attributes, Behaviors = Methods
  • UML
    • The standard modeling technique for OO

We skipped through the last two of the items above, Dave mentioned we would cover these in more detail next week.

In the tutorial we completed the interview for our assignments which will now enable us to complete an Event Table for the Employee Testing System Assignment. Apparently our interview went very well (I think this was a successful chance for Dave to give students some positive re-enforcement prior to attempting the assignments).

FIT9017: Week 3

Judy Sheard’s third week lecture continued on the introduction to Java and programming as a whole. Although all of the concepts covered were very basic some of the terminology needs to be learned, particularly for when in the work place and the need to communicate arises. So, a summary of the terms covered and their contextual definitions:

  • Selection – if construct, 3 components: condition,consequent, alternative. if(keyword) (condition){consequent}else{alt}
  • relational operator –  ==, !=, <, >, <=, =>  result of these operators is a boolean TRUE/FALSE
  • boolean expression –  using one of the above operators.
  • compound statement – multiple lines in consequent block.
  • nested if – if within and if construct.
  • logical operators – !, && , || NOT, AND, OR can be used in conjunction with boolean expressions.
  • switch statement – can be used to neaten cascading if statements (compiles as cascading ifs however) ideal for day of the week statements etc. Can only be used with int and char expression evaluations.
  • shorthand arithmetic operators – a += 1; a -=1; a *=2; a /=3; a %=5; //reassign a with the result of the operators. a++; ++a; b–; –b; // if ++, — is after the variable then the arithmetic will be applied after the entire statement.
  • local variables –  variables within methods which exist only as long as the method is being executed.
  • base input –  using scanner method to read from keyboard

Precedence rule for evaluating expressions (JAVA):

  1. Parenthesis
  2. Unary Operators (++, –, !)
  3. Binary Arithmetic Operators (*, /, %, +, -)
  4. Relational Operators (<, >, <=, =>, ==, !=)
  5. Logical Operators ( &&, ||)
  6. Shorthand arithmetic ( =, +=, -=, *=, /=, %=) // these ones are evaluated right to left.

When in doubt of any of the above its much easier just to use parenthesis…

Pearl of the week: (I was always under the impression that a leap year is simple every 4th year, this is not the case however)

Algorithm for leap years:

Hope all banking systems have this correctly coded otherwise the 2100 bug might turn out to be more exciting than y2k.

The tut again was simply a revision of the lecture with the chance to ask question and get explanations. We are getting the assignment outline this week, Judy has said it is not really challenging…

FIT9018: Week 3

Andy Cheng presented the lecture titled “Operating Systems II: File Management” this week. In basis File Management systems allow users to store information in units called files, File systems provide a logical view for the user whilst hiding the physical view which is not interpretable by the average human.

  • Ordinary Files – executable, text, source code, etc.
  • Directories – contain Ordinary files and subdirectories (assist with Logical View)
  • Special Files – represent devices and other advanced file types.

We did not get into the file types in detail during the lecture or the tut however the file type and their characters (which can be view using ls -l):

  • – -> regular file
  • d -> directory file
  • b -> buffered special file (ie: disk drive)
  • c -> unbuffered special file (ie: terminal)
  • l -> symbolic link
  • p -> pipe
  • s -> socket

Absolute and Relative paths, self explanatory.

The lecture was cut short as we had to spent some time finishing the previous weeks slides so we did not really get into the chmod analysis which is responsible for permissions (I have had experience with this command as it is important on Unix based hosting for updating write permissions on config files). Basically the command is divided into User/Group/Others -> read, write and execute. A quick hand way for setting permissions is:

The octal (0-7) value is calculated by adding up the values for each digit

read = 4 ,write = 2, execute = 1,
User (rwx) = 4+2+1 = 7
Group(rx) = 4+1 = 5
World (rx) = 4+1 = 5
chmode mode = 0755

$ chmod 755 myfile – would be the command.

Pearl of the week: In all Unix operating systems all entities are treated as files (I assume this is related to the monolithic kernel design)

In the tut we got into working with the shell, a summary of some of the commands we covered below:

  • Print working directory -> pwd
  • Tab completes file name (or to fork where multiple possible values occur)
  • chmod

My favored site with listings of shell commands is: I find it the quickest and easiest for learning and look up.

To get better at command-line interface the key is regular practice. I am currently running Ubuntu on my home pc, but rarely use the shell unless testing programs. It is a good habit to get into using it.

After doing some practice it appears that using wildcard for the ls command is not very useful for find particular files in subdirectories. For example if you wanted to find all of the .ape files in your My Music folder, ls -R *.mp3 would not work. Instead one would need to use:

FIT9019: Week 3

Week 3’s lecture by Manoj Kathpalia got into database design. We continued our referencing to the ANSI/SPARC architecture which it appears will be an ongoing theme.

The lecture ran through the Database Design Cycle introducing Requirements Definition, Conceptual Design, Logical Design and Physical Design. With detailed analysis of ER modeling which applies to Conceptual and and Logical Design (which are both at the conceptual level of the ANSI/SPARC architecture).

I have some confusion over Cardinality, I assume the  Cardinality of Relation and the Cardinality of a Relationship are two different things. The cardinality of a relation being the number of tuples and the cardinality of a relationship being either 1:1, 1:M or M:N. I will need to clarify this with Manoj.

The ER model is quite a simple graphical modeling tool which we review in the tutorial, it does however seem that there are a number of acceptable notations in ER modeling some of which can be seen here.

Pearl of the week:

Although ER modeling can be used for both Conceptual and Logical Design, the Conceptual Level does not include Foreign Keys and allows Many-to-Many relationships.

After working through the ER model, we touched on integrity constraints, specifically Referential Integrity constraints:

  • Foreign Key references must be valid or null
  • Update Rules either restricted, cascaded or null (ie: when the customer_ID is updated in the customer table, the foreign key in the order table can either stay the same, update or become null).
  • Deletion Rules either restricted, cascaded or null (ie: when the customer_ID is attempted to be deleted in the customer table, it can either be restricted (forbidden delete), delete the associated orders :O or set the customer_ID filed of the order to null).

Finally we covered an introduction to Database Design Language [DBDL]. We did some more work on DBDL in the tutorial although there were some discrepancies between the lecture example and the tut examples (ie including CK and PK). From the final question of the tutorial, my derived relations in DBDL were as follows:

I did not include CK and PK as they were not included in the lecture’s example.

FIT9030: Week 3

Another packed lecture from David grant for Systems Analysis and Design yesterday. The first half was a completion of last weeks unfinished lecture on Systems development methodologies. We had a more in depth look at the Object Oriented Approach and its associated methodologies, primarily iterative/spiral which is the current trend. Extreme Programming, The Unified Process and Agile Modeling (a hybrid of the two former) came next. I had not realized previously that my work place utilizes Agile Modeling with SCRUMs and SPRINTs, another timely point that related directly to my job came about when David mentioned that the Agile model would only be successful with experienced, self managing developers (haha … :|). From this lecture I became a little more confused on the distinction between models and methodologies. I recall David mentioning something on the differences but that has escaped me and when looking at wikipedia’s explanation (wiki link) it appears that they are basically substitutable terms;

The framework of a software development methodology consists of:
* A software development philosophy, with the approach or approaches of the software development process
* Multiple tools, models and methods, to assist in the software development process.

I have found the lecture and course work structure very good for this subject as it uses a consistent process; Introduction of broad concept -> Introduction of Practices -> Analysis of Practices which feels to me like conceptual clustering.
conceptual clustering

Speaking of which, following the introduction to Extreme Programming, The Unified Process and AGILE modeling, we looked at them in further detail:

Pearl of the week –  Object Oriented Methodologies

  • Extreme Programming – Lightweight, efficient development process, utilizing informal stories and programming pairs. This methodology relies on heavy user involvement and continuous testing and integration.
  • Unified Process – Object Oriented, uses UML, based on (but labels 4 phases) of SDLC and Reinforces six best practices
  • Agile Modeling –  Hybrid of XP and UP, uses Interactive and Incremental modeling. Really a logical evolution of  XP and UP based on practical feedback.

The mysterious CASE tools,where introduced again in this lecture but again not covered in detail. I imagine this is because we need to understand all of the concepts in detail before using the tools but by mentioning them the topic it will not feel entirely new when we get onto it.

We completed the previous weeks lecture back on the SDLC getting some revision on the first of the 6 phases [PADIS], Planning.

Steps of the Planning phase

  • Defining the Problem
  • Confirming Feasibility [POSTEL]
  • Launching the Project

The current weeks lecture was a bit shorter and focused on phase 2 of the SDLC [PADIS], Analysis and Requirements Gathering. The key outcome of which was how System Requirements should be compiled; through review of documentation, interview, observation, prototypes, questionnaires, vendor research and joing application design sessions. Most of the Analysis phase is quite intuitive:

  • Gather information
  • Define System Requirements
  • Prioritize System Requirements
  • Prototype for feasibility and discovery
  • generate and evaluate alternatives

Also mentioned in the lecture was Business Process Re-engineering however this practice is now becoming more modular and should be driven by the business management (although a systems analyst would provide suggestions or plant seeds as the case may be).

In the tutorial we spent about 35 minutes on the Malcolm Gladwell talk, but the points where valid concluding that Systems design must pay great mind to humanistic aspects and influences.

We will start our assignments next week which should further reinforce what we have covered thus far.

FIT9017: Week 2

Today Judy Sheard continued the introduction to the Java language whilst maintaining a conceptual anchor. Having worked through several Java text books prior to starting the course I was already familiar with most of the terms and concepts but a little revision never hurts. The topics covered in the lecture:

  • Classes
  • Fields
  • Assignment
  • Expressions
  • Constructors
  • Methods
  • Parameters
  • Accessor/Mutator methods
  • Data types
  • Display Information
  • Visibility Modifiers

The tutorial included some revision of the material presented in the lecture and some references to the text book which no one brought. This was a bit annoying, why they could not list the questions instead of referencing seems irrational. Similarly the decision not to make available the lecture notes prior to the lecture so students can preview it is really odd…

Anyhow, as the lecture and tut were quite basic I had some time to work on my own project in which I identified a bug. A JTable which retrieves selected data from a MySQL table and then replaces it has a bug in the update function whereby a single array variable is dropped from the end of the first row. The bug must be either in the code pulling the values from the JTable into an Array variable or the code creating an SQL update Query from the Java array:

JTable -> Array variable code:

private void updateQuoteButtonMouseReleased(java.awt.event.MouseEvent evt) {
for (int a=0;a < qData.arrayRet().length;a++)
for (int b=0;b < 3;b++)
String cString = (String) quoteTable.getValueAt(a,b);
try {
} catch (SQLException ex) {
Logger.getLogger(BookPanel.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(BookPanel.class.getName()).log(Level.SEVERE, null, ex);
} catch (ClassNotFoundException ex) {
Logger.getLogger(BookPanel.class.getName()).log(Level.SEVERE, null, ex);

Array variable -> SQL UPDATE query code:

public void updateBookDB()
throws SQLException, IOException, ClassNotFoundException
if (qArray.length == 0)
Connection conn = SimpleDataSource.getConnection();
stat2 = conn.prepareStatement
("DELETE FROM quotes WHERE book_ID = ?");
stat2.setInt(1, bookID);
String SQLCmd = "INSERT INTO quotes values ";
for (int a=0;a < (qArray.length - 1);a++)
SQLCmd = SQLCmd + "(" + bookID + ", 1, " +
qArray[a][0] + ", '" +
qArray[a][1] + "', '" +
qArray[a][2] + "'),";
SQLCmd = SQLCmd + "(" + bookID + ", 1, " +
qArray[qArray.length - 1][0] + ", '" +
qArray[qArray.length - 1][1] + "', '" +
qArray[qArray.length - 1][2] + "');";
Connection conn = SimpleDataSource.getConnection();
stat2 = conn.prepareStatement
("DELETE FROM quotes WHERE book_ID = ?");
stat2.setInt(1, bookID);
stat3 = conn.prepareStatement(SQLCmd);

After having a look at the code in notepad and being unable to find the bug. I will look for the error tomorrow night and see how long it takes me to find and fix. I won’t open another of my own projects in BlueJ after it automatically renamed my Package declarations making errors throughout my source code.