MPATE-GE 2618: C Programming for Music Technology. Unit 1.1



Similar documents
Command Line - Part 1

Command Line Crash Course For Unix

CS 253: Intro to Systems Programming

Introduction to Linux and Cluster Basics for the CCR General Computing Cluster

CS 103 Lab Linux and Virtual Machines

Lab 1: Introduction to C, ASCII ART and the Linux Command Line Environment

Tutorial 0A Programming on the command line

1 Basic commands. 2 Terminology. CS61B, Fall 2009 Simple UNIX Commands P. N. Hilfinger

Lab 1 Beginning C Program

CS 3530 Operating Systems. L02 OS Intro Part 1 Dr. Ken Hoganson

Unix Sampler. PEOPLE whoami id who

Programming for GCSE Topic H: Operating Systems

Running your first Linux Program

Lecture 27 C and Assembly

Linux command line. An introduction to the Linux command line for genomics. Susan Fairley

TNM093 Practical Data Visualization and Virtual Reality Laboratory Platform

LECTURE-7. Introduction to DOS. Introduction to UNIX/LINUX OS. Introduction to Windows. Topics:

CSIL MiniCourses. Introduction To Unix (I) John Lekberg Sean Hogan Cannon Matthews Graham Smith. Updated on:

CP Lab 2: Writing programs for simple arithmetic problems

An Introduction to the Linux Command Shell For Beginners

File Manager User Guide

Command-Line Operations : The Shell. Don't fear the command line...

Thirty Useful Unix Commands

Ubuntu, FEAP, and Virtualiza3on. Jonathan Wong Lab Mee3ng 11/08/10

ICS 351: Today's plan

An Introduction to Using the Command Line Interface (CLI) to Work with Files and Directories

Outline. hardware components programming environments. installing Python executing Python code. decimal and binary notations running Sage

New Lab Intro to KDE Terminal Konsole

Birmingham Environment for Academic Research. Introduction to Linux Quick Reference Guide. Research Computing Team V1.0

University of Toronto

Kernel. What is an Operating System? Systems Software and Application Software. The core of an OS is called kernel, which. Module 9: Operating Systems

Unix the Bare Minimum

CS 2112 Lab: Version Control

Example of Standard API

Beyond Windows: Using the Linux Servers and the Grid

QUICK START BASIC LINUX AND G++ COMMANDS. Prepared By: Pn. Azura Bt Ishak

Software. Programming Language. Software. Instructor Özgür ZEYDAN. Bülent Ecevit University Department of Environmental Engineering

Linux Labs: mini survival guide

Tutorial Guide to the IS Unix Service

CMSC 216 UNIX tutorial Fall 2010

Unix Guide. Logo Reproduction. School of Computing & Information Systems. Colours red and black on white backgroun

Linux Overview. Local facilities. Linux commands. The vi (gvim) editor

USEFUL UNIX COMMANDS

Cisco Networking Academy Program Curriculum Scope & Sequence. Fundamentals of UNIX version 2.0 (July, 2002)

Introduction to the UNIX Operating System and Open Windows Desktop Environment

Syntax: cd <Path> Or cd $<Custom/Standard Top Name>_TOP (In CAPS)

Lecture 7: Machine-Level Programming I: Basics Mohamed Zahran (aka Z)

Installing Java. Table of contents

Installing C++ compiler for CSc212 Data Structures

Open Source Computational Fluid Dynamics

Opening a Command Shell

Hadoop Shell Commands

Tutorial: Using WestGrid. Drew Leske Compute Canada/WestGrid Site Lead University of Victoria

Hadoop Shell Commands

Code::Block manual. for CS101x course. Department of Computer Science and Engineering Indian Institute of Technology - Bombay Mumbai

The Linux Operating System and Linux-Related Issues

Fred Hantelmann LINUX. Start-up Guide. A self-contained introduction. With 57 Figures. Springer

OPERATING SYSTEM SERVICES

UNIX - FILE SYSTEM BASICS

Programming from the Ground Up

File System Shell Guide

Setting up Radmind For an OSX Public Lab

Simple C Programs. Goals for this Lecture. Help you learn about:

CS3600 SYSTEMS AND NETWORKS

Introduction to Mac OS X

Version Control with Subversion and Xcode

TEL2821/IS2150: INTRODUCTION TO SECURITY Lab: Operating Systems and Access Control

L01 Introduction to the Unix OS

Basic Hadoop Programming Skills

ELEC 377. Operating Systems. Week 1 Class 3

For a 64-bit system. I - Presentation Of The Shellcode

Basic C Shell. helpdesk@stat.rice.edu. 11th August 2003

Chapter 2 Text Processing with the Command Line Interface

A Crash Course on UNIX

RECOVER ( 8 ) Maintenance Procedures RECOVER ( 8 )

The Basics of FTP. Basic Order of Operations: Commands: FTP (File Transfer Protocol) allows a user to transfer files to/from a remote network site.

Beginners Shell Scripting for Batch Jobs

Operating System Structure

Programming from the Ground Up

Extreme computing lab exercises Session one

Introduction to Running Hadoop on the High Performance Clusters at the Center for Computational Research

How To Run Linux On Windows 7 (For A Non-Privileged User) On A Windows 7 Computer (For Non-Patty) On Your Computer (Windows) On An Unix Computer (Unix) On Windows) On The Same

Creating a Java application using Perfect Developer and the Java Develo...

Step By Step Guide for Starting "Hello, World!" on OpenWRT

Introduction to Unix Tutorial

HDFS File System Shell Guide

Introduction to Linux operating system. module Basic Bioinformatics PBF

CS2510 Computer Operating Systems Hadoop Examples Guide

Objectives. Chapter 2: Operating-System Structures. Operating System Services (Cont.) Operating System Services. Operating System Services (Cont.

CPSC 226 Lab Nine Fall 2015

A GENERIC PURPOSE, CROSS-PLATFORM, HIGH EXTENSIBLE VIRTUAL MACHINE. John Vlachoyiannis

Introduction to Operating Systems

Automated Offsite Backup with rdiff-backup

Extreme computing lab exercises Session one

Lesson 06: Basics of Software Development (W02D2

FTP: Transferring Files to and from Home and UCS

Code Estimation Tools Directions for a Services Engagement

Transcription:

MPATE-GE 2618: C Programming for Music Technology Unit 1.1

What is an algorithm? An algorithm is a precise, unambiguous procedure for producing certain results (outputs) from given data (inputs). It is a method for accomplishing a task or solving a problem.

Goals Learn to develop algorithms Learn to decompose problems into smaller, solvable parts in an efficient way. Learn about data structures. Learn to express algorithms in C (programming). Learn how to program audio applications.

Organization & Introduction Today s outline Course organization Introduction to data representation, C, and Unix Course website: http://www.nyu.edu/projects/farbood/2618 Problem sets Plan on problem sets averaging 10-15 hours per week, possibly more Four types of problems in assignments: Programming (coding) Developing algorithms (design) Reading code Using tools Assessment: Lecture Best 6 out of 7 problem sets 65% Best 2 out of 3 quizzes 20% Final project 15 % Assessment: Lab Attendance 30% Problem set average (best 6 out of 7) = 70%

Office hours Instructor email: mfarbood@nyu.edu TA: Oriol (Uri) Nieto: onc202@nyu.edu Office hours: Tuesday, 10am-12pm, Education building, Rm. 630 ursday, 11am-1pm, Education building, Rm. 624 Office hours start next week Please email both instructor and TA whenever you have any question.

Problem sets and platforms Assignments were developed with a Unix-based system in mind, in particular Mac OS X, because most music technology students prefer to use Macs. However, all assignments (and later on in the course, audio APIs utilized) are cross-platform. Quick Poll: how many students are using Mac OS? Windows? Linux?

Using the terminal What is bash? It s a shell, or a command line interface that lets you interact with the OS. at s what you re using when you type into your terminal window. How do you set up your environment? What is a prompt? To type a file name with a space on the command line, use the escape characer \ before it. Example: cd My\ Docs cd s to the directory My Docs.

Unix Mac OS X is built on a Unix (BSD) core It comes with the GNU C compiler (gcc) that we ll be using for the course (make sure you download XCode) Traversing the Unix file system directory commands cd changes current directory to home directory cd <dir> changes current directory to specified directory cd.. go up one directory level ls list the contents of present working directory pwd show path to current directory mkdir <dir> make a new directory rmdir <dir> delete a directory

File commands Unix continued cat <filename> prints contents of file less <filename> same as cat but shows one screenful at a time cp <src> <dest> copy file <src> to <dest> mv <src> <dest> move or rename <src> to <dest> touch <filename> creates an empty new file called <filename> emacs <filename> opens a new file in the editor emacs

Some Unix questions How does the shell know where to find the programs you type? See what your path is echo $PATH Why don t I see all my files when I type ls? What are command flags? ls -af What is standard input and output? How do I save output to a file? <command> > <outputfilename> How do I find out more about a command? man <command name>

Programming: Some history In the beginning, computers could only be programmed in terms of binary numbers that corresponded directly to specific machine instructions and locations in the computer s memory. Not very human friendly. e next software advance occurred with the development of assembly language. Enabled the programmer to work with the machine on a higher level, using symbolic names for instructions. en came high-level languages like FORTRAN, in which programmers no longer had to concern themselves with the architecture of a particular computer. is resulted in the need for a compiler to translate the program into a form the computer could understand.

Compiling a C program: Basic outline Source code Human-readable instructions (your program) Format is text Source code is then translated by a compiler into machine code (binary) You can then run this program on your machine. Source code Machine code int x = 0;" x = y + z;" while (...)" Compiler 00100110101" 01101001001" 01011101000"

Compiling a C program: Detailed version Source code int x = 0;" x = y + z;" while (...)" Assembler Preprocessor Takes the assembly language produced by the compiler, and translates into object code Assembly instructions are turned into opcode (machine language codes that specifies a particular operation for the CPU) Assembly code Compiler movl %esp, %ebp" pushl %ebx" subl $36, %esp" Object code Machine code that is usually not directly executable (.o files) Linking e linker takes one of more object files and combines them into an executable (the linker is sometimes called the loader in Unix). External libraries used by your program are linked in at this stage. Object code Assembler 00100110101" (Library ref)" 01011101000" (Library ref)" Linker Libraries (object code) 11111001111" 01101001001" 00011010111" 00011111000" 01011111001" ld is the Unix linker Executable code 00100110101" 01101001001" 01011101000" 11001101111" 01011111001"

Structure of a C program /* This is a comment. Not a very useful one, though */" #include <stdio.h> int main (void) " {" "printf("hello World!\n"); " "return 0; " }"

Compiling a C program After creating a file, (in this case, we re calling it helloworld.c ) compile it and run it. hostname:user ~ % gcc helloworld.c hostname:user ~ % ls a.out* "helloworld.c hostname:user ~ %./a.out HelloWorld! hostname:user ~ %

Getting started Programming in C, Chapters 2-4, pp. 5-41 Absolute Beginner s Guide to C, Chapters 1-4, pp. 1-46 Install gcc and other Unix tools on your computer If you are using Windows, you must install Cygwin. If you are using MacOS, you might have to install XCode programming tools. If you are using Linux, you shouldn t need to install anything. Get acquainted with the Unix environment Learn how to navigate the Unix directory structure; experiment with basic Unix commands Get a feel for emacs (if you choose to use it as your text editor) see website for references online to help you get acquainted Go to website (under Lectures) and download the Getting Started document to help you set up your shell and emacs environments