Monday, 23 February 2015

F452 File handling

Serial file:

  • Data is stored in the order that it is added.
  • This is known as 'appending' the data.

Sequential file:

  • Data is stored according to a key field.
  • When writing data to a sequential file all subsequent records need to be moved.
  • File modes:
    • -Append
    • -Create
    • -CreateNew
    • -OpenOrCreate
    • -Read
    • -ReadWrite
    • -Write

Indexed sequential file:

  • Data is arranged according to a key field but uses an index which can find records directly.

Random files:

  • Allow data to be stored anywhere in a dedicated section of a disk.
  • A hash algorithm (calculation) is performed on a field in the record to be stored.

Size estimation:

  1.  Determine the size in Bytes of each field.
  2.  Add the field sizes.
  3.  Multiply by number of records.
  4.  Add 10% to the result for additional storage/ overhead.

Wednesday, 11 February 2015

F451 - Software answers

Sage Instant [Payroll Explore]:

  • Accounting software.
  • Keeps track of income and would be used by employers.
  • Provides templates for easy use. 
  • Another example: Matlab.
AutoDesk [AutoCAD LT 2014]:
  • CAD prototyping software.
  • Used by designers to design.
  • Provides easy to use tools and help to illustrate designs.
  • Another example: Google SketchUp.
 Microsoft Visual Studio:
  • Integrated development environment (IDE).
  • Used to write code; used by developers.
  • Compiles code & has funky build tools.
  • Another example: Python 3.3.4 IDE.
InfinityQS [ProFicient]:
  • Statistical analysis software.
  • Used to store data and produce visual representations for businesses.
  • Accumulates data.
  • Another example: ADaMSoft.
NCR [CounterPoint]:


F451 - TCP/IP


  • TCP/IP is a set of protocols developed to allow cooperating computers to share resources across a network.
  • TCP stands for Transmission Control Protocol.
  • They are Transport Layer and Network Layer protocols in OSI model.
  • The most well known network that adopted TCP/IP is --> Internet (the biggest WAN)
  • Supported by UNIX operating system.

F452 - Arrays 'n' stuff.

3 properties of a 1 dimensional array:


  • List of elements of a specific type.
  • Can be used in an expression.
  • Contiguous block of memory.
  • Relatively efficient (not entirely guaranteed).
  • Typed.
  • Has an identifier.
  • Indexes (mainly 0 based0).
  • Fixed size.



2D array:

Row then column.
2 columns.

A      B
[0,0],[1,0],
[1,0],[1,1],

[2,0],[2,1],



List:

Efficient and dynamic data type.

Dictionary:
This is an implementation of a hash table: an extremely efficient way to store keys for lookup.
A dictionary is fast, well designed and reliable.
Example: dict["string"];

ArrayList:
Found in systems.collections. Can have different data types.

Stack:
Sequential stack where data is pushed and popped to the top of the stack.

Queue:
This removes elements that were added first (FIFO, first-in-first out). So we keep items in order.

Sets:
The hashset implements set logic in its many instance methods. We use methods such as Union on different HashSets to solve problems. This makes some programs simpler.

F452 - Basic data types or Primitives.

Numeric data types:
Integer.
Real.

Alphanumeric data types:
Char.
String.

Boolean:
True or False

F451 - Internet Protocol


  • IP stands for Internet Protocol.
  • IP specifies the format of packets, also called datagrams, and the addressing scheme. Most networks combine IP with a higher - level protocol called Transmission Control Protocol (TCP), which establishes a virtual connection between a destination and a source.
  • TCP establishes a connection between 2 hosts so that they can send messages back and forth for a period of time (duplex).

Purpose:


  • Need a standard means of communication between devices.
  • Can't communicate if speaking 2 different languages.
  • The IP defines the basic unit of data transfer (IP diagram).
  • IP software performs the routing function.
  • IP includes a set of rules that process the idea of unreliable packet delivery.

What is protocol? 

  • Rules and conventions explaining how something must be done.
  • Used to describe how devices can communicate.

Each datagram has 2 components:

  • Header 
  • Payload
Please - physical
Dear - data link
Never - network
Try - transport
Stealing - session
People's - presentation
Apples - application

IP supports the following following services:
  • One-to-one (unicast)
  • One-to-all (broadcast)
  • One-to-several (multicast)

Physical Layer:

  • This layer deals with the Hardware of network.

Data Link Layer:

  • This layer deals with MAC addresses of devices.
  • Responsible for physical addressing, error correction & preparing the information for the media frames.

Network Layer:

  • This layer deals with Packets (data bundles).
  • Responsible for logical addressing and routing.

Transport Layer:


  • This layer deals with segments.
  • Breaks information into segments and is responsible for connection & connectionless communication.
  • Hardware: proxy server, gateways, firewall,...

Session Layer:

  • Responsible for establishing, managing & terminating user connections.
  • Acknowledgements of data received during a sessions.
  • Retransmission of data if it is not received by a device.

Presentation Layer:

  • Allows hosts & applications to use a common language.
  • Performs..
    • Data formatting.
    • Encryption & Decryption for security.
    • Compression & Expansion.

Application Layer:

  • This layer is what the user sees. 
  • Provides Interface for users to communicate with applications.

IP - Internet protocol.
ARP - Address Resolution Protocol.
ICMP - Internet Control Message Protocol.

IP address:


  • An IP address is a unique global address for a network interface.
  • Is a 32 bit long  identifier.
  • Encodes a network number (network prefix) and a host number.
  • In high-order bit is set to 0, the next seven bits complete the network ID, the remaining 24 buts represent the host ID.
  • The 2 high order bits in class B are set to 10, the next 14 are used to complete the network ID, the remaining 16 bits represent the host ID.

Subnetting:


  • Subnetting enables the network administrator to further divide the host part of the address into 2 or more subnets.
  • In this case, a part of the host address is reserved to identify the particular subnet.
  • This is easier to see if we show the IP address in binary format.

Journey to IP versions: 

  • IPV(1-3) : 
    • Were not formally assigned.
  • IPV4 : 
    • TCP/IP, 32 bit IP address currently used.
  • IPV5 : 
    • Internet stream protocol (SP).
  • IPV6 : 
    • Designed to replace IPV4, 128 bit IP address.


F451 - Switching and Routing

Switching:

  • Path set up at connection time.
  • Simple table look up.
  • Table maintenance via signaling.
  • No out of sequence delivery.
  • Lost path may lose connection.
  • Much faster than pure routing.
  • Link decision made ahead of time, and resources allocated then.

Routing:

  • Can work as connectionless.
  • Complex routing algorithm.
  • Table maintenance via protocol.
  • Out of sequence delivery likely.
  • Robust: no connections lost.
  • Significant processing delay.
  • Output link decision based on packet header contents - at every node.