Lecture 9 – Scripting II Testing scripts MP3 files id3tool.

Slides:



Advertisements
Similar presentations
Sound Situation Formats and Foundations. Cassette Tapes Introduced by the Music Industry.
Advertisements

Embedded Streaming Media with GStreamer and BeagleBoard ESC-228 Presented by Santiago Nunez santiago.nunez (at) ridgerun.com.
Princess & Dragon – Version 2 By Michael Hoyle under the direction of Professor Susan Rodger Duke University July 2012 Part 3: Billboards, Events, Sounds,
The Online Guide to Creating Podcasts Presented by The Portland Public Schools Multimedia Library Recording and Saving your Podcast.
Recursion in Python. Recursion Problems in every area of life can be defined recursively, that is, they can be described in terms of themselves. An English.
Conclusions.
Sounds Good: Quicker, better assessment using audio feedback? Bob Rotheram Leeds Metropolitan University
Important concepts in software engineering The tools to make it easy to apply common sense!
What do I do? 1. Read each scene. 2. Choose what you would do. 3. Read what happens next! 4. Try different choices when you get done! Mrs. Hayman’s Second.
CS Lecture 03 Outline Sed and awk from previous lecture Writing simple bash script Assignment 1 discussion 1CS 311 Operating SystemsLecture 03.
University of British Columbia CPSC 111, Intro to Computation Jan-Apr 2006 Tamara Munzner Class Design Lecture 6, Tue Jan
SQL Data Definition II Stanislava Armstrong 1SQL Data Definition II.
DT228/3 Web Development JSP: Directives and Scripting elements.
Assignment 1 Pointers ● Be sure to use all tags properly – Don't use a tag for something it wasn't designed for – Ex. Do not use heading tags... for regular.
IS 1181 IS 118 Introduction to Development Tools Chapter 5 Reusing Code.
Lecture 3  Shell Variables  Shell Command History  Job / Process Control  Directory Control.
 Knowledge and use of tools and resources in a system: standard libraries, system calls, debuggers, the shell environment, system programs and scripting.
Creating a Simple Page: HTML Overview
Homework Reading Programming Assignments
CO1552 – Web Application Development Lists, Special Characters, and Tables.
Or Why does this stuff give me funny feelings?. Culture Sub Headings Categories : Watching Doing Talking.
Games Development 2 Resource Management CO3301 Week 3.
Seth Gibson Rapid Experience Development Build It On Stone.
RFID Editing and setup. Collect your content and organise it how you want it to be viewed and save it somewhere so you can find it easily. (Media formats.
Assignment 2 Due November 4, 1:30pm. Website You are creating a website for a fictional business which must sell some sort of product You can create any.
DEBUGGING CHAPTER Topics  Getting Started with Debugging  Types of Bugs –Compile-Time Bugs –Bugs Attaching Scripts –Runtime Errors  Stepping.
General Computer Science for Engineers CISC 106 Lecture 07 James Atlas Computer and Information Sciences 06/29/2009.
General Programming Introduction to Computing Science and Programming I.
Best Practices for Script Design A PowerShell.org TechSession.
ITIS 3110 LAB 02 Scripts I. Lab IDs Your Lab ID is the same as your 49er ID The PW is different: a + your 800 id a Note: sometimes the a is not.
INTRODUCTORY Tutorial 1 Using HTML Tags to Create Web Pages.
  free online video (slide-show) maker  number of images and length/ tempo of your song will determine the speed.
Introduction Copyright © Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See
Code reading skills LEVEL GAME.  Common scenario:  Students raise hand. Point to code, say they don’t understand why it’s not working.  public void.
Alice Learning to program: Part Two Writing Your Own Methods by Ruthie Tucker and Jenna Hayes Under the direction of Professor Susan Rodger Duke University,
Perl Tutorial. Why PERL ??? Practical extraction and report language Similar to shell script but lot easier and more powerful Easy availablity All details.
Introduction to the Maya C++ API Brent Haley The Ohio State University
When we create.rtf document apart from saving the actual info the tool saves additional info like start of a paragraph, bold, size of the font.. Etc. This.
Lecture 25 May 16, Agenda Using JComboBox Class ID3V1_Tag –Using it. –Implementation. Class MP3_File –Dummy Version Quiz.
COLD READING UNIT. WHAT DO YOU THINK ABOUT WHEN YOU HEAR “COLD READING?”
GAME 1024: Advanced Game Programming Lesson 11: Now What? By Kain Shin.
EMT 2390L Lecture 3 Dr. Reyes Reference: The Linux Command Line, W.E. Shotts.
Today's Ninja Challenge: Write Your First Computer Game!
How to get your MP to work for you. It may seem intimidating to contact them or make requests of them, but this is why their job exists!! Research your.
Day 2: Microscope Skills Learning Targets: I will learn about the proper care of a compound microscope I will be able to prepare my own slide (wet mount).
UNIX-21 WEEK 2 4/5/2005. UNIX-22 TOPICS Functions (contd.) pushd, popd, dirs Debugging Shell scripts Scheduling Unix jobs Job Management.
Setting Up and Managing a Bioinformatics Project Andrii Rozumnyi and Gagandeep Singh Spring 2016.
Oleksii Maksymenko. Dive into the project context: How was it and How it is going? Trying to apply my Tester’s experience on own project What should be.
Functions Wouldn’t it be nice to be able to bring up a new animal and paragraph without having to reload the page each time? We can! We can place the.
Do Your Homework Debbie Sheppard Study Skills. How can homework help you? Maybe the thought of homework annoys you so much that you’ve overlooked the.
YouTube Mp3 Converter.
Section 9 Tagged File Support Design
Introduction to Computing Science and Programming I
L – Modeling and Simulating Social Systems with MATLAB
Bash Introduction (adapted from chapters 1 and 2 of bash Cookbook by Albing, Vossing, & Newham) CPTE 440 John Beckett.
Brandon A. English Phrases & Proverbs.
Arrays and files BIS1523 – Lecture 15.
Easy-Bash: Designing a Metasearch Engine for Bash Command Queries
Cookies BIS1523 – Lecture 23.
Playing Audio (Part 2).
Arrays and Strings Chapter 9.
Introduction to Computer Organization & Systems
Debugging Taken from notes by Dr. Neil Moore
Debugging Taken from notes by Dr. Neil Moore
File Input and Output.
Engine Part ID Part 1.
Engine Part ID Part 2.
Engine Part ID Part 2.
The Do’s & Don’ts of Effective Research
Presentation transcript:

Lecture 9 – Scripting II Testing scripts MP3 files id3tool

Script Development 1.Plan your scripts 2.Source script files 3.Make “proper” functions 4.“echo” your code 5. Mystery Hint

1. Plan Your Scripts Hastily-written scripts suck to debug –Finding code snippets can be hard –“Analogous” code can be implemented differently (i.e., orders of params, etc)

2. Source Script Files Place functions into script file Instead of “main” at bottom, just source the script Call functions by hand at terminal

3. Make “Proper” Functions Collect all related code into a function If function is too large, break into sub-functions –Subjective, but lines Even a single line of code is okay –Could be called again –Could be a very complex line

4. “echo” Your Code Sometimes a line doesn’t seem to be working Placing an ‘echo’ on line can help You’ve been told to never debug like this…why? –

4. “echo” Your Code Sometimes a line doesn’t seem to be working Placing an ‘echo’ on line can help You’ve been told to never debug like this…why? –Alters pointer/stack setup –We’re not playing with pointers, so we’re (probably) good

5. _____?______

5. Walk Away Anime characters fight better when they’re mad Scientists/Engineers don’t code better when mad You’re not an anime character

MP3 Files We don’t care about the internals –JPEG6.2 is complex enough –Audio is worse! What do we care about? –

MP3 Files We don’t care about the internals –JPEG6.2 is complex enough –Audio is worse! What do we care about? –ID3 tags!

ID3 Tags They contain basic info: –Title –Artist –Album –Year –Track Number –etc

id3tool Actual audio is complex –Let’s ignore it ID3 tags are easy –Let’s use id3tool to view/alter it

id3tool –Lists attributes of the MP3 file Can set attributes –-a  album –-r  artist –-y  year File must already exist! –“touch” command

BASH Function #1 createOneDummyMP3() { touch $1 id3tool $1 -a $2 -r $3 -y $4 }

BASH Function #2 createTestMP3Files() { mkdir –p $1 pushd $1 for i in {0..9} do for j in {0..9} do createOneDummyMP3 song$i$j.mp3 Album$i Artist$j 200$i done popd }

PS Function #1 function createOneMP3File( $filename, $album, $artist, $year) { echo ‘’ > $filename id3tool $filename -a $album -r $artist -y $year }

PS Function #2 function createTestMP3Files( $dirName) { mkdir –force $dirName pushd $dirName foreach ($i in 0..9) { foreach ($j in 0..9) { createOneMP3File song$i$j.mp3 Album$i Artist$i 200$i } popd }