Administrative Notes February 9, 2017 Feb 10: Project proposal - - PowerPoint PPT Presentation

administrative notes february 9 2017
SMART_READER_LITE
LIVE PREVIEW

Administrative Notes February 9, 2017 Feb 10: Project proposal - - PowerPoint PPT Presentation

Administrative Notes February 9, 2017 Feb 10: Project proposal resubmission (optional) Feb 13: Art and Images reading quiz Feb 17: In the News call #2 Computational Thinking The image part with relationship ID rId20 was not


slide-1
SLIDE 1

Computational Thinking www.ugrad.cs.ubc.ca/~cs100

The image part with relationship ID rId20 was not found in the file.

Administrative Notes February 9, 2017

  • Feb 10: Project proposal resubmission (optional)
  • Feb 13: Art and Images reading quiz
  • Feb 17: In the News call #2
slide-2
SLIDE 2

Computational Thinking www.ugrad.cs.ubc.ca/~cs100

The image part with relationship ID rId20 was not found in the file.

Data Representation: Part 2

Text representation Colour representation

slide-3
SLIDE 3

Computational Thinking www.ugrad.cs.ubc.ca/~cs100

The image part with relationship ID rId20 was not found in the file.

Learning goals Text representation

  • [CT Building Block] Given a list of ASCII codes, students

will be able to decode an ASCII representation of a short text document.

  • [CT Building Block] Students will be able to explain why
  • pening a non-ASCII file (e.g., a Word document) in a text

editor results in a different display than when the same document is opened in its intended application.

3

slide-4
SLIDE 4

Computational Thinking www.ugrad.cs.ubc.ca/~cs100

The image part with relationship ID rId20 was not found in the file.

How do we store letters in hex (or binary)? ASCII – 128 values (7 bits, since 27 = 128)

https://en.wikipedia.org/wiki/ASCII

slide-5
SLIDE 5

Computational Thinking www.ugrad.cs.ubc.ca/~cs100

The image part with relationship ID rId20 was not found in the file.

How do we store letters in hex (or binary)? ASCII – 128 values (7 bits, since 27 = 128)

https://en.wikipedia.org/wiki/ASCII

  • ACSII (American Standard Code for Information

Interchange) was developed in the 1960’s

  • In addition to letters and numbers, punctuation, spaces

and other special control characters are encoded; each encoded item is sometimes called a code point

  • Why 7 bits? An extra “check” bit was included that could

be used to detect certain errors that might arise, e.g., when sending data over a modem

  • Extended ASCII uses 8 bits (or one byte), allowing for

characters with accents (Á, ë and others)

slide-6
SLIDE 6

Computational Thinking www.ugrad.cs.ubc.ca/~cs100

The image part with relationship ID rId20 was not found in the file.

Translating from ASCII (hex) to text Example

Hex Binary Symbol 41 01000001 A 42 01000010 B 43 01000011 C 44 01000100 D 45 01000101 E 46 01000110 F 47 01000111 G

Binary 01000110 01000001 01000011 01000101 Hex 46 41 43 45 Text

The image part with relatio nship ID rId9 was not found in the file.
slide-7
SLIDE 7

Computational Thinking www.ugrad.cs.ubc.ca/~cs100

The image part with relationship ID rId20 was not found in the file.

Translate from ASCII (hex) to text Group exercise

Hex Symbol 41 A 42 B 43 C 44 D 45 E 46 F 47 G

Binary 01000010 01000001 01000100 01000111 01000101 Hex 42 41 44 47 45 Text

slide-8
SLIDE 8

Computational Thinking www.ugrad.cs.ubc.ca/~cs100

The image part with relationship ID rId20 was not found in the file.

Extended ASCII: an 8-bit representation

If regular ASCII represents 128 values in 7 bits, how many values can we represent in a byte (8 bits)?

slide-9
SLIDE 9

Computational Thinking www.ugrad.cs.ubc.ca/~cs100

The image part with relationship ID rId20 was not found in the file.

What about other languages, like Chinese?

  • Unicode is a text representation standard,

maintained by the Unicode Consortium since the 1980s

  • Unicode covers most of the world’s modern

and historic writing systems, and has over a million code points

  • There are different implementations, including

UTF-8 and UTF-16

https://en.wikipedia.org/wiki/Unicode

slide-10
SLIDE 10

Computational Thinking www.ugrad.cs.ubc.ca/~cs100

The image part with relationship ID rId20 was not found in the file.

What about other languages, like Chinese?

Both and UTF-8 and UTF-16 are variable-length encodings:

  • UTF-8 is consistent with ASCII representation,

using one byte, but uses up to four bytes for

  • ther characters
  • UTF-16 uses one or two 16-bit code units per

code point

https://en.wikipedia.org/wiki/Unicode

slide-11
SLIDE 11

Computational Thinking www.ugrad.cs.ubc.ca/~cs100

The image part with relationship ID rId20 was not found in the file.

Are ASCII, UTF-8 and UTF-16 forms of encryption? Clicker question

  • A. Yes
  • B. No

https://en.wikipedia.org/wiki/Unicode

slide-12
SLIDE 12

Computational Thinking www.ugrad.cs.ubc.ca/~cs100

The image part with relationship ID rId20 was not found in the file.

What about formatting? How does Word store its data?

slide-13
SLIDE 13

Computational Thinking www.ugrad.cs.ubc.ca/~cs100

The image part with relationship ID rId20 was not found in the file.

What about formatting? How does Word store its data?

  • Uploading a Word document into the online Hex

editor suggests that the document is not in ASCII representation

  • In fact it is a zipped collection of files! If you

unzip a word document, you can see these files (and even change some things in them…)

slide-14
SLIDE 14

Computational Thinking www.ugrad.cs.ubc.ca/~cs100

The image part with relationship ID rId20 was not found in the file.

What about formatting? How does Word store its data?

  • Most of the files that comprise a Word document

are in XML (Extensible Markup Language) format; they describe metadata such as the font style and size, document creator, etc.

  • The files
  • The files may also contain information about

tracked changes to the document, collaborators, privacy and security settings, and more

slide-15
SLIDE 15

Computational Thinking www.ugrad.cs.ubc.ca/~cs100

The image part with relationship ID rId20 was not found in the file.

Privacy implication!

  • The information that’s encoded in a Word document

can have data that you don’t necessarily want to share!

  • There are ways to “scrub” metadata from Word

documents (details depend on the type of computer – Mac or PC – and on the version of Word)

slide-16
SLIDE 16

Computational Thinking www.ugrad.cs.ubc.ca/~cs100

The image part with relationship ID rId20 was not found in the file.

Keeping data confidential can be tricky in

  • ther formats as well…
  • Consider confidential documents, like the redacted

military document in the beginning of Blown to Bits Chapter 3… http://www.corriere.it/Media/Documenti/Classified.pdf

slide-17
SLIDE 17

Computational Thinking www.ugrad.cs.ubc.ca/~cs100

The image part with relationship ID rId20 was not found in the file.

Learning goals Colour representation

17

  • [CT Building Block] Define the RGB colour specification,

explain its basis

slide-18
SLIDE 18

Computational Thinking www.ugrad.cs.ubc.ca/~cs100

The image part with relationship ID rId20 was not found in the file.
  • Colours on monitors, phone

screens, and TVs are mixes of red, green, and blue lights

  • Computer applications use 256

intensities (8 bits) for each of red, green, and blue

Red Green Blue (RGB) colours

slide-19
SLIDE 19

Computational Thinking www.ugrad.cs.ubc.ca/~cs100

The image part with relationship ID rId20 was not found in the file.

Black and white colors

Black is the absence of light:

0000 0000 0000 0000 0000 0000 (Binary) 0 0 0 0 0 0 (Hex) RGB bit assignment for black

White is the full intensity of each color:

1111 1111 1111 1111 1111 1111 (Binary) F F F F F F (Hex) RGB bit assignment for white http://www.colorpicker.com/

slide-20
SLIDE 20

Computational Thinking www.ugrad.cs.ubc.ca/~cs100

The image part with relationship ID rId20 was not found in the file.

RGB colours Clicker exercise

Suppose red’s intensity is 255 (full intensity). What happens if both the blue and green intensities increase at the same rate, starting from 0?

20

slide-21
SLIDE 21

Computational Thinking www.ugrad.cs.ubc.ca/~cs100

The image part with relationship ID rId20 was not found in the file.

RGB colours Clicker exercise illustration

slide-22
SLIDE 22

Computational Thinking www.ugrad.cs.ubc.ca/~cs100

The image part with relationship ID rId20 was not found in the file.

RGB colours Clicker exercise

Which colour best describes the one represented by the hexadecimal colour code: #00B103?

22