Talk Like a Pirate David Reed Creighton University Captain Jack Sparrow Captain Blackbeard Captain Redpen.

Slides:



Advertisements
Similar presentations
Authoring Languages and Web Authoring Software 4.01 Examine web page development and design.
Advertisements

1 CSC 551: Web Programming Spring 2004 client-side programming with JavaScript  scripts vs. programs  JavaScript vs. JScript vs. VBScript  common tasks.
1 A Balanced Introduction to Computer Science, 2/E David Reed, Creighton University ©2008 Pearson Prentice Hall ISBN Chapter 17 JavaScript.
Talk Like a Pirate Day By Anne & David Ellsworth Music K-8 Volume 15 Number 1  2004 Plank Road Publishing PowerPoint by Sally Utley.
JavaScript- Processing HTML Forms. Event Handlers Begins with and ends with.
Browsers and Servers CGI Processing Model ( Common Gateway Interface ) © Norman White, 2013.
David Reed Department of Computer Science Creighton University __ __ ______ ____ ______ __ __ /\ \/\ \/\__ _\ /\ _`\ /\__ _\/\ \
JavaScript- Introduction. What it is and what it does? What it is? It is NOT Java It is NOT Server-side programming Users can see code It is a client-side.
1 A Balanced Introduction to Computer Science, 2/E David Reed, Creighton University ©2008 Pearson Prentice Hall ISBN Chapter 7 Event-Driven.
Information Technology Center Hany Abdelwahab Computer Specialist.
Computer Science 103 Chapter 4 Advanced JavaScript.
Tutorial 8 Designing a Web Site with Frames. XP Objectives Explore the uses of frames in a Web site Create a frameset consisting of rows and columns of.
JavaScript Lesson 1 TBE 540. Prerequisites  Before beginning this lesson, the learner must be able to… Create a basic web page using a text editor and/or.
CS 299 – Web Programming and Design Overview of JavaScript and DOM Instructor: Dr. Fang (Daisy) Tang.
Russell Taylor Lecturer in Computing & Business Studies.
XP Tutorial 1 New Perspectives on JavaScript, Comprehensive1 Introducing JavaScript Hiding Addresses from Spammers.
4.01B Authoring Languages and Web Authoring Software 4.01 Examine webpage development and design.
A02 Creating my website NAME ______________. UNIT 2 – A02 – Creating my Website The purpose of this assessment objective is to create 5 web pages containing.
Introduction to JavaScript. Aim To enable you to write you first JavaScript.
CST JavaScript Validating Form Data with JavaScript.
1 Events Lect 8. 2 Event-driven Pages one popular feature of the Web is its interactive nature e.g., you click on buttons to make windows appear e.g.,
A First Program Using C#
Javascript and the Web Whys and Hows of Javascript.
4.1 JavaScript Introduction
Forms and Java script. Forms The graphical user interface -textbox, radio, button, textarea, checkbox… The processing script –CGI scripts, Perl script,
Object Matching With Faces CS460 Project Presentation By Sam Buyarski.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
PowerPoint Basics “Just what are we trying to do with this software anyway?”
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
Event Handlers CS101 Introduction to Computing. Learning Goals Learn about event handlers Determine how events are useful in JavaScript Discover where.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
ECT 250: Survey of E-Commerce Technology FrontPage Publishing pages Unix.
Computers and Scientific Thinking David Reed, Creighton University JavaScript and User Interaction 1.
G053 - Lecture 16 Validating Forms Mr C Johnston ICT Teacher
1 JavaScript in Context. Server-Side Programming.
Dynamic Web Pages & JavaScript. Dynamic Web Pages Dynamic = Change Dynamic Web Pages are web pages that change. More than just moving graphics around.
Computers and Scientific Thinking David Reed, Creighton University Functions and Libraries 1.
Who were the pirates? Pirates have existed since ancient times. They threatened the trading routes of ancient Greece, and captured ships from Roman.
Introduction to JavaScript CS101 Introduction to Computing.
1 A Balanced Introduction to Computer Science David Reed, Creighton University ©2005 Pearson Prentice Hall ISBN X Chapter 4 JavaScript and.
Sahar Mosleh California State University San MarcosPage 1 JavaScript Basic.
A Balanced Introduction to Computer Science, 3/E David Reed, Creighton University ©2011 Pearson Prentice Hall ISBN Chapter 17 JavaScript.
Cookies (continue). Extracting Data From Cookies Data retrieved from a cookie is a simple text string. While there is no specific JavaScript function.
CS562 Advanced Java and Internet Application Introduction to the Computer Warehouse Web Application. Java Server Pages (JSP) Technology. By Team Alpha.
Hands-on Introduction to Visual Basic.NET Programming Right from the Start with Visual Basic.NET 1/e 6.
4.01B Authoring Languages and Web Authoring Software 4.01 Examine webpage development and design.
Chapter 4 Java Script - Part1. 2 Outlines Introduction to Java Script Variables, Operators and Functions Conditional statements JavaScript Objects Forms.
CSC 121 Computers and Scientific Thinking Fall Event-Driven Programming.
CGS 3066: Web Programming and Design Spring 2016 Introduction to JavaScript.
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
JavaScript: A short introduction Joseph Lee Created by Joseph Lee.
Web Programming Java Script-Introduction. What is Javascript? JavaScript is a scripting language using for the Web. JavaScript is a programming language.
Page Redirection When you click a URL to reach to a page X but internally you are directed to another page Y that simply happens because of page re- direction.
Brief Look InTo JavaScript Dr. Thomas Hicks Computer Science Department Trinity University.
1 Terminal Management System Usage Overview Document Version 1.1.
JavaScript Part 1 Introduction to scripting The ‘alert’ function.
Event-Driven Programming
Section 10.1 YOU WILL LEARN TO… Define scripting
Chapter 4 JavaScript and Dynamic Web Pages
T. Jumana Abu Shmais – AOU - Riyadh
Chapter 6 Event-Driven Pages
JavaScript.
About Multimedia Files
Note1 Click on the Need Help link on the right side of the page to begin the Add Alternate Name process.
Chapter 7 Event-Driven Pages
A02 Creating my website NAME ______________.
Chapter 17 JavaScript Arrays
Activity 1 Bookmarking a web site
Introduction to scripting
Presentation transcript:

Talk Like a Pirate David Reed Creighton University Captain Jack Sparrow Captain Blackbeard Captain Redpen

2 Talk Like a Pirate Day International Talk Like a Pirate Day – September 19th  founded by John Baur and Mark Summers in 1995  popularized by columnist Dave Barry  see for more detailswww.talklikeapirate.com official Web site had a simple pirate translator  poorly done, but inspiring "nifty" characteristics  can be used to introduce/demonstrate a variety of programming concepts GUI event-driven programming meta-programming string methods, regular expressions  can be used in a variety of classes using different languages CS0 with HTML/JavaScript CS1 or CS2 with C++/Java Web Design/Programming  it's fun!

3 Pirate Translator (version 1.0) used in a Web-based CS0 course students critiqued the design of the official page developed a "better" translation page  one button per word/phrase  when user clicks on button, translation appears in a text box note: this could easily be done in Java using AWT/Swing advantages:  simple & intuitive  easy to extend (just add more buttons)  minimal "programming"  open for creativity (layout, images, extended vocabulary, …)

4 Pirate Translator (version 2.0) disadvantage of version 1: button repetition  adding a new word/phrase meant adding a new button – danger of inconsistencies more general solution: metaprogramming  store words/phrases in a list structure to extend the vocabulary, simply add to the list  use JavaScript to dynamically generate the buttons PHRASES = [["Greetings", "hello", "ahoy", "pardon me", "avast", "excuse me", "arrr"], ["People", "sir", "matey", "madam", "proud beauty", "miss", "comely wench"], ["Questions", "where is", "whar be", "can you help me find", "know ye", "is that", "be that", "how far is it to", "how many leagues to"],... ]; for (var i = 0; i < PHRASES.length; i++) { document.write(" " + PHRASES[i][0] + ": "); for (var j = 1; j < PHRASES[i].length; j+=2) { document.write("<input type=\"button\" value=\"" + PHRASES[i][j] + "\" onClick='document.PirateForm.Output.value += \"" + PHRASES[i][j+1] + " \";'>\n"); } could use a Java/C++ program to generate the HTML document

5 Pirate Translator (version 3.0) disadvantage of version 2: translation is limited to provided buttons  would like to take entire phrases, translate "piratey" parts, leave rest alone alternative approach used in upper-level Web Programming course  user enters text to be translated  string methods used to search for words/phrases to translate utilize regular expressions to match word boundaries, ignore case  replace matched word/phrase with pirate translation PHRASES = [["hello", "ahoy"], ["hi", "yo-ho-ho"], ["pardon me", "avast"], ["excuse me", "arrr"], ["yes", "aye"], ["my", "me"],... ]; for (var i = 0; i = "A" && text.charAt(index) <= "Z") { text = text.replace(toReplace, Capitalize(PHRASES[i][1])); } else { text = text.replace(toReplace, PHRASES[i][1]); } index = text.search(toReplace); } } here in JavaScript, but could be any language with strings (regular expressions a plus)

6 It be fun! in conclusion:  a pirate translator is fun and engaging  can be used in a multiple courses to illustrate multiple concepts  can provide an open-ended challenge to students critique/design a user interface add to the vocabulary of the translator add new features e.g., insert random Arrrrrrr 's explore regular expressions e.g., translate words ending in ing to in' (but not swing or handspring ) Give it a try in your class, or walk the plank like the lily-livered landlubber you are!