CS1315: Introduction to Media Computation Introduction to JES.

Slides:



Advertisements
Similar presentations
Do I need a robot today? You only need a robot if your team has not shown me your octagon and/or the octagon in a function.
Advertisements

CS1315: Introduction to Media Computation Introduction to Programming.
Created by Mark Guzdial, Georgia Institute of Technology; modified by Robert H. Sloan, University of Illinois at Chicago, For Educational Use. CS.
Media Computation in JES (Chapter 2) DM Rasanjalee Himali.
IT151: Introduction to Programming
Python: Making colors and Using Loops. Review JES command area – program area Defining/using functions specifying a sequence of steps for what the function.
Chapter 2: Introduction to Programming. Chapter Learning Objectives.
01-IntroToMediaComp1 Barb Ericson Georgia Institute of Technology Oct 2010 Introduction to Computer Science and Media Computation.
James Tam Programming: Part I In this section of notes you will learn about how to write simple programs using JES.
Python. What is Python? A programming language we can use to communicate with the computer and solve problems We give the computer instructions that it.
Lesson 3 Text Basics Adapted From Source:
PYTHON: LESSON 1 Catherine and Annie. WHAT IS PYTHON ANYWAY?  Python is a programming language.  But what’s a programming language?  It’s a language.
Graphics in Python using the JES environment
Python Programming Fundamentals
CS 102 Computers In Context (Multimedia)‏ 01 / 28 / 2009 Instructor: Michael Eckmann.
by Chris Brown under Prof. Susan Rodger Duke University June 2012
Adding Content To Your Faculty Page 1.Login 2.Create your Faculty Page 3.
CS 101: Introduction to Computing Programming picture manipulations Developed by Mark Guzdial, Georgia Institute of Technology, 2003–2004; modified by.
Introduction to Programming Workshop 1 PHYS1101 Discovery Skills in Physics Dr. Nigel Dipper Room 125d
Download JES Tool JES: Jython Environment for Students
Lecture # 27 Python I. Python “Interpretive” language (vs. compiled) So is HTML, JavaScript. Python supports file I/O. JavaScript doesn’t Python is a.
Playing Music in Alice By David Yan Under the direction of Professor Susan Rodger July 2015.
CMSC 104, Section 301, Fall Lecture 06, 9/18/02 Algorithms, Part 3 of 3 Topics Disk Quota Exceeded. Using Pine. More Algorithms Reading Read.
Word 2010 Vocabulary List 1. Click and Type - A feature that allows you to double-click a blank area of a document to position the cursor in that location,
 Application – another name for a program.  Interface – is what appears on the screen when the application is running.  Program Code – is instructions.
Python programming Introduction to the JES environment and basics of Python Reading: Chapters 1, 2 from “Introduction to Computing and Programming in Python”
Conditions. Objectives  Understanding what altering the flow of control does on programs and being able to apply thee to design code  Look at why indentation.
CMPS 1371 Introduction to Computing for Engineers MatLab.
CS1315: Introduction to Media Computation Introduction to Programming.
Playing Music in Alice By David Yan Under the direction of Professor Susan Rodger July 2015.
CS 100 Introduction to Computing Introduction to JES Developed by Mark Guzdial, Georgia Institute of Technology, 2003–2004; modified by Robert H. Sloan.
Chapter 1 – Matlab Overview EGR1302. Desktop Command window Current Directory window Command History window Tabs to toggle between Current Directory &
CS 101: Introduction to Computing Color replacements and targeted color replacement (if statement) Developed by Mark Guzdial, Georgia Institute of Technology,
01-IntroToMediaComp1 Barb Ericson Georgia Institute of Technology Feb 2010 Introduction to Computer Science and Media Computation.
1 Structure of a C Program (continued) Presentation original from Dr. Turner’s class USF - COP C for Engineers Summer 2008.
CS1315: Introduction to Media Computation Color replacements and targeted color replacement (IF)
Trinity College Dublin, The University of Dublin GE3M25: Computer Programming for Biologists Python Karsten Hokamp, PhD Genetics TCD, 03/11/2015.
A Media Computation Cookbook Manipulating Images and Sounds for Use in Alice Part 1: Image Manipulations Part 2: Changing colors in an area Part 3: Chromakey.
1 CS 177 Week 2 Recitation Slides Variables, Files and Functions.
CS1315: Introduction to Media Computation Introduction to JES.
Python programming Introduction to the JES environment and basics of Python.
CS1315: Introduction to Media Computation Introduction to Programming.
Intro CS and Media Computation1 Barb Ericson Georgia Institute of Technology Feb 2010 Introduction to Computer Science and Media Computation.
Python programming Using the JES picture functions and defining new functions.
Chapter 6 Functions The Tic-Tac-Toe Game. Chapter Content In this chapter you will learn to do the following: 0 Write your own functions 0 Accept values.
Part 1 Learning Objectives To understand that variables are a temporary named location to store data and that programmers work with different data types.
Multimedia Summer Camp
Development Environment
CSCI 203: Introduction to Computer Science I
Scratch for Interactivity
Introduction to Programming
In the beginning… software
Download JES Tool JES: Jython Environment for Students
Introduction to Python
Introduction to the JES environment and basics of Python
CS1315: Introduction to Media Computation
Chapter 2: Introduction to Programming
Chapter 2: Introduction to Programming
Agenda – 1/31/18 Questions? Group practice problems
A Media Computation Cookbook
Workshop for Programming And Systems Management Teachers
CSCI N317 Computation for Scientific Applications Unit 1 – 1 MATLAB
CS 177 Week 3 Recitation Slides
CSCI N207 Data Analysis Using Spreadsheet
CS1315: Introduction to Media Computation
General Computer Science for Engineers CISC 106 Lecture 03
Mu Editor – New User Cheat Sheet – CircuitPython Mode
Mu Editor – New User Cheat Sheet – CircuitPython Mode
Presentation transcript:

CS1315: Introduction to Media Computation Introduction to JES

Installation Installing JES and starting it  Windows users: Just copy the folder Double-click JES application  Mac users: Just copy the folder Double-click the JES application

We will program in JES JES: Jython Environment for Students A simple editor (for entering in our programs or recipes): the program area A command area for entering in commands for Python to execute.

JES - Jython Environment for Students

Tour of JES Save and Save As Cut/Copy/Paste with shortcut keys Turning in assignments  them to me  You will use this first with HW1  Help within JES  Explain is contextualized help: Highlight a JES (media) function  Lots of help on mediatools and the like

Python understands commands We can name data with = We can print values, expressions, anything with print

Using JES like a calculator >>> print >>> print 34.1/ >>> print 22 * >>> print >>> print "Hello" Hello >>> print "Hello" + "Mark" HelloMark

Command Area Editing Up/down arrows walk through command history You can edit the line at the bottom  and then hit Return/Enter  that makes that last line execute

Demonstrating JES for files and sounds >>> print pickAFile() /Users/monica/MediaSources/barbara.jpg >>> print makePicture(pickAFile()) Picture, filename /Users/monica/MediaSources/barbara.jpg height 294 width 222 >>> print pickAFile() /Users/monica/MediaSources/hello.wav >>> print makeSound(pickAFile()) Sound of length >>> print play(makeSound(pickAFile())) None >>> myfilename = pickAFile() >>> print myfilename /Users/monica/MediaSources/barbara.jpg >>> mypicture = makePicture(myfilename) >>> print mypicture Picture, filename /Users/monica/MediaSources/barbara.jpg height 294 width 222 >>> show(mypicture)

Typical code to view a picture myfile = pickAFile() mypict = makePicture(myfile) show(mypict)

Typical code to play a wav file myfile = pickAFile() mysound = makeSound(myfile) play(mysound)

Writing a “recipe”: Making our own functions To make a function, use the command def Then, the name of the function, and the names of the parameters between parentheses (age) End the line with a colon : The body of the recipe is indented (Hint: Use three spaces)  That’s called a block

Making functions the easy way Get something working by typing commands in the command window (bottom half of JES) Enter the def command in the editing window (top part of JES) Copy-paste the right commands into the editing window

A recipe for playing picked sound files def pickAndPlay(): myfile = pickAFile() mysound = makeSound(myfile) play(mysound) Note: myfile and mysound, inside pickAndPlay(), are completely different from the same names in the command area.

Blocking is indicated for you in JES Statements that are indented the same, are in the same block. Statements in the same block as the cursor are enclosed in a blue box.

A function for playing picked picture files def pickAndShow(): myfile = pickAFile() mypict = makePicture(myfile) show(mypict)

The Most Common JES Bug: Forgetting to Load Your function does NOT exist for JES until you load it  Before you load it, the program is just a bunch of characters.  Loading encodes it as an executable function Save and Save As  You must Save before Loading  You must Load before you can use your function

MOST IMPORTANT THING TO DO TO PASS THIS CLASS! DO THE EXAMPLES! Try them out for yourself. Replicate them. Alter them. Understand them!  FOR EVERY CLASS, TYPE IN AT LEAST TWO OF THE EXAMPLES FROM CLASS To understand a program means that you know why each line is there. Practicing will help you encounter all the simple-but- confusing errors early—BEFORE you are rushing to get homework done!!