Helpful links for EPIC 2018 Workshop using p5.js and Project Jupyter
Choose someone who you would:
California 39th District, Assembly
DIY Girls, Founder
GitHub, Data Scientist
“On learning AI: The myth of innate ability in tech.”
Adafruit, Founder and CEO
Electrical Engineer
Project Jupyter, Operations Manager
Heptio, Engineer
Completed
is one of many CS careers.
Organizing, Planning Events
Art
Math
Writing
Music
What interests you?
Explore coding and the many other Computer Science careers.
Lifelong learning is important in Computer Science.
Made with Code: Limor Fried, Founder of Adafruit
See the Google Doodles page.
Choose a Google Doodle.
- What things were interactive?
- How did it start?
- How did it end?
- What do you like best?
- What would you change?
Inspect doodle web page with Chrome Developer tools.
JavaScript documentation from Mozilla
Design at Google
Skills used:
- Product research
- User Interface and UX
- Computer Human Interactions
Completed
https://alpha.editor.p5js.org/
Get started with JavaScript
Completed
In general:
.js) :arrow_right: interactivitycodepen.io to test code :bulb:
sketch.js is a JavaScript filesketch.js
function setup() {
// put setup code here
}
function draw() {
// put drawing code here
}
index.html<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0>
<style> body {padding: 0; margin: 0;} </style>
<script src="../p5.min.js"></script>
<script src="../addons/p5.dom.min.js"></script>
<script src="../addons/p5.sound.min.js"></script>
<script src="sketch.js"></script>
</head>
<body>
</body>
</html>
The canvas coordinates are different than in math class.
- top left (0,0)
- bottom right (width-1, height-1)
createCanvas(300, 100); // Canvas width is 300 pixels, height is 100 pixels
For example:
- top left (0,0)
- bottom right (299, 99)
ellipse(centerPixelsFromLeft, centerPixelsFromTop, width, height);
Example
[.code: auto(42), line-height(2.0)]
function setup() {
createCanvas(400, 400);
}
function draw() {
ellipse(150, 90, 20, 20); // Draw a circle (width=height)
ellipse(200, 200, 80, 10); // Draw an ellipse
}
function setup() {
createCanvas(400, 400);
}
function draw() {
ellipse(150, 90, 20, 20); // Draw a circle (width=height)
ellipse(200, 200, 80, 10); // Draw an ellipse
line(0, 0, 50, 50);
rectangle(300, 200, 50, 30);
rectangle(50, 70, 30, 30);
}
Completed
Red (r)
Green (g)
Blue (b)
A color is a mix of red, green, blue.
Color value: 0 to 255
Sliders and Widgets
#Project 6
Interactivity
Completed
Press the yellow button.
Use Python as an interactive calculator.
Python, Jupyter, & Binder
Completed
AI and Machine Learning Examples
Your accomplishments
| Number | Project |
|---|---|
| 1 | People |
| 2 | Careers |
| 3 | Design at Google |
| Javascript: p5.js | |
| 4 | Getting started |
| 5 | Draw |
| 6 | Interactivity |
| 7 | Python: Jupyter and mybinder.org |
| 8 | Next steps |
willingc AT gmail DOT com
footer: ©Carol Willing, 2018. https://speakerdeck.com/willingc/interactivity-in-computer-science
slidenumbers: true
build-lists: true
theme: Next, 2
Research Software Engineer, Cal Poly SLO
Project Jupyter, Steering Council
Python Software Foundation Fellow
Python Core Developer
Open Source Hardware and Software
Every day, I am a beginner at something.
Learn. Build. Share.



| Time | Project |
|---|---|
| 1:10 pm | People |
| 1:20 pm | Careers |
| 1:30 pm | Design at Google |
| 1:45pm | JavaScript: p5.js |
| 2:30 pm | Python: Jupyter and mybinder.org |
| 2:45 pm | Next steps |
^ Pacing: 1:10 pm






“On learning AI: The myth of innate ability in tech.”



^ Pacing: 1:20 pm




Explore coding and the many other Computer Science careers.
Lifelong learning is important in Computer Science.
^ Pacing: 1:30 pm

See the Google Doodles page.

Choose a Google Doodle.
- What things were interactive?
- How did it start?
- How did it end?
- What do you like best?
- What would you change?
:bulb: UX = User Experience :bulb:

Inspect doodle web page with Chrome Developer tools.
:eyes: JavaScript documentation from Mozilla :eyes:
Skills used:
- Product research
- User Interface and UX
- Computer Human Interactions





In general:
.js) :arrow_right: interactivity:bulb: codepen.io to test code :bulb:

sketch.js is a JavaScript file[.code: auto(42), line-height(2.0)]
sketch.js
function setup() {
// put setup code here
}
function draw() {
// put drawing code here
}
index.html[.code: auto(42), line-height(2.0)]
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0>
<style> body {padding: 0; margin: 0;} </style>
<script src="../p5.min.js"></script>
<script src="../addons/p5.dom.min.js"></script>
<script src="../addons/p5.sound.min.js"></script>
<script src="sketch.js"></script>
</head>
<body>
</body>
</html>
The canvas coordinates are different than in math class.
- top left (0,0)
- bottom right (width-1, height-1)
[.code: auto(42), line-height(2.0)]
createCanvas(300, 100); // Canvas width is 300 pixels, height is 100 pixels

For example:
- top left (0,0)
- bottom right (299, 99)
ellipse(centerPixelsFromLeft, centerPixelsFromTop, width, height);
Example
[.code: auto(42), line-height(2.0)]
function setup() {
createCanvas(400, 400);
}
function draw() {
ellipse(150, 90, 20, 20); // Draw a circle (width=height)
ellipse(200, 200, 80, 10); // Draw an ellipse
}

[.code: auto(42), line-height(2.0)]
function setup() {
createCanvas(400, 400);
}
function draw() {
ellipse(150, 90, 20, 20); // Draw a circle (width=height)
ellipse(200, 200, 80, 10); // Draw an ellipse
line(0, 0, 50, 50);
rectangle(300, 200, 50, 30);
rectangle(50, 70, 30, 30);
}

Red (r)
Green (g)
Blue (b)
A color is a mix of red, green, blue.
Color value: 0 to 255


Press the yellow button.


Use Python as an interactive calculator.


:tada: Your accomplishments :tada:
| Number | Project |
|---|---|
| 1 | People |
| 2 | Careers |
| 3 | Design at Google |
| Javascript: p5.js | |
| 4 | Getting started |
| 5 | Draw |
| 6 | Interactivity |
| 7 | Python: Jupyter and mybinder.org |
| 8 | Next steps |
willingc AT gmail DOT com
Photos:
Videos: