Jupyter at Bryn Mawr College |
|||
Public notebooks: /services/public/dblank / CS110 Intro to Computing / 2017-Fall / Notebooks |
Notes from Sep 7, 2017, CS110 Introduction to Computing, Bryn Mawr College. Douglas Blank.
Some examples:
Now, let's see what you can do!
Jupyter is the name of the system that you log into. It is running on a server at Bryn Mawr College. It allows you to run code in a variety of programming languages inside things called "notebooks." Each notebook is made up of cells. Cells can have text (called "markdown", like this text).
You can turn on Spell-checking and the in-class exercise Submit by:
You can control how a cell is treated (code or markdown) by selecting from the picklist in the toolbar. You can select Markdown (like this cell), or Code. You can edit a markdown cell by double-clicking it, editing it, and then Shift+Enter.
New function:
text("String in double quotes", x, y);
NOTE: On your Lab1, make sure you put your name on your art using the Text() function.
You can put code in a cell, like this:
fill(0);
text("This is a sketch", 10, 15);
text("You can write", 10, 30);
text("and draw:", 10, 45);
fill(255, 0, 0);
ellipse(50, 75, 25, 25);
Cells should be run sequentially, from top to bottom. You can get information on how to use the notebook for writing here: Jupyter Notebook Users Manual.
Tips:
SHIFT+TAB
after a name to get help on itTAB
after a few letters to complete the variable or function You can create text with headings, styles, and even create equations, like:
$$ \left(\! \begin{array}{c} n \\ r \end{array} \!\right) = \frac{n!}{r!(n-r)!} $$
Processing is a programming language. You write programs as "sketches." Each sketch goes into a Jupyter cell.
The syntax of the Processing language is a subset of the Java programming language.
Functions to explore:
All of the shapes are listed at processingjs.org/reference
When done, Save the Sketch, and click on the Submit button in the toolbar. Select dsblank, and CS110-Practice-Sep-7.
You can also click on the Publish . That will give you a URL that you can share with friends and family.