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