Monday, March 9, 2015

Validation
Is it valid or allowed, can check if something is valid but sometime inacurrate
You can check if it is not correct.
This ensure data is correctly inputted and spots human errors.
Ensures data entered complies with allowable data
many different types of validation include:

Range checks
format check
type character checks presence checks
Length checks
Lookup existence.



Vertification
Is it the same?

Hesitance check
It is a number that is derived from the other contents of the number

Backing up and archivivng
full compies every file fully]
Incremental Backup
Only copies files that are changed in the last backup

Archiing
not the same as backup

storing old/unused data

Taking it from server mainframe

Transferring onto storage medium

Unlikely to be used again but still available.

Syntax error



  • Missing extra brackets
  • Using variables
  • Brackets not used properly
  • The statement in the code does not follow the rules of the language.
  • Usually detected by the translator, as the statement cannot be understood.
  • Programs will not be compiled
Logic Error
  • The syntax of the code is correct
  • the code does not do what it should
  • Will usually run normally but with some unexpected result
  • Usually tested while being tested
  • Incorrect mathematical formulae
  • Misplaced brackets
  • Instruction written and therefore executed in the wrong order
Run time error
  • The syntax is correct
  • the logic of the program is correct
  • extreme circumstances cause crash
  • program attempts impossible operation
  • causes program to crash at run time
  • usually detected while testing
  • Division by zero
  • attempt to access non existent file
  • attempt to reference array elements before they are initialised 
Test Data
Data which syhold genarate an error message 

OSI Model

Protocol 
A set of rules that govern how something works.
Within a computer science:
  • A communication protocol is a system of digital rules for data exchange within or between computers
  • When data is exchanged through a computer network, the rules system is called a network protocol 
Logical Protocol (SMTP) - It is how emails are sent

  • HTTPS - Browsing through the net 

  • TSP

Physical
  • Bluetooth
  • Wifi
Lowest layer is logical and the highest is physical.


Physical layer = Describes electrical and physical specifications for devices: Cable, connectors, hubs.

Data link layer = Provides connections between hosts on the same network: Ethernet 

Network layer =  Provides connection between hosts on different networks :IPv4 and IPv6. Routing of packets.

Transport = Provides transport of data: TCP and UDP. End to end connections.

Session =  establishing a connection. Controls the dialogs between computers (handshake). Also controls duplexing termination and restarts. 

Presentation = compressing the data.  Provides a context for communication between layers 
ASCII Characters, Encryption and decryption. Compression.

Application = HTTPS, where we find network application eg mail, browser 
  • All
  • People
  • Studying
  • This 
  • Needs
  • Drastic
  • Psychotherapy

It hands communication between computers across networks.

Global and Local Variables

Scope

  • The scope of a declaration is the block of code where the identifier is valid for use

  • A global declaration is made outside the bodies of all function and outside the main program. it is normally grouped with the other global declarations and places at the beginning of the the program file.
  • Local declaration is one that is made inside the body of a function. locally declared variables cannot be accessed outside of the function they were declared in
  • It is possible to declare the same identifier name is different parts of the program.

Local Variables

  • We have used thus have been local variables
  • A Local variable is a variable which is either a variable declared within the function.
  • As you may have encountered in your programming if we declare variables in function then we can only use them within that function. This is a direct result of placing our declaration statements inside functions.


Global variable

  • A global variable def is a variable which is accessible in multiple scopes
  • It is important to note that global variables are only accessible after they have been declared.
  • Undisciplined use of global variables may lead to confusion and debugging difficulties.
  • Instead of using global variable in function, try passing local variables  by reference.


Thursday, February 26, 2015

Mock Exam What I need to do next?

1) Alway add two key points, eg 'State two differences between ROM and RAM'

2) Use correct key words.

3) Use correct spelling when answering long questions.

4) Write workings out in the order of workings.

5) When describing an output, explain why it would be used for the SITUATION required.

6) Keep it simple, don't waffle.

7) Use the marks as a guideline of how many points I should include.

8) Learn basics keywords (sequences, iteration, statement)

9) Learn the different types of testing

10) Need to use the information to help answer the question.

11) 4 mark question, State, 'example', 'explantation'.

12) Follow the code when trying to solve something.




Wednesday, February 25, 2015

Data Transmission


What is a network?
A network is collection of two oar more computers connected together to share resources.

LAN: Covers a small geographical area eg a single building in school.

WAN: Covers a large geographical area for example a country or continent.

Hardware
To build a network:

  • at least 2 computers 
  • a network card 
  • network cable 
  • a switch or a hub to connect the cable to and exchange signals 
  • on large networks with a significant amount of traffic a network server is needed to mange data transmission. 
Serial and parallel
Bits are sent one at a time over a single wire. The speed of transmission depends on the medium being used but could be very high (in some cases faster than a slow parallel transmission).

Parallel transmission is used inside computer systems and for very short distances. A parallel port could send 8, 16 or 32 bits simultaneously down separate lines. Before USB used to connect to printers.

Simplex 
Is used for transmission of data in one direction eg from a mouse to a computer

Half-duplex
Used to transmit data in both directions but not at the same time.

duplex modes
Is used for transmission of data in both direction simultaneously.

Bit rat
The number of bits transmitted each second or the rate at which data is transferred.

Different bit rates are suitable for different applications. Largely based on how time sensitive the information is.

Video streaming -  requires a high bit rate as there is lots of data and any delay will interrupt the video

Transferring word documents - Can use a lower bit rate as the files are needed on real time and people can wait a few min for the files to arrive.

Errors in data transmission
Its very easy for data to become corrupted during transmission. There are three main ways that computers check for errors in data.

Echoing - back The receiver sends the data back to the sender who checks that it matches what was originally sent.

Check sums - Extra digits or numbers are added to the end of a complex sequence. These numbers are calculated based on the number in the sequences. When the sequence in received the check number ins recalculated and if it doesn't match then the data is resent.

Parity check - 1 bit in each byte is reserved as the parity bit. The parity bit is 1 if the number of 1s in the rest of the byte is add 0 if the number of 1s is even.

Packets - When data is transmitted across a network the whole file is not sent at once. the files is broken up into a smaller chunks called packets and these are transmitted separately across the network.

Once a file has been broken up in to packets each packet has a header added to it, this contains information like the packets sender, destination, size and the protocol it it using.

Transmitting data in packets instead of whole files is more reliable and more secure.

Circuit switching - all the packets take the same route to their destination
This means that it is quick to assemble packets at the receiving end as they arrive in the order they were sent.

Packet switching - All the packets take different routes to their destination. This means that it takes longer to assemble packets at the receiving end as they dont arranging the order they were sent. However packets can also avoid slower areas of the network to avoid overloading the network.

Peer to peer - making connection to together computers with equivalent class with your network.

Wednesday, January 7, 2015

Representation Of Data and Binary

All digital data are stores as binary. Eg Words, Cameras, Monitors...

When converting binary into decimals or reverse the left side is the most significant bit and the right side is the least significant bit.
8 bits = 1byte

BCD is when we code each part of the data by using a nibble.


By using Sign Magnitude method we loose a bit meaning the biggest number we can store is 127.

2a Complement
We assume that the MSB is a negative and the rest of the bit is positive adding to the negative number.

Three way of coding
EBCDIC is dead, stores data on a magnetic tape. cannot store keyboards characters.
ASCII every keyboard character is given a corresponding binary code. every letter is given a binary number.
UNICODE uses 2 bytes it is replacing ASCII it is used to cover more languages in the world, it is more important in the internet as it can store more languages.


Monday, December 1, 2014

How Internet Works


  • It is an wire that has connections to computers and servers
  • Each server has IP address that has a given name.
  • Anything we get from the internet are files that are stored in the servers hard disk that are connected to the internet.
  • DNS which allows us look up the IP address for any particular name.
  • The computers are connected to ISP that is connected to the wire.
  • When pictures are sent they are split into smaller sections called packets.
  • Everything connected to the internet has a IP.

Wednesday, November 26, 2014

Array

NUMERIC DATA TYPES
This is an integer, so whole number eg 7 or a Real number so 7.2.
ALPHANUMERIC DATA TYPES
This is a CHAR so single character or digit, eg ‘C’.
String, several characters together, like star citizen.
BOOLEAN
Data that can only take two values so true or false.


ARRAY OF DATA
contains several data items, usually of the same type, grouped with a single name. Accessed using an index, Stored continuously within computer memory.
continuously means like all together, in sequence.
In Python an array is called a list.
If you have a list/array you can easily add things to the list and take away from the list without changing the source code on the fly. This also allows more flexibility with using it other than storing each one as a separate variable.


li = ['a', 'b', 'new', 'mpilgrim', 'z', 'example', 'new', 'two', 'elements']  
for item in li:  
   if item == 'example':  
       print "this is an example function"


This will go through the list until it finds “example” and it will print the text.
a one dimensional array as one row whereas a two dimensional array has an unlimited amount of rows and columns, similar to a spreadsheet.
all arrays start at position 0
so in: M A R A D; M is in position 0 and A is in pos 1
0 is still the first character/part of the array.

An array is used to make a program more efficient when it comes to a lot of data, it is also good for iteration as it means you can eliminate using each variable separately. Arrays are dynamic.

Wednesday, November 12, 2014

System Life Cycle

1) Problem
2) Analyse the Problem
3) Design
4) Implementation
5) Test
6) Install
7) Maintain
8) Evaluate (Goes back to 1)

Waterfall and Spiral 
Waterfall is the traditional one which only goes through the system life cycle once
The Spiral is when the system life cycle carries on.

Waterfall
Information Gathering
Interview This is time consuming bit allows us to probe for answers and get first hand information
Questionares 
This is useful when there are lots of users although there is a limit to how much you will find out.
Observe the Current System
Although time consuming this is objective rather than subjective and might spot things that the user doesn't.

Feasibility Study is a report to identify the possible solutions to the problem and how possible they are.
Economic or technical feasibility of the new system.

Importance of Analysis

  • Problem must be accurately defined to solve it effectively 
  • User may not understand potential of computer system 
  • Developer not likely to understand the industry which the user working in 
  • Developer must produce a solution that the user requires to meet their needs
  • clear communication between the user and developer is important

Monday, November 10, 2014

Data Types and Data Structures

Numeric Data Types
Basic Data Types

  • Integer whole number eg 7
  • Real/float decimal point eg 7.2


Alphanumeric data types

  • Char a single character, Digit or symbol eg C
  • String several characters grouped  together eg Mr Smith


Boolean

  • A data can only have one of two values (TRUE or FALSE, 1 or 0)
Array Definition
  • A data structure that contains server data items
  • of the same data type
  • Grouped together with one name
  • Individual items are accessed using an index
  • Stored contiguously in computer memory
Use
  • Instead of having variables that we have to declare at front, we can use a list, the software can go through the list easily and find the variable in the list easily.
  • Fewer variables.
  • Use iteration to go through the list with the given variable instead of going through each variable to find the given variable.
  • They are dynamic, can change the program as it is running.

Array Declaration
  • Identifier/name
  • Data type
  • Dimension (1 or 2) One dimension has only has one row two dimension has a row and column.
  • All arrays start at index 0

Sunday, November 9, 2014

Magic 8 Ball Homework

import random
import time
generate = random.randint(1,20)
userQ = input("Welcome to Magic 8 ball, ask me anything!\n")
print("*Shaking ball*")
time.sleep(2)
if generate == 1:
    print("It is certain")
elif generate == 2:
    print("It is decidedly so")
elif generate == 3:
    print("Without a doubt")
elif generate == 4:
    print("Yes definitely")
elif generate == 5:
    print("You may rely on it")
elif generate == 6:
    print("As I see it, yes")
elif generate == 7:
    print("Most likely")
elif generate == 8:
    print("Outlook good")
elif generate == 9:
    print("Yes")
elif generate == 10:
    print("Signs point to yes")
elif generate == 11:
    print("Reply hazy try again")
elif generate == 12:
    print("Ask again later")
elif generate == 13:
    print("Better not tell you now")
elif generate == 14:
    print("Cannot predict now")
elif generate == 15:
    print("Concentrate and ask again")
elif generate == 16:
    print("Don't count on it")
elif generate == 17:
    print("My reply is no")
elif generate == 18:
    print("My sources say no")
elif generate == 19:
    print("Outlook not so good")
elif generate == 20:
    print("Very doubtful")
time.sleep(0.5)
while True:
    generate = random.randint(1,20)
    userQ = input("Ask me another question (to exit say ¦put down 8 ball¦)\n")
    print("*Shaking ball*")
    time.sleep(2)
    if generate == 1:
        print("It is certain")
    elif generate == 2:
        print("It is decidedly so")
    elif generate == 3:
        print("Without a doubt")
    elif generate == 4:
        print("Yes definitely")
    elif generate == 5:
        print("You may rely on it")
    elif generate == 6:
        print("As I see it, yes")
    elif generate == 7:
        print("Most likely")
    elif generate == 8:
        print("Outlook good")
    elif generate == 9:
        print("Yes")
    elif generate == 10:
        print("Signs point to yes")
    elif generate == 11:
        print("Reply hazy try again")
    elif generate == 12:
        print("Ask again later")
    elif generate == 13:
        print("Better not tell you now")
    elif generate == 14:
        print("Cannot predict now")
    elif generate == 15:
        print("Concentrate and ask again")
    elif generate == 16:
        print("Don't count on it")
    elif generate == 17:
        print("My reply is no")
    elif generate == 18:
        print("My sources say no")
    elif generate == 19:
        print("Outlook not so good")
    elif generate == 20:
        print("Very doubtful")
    time.sleep(0.5)
    if userQ == "put down 8 ball":
            break

Thursday, November 6, 2014

Software Development Cycle

DEVELOPMENT TOOLS
There are several different tools that could/might be used within the software development cycle are as follows:


  • API - This is an Application Programming Interface which is comparable to a lego set, building blocks as an API is basically a large library with pre made parts that you can use easily create your program. An example is within windows win32, this is the main api that control very simple things within windows. WebGL or OpenGL is also an API which can help with rendering the 3d model or animation etc.


  • SOURCE CONTROL - This is a system within a network database where one person can work on a bit of the program can check in which allows you to control it for a certain amount of time and cannot be interfered until this programmer has stopped working on it and checked out. There is also version where it keeps track of the different changes. Branching is another idea where you can take parts of the code off the main program and work on them in isolation.


  • BUILD TOOLS - AKA COMPILER - These are programs that put all the different pieces and parts that make up the whole program and help the developers compile the program into a complete version.


  • BUG TRACKING - Every piece of software in the world has bugs, nothing is perfect. This is a separate system that helps organise the bugs within a large program which prioritises issues and assigns jobs to fix bugs. This can sometimes link with the Source Control and mingle with the versioning.

  • AUTOMATED BUILD TOOLS - This is a service/script that runs and can compile the program in the correct order when something needs to be updated regularly. So it checks out and builds the system automatically which saves time.


Wednesday, November 5, 2014

Buffering and Interrupts

What is buffering?
Its an area of memory thats used in-between a slow and fast device to make sure the device receives information more slowly. The data is temporarily stored there while the secondary storage device receives it. This allows the processor to carry out other processors while the data is being received by the slower device.

Example: When we click on a video, the video does not start automatically meaning we have to wait for the video to load, that is when it is buffering. When it is buffering, there is enough data being transformed to the CPU so that there would be enough data for the video to run smoothly.

Advantages
1) can run videos more smoothly
2)The quality remains fairly high

Disadvantages
1) Increases loading time therefore it increases the waiting time for the video to load.
2) Synchronisation issue
3) Its going to use resources in the computer eg GPU/RAM

Interrupts
1) When the buffer needs service, it sends a signal to the CPU needing assistance to transfer the data to the output which means the buffer interrupts the CPU which means the CPU stops what ever processes it doing and goes and fetches the data and fills up the buffer.
2) Error messages are interrupts which means we have to respond to it.

An interrupt is a signal to the CPU to pause what its doing on that point so that it could service the interrupt and then go back to what is it doing.

Key Points 
1) Data sent to buffer from primary memory
2) This allows processor can continue with other tasks
3) Interrupts sent when buffer is full
4) Buffer is emptied to storage device
5) Buffer used to allow RAM and secondary storage device to transfer data as they do so at different       speeds
6) when buffer is empty
7) Interrupt is sent to processor
8) To request buffer refill
9) Process cycles until al data is transferred.


Data: 
1)Raw facts and figuers
2)No structure or content 

Information
1)Structured organised data
2)Processed data

Eg Bar Code, the computer identifies the number in the data base, identifies what is it and matches the price.


Magnetic Ink Recognition
1) the computer can recognise the ink's shape and read it accurately.

Optical Character Recognition
1) Captures images then it compares the shapes that has been captured with the data that is stored.

Optical Mark Recognition
1) The machine captures the marks that are on sheets that are in certain places and sends the co-ordinates to the data base.

Monday, October 6, 2014

CPU Notes

CPU (CENTRAL PROCESSING UNIT) WORKBOOK




THE PURPOSE OF THE CPU


This is often described as the brain of the computer. The purpose of the CPU is to process data. It is where all the searching, sorting, calculating and decision making takes place in the computer.


FETCH, DECODE, EXECUTE CYCLE


The CPU will fetch the data, instructions for a program from the main memory which is called RAM or Random Access memory. This is then stored within the CPU’s own memory reserve which is a lot smaller than RAM. This is called the Registers within the CPU. This is the FETCH part of the cycle.


These internal memory areas are collectively called the Registers but it can be divided into 4 different parts. These are called:
PC - Program Counter
CIR - Current Instruction Register
MAR - Memory Address Register
MDR - Memory Data Register


The CPU will place the address of the next item to be fetched in the address bus which his vital hardware path.


After this the data then moves from the main memory into the cpu by travelling along a bus called the data bus.


The next step in this system is the DECODE part of the cycle, this is where the CPU will make sense of the instruction.


The CPU has to understand a specific set of commands which differ between each CPU, this is called the instruction set.


after the DECODE has happened the CPU will prepare various areas for the next step in the process. After this is CPU will now start the EXECUTE part of the cycle where the data is finally processed, this means the instructions are actually carried out.


The cycle then starts again.


fetch_decode_execute_cycle.jpg< Diagram of the cycle.


THE CONTROL UNIT


parts_of_a_cpu.jpg
The three main jobs of the control unit is to control data flow within the processor, it controls the fetch execute cycle I wrote about earlier.
It will monitor the hardware within a system to make sure the commands are given to them and output correctly. it keeps everything in check.
It will control and is in charge of the specific inputs and outputs of a system so that they go to the right place at the right time.

THE IMMEDIATE ACCESS STORE (IAS)


The cpu will use the IAS as a temporary storage place for read data from the backing storage.


The main reason for an IAS is so that applications are able to run more directly as they are too slow from Backing storage (Hard drive). Basicly applications to run fast enough need to be in a quicker form and closer to the ALU etc.


ARITHMETIC LOGIC UNIT (ALU)


The ALU can be split up into a couple of different parts, the first being the Arithmetic part.
This does exactly what it says on the tin, performs the calculations on the data like adding, subtracting multiplying etc.
The other part being the Logic part which deals with, you guessed it, logic and comparisons.
so it will work out if one value is greater than another or equal etc etc.


CLOCK SPEED


A computer can only process a certain amount of instructions at a time, This depends on the amount of cores a cpu has, the more cores the more tasks it can do at once.


Clock speed is essentially the speed of a processor, it’s basically controlled by a quartz clock within the cpu. Its all measured in cycles per second, so one clock is one Hertz.


Most CPUs will run at 3GHz or more which is three thousand million cycles a second. This means the CPU can do roughly 3 billion instructions a second.


The more clock speed a CPU has the faster it will run, which means there will be a boost in performance. The downside of the this is the heat it generates which means you need a bigger air cooler or go water cooling.


“Overclocking” is when you get the most performance out of your CPU by increasing the clock speed to run faster than it was designed for. This means you need to get bigger cooling systems that what is typically found in a computer system. Some people will resort to watercooling their systems to keep temperatures down and noise down.


NUMBER OF CORES


When a CPU has “dual core” or “quad cores” it means that it has ‘parallel’ processing so basicly depending on the amount of cores, multiple instructions can be processed at the same time as there are multiple ALUs etc.


THE CACHE


The order the CPU will take to look at different storage areas it can access is as follows:
  1. CACHE
  2. RAM
  3. HARD DISK/SSD/HYBRID
this access this in that order as it gets larger in size as it goes down the list, and increases in speed as it goes up that list.


The CACHE is known as volatile memory as the cache will clear itself out when the computer is not powered. any data that was on the cache will be cleared, and the data will be gone.


The larger the CACHE is the faster a computer system will perform but specifically to the CPU it will mean there is more data to store for quicker access which means the computer will perform faster.

CACHE is the faster a computer system will perform but specifically to the CPU it will mean there is more data to store for quicker access which means the computer will perform faster.

Iphone Case Study

Iphone Case Study