Java net programming II

Size: px
Start display at page:

Download "Java net programming II"

Transcription

1 Java et programmig II Overview The problem Basic backgroud: TCP/IP, ports, Cliet/Server, sockets Commuicatio with sockets java.et (overview) Simple web server implemetatio 1

2 Socket commuicatio Server IP: port: 2000 Request: Server IP: port: The Java.et.Socket Class Coectio is accomplished via object istatiatio q Each Socket object is associated with exactly oe remote host. Sedig ad receivig data is accomplished with output ad iput streams. 2

3 Example: Server ad Cliet - Server import import java.et.*; java.io.*; public class Server { public static void mai(strig[] args) throws IOExceptio { it serverport = 2000; ServerSocket serversocket = ull; 16-5 Example: Server ad Cliet - Server //Create try { server socket serversocket = ew ServerSocket(serverPort); catch (IOExceptio e) { System.err.pritl("Could ot liste o port: " + serverport); System.exit(1);

4 Example: Server ad Cliet - Server //Liste to cliet request ad create cliet socket Socket clietsocket = ull; try { clietsocket = serversocket.accept(); catch (IOExceptio e) { System.err.pritl("Accept failed."); System.exit(1); 16-7 Example: Server ad Cliet - Server //Create I/O streams PritWriter out = ew PritWriter( clietsocket.getoutputstream(), true); BufferedReader i = ew BufferedReader( ew IputStreamReader( clietsocket.getiputstream())); //Commuicate with cliet //Get a strig from cliet, modify it ad set it back //Ca throw I/O exceptio Strig fromcliet = i.readlie(); Strig tocliet = "Readig from " + clietsocket + ": "+ fromcliet; out.pritl(tocliet);

5 Example: Server ad Cliet - Server // Housekeepig: Release resources out.close(); i.close(); clietsocket.close(); serversocket.close(); 16-9 Example: Server ad Cliet - Cliet import java.io.*; import java.et.*; public class Cliet { public static void mai(strig[] args) throws IOExceptio { Socket serversocket = ull; PritWriter out = ull; //sed to server BufferedReader i = ull; //receive from server Strig server = " "; // OR: Strig server = "localhost ; it serverport = 2000;

6 Example: Server ad Cliet - Cliet // Coect to Server try { // Server IP ad port serversocket= ew Socket(server, serverport); out = ew PritWriter(serverSocket.getOutputStream(), true); i = ew BufferedReader(ew IputStreamReader(serverSocket.getIputStream())); catch (UkowHostExceptio e) { System.err.pritl("Ca ot fid host: "+ server); System.exit(1); catch (IOExceptio e) { System.err.pritl("Could't get I/O with: " + server); System.exit(1); Example: Server ad Cliet - Cliet //Commuicate with server //Sed a strig to server ad receive a reply Strig toserver = "Strig from cliet"; out.pritl(toserver); Strig fromserver = i.readlie(); System.out.pritl("Cliet: " + toserver); System.out.pritl("Server: " + fromserver);

7 Example: Server ad Cliet - Cliet //Release resources out.close(); i.close(); serversocket.close(); Example: Server ad Cliet - Cliet Server: Strig fromcliet = i.readlie(); Strig tocliet = "Readig from " + clietsocket + ": "+ fromcliet; out.pritl(tocliet); Cliet: Strig toserver = "Strig from cliet"; out.pritl(toserver); Strig fromserver = i.readlie(); System.out.pritl("Cliet: " + toserver); System.out.pritl("Server: " + fromserver);

8 Example: Server ad Cliet multiple cliets Server rus oly oce After cliet commuicatio both server ad cliet ed What if we eed the server to commuicate with several cliets? Example: Server ad Cliet multiple cliets Whe cliet coectio requests arrived they are queued They ca be serviced oe at a time Or the server ca service cliets simultaeously through the use of threads A thread is a lightweight cocurret process Creatig oe thread per each cliet coectio, cliets are serviced simultaeously

9 Example: Server ad Cliet multiple cliets The basic flow of logic is: while (true) { accept a coectio; create a thread to deal with the cliet; Server Thread 0 Thread 1 Thread Cliet 0 Cliet 1 Cliet Example: Server ad Cliet - multiple cliets //Class Server //serversocket = ew ServerSocket(serverPort); while (true) { //Liste to cliet request (as before)... clietsocket = serversocket.accept(); //Create I/O streams (moved) //Commuicate with cliets ew ServerThread(clietSocket).start(); //executes //thread ru() //clietsocket.close(); //ed while //Error Thread rus //i parallel Helder Daiel

10 Example: Server ad Cliet - multiple cliets public class ServerThread exteds Thread { private Socket clietsocket; public ServerThread (Socket socket) { clietsocket=socket; Example: Server ad Cliet - multiple cliets public void ru() { try { //Create I/O streams (moved from server class) //(we eed differet streams for each cliet) PritWriter writecliet = ew PritWriter(clietSocket.getOutputStream(), true); BufferedReader readcliet = ew BufferedReader( ew IputStreamReader( clietsocket.getiputstream()));

11 Example: Server ad Cliet - multiple cliets //Commuicate with cliet (moved from server class) Strig fromcliet = readcliet.readlie(); Strig tocliet = fromcliet + " set from Server"; writecliet.pritl(tocliet); //Release resources (moved from server class) writecliet.close(); readcliet.close(); clietsocket.close(); catch (IOExceptio e) { e.pritstacktrace(); If we eed to chage the behaviour of the server we eed to rewrite this class Server ad Cliet templates Most of the iteractios betwee a server ad its cliets is structurally similar. Both the TemplateMethod ad the Strategy desig patters ca be used to desig cliet-server iteractios A cocrete server ad a cocrete cliets ca the be implemeted re-usig most of the previously writte code Typically, oly a small class will be eed for implemetig a cocrete cliet. The same applies for a cocrete server. jvo@ualg.pt

12 TemplateCliet ClietDemo ClietDemo() mai(strig[]):void TemplateCliet serversocket: Socket server: Strig serverport: it TemplateCliet(Strig,it) fialize():void behaviour():void start():void ACocreteCliet ACocreteCliet(Strig,it) behaviour():void ClietDemo starts the cliet import java.io.*; public class ClietDemo { public static void mai(strig[] args) throws IOExceptio, ClassNotFoudExceptio { Strig server = "localhost"; // " "; it serverport = 2000; ew ACocreteCliet(server, serverport).start(); ClietDemo ClietDemo() mai(strig[]):void TemplateCliet serversocket: Socket server: Strig serverport: it TemplateCliet(Strig,it) fialize():void behaviour():void start():void ACocreteCliet ACocreteCliet(Strig,it) hdaiel@ualg.pt behaviour():void Helder Daiel

13 TemplateCliet code abstract public class TemplateCliet { protected Socket serversocket = ull; private Strig server; private it serverport; public TemplateCliet (Strig server, it serverport) { this.serverport = serverport; this.server = server; try { //Coect to Server serversocket = ew Socket(this.server, this.serverport); catch (UkowHostExceptio e) { System.err.pritl("Caot fid host: "+ server); System.exit(1); catch (IOExceptio e) { System.err.pritl("Could't get I/O with: "+server); System.exit(1); //Ed costructor TemplateCliet protected void fialize() throws IOExceptio { serversocket.close(); // to be implemeted by subclasses abstract public void behaviour() throws IOExceptio, ClassNotFoudExceptio; public void start() throws IOExceptio, ClassNotFoudExceptio { behaviour(); //Ed class

14 A Cocrete cliet eeds oly to implemet behaviour (ad a costructor) import java.io.*; import java.util.date; class ACocreteCliet exteds TemplateCliet { ACocreteCliet (Strig server, it serverport) { super(server, serverport); A cocrete cliet eeds oly to implemet behaviour (ad a costructor) public void behaviour() throws IOExceptio, ClassNotFoudExceptio { ObjectOutputStream writeserver = ew ObjectOutputStream( serversocket.getoutputstream()); ObjectIputStream readserver = ew ObjectIputStream( serversocket.getiputstream()); Date toserver = ew Date(); writeserver.writeobject(toserver); Date fromserver = (Date) readserver.readobject(); System.out.pritl("Cliet: " + toserver); System.out.pritl("Server: " + fromserver); writeserver.close(); readserver.close(); // eoc

15 The server side ServerDemo ServerDemo() mai(strig[]):void CotextServer serversocket: ServerSocket ruig: boolea behaviourclassname: Strig CotextServer(it,Strig) fialize():void stop():void start():void <<Java Iterface>> IServerBehaviour iitialize(socket):void behaviour():void start():void TemplateServerThread clietsocket: Socket TemplateServerThread() ru():void ServerBehaviourDemo ServerBehaviourDemo() iitialize(socket):void behaviour():void José Valete de Oliveira ServerDemo starts the server public class ServerDemo { public static void mai(strig[] args) throws Exceptio { it sport = 2000; ew CotextServer(sport, ServerBehaviourDemo ).start(); ServerDemo ServerDemo() mai(strig[]):void CotextServer serversocket: ServerSocket ruig: boolea behaviourclassname: Strig CotextServer(it,Strig) fialize():void stop():void start():void <<Java Iterface>> IServerBehaviour iitialize(socket):void behaviour():void start():void TemplateServerThread clietsocket: Socket TemplateServerThread() ru():void ServerBehaviourDemo ServerBehaviourDemo() iitialize(socket):void Need to pass the class ame that implemets the method behaviour(), i.e., ServerBehaviourDemo behaviour():void hdaiel@ualg.pt Helder Daiel 15

16 The CotextServer public class CotextServer { private ServerSocket serversocket; private boolea ruig = false; private Strig behaviourclassname; public CotextServer(it serverport, Strig behaviourclassname) { ruig = false; this.behaviourclassname = behaviourclassname; try { serversocket = ew ServerSocket(serverPort); catch (IOExceptio e) { System.err.pritl("Could ot liste o port: " + serverport); System.exit(1); //Ed costructor The CotextServer protected void fialize() throws IOExceptio { serversocket.close(); public void stop() { ruig = false;

17 The CotextServer public void start() throws Exceptio { ruig = true; while (ruig) { socket clietsocket = ull; try { clietsocket = serversocket.accept(); catch (IOExceptio e) { System.err.pritl("Accept failed."); System.exit(1); //Start a ew Thread for each cliet The CotextServer //eom //eoc //Start a ew Thread for each cliet //Class behaviour ame is obtaied usig reflectio IServerBehaviour behaviour = (IServerBehaviour) Class.forName(behaviourClassName).ewIstace(); behaviour.iitialize(clietsocket); behaviour.start(); IServerBehaviour behaviour = (IServerBehaviour) ServerBehaviourDemo.ewIstace(); For producig: ew ServerBehaviourDemo();

18 The server side ServerDemo ServerDemo() mai(strig[]):void CotextServer serversocket: ServerSocket ruig: boolea behaviourclassname: Strig CotextServer(it,Strig) fialize():void stop():void start():void <<Java Iterface>> IServerBehaviour iitialize(socket):void behaviour():void start():void TemplateServerThread clietsocket: Socket TemplateServerThread() ru():void ServerBehaviourDemo ServerBehaviourDemo() iitialize(socket):void behaviour():void José Valete de Oliveira A iterface for specifyig the type ServerBehaviour <<Java Iterface>> IServerBehaviour import java.et.socket; iitialize(socket):void behaviour():void start():void public iterface IServerBehaviour { void iitialize (Socket clietsocket); void behaviour() throws Exceptio; void start();

19 TemplateServerThread code for cocrete behaviours abstract public class TemplateServerThread exteds Thread implemets IServerBehaviour { protected Socket clietsocket; public void ru() { try { // Commuicate with cliet behaviour(); // Must be implemeted by subclasses clietsocket.close(); catch (Exceptio e) { e.pritstacktrace(); A cocrete behaviour: ServerBehaviourDemo class ServerBehaviourDemo exteds TemplateServerThread { // madatory public void iitialize (Socket clietsocket) { this.clietsocket = clietsocket; This is the oly class we eed to chage to implemet a differet server // madatory public void behaviour() throws Exceptio { // YOUR CODE HERE <<Java Iterface>> IServerBehaviour iitialize(socket):void behaviour():void start():void TemplateServerThread clietsocket: Socket TemplateServerThread() ru():void ServerBehaviourDemo ServerBehaviourDemo() iitialize(socket):void behaviour():void

20 A cocrete behaviour: ServerBehaviourDemo public void behaviour() throws Exceptio { ObjectOutputStream w = ew ObjectOutputStream(clietSocket.getOutputStream()); ObjectIputStream r = ew ObjectIputStream (clietsocket.getiputstream()); Date fromcliet = (Date) r.readobject(); Date tocliet = (Date) fromcliet.cloe(); w.writeobject(tocliet); // Close I/O streams ow w.close(); r.close(); // Ed behaviour //Ed class Server Cliet iteractio Server: Date fromcliet = (Date) readcliet.readobject(); Date tocliet = (Date) fromcliet.cloe(); w.writeobject(tocliet); Cliet: Date toserver = ew Date(); writeserver.writeobject(toserver); Date fromserver = (Date) readserver.readobject(); System.out.pritl("Cliet: " + toserver); System.out.pritl("Server: " + fromserver);

21 Check poit Say you eed a server to: q receive a Strig q Modify it q ad sed back to the cliet What would you do? Simple (HTTP) webserver for GET requests oly http request (GET) Web page Web server Web page Web cliet 42 21

22 Simple webserver for GET requests oly WebServerDemo WebServerDemo() mai(strig[]):void CotextServer serversocket: ServerSocket ruig: boolea behaviourclassname: Strig CotextServer(it,Strig) fialize():void stop():void start():void <<Java Iterface>> IServerBehaviour iitialize(socket):void behaviour():void start():void TemplateServerThread clietsocket: Socket TemplateServerThread() ru():void WebServerBehaviour WebServerBehaviour() iitialize(socket):void behaviour():void httperror(it,dataoutputstream):void sedheader(strig,file,dataoutputstream):void filetype(file):strig sedfile(file,dataoutputstream):void WebServerDemo starts the http server public class WebServerDemo { public static void mai(strig[] args) throws Exceptio { it sport = 2000; ew CotextServer(sport,"WebServerBehaviour ).start();

23 WebServerBehaviour import java.io.*; import java.et.*; class WebServerBehaviour exteds TemplateServerThread { public void iitialize (Socket clietsocket) { this.clietsocket = clietsocket; Webserver (http server): behaviour public void behaviour() throws Exceptio { DataOutputStream writecliet = ew DataOutputStream (clietsocket.getoutputstream()); BufferedReader readcliet = ew BufferedReader(ew IputStreamReader(clietSocket.getIputStream())); fial char URLseparator = '/'; Strig webbase = "." + URLseparator + "src"; //./src (Eclispe) Strig httpheader = ""; Strig clietrequest; Strig servername = "WebServerDemo 1.0";

24 Webserver (http server): behaviour // Parse HTTP request clietrequest = readcliet.readlie().touppercase(); Strig delims = "[ ]+"; //spaces Strig[] tokes = clietrequest.split(delims); Strig cmd = tokes[0]; //HTTP Commad - GET, POST Strig page = tokes[1]; //Page ame Strig versio = tokes[2]; //HTTP Versio // Skip request lies after GET commad // (stop after lie sequece CRLF ou LF ou ull) do { clietrequest = readcliet.readlie(); while (!clietrequest.equals("") &&!clietrequest.equals("\r\") &&!clietrequest.equals("\") ); Webserver (http server): behaviour // Sed page to cliet oly if HTTP COMMAND is GET // other commads are igored if (cmd.equals("get")) { Strig filename = webbase; if (page.charat(0)!= URLseparator) filename += URLseparator; filename += page; if (page.cotais("..")) httperror(403, writecliet); else if (page.cotais("//")) httperror(403, writecliet); else { //Ope page file File f = ew File(fileName); if (!f.exists()) httperror(404, writecliet); else { //sed header to cliet sedheader(servername, f, writecliet); sedfile(f, writecliet); URL: :2000/folder/p

25 Webserver (http server): behaviour //Close I/O streams writecliet.close(); readcliet.close(); //Ed behaviour Auxiliary fuctios private void httperror(it error, DataOutputStream writecliet) throws IOExceptio { Strig html = "HTTP/1.0 "; switch(error) { case 400: html += "400 Bad Request"; break; case 403: html += "403 Forbidde"; break; case 404: html += "404 Not Foud"; break; //... HTTP/ Forbidde html += "\r\\r\"; writecliet.writebytes(html);

26 Auxiliary fuctios private void sedheader(strig servername, File f, DataOutputStream writecliet) throws IOExceptio { Strig header = "HTTP/ OK\r\ ; header += "Coectio: close\r\"; //we ca't hadle //persistet coectios header += servername+"\r\"; header += filetype(f); header += "Cotet-legth: "+f.legth()+"\r\"; // This blak lie marks the ed of the httpheader // ad the start of the body header += "\r\"; writecliet.writebytes(header); HTTP/ OK Coectio: close WebServerDemo 1.0 Cotet-Type: text/html Cotet-legth: Auxiliary fuctios private Strig filetype(file f){ Strig filename = f.getabsolutepath().tolowercase(); Strig type = "Cotet-Type: ; //other extesios are assumed text if (filename.edswith(".zip")) type += "applicatio/x-zip-compressed"; else if (filename.edswith(".gif")) type += "image/gif"; else if (filename.edswith(".jpg") filename.edswith(".jpeg")) type += "image/jpeg"; else if (filename.edswith(".ico")) type+= "image/x-ico"; //plety more types to fill i... else type += "text/html"; retur type += "\r\";

27 Auxiliary fuctios private void sedfile(file f, DataOutputStream writecliet) throws IOExceptio{ FileIputStream fis = ew FileIputStream(f); while (true) { it b = fis.read(); if (b == -1) break; //ed of file writecliet.write(b); fis.close(); //Ed class Testig the webserver, a idex.html file for <html> <head> <title>demo java web server </title> </head> <body> POO 2016/2017 <br> A todos umas férias com muita class! <br> <IMG src="duke_christmas.pg" alt= Bom Natal!"/> </body> </html> 27

28 Check poit: Test the webserver 28

JCF: case studies. Bruce Eckel, Thinking in Java, 4th edition, PrenticeHall, New Jersey, cf.

JCF: case studies. Bruce Eckel, Thinking in Java, 4th edition, PrenticeHall, New Jersey, cf. JCF: case studies Bruce Eckel, Thikig i Java, 4th editio, PreticeHall, New Jersey, cf. http://midview.et/books/tij4 jvo@ualg.pt José Valete de Oliveira 20-1 CS1: From real to fractio How to covert a real

More information

Streams. Overview. The notion of stream Java I/O streamhierarchy Files, and file access using streams Serialization Sockets

Streams. Overview. The notion of stream Java I/O streamhierarchy Files, and file access using streams Serialization Sockets Streams Bruce Eckel, Thikig i Java, 4th editio, PreticeHall, New Jersey, cf. http://midview.et/books/tij4 jvo@ualg.pt José Valete de Oliveira 16-1 Overview The otio of stream Java I/O streamhierarchy Files,

More information

Classes and Objects. Again: Distance between points within the first quadrant. José Valente de Oliveira 4-1

Classes and Objects. Again: Distance between points within the first quadrant. José Valente de Oliveira 4-1 Classes ad Objects jvo@ualg.pt José Valete de Oliveira 4-1 Agai: Distace betwee poits withi the first quadrat Sample iput Sample output 1 1 3 4 2 jvo@ualg.pt José Valete de Oliveira 4-2 1 The simplest

More information

10/23/18. File class in Java. Scanner reminder. Files. Opening a file for reading. Scanner reminder. File Input and Output

10/23/18. File class in Java. Scanner reminder. Files. Opening a file for reading. Scanner reminder. File Input and Output File class i Java File Iput ad Output TOPICS File Iput Exceptio Hadlig File Output Programmers refer to iput/output as "I/O". The File class represets files as objects. The class is defied i the java.io

More information

Abstract Data Types (ADTs) Stacks. The Stack ADT ( 4.2) Stack Interface in Java

Abstract Data Types (ADTs) Stacks. The Stack ADT ( 4.2) Stack Interface in Java Abstract Data Types (ADTs) tacks A abstract data type (ADT) is a abstractio of a data structure A ADT specifies: Data stored Operatios o the data Error coditios associated with operatios Example: ADT modelig

More information

Exceptions. Your computer takes exception. The Exception Class. Causes of Exceptions

Exceptions. Your computer takes exception. The Exception Class. Causes of Exceptions Your computer takes exceptio s s are errors i the logic of a program (ru-time errors). Examples: i thread mai java.io.filenotfoud: studet.txt (The system caot fid the file specified.) i thread mai java.lag.nullpoiter:

More information

Bruce Eckel, Thinking in Patterns with Java, cf. José Valente de Oliveira 10-1

Bruce Eckel, Thinking in Patterns with Java, cf.   José Valente de Oliveira 10-1 The desig patter Template Method Erich Gamma, Richard Helm, Ralph Johso, Joh Vlissides, Desig Patters Elemets of Reusable Object-Orieted Software, Addiso-Wesley, 1995, AKA GoF Bruce Eckel, Thikig i Patters

More information

Overview. Another application of Interfaces: the Strategy Design Pattern. n Java interfaces

Overview. Another application of Interfaces: the Strategy Design Pattern. n Java interfaces Aother applicatio of Iterfaces: the Strategy Desig Patter Erich Gamma, Richard Helm, Ralph Johso, Joh Vlissides, Desig Patters Elemets of Reusable Object- Orieted Software, Addiso-Wesley, 1995, AKA GoF

More information

Exercise Set: Implementing an Object-Oriented Design

Exercise Set: Implementing an Object-Oriented Design Exercise Set: Implemetig a Object-Orieted Desig I this exercise set, we have marked questios we thik are harder tha others with a [ ]. We have also marked questios for which solutios are provided at the

More information

K-NET bus. When several turrets are connected to the K-Bus, the structure of the system is as showns

K-NET bus. When several turrets are connected to the K-Bus, the structure of the system is as showns K-NET bus The K-Net bus is based o the SPI bus but it allows to addressig may differet turrets like the I 2 C bus. The K-Net is 6 a wires bus (4 for SPI wires ad 2 additioal wires for request ad ackowledge

More information

n Some thoughts on software development n The idea of a calculator n Using a grammar n Expression evaluation n Program organization n Analysis

n Some thoughts on software development n The idea of a calculator n Using a grammar n Expression evaluation n Program organization n Analysis Overview Chapter 6 Writig a Program Bjare Stroustrup Some thoughts o software developmet The idea of a calculator Usig a grammar Expressio evaluatio Program orgaizatio www.stroustrup.com/programmig 3 Buildig

More information

CSC 220: Computer Organization Unit 11 Basic Computer Organization and Design

CSC 220: Computer Organization Unit 11 Basic Computer Organization and Design College of Computer ad Iformatio Scieces Departmet of Computer Sciece CSC 220: Computer Orgaizatio Uit 11 Basic Computer Orgaizatio ad Desig 1 For the rest of the semester, we ll focus o computer architecture:

More information

Architectural styles for software systems The client-server style

Architectural styles for software systems The client-server style Architectural styles for software systems The cliet-server style Prof. Paolo Ciacarii Software Architecture CdL M Iformatica Uiversità di Bologa Ageda Cliet server style CS two tiers CS three tiers CS

More information

Threads and Concurrency in Java: Part 1

Threads and Concurrency in Java: Part 1 Cocurrecy Threads ad Cocurrecy i Java: Part 1 What every computer egieer eeds to kow about cocurrecy: Cocurrecy is to utraied programmers as matches are to small childre. It is all too easy to get bured.

More information

Threads and Concurrency in Java: Part 1

Threads and Concurrency in Java: Part 1 Threads ad Cocurrecy i Java: Part 1 1 Cocurrecy What every computer egieer eeds to kow about cocurrecy: Cocurrecy is to utraied programmers as matches are to small childre. It is all too easy to get bured.

More information

Recursion. Computer Science S-111 Harvard University David G. Sullivan, Ph.D. Review: Method Frames

Recursion. Computer Science S-111 Harvard University David G. Sullivan, Ph.D. Review: Method Frames Uit 4, Part 3 Recursio Computer Sciece S-111 Harvard Uiversity David G. Sulliva, Ph.D. Review: Method Frames Whe you make a method call, the Java rutime sets aside a block of memory kow as the frame of

More information

CMPT 125 Assignment 2 Solutions

CMPT 125 Assignment 2 Solutions CMPT 25 Assigmet 2 Solutios Questio (20 marks total) a) Let s cosider a iteger array of size 0. (0 marks, each part is 2 marks) it a[0]; I. How would you assig a poiter, called pa, to store the address

More information

CIS 121 Data Structures and Algorithms with Java Spring Stacks and Queues Monday, February 12 / Tuesday, February 13

CIS 121 Data Structures and Algorithms with Java Spring Stacks and Queues Monday, February 12 / Tuesday, February 13 CIS Data Structures ad Algorithms with Java Sprig 08 Stacks ad Queues Moday, February / Tuesday, February Learig Goals Durig this lab, you will: Review stacks ad queues. Lear amortized ruig time aalysis

More information

CS211 Fall 2003 Prelim 2 Solutions and Grading Guide

CS211 Fall 2003 Prelim 2 Solutions and Grading Guide CS11 Fall 003 Prelim Solutios ad Gradig Guide Problem 1: (a) obj = obj1; ILLEGAL because type of referece must always be a supertype of type of object (b) obj3 = obj1; ILLEGAL because type of referece

More information

. Written in factored form it is easy to see that the roots are 2, 2, i,

. Written in factored form it is easy to see that the roots are 2, 2, i, CMPS A Itroductio to Programmig Programmig Assigmet 4 I this assigmet you will write a java program that determies the real roots of a polyomial that lie withi a specified rage. Recall that the roots (or

More information

WORKED EXAMPLE 7.1. Producing a Mass Mailing. We want to automate the process of producing mass mailings. A typical letter might look as follows:

WORKED EXAMPLE 7.1. Producing a Mass Mailing. We want to automate the process of producing mass mailings. A typical letter might look as follows: Worked Example 7.1 Producig a Mass Mailig 1 WORKED EXAMPLE 7.1 Producig a Mass Mailig We wat to automate the process of producig mass mailigs. A typical letter might look as follows: To: Ms. Sally Smith

More information

Parabolic Path to a Best Best-Fit Line:

Parabolic Path to a Best Best-Fit Line: Studet Activity : Fidig the Least Squares Regressio Lie By Explorig the Relatioship betwee Slope ad Residuals Objective: How does oe determie a best best-fit lie for a set of data? Eyeballig it may be

More information

CS 11 C track: lecture 1

CS 11 C track: lecture 1 CS 11 C track: lecture 1 Prelimiaries Need a CMS cluster accout http://acctreq.cms.caltech.edu/cgi-bi/request.cgi Need to kow UNIX IMSS tutorial liked from track home page Track home page: http://courses.cms.caltech.edu/courses/cs11/material

More information

MOTIF XF Extension Owner s Manual

MOTIF XF Extension Owner s Manual MOTIF XF Extesio Ower s Maual Table of Cotets About MOTIF XF Extesio...2 What Extesio ca do...2 Auto settig of Audio Driver... 2 Auto settigs of Remote Device... 2 Project templates with Iput/ Output Bus

More information

Term Project Report. This component works to detect gesture from the patient as a sign of emergency message and send it to the emergency manager.

Term Project Report. This component works to detect gesture from the patient as a sign of emergency message and send it to the emergency manager. CS2310 Fial Project Loghao Li Term Project Report Itroductio I this project, I worked o expadig exercise 4. What I focused o is makig the real gesture recogizig sesor ad desig proper gestures ad recogizig

More information

Some third-party libraries exist to assist in integrating Twitter into an Android application (from

Some third-party libraries exist to assist in integrating Twitter into an Android application (from 10 Chapter 8 Networkig Social Networkig Twitter is a social etworkig ad microbloggig service that eables its users to sed ad read messages kow as tweets.twitter is described as SMS of the Iteret, ad ideed,

More information

Java Inheritance. Class ADT (Abstract Data Type) Interface. Classes implement the concept of ADT: Interfaces define interaction contracts: Rui Moreira

Java Inheritance. Class ADT (Abstract Data Type) Interface. Classes implement the concept of ADT: Interfaces define interaction contracts: Rui Moreira Java Iheritace Rui Moreira Class ADT (Abstract Data Type) Classes implemet the cocept of ADT: Provide a coheret represetatio for the declaratio of structured data types ad also the code for maipulatig

More information

CS 111: Program Design I Lecture # 7: First Loop, Web Crawler, Functions

CS 111: Program Design I Lecture # 7: First Loop, Web Crawler, Functions CS 111: Program Desig I Lecture # 7: First Loop, Web Crawler, Fuctios Robert H. Sloa & Richard Warer Uiversity of Illiois at Chicago September 18, 2018 What will this prit? x = 5 if x == 3: prit("hi!")

More information

Definitions. Error. A wrong decision made during software development

Definitions. Error. A wrong decision made during software development Debuggig Defiitios Error A wrog decisio made durig software developmet Defiitios 2 Error A wrog decisio made durig software developmet Defect bug sometimes meas this The term Fault is also used Property

More information

Elementary Educational Computer

Elementary Educational Computer Chapter 5 Elemetary Educatioal Computer. Geeral structure of the Elemetary Educatioal Computer (EEC) The EEC coforms to the 5 uits structure defied by vo Neuma's model (.) All uits are preseted i a simplified

More information

CS 111: Program Design I Lecture 19: Networks, the Web, and getting text from the Web in Python

CS 111: Program Design I Lecture 19: Networks, the Web, and getting text from the Web in Python CS 111: Program Desig I Lecture 19: Networks, the Web, ad gettig text from the Web i Pytho Robert H. Sloa & Richard Warer Uiversity of Illiois at Chicago April 3, 2018 Goals Lear about Iteret Lear about

More information

Chapter 10. Defining Classes. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

Chapter 10. Defining Classes. Copyright 2015 Pearson Education, Ltd.. All rights reserved. Chapter 10 Defiig Classes Copyright 2015 Pearso Educatio, Ltd.. All rights reserved. Overview 10.1 Structures 10.2 Classes 10.3 Abstract Data Types 10.4 Itroductio to Iheritace Copyright 2015 Pearso Educatio,

More information

Linked Lists 11/16/18. Preliminaries. Java References. Objects and references. Self references. Linking self-referential nodes

Linked Lists 11/16/18. Preliminaries. Java References. Objects and references. Self references. Linking self-referential nodes Prelimiaries Liked Lists public class StrageObject { Strig ame; StrageObject other; Arrays are ot always the optimal data structure: A array has fixed size eeds to be copied to expad its capacity Addig

More information

Weston Anniversary Fund

Weston Anniversary Fund Westo Olie Applicatio Guide 2018 1 This guide is desiged to help charities applyig to the Westo to use our olie applicatio form. The Westo is ope to applicatios from 5th Jauary 2018 ad closes o 30th Jue

More information

Chapter 1. Introduction to Computers and C++ Programming. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

Chapter 1. Introduction to Computers and C++ Programming. Copyright 2015 Pearson Education, Ltd.. All rights reserved. Chapter 1 Itroductio to Computers ad C++ Programmig Copyright 2015 Pearso Educatio, Ltd.. All rights reserved. Overview 1.1 Computer Systems 1.2 Programmig ad Problem Solvig 1.3 Itroductio to C++ 1.4 Testig

More information

Chapter 5. Functions for All Subtasks. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

Chapter 5. Functions for All Subtasks. Copyright 2015 Pearson Education, Ltd.. All rights reserved. Chapter 5 Fuctios for All Subtasks Copyright 2015 Pearso Educatio, Ltd.. All rights reserved. Overview 5.1 void Fuctios 5.2 Call-By-Referece Parameters 5.3 Usig Procedural Abstractio 5.4 Testig ad Debuggig

More information

Computers and Scientific Thinking

Computers and Scientific Thinking Computers ad Scietific Thikig David Reed, Creighto Uiversity Chapter 15 JavaScript Strigs 1 Strigs as Objects so far, your iteractive Web pages have maipulated strigs i simple ways use text box to iput

More information

Threads and Concurrency in Java: Part 2

Threads and Concurrency in Java: Part 2 Threads ad Cocurrecy i Java: Part 2 1 Waitig Sychroized methods itroduce oe kid of coordiatio betwee threads. Sometimes we eed a thread to wait util a specific coditio has arise. 2003--09 T. S. Norvell

More information

System and Software Architecture Description (SSAD)

System and Software Architecture Description (SSAD) System ad Software Architecture Descriptio (SSAD) Diabetes Health Platform Team #6 Jasmie Berry (Cliet) Veerav Naidu (Project Maager) Mukai Nog (Architect) Steve South (IV&V) Vijaya Prabhakara (Quality

More information

Chapter 4 The Datapath

Chapter 4 The Datapath The Ageda Chapter 4 The Datapath Based o slides McGraw-Hill Additioal material 24/25/26 Lewis/Marti Additioal material 28 Roth Additioal material 2 Taylor Additioal material 2 Farmer Tae the elemets that

More information

Multi-threaded Web Server (Assignment 1) Georgios Georgiadis

Multi-threaded Web Server (Assignment 1) Georgios Georgiadis Multi-threaded Web Server (Assignment 1) Georgios Georgiadis Overview Multi-threaded Web Server What to do and how to do it HTTP messages Processes and threads ComputerComm '09 2 Multi-threaded Web Server

More information

Chapter 11. Friends, Overloaded Operators, and Arrays in Classes. Copyright 2014 Pearson Addison-Wesley. All rights reserved.

Chapter 11. Friends, Overloaded Operators, and Arrays in Classes. Copyright 2014 Pearson Addison-Wesley. All rights reserved. Chapter 11 Frieds, Overloaded Operators, ad Arrays i Classes Copyright 2014 Pearso Addiso-Wesley. All rights reserved. Overview 11.1 Fried Fuctios 11.2 Overloadig Operators 11.3 Arrays ad Classes 11.4

More information

Chapter 8. Strings and Vectors. Copyright 2014 Pearson Addison-Wesley. All rights reserved.

Chapter 8. Strings and Vectors. Copyright 2014 Pearson Addison-Wesley. All rights reserved. Chapter 8 Strigs ad Vectors Overview 8.1 A Array Type for Strigs 8.2 The Stadard strig Class 8.3 Vectors Slide 8-3 8.1 A Array Type for Strigs A Array Type for Strigs C-strigs ca be used to represet strigs

More information

Chapter 5: Processor Design Advanced Topics. Microprogramming: Basic Idea

Chapter 5: Processor Design Advanced Topics. Microprogramming: Basic Idea 5-1 Chapter 5 Processor Desig Advaced Topics Chapter 5: Processor Desig Advaced Topics Topics 5.3 Microprogrammig Cotrol store ad microbrachig Horizotal ad vertical microprogrammig 5- Chapter 5 Processor

More information

3.1 Overview of MySQL Programs. These programs are discussed further in Chapter 4, Database Administration. Client programs that access the server:

3.1 Overview of MySQL Programs. These programs are discussed further in Chapter 4, Database Administration. Client programs that access the server: 3 Usig MySQL Programs This chapter provides a brief overview of the programs provided by MySQL AB ad discusses how to specify optios whe you ru these programs. Most programs have optios that are specific

More information

Web Server Project. Tom Kelliher, CS points, due May 4, 2011

Web Server Project. Tom Kelliher, CS points, due May 4, 2011 Web Server Project Tom Kelliher, CS 325 100 points, due May 4, 2011 Introduction (From Kurose & Ross, 4th ed.) In this project you will develop a Web server in two steps. In the end, you will have built

More information

COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. Chapter 4. The Processor. Part A Datapath Design

COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. Chapter 4. The Processor. Part A Datapath Design COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Iterface 5 th Editio Chapter The Processor Part A path Desig Itroductio CPU performace factors Istructio cout Determied by ISA ad compiler. CPI ad

More information

Chapter 9. Pointers and Dynamic Arrays. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

Chapter 9. Pointers and Dynamic Arrays. Copyright 2015 Pearson Education, Ltd.. All rights reserved. Chapter 9 Poiters ad Dyamic Arrays Copyright 2015 Pearso Educatio, Ltd.. All rights reserved. Overview 9.1 Poiters 9.2 Dyamic Arrays Copyright 2015 Pearso Educatio, Ltd.. All rights reserved. Slide 9-3

More information

Topics. Instance object. Instance object. Fundamentals of OT. Object notation. How do objects collaborate? Pearson Education 2007 Appendix (RASD 3/e)

Topics. Instance object. Instance object. Fundamentals of OT. Object notation. How do objects collaborate? Pearson Education 2007 Appendix (RASD 3/e) Appedix (RASD 3/e) MACIASZEK, L.A. (2007): Requiremets Aalysis ad System Desig, 3 rd ed. Addiso Wesley, Harlow Eglad ISBN 978-0-321-44036-5 Appedix Fudametals of Object Techology Pearso Educatio Limited

More information

CIS 121. Introduction to Trees

CIS 121. Introduction to Trees CIS 121 Itroductio to Trees 1 Tree ADT Tree defiitio q A tree is a set of odes which may be empty q If ot empty, the there is a distiguished ode r, called root ad zero or more o-empty subtrees T 1, T 2,

More information

Exercise 6 (Week 42) For the foreign students only.

Exercise 6 (Week 42) For the foreign students only. These are the last exercises of the course. Please, remember that to pass exercises, the sum of the poits gathered by solvig the questios ad attedig the exercise groups must be at least 4% ( poits) of

More information

Solution printed. Do not start the test until instructed to do so! CS 2604 Data Structures Midterm Spring, Instructions:

Solution printed. Do not start the test until instructed to do so! CS 2604 Data Structures Midterm Spring, Instructions: CS 604 Data Structures Midterm Sprig, 00 VIRG INIA POLYTECHNIC INSTITUTE AND STATE U T PROSI M UNI VERSI TY Istructios: Prit your ame i the space provided below. This examiatio is closed book ad closed

More information

Chapter 8. Strings and Vectors. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

Chapter 8. Strings and Vectors. Copyright 2015 Pearson Education, Ltd.. All rights reserved. Chapter 8 Strigs ad Vectors Copyright 2015 Pearso Educatio, Ltd.. All rights reserved. Overview 8.1 A Array Type for Strigs 8.2 The Stadard strig Class 8.3 Vectors Copyright 2015 Pearso Educatio, Ltd..

More information

Project 2.5 Improved Euler Implementation

Project 2.5 Improved Euler Implementation Project 2.5 Improved Euler Implemetatio Figure 2.5.10 i the text lists TI-85 ad BASIC programs implemetig the improved Euler method to approximate the solutio of the iitial value problem dy dx = x+ y,

More information

Today s objectives. CSE401: Introduction to Compiler Construction. What is a compiler? Administrative Details. Why study compilers?

Today s objectives. CSE401: Introduction to Compiler Construction. What is a compiler? Administrative Details. Why study compilers? CSE401: Itroductio to Compiler Costructio Larry Ruzzo Sprig 2004 Today s objectives Admiistrative details Defie compilers ad why we study them Defie the high-level structure of compilers Associate specific

More information

Python Programming: An Introduction to Computer Science

Python Programming: An Introduction to Computer Science Pytho Programmig: A Itroductio to Computer Sciece Chapter 1 Computers ad Programs 1 Objectives To uderstad the respective roles of hardware ad software i a computig system. To lear what computer scietists

More information

Lazy Type Changes in Object-oriented Database. Shan Ming Woo and Barbara Liskov MIT Lab. for Computer Science December 1999

Lazy Type Changes in Object-oriented Database. Shan Ming Woo and Barbara Liskov MIT Lab. for Computer Science December 1999 Lazy Type Chages i Object-orieted Database Sha Mig Woo ad Barbara Liskov MIT Lab. for Computer Sciece December 1999 Backgroud wbehavior of OODB apps compose of behavior of persistet obj wbehavior of objects

More information

Chapter 6. I/O Streams as an Introduction to Objects and Classes. Copyright 2014 Pearson Addison-Wesley. All rights reserved.

Chapter 6. I/O Streams as an Introduction to Objects and Classes. Copyright 2014 Pearson Addison-Wesley. All rights reserved. Chapter 6 I/O Streams as a Itroductio to Objects ad Classes Overview 6.1 Streams ad Basic File I/O 6.2 Tools for Stream I/O 6.3 Character I/O Slide 6-3 6.1 Streams ad Basic File I/O I/O Streams I/O refers

More information

CSC165H1 Worksheet: Tutorial 8 Algorithm analysis (SOLUTIONS)

CSC165H1 Worksheet: Tutorial 8 Algorithm analysis (SOLUTIONS) CSC165H1, Witer 018 Learig Objectives By the ed of this worksheet, you will: Aalyse the ruig time of fuctios cotaiig ested loops. 1. Nested loop variatios. Each of the followig fuctios takes as iput a

More information

CSE 111 Bio: Program Design I Class 11: loops

CSE 111 Bio: Program Design I Class 11: loops SE 111 Bio: Program Desig I lass 11: loops Radall Muroe, xkcd.com/1411/ Robert H. Sloa (S) & Rachel Poretsky (Bio) Uiversity of Illiois, hicago October 2, 2016 Pytho ets Loopy! he Pytho, Busch ardes Florida

More information

Baan Tools User Management

Baan Tools User Management Baa Tools User Maagemet Module Procedure UP008A US Documetiformatio Documet Documet code : UP008A US Documet group : User Documetatio Documet title : User Maagemet Applicatio/Package : Baa Tools Editio

More information

Pattern Recognition Systems Lab 1 Least Mean Squares

Pattern Recognition Systems Lab 1 Least Mean Squares Patter Recogitio Systems Lab 1 Least Mea Squares 1. Objectives This laboratory work itroduces the OpeCV-based framework used throughout the course. I this assigmet a lie is fitted to a set of poits usig

More information

Solutions to Final COMS W4115 Programming Languages and Translators Monday, May 4, :10-5:25pm, 309 Havemeyer

Solutions to Final COMS W4115 Programming Languages and Translators Monday, May 4, :10-5:25pm, 309 Havemeyer Departmet of Computer ciece Columbia Uiversity olutios to Fial COM W45 Programmig Laguages ad Traslators Moday, May 4, 2009 4:0-5:25pm, 309 Havemeyer Closed book, o aids. Do questios 5. Each questio is

More information

top() Applications of Stacks

top() Applications of Stacks CS22 Algorithms ad Data Structures MW :00 am - 2: pm, MSEC 0 Istructor: Xiao Qi Lecture 6: Stacks ad Queues Aoucemets Quiz results Homework 2 is available Due o September 29 th, 2004 www.cs.mt.edu~xqicoursescs22

More information

Avid Interplay Bundle

Avid Interplay Bundle Avid Iterplay Budle Versio 2.5 Cofigurator ReadMe Overview This documet provides a overview of Iterplay Budle v2.5 ad describes how to ru the Iterplay Budle cofiguratio tool. Iterplay Budle v2.5 refers

More information

CS 111: Program Design I Lecture 16: Module Review, Encodings, Lists

CS 111: Program Design I Lecture 16: Module Review, Encodings, Lists CS 111: Program Desig I Lecture 16: Module Review, Ecodigs, Lists Robert H. Sloa & Richard Warer Uiversity of Illiois at Chicago October 18, 2016 Last time Dot otatio ad methods Padas: user maual poit

More information

Python Programming: An Introduction to Computer Science

Python Programming: An Introduction to Computer Science Pytho Programmig: A Itroductio to Computer Sciece Chapter 6 Defiig Fuctios Pytho Programmig, 2/e 1 Objectives To uderstad why programmers divide programs up ito sets of cooperatig fuctios. To be able to

More information

Structuring Redundancy for Fault Tolerance. CSE 598D: Fault Tolerant Software

Structuring Redundancy for Fault Tolerance. CSE 598D: Fault Tolerant Software Structurig Redudacy for Fault Tolerace CSE 598D: Fault Tolerat Software What do we wat to achieve? Versios Damage Assessmet Versio 1 Error Detectio Iputs Versio 2 Voter Outputs State Restoratio Cotiued

More information

Hash Tables. Presentation for use with the textbook Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015.

Hash Tables. Presentation for use with the textbook Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015. Presetatio for use with the textbook Algorithm Desig ad Applicatios, by M. T. Goodrich ad R. Tamassia, Wiley, 2015 Hash Tables xkcd. http://xkcd.com/221/. Radom Number. Used with permissio uder Creative

More information

BEA WebLogic Server. Programming WebLogic Enterprise JavaBeans

BEA WebLogic Server. Programming WebLogic Enterprise JavaBeans BEA WebLogic Server Programmig WebLogic Eterprise JavaBeas WebLogic Server 6.0 Documet Date March 3, 2001 Copyright Copyright 2001 BEA Systems, Ic. All Rights Reserved. Restricted Rights Leged This software

More information

Overview. Chapter 18 Vectors and Arrays. Reminder. vector. Bjarne Stroustrup

Overview. Chapter 18 Vectors and Arrays. Reminder. vector. Bjarne Stroustrup Chapter 18 Vectors ad Arrays Bjare Stroustrup Vector revisited How are they implemeted? Poiters ad free store Destructors Iitializatio Copy ad move Arrays Array ad poiter problems Chagig size Templates

More information

CSE 417: Algorithms and Computational Complexity

CSE 417: Algorithms and Computational Complexity Time CSE 47: Algorithms ad Computatioal Readig assigmet Read Chapter of The ALGORITHM Desig Maual Aalysis & Sortig Autum 00 Paul Beame aalysis Problem size Worst-case complexity: max # steps algorithm

More information

Review: The ACID properties

Review: The ACID properties Recovery Review: The ACID properties A tomicity: All actios i the Xactio happe, or oe happe. C osistecy: If each Xactio is cosistet, ad the DB starts cosistet, it eds up cosistet. I solatio: Executio of

More information

Goals of the Lecture UML Implementation Diagrams

Goals of the Lecture UML Implementation Diagrams Goals of the Lecture UML Implemetatio Diagrams Object-Orieted Aalysis ad Desig - Fall 1998 Preset UML Diagrams useful for implemetatio Provide examples Next Lecture Ð A variety of topics o mappig from

More information

COP4020 Programming Languages. Functional Programming Prof. Robert van Engelen

COP4020 Programming Languages. Functional Programming Prof. Robert van Engelen COP4020 Programmig Laguages Fuctioal Programmig Prof. Robert va Egele Overview What is fuctioal programmig? Historical origis of fuctioal programmig Fuctioal programmig today Cocepts of fuctioal programmig

More information

Overview Chapter 12 A display model

Overview Chapter 12 A display model Overview Chapter 12 A display model Why graphics? A graphics model Examples Bjare Stroustrup www.stroustrup.com/programmig 3 Why bother with graphics ad GUI? Why bother with graphics ad GUI? It s very

More information

Appendix D. Controller Implementation

Appendix D. Controller Implementation COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Iterface 5 th Editio Appedix D Cotroller Implemetatio Cotroller Implemetatios Combiatioal logic (sigle-cycle); Fiite state machie (multi-cycle, pipelied);

More information

CS200: Hash Tables. Prichard Ch CS200 - Hash Tables 1

CS200: Hash Tables. Prichard Ch CS200 - Hash Tables 1 CS200: Hash Tables Prichard Ch. 13.2 CS200 - Hash Tables 1 Table Implemetatios: average cases Search Add Remove Sorted array-based Usorted array-based Balaced Search Trees O(log ) O() O() O() O(1) O()

More information

Politecnico di Milano Advanced Network Technologies Laboratory. Internet of Things. Projects

Politecnico di Milano Advanced Network Technologies Laboratory. Internet of Things. Projects Politecico di Milao Advaced Network Techologies Laboratory Iteret of Thigs Projects 2016-2017 Politecico di Milao Advaced Network Techologies Laboratory Geeral Rules Geeral Rules o Gradig 26/30 are assiged

More information

COMP 213. Advanced Object-oriented Programming. Lecture 20. Network Programming

COMP 213. Advanced Object-oriented Programming. Lecture 20. Network Programming COMP 213 Advanced Object-oriented Programming Lecture 20 Network Programming Network Programming A network consists of several computers connected so that data can be sent from one to another. Network

More information

CS 111: Program Design I Lecture 18: Web and getting text from it

CS 111: Program Design I Lecture 18: Web and getting text from it CS 111: Program Desig I Lecture 18: Web ad gettig text from it Robert H. Sloa & Richard Warer Uiversity of Illiois at Chicago October 25, 2016 Goals Lear about Iteret ad how to access it directly from

More information

JDBC (Java Database Connectivity)

JDBC (Java Database Connectivity) JDBC (Java Database Coectivity) Database System Cocepts, 6 th Ed. Siberschatz, Korth ad Sudarsha See www.db-book.com for coditios o re-use JDBC Java API for commuicatig with database systems supportig

More information

n Maurice Wilkes, 1949 n Organize software to minimize errors. n Eliminate most of the errors we made anyway.

n Maurice Wilkes, 1949 n Organize software to minimize errors. n Eliminate most of the errors we made anyway. Bjare Stroustrup www.stroustrup.com/programmig Chapter 5 Errors Abstract Whe we program, we have to deal with errors. Our most basic aim is correctess, but we must deal with icomplete problem specificatios,

More information

BEA Tuxedo. Using the CORBA Name Service

BEA Tuxedo. Using the CORBA Name Service BEA Tuxedo Usig the CORBA Name Service BEA Tuxedo Release 8.0 Documet Editio 8.0 Jue 2001 Copyright Copyright 2001 BEA Systems, Ic. All Rights Reserved. Restricted Rights Leged This software ad documetatio

More information

Computational Geometry

Computational Geometry Computatioal Geometry Chapter 4 Liear programmig Duality Smallest eclosig disk O the Ageda Liear Programmig Slides courtesy of Craig Gotsma 4. 4. Liear Programmig - Example Defie: (amout amout cosumed

More information

CSE 111 Bio: Program Design I Lecture 17: software development, list methods

CSE 111 Bio: Program Design I Lecture 17: software development, list methods CSE 111 Bio: Program Desig I Lecture 17: software developmet, list methods Robert H. Sloa(CS) & Rachel Poretsky(Bio) Uiversity of Illiois, Chicago October 19, 2017 NESTED LOOPS: REVIEW Geerate times table

More information

Software development of components for complex signal analysis on the example of adaptive recursive estimation methods.

Software development of components for complex signal analysis on the example of adaptive recursive estimation methods. Software developmet of compoets for complex sigal aalysis o the example of adaptive recursive estimatio methods. SIMON BOYMANN, RALPH MASCHOTTA, SILKE LEHMANN, DUNJA STEUER Istitute of Biomedical Egieerig

More information

Customer Portal Quick Reference User Guide

Customer Portal Quick Reference User Guide Customer Portal Quick Referece User Guide Overview This user guide is iteded for FM Approvals customers usig the Approval Iformatio Maagemet (AIM) customer portal to track their active projects. AIM is

More information

CMSC Computer Architecture Lecture 12: Virtual Memory. Prof. Yanjing Li University of Chicago

CMSC Computer Architecture Lecture 12: Virtual Memory. Prof. Yanjing Li University of Chicago CMSC 22200 Computer Architecture Lecture 12: Virtual Memory Prof. Yajig Li Uiversity of Chicago A System with Physical Memory Oly Examples: most Cray machies early PCs Memory early all embedded systems

More information

Chapter 4 Remote Procedure Calls and Distributed Transactions

Chapter 4 Remote Procedure Calls and Distributed Transactions Prof. Dr.-Ig. Stefa Deßloch AG Heterogee Iformatiossysteme Geb. 36, Raum 329 Tel. 0631/205 3275 dessloch@iformatik.ui-kl.de Chapter 4 Remote Procedure Calls ad Distributed Trasactios Outlie Remote Procedure

More information

Message Integrity and Hash Functions. TELE3119: Week4

Message Integrity and Hash Functions. TELE3119: Week4 Message Itegrity ad Hash Fuctios TELE3119: Week4 Outlie Message Itegrity Hash fuctios ad applicatios Hash Structure Popular Hash fuctios 4-2 Message Itegrity Goal: itegrity (ot secrecy) Allows commuicatig

More information

Extending The Sleuth Kit and its Underlying Model for Pooled Storage File System Forensic Analysis

Extending The Sleuth Kit and its Underlying Model for Pooled Storage File System Forensic Analysis Extedig The Sleuth Kit ad its Uderlyig Model for Pooled File System Foresic Aalysis Frauhofer Istitute for Commuicatio, Iformatio Processig ad Ergoomics Ja-Niclas Hilgert* Marti Lambertz Daiel Plohma ja-iclas.hilgert@fkie.frauhofer.de

More information

BEA Tuxedo. Creating CORBA Client Applications

BEA Tuxedo. Creating CORBA Client Applications BEA Tuxedo Creatig CORBA Cliet Applicatios BEA Tuxedo 8.0 Documet Editio 8.0 Jue 2001 Copyright Copyright 2001 BEA Systems, Ic. All Rights Reserved. Restricted Rights Leged This software ad documetatio

More information

COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. Chapter 4. The Processor. Single-Cycle Disadvantages & Advantages

COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. Chapter 4. The Processor. Single-Cycle Disadvantages & Advantages COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Iterface 5 th Editio Chapter 4 The Processor Pipeliig Sigle-Cycle Disadvatages & Advatages Clk Uses the clock cycle iefficietly the clock cycle must

More information

1/27/12. Vectors: Outline and Reading. Chapter 6: Vectors, Lists and Sequences. The Vector ADT. Applications of Vectors. Array based Vector: Insertion

1/27/12. Vectors: Outline and Reading. Chapter 6: Vectors, Lists and Sequences. The Vector ADT. Applications of Vectors. Array based Vector: Insertion Chater 6: ectors, Lists ad Sequeces ectors: Outlie ad Readig The ector ADT ( 6.1.1) Array-based imlemetatio ( 6.1.2) Nacy Amato Parasol Lab, Det. CSE, Texas A&M Uiversity Ackowledgemet: These slides are

More information

Unit 2. Basic Linux Security

Unit 2. Basic Linux Security it 2 Basic Liux ecurity oa Warre Cofigurig g Cliet ervices Cofigure superservers to hadle multiple etwork services et up admiistrative services like loggig ad pritig se simple etwork iformatio services

More information

Abstract. Chapter 4 Computation. Overview 8/13/18. Bjarne Stroustrup Note:

Abstract. Chapter 4 Computation. Overview 8/13/18. Bjarne Stroustrup   Note: Chapter 4 Computatio Bjare Stroustrup www.stroustrup.com/programmig Abstract Today, I ll preset the basics of computatio. I particular, we ll discuss expressios, how to iterate over a series of values

More information

EVALUATION OF TRIGONOMETRIC FUNCTIONS

EVALUATION OF TRIGONOMETRIC FUNCTIONS EVALUATION OF TRIGONOMETRIC FUNCTIONS Whe first exposed to trigoometric fuctios i high school studets are expected to memorize the values of the trigoometric fuctios of sie cosie taget for the special

More information

Code Review Defects. Authors: Mika V. Mäntylä and Casper Lassenius Original version: 4 Sep, 2007 Made available online: 24 April, 2013

Code Review Defects. Authors: Mika V. Mäntylä and Casper Lassenius Original version: 4 Sep, 2007 Made available online: 24 April, 2013 Code Review s Authors: Mika V. Mätylä ad Casper Lasseius Origial versio: 4 Sep, 2007 Made available olie: 24 April, 2013 This documet cotais further details of the code review defects preseted i [1]. of

More information

Creating Test Harnesses and Starter Applications

Creating Test Harnesses and Starter Applications 03 6000 ch02 11/18/03 8:54 AM Page 27 Creatig Test Haresses ad Starter Applicatios Applicatio Types You Ca Create with Visual C++ Visual C++.NET comes with a package of wizards that geerate startig code

More information