Wednesday, 22 June 2011

3.10-3.11

Scheduling - The OS has to arrange the order of tasks to be done either:
            1. to make maximum use of the CPU
            2. To give one program priority

Program A making calculations = Processor hungry = Processor bound
Program B Printing Wahe slips = I/o hungry = I/O Bound

If Program B is given priority the it shares the time more efficiently and more throughput is achieved.

The objective of scheduling are to

Maximise the use of the computer
be fair to all users
Provide a reasonable response time to all users, whether they are on-line users or a batch processing user
Prevent the system failing if it is becoming overloaded
Make sure that the system is consistent by always giving similar response times to similar activities from  day to day

The following is a list of criteria which may be used to determine a schedule which will achieve the previous objectives

Priority - Give some jobs a priority to the CPU
I/O or processor bound? - Give priority to I/O bound tasks as Processor Bound would hog the CPU
Type of job - Batch processing, on-line and real time all erquire different response times
Resourse requirements - The amount of time needed to complete the job, the memory required, I/o and processor time
Resources used so far - The amount of processor time used so far, how much I/o used so far.
Waiting time - The time the job has been waiting to use the system.


Scheduling Policies
FIrst Come First Served - First to the ready queue will be the first to the running state
Shortest Job First - Jobs are sorted in the Ready queue in order of the time they will take. New jobs slot into their correct position
Round Robin - Each job gets set a 'time slice' with the processor and at the end of the 'slice' it returns to the back of the Ready Queue. If a job finishes during a slice it leaves the system
Shortest Remaining time - The ready queue is sorted by job that has the least time remaining
and 2 more...

A job joins a duifferent queue depending on how important the job is.
A job in a lower priority queue has to wait until the queues above are clear before it gets processor time.

MFQ - MFQ use the same system but also apply Tim Slices and if the job doesn't finish during the slice then it is moved to a lowere queue, the last of which is a Round Robin. 

Spooling - Preventing speed mismatch by settting up a cueing system.
The details of an output are witten to a file e.g name, location, size, fonts, images
The info file is placed in a queue

OS Organising Memory

Reasons

Programs loaded in different orders

Multi Users on one app with individual sets of data

Apps simultaneously controlling multiple sets of data for multiple users or apps = reentrant

Interrupts

I/o interrupt - From I/o device e/g Printer out of paper

Timer interrupt - From internal clock because processor has time critical activities to do.
                - OS' have to allocate certain time to certain processes. Switches to other processes because a certain activity is taking too long.

Hardware error - Power failiure = OS must attempt to close safely

Program interrupt - Program error e.g trying to use OS memory

Interrupts and interrupting interrupts - 

Register - Holds the info that is being executed and is the CPU's own form of 'RAM'. While also storing data while interrupts are occurring as interrupts happen first.
 So an activity is happening, then is interrupted, so the activity is stored in the register till the interrupt is finished.






Memory Management

A job is made up from instructions

Jobs sit in main memory when they are queueing to use the processor

If Job C finishes ,the OS needs to re-address the other jobs to Job E and 

The OS loads jobs and recalculates memory addresses to fit new jobs in.

The Loader does both these tasks

A calculation must be done for each instruction's address so a job can be moved

Relative addressing is when each instruction's new address is decided relative to where the first instruction was moved to.

Segmentation

Variable lengths blocks - Programmers divide jobs into segments

Segments = Sub-routines/ groups of subs/ data

Addressing

The segment table must include the start position and size of the segment

Virtual Memory

Dividing programs up into pages or segments means that only parts being ued need to be loaded

Disk threshing = Memory full forces constant page swapping from processor

What gets replaced in memory? Page idle the longest, First in First out

The OS flags each Page with a 0. data must not be paged out so when the data changes in is flagged with a 1.



Paging

Memory addressing becomes a big issue

A paging table is kept to record which Job page in which memory page

Virtual memory is a designated slice of the hard drive and it swaps entire pages around?
Used when RAM isn't available

Desktop PC OPerating Systems

File allocation Table (FAT)

Uses a linked list to point to where files are on the disk.

Disk is FORMATTED - Divides the disk radially and concentrically (Circle)

3.13

Accumulator holds the results within in an event so the results can be dealt within one procedure (So it doesn't have to leave RAM)

Buses are 'wires', communication wire (E.g USB).
Address Bus is information about the receiver
Control Bus - Controls the communication to all parts of the system from the CPU. Wires that come out of the CPU.

Co Processor - Graphics Card
Parallel Processor - Dedicate a processor to a particular task which makes it faster. 2 instructions can happen at once. Operating system must be programmed to use 2 processors. E.g Facebook server, Delegation of task. E.g One processor deals with internet requests, others deal with something else etc.
Array Processor - Deal with repetitive tasks

3.12

3.12

Assembly language is machine code short hand (E.g + = 011001001). Kinda like how the keyboard works. Press the 'z' character and an assembler takes the mnemomics and shows a 'z' It's short hand machine code

An interpreter takes one sentence at a time, translates it and runs the instruction when it goes through a computer, it interprets the next instruction. It is used when not enough memory to hold compiled propgram (Multiple instructions)
Used by come languages (VB) to debug
Error can be reported per line of execution, this makes error checking easier.


A compiler is when all instructions are translated simultaneously. A program is compiled into 1 file and has been translated beforehand so it can be read straightaway.
It's faster to load but requires more memory.


Lexical analysis - Prepares the translator/compiler if your sentence makes sense. Looks up in it's 'dictionary' if your sentence makes sense. E.g Sentence should be = 


Dim 'variable' as (Assignment, same as equal sign) 'Data taype'.

Keyword = Token

The dictionary is stored in each of the programs.

Syntax analysis - Sentence is checked horizontally to see if it makes sense

Intermediate code - Code that has been checked and is halfway through execution

Linkers - 

Loaders do the loading

Library routines - DLL Files - Littles slices of code, modules. Seperately saved files that contain a set of instructions




Von Neumann - Came up with the idea of Apps, 'Stored program using the same memory space where instructions where stored with data.

A queue of info is put through a register which then puts the data into Memory address register.

1. Load the address from (PC) into Mar (Memory address register)
2. Increment the (PC) by 1
Load the instruction from the MAR address into the MDR
Load this instruction from MRP into CIR
Decode the instruction that is in the CIR
If the instructions is a jump instruction then a. Load the address part of the instruction into the PC, b. Reset by going to step 1 else step 7
7. Execute the instruction
8. Reset by going to step 1.

CIR - Current instruction register.
MDR - memory data register
PC - Program counter

Friday, 18 March 2011

Fields Explanation

The explanation below is reference to the table above which is to help the user understand each field. The explanation of the field also contains a justification as to why certain validations were chosen and why certain character lengths were chosen.
Booking an Event

Unique Identifier is to ensure that each event is different. The unique identifier is made up of 7 different characters
The name of organisation is what the organisation wishing to book the school is called. As some organisations have numbers, and sometimes, symbols, All types of characters are acceptable
Names can range from being very short to very long, depending on many, (though irrelevant factors, i.e culture), some names, however will be extremely long, though the chance that this will happen is very minute, and thus should be ignored. Therefore in order to cater for those people who have long last names, without making the program too large, 25 characters is sufficient. Names however, must obviously exclude characters other than letters.
The address of the organisation is very important because once the organisations camp activity concludes, an invoice must be sent to a particular address. This field can contain letters and numbers and 50 characters is enough
As one of the forms of communication, email works as a way of providing communication through the internet. As communication is vital, and some documents, including spreadsheets, client details etc, are not appropriate to send over the phone or even sometimes, through mail (Because of time constraints), an email address of the client is vital. 30 characters is suffice as most email addresses exceed this character amount. 
Another form of communication is through the phone, this provides very quick communication for collecting simple information through discussion. All phone numbers contain only numbers, and the chances of the number being less than 13 characters is very high.
At times, it may be impossible to contact the client because they are in some unknown location, away from a computer, (or just haven’t bothered to check their emails) and a phone. Fortunately, because of the cell phones portability, it is possible to contact the client at any time, anywhere. This form of communication is normally used in case of emergency, or there is information required urgently. Cell phone numbers, (In NZ) are normally less than 13 digits, therefore 13 is a sufficient number of digits in this field.
Mr Powell needs some kind of explanation as to why they wish to book the school. What is the purpose of their camp, the reasoning may range from ‘Uniting members of similar organisations’ or ‘training workers’. However, if the possible clients could bring havoc and potential danger, these clients may be ignored. Because a short explanation is necessary, 200 characters is sufficient. The explanation also must not contain any numbers as it is only a short explanation as to why they wish to book the event where specifics are not necessary.
Sometimes, the camps are seasonal and therefore, they only want it at a particular time, (E.g: It’s a christmas camp). Therefore, to almost guarantee that the clients can book at that particular time, Mr Powell, must ensure that it is possible to book at that particular date. Therefore an explanation as to why that date is demanded is necessary. The explanation however, should not require any numbers as it is only a simple explanation is all that’s required. Because a short explanation is necessary, 200 characters is sufficient. The explanation also must not contain any numbers as it is only a short explanation as to why they wish to book the event where specifics are not necessary.
The age range of the clients is necessary as it provides Mr Powell with an idea of how much food will be provided as well as whether their will be a higher or lower ‘*BOND*’  because the clients are more likely to break something. The validation in this field is governed by the rule: This field must not contain any characters other then digits and must contain less than 4 characters.
In order to ascertain the total costs and provide for the clients as necessary. Because some camps do not require the use of the ‘Kings College Technology Block’, that building won’t be used and costs for lighting etc will be saved as a result. If a house isn’t being used for accommodation, that could mean that they may try and fit a certain amount of clients into a certain house for whatever reason, (E.g, For a church, they might find it almost mandatory, that a ward sticks and sleeps together). It would be sensible, to have up to 100 characters available in this field, and, as this field contains proper nouns, it must only contain letters.
In order to get a fair idea of total costs, it is important to know how many people will be staying at the camp. This figure also provides Mr Powell with an idea of how much work will be required from his employees. This field must not contain any more than 4 characters and each character must be a digit.
Workers

When workers are recruited, each worker has a unique profile. In order to keep each worker unique, and to an extent protect them from fraud (such as a worker committing a crime, under the cover that he is someone else). This unique identifier also allows Mr Powell and the users to individually identify each employee. This field can contain any type of characters, up to the character length of 7.
This is the name of the worker and the name Mr Powell can identify and address him by. Names can range from being very short to very long, depending on many, (though irrelevant factors, i.e culture), some names, however will be extremely long, though the chance that this will happen is very minute, and thus should be ignored. Therefore in order to cater for those people who have long last names, without making the program too large, 25 characters is sufficient. Names however, must obviously exclude characters other than letters.
The address of the organisation is very important because once the organisations camp activity concludes, an invoice must be sent to a particular address. This field can contain letters and numbers and 50 characters is enough
It is important to know the birthdate of the employee to determine whether he is too young or too old to work. It also helps Mr Powell get an idea of what each worker should be paid, minimum wage for workers under 18 is different to those who are considered adults. This field will only contain numbers and will be a maximum of 10 digits.
Another form of communication is through the phone, this provides very quick communication to update workers. All phone numbers contain only numbers, and the chances of the number being less than 13 characters is very high.
As one of the forms of communication, email works as a way of providing communication through the internet. As communication is vital, and some documents, including spreadsheets, client details etc, are not appropriate to send over the phone or even sometimes, through mail (Because of time constraints), an email address of the client is vital. 30 characters is suffice as most email addresses exceed this character amount.
 In order to calculate a fair and deserving pay, the wage rate for each worker is required. This field can contain up to 8 characters excluding every character other than numbers and decimal points.
 Another requirement in calculating the total payment per worker is knowing how many hours they have worked. This figure allows Mr Powell to pay each of his employees according to what they deserve. This field can contain up to 5 characters including decimal points and numbers.
In reality, some workers are unable to work on certain days, this may be due to fixed commitments such as church or sport. Because of this, it is prudent to know what days workers are unavailable, this way Mr Powell can allocate work accordingly and hire other workers if necessary. This field must contain only letters and must be a day of the week
Because tax is a mandatory payment to the government, which is a percentage of the workers income, it must be deducted from the workers income and paid to the government. The rate at each worker will be taxed at will differ due to several factors including their income level. This field cannot contain any characters other than numbers and is limited to 2 characters.

System Requirements (To be altered)

-Windows XP Home Edition SP-2 or better
-1 GHz 32-bit(x86) or 64-bit(x64) processor
-1gb of system memory
-At least 100mb free space on Hard Drive
-128mb of graphics memory (Minimum)
-Pixel Shader 2.0 in Hardware
-32 bits per pixel (minimum)

User Requirements

Objective of new system
The system aims to integrate the current processes of both calculating the wages of workers and matching them to each booking. This will provide a much quicker and more efficient system in comparison to the current system and it’s tedious and mundane tasks. 
The new system will have new features including:
A new rating system - Allowing the Employer to give ratings to his/her employees based on their work ethics, commitment and physical ability
A newer ‘workers’ profile - Listing the details of each worker, including newer details such as work unavailability, tax rate and their ‘Workers rating’.
A program that deals specifically with the menial task of recording the events and calculating wages
A more efficient and faster approach to recording both the details of the workers and the events they are matched to
The ability to produce a report of the workers profile and events
As well as completing the whole process of:
Recording the details of the events
Recording the details of the workers
Matching the workers to their respective work events
Calculating the amount of pay accrued to each worker
Producing a print out of the workers profile and the details of the event
Calculations and Decisions
Calculations and decisions are made when trying to calculate the wages that each employee deserves. Mr Powell decides the amount of work that needs to be completed each day, which fluctuates depending on the physical ability of the workers, the amount of workers working on that date, and how much time they have before the event occurs. Powell is therefore responsible for both employing workers and allocating them alloted working shifts. The workers rate is also dependent on several factors including; Amount of time they have been employed, Type of work they do and age. The tax rate depends on many factors including Income level and length employed (Full-time or part-time work), but the information is provided by the individual employee. 

When recording this information, Contact details and contracts are filled out manually on pieces of paper which are returned to Mr Powell who enters them into the computer which keeps a digitalized record of the workers contract agreements and contact details. The current system of processing and recording bookings is split, some of it is done on paper and some of it is done via the computer. Mr Powell normally records the details of the contacts using pad and pen. Though, it seems that it may be quicker to actually record the events on paper instead of on the computer, the process of repeating work is ‘in-fact’ more time consuming and can have disastrous effects if lost or destroyed.
Therefore, if I could establish why it is easier to record things on paper, we may be able to create a more efficient system. It would also be prudent to digitalize the notes in order to have a form of ‘back-up’. Fortunately, If we combine the process of recording events and recording workers details, their will be less need for paperwork. It is also worth noting that during the event, workers are not required as frequently therefore ‘shifts’ are introduced.
Therefore, new calculations and decisions will include:
Workers
-(1-(Tax %))((The amount of hours worked) X (The workers wage rate))= Total Pay or Wages owed
-Who works on a particular day
-Workers rating
-The day that workers are available to work
-Which event they will be matched to
Extra wants
Mr Powell has requested that the system includes a ‘Rating’ system pertaining to the workers. This rating system will act as an indicator to Mr Powell for future reference on the productivity and work ethic. A high rating will mean that worker is committed, prompt, efficient and shows initiative while a low rating will indicate the opposite. When Mr Powell is planning on recruiting workers for an event, he can refer to the ‘Rating System’ which will show him the best and the worst workers that have previously been employed.
*List any other wants*



In altering, integrating and digitalizing the old systems, Mr Powell and the users need certain information pertaining to the job. The new system requires new fields which 
When Booking an event, Mr Powell gets the information from the people who want to book the school. The information that he requires includes:
Name of organization wishing to book the school as he needs to know who wants to book the school, address them directly and possibly to check whether they are a legit organization by doing research on them
Name of Person wishing to book the school (The person in charge of the camp) so he knows who to contact when getting back with a negotiable price and who to speak to when a problem occurs at the camp or about the camp.
Contact Details (Email, Phone, Mobile, Work Phone, Address) are required so Mr Powell can contact the person wishing to book the school via Email, Phone and by mail when sending out an invoice and receipt
Reason for wanting to book the event so that Mr Powell can get an idea as to why they want a camp and it’s purpose
Possible date that they wish to book the school is also important as Mr Powell can get an Idea as to why they want that particular date, (I.e it may be a Christmas camp where it is quite obvious that the camp must be around ‘Christmas’ time.)
Why that date? - An explanation as to why they want to book that particular date
Period of time that the client wishes to book out the school - To get an idea as to how long the people wishing to book the school want to book the school for
Age range of the group - This is important as it gives Mr Powell an idea as to how much he will have to order in terms of food, booking facilities and being hospitable.
Facilities that wished to be used (Or won’t be used, if it’s easier to record) so Mr Powell knows which facilities to lock up and how he can prepare those facilities for their use.
When wishing to calculate the wage of each worker and to match them to their respective event, Crucial information needed to be gathered includes:
Name of Person is crucial in knowing who you’re employing. This both allows Mr Powell to address the person and to know who and what they’re doing.
Knowing the address allows Mr Powell to send receipts to the employees houses via mail
Birthdate is also essential to ensure that the workers are old enough to work. Currently the work age limit is limited to senior students which is anything from 15 upwards
Contact Phone - To contact the students for work purposes and to inform them of any possible changes or in emergencies
Email allows quick and free communication between both employer and employee and is used to inform workers of any changes or updates.
Wage Rate allows Mr Powell to pay the employees fairly.
Amount of Hours Worked tells Mr Powell how many hours that the worker has worked and essentially, is used to calculate his total pay due
Work Unavailability tells Mr Powell what days the students are unavailable for work in order to aid him in planning work shifts and job allocations amongst workers. This also gives him time to find workers to cover the employee who isn’t able to make work in order to ensure that the work planned goes according to plan
Tax rate gives Mr Powell an accurate and fair idea of the tax that needs to be deducted from each worker in order to pay to the government





Saturday, 19 February 2011

A2 Project Interview

My IT Questions

Project Company: King's Institute
Problem: Dealing with In/Out times for casual workers calculating pay as well as recording events for the year.

Questions: [Relating to wages]

What is the rate you pay your casual workers?
The rate varies according to the dictate of the employee, So how long they have been employed with us or the current legal rates that apply

Do they receive any bonus'?
They... Yes they can

When do they receive bonus'
At the conclusion of the job, Of their employment

At the moment, how do you record the amount of hours that the workers have worked for and the events that are booked?
I'll deal with the first one, "How do we record the amount of hours, Each employee is required to fill in a time sheet on a daily bases. That time sheet is then translated into the payroll system, and payment is made accordingly. How do we record the events? The events are recorded in an electronic diary and on the white board

How do you contact them for work?
We have 2 systems. The first one is the inquiry of the housemasters and ask them if they would like to ask they are, the senior students, if they are potentially interested in working during the holiday period. The second system is that we'll either ring, email or contact an workers that have been previously employed 

How many workers do you employee annually on average?
Different workers?Ahhh, 30

What kind of work do the employee's of the institute do?
Varies but it usually is associated with the setup, management and the conclusion of an event. They will anything from manual labour, through to assisting and directing people who are new to the site, in terms of acting as guides or  PR people

Given that the work load fluctuates, Would it be prudent to say that some days not all workers are required?
Correct

 How do you decide who works on a particular day?
Usually my assessment of their commitment to the job and ability to get the job done
Are the hours fixed?
No, they are different

How do you decide when adequate work has been done for the day?
Usually at the conclusion of the work that needs to be done for that period, but that can vary depending on the work that has been done during the day, so if it has been a very heavy workload, we may finish earlier than if it hasn't been physically demanding.
How do you deal with a situation where an employee is unable to make work?
Workload just increases for the people who are here or occasionally I will have a reserve list of people who I can ring and contact to come in and fill in the space of the missing employee

So when workers come to work, they must give you their details?
Yes, Well contact details

---------------------------------------------------------------------------------------------

Questions: [Relating to Events]

When someone wants to book the school, how long does it normally take for you to record that booking?
Usually its a protracted negotiation period that starts with an initial inquiry, the second step would be the negotiation of associated costs and the third stage would be a final booking and can vary from anything from 3 days to 3 months

By what means do you record events?
Well we use a manual diary to record events and we use a computer to record things such as the spreadsheets associated with the cost, provision for invoices or electronic communication via email or correspondence.

How do you charge those who wish to book the school?
They have 2 requirements, A facility reservation cost, which is basically a booking that they have made and the second payment is traditionally, within 30 days, an invoice for the event

How long is the school normally booked out for?
No, you can book it for as long as it's available and it's only available during the holiday period

A2 Project Intro


Description of the organisation

Point of program: To calculate workers payment, provide the institute with a list of people available to work on a particular day and their contact details and to book in events

Kings' Institute

Kings' Institute is an organisation that deals with events and functions
that take place within the college. This ranges from afternoon teas, weddings and
camps. The Institute needs to record each of the events that the school is booked out for and their duration. Normally each of these functions requires casual workers to look after the paying guests. The head of the institute is John Powell and he deals with managing and directing the rest of the institute in ensuring that their is an available period and enough workers required for each booking.

Methods Currently in use:

Normally Mr John Powell asks some of the students if they are keen to work and asks them to spread the word about work. He also sends an email to housemasters asking them to ask senior students if they are willing to work. So advertising for the job is done by word of mouth. When someone wishes to book out the school they contact Powell and he checks for an availability and a price. He normally works out the costs use a spreadsheet and has a white board that acts as a visual aid in seeing which dates are available for latter bookings.

Origin and form of the data used

The information comes from the students who wish to work at the school who will 
contact Mr John Powell and confirm that they are able to work. Each worker has their own unique ID and respective contact details. Those who wish to book the school out will also contact Powell and confirm availability. Mr Powell will also provide ratings as to how productive and committed each worker is to provide a useful indication as to which workers he will want for the next booking.