GUI Events App1 mouse click OK App2 OK Cancel Cancel App2 code: App1 event loop Window System input device event loop which app? App2 event loop which callback? OKbtn_click() { do stuff; } OKbtn_mouseover() { do more stuff; } CancelBtn_click() { do different stuff; }
View full slide show




Example: configuration • • • Questions: 1.How does a new worker query ZK for a configuration? 2. How does an administrator change the configuration on the fly? 3. How do the workers read the new configuration? [configuration stored in /app1/config] 1.getData(/app1/config,true) 2.setData(/app1/config/config_data,-1) [notify watching clients] 3. getData(/app1/config,true) • • • String create(path, data, flags) void delete(path, version) watch) Stat exists(path, (data, Stat) getData(path, watch) Stat setData(path, data, version) String[] getChildren(path, watch) / / app configuration app1 / app1/confi 30 / app1/progres / app2
View full slide show




“Software Defined Networking” approach to open it App App App Network Operating System App App App Operating Operating System System App Specialized Specialized Packet Packet Forwarding Forwarding Hardware Hardware App App App App Operating System System Specialized Packet Forwarding Forwarding Hardware Hardware App Operating System System App Specialized Specialized Packet Packet Forwarding Forwarding Hardware Hardware App App Operating Operating System System App App App Operating Operating System System Specialized Specialized Packet Packet Forwarding Hardware Forwarding Hardware Specialized Specialized Packet Packet Forwarding Hardware Forwarding Hardware
View full slide show




Mouse Events • Events related to the mouse are separated into mouse events and mouse motion events • Mouse Events: mouse pressed the mouse button is pressed down mouse released the mouse button is released mouse clicked the mouse button is pressed down and released without moving the mouse in between mouse entered the mouse pointer is moved onto (over) a component mouse exited the mouse pointer is moved off of a component © 2004 Pearson Addison-Wesley. All rights reserved 7-49
View full slide show




Example: simple locks • • • • • • String create(path, data, flags) void delete(path, version) Stat exists(path, watch) (data, Stat) getData(path, watch) Stat setData(path, data, version) String[] getChildren(path, watch) Question: 1. How can all workers of an application use a single resource through a lock? create(/app1/lock1,…,EPHE.) ok? yes /app1 use locked resource /app1/workers/worker1 /app1/workers /app1/lock1 /app1/workers/worker2 getData(/app1/lock1,true) all processes compete at all times for the lock 36 /
View full slide show




znodes • znodes are not designed for general data storage (usually require storage in the order of kilobytes) • znodes map to abstractions of the client application Group membership protocol: Client process pi creates znode p_i under /app1. /app1 persists as long as the process is running. / /app1 /app1/p_1 /app1/p_2 /app1/p_3 22 /app2
View full slide show




using UnityEngine; using System.Collections; public class example : MonoBehaviour { This is quite an interesting (i.e., tricky) example of Unity’s Immediate Mode GUI! How many times is DoMyWindow called? 2X When is DoMyWindow called? Immediately after each call to GUI.Window (note that GUI.color is static). public Rect windowRect0 = new Rect( 20, 20, 120, 50 ); public Rect windowRect1 = new Rect( 20, 100, 120, 50 ); void OnGUI ( ) { GUI.color = Color.red; windowRect0 = GUI.Window( 0, windowRect0, DoMyWindow, "Red Window" ); GUI.color = Color.green; windowRect1 = GUI.Window( 1, windowRect1, DoMyWindow, "Green Window" ); } void DoMyWindow ( int windowID ) { if (GUI.Button(new Rect(10, 20, 100, 20), "Hello World")) print( "Got a click in window with color " + GUI.color ); GUI.DragWindow( new Rect(0, 0, 10000, 10000) ); } } //make window drag-able within this area
View full slide show




Current Internet Closed to Innovations in the Infrastructure Closed App App App Operating Operating System System App Specialized Specialized Packet Packet Forwarding Forwarding Hardware Hardware App App App App Operating System System Specialized Packet Forwarding Forwarding Hardware Hardware App Operating System System App Specialized Specialized Packet Packet Forwarding Forwarding Hardware Hardware App App Operating Operating System System App App App Specialized Specialized Packet Packet Forwarding Hardware Forwarding Hardware Operating Operating System System Specialized Specialized Packet Packet Forwarding Hardware Forwarding Hardware 3
View full slide show




XP JavaScript Event Holders This figure describes event handlers that JavaScript provides. Category Event Handler Description Netscape IE Window and Document events onload The browser has completed loading the document. 2.0 3.0 onunload The browser has completed unloading the document. 2.0 3.0 onabort onerror The transfer of an image as been aborted. An error has occurred in the JavaScript program. 3.0 3.0 4.0 4.0 onmove onresize onscroll onfocus onblur onchange onselect The user has moved the browser window. The user has resized the browser window. The user has moved the scrollbar. The user has entered an input field. The user has exited an input field. The content of an input field has changed. The user has selected text in an input or textarea field. 4.0 4.0 2.0 2.0 2.0 2.0 3.0 4.0 4.0 3.0 3.0 3.0 3.0 onsubmit onreset onkeydown onkeyup onkeypress onclick ondblclick onmousedown onmouseup onmousemove onmouseover onmouseout A form has been submitted. The user has clicked the Reset button. The user has begun pressing a key. The user has released a key. The user has pressed and released a key. The user has clicked the mouse button. The user has double-clicked the mouse button. The user has begun pressing the mouse button. The user has released the mouse button. The user has moved the mouse pointer. The user has moved the mouse over an element. The user has moved the mouse out from an element. 2.0 3.0 4.0 4.0 4.0 2.0 4.0 4.0 4.0 4.0 2.0 3.0 3.0 4.0 4.0 4.0 4.0 3.0 4.0 4.0 4.0 4.0 3.0 4.0 Form events Keyboard and Mouse events Creating Web Pages with HTML, 3e Prepared by: C. Hueckstaedt, Tutorial 9 36
View full slide show




Example: group membership • • • • • Questions: 1.How can all workers (slaves) of an application register themselves on ZK? 2. How can a process find out about all active workers of an application? • String create(path, data, flags) void delete(path, version) watch) Stat exists(path, (data, Stat) getData(path, watch) Stat setData(path, data, version) String[] getChildren(path, watch) / /app1 [a znode is designated to store workers] 3.create(/app1/workers/ worker,data,EPHEMERAL) 4. getChildren(/app1/wor kers,true) /app1/workers/worker1 31 /app1/workers /app1/workers/worker2
View full slide show




Example: locking without herd effect id=create(/app1/locks/lock_,SEQ.|EPHE.) ids = getChildren(/app1/locks/,false) id=min(ids )? ye s / exit (use lock) /app1 no /app1/locks exists(max_id
View full slide show




Example: leader election • • • • • • String create(path, data, flags) void delete(path, version) watch) Stat exists(path, (data, Stat) getData(path, watch) Stat setData(path, data, version) String[] getChildren(path, watch) Question: 1. How can all workers of an application elect a leader among themselves? getData(/app1/workers/leader,true) / ok ? ye s follow /app1 create(/app1/workers/leader,IP,EPHE.) n o ok ? lead /app1/workers/leader ye s 38 if the leader dies, elect again (“herd effect”) /app1/workers /app1/workers/worker1
View full slide show




ASCII Confirmation Program #3 ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code # # # # # # # # # # # # # # # # 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 is: is: is: is: is: is: is: is: is: is: is: is: is: is: is: is: @ A B C D E F G H I J K L M N O ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII Characters & Strings Lesson 1 CS1313 Fall 2016 Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code # # # # # # # # # # # # # # # # 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 is: is: is: is: is: is: is: is: is: is: is: is: is: is: is: is: P Q R S T U V W X Y Z [ \ ] ^ _ 16
View full slide show




Lync 2013 Quick Reference Use audio call controls Pause on the phone/mic button to access the controls: • To put the call on hold, click Hold Call. • Click Mute to mute your audio. • To send the call to another number, click the Transfer Call tab, and choose one of the numbers. • To hang up, click the phone button in the conversation window. Check your voice mail 1. Click the Phone tab. You’ll see your messages and the caller’s info. 2. Pause on a voice mail message and click Play. 3. Click More Options, and select one of the choices, such as: Quick Reference for Set up your audio device 1. Click Select Primary Device on the lower-left corner of Lync, then click Audio Device Settings. 2. Pick your device from the Audio Device menu, and adjust Speakers and Microphone volume. Make a call • Delete Item deletes the voice mail from Lync. Make a Lync call (computer audio) • Mark item as Read • Call the contact. • See Contact Card You can also click View more in Outlook to open the Voice Mail folder for more info. 1. Pause on a contact’s picture. 2. Click the Phone button to call the contact using Lync, or click the arrow next to the Phone button and select a number. Call using the dial pad 3. Click the Phone icon in Lync. 4. Click the numbers on the dial pad or type the number in the search box, then click Call. Lync calls the number just like a © 2012 Microsoft Corporation. All rights reserved. Voice Before using Lync to make a call or join a conference, set up your audio device and check the quality. You can use your computer’s mic and speakers, or plug in a headset. • Open Item in Outlook provides more information about the call. • Start a Video Call with the contact. 4. Audio regular phone.
View full slide show




RAPTORGraph Syntax and Semantics RAPTORGraph is a collection of procedures and functions that a RAPTOR programmer can use to create a graphics window, draw and animate graphical objects in that window, and interact with the graphics window using the keyboard and mouse. Procedure calls occur only in call symbols. Function calls return a value and therefore can occur anywhere a value can occur. (i.e. in assignment, decision, and output statements and as procedure call parameters.) Graphic window opening and closing procedures Open_Graph_Window( X_Size, Y_Size ) Close_Graph_Window Graphic window “size” functions Get_Max_Width -> returns available screen pixel width Get_Max_Height -> returns available screen pixel height Get_Window_Width -> returns current window pixel width Get_Window_Height -> returns current window pixel height Drawing procedures Put_Pixel( X, Y, Color ) Draw_Line( X1, Y1, X2, Y2, Color ) Draw_Box( X1, Y1, X2, Y2, Color, Filled/Unfilled ) Draw_Circle( X, Y, Radius, Color, Filled/Unfilled ) Draw_Ellipse( X1, Y1, X2, Y2, Color, Filled/Unfilled ) Draw_Arc( X1, Y1, X2, Y2, StartX, StartY, EndX, EndY, Color ) Clear_Window( Color ) Flood_Fill( X, Y, Color ) Display_Text( X, Y, String Expression, Color ) Display_Number( X, Y, Number Expression, Color ) Mouse input procedures Wait_for_Mouse_Button( Which_Button ) Get_Mouse_Button( Which_Button, X, Y ) Mouse input functions Mouse_Button_Pressed( Which_Button ) –> returns True / False Mouse_Button_Released( Which_Button ) –> returns True / False Get_Mouse_X –> returns X coordinate of mouse location Get_Mouse_Y –> returns Y coordinate of mouse location Keyboard input procedure Wait_For_Key Keyboard input functions Key_Hit -> returns True / False (whether a key was pressed) Get_Key -> returns the numeric ASCII value of the pressed key Get_Key_String -> returns a string value of the pressed key RAPTORGraph Colors Black, Blue, Green, Cyan, Red, Magenta, Brown, Light_Gray, Dark_Gray, Light_Blue, Light_Green, Light_Cyan, Light_Red, Light_Magenta, Yellow, White (Get_Pixel returns 0 for Black, 1 for Blue, …,16 for White) Graphics window query function Get_Pixel( X, Y ) -> returns the number code for the color of the pixel at (X, Y) How to animate an object in RAPTORGraph Place the following inside of a loop Draw some an object relative to an X,Y point with the drawing procedures Delay_For some small time period Draw the object again in white (i.e. erase it) Update the X,Y point where you are drawing by some small offset
View full slide show




using UnityEngine; This is quite an interesting (i.e., tricky) example of Unity’s Immediate Mode GUI! How many times is DoMyWindow called? When is DoMyWindow called? using System.Collections; public class example : MonoBehaviour { public Rect windowRect0 = new Rect( 20, 20, 120, 50 ); public Rect windowRect1 = new Rect( 20, 100, 120, 50 ); void OnGUI ( ) { GUI.color = Color.red; windowRect0 = GUI.Window( 0, windowRect0, DoMyWindow, "Red Window" ); GUI.color = Color.green; windowRect1 = GUI.Window( 1, windowRect1, DoMyWindow, "Green Window" ); } void DoMyWindow ( int windowID ) { if (GUI.Button(new Rect(10, 20, 100, 20), "Hello World")) print( "Got a click in window with color " + GUI.color ); GUI.DragWindow( new Rect(0, 0, 10000, 10000) ); } } //make window dragable within this area
View full slide show




using UnityEngine; This is quite an interesting (i.e., tricky) example of Unity’s Immediate Mode GUI! How many times is DoMyWindow called? 2X When is DoMyWindow called? using System.Collections; public class example : MonoBehaviour { public Rect windowRect0 = new Rect( 20, 20, 120, 50 ); public Rect windowRect1 = new Rect( 20, 100, 120, 50 ); void OnGUI ( ) { GUI.color = Color.red; windowRect0 = GUI.Window( 0, windowRect0, DoMyWindow, "Red Window" ); GUI.color = Color.green; windowRect1 = GUI.Window( 1, windowRect1, DoMyWindow, "Green Window" ); } void DoMyWindow ( int windowID ) { if (GUI.Button(new Rect(10, 20, 100, 20), "Hello World")) print( "Got a click in window with color " + GUI.color ); GUI.DragWindow( new Rect(0, 0, 10000, 10000) ); } } //make window drag-able within this area
View full slide show




ASCII Confirmation Program #4 ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code # 96 # 97 # 98 # 99 #100 #101 #102 #103 #104 #105 #106 #107 #108 #109 #110 #111 is: is: is: is: is: is: is: is: is: is: is: is: is: is: is: is: ‘ a b c d e f g h i j k l m n o ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII Characters & Strings Lesson 1 CS1313 Fall 2016 Code Code Code Code Code Code Code Code Code Code Code Code Code Code Code #112 #113 #114 #115 #116 #117 #118 #119 #120 #121 #122 #123 #124 #125 #126 is: is: is: is: is: is: is: is: is: is: is: is: is: is: is: p q r s t u v w x y z { | } ~ 17
View full slide show




using UnityEngine; using System.Collections; public class example : MonoBehaviour { public Rect windowRect0 = new Rect( 20, 20, 120, 50 ); public Rect windowRect1 = new Rect( 20, 100, 120, 50 ); void OnGUI ( ) { GUI.color = Color.red; Create windows with different colors, and specify dragable region bounds. windowRect0 = GUI.Window( 0, windowRect0, DoMyWindow, "Red Window" ); GUI.color = Color.green; windowRect1 = GUI.Window( 1, windowRect1, DoMyWindow, "Green Window" ); } void DoMyWindow ( int windowID ) { if (GUI.Button(new Rect(10, 20, 100, 20), "Hello World")) print( "Got a click in window with color " + GUI.color ); GUI.DragWindow( new Rect(0, 0, 10000, 10000) ); } } //make window drag-able within this area
View full slide show




Handling Mouse Events • The mouse generates two types of events: – mouse events and mouse motion events. • Any component derived from the Component class can handle events generated by the mouse. • To handle mouse events you create: – a mouse listener class and/or – a mouse motion listener class. More GUI Programming 102
View full slide show




Manage your video display and layout Quick Reference for your video, not to view the video shared by others. Participants who Lync Web App Join a Lync Meeting with computer audio don’t share their video can choose to display a static picture instead. If you don’t have Lync 2013, you can join a scheduled Lync Meeting The area of the screen in which the pictures or videos are displayed is from Lync Web App. In the meeting request, click Join Lync Meeting. called the gallery. Type your name in the text box, ensure the option to install the Lync Lync Web App provides a rich video experience for meetings. If you have a camera connected to your computer, click to share your video with others in the meeting. A camera is required only to share Web App plug-in update is selected, and click Join the meeting. The plug-in is required to use computer audio. After it’s installed, you can also share your video and programs. There are two layout options to display the pictures and videos being shared. Gallery View displays all the participant pictures and videos while Speaker View displays the picture or video of only an active speaker. When a sharing session starts, a third layout option called Presentation View is available, which displays only the shared content. Click to choose To speed up your entry into future meetings, select the Remember the layout you want. me check box. Depending on how the meeting was set up, you’ll You can also expand the size of the meeting either wait in the lobby or be admitted to the meeting. If you’re in the window to view the meeting stage in greater lobby, only a presenter can admit you to the meeting. All presenters detail. Click immediately enter the meeting. After you’re admitted to the meeting, to go to the full window mode. To return to the normal window size, click the icon again. you can use your computer’s speakers and mic, or a headset to participate in the meeting. Join a Lync Meeting with phone audio In the meeting request, click Join Lync Meeting. Type your name in the text box, ensure the option to install the Lync Web App Plug-in is not selected, and click Join the meeting. After you’re admitted to the meeting, in the Join Meeting Audio dialog box, click Have the meeting call me to enter a phone number where the conference can © 2012 Microsoft Corporation. All rights reserved. call you, or click I will dial in to the meeting and call one of the phone numbers listed in the meeting invitation.
View full slide show




25 14.10 More DHTML Events Event Desc ription Keyboard Events onhelp onkeydown onkeypress onkeyup marquee events onbounce Fires when the user initiates help (i.e., by pressing the F1 key). onfinish onstart Mouse events Fires when a marquee finishes its scrolling. oncontextmenu ondblclick ondrag ondragend ondragenter ondragleave ondragover Fires when the context menu is shown (right-click). ondragstart ondrop Fires when a mouse drag begins. onmousedown onmouseup Fig. 14.10 Dynamic Fires when a mouse button is pressed down. Fires when the user pushes down a key. Fires when the user presses a key. Fires when the user ends a key press. Fires when direction. a scrolling marquee bounces back in the other valid target Fires when a marquee begins a new loop. Fires when the mouse is double-clicked. Fires during a mouse drag. Fires when a mouse drag ends. Fires when something is dragged onto an area. Fires when something is dragged out of an area. Fires when a drag is held over an area. Fires when during a drag. a mouse button Fires when a mouse button is released. HTML events.  2001 Prentice Hall, Inc. All rights reserved. is released over a
View full slide show




ZooKeeper’s data model: filesystem • znodes are organised in a hierarchical namespace • znodes can be manipulated by clients through the ZooKeeper API • znodes are referred to by UNIX style file system paths / /app1 /app1/p_1 /app1/p_2 /app2 All znodes store data (file like) & can have children (directory like). /app1/p_3 21
View full slide show




Wordswords words MOREWORDS WORDS MORE AND MORE WORDS WORDS words worsds wordswordswords WORDS WORDS more words long words hosrt words wordsWordswords words MOREWORDS WORDS MORE AND MORE WORDS WORDS words worsds wordswordswords WORDS WORDS more words long words hosrt words Wordswords words MOREWORDS WORDS MORE AND MORE WORDS WORDS words worsds wordswordswords WORDS WORDS more words long words hosrt words wordsWordswords words MOREWORDS WORDS MORE AND MORE WORDS WORDS words worsds wordswordswords WORDS WORDS more words long words hosrt words words Wordswords words MOREWORDS WORDS MORE AND MORE WORDS WORDS words worsds wordswordswords WORDS WORDS more words long words hosrt words words Wordswords words MOREWORDS WORDS MOR AND MORE WORDS WORDS words worsds wordswordswords WORDS WORDS more words long words hosrt words words Wordswords words MOREWORDS WORDS MORE AND MORE WORDS WORDS words worsds wordswordswords WORDS WORDS more words long words hosrt words words Wordswords words MOREWORDS WORDS MORE AND MORE WORDS WORDS words worsds wordswordswords WORDS WORDS more words long words hosrt words words Wordswords words MOREWORDS WORDS MORE AND MORE WORDS WORDS words worsds wordswordswords WORDS WORDS more words long words hosrt words words Wordswords words MOREWORDS WORDS MORE AND MORE WORDS WORDS words worsds wordswordswords WORDS WORDS more words long words hosrt words words Wordswords words MOREWORDS WORDS MORE AND MORE WORDS WORDS words worsds wordswordswords WORDS WORDS more words long words hosrt words words Wordswords words MOREWORDS WORDS MORE AND MORE WORDS WORDS words worsds wordswordswords WORDS WORDS more words long words hosrt words words Wordswords words MOREWORDS WORDS MORE AND MORE WORDS WORDS words worsds wordswordswords WORDS WORDS more words long words hosrt words wordsWordswords words MOREWORDS WORDS MORE AND MORE WORDS WORDS words worsds wordswordswords WORDS WORDS more words long words hosrt words wordsWordswords words MOREWORDS WORDS MORE AND MORE WORDS WORDS words worsds wordswordswords WORDS WORDS more words long words hosrt words wordsWordswords words MOREWORDS WORDS MORE AND MORE WORDS WORDS words worsds wordswordswords WORDS WORDS more words long words hosrt words wordsWordswords words MOREWORDS WORDS MORE AND MORE WORDS WORDS words worsds wordswordswords WORDS WORDS more words long words hosrt words wordsWordswords words MOREWORDS WORDSWordswords words MOREWORDS WORDS MORE AND MORE WORDS WORDS words worsds wordswordswords WORDS WORDS more words long words hosrt words words
View full slide show