Wednesday, 20 October 2010

Information Processing

Today Mark brought in George his pet snake! It's amazing how it was so tame and didn't hiss or give the impression he wanted to bite one of us.

We learnt about testing and debugging, and how there are three separate types of errors;
Syntax - The computer does not understand your instructions (It finds where the error is)
Run-time - Programme cannot execute instructions (Does not find the error, such as spelling)
Logical - Programme executes but does not match the intention (Usually due to a mistake from the user)

Information processing will always involve an Input, Process and an Output. This way of thinking is important to understand the process to make something work, and how to do it. An example was how Mark was able to create a system that converted Fahrenheit to Celsius. Here's a breakdown of the input, process and output;

Input - Temperature in Fahrenheit
Process -
Output - Temperature in Celsius

We also learnt some functions which could be used, to help work out mathematical data;
Square root - sqrt ( )
Absolute Value - abs ( )
Integer - floor ( )
Sine - sin ( )
Cosine - cos ( )
Random Number - random ( )

Sunday, 17 October 2010

Dynamic HTML

HTML can be very static, which means that it can be limiting, as it will be identical each time it loads. The solution is dynamic processing. This means the use of processes such as javascript, to allow things to change within the webpage.

For javascript to work, there will need to be some specific information within the body of the HTML. There will need to be an 'input id', which will be referred to within the script, a type so that the computer can understand what you are making, a value, which will be the text/information that will be shown to the user, and a list of functions that will be used, which in the example we were shown was "onclick="btnRed_OnClick()".

Then, you need to insert a <script> element outside of the <html> area within the code of the web page. This will be to create the interaction functionality to the code, where the Input ID, function and value will be very important.

This is what is known as an event handler procedure, which means an event that the input ID it refers to will do, when something is done, which in this case is when the mouse is placed over it.

function btnRed_OnMouseOver(){
    btnRed.value = "RED";
  }

Within this event handle procedure there is a set order that it must be written;
Object.Property=Literal
Which just means..
Input ID . Outcome will be? = Answer
So its like saying; I want the red button, to change to.. red. It's just the same, but displayed in code, so that the computer can understand it when viewing the web page.

The order is very important with code, unlike in mathematics where you can say x2+b =23+c3 and can switch them around to get the same result, in coding if you were to put something in the wrong place within the form of code it is being put into, it will just not work.

The Object and Property (as described above), act as the destination, and the Literal acts as the source. So it's like saying Put Red into the Value of btnRed (referring to the piece of code above). Thinking about it this way could easily confuse you and think you need to re-order the code to say "Red"= btnRed.Value, but this would not work, so the order of the arrangement of code is VERY important for success.

The wavy bracket tags which look like this: { } are very important for functions to work within code, you will need to make sure that they start and finish the code otherwise it will not work.

SO, some new key words learnt during week 12's lesson for Soft131;
Property - It's the format for the informatio nthat will be shown, such as "title" or "src"
Keyword - A fixed part of the code, such as "function"
Object - The type of information that is being used, such as "document"
Event - What needs to be done for it to happen, such as "OnMouseOver"
Event handler - The event and outcome from it, "btnRed_OnmouseOver"

HTML

HTML - Hyper-Text Markup Language

Tags are the choice of elements that you wish to include into your webpage, such as <b> or </a>
The start and end tags both count as SEPARATE tags, which is important to remember.

Elements are the full form of the tag, with the start tag, content and then the end tag, for example;
<b>Insert some important information here</b>
This would be an element, as it contains both the opening and closing brackets, and also content.

Nesting is a way in which you can use more than one set of tags for one piece of content, such as possibly making a set of text bold, but also give it some spacing from the other content on the webpage.
<p><b>This piece of text is very important and should be read first</b></p>
The important thing to note here, is that the tags cannot overlap eachother, if one set of tags are inside another, then the inside one must be ended FIRST.

Attributes are what extra information is included within tags to help make them work, such as hyperlinking another webpage;
<a href=“http://karl-soft131.blogspot.com”>Next Page</a>
The href="http://karl-soft131.blogspot.com" is the attribute. To put it simple, it's the extra piece of information to help understand the purpose of the tag.
Alternatively this could also be used for inserting an image
 <img src=“Beach.jpg” />
As you can see here, src="Beach.jpg" is the attribute in this element.

Sunday, 3 October 2010

Overview of introduction to the course

We found out that the lecturer doesn't use Tulip so will need to refer to his website for any lecture notes and information;

Soft131 Homepage

This lesson will be what will help us to understand in more depth the work we do with Chris Saunders in iDat102, as his work will be the creation, and Mark Dixon's will be more of the theory of using the HTML codes and javascript.