CS 100 Python commands, computing concepts, and algorithmic approaches for final Fall 2015

Size: px
Start display at page:

Download "CS 100 Python commands, computing concepts, and algorithmic approaches for final Fall 2015"

Transcription

1 CS 100 Python commands, computing concepts, and algorithmic approaches for final Fall 2015 These pages will NOT BE INCLUDED IN THE MIDTERM. print - Displays a value in the command area - Examples: - print Hello - print 10 - print x, where x is a variable. Its value will be printed. assignment statement - Used to change the value of a variable - Examples: def file = pickafile() color = red - Used to define a function - The names inside the parentheses on the def line are parameters. They get their value when the function is called. def HelloWorld (name) : print Hello, + name calling a function - Executes the function, assigning argument values to parameter names - The names inside the parentheses when a function is called are arguments. Their value is assigned to the parameter in the same position on the def line of the function. return HelloWorld ( Mary Lyon ) - A return statement allows a function to compute a value and report it back to the caller - The caller saves the value in a variable using an assignment statement

2 def loadpicture () : file = pickafile() pic = makepicture(file) return pic - Then the caller can say: mypic = loadpicture() for loop - Repeats the statements inside the loop for each value looped over for p in getpixels(picture) : setcolor (p, red) - Nested for loops are handy for selecting a rectangular part of an image or for doing image manipulations based on the location of a pixel. if statement - Executes some statements only when a condition is true # Shadows if (grayness < 63) : redness = redness * 1.1 blueness = blueness * 0.9 # Midtones elif (grayness < 192) : redness = redness * 1.15 blueness = blueness * 0.85 # Highlights else : redness = redness * 1.08 blueness = blueness * An if-statement can have any number of elif parts, including 0. The else part is optional and must come last. The statements associated with the first condition that is true are executed and the rest of the if-statement is skipped. The else part is executed if none of the conditions are true. Computing concepts you should be familiar with These are just the highlights. Questions on the exam may go beyond this level of detail. - An algorithm is a sequence of instructions describing how to complete a task. A program is an algorithm written in a programming language.

3 - Abstraction is describing a solution in a way that you use already understood concepts in your description, rather than providing complete detail. A function is a way of defining an abstraction, by giving a name to a list of instructions. - Syntax refers to the grammar rules of a programming language. - Semantics defines what a programming language construct means. - Variables allow you to use names for values, where the variable can have different values at different times. - The scope of a variable is the part of the program where the variable is known. A parameter or a variable set within a function has the function as its scope. - The computer encodes all data as binary, just 0s and 1s. The same sequence of 0s and 1s can mean different things depending on its context. For example, it could be a number, a letter, or a color. - ASCII is the most common encoding of characters into binary. Unicode is another encoding that can support many different alphabets and common symbols. - JPEG and GIF are two different formats for images that compress images so they take less space on disk than their complete bitmap representation. - Vector graphics is a way of representing an image by providing instructions to draw the image rather than describing the image directly. - A bit can take on one of 2 values, 0 or 1. A byte is 8 bits and can take on any value between 0 and Images are made up of pixels. A pixel has a location identified by its row and column numbers. Each pixel has a color. - RGB represents a color with a red value, a green value and a blue value. Each of these values can range from 0 to 255. Black is 0, 0, 0. White is 255, 255, 255. Any color where the R, G, and B values are the same is a shade of gray. - A test function allows us to easily re-run functions we are writing without needing to do a lot of typing in the console. - We can compute the negative of a color by subtracting each RGB color component from 255 and using those values to create a new color. - We can convert an image to grayscale by averaging the red, green and blue values of each pixel. Luminance is another word we use for this average. - Chromakey is a technique used to record something or someone against a solid background, often bright green, so that the object or person can be separated from the background and copied cleanly into another image. - Sound is caused by changes in air pressure. A sound wave is a visual representation of these air pressure changes over time. - The amplitude of a sound wave is its height above or below a middle line. Amplitude affects the volume. - The frequency of a sound wave is how often the sound wave repeats in one second. Frequency determines pitch.

4 - Sound is recorded digitally by sampling it at fixed intervals and recording the values found. More frequent sampling generally results in higher quality sound. - Normalizing a sound changes the amplitude of a sound so that its highest amplitude is at the maximum value of 32, Notes are chorded by normalizing each and then averaging their values. - A sound wave that is a sine wave produces a "pure" note. The same pitch can be created with different shape sounds, like square waves, or less regular waves such as those that come from a musical instrument as long as the frequency is the same as that of the sound wave. Algorithmic approaches We have been working with some standard algorithmic approaches in the functions that we have been writing in class. Image algorithms When we want to treat all pixels in an image the same way for pixel in getpixels ( <picture> ) : <instructions to change the pixel> When we want to change a rectangular portion of a picture for row in range ( <top row>, <bottom row> ) : for col in range ( <left col>, <right col> ) : pixel = getpixel ( <picture>, col, row ) <instructions to change the pixel> When we want to create a new picture based on the contents of an existing picture <canvas> = makeemptypicture ( <width>, <height> ) for row in range ( <top row>, <bottom row> ) : for col in range ( <left col>, <right col> ) : <original pixel> = getpixel ( <picture>, col, row ) <calculate row & column to copy to on the canvas> <canvas pixel> = getpixel (<canvas>, <canvas col>, <canvas row> ) setcolor ( <canvas pixel>, getcolor ( <original pixel> ) ) return <canvas> When we want to treat pixels differently based on their original color, we use an ifstatement for p in getpixels (pic) : if <some condition is true> : setcolor (p, <some color> ) Testing We separate the loading of files and the displaying of images into a test function to keep the image manipulation function more reusable.

5 When the image manipulation function modifies the image in place, the test function generally follows this pattern def test<func> () : file = <file name> picture = makepicture (file) explore (picture) <image manipulation function> (picture) explore (picture) When the image manipulation function creates a new canvas, the test function generally follows this pattern def test<func> () : file = <file name> picture = makepicture (file) explore (picture) copy = <image manipulation function> (picture) explore (copy) Sound algorithms When we want to treat all samples in a sound the same way for sample in getsamples ( <sound> ) : <instructions to change the sample> When we want to change a sample based on its position for index in range ( <first position>, <last position> ) : sample = getsamplevalueat ( <sound>, index ) <instructions to change the sample> When we want to create a new sound based on the contents of an existing sound <new sound> = makeemptysound ( <number of samples> ) for index in range ( <first position>, <last position> ) : <original sample> = getsamplevalueat ( <sound>, index ) <calculate position to copy to in the new sound> <calculate new sample value> setsamplevalueat ( <new sound>, <new position>, <new value> ) return <new sound> Before combining sounds, we generally normalize the sounds so that they have the same relative volume. def normalize (sound): # Find the highest value in the sound highestvalue = 0 for sample in getsamples (sound): if getsamplevalue (sample) > highestvalue : highestvalue = getsamplevalue ( sample ) # Calculate the multiplier to maximize the highest value

6 multiplier = / highestvalue # Apply the multiplier to all the samples in the sound changevolume (sound, multiplier) To chord two notes, we first normalize the notes and then average their values def chord ( note1, note2 ) : # Normalize the notes normalize (note1) normalize (note2) # Create a new sound if getlength ( note1 ) < getlength (note2) : newlength = getlength (note1) else : newlength = getlength (note2) newsound = makeemptysound (newlength) # Walk over the 2 notes for index in range (newlength) : value1 = getsamplevalueat (note1, index) value2 = getsamplevalueat (note2, index) # Average their values and store that in the chorded sound setsamplevalueat (newsound, index, (value1 + value2) / 2) return newsound

Image Size vs. File Size. gif File Compression. 1 Review. Slides05 - Pixels.key - September 28, 2015

Image Size vs. File Size. gif File Compression. 1 Review. Slides05 - Pixels.key - September 28, 2015 1 Review What is a pixel? What is RGB? Image Size vs. File Size 857 2 1280 The Picture use 857 * 1280 * 3 bytes 3.3 MB (MB = megabytes = millions of bytes) of memory The jpeg file uses 201 KB (KB = kilobytes

More information

Objectives. Connecting with Computer Science 2

Objectives. Connecting with Computer Science 2 Objectives Learn why numbering systems are important to understand Refresh your knowledge of powers of numbers Learn how numbering systems are used to count Understand the significance of positional value

More information

Media Computation Module

Media Computation Module Media Computation Module Last Updated: May 4, 2011 1 Module Name Media Computation 2 Scope Media Computation is a new type of introductory Computer Science class created to provide a path for those interested

More information

Introduction to JES and Programming. Installation

Introduction to JES and Programming. Installation Introduction to JES and Programming Installation Installing JES and starting it up Windows users: Just copy the folder Double-click JES application Mac users: Just copy the folder Double-click the JES

More information

Why do computers store all information as binary numbers? (B) This requires no translation of data after it is entered by the user.

Why do computers store all information as binary numbers? (B) This requires no translation of data after it is entered by the user. Week2 Quizzes (Aug30- Sept1) L4 Quiz 1 Why do computers store all information as binary numbers? (A) This is easier to use than base 10 numbers. (B) This requires no translation of data after it is entered

More information

Introduction to Computer Science (I1100) Data Storage

Introduction to Computer Science (I1100) Data Storage Data Storage 145 Data types Data comes in different forms Data Numbers Text Audio Images Video 146 Data inside the computer All data types are transformed into a uniform representation when they are stored

More information

Announcements. Project 2 due next Monday. Next Tuesday is review session; Midterm 1 on Wed., EE 129, 8:00 9:30pm

Announcements. Project 2 due next Monday. Next Tuesday is review session; Midterm 1 on Wed., EE 129, 8:00 9:30pm Project 2 due next Monday Next Tuesday is review session; Announcements Midterm 1 on Wed., EE 129, 8:00 9:30pm Project 3 to be posted Oct. 3 (next Wed) Preparing for the Midterm: Review Chapters 3-6 of

More information

Chapter 2: Introduction to Programming

Chapter 2: Introduction to Programming Chapter 2: Introduction to Programming Chapter Learning Objectives Installation Installing JES and starting it up Go to http://www.mediacomputation.org and get the version of JES for your computer. If

More information

Chapter 2: Introduction to Programming

Chapter 2: Introduction to Programming Chapter 2: Introduction to Programming 1 Chapter Learning Objectives 2 Installation Installing JES and starting it up Go to http://www.mediacomputation.org and get the version of JES for your computer.

More information

Data Representation 1

Data Representation 1 1 Data Representation Outline Binary Numbers Adding Binary Numbers Negative Integers Other Operations with Binary Numbers Floating Point Numbers Character Representation Image Representation Sound Representation

More information

Introduction to Computer Science. Course Goals. Python. Slides02 - Intro to Python.key - September 15, 2015

Introduction to Computer Science. Course Goals. Python. Slides02 - Intro to Python.key - September 15, 2015 Introduction to Computer Science Barbara Lerner (blerner@mtholyoke.edu) https://www.mtholyoke.edu/~blerner/cs100/ 1 Office Clapp 227, x3250 Mon 1-2 Tues 4-5 Wed. 11-12 Thurs 3:30-4:30 or by appointment

More information

CHAPTER 2 - DIGITAL DATA REPRESENTATION AND NUMBERING SYSTEMS

CHAPTER 2 - DIGITAL DATA REPRESENTATION AND NUMBERING SYSTEMS CHAPTER 2 - DIGITAL DATA REPRESENTATION AND NUMBERING SYSTEMS INTRODUCTION Digital computers use sequences of binary digits (bits) to represent numbers, letters, special symbols, music, pictures, and videos.

More information

CS 1124 Media Computation. Steve Harrison Lecture 4.2 (September 18, 2008)

CS 1124 Media Computation. Steve Harrison Lecture 4.2 (September 18, 2008) CS 1124 Media Computation Steve Harrison Lecture 4.2 (September 18, 2008) Today... Moving to chapter 5... HW 4 Group project 2 Today How can we merge pictures? Blending pictures together blend 1 mix two

More information

An Introduction to Processing

An Introduction to Processing An Introduction to Processing Creating static drawings Produced by: Mairead Meagher Dr. Siobhán Drohan Department of Computing and Mathematics http://www.wit.ie/ Topics list Coordinate System in Computing.

More information

CS 107 Practice Final Exam Spring Instructions: closed books, closed notes, open minds, 2 hour time limit. There are 4 sections.

CS 107 Practice Final Exam Spring Instructions: closed books, closed notes, open minds, 2 hour time limit. There are 4 sections. Name CS 107 Practice Final Exam Spring 2016 Instructions: closed books, closed notes, open minds, 2 hour time limit. There are 4 sections. Part I: Definitions and Theory Part II: Binary, Logic, and Gates

More information

CISC 1600 Lecture 3.1 Introduction to Processing

CISC 1600 Lecture 3.1 Introduction to Processing CISC 1600 Lecture 3.1 Introduction to Processing Topics: Example sketches Drawing functions in Processing Colors in Processing General Processing syntax Processing is for sketching Designed to allow artists

More information

CS 1124 Media computation. Lecture 9.1, October 20, 2008 Steve Harrison

CS 1124 Media computation. Lecture 9.1, October 20, 2008 Steve Harrison CS 1124 Media computation Lecture 9.1, October 20, 2008 Steve Harrison Where were we? Backwards (in 3 ways) Strings Where were we? Backwards (in 3 ways) Strings Backwards (1) Reverse the samples: recipe

More information

Binary representation and data

Binary representation and data Binary representation and data Loriano Storchi loriano@storchi.org http:://www.storchi.org/ Binary representation of numbers In a positional numbering system given the base this directly defines the number

More information

CS 101 Representing Information. Lecture 5

CS 101 Representing Information. Lecture 5 CS 101 Representing Information Lecture 5 1 Representing Information Computers are capable of storing, transmitting, and displaying information For example, Text files, Word documents, JPEG videos, MOV

More information

Data Representation From 0s and 1s to images CPSC 101

Data Representation From 0s and 1s to images CPSC 101 Data Representation From 0s and 1s to images CPSC 101 Learning Goals After the Data Representation: Images unit, you will be able to: Recognize and translate between binary and decimal numbers Define bit,

More information

CS 1124 Media Computation Lecture 2.2. Steve Harrison September 3, 2008

CS 1124 Media Computation Lecture 2.2. Steve Harrison September 3, 2008 CS 1124 Media Computation Lecture 2.2 Steve Harrison September 3, 2008 1 Much of programming is about naming We name our data Data: The numbers we manipulate We call our names for data variables We name

More information

GCSE Computing. Revision Pack TWO. Data Representation Questions. Name: /113. Attempt One % Attempt Two % Attempt Three %

GCSE Computing. Revision Pack TWO. Data Representation Questions. Name: /113. Attempt One % Attempt Two % Attempt Three % GCSE Computing Revision Pack TWO Data Representation Questions Name: /113 Attempt One % Attempt Two % Attempt Three % Areas of Strength Areas for Development 1. Explain how ASCII is used to represent text

More information

2nd Paragraph should make a point (could be an advantage or disadvantage) and explain the point fully giving an example where necessary.

2nd Paragraph should make a point (could be an advantage or disadvantage) and explain the point fully giving an example where necessary. STUDENT TEACHER WORKING AT GRADE TERM TARGET CLASS YEAR TARGET The long answer questions in this booklet are designed to stretch and challenge you. It is important that you understand how they should be

More information

CMPSCI 119 Fall 2018 Wednesday, November 14, 2018 Midterm #2 Solution Key Professor William T. Verts

CMPSCI 119 Fall 2018 Wednesday, November 14, 2018 Midterm #2 Solution Key Professor William T. Verts CMPSCI 119 Fall 2018 Wednesday, November 14, 2018 Midterm #2 Solution Key Professor William T. Verts 25 Points What is the value of each expression below? Answer any 25; answer more for extra credit.

More information

Metamorphosis of Information. Chapter 2: Metamorphosis of Information. What is Information? What is Information? Chapter 2. The Computer Continuum 1

Metamorphosis of Information. Chapter 2: Metamorphosis of Information. What is Information? What is Information? Chapter 2. The Computer Continuum 1 Chapter : Metamorphosis of Information How does the computer store information? Metamorphosis of Information! In this lecture: What are the common types of information that can be manipulated by the computer?

More information

TOPIC 10 THE IF STATEMENT. Making Decisions. Making Decisions. If Statement Syntax. If Statement

TOPIC 10 THE IF STATEMENT. Making Decisions. Making Decisions. If Statement Syntax. If Statement 1 Outline 2 2 TOPIC 10 THE IF STATEMENT How to use conditionals Picture manipulation using conditionals: Edge detection Sepia toning Chromakey (Blue-screening) Notes adapted from Introduction to Computing

More information

TOPIC 10 THE IF STATEMENT

TOPIC 10 THE IF STATEMENT 1 TOPIC 10 THE IF STATEMENT Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach by M. Guzdial and B. Ericson, and instructor materials prepared by B. Ericson.

More information

255, 255, 0 0, 255, 255 XHTML:

255, 255, 0 0, 255, 255 XHTML: Colour Concepts How Colours are Displayed FIG-5.1 Have you looked closely at your television screen recently? It's in full colour, showing every colour and shade that your eye is capable of seeing. And

More information

Lecture 1: What is a computer?

Lecture 1: What is a computer? 02-201, Fall 2015, Carl Kingsford Lecture 1: What is a computer? 0. Today's Topics Basic computer architecture How the computer represents data 1. What is a computer? A modern computer is a collection

More information

CpSc 101, Fall 2015 Lab7: Image File Creation

CpSc 101, Fall 2015 Lab7: Image File Creation CpSc 101, Fall 2015 Lab7: Image File Creation Goals Construct a C language program that will produce images of the flags of Poland, Netherland, and Italy. Image files Images (e.g. digital photos) consist

More information

Bits, bytes, binary numbers, and the representation of information

Bits, bytes, binary numbers, and the representation of information Bits, bytes, binary numbers, and the representation of information computers represent, process, store, copy, and transmit everything as numbers hence "digital computer" the numbers can represent anything

More information

Digital Media. Daniel Fuller ITEC 2110

Digital Media. Daniel Fuller ITEC 2110 Digital Media Daniel Fuller ITEC 2110 Daily Question: Which statement is True? 5 + 5 = 10 1 + 1 = 10 F + 1 = 10 Email answer to DFullerDailyQuestion@gmail.com Subject Line: ITEC2110-26 First, some mac

More information

To start, open or build a simple solid model. The bracket from a previous exercise will be used for demonstration purposes.

To start, open or build a simple solid model. The bracket from a previous exercise will be used for demonstration purposes. Render, Lights, and Shadows The Render programs are techniques using surface shading, surface tones, and surface materials that are then presented in a scene with options for lights and shadows. Modifications

More information

Introduction to Programming with JES

Introduction to Programming with JES Introduction to Programming with JES Titus Winters & Josef Spjut October 6, 2005 1 Introduction First off, welcome to UCR, and congratulations on becoming a Computer Engineering major. Excellent choice.

More information

Creating a Java class with a main method

Creating a Java class with a main method Creating a Java class with a main method The purpose of this exercise is to ensure you can code your own Java application class. This type of class used here is special in the sense that it has a main

More information

Data encoding. Lauri Võsandi

Data encoding. Lauri Võsandi Data encoding Lauri Võsandi Binary data Binary can represent Letters of alphabet, plain-text files Integers, floating-point numbers (of finite precision) Pixels, images, video Audio samples Could be stored

More information

Data Storage. Slides derived from those available on the web site of the book: Computer Science: An Overview, 11 th Edition, by J.

Data Storage. Slides derived from those available on the web site of the book: Computer Science: An Overview, 11 th Edition, by J. Data Storage Slides derived from those available on the web site of the book: Computer Science: An Overview, 11 th Edition, by J. Glenn Brookshear Copyright 2012 Pearson Education, Inc. Data Storage Bits

More information

Next Generation Intelligent LCDs

Next Generation Intelligent LCDs Next Generation Intelligent LCDs 2D Run-Length Encoding Application Note Version 1.0 Document Date: April 30, 2013 Copyright by demmel products gmbh 2004-2013 Unless otherwise noted, all materials contained

More information

CSE 8A Lecture 13. Reading for next class: Today s topics: Finish PSA 6: Chromakey! DUE TUESDAY Interm exam 3 next Friday. Sounds!

CSE 8A Lecture 13. Reading for next class: Today s topics: Finish PSA 6: Chromakey! DUE TUESDAY Interm exam 3 next Friday. Sounds! CSE 8A Lecture 13 Reading for next class: 8.4-8.5 Today s topics: Sounds! Finish PSA 6: Chromakey! DUE TUESDAY Interm exam 3 next Friday CSE 8a Exam #3 Study Hints 1) Reading Quizzes (2/4-2/15) Omit 2/6/13

More information

CS 177 Fall 2010 Final Exam

CS 177 Fall 2010 Final Exam There are 50 single choice questions. Each one is worth 4 points. The total score for the exam is 200 points. Answer the questions on the bubble sheet given. Fill in the Instructor, Course, Signature,

More information

Your Name: Your TA's Name: 1 / 10 CS 1301 CS1 with Robots Fall 2008 Exam 3

Your Name: Your TA's Name: 1 / 10 CS 1301 CS1 with Robots Fall 2008 Exam 3 1 / 10 CS 1301 CS1 with Robots Fall 2008 Exam 3 This test has ten (10) problems on Nine (9) pages. Some problems have multiple parts. Problem Score Possible Points 1. Vocabulary 15 2. Fill in the Blank

More information

MCS 2514 Fall 2012 Programming Assignment 3 Image Processing Pointers, Class & Dynamic Data Due: Nov 25, 11:59 pm.

MCS 2514 Fall 2012 Programming Assignment 3 Image Processing Pointers, Class & Dynamic Data Due: Nov 25, 11:59 pm. MCS 2514 Fall 2012 Programming Assignment 3 Image Processing Pointers, Class & Dynamic Data Due: Nov 25, 11:59 pm. This project is called Image Processing which will shrink an input image, convert a color

More information

Chapter 1. Data Storage Pearson Addison-Wesley. All rights reserved

Chapter 1. Data Storage Pearson Addison-Wesley. All rights reserved Chapter 1 Data Storage 2007 Pearson Addison-Wesley. All rights reserved Chapter 1: Data Storage 1.1 Bits and Their Storage 1.2 Main Memory 1.3 Mass Storage 1.4 Representing Information as Bit Patterns

More information

[301] Bits and Memory. Tyler Caraza-Harter

[301] Bits and Memory. Tyler Caraza-Harter [301] Bits and Memory Tyler Caraza-Harter Ones and Zeros 01111111110101011000110010011011000010010001100110101101 01000101110110000000110011101011101111000110101010010011 00011000100110001010111010110001010011101000100110100000

More information

15110 PRINCIPLES OF COMPUTING SAMPLE EXAM 2

15110 PRINCIPLES OF COMPUTING SAMPLE EXAM 2 15110 PRINCIPLES OF COMPUTING SAMPLE EXAM 2 Name Section Directions: Answer each question neatly in the space provided. Please read each question carefully. You have 50 minutes for this exam. No electronic

More information

Languages. Solve problems using a computer, give the computer instructions. Remember our diaper-changing exercise?

Languages. Solve problems using a computer, give the computer instructions. Remember our diaper-changing exercise? Languages Solve problems using a computer, give the computer instructions. Remember our diaper-changing exercise? Talk the talk Speak its language High-level: Python, C++, Java Low-level: machine language,

More information

3 Data Storage 3.1. Foundations of Computer Science Cengage Learning

3 Data Storage 3.1. Foundations of Computer Science Cengage Learning 3 Data Storage 3.1 Foundations of Computer Science Cengage Learning Objectives After studying this chapter, the student should be able to: List five different data types used in a computer. Describe how

More information

Flying Start AS Computer Science. September 2015

Flying Start AS Computer Science. September 2015 Flying Start AS Computer Science September 2015 Name: To your first AS Computing lesson, you will need to bring: 1. A folder with dividers An A4 ring binder with labelled A4 dividers would be ideal. The

More information

The Warhol Language Reference Manual

The Warhol Language Reference Manual The Warhol Language Reference Manual Martina Atabong maa2247 Charvinia Neblett cdn2118 Samuel Nnodim son2105 Catherine Wes ciw2109 Sarina Xie sx2166 Introduction Warhol is a functional and imperative programming

More information

Color and Shading. Color. Shapiro and Stockman, Chapter 6. Color and Machine Vision. Color and Perception

Color and Shading. Color. Shapiro and Stockman, Chapter 6. Color and Machine Vision. Color and Perception Color and Shading Color Shapiro and Stockman, Chapter 6 Color is an important factor for for human perception for object and material identification, even time of day. Color perception depends upon both

More information

Introduction to Flash - Creating a Motion Tween

Introduction to Flash - Creating a Motion Tween Introduction to Flash - Creating a Motion Tween This tutorial will show you how to create basic motion with Flash, referred to as a motion tween. Download the files to see working examples or start by

More information

Bits and Bit Patterns

Bits and Bit Patterns Bits and Bit Patterns Bit: Binary Digit (0 or 1) Bit Patterns are used to represent information. Numbers Text characters Images Sound And others 0-1 Boolean Operations Boolean Operation: An operation that

More information

Elementary Computing CSC 100. M. Cheng, Computer Science

Elementary Computing CSC 100. M. Cheng, Computer Science Elementary Computing CSC 100 1 Graphics & Media Scalable Outline & Bit- mapped Fonts Binary Number Representation & Text Pixels, Colors and Resolution Sound & Digital Audio Film & Digital Video Data Compression

More information

Final Study Guide Arts & Communications

Final Study Guide Arts & Communications Final Study Guide Arts & Communications Programs Used in Multimedia Developing a multimedia production requires an array of software to create, edit, and combine text, sounds, and images. Elements of Multimedia

More information

8/31/2015 BITS BYTES AND FILES. What is a bit. Representing a number. Technically, it s a change of voltage

8/31/2015 BITS BYTES AND FILES. What is a bit. Representing a number. Technically, it s a change of voltage Personal Computing BITS BYTES AND FILES What is a bit Technically, it s a change of voltage Two stable states of a flip-flop Positions of an electrical switch That s for the EE folks It s a zero or a one

More information

CS101 Lecture 12: Image Compression. What You ll Learn Today

CS101 Lecture 12: Image Compression. What You ll Learn Today CS101 Lecture 12: Image Compression Vector Graphics Compression Techniques Aaron Stevens (azs@bu.edu) 11 October 2012 What You ll Learn Today Review: how big are image files? How can we make image files

More information

The pixelman Language Reference Manual. Anthony Chan, Teresa Choe, Gabriel Kramer-Garcia, Brian Tsau

The pixelman Language Reference Manual. Anthony Chan, Teresa Choe, Gabriel Kramer-Garcia, Brian Tsau The pixelman Language Reference Manual Anthony Chan, Teresa Choe, Gabriel Kramer-Garcia, Brian Tsau October 2017 Contents 1 Introduction 2 2 Lexical Conventions 2 2.1 Comments..........................................

More information

IMAGE COMPRESSION USING FOURIER TRANSFORMS

IMAGE COMPRESSION USING FOURIER TRANSFORMS IMAGE COMPRESSION USING FOURIER TRANSFORMS Kevin Cherry May 2, 2008 Math 4325 Compression is a technique for storing files in less space than would normally be required. This in general, has two major

More information

计算原理导论. Introduction to Computing Principles 智能与计算学部刘志磊

计算原理导论. Introduction to Computing Principles 智能与计算学部刘志磊 计算原理导论 Introduction to Computing Principles 天津大学 智能与计算学部刘志磊 Analog The world is basically analog What does that mean? "Signal" is a varying wave over time e.g. sound as a running example here How Does

More information

CS 315 Software Design Homework 1 First Sip of Java Due: Sept. 10, 11:30 PM

CS 315 Software Design Homework 1 First Sip of Java Due: Sept. 10, 11:30 PM CS 315 Software Design Homework 1 First Sip of Java Due: Sept. 10, 11:30 PM Objectives The objectives of this assignment are: to get your first experience with Java to become familiar with Eclipse Java

More information

User Guide Belltech Systems, LLC

User Guide Belltech Systems, LLC User Guide Belltech Systems, LLC http://www.belltechsystems.com May, 2006 1. Introducing Belltech CaptureXT 2. Installation and Uninstallation Installation Running the Application Uninstallation 3. User

More information

Midterm Exam 2B Answer key

Midterm Exam 2B Answer key Midterm Exam 2B Answer key 15110 Principles of Computing Fall 2015 April 6, 2015 Name: Andrew ID: Lab section: Instructions Answer each question neatly in the space provided. There are 6 questions totaling

More information

Jianhui Zhang, Ph.D., Associate Prof. College of Computer Science and Technology, Hangzhou Dianzi Univ.

Jianhui Zhang, Ph.D., Associate Prof. College of Computer Science and Technology, Hangzhou Dianzi Univ. Jianhui Zhang, Ph.D., Associate Prof. College of Computer Science and Technology, Hangzhou Dianzi Univ. Email: jh_zhang@hdu.edu.cn Copyright 2015 Pearson Education, Inc. Chapter 1: Data Storage Computer

More information

Standard File Formats

Standard File Formats Standard File Formats Introduction:... 2 Text: TXT and RTF... 4 Grapics: BMP, GIF, JPG and PNG... 5 Audio: WAV and MP3... 8 Video: AVI and MPG... 11 Page 1 Introduction You can store many different types

More information

Programming for Non-Programmers

Programming for Non-Programmers Programming for Non-Programmers Python Chapter 2 Source: Dilbert Agenda 6:00pm Lesson Begins 6:15pm First Pillow example up and running 6:30pm First class built 6:45pm Food & Challenge Problem 7:15pm Wrap

More information

Example 1: Denary = 1. Answer: Binary = (1 * 1) = 1. Example 2: Denary = 3. Answer: Binary = (1 * 1) + (2 * 1) = 3

Example 1: Denary = 1. Answer: Binary = (1 * 1) = 1. Example 2: Denary = 3. Answer: Binary = (1 * 1) + (2 * 1) = 3 1.1.1 Binary systems In mathematics and digital electronics, a binary number is a number expressed in the binary numeral system, or base-2 numeral system, which represents numeric values using two different

More information

Topics. Hardware and Software. Introduction. Main Memory. The CPU 9/21/2014. Introduction to Computers and Programming

Topics. Hardware and Software. Introduction. Main Memory. The CPU 9/21/2014. Introduction to Computers and Programming Topics C H A P T E R 1 Introduction to Computers and Programming Introduction Hardware and Software How Computers Store Data Using Python Introduction Computers can be programmed Designed to do any job

More information

Compression. storage medium/ communications network. For the purpose of this lecture, we observe the following constraints:

Compression. storage medium/ communications network. For the purpose of this lecture, we observe the following constraints: CS231 Algorithms Handout # 31 Prof. Lyn Turbak November 20, 2001 Wellesley College Compression The Big Picture We want to be able to store and retrieve data, as well as communicate it with others. In general,

More information

Numbers and their bases

Numbers and their bases Numbers and their bases Information on computers are all represented as numbers. For example, ord( a ) == 97, ord( + ) == 43 (See ASCII table). All audio, video, and photos are represented as numbers.

More information

How to Make a Poster Using PowerPoint

How to Make a Poster Using PowerPoint How to Make a Poster Using PowerPoint 1997 2010 Start PowerPoint: Make a New presentation a blank one. When asked for a Layout, choose a blank one one without anything even a title. Choose the Size of

More information

CS1114: Matlab Introduction

CS1114: Matlab Introduction CS1114: Matlab Introduction 1 Introduction The purpose of this introduction is to provide you a brief introduction to the features of Matlab that will be most relevant to your work in this course. Even

More information

Sketchpad Graphics Language Reference Manual. Zhongyu Wang, zw2259 Yichen Liu, yl2904 Yan Peng, yp2321

Sketchpad Graphics Language Reference Manual. Zhongyu Wang, zw2259 Yichen Liu, yl2904 Yan Peng, yp2321 Sketchpad Graphics Language Reference Manual Zhongyu Wang, zw2259 Yichen Liu, yl2904 Yan Peng, yp2321 October 20, 2013 1. Introduction This manual provides reference information for using the SKL (Sketchpad

More information

CS 315 Data Structures Fall Figure 1

CS 315 Data Structures Fall Figure 1 CS 315 Data Structures Fall 2012 Lab # 3 Image synthesis with EasyBMP Due: Sept 18, 2012 (by 23:55 PM) EasyBMP is a simple c++ package created with the following goals: easy inclusion in C++ projects,

More information

XPM 2D Transformations Week 2, Lecture 3

XPM 2D Transformations Week 2, Lecture 3 CS 430/585 Computer Graphics I XPM 2D Transformations Week 2, Lecture 3 David Breen, William Regli and Maxim Peysakhov Geometric and Intelligent Computing Laboratory Department of Computer Science Drexel

More information

Unicode. Standard Alphanumeric Formats. Unicode Version 2.1 BCD ASCII EBCDIC

Unicode. Standard Alphanumeric Formats. Unicode Version 2.1 BCD ASCII EBCDIC Standard Alphanumeric Formats Unicode BCD ASCII EBCDIC Unicode Next slides 16-bit standard Developed by a consortia Intended to supercede older 7- and 8-bit codes Unicode Version 2.1 1998 Improves on version

More information

Exploring Microsoft Office Word 2007

Exploring Microsoft Office Word 2007 Exploring Microsoft Office Word 2007 Chapter 3: Enhancing a Document Robert Grauer, Keith Mulbery, Michelle Hulett Objectives Insert a table Format a table Sort and apply formulas to table data Convert

More information

CS 1301 Final Exam Review Guide

CS 1301 Final Exam Review Guide CS 1301 Final Exam Review Guide A. Programming and Algorithm 1. Binary, Octal-decimal, Decimal, and Hexadecimal conversion Definition Binary (base 2): 10011 = 1*2 4 + 0*2 3 + 0*2 2 + 1*2 1 + 1*2 0 Octal-decimal

More information

PREPARING FOR PRELIM 1

PREPARING FOR PRELIM 1 PREPARING FOR PRELIM 1 CS 1110: FALL 2012 This handout explains what you have to know for the first prelim. There will be a review session with detailed examples to help you study. To prepare for the prelim,

More information

Ordinary Differential Equation Solver Language (ODESL) Reference Manual

Ordinary Differential Equation Solver Language (ODESL) Reference Manual Ordinary Differential Equation Solver Language (ODESL) Reference Manual Rui Chen 11/03/2010 1. Introduction ODESL is a computer language specifically designed to solve ordinary differential equations (ODE

More information

Lab 7: Python Loops and Images 1

Lab 7: Python Loops and Images 1 Lab 7: Python Loops and Images 1 Objectives to use while loops and for loops to further explore image and pixel features to further understand and practice using parameters in functions Copy the Lab 7

More information

Part 1 Change Color Effects, like Black & White

Part 1 Change Color Effects, like Black & White Part 1 Change Color Effects, like Black & White First, I will show you Black & White. After that, I will show you other effects. Next, open PicPick. As I mentoned before, if you don t have PicPick, hover

More information

XPM 2D Transformations Week 2, Lecture 3

XPM 2D Transformations Week 2, Lecture 3 CS 430/585 Computer Graphics I XPM 2D Transformations Week 2, Lecture 3 David Breen, William Regli and Maxim Peysakhov Geometric and Intelligent Computing Laboratory Department of Computer Science Drexel

More information

\n is used in a string to indicate the newline character. An expression produces data. The simplest expression

\n is used in a string to indicate the newline character. An expression produces data. The simplest expression Chapter 1 Summary Comments are indicated by a hash sign # (also known as the pound or number sign). Text to the right of the hash sign is ignored. (But, hash loses its special meaning if it is part of

More information

SMURF Language Reference Manual Serial MUsic Represented as Functions

SMURF Language Reference Manual Serial MUsic Represented as Functions SMURF Language Reference Manual Serial MUsic Represented as Functions Richard Townsend, Lianne Lairmore, Lindsay Neubauer, Van Bui, Kuangya Zhai {rt2515, lel2143, lan2135, vb2363, kz2219}@columbia.edu

More information

egrapher Language Reference Manual

egrapher Language Reference Manual egrapher Language Reference Manual Long Long: ll3078@columbia.edu Xinli Jia: xj2191@columbia.edu Jiefu Ying: jy2799@columbia.edu Linnan Wang: lw2645@columbia.edu Darren Chen: dsc2155@columbia.edu 1. Introduction

More information

Turtle Tango (TT) Language Reference Manual

Turtle Tango (TT) Language Reference Manual Turtle Tango (TT) Language Reference Manual Jeff Bender UNI: jrb2211 COMS W4115 6/29/2012 Contents 1. Introduction... 3 2. Lexical Conventions... 3 3. Scope... 3 4. Statements... 4 5. Expressions... 5

More information

Teaching KS3 Computing. Session 3 Theory: More on binary and representing text Practical: Introducing IF

Teaching KS3 Computing. Session 3 Theory: More on binary and representing text Practical: Introducing IF Teaching KS3 Computing Session 3 Theory: More on binary and representing text Practical: Introducing IF Today s session 5:00 6:00 Representing text as numbers characters and the computer 6.00 7.00 Programming

More information

Here is a sample IDLE window illustrating the use of these two functions:

Here is a sample IDLE window illustrating the use of these two functions: 1 A SLIGHT DETOUR: RANDOM WALKS One way you can do interesting things with a program is to introduce some randomness into the mix. Python, and most programming languages, typically provide a library for

More information

COMP-202: Foundations of Programming. Lecture 26: Image Manipulation; Wrap-Up Jackie Cheung, Winter 2015

COMP-202: Foundations of Programming. Lecture 26: Image Manipulation; Wrap-Up Jackie Cheung, Winter 2015 COMP-202: Foundations of Programming Lecture 26: Image Manipulation; Wrap-Up Jackie Cheung, Winter 2015 Announcements Assignment 6 due Tue Apr 14 at 11:59pm Final is scheduled for Apr 29, 6pm 9pm Please

More information

BCC Rays Ripply Filter

BCC Rays Ripply Filter BCC Rays Ripply Filter The BCC Rays Ripply filter combines a light rays effect with a rippled light effect. The resulting light is generated from a selected channel in the source image and spreads from

More information

Using Microsoft Word. Working With Objects

Using Microsoft Word. Working With Objects Using Microsoft Word Many Word documents will require elements that were created in programs other than Word, such as the picture to the right. Nontext elements in a document are referred to as Objects

More information

CS Lab 8. Part 1 - Basics of File I/O

CS Lab 8. Part 1 - Basics of File I/O CS 105 - Lab 8 Today, you will be doing a lot with files! We will start with the basics of reading and writing and then expand upon the pixel value work that you did in a previous lab by working on image

More information

Midterm Review. October 17

Midterm Review. October 17 Midterm Review October 17 Midterm Layout Some multiple choice, matching, true/false Not much though Will mostly be short answer You will have to write/edit/sketch some HTML You will have to write/edit/sketch

More information

8/16/12. Computer Organization. Architecture. Computer Organization. Computer Basics

8/16/12. Computer Organization. Architecture. Computer Organization. Computer Basics Computer Organization Computer Basics TOPICS Computer Organization Data Representation Program Execution Computer Languages 1 2 Architecture Computer Organization n central-processing unit n performs the

More information

Unit 2 Digital Information. Chapter 1 Study Guide

Unit 2 Digital Information. Chapter 1 Study Guide Unit 2 Digital Information Chapter 1 Study Guide 2.5 Wrap Up Other file formats Other file formats you may have encountered or heard of include:.doc,.docx,.pdf,.mp4,.mov The file extension you often see

More information

Colour and Number Representation. From Hex to Binary and Back. Colour and Number Representation. Colour and Number Representation

Colour and Number Representation. From Hex to Binary and Back. Colour and Number Representation. Colour and Number Representation Colour and Number Representation From Hex to Binary and Back summary: colour representation easy: replace each hexadecimal "digit" with the corresponding four binary digits using the conversion table examples:

More information

Microsoft Office Word 2010

Microsoft Office Word 2010 Microsoft Office Word 2010 Inserting and Working with Pictures (Images) 1. Images in your work An image is a great way to liven up a document, but in academic uses is normally only included where something

More information

CS1114: Matlab Introduction

CS1114: Matlab Introduction CS1114: Matlab Introduction 1 Introduction The purpose of this introduction is to provide you a brief introduction to the features of Matlab that will be most relevant to your work in this course. Even

More information

Software and Hardware

Software and Hardware Software and Hardware Numbers At the most fundamental level, a computer manipulates electricity according to specific rules To make those rules produce something useful, we need to associate the electrical

More information

CS 177 Fall 2010 Exam II

CS 177 Fall 2010 Exam II There are 25 single choice questions. Each one is worth 4 points. The total score for the exam is 100. Answer the questions on the bubble sheet given. Fill in the Instructor, Course, Signature, Test, and

More information