Wednesday 28 May 2014

Python Starter

Thursday 22 May 2014

Networks





Year 10 Exam Feedback

What went well in your Year 10 ICT exam?


To help us with planning for next time please also tell us how it could be even better?



Wednesday 21 May 2014

On a Mission Promote It


PROMOTE IT

Product You must produce a promotional product (promo) for your game that:
  • encourages members of the target audience to play the game
  • makes use of appropriate assets from the game.
This should be a digital product such as a Flash introduction or a trailer.

Wednesday 14 May 2014

What Is Unit Testing?

At a high-level, unit testing refers to the practice of testing certain functions and areas – or units – of our code. This gives us the ability to verify that our functions work as expected. That is to say that for any function and given a set of inputs, we can determine if the function is returning the proper values and will gracefully handle failures during the course of execution should invalid input be provided.
Ultimately, this helps us to identify failures in our algorithms and/or logic to help improve the quality of the code that composes a certain function. As you begin to write more and more tests, you end up creating a suite of tests that you can run at any time during development to continually verify the quality of your work.
A second advantage to approaching development from a unit testing perspective is that you'll likely be writing code that is easy to test. Since unit testing requires that your code be easily testable, it means that your code must support this particular type of evaluation. As such, you're more likely to have a higher number of smaller, more focused functions that provide a single operation on a set of data rather than large functions performing a number of different operations.
A third advantage for writing solid unit tests and well-tested code is that you can prevent future changes from breaking functionality. Since you're testing your code as you introduce your functionality, you're going to begin developing a suite of test cases that can be run each time you work on your logic. When a failure happens, you know that you have something to address.
In computer programmingunit testing is a software testing method by which individual units of source code, sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures are tested to determine if they are fit for use. Intuitively, one can view a unit as the smallest testable part of an application. In procedural programming, a unit could be an entire module, but it is more commonly an individual function or procedure. In object-oriented programming, a unit is often an entire interface, such as a class, but could be an individual method. Unit tests are short code fragments created by programmers or occasionally by white box testers during the development process.

Ideally, each test case is independent from the others. Substitutes such as method stubsmock objects,fakes, and test harnesses can be used to assist testing a module in isolation. Unit tests are typically written and run by software developers to ensure that code meets its design and behaves as intended.

Using Comments


Demonstrates an else clause

# Granted or Denied
# Demonstrates an else clause

print("Welcome to System Security Inc.")
print("-- where security is our middle name\n")

password = input("Enter your password: ")

if password == "secret":
    print("Access Granted")
else:
    print("Access Denied")

input("\n\nPress the enter key to exit.")

Monday 12 May 2014

Software Development Life Cycle (SDLC)

What you need to know?


  • Describe the software development life Cycle.
  • The Importance of the different stages of the Software development life cycle.
  • You should be able to identify at which stage of the software development life cycle a given step would occur.
  • Understand that there are several life cycle models that can be used for example cyclical, waterfall, spiral
  • You should be able to discuss the advantages and disadvantages of these life cycle life cycles


Answer these questions on your Blog

Define a Software Development Life Cycle?

What are the stages of the Software development life cycle in a general model?

What is the Waterfall model?
 (Definition, image of the model, advantages and disadvantages)

What is the Incremental Model?
 (Definition, image of the model, advantages and disadvantages)

What is the V-Shaped Model?
(Definition, image of the model, advantages and disadvantages)

What is the Spiral Model?
(Definition, image of the model, advantages and disadvantages)











Thursday 8 May 2014

ASCII

ASCII, abbreviated from American Standard Code for Information Interchange.
Originally based on the English alphabet, it encodes 128 specified characters into 7-bit binary integers as shown by the ASCII chart below The characters encoded are numbers 0 to 9, lowercase letters to z, uppercase letters A to Z, basic punctuation symbols,control codes that originated with Teletype machines, and space
For example, lowercase e would become binary 1100101.

ASCII codes represent text in computerscommunications equipment, and other devices that use text. Most modern character-encoding schemes are based on ASCII, though they support many additional characters.

ASCII includes definitions for 128 characters: 33 are non-printing control characters (many now obsolete) that affect how text and space are processed and 95 printable characters, including the space (which is considered an invisible graphic).


Wednesday 7 May 2014

How CD's Work?








CiDA Unit1 Developing Web Products - A How To Guide

Exam First Steps!

  • Adobe Dreamweaver
  • Manage Sites to H:/Sites
  • Create a new HTML template (File – New)
  • Insert an Editable region (Insert – Template Objects)
  • Save as Template (File – Save as Template)
  • Create pages from template (File – New – Blank Page from Template)



These videos might help you also


Tuesday 6 May 2014



Getting units right is important



Getting units right is important. Scientists from NASA will tell you this. In 1998 a space probe called the Climate Orbiter was launched to track climate changes on Mars. The Orbiter failed to stop at the atmosphere of Mars, and instead carried on going, only to burn up and disintegrate. On investigation it was found that the company that built the spacecraft, Lockheed, were using the Imperial units of measurement - miles, feet and inches - while the people running the missions at NASA were using the metric system - kilometres, metres and centimetres. Calculations by Lockheed and NASA didn’t match at all and the mission failed miserably - costing more than $125 million and years of effort.

Friday 2 May 2014

Computer Science Label Links


Year 10 you should have links on your CS Blog to all these topics in your Label Tab

Please check that you do and have the notes from my blog linked to yours
  • Binary
  • Computer Systems
  • Computing History
  • Computing Science
  • Constants
  • CPU
  • Data Storage Media
  • Data types
  • Disabled Users
  • Flowcharts
  • Functions
  • Hardware
  • Hexadecimal
  • HTML
  • Input Devices
  • Lists
  • Logic
  • Loops
  • Objects
  • Procedures
  • Processors
  • Python
  • RAM
  • ROM
  • Strings
  • Testing Code
  • variables
  • Vector Images
  • Venn Diagrams

Thursday 1 May 2014

Unit5 - Game Authoring (things to do)

Student Resources

Folder Structure & Eportfolio
Game Overview
Moodboard
Design It
Build It


Review It
Evidence It

object-oriented programming (OOP)

Object-oriented programming (OOP) is a programming language model organized around objects rather than "actions" and data rather than logic. Historically, a program has been viewed as a logical procedure that takes input data, processes it, and produces output data.

The programming challenge was seen as how to write the logic, not how to define the data. Object-oriented programming takes the view that what we really care about are the objects we want to manipulate rather than the logic required to manipulate them. Examples of objects range from human beings (described by name, address, and so forth) to buildings and floors (whose properties can be described and managed) down to the little widgets on a computer desktop (such as buttons and scroll bars).
The first step in OOP is to identify all the objects the programmer wants to manipulate and how they relate to each other, an exercise often known as data modeling. Once an object has been identified,  it is generalized as a class of objects (think of Plato's concept of the "ideal" chair that stands for all chairs) which defines the kind of data it contains and any logic sequences that can manipulate it. Each distinct logic sequence is known as a method. Objects communicate with well-defined interfaces called messages.

What Is an Object?

Objects are key to understanding object-oriented technology. Look around right now and you'll find many examples of real-world objects: your dog, your desk, your television set, your bicycle.
Real-world objects share two characteristics: They all have state and behavior. Dogs have state (name, color, breed, hungry) and behavior (barking, fetching, wagging tail). Bicycles also have state (current gear, current pedal cadence, current speed) and behavior (changing gear, changing pedal cadence, applying brakes). Identifying the state and behavior for real-world objects is a great way to begin thinking in terms of object-oriented programming.
Take a minute right now to observe the real-world objects that are in your immediate area. For each object that you see, ask yourself two questions: "What possible states can this object be in?" and "What possible behavior can this object perform?". Make sure to write down your observations. As you do, you'll notice that real-world objects vary in complexity; your desktop lamp may have only two possible states (on and off) and two possible behaviors (turn on, turn off), but your desktop radio might have additional states (on, off, current volume, current station) and behavior (turn on, turn off, increase volume, decrease volume, seek, scan, and tune). You may also notice that some objects, in turn, will also contain other objects. These real-world observations all translate into the world of object-oriented programming.
A circle with an inner circle filled with items, surrounded by gray wedges representing methods that allow access to the inner circle.
A software object.

Software objects are conceptually similar to real-world objects: they too consist of state and related behavior. An object stores its state in fields (variables in some programming languages) and exposes its behavior through methods(functions in some programming languages). Methods operate on an object's internal state and serve as the primary mechanism for object-to-object communication. Hiding internal state and requiring all interaction to be performed through an object's methods is known as data encapsulation — a fundamental principle of object-oriented programming.
Consider a bicycle, for example:
A picture of an object, with bibycle methods and instance variables.
A bicycle modeled as a software object.

By attributing state (current speed, current pedal cadence, and current gear) and providing methods for changing that state, the object remains in control of how the outside world is allowed to use it. For example, if the bicycle only has 6 gears, a method to change gears could reject any value that is less than 1 or greater than 6.
Bundling code into individual software objects provides a number of benefits, including:
  1. Modularity: The source code for an object can be written and maintained independently of the source code for other objects. Once created, an object can be easily passed around inside the system.
  2. Information-hiding: By interacting only with an object's methods, the details of its internal implementation remain hidden from the outside world.
  3. Code re-use: If an object already exists (perhaps written by another software developer), you can use that object in your program. This allows specialists to implement/test/debug complex, task-specific objects, which you can then trust to run in your own code.
  4. Pluggability and debugging ease: If a particular object turns out to be problematic, you can simply remove it from your application and plug in a different object as its replacement. This is analogous to fixing mechanical problems in the real world. If a bolt breaks, you replace it, not the entire machine.

String


     
  •  
  •  
  • Print
A string is a data type used in programming, such as an integer and floating point unit, but is used to represent text rather than numbers. It is comprised of a set of characters that can also contain spaces and numbers. For example, the word "hamburger" and the phrase "I ate 3 hamburgers" are both strings. Even "12345" could be considered a string, if specified correctly. Typically, programmers must enclose strings in quotation marks for the data to recognized as a string and not a number or variable name.
For example, in the comparison:
if (Option1 == Option2) then ...
Option1 and Option2 may be variables containing integers, strings, or other data.
If the values are the same, the test returns a value of true, otherwise the 
result is false. In the comparison:
if ("Option1" == "Option2") then ...
Option1 and Option2 are being treated as strings. 
Therefore the test is comparing the words "Option1" and "Option2,"
 which would return false. 
The length of a string is often determined by using a null character.

Strings

A compound data type

So far we have seen five types: intfloatboolNoneType and str. Strings are qualitatively different from the other four because they are made up of smaller pieces — characters.
Types that comprise smaller pieces are called compound data types. Depending on what we are doing, we may want to treat a compound data type as a single thing, or we may want to access its parts. This ambiguity is useful.
The bracket operator selects a single character from a string:
>>> fruit = "banana"
>>> letter = fruit[1]
>>> print letter
The expression fruit[1] selects character number 1 from fruit. The variable letter refers to the result. When we display letter, we get a surprise:
a
The first letter of "banana" is not a, unless you are a computer scientist. For perverse reasons, computer scientists always start counting from zero. The 0th letter ( zero-eth ) of "banana" is b. The 1th letter ( one-eth ) is a, and the 2th ( two-eth ) letter is n.
If you want the zero-eth letter of a string, you just put 0, or any expression with the value 0, in the brackets:
>>> letter = fruit[0]
>>> print letter
b
The expression in brackets is called an index. An index specifies a member of an ordered set, in this case the set of characters in the string. The index indicates which one you want, hence the name. It can be any integer expression.

Flowcharts

To understand what a system flowchart is, it helps to know that the most basic definition of a system is: a connection of parts that does something useful.

What is a system flowchart?

System flowcharts are a way of displaying how data flows in a system and how decisions are made to control events.
To illustrate this, symbols are used. They are connected together to show what happens to data and where it goes. The basic ones include:
Decisions (yes, no) are represented by a diamond. Processes (something that happens) are represented by a rectangle. Inputs and outputs are represented by a parallelagram. An arrow represents the data flow, indicating the direction of data flow.
Symbols used in flow charts
Note that system flow charts are very similar to data flow charts. Data flow charts do not include decisions, they just show the path that data takes, where it is held, processed, and then output.

Using system flowchart ideas

This system flowchart is a diagram for a 'cruise control' for a car. The cruise control keeps the car at a steady speed that has been set by the driver.
The speed sensor detects the speed of the car. If the car is too fast, less fuel is provided to the engine and teh flow chart returns to the start. If it is not too fast, is it too slow? If it is too slow, more fuel is sent to the engine and the flow chart returns to the start. If it is not too slow, the flow chart returns to the start.
A system flowchart for cruise control on a car
The flowchart shows what the outcome is if the car is going too fast or too slow. The system is designed to add fuel, or take it away and so keep the car's speed constant. The output (the car's new speed) is then fed back into the system via the speed sensor.
Other examples of uses for system diagrams include:
  • aircraft control
  • central heating
  • automatic washing machines
  • booking systems for airlines

Loops in Python

For loops

Usage in Python

  • When do I use for loops?
For loops are traditionally used when you have a piece of code which you want to repeat n number of times. As an alternative, there is the WhileLoop, however, while is used when a condition is to be met, or if you want a piece of code to repeat forever, for example -
For loop from 0 to 2, therefore running 3 times.
for x in range(0, 3):
    print "We're on time %d" % (x)
While loop from 1 to infinity, therefore running infinity times.
x = 1
while True:
    print "To infinity and beyond! We're getting close, on %d now!" % (x)
    x += 1
As you can see, they serve different purposes. The for loop runs for a fixed amount - in this case, 3, while thewhile loop theoretically runs forever. You could use a for loop with a huge number in order to gain the same effect as a while loop, but what's the point of doing that when you have a construct that already exists? As the old saying goes, "why try to reinvent the wheel?".
  • How do they work?
If you've done any programming before, there's no doubt you've come across a for loop or an equivalent to it. In Python, they work a little differently. Basically, any object with an iterable method can be used in a for loop in Python. Even strings, despite not having an iterable method - but we'll not get on to that here. Having an iterable method basically means that the data can be presented in list form, where there's multiple values in an orderly fashion. You can define your own iterables by creating an object with next() and iter() methods. This means that you'll rarely be dealing with raw numbers when it comes to for loops in Python - great for just about anyone!
  • Nested loops
When you have a piece of code you want to run x number of times, then code within that code which you want to run y number of times, you use what is known as a "nested loop". In Python, these are heavily used whenever someone has a list of lists - an iterable object within an iterable object.
  • Early exits

Like the while loop, the for loop can be made to exit before the given object is finished. This is done using thebreak keyword, which will stop the code from executing any further. You can also have an optional else clause, which will run should the for loop exit cleanly - I.E., without breaking.