Author: Mr Stratton

Computing teacher and a PT at Coltness High School.

Higher – Responsive web design in PagePlus X8

Not everyone uses a desktop computer to view web pages. A significant proportion of the population now uses mobile devices to view websites. This means that designers have to use a website design that can respond to these devices by changing page size, position of elements, etc. Normally this would be done with CSS scripting however the process is slightly different in WebPlus.

Higher – Revision for Friday 18th of March

Please look over the following SSD areas

Be able to name and describe how the following standard algorithms work.

  • Linear Search
  • Input Validation
  • Find Maximum
  • Count Occurrences
  • Find Minimum
  • Reading from a file

Describe how the following translators work

  • Interpreters
  • Compilers

Differences between high and low level languages

How to use a subprogram

Use of parameters in subprograms

Differences between functions and procedures

 

Creating the binary background

I’ve changed my background from a stock internet photo to one I created myself.

First of all I wrote a little python program that generated a random 0 or 1

1
2
3
4
5
6
7
import random
message=""
for item in range(3000):
    number=random.randint(0,1)
    message=message + str(number)

print(message)

 

blueBinaryI then took a screenshot of the resulting console window and cropped it with IrfanView. I made a negative of the image and swapped the RGB colours before saving it as a PNG file.

I then uploaded the file and set it as a time background, it needs a little crop as it’s a couple of pixels too wide on one edge.

I’m sure you can think of a way that you could use this technique to create even better backgrounds with patterns or hidden messages.

Python Tables

tableI was asked in class how we can create a table in Python. There are a number of ways to do this but the easiest is probably to use the .format method.

The program reads in data from a CSV file before displaying the information in a two column table. There is a lot of internal commentary you can strip out leaving just the code.

The main part of the program is line 28. Where the contents of names and scores are displayed one line at a time with padding to make them appear to be in a table.

Read more

Higher – Python – Reading from a file

Python-logo-notext.svgA lot of people find reading from a sequential file difficult. Well lets break it down, first of all what is a sequential file? A sequential file is a text based (ASCII or UNICODE) file that is made up of both printing and non printing characters. The end of the file is signalled with EoF, often programmers put data in separate lines using a new line character. Sometimes the files are in CSV format, which means that each line holds a records worth of data.

The basic premise of any Python read file access is

  1. Open file for reading
  2. read each line
  3. close file

This post will mostly be focused on different ways of doing step 2.

Read more

Internet or World Wide Web

So do you know the difference between the Internet and the WWW? BT think that the terms are interchangeable, however, this is NOT the case.

The Internet is a interconnected network of networks. It is the physical network that all internet traffic must pass along.

The World Wide Web is a service that runs on the Internet. It is a series of documents hosted on Internet connected web servers that allow for  browsing using hyper links.

The two terms are not interchangeable in the exam and you will drop marks by using the wrong term.