Joel Gethin Lewis
Lecture 2
Thanks again to Rune Madsen for putting his course online:
http://printingcode.runemadsen.com/lecture-form/.
http://printingcode.runemadsen.com/lecture-form-2/.
Don't forget to click to the slides and press 's' Joel!
Thanks again to Ali Almossawi for writing his book.
Read the Matching socks and Finding your size chapters of "Bad Choices" Joel!
The website for p5.js is: https://p5js.org
The following content is all from the "Learn" section of the p5.js website.
Hello p5.js and Get Started and finally some Examples.
Don't forget you can right click or CTRL click any time to save a png!
Before we get on to how JavaScript stores information in Variables and Data Types, I want to go back to the previous lecture. Remember how we learnt to count in binary?
Does anyone know what a Megabyte is?
A million bytes! (Actually a bit more).
What is a byte?
A byte is 8 bits.
(I remember this by saying Beight in my head).
What is a bit?
A bit is a Binary digIT.
A 1 or a 0.
So everything stored on a computer is just a 1 or a 0.
Turns out it's much easier to encode binary numbers as hexadecimal numbers to make them a bit more readable.
Hexadecimal means base 16! So: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F.
Each byte (eight bits) can be encoded as two base 16 numbers.
11010100 in binary would be D4 in hex.
FFFF3 in hex would be 11111111111111110011 in binary!
Lets open a JPEG in a Hex Editor to see what it looks like.
Open BobDylanSelfPortraitSigned.jpg.
We can see when the photo was taken and with which camera!
Lots of files have this kind of information encoded in them. Usually in ASCII encoding.
Demonstrate looking up A in the editor in a ASCII table.
The following content is all from the JavaScript Basics section of the p5.js wiki.
How JavaScript gets added to webpages.
Types: Numbers, Strings and Booleans.
Assignment and operators.