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.

(more…)

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: 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:

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.

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

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);
qData.setArrayVal(a,b,cString);
}
}
try {
qData.updateBookDB();
this.qPop(Integer.parseInt(enterIDField.getText()));
} 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)
{
SimpleDataSource.init();
Connection conn = SimpleDataSource.getConnection();
try
{
java.sql.PreparedStatement
stat2 = conn.prepareStatement
("DELETE FROM quotes WHERE book_ID = ?");
stat2.setInt(1, bookID);
stat2.execute();
}
finally
{
conn.close();
}
}
else
{
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] + "');";
SimpleDataSource.init();
Connection conn = SimpleDataSource.getConnection();
try
{
java.sql.PreparedStatement
stat2 = conn.prepareStatement
("DELETE FROM quotes WHERE book_ID = ?");
stat2.setInt(1, bookID);
java.sql.PreparedStatement
stat3 = conn.prepareStatement(SQLCmd);
stat2.execute();
stat3.execute();
}
finally
{
conn.close();
}
}

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.

FIT9018: Week 2

Andy Cheng today presented an Introduction to Operating Systems,  focusing on Unix and Unix like operating systems. This lecture was a bit short due to a time and room change. We also had to finish the previous weeks lecture with some further analysis into the steps a computer takes to process instructions. The operating system is best defined graphically (source: http://en.wikipedia.org/wiki/Operating_system <- also has a good amount of relevant details in the article):

Some key abilities of an O/S are:

  • Controls Hardware
  • Provides environment for other programs to run/compile
  • Controls CPU, memory and secondary memory allocation
  • Divides software into utilities and application depending on complexity

Modern operating systems can be defined as Multi-User and Multi-tasking (although this interrupts give the illusion of multitasking, the processor can only process one programs instruction at any given time.)

Running somewhat parallel to the abilities are, The Major Functions of an O/S:

  • Process Management(program/s in execution) -> creates and destroys processes, controls progress  of processes, acts on exceptions/interrupts (enables multitasking), allocating hardware to processes, providing inter process communication.
  • File Management -> controls transfer of data to and from secondary storage devices, controlling file access, provide sharing, keep track of space and locations of files.
  • Memory Management -> Primary memory (RAM), closely related to process management and assists in the illusion of multitasking. Modern O/S memory management should be non-contiguous logical objects to be disjointed and to enable virtual memory (incorporating secondary memory).

The rest of the lecture was a history of Unix and the evolution of O/S, a more detailed version of which can be found at: http://en.wikipedia.org/wiki/History_of_operating_systems

The tut comprised simply of installing ubuntu onto a flash disk from which we will be completing tasks from in the future. However the tut did contain the Pearl of the week:

When installing Ubuntu onto a flash disk you must go into advanced installation options at the review stage and change the boot sector installation to the Flash disk drive (it is not altered when choosing the Flash disk as the installation directory). Without this Ubuntu will not boot from a flash disk!

FIT9019: Week 2

We got into the Relational Data Model today in Manoj Kathpalia’s second week lecture. I found this lecture much more interesting and challenging than last weeks which was great. Until now the terminology I had used for Relational Databases was: Table, Column, Row. Today I discovered that the RDBMS industry is engaging in mass duplication of data by having to remember the following alternate names:

  • Table – > Relation, Entity
  • Column -> Attribute / field
  • Row -> Record set / tuple / entry

Why everyone doesn’t just use Table, Column, Row is beyond me… We covered some properties of Relations, Primary, Alternate and Foreign Keys. I was a little confused by the Relation Languages segment where Data Definition Language [DDL] and Data Manipulation Language [DML] were outlined.  Does SQL encompass both DDL and DML? If so why separate them? Further investigation reveals DDL, ‘Initially it referred to a subset of SQL, but is now used in a generic sense to refer to any formal language for describing data or information structures, like XML schemas.‘ source: http://en.wikipedia.org/wiki/Data_Definition_Language … which reminds me that I need to do some learning about XML. DDL -> Create and Delete (DBs, Tables, views, integrity contraints, indexes) DML -> Relational Calculus, Relational Algebra,  Transform Oriented Languages, Graphical Languages (MS Access),  4GL, 5GL  (All exhibit ‘closure ‘ property – whatever you do is not stored permanently and gone on closure of the instance.) For DML we are focusing on Relational Algebra as it is apparently more simplistic. Relational algebra has 8 basic operators:

  • Selection
  • Projection
  • Join
  • Union
  • Intersection
  • Difference
  • Cartesian Product
  • Division

We went through definitions of these with theoretical examples which I think failed to pull the theory into any relevant practical sense. I hope the tut will give me some more practical connections for this theory otherwise (without a much larger mathematical understanding) this is rote learning without the ability for application. Will update this entry after the tutorial. In the tutorial we went through some clarification of terms and then moved onto some prac questions on Relational Algebra for which I made some notepad notations:

Q4, D

[1] -> (ROOM) |x| ROOM.Hotel-No = HOTEL.Hotel-No (HOTEL)

[2] -> π type,price([1]) PROJECTION

[3] -> Θ [2].Name = Grosvenor ([2])

Q4, e

[1] -> (GUEST) |x| GUEST.Guest-No = BOOKING.Guest-No (BOOKING)

[2] -> ([1]) |x| [1].Hotel-No = HOTEL.Hotel.No (HOTEL)

[3] -> π [2].NAME, [2].ADDRESS ([2])

|x| – JOIN

π – PROJECTION

Θ – SELECTION

note that SELECTION and PROJECTION should be done first if efficiency is a concern.

Working through the Relational Algebra was good as it tied the link between theory and possible practical applications. I know if I had known this theory previously I could have saved time on several projects using SQL databases. Pearl of the Week: Relational Algebra Basic Operators:

  • Selection (Slices Tuples)
  • Projection (Dices Attributes)
  • Join (Natural Join, Left/Right/Full Outer Join, θ-join[uses binary operators {<, ≤, =, >, ≥}]
  • Union
  • Intersect
  • Difference
  • Cartesian Product
  • Division
  • Rename? [(Actually, Codd omitted the rename, but the compelling case for its inclusion was shown by the inventors of ISBL.)source