Tuesday 15 December 2015

Procedural languages

Procedural languages are the most conventional 2nd and 3rd generation programming languages.
They tell the computer how to do something using a sequence of commands called imperatives- do this, do that
Characteristics:
> The code runs one line after another, it supports selection,iteration and assignment.
>Uses variables
>Programs are built in modules, which contain instructions to define exactly how the program should   run

Global variables are declared at the start of the program and are accessible throughout the program.
Local variables are defined inside procedures and are only visible to them.

Python Snowflakes:


Advantages and disadvantages of procedural language:

Advantages:- Excellent for general purpose programming- Many books and references available on well-tried and tested coding algorithms- Good level of control without having to know precise target CPU details- Portable source code - use a different compiler to target a different CPUDisadvantages:- As there are so many procedural languages, a programmer tends to have to specialise in a particular language in order to get work- Need to be very precise and knowledgeable about programming instructions, and so a fully de-bugged working program takes more time to put together- Not as efficient as hand-crafted source code written in a low level language




Thursday 10 December 2015

Device drivers


Device Drivers:

Every piece of hardware that connects to a computer will have a device driver that allows the computer system to communicate with it. Some drivers will be preinstalled with the OS, the right ones are loaded on boot up. The exact details of the driver will be kept in a file, called the registry in Windows. Makers of hardware will provide the device drivers for the piece of hardware and the specific OS.


When an application asks the OS to save a file or access any connected device, the OS needs to make use of a hardware driver. Hardware drivers are simply software that understands how to talk directly to a given piece of hardware. Drivers are normally produced by the manufacturer of the hardware, but can also be produced by OS manufacturers and even the open-source community. As all devices are different, the OS needs to have a generic way of talking to devices of the same type. This generic communication is not understood by the hardware itself and requires translation into the correct binary control signals. Hardware drivers perform this translation from the generic instructions sent by the OS to the specific instructions understood by the hardware. Drivers are only loaded by the OS, if specific hardware has been connected to the PC and requires installation. They are modular in nature and can be loaded on demand. Most OS installations will detect what hardware the user has and try to install the required drivers when the OS is installed. This functionality works by each device having two codes, a vendor ID (VID) and a product ID (PID). When a device is connected, the OS queries the device for these two codes. It then checks its database of known vendors and products to see if a suitable device driver can be found. If not, the user will have to install one before that device can be used.
Sometimes the OS will install generic drivers that will not be able to use the full range of features of the device. When setting up a new OS, you will have to install drivers for every piece of hardware on your PC. To see what drivers your system is currently using, you will need to load Device Manager for Windows or System Profiler on a Mac. On Linux the easiest way to see what devices are installed is to run ‘lspci’ or ‘lsusb’ from the command line.

What a device driver does:

A device driver understands how to talk to a particular piece of hardware, it translates the generic way an OS communicates to hardware into the correct binary signals for the hardware. When a new piece of hardware is installed the device driver will be installed using the Vendor and Product ID from the device so that it can automatically download the correct driver.



Friday 4 December 2015

Iteration

Iteration
Simply iteration just means repetition.
It is a sequence of instructions that are repeated multiple times.

There are 3 different types of iteration. These are:

  • WHILE
    • This loop is a condition controlled loop. the condition is tested upon entry to the loop, the instruction in this loop would not be executed if not all of the conditions are met. The loop will repeat itself until all the conditions are met, when this happens the loop will be exited.
  • REPEAT
    • The statements in this loop are executed before the condition is evaluated. A repeat loop is also a condition controlled loop, and it must be run through once at least.
  • FOR
    •  This is a count controlled loop, this is because you tell it the amount of times to complete this loop. For this there will always be a counter variable which will automatically increment each time that the loop is run through.
A procedure is a sub routine which execute their statements and does not return a value.

Thursday 3 December 2015

Open Source

Source Code:
Source code is the raw code produced by developers and defines what they want their software to do. It is written by developers using a programming language such as Java.

Open source:
Open-source software is opposite to closed source. For software to be open source, you must be able to download the source code and make changes to it  freely. There is a big difference between free software and open source. Free software does not make the source code available. Open-source code tends to have a lot of developers working on it for free, or being sponsored by a larger company. Anyone can join the community of developers to make changes to the code and upload their changes for the rest of the world to see. If the changes are good, they will be merged into the main source code and all users can benefit. Some famous examples of open-source software are Mozilla Firefox and the Linux kernel.

One of the most common licences is the GNU General Public License (GNU GPL or GPL) (GNU is a recursive acronym that stands for ‘GNU’s not UNIX’). Linux is under this type of license.

A program is free software, for certain users if:
  • You have the freedom to run the program as you wish, for any purpose. 
  • You have the freedom to modify the program to suit your needs. (To make this freedom effective in practice, you must have access to the source code, since making changes in a program without having the source code is exceedingly difficult.) 

Positives:
  • Free to use for everyone 
  • Allows creatation new programs and ideas that can be implemented on a larger scale
  • Continually evolving over time
  • Modify software to business practices, not possible with proprietary software

Negatives:
  • High number of bugs
  • Bugs can take time to be fixed developers with less support
  • Generally harder to use for individuals
  • Can have some high costs
  • Source code open to certain users.

Questions:
1, Open source software has the source code available in the public domain for viewing and editing.

2. Off the shelf software can be bought online as a download or in a shop on an optical disk. It is ready to use straight away for general tasks for a wide range of users. It cannot be used for specific tasks. Bespoke software is custom designed for a specific purpose by a company for a client that has a specific request, for example software for business. This generally has less support but features can be added on request.

3. GNOME, Apache, OpenOffice.

4. It is better value for money for the government without being locked into proprietary software. It allows flexibility without extra costs.

5. Benefits: lower costs, easier to add new features, it will evolve continually over time. Issues: lower security issues, source code available to malicious users, little to no support, bugs take a while to be fixed.

6. Licenses are needed to stop people using open source software for commercial reasons and making money off a free to use program. However it also stops malicious users from taking software and not sharing their edits with other users, for example GNU license.

Thursday 26 November 2015

Expert System Agony Aunt

Dear Emily
I run what was until recently a very successful helpline for computer-based problems. Recently, though, we haven’t been getting enough phone traffic to keep the lights on – I’m losing money hand over fist. I’ve heard a lot about “expert systems” that supposedly automatically answer any queries put to them. Can you explain to me what would be involved in setting one up?
Harry, Flitworth

Response:

Hello Harry,
 That is quite an issue you are having! Indeed an expert system is what you need! There are 4 main components of an expert computer system and these are;
  • The human computer interface (HCI) - This allows human access 
  • The knowledge base- This is a database of facts, it contains rules and facts about the task domain. It contains expert knowledge.
  • The rule base-links knowledge together through facts.
  • The inference engine - it is software that makes reductions using the knowledge baseattempts to work out the answer to the user’s query by using the rule base
To create this system you will need to have a database that contains different information for specific issues that you will encounter, there must also be a solution for each issue. This will then link with the rule base which will link each problem together.
Emily


Dear  Emily
I’ve got an exam tomorrow on expert systems. I know all about how they work, but I just *know* they’ll ask for real-life examples of where people have put these systems into use, and how well they perform. Can you give me a list of, say, five to ten industries or sectors or government branches that might have found expert systems useful enough to set one up?
Brunhilde, Derby

Response:
Hello Brunhilde,
Here are some examples for expert systems in the real world:
·         NHS online health checker
·         Government tax credit
·         Student finance from the Government
·         Auto pilot

Emily



Dear Emily
The machine apocalypse is coming! Computers are going to take over the world, and we’re helping them! I’m putting together a pamphlet to distribute to anyone passing the Houses of Parliament (hand-written, naturally) outlining the dangers of expert systems, their drawbacks and why we should stick with human operators. Could you…um…help me out here with a few examples?
Lizzy, Brunswick

Response:
Hello Lizzy,
Calm down! We have a solution for you, for example Medical diagnosis this is because the patient could lie to the system and the computer cannot check the patient of these false ideas. Expert computer systems are expensive to maintain and finally they also have limited knowledge outside their specific purpose.

Emily 

Tuesday 24 November 2015

Utility Software

Utility Software

Utility software often comes packages with the operating system, it's purpose is to ensure that it looks after or runs house keeping tasks for the computer, devices and other programs in the following areas:
  • File sorted
  • File renaming
  • File conversion 
  • File repair
  • Disk monitoring and Defragmentation
  • Printing jobs
  • Backing up data
  • anti virus
A utility program will have specific task and so will only do a couple of these jobs.

Examples of Utility software:

Anti Virus:
  • Antivirus software, this helps to protect a computer system from viruses and other harmful programs. A computer virus is a computer program that can cause damage to a computer's software, hardware or data. It is referred to as a virus because it has the capability to replicate itself and hide inside other computer files. This utility software will scans your online activity to make sure you are not downloading infected files.
    It has a large database of virus signatures, which it can compare to your files. It also monitors suspicious activity and informs the user if it detects anything untoward. When a virus is found, it can try to remove it, delete it or quarantine the file.
Backup software:
  • Backup software helps in the creation of a backup of the files on your computer. Most computer systems use a hard disk drive for storage. While these are generally very robust, they can fail or crash, resulting in costly data loss. Backup software helps you copy the most important files to another storage device, such as an external hard disk. 

Knowledge base systems

Knowledge based systems/Expert systems

This is essentially the process of creating a computer system that is designed to behave like a human.
They mimic human knowledge and experience in a specific field. Knowledge base systems find solutions to a problem with a given conditions.

Human experts all work in the same way:
  • Someone asks an expert for advice about a specific problem
  • The expert asks them a series of questions to understand and figure out the best solution 
  • Keep the dialogue open until more than one solution is found
  • Prioritise solutions based on budgets
  • a knowledge base systems tries to replicate this.
The components of the knowledge base system:
  • The human computer interface (HCI) - This allows human access 
  • The knowledge base- This is a database of facts, it contains rules and facts about the task domain. It contains expert knowledge.
  • The rule base-links knowledge together through facts.
  • The inference engine - it is software that makes reductions using the knowledge baseattempts to work out the answer to the user’s query by using the rule base.


Facts contain things like the retirement.
The rule base works by using logic and probabilities. 
The inference engine is interactive and will not just take in the input, do some processing and then provide an answer. At any point the knowledge-based system may require more information to help arrive at the correct conclusion.

The NHS Choices:
This program asks the user to answer questions to find out what problem or symptoms are being experienced, also it will instruct the user/ patient of what action they should take.

Examples of knowledge based system:
  • Online medical system
  • Telephone help system
  • Credit decisions
Advantages :
  • Allows us to always have access to advice when humans aren't available
  • Knowledge is captured
  • staff training
  • Does not get tired or over worked
  • No emotional overhead

Disadvantages:

  • Narrow range of knowledge
  • Requires effort and cost
  • Bad for ambitious problems 
  • Can only learn through mistakes from users
  • No creative solutions




The script:

In a small town called Bethlehem there were two quarrying families but secretly Harry and Mary have been having an affair. Harry is kicked out of his house by his wife because she found out he had been sleeping around. He was out in the cold searching for the man who told his wife about his sin. Three witches appeared to him on the haystack by Donald the donkey "I commend your pains" to which Harry replies "how now you secret black and midnight hag!" 
"I will prick my bum and the wicked will come your way curse your SIN"
The scene dissolves into Mary and Harry in the bedroom
"I'm sorry Mary I'm moving myself in your my deed without a name but the wife she knew" Mary drops to the floor with a bang! and Harry replied "Speakest thou from thy heart, Mary come back to me, is it too late now to say sorryyyyyy cause im missin' more than just your lorryyyy"
Gabriel breaks through the chimney and warns Harry to go go go find the expert system
"How do I know if it's an expert system, how do I know"
Gabriel prepares himself and breaks out in harmonious song "an expert system is a piece of software which uses expert knowledge to offer advice or make decisions in such areas such as medical diagnosis."
"I need it I need it I have a broken heart!!!!!!!!!!!!!!!!!!"
Harry ends up in a forest
Through the forest have I gone
But expert computer system found I none
pretty soul she does not die
I can't leave her to walk on by (in the clouds)
here my maiden, sleeping sound,
oh no I'm technology bound
how howst this system save my soul!!1????!!!!11"

An angry wolf lurks in thee shadows all you can here in the nearby village are the cries of young Harry as his body is being ripped apart by the wolf. 

Fiddle player "I needed this expert system because it uses human expertise knowledge and would have helped them solve their life threatening crisis but they're now dead.


An expert computer system is a program that mimics human knowledge and experience in certain situations.

Thursday 19 November 2015

Excel Review



Excel Review

Excel has been named the best spreadsheet program for many years a reason for this is because many Excel files can be saved in several formats.
Excel comes with over 1,000 start out templates this is really good for varying uses of Excel, for example those that wish to use Excel in a business and company setting can create impressive and professional charts, graphs and spreadsheets and those that wish to use Excel for personal use can do so to.
Another reason for Excel to be highly desirable is that it comes with access to SkyDrive, therefore once you download the app on to any of your compatible electronic devices you can instantly save, access and share files between all of your devices. This is done securely and safely, and can be used for Excel workbooks and spreadsheets that are needed to be opened and edited by others simultaneously in real time.



Advantages:
  • It is one of the second most widely used applications as it is the most powerful spreadsheet software
  • Chart production is easier as there is quick analysis
  • The software allows the machine to learn predicted inputs from the user so its quick
  • It is an easy software to use


Disadvantages:
  • It is not useful for large amounts of data
  • it isn't the best for advanced statistical analysis 

The display on Excel:




Features:

  • Graphs and charts
  • Saving files to one drive
  • Quick analysis to make tables into charts
  • Machine learning for auto-fills
  • You can protect cells from change this stops data from being corrupted
  • Your can create complex formulas and calculations
  • Calculations are automatic updated
  • Filters and sources to find relative information of what a user is looking for.
  • Data can be exported and imported from external devices





















    Word review

    Microsoft office Word Review
    Office 2013 has a new design language from Microsoft called Metro UI. Thsi puts your document centre stage with the tool ribbon faded slightly in the background. The UI is made for touch if a setting is flipped and buttons become bigger and more spacious for Windows 10 touch devices such as Surface Pro 4. However this can be very inefficient.
    Image and video embedding is now easier as they can be directly embedded without having to save them first and new alignment guides that appear to help centre or align images or set text wrap.

    PDF documents can also be converted into document files to be edited with all of the layout that was in the original PDF.

    The simplification of the interface means that some functions have been lost or hidden or have become more complicated to find and use than before.For example AutoCorrect features have disappeared from the right click menu so you have to enter a settings menu to add corrections you want to use.


    Advantages:
    - Touch Friendly
    - Simple interface
    - New useful functions such as importing video and alignment grids

    Disadvantages:
    - Difficult to use simple features
    - Inefficient with a keyboard and mouse
    - PDF import still has formatting issues

    Overall Word 2013 has been optimised for touch related devices that are more common with Windows 10 but has sacrificed some usability for this simplification of the program.

    Friday 13 November 2015

    Abstraction



    Abstraction

    What is abstraction?
    Abstraction is a representation of the real world but hiding some details.
    It is an important tool in problem solving 
    An example of abstraction is the London tube map, this is because it doesn't have all the detail of the exact track route and also the surrounding areas, it is to the point and hides unnecessary detail.
















    Another example of abstraction is games for example The Sims. (Raising a child is very simplistic and also there is removed detail for example the child and ageing process.)

    Abstraction can be used to try and simplify a problem that has already been solved.
    you need to turn the information from analogue to digital, analysing the size and shape of the item that is being scanned. When information and problems are simplified you can reuse certain abstracts. In abstraction you are taking away details that you do not need to monitor. The weather forecast remove levels above 30 feet as no-one needs to know higher than that in detail. 
    Scientists have decided which information is relevant and discard any other information.

    The moon model from Google is an example of abstraction:
    1. It's 2D instead of 3D
    2. The mission paths 
    3. The elevation is shown in colours instead of actual heights
    4. There is limited resolution 

    Abstraction is key for programming.
    Functional Decomposition is breaking down problems into smaller sub problems.
    Procedural Abstraction is a way to separate out values used in a model in a set way, allows us to create different algorithms that allow you to input different values.
    Functional Abstraction calculates the square root or generates a random number for example abstraction is taken one step further.Using a function doesn't require you to know anything about how the computation is carried out.
    Data Abstraction the data or information is relevant to solving a problem .

    Thursday 5 November 2015

    Scheduling

    Scheduling

    What is Scheduling?
    Scheduling is the term the OS uses to define how and when a process is swapped in and out of the CPU, enabling multitasking. Each OS has a different way of performing scheduling. Scheduling makes decisions on which process should be run next or which ones should be interrupted, known as pre-empting.

    external image Fig03_08.jpg

    Scheduler Aims:
    The main design goals of the scheduler are to:
    • Minimise starvation of processes (When a process doesn't get enough time or no time at all to run on the CPU)
    • Eliminate deadlock (When a process is waiting for a resource from another process so cannot access it, and this process is waiting for a resource held by the other, so neither can progress)
    • Ensure high throughput of processes (Processes can be completed as quickly as possible).
    • Ensure fairness for all processes (Linked to starvation).
    • Ensure reasonable response time (To enhance user experience).
    The choice of a scheduling algorithm is to ensure these goals are met.

    Disk Scheduling Vs Process Scheduling:

    When you run a program, we would like to have it in CPU registers because is the fastest memory, but that is very expensive, so the programs (processes) are sent to RAM (also we would like to run many processes, more than the registers may keep). RAM soon or later will be full, we need to keep more programs on memory, so the next caching level is send the processes that aren't being used from RAM to disk.
    • The disk scheduling then consist in send to disk the processes that are not being used right now, but someday they will.
    • The process scheduling allows you to use many programs and apps in a "parallel" way (you see that everything is executing at the same time, but is just an illusion)


    The strategies Deciding how jobs should be scheduled:
    • Shortest job first: the jobs are sorted into ascending order.
    • Round robin: each job is given a maximum length of processor time after which the job is put back in the queue.
    • Shortest remaining time: jobs in the ready queue are sorted into ascending order of the remaining processing time the job is expected to need.

    Types of Strategy

    Round Robin

    This is the the simplest scheduling strategy that allows fairness in time on the CPU. This fairness is achieved as each process is given a fixed time to run and is pre-empted if the process has not completed before the end of that time. When processes aren't completed they are sent back to the ready to run queue and the head of the queue swaps into the CPU, this will continue until all processes are completed.

    Priority Scheduling

    This approach is very good for making sure that the most vital jobs get to run first however, it must also deal with low-priority jobs, otherwise they may never get a look-in. In this case the scheduler may start to bump up the priority of lower jobs to ensure they will eventually run.

    Shortest Burst

    This approach the idea is to get as many jobs through the CPU as possible. Many jobs spend a considerable of time waiting for some input-output event to happen, and then they run for a bit and once again they have to wait for another input-output event.This strategy schedules the shortest job to be processed first.

    Operating System Functions

    BIOS

    • This stands for basic input output system
    • When a computer is first switched on it looks to the BIOS to get it up and running and so the processors program counter points to the BIOS memory
    • The BIOS will usually first check that the computer is functional, memory is now installed and accessible, the processor is working, this is called is power on off self test (POST)
    • once it is finished it can use a boot loader program to load the operating system kennel into memory.
    • BIOS usually stored on flash memory so it can be updated which allows settings like the boot order disks to be changed and saved by the user.
    Virtual Machines
    • It is possible to write a program that has the same functionality as a physical computer, this is called virtual machines
    • A common virtual machine  is run operation with another operating system, this might be because a program is needed that will not run on the host operating system or it might be because it offers a convenient way to test a program being developed on multiple platforms. 
    • virtual machines are just programs and data that have advantages over physical machines, they can be backed up and duplicated and more than one can be at one time on a physical machine. It is for these reasons that many organisations are vitalising their network infrastructure, making their server a group of machines running from a cluster of physical machines.
    Process Virtualisation 
    • Another common use of virtual machine is for interpreting intermediate code. When programs are compiled to a machine that code will only run on processors with the same instruction set
    • An alternative is to use an interpreter, but this is slow and means that the source code is freely available.
    • Intermediate code offers a compromise between the two approaches.
    • A compiler is needed to convert the source into something called a byte code.

    Tuesday 3 November 2015

    Buffers and Interrupts


    Buffer

    • A buffer is a small amount of fast memory which is used as temporary data. The processor can store and receive data from the buffer quickly and then gets on with another task while the storage device takes its time reading or sending data. 
    • Saving data from primary storage has two stages: 
        • fill the processor from the buffer 
        • empty the buffer to storage.
    • This system will work if the buffer can hold all the data it needs to that needs to be sent top the storage device. however, if there is more data than will fit in the buffer the storage device needs to tell the processor that it has used all data in the buffer. 


    Interrupts
    • The storage device sends an interrupt a signal to the processor that needs attention. When the processor receives this interrupt it stores it and carries on with what it is doing. When it is finished it checks all the interrupts and services and does the most important one first.
    • The use of an interrupt is widespread in any computer system any devices for example the printer or the keyboard.
    • Every interrupt has program code which is run to deal with or service the interrupt. 
    The different interrupts:

    • I/O interrupt:
      •  This refers to any interrupt that is being raised by either an input or an output.
    • Hardware interrupt:
      • This refers to any interrupt that is raised by a component of the computer.
    • Program interrupt:
      • This is an interrupt that is raised and triggered by software that is installed onto the computer.
    • Time interrupt:
      • This is an interrupt that is triggered at a specific time or after a specific amount of time.

    The operating system manages the interrupt after the execution of an instruction, the processor checks to see in an interrupt has occurred. If it has, the operating system services the interrupt if it is more important than the task already being carried out