Categories
Systems Analysis and Design

FIT9030: Week 5

Week 5 is here and we started the week with the lecture, tutorial double of Systems Analysis and Desgin(by David Grant). I missed the first 10 minutes of the lecture, which I guess involved some revision of the previous weeks lecture on Analysis Models.

The week 5 lecture titled “Traditional or Structured Approach to Analysis”… I think the title should be amended to ‘Structured or Object-Oriented Approach to Analysis“.

Source: FIT9030 week 5 lecture slide
Categories
Foundations of Programming

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: 70.40.214.44/Java_coding_standards.pdf

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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/**
Constructs a Book with bookID.
@param ID the Book ID number
*/

public Book(int ID)
throws SQLException, IOException, ClassNotFoundException
{
SimpleDataSource.init();
Connection conn = SimpleDataSource.getConnection();
try
{
java.sql.PreparedStatement
stat = conn.prepareStatement("SELECT * FROM books WHERE book_ID = ?");
stat.setInt(1, ID);
ResultSet rs = stat.executeQuery();
rs.next();
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");
}
finally
{
conn.close();
}
}

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: http://kpumuk.info/projects/wordpress-plugins/codecolorer/

Categories
Computer Technologies and O/S

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

$ vi myfile
$ vim myfile

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.

Categories
Random

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://github.com/dgiagio/ipheth.git
  3. Install VitualBox PUEL (http://www.virtualbox.org/wiki/Linux_Downloads) , ensure it is PUEL, no OSE Edition
  4. Install Samba and share Music folder (instructions: https://help.ubuntu.com/9.04/serverguide/C/samba-fileserver.html)
  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.

Categories
Database Technology

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.

CUSTOMER (cust-id, surname, initials,{order-no, order-date})
//{} signify repeating values.

Now in 1NF :

CUSTOMER(cust-id, surname, initials)
ORDER(cust_id, order-no, order-date)

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

ORDER-LINE(order_number, product_no, description, number-ordered)
// As above, the description attribute is dependent only on product_no
making it a partial key dependency.

Now in 2NF:

ORDER-LINE(order_number, product_no, number-ordered)
ORDER-LINE(product_no, description)

3NF: Remove transitive keys dependencies.

ORDER(order-no, order-date, cus-id, name, street, suburb)
//name, street and suburb transitively dependent on cus-id

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

ORDER(order-no, order-date, cus-id)
CUSTOMER(cus-id, name, street, suburb)
// new relation added to eliminate transitive dependency.

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.

Categories
Systems Analysis and Design

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).

Categories
Foundations of Programming

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:

if (year modulo 4 is 0) and (year modulo 100 is not 0) or (year modulo 400 is 0)
       then is_leap_year
else
       not_leap_year

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…

if (year modulo 4 is 0) and (year modulo 100 is not 0) or (year modulo 400 is 0)
       then is_leap_year
else
       not_leap_year
Categories
Computer Technologies and O/S

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: http://ss64.com/bash/ 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:

find ~/My Music/ -regex ".*\(mp3\)$" //find all .mp4 files
find -regex ".*\(.ape\|\.mp4\)$"  //find all .ape and .mp4 in relative directory and subdirectories

Categories
Database Technology

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:

book(ISBN, call_num, title, pub_date, publisher_ID)
SK title
AK call_num

author(author_ID, surname, first_name, DOB, initials)
SK surname
 SK initials

author_book(ISBN, author_ID)
FK ISBN -> book - Delete restrict, Update Restrict
FK author_ID -> author Delete restrict, Update Restrict

subject (sub_name)

subject_book (ISBN, sub_name)
FK ISBN -> book - Delete restrict, Update restrict
FK sub_name -> subject - Delete restrict, Update Restrict

publisher (publisher_ID, pub_name, street_add, city, postcode, country)
AK pub_name
SK pub_name

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

Categories
Systems Analysis and Design

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.

http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle#Requirements_gathering_and_analysishttp://en.wikipedia.org/wiki/Systems_Development_Life_Cycle#Requirements_gathering_and_analysis