Mon., 30 Nov. 2015 Project progress reports due today! Schedule for - - PowerPoint PPT Presentation

mon 30 nov 2015 project progress reports due today
SMART_READER_LITE
LIVE PREVIEW

Mon., 30 Nov. 2015 Project progress reports due today! Schedule for - - PowerPoint PPT Presentation

Mon., 30 Nov. 2015 Project progress reports due today! Schedule for rest of semester: Today--missed topics Weds., 2 Dec: hand out exam review; begin review Fri. 4 Dec: first batch of presentations Mon. 7 Dec: COOKIES! 2nd batch of presentations


slide-1
SLIDE 1

Mon., 30 Nov. 2015 Project progress reports due today! Schedule for rest of semester: Today--missed topics Weds., 2 Dec: hand out exam review; begin review

  • Fri. 4 Dec: first batch of presentations
  • Mon. 7 Dec: COOKIES!2nd batch of presentations
  • Thu. 10 Dec, 9 a.m. -- FINAL EXAM
slide-2
SLIDE 2

Missed Opportunities Chapter 12 is about concurrency and programming

  • languages. Issues include:
  • how to denote parallelism in a program?
  • how to synchronize parallel processes?
  • how to share resources (e.g., memory)?

(Some of these are implementation issues rather than language issues.)

slide-3
SLIDE 3

Missed Opportunities Concurrency in Java: threads

public class Threads implements Runnable { private static int n; public void run() { System.out.println("Thread " + n); } public static void main(String[] args) { for (n = 0; n < 5; n++) { (new Thread(new Threads())).start(); } } }

slide-4
SLIDE 4

Concurrency in Java: threads

rroos@aldenv111:~$ java Threads Thread 3 Thread 4 Thread 3 Thread 3 Thread 5 rroos@aldenv111:~$ java Threads Thread 4 Thread 5 Thread 5 Thread 4 Thread 4

slide-5
SLIDE 5

Missed Opportunities Chapter 13: Scripting Languages

Examples include:

  • shell languages (e.g., “bash”, “csh”, “zsh”, “tcsh”, and many
  • thers)
  • text-processing languages (e.g., “awk”, “perl”, and others)
  • “glue” and general-purpose languages (e.g., Python, Perl,

Ruby, etc.)

  • “extension” languages (e.g., JavaScript, Visual Basic,

VimScript, etc.) Some languages fall under several categories

slide-6
SLIDE 6

Scripting Languages

Bash script for renaming a group of files:

for file in *.html do mv "$file" "${file%.html}.txt" done $ ls *.jpeg pic1.jpeg pic2.jpeg pic3.jpeg $ ./rename $ ls *.jpeg ls: cannot access *.jpeg: No such file or directory rroos@aldenv111:~$ ls pic*jpg pic1.jpg pic2.jpg pic3.jpg

slide-7
SLIDE 7

Scripting Languages We have looked at JavaScript in a little more detail than other languages, but mostly we have focused

  • n features of the language itself rather than its

use in “extending” the features of HTML, CSS, etc. in web pages. For instance, in Chrome and just about any other browser, search for a menu item called “Developer” or “Tools” or “View Source” and look at the underlying code:

slide-8
SLIDE 8

Scripting Languages Here’s what it looks like on my laptop:

slide-9
SLIDE 9

Scripting Languages

JavaScript code goes inside the <script>...</script> tags

From: http://cs.allegheny.edu/sites/rroos/cs210f2015/binary.html

slide-10
SLIDE 10

Scripting Languages We can augment the behavior of HTML elements “callbacks”, i.e., functions that get passed into event handlers such as the one that handles a “button click”: