Wednesday, 30 January 2008

Lecture Review Week 3

Database --- This week started with the integrity constraints of the tables. Integrity constraints are rules for which to keep the data. Every table will require a Primary Key to ensure that the specified attribute(s) is always different. The attribute can be set to Not Null, so that no entry can be added if that attribute is empty. It can also be set to Unique, to ensure that the specific attribute does not repeats. Primary Key is essentially Unique and Not Null. The next constraints is Foreign Key, this allows the attribute to reference to other tables, and acts like pointers. The keywords to allows changes to be made in the table being referenced and then changing automatically in the referencing table are "On Delete/Update Cascade/No Action/Set Default/Set Null". The last is Check, which checks that the attribute will satisfy the given conditions as stated in the check statement.

Second half of the lesson focus on simple SQL statements. Create Table t1, creates a table, then within the parenteses put the required field of attributes for the table, with its domains and integrity constraints. Drop Table t1 deletes the table t1 created earlier. Alter Table t1 Add attribute domain will expand the table by another column. Insert Into relation_name(att, att) Values () using single quotes for the values. The att, att represents the order you want to add, can be omitted and the default order will be used. To view the whole table use select * from t1. To delete entries, use Delete From t1 where 'conditions'.



Business Law --- In the continuation of contract law lecture, there was discussion on contracts with minors - people under the age of 21, with mentally disordered and drunkards, and with companies. For minors, there could be three types of contract, first is a valid contract, which is beneficial to the minor or is necessity to the minor. Second type is voidable contract, which includes leases and partnership. Third type is void contract, which means the contract never existed in the first place. This includes money lent to minor and goods which are not a necessity to minors. For the contracts with mentally disordered and drunkards, there can only be voidable contracts.

The next part includes the terms of contracts. Conditions are the important terms in a contract, warranties are the minor term of the contract, innominate terms are the terms that you have to wait and see to see whether the breach was a breach of conditions or warranties. Exemption clauses can be included in contracts to exclude the liability of one of the party. Exemption clauses must be in contractual document and not in a mere receipt. If a person signs a contractual document, he is bound by its term even if he does not read (ignorant is not bliss). If a person is induced to sign by misrepresentation, then he won't be bound by the exemption clause. An ambiguous clause is invalid. Exemption clause made after the contract is sign is invalid, however, if there are past dealings and the person is aware that such a clause exists, then he will be bounded by it. Exemption clause does not discharge you from responsibility from death or injury. It can only exempts you from other losses.


Business Communication --- The first lecture on User Manual. It's quite instinctive to perform most of the steps. First, Analyze the users, what are the needs, who will use the software. Second, Design a task list, write out all the tasks that can be done using the softwares. Third, Develop a draft. Fourth, Review and Test the draft, and last Finalize the manual.

When writing the manual, treat the reader as an idiot of the software. Therefore when you write the step by step instructions, they must really lead to the desired outcome. Screenshots are added to aid user identify start state and end state.

The layout of the user manual should also be attractive. This are influenced by 4 factors - Alignment, Contrast, Proximity, and Repetition. Alignment makes the manual neater. Contrast between size of words shows different level of importance, different colours can be used to show that the words are related. Putting things of the same nature together makes it easier for reader to see that they are related, this is proximity, and reusing the same template for over and over again is repetition.


Artificial Intelligence --- This lecture was on more searching techniques. Choosing a search strategy depends on the problem. With more number of goals states, the problem is easier to solve. Other factors are distribution of goal states, the type of search tree (finite or infinite), repeated states, and the need for optimality.

The best first search uses an evaluation function f(n) to estimate the desirability. then order the nodes in fringe in decreasing order of desirability. Greedy Best First Search is a special case which uses a heuristic function h(n) which is an estimate of the cost from n to the goal. This search is Not Complete, Time of O(bm), Space of O(bm), and is not optimal since it doesn't explore for other possible cheaper route.

Another special case is the A* Search. The evaluation function f(n) = g(n) + h(n) where g(n) is the cost so far and h(n) is the estimated cost of n to goal. The h(n) here is an admissible heuristic function which means that the estimation is always lower than the actual cost. Therefore A* is optimal. The time is exponential and space is keeping all nodes in memory.

A recursive best first search keeps the 2nd best f-value seen so far, and backtracks when children reaches a value that exceeds the f-value. My guess for RBFS is it is complete, and not optimal


Software Engineering --- How do you draw a Use Case Diagram? First draw a stick figure of a person, and this is the actor. Then you give him a roll of what he does. A straight line represents association of actor with use case. Dashed arrow with the keyword '<>' specifies the behaviour defined for the base use case. A triangle arrow is a taxonomic relationship between a more general use case and a specific use case. Dashed arrow with '<>' gives a relationship shared between two base use cases.

No comments: