STSCI Python Introduction

Size: px
Start display at page:

Download "STSCI Python Introduction"

Transcription

1 STSCI Python Introduction Class 5 Jim Hare Today s Agenda stpydb Module database interface module os Module commonly used methods os.path Module Manipulates pathnames shutil Module - High-level file operations Demonstration of Pmw Widgets Simple helloworld Tkinter program 1

2 Database Functions dbtools.py use with sql flat files. stpydb.py use to program queries and get results in variables to use in the module. stpydb Functions stpydb() - Connecting to the database. stpydb is a class object. getparammodechar - Returns the query param substitution char setparammodechar - Defines the query param substitution char setparam - Defines value for a named parameter execute - Executes the query returning one row at a time executeall - Executes the query returning all rows executeupdate - Executes an update/insert/delete query 2

3 stpydb Functions continued rowcount - Returns #rows affected by a query begintransaction - Starts a transaction on a given connection committransaction - Commits a transaction on a given connection rollbacktransaction - Aborts a transaction on a given connection clear - Clears an unfinished query stpydb Functions continued getdescription - Returns meta data info on last select query printdescription - Prints meta data report on last select query query - Pass a query string close - Shuts down the connection 3

4 stpydb Constructor Look at def init in /ess5/psdpython/stpydb.py, the constructor Examples: q1 = stpydb.stpydb() q2 = stpydb.stpydb('nomad') q3 = stpydb.stpydb(dbmsname='psttest4') q4 = stpydb.stpydb('nomad','psttest4') q5 = stpydb.stpydb(modulename='testpydb.py') q6 = stpydb.stpydb('r2d2','pstdev1','testpydb.py') Parameters, Queries and Execution - executeupdate Ex. Update from /ess5/psdpython/spssdb.py db= stpydb.stpydb(servername=server,dbmsname=database) param = [['PROP', proposal_id],['obset', obset_id], ['BEG',window_beg], ['END',window_end]] db.query('update qbwindows set window_beg ' 'window_end where proposal_id ' 'and obset_id db.setparam(param) db.executeupdate() return None 4

5 Parameters, Queries and Execution - execute Ex. Execute returns one record at a time param = ['sunit',suid[0]] db.query('select qs.proposal_id,qs.obset_id') db.query(' from qsbranching qs ') db.query('where qs.sunit_id db.setparam(param) result = {} while db.execute(result): obsetlist = obsetlist + \ ['%s:%s:01' % (result['proposal_id'],result['obset_id'])] Parameters, Queries and Execution - executeall Ex. executeall returns list of records currlist = [{}] q1.query("select d_scenar_acq, d_use_fgs_1, d_use_fgs_2, d_use_fgs_3 ") q1.query("from qbacqd_def") q1.executeall(currlist) for currdict in currlist: for field in currdict.keys(): print currdict[field] 5

6 Transactions q3.begintransaction() q3.query(querynew1) q3.executeupdate() q3.query(querynew2) q3.executeupdate() #NO error condition if you don't rollback! q3.rollbacktransaction() Tools and Examples spssdb.py functions related to spss database sirecon.py a tool to get 10.2 table data stpydb.py the tool developed for sybase interface testpydb.py tests developed to test stpydb 6

7 os Module Functions General Purpose Process Environment Files and Directories Process Management os.path - manipulates pathnames in a portable manner. General Purpose os Variables environ - mapping object of the current environment variables. linesep - \n for POSIX name - posix, nt, dos, mac, or os2 path - OS-dependent standard module for pathname operations 7

8 Process Environment os Functions Highlights chdir(path) - changes the current working dir to path getcwd() - gets the current working dir getpid() - get the process id of process getuid() - get the user id of current process putenv(varname, value) - Changes subprocess environment variable varname. uname() - returns (sysname,nodename,release,version,machine) File and Directory os Highlights chmod(path, mode) - changes access mode access(path,accessmode) - returns 1 if ok Accessmode - R_OK,W_OK,X_OK, or F_OK listdir(path) - List of filename returned mkdir(path, [mode]) - create directory mkdirs(path, [mode]) - makes directories to reach the leaf, recursive 8

9 Files and Directories os cont. remove(path) - remove the file path removedirs(path) - recursive removal rename(src, dst) - renames src to dst renames(old, new) - recursive rename rmdir(path) - removes the path Process Management os Functions Higlights exec l, le, lp, v, ve, vp, vpe - Many ways to execute a program path. fork() - creates a clone child process. spawn v,or ve (mode, path, args) (env) - spawns a program path in a new process system(command) - executes a system command in a subprocess 9

10 os.path Module Highlights abspath(path) - absolute full pathname abspath(../python/foo ) is /home/bz/python/foo basename(path) - returns the basename basename( /usr/local/python ) is python. dirname(path) - directory of the path dirname( /usr/local/python ) is /usr/local split(path) - returns tuple (dirname(),basename()) os.path Module Highlights cont. exists(path) - true if path exists isfile(path) - true if path is regular file isdir(path) - true if path is a directory join(path1,[,path2[, ]]) - intelligent join of one or mor paths join( /home, bz, Python ) is /home/bz/python splitext(path) - splitext( foo.txt ) is ( foo, txt ) 10

11 shutil Module Highlights copy(src, dst) - copies from src to dst and permissions. Other copys - copyfile, copymode, copystat, copy2 copytree(src, dst [, symlinks]) - recursively copies an entire directory tree. dst will be created and should not exist. Sylinks - true - symlinks same in the new tree; false - contents of linked files are copied to the new directory tree. rmtree(path, [, ignore_errors[, onerror]]) - remove directory tree Pmw Demo What s a Widget? 11

12 Tkinter helloworld Program A simple example of Tkinter 12

Python. Directory and File Paths

Python. Directory and File Paths Copyright Software Carpentry and The University of Edinburgh 2010-2011 This work is licensed under the Creative Commons Attribution License See http://software-carpentry.org/license.html for more information.

More information

Introduction to python

Introduction to python Introduction to python 13 Files Rossano Venturini rossano.venturini@unipi.it File System A computer s file system consists of a tree-like structured organization of directories and files directory file

More information

CS Programming Languages: Python

CS Programming Languages: Python CS 3101-1 - Programming Languages: Python Lecture 5: Exceptions / Daniel Bauer (bauer@cs.columbia.edu) October 08 2014 Daniel Bauer CS3101-1 Python - 05 - Exceptions / 1/35 Contents Exceptions Daniel Bauer

More information

rpaths Documentation Release 0.2 Remi Rampin

rpaths Documentation Release 0.2 Remi Rampin rpaths Documentation Release 0.2 Remi Rampin June 09, 2014 Contents 1 Introduction 1 2 Classes 3 2.1 Abstract classes............................................. 3 2.2 Concrete class Path............................................

More information

rpaths Documentation Release 0.13 Remi Rampin

rpaths Documentation Release 0.13 Remi Rampin rpaths Documentation Release 0.13 Remi Rampin Aug 02, 2018 Contents 1 Introduction 1 2 Classes 3 2.1 Abstract classes............................................. 3 2.2 Concrete class Path............................................

More information

If you re like me, you ve probably written a Python script or two that

If you re like me, you ve probably written a Python script or two that DAVID BEAZLEY David Beazley is an open source developer and author of the Python Essential Reference (4th Edition, Addison-Wesley, 2009). He is also known as the creator of Swig (http://www.swig.org) and

More information

OstrichLib Documentation

OstrichLib Documentation OstrichLib Documentation Release 0.0.0 Itamar Ostricher May 10, 2016 Contents 1 utils package 3 1.1 collections utils module......................................... 3 1.2 path utils module.............................................

More information

Windows architecture. user. mode. Env. subsystems. Executive. Device drivers Kernel. kernel. mode HAL. Hardware. Process B. Process C.

Windows architecture. user. mode. Env. subsystems. Executive. Device drivers Kernel. kernel. mode HAL. Hardware. Process B. Process C. Structure Unix architecture users Functions of the System tools (shell, editors, compilers, ) standard library System call Standard library (printf, fork, ) OS kernel: processes, memory management, file

More information

Today. Review. Unix as an OS case study Intro to Shell Scripting. What is an Operating System? What are its goals? How do we evaluate it?

Today. Review. Unix as an OS case study Intro to Shell Scripting. What is an Operating System? What are its goals? How do we evaluate it? Today Unix as an OS case study Intro to Shell Scripting Make sure the computer is in Linux If not, restart, holding down ALT key Login! Posted slides contain material not explicitly covered in class 1

More information

Programming in Python

Programming in Python COURSE DESCRIPTION This course presents both the programming interface and the techniques that can be used to write procedures in Python on Unix / Linux systems. COURSE OBJECTIVES Each participant will

More information

DB Export/Import/Generate data tool

DB Export/Import/Generate data tool DB Export/Import/Generate data tool Main functions: quick connection to any database using defined UDL files show list of available tables and/or queries show data from selected table with possibility

More information

Lecture files in /home/hwang/cs375/lecture05 on csserver.

Lecture files in /home/hwang/cs375/lecture05 on csserver. Lecture 5 Lecture files in /home/hwang/cs375/lecture05 on csserver. cp -r /home/hwang/cs375/lecture05. scp -r user@csserver.evansville.edu:/home/hwang/cs375/lecture05. Project 1 posted, due next Thursday

More information

Python Script Programming

Python Script Programming Python Script Programming St. Graf, S. Linner, M. Lischewski (JSC, Forschungszentrum Jülich) Table of Contents Introduction Data Types I Control Statements Functions Input/Output Errors and Exceptions

More information

CIS192 Python Programming

CIS192 Python Programming CIS192 Python Programming Regular Expressions and maybe OS Robert Rand University of Pennsylvania October 1, 2015 Robert Rand (University of Pennsylvania) CIS 192 October 1, 2015 1 / 16 Outline 1 Regular

More information

Using Python for shell scripts

Using Python for shell scripts Using Python for shell scripts January 2018 1/29 Using Python for shell scripts Peter Hill Outline Using Python for shell scripts January 2018 2/29 Advantages/disadvantages of Python Running a parameter

More information

Database Driver Sybase CT Library. Release 4.25

Database Driver Sybase CT Library. Release 4.25 Database Driver Sybase CT Library Release 4.25 May 2000 1 Database Driver for SYBASE CT Library The SYBASE Open Client product provides software for communicating with SYBASE SQL Server and SYBASE Open

More information

Scripting With Jython

Scripting With Jython Scripting With Jython In this chapter, we will look at scripting with Jython. For our purposes, we will define scripting as the writing of small programs to help out with daily tasks. These tasks are things

More information

fool Documentation Release 0.1 Nathan Typanski

fool Documentation Release 0.1 Nathan Typanski fool Documentation Release 0.1 Nathan Typanski November 28, 2014 Contents 1 fool package 3 1.1 fool.chapter module........................................... 3 1.2 fool.conflicts module...........................................

More information

Programming in Python Advanced

Programming in Python Advanced Programming in Python Advanced Duration: 3 days, 8 hours a day Pre-requisites: * Participants should be comfortable with the following technologies: Basic and working knowledge of the Pyton If new to the

More information

databuild Documentation

databuild Documentation databuild Documentation Release 0.0.10 Flavio Curella May 15, 2015 Contents 1 Contents 3 1.1 Installation................................................ 3 1.2 Quickstart................................................

More information

Transfer designs from a Creative Fantasy Alphabet Card to the 2170 Machine THEN use File Assistant to transfer the designs to the computer

Transfer designs from a Creative Fantasy Alphabet Card to the 2170 Machine THEN use File Assistant to transfer the designs to the computer Transfer designs from a Creative Fantasy Alphabet Card to the 2170 Machine THEN use File Assistant to transfer the designs to the computer Tutorial by Jan Smith, CompuSew with Jan, 2008. http://www.compusewwithjan.com

More information

Starting the System & Basic Erlang Exercises

Starting the System & Basic Erlang Exercises Starting the System & Basic Erlang Exercises These exercises will help you get accustomed with the Erlang development and run time environments. Once you have set up the Erlang mode for emacs, you will

More information

Chapter 1 - Introduction. September 8, 2016

Chapter 1 - Introduction. September 8, 2016 Chapter 1 - Introduction September 8, 2016 Introduction Overview of Linux/Unix Shells Commands: built-in, aliases, program invocations, alternation and iteration Finding more information: man, info Help

More information

dypy: Dynamical Systems in Python PHY250 Project Report Spring 2008

dypy: Dynamical Systems in Python PHY250 Project Report Spring 2008 dypy: Dynamical Systems in Python PHY250 Project Report Spring 2008 SOPHIE ENGLE AND SEAN WHALEN Department of Computer Science {sjengle,shwhalen}@ucdavis.edu Abstract: This project introduces dypy an

More information

PTN-202: Advanced Python Programming Course Description. Course Outline

PTN-202: Advanced Python Programming Course Description. Course Outline PTN-202: Advanced Python Programming Course Description This 4-day course picks up where Python I leaves off, covering some topics in more detail, and adding many new ones, with a focus on enterprise development.

More information

An Introduction to Unix Power Tools

An Introduction to Unix Power Tools An to Unix Power Tools Randolph Langley Department of Computer Science Florida State University August 27, 2008 History of Unix Unix Today Command line versus graphical interfaces to COP 4342, Fall History

More information

In addition to the correct answer, you MUST show all your work in order to receive full credit.

In addition to the correct answer, you MUST show all your work in order to receive full credit. In addition to the correct answer, you MUST show all your work in order to receive full credit. Questions Mark: Question1) Multiple Choice Questions /10 Question 2) Binary Trees /15 Question 3) Linked

More information

Lecture 8. Database Management and Queries

Lecture 8. Database Management and Queries Lecture 8 Database Management and Queries Lecture 8: Outline I. Database Components II. Database Structures A. Conceptual, Logical, and Physical Components III. Non-Relational Databases A. Flat File B.

More information

COMS 469: Interactive Media II

COMS 469: Interactive Media II COMS 469: Interactive Media II Agenda Review Files and Directories Review User Defined Functions Cookies File Includes CMS Admin Login Review User Defined Functions Input arguments Output Return values

More information

Operating System Structure

Operating System Structure Operating System Structure CSCI 4061 Introduction to Operating Systems Applications Instructor: Abhishek Chandra Operating System Hardware 2 Questions Operating System Structure How does the OS manage

More information

FILE HANDLING AND EXCEPTIONS

FILE HANDLING AND EXCEPTIONS FILE HANDLING AND EXCEPTIONS INPUT We ve already seen how to use the input function for grabbing input from a user: input() >>> print(input('what is your name? ')) What is your name? Spongebob Spongebob

More information

Programming in Python 2014

Programming in Python 2014 Practical No. 1 Write a program that prompts the user for following information: a. Number b. Choice (Choice value can be 1 or 2) If user enters choice 1 then it should check whether the given number is

More information

Basic OS Progamming Abstrac7ons

Basic OS Progamming Abstrac7ons Basic OS Progamming Abstrac7ons Don Porter Recap We ve introduced the idea of a process as a container for a running program And we ve discussed the hardware- level mechanisms to transi7on between the

More information

CS313D: ADVANCED PROGRAMMING LANGUAGE

CS313D: ADVANCED PROGRAMMING LANGUAGE CS313D: ADVANCED PROGRAMMING LANGUAGE Computer Science department Lecture 11: Connection to Databases Lecture Contents 2 What is a database? Relational databases Cases study: A Books Database Querying

More information

Basic OS Progamming Abstrac2ons

Basic OS Progamming Abstrac2ons Basic OS Progamming Abstrac2ons Don Porter Recap We ve introduced the idea of a process as a container for a running program And we ve discussed the hardware- level mechanisms to transi2on between the

More information

CSci 4061 Introduction to Operating Systems. Processes in C/Unix

CSci 4061 Introduction to Operating Systems. Processes in C/Unix CSci 4061 Introduction to Operating Systems Processes in C/Unix Process as Abstraction Talked about C programs a bit Program is a static entity Process is an abstraction of a running program provided by

More information

LECTURE 7. The Standard Library Part 1: Built-ins, time, sys, and os

LECTURE 7. The Standard Library Part 1: Built-ins, time, sys, and os LECTURE 7 The Standard Library Part 1: Built-ins, time, sys, and os THE PYTHON LANGUAGE Believe it or not, you now have all the Python syntax and structures you need already. At this point, we can turn

More information

LECTURE 9 The Standard Library Part 3

LECTURE 9 The Standard Library Part 3 LECTURE 9 The Standard Library Part 3 THE STANDARD LIBRARY In this lecture, we will briefly cover each of the remaining Standard Library modules that you absolutely must know about. Some of the remaining

More information

PYTHON TRAINING COURSE CONTENT

PYTHON TRAINING COURSE CONTENT SECTION 1: INTRODUCTION What s python? Why do people use python? Some quotable quotes A python history lesson Advocacy news What s python good for? What s python not good for? The compulsory features list

More information

Python Summary. cat 5 dog

Python Summary. cat 5 dog Python Summary Print Function: the print() function takes a list of values to print and writes them to the output, e.g., print('cat',5,'dog') print() # blank line cat 5 dog print('pi is about', 3.14) pi

More information

Automating common tasks

Automating common tasks Chapter 16 Automating common tasks One of the great advantages of the Python language is the ability to write programs that scan through your computer and perform some operation on each file.filesareorganized

More information

Multithreaded Programming

Multithreaded Programming Multithreaded Programming The slides do not contain all the information and cannot be treated as a study material for Operating System. Please refer the text book for exams. September 4, 2014 Topics Overview

More information

Introduction to Python

Introduction to Python May 25, 2010 Basic Operators Logicals Types Tuples, Lists, & Dictionaries and or Building Functions Labs From a non-lab computer visit: http://www.csuglab.cornell.edu/userinfo Running your own python setup,

More information

CSE : Python Programming

CSE : Python Programming CSE 399-004: Python Programming Lecture 08: Graphical User Interfaces with wxpython March 12, 2005 http://www.seas.upenn.edu/~cse39904/ Plan for today and next time Today: wxpython (part 1) Aside: Arguments

More information

Chapter 4: Threads. Operating System Concepts. Silberschatz, Galvin and Gagne

Chapter 4: Threads. Operating System Concepts. Silberschatz, Galvin and Gagne Chapter 4: Threads Silberschatz, Galvin and Gagne Chapter 4: Threads Overview Multithreading Models Thread Libraries Threading Issues Operating System Examples Linux Threads 4.2 Silberschatz, Galvin and

More information

More Scripting and Regular Expressions. Todd Kelley CST8207 Todd Kelley 1

More Scripting and Regular Expressions. Todd Kelley CST8207 Todd Kelley 1 More Scripting and Regular Expressions Todd Kelley kelleyt@algonquincollege.com CST8207 Todd Kelley 1 Regular Expression Summary Regular Expression Examples Shell Scripting 2 Do not confuse filename globbing

More information

Programming in Python 2016

Programming in Python 2016 Practical No. 1 Write a program that prompts the user for input and check whether input contain repeated characters or numbers or not. If it contain repeated characters then count the total repeated characters

More information

PROCEDURAL DATABASE PROGRAMMING ( PL/SQL AND T-SQL)

PROCEDURAL DATABASE PROGRAMMING ( PL/SQL AND T-SQL) Technology & Information Management Instructor: Michael Kremer, Ph.D. Class 6 Database Programming PROCEDURAL DATABASE PROGRAMMING ( PL/SQL AND T-SQL) AGENDA 8. Using Declarative SQL in Procedural SQL

More information

Getting Started with Command Prompts

Getting Started with Command Prompts Getting Started with Command Prompts Updated December, 2017 Some courses such as Java Programming will ask the student to perform tasks from a command prompt (Windows) or Terminal window (Mac OS). Many

More information

PASS4TEST. IT Certification Guaranteed, The Easy Way! We offer free update service for one year

PASS4TEST. IT Certification Guaranteed, The Easy Way!  We offer free update service for one year PASS4TEST IT Certification Guaranteed, The Easy Way! \ We offer free update service for one year Exam : 70-448 Title : TS:MS SQL Server 2008.Business Intelligence Dev and Maintenan Vendors : Microsoft

More information

OPERATING SYSTEMS, ASSIGNMENT 4 FILE SYSTEM

OPERATING SYSTEMS, ASSIGNMENT 4 FILE SYSTEM OPERATING SYSTEMS, ASSIGNMENT 4 FILE SYSTEM SUBMISSION DATE: 15/06/2014 23:59 In this assignment you are requested to extend the file system of xv6. xv6 implements a Unix-like file system, and when running

More information

I.-C. Lin, Assistant Professor. Textbook: Operating System Concepts 8ed CHAPTER 4: MULTITHREADED PROGRAMMING

I.-C. Lin, Assistant Professor. Textbook: Operating System Concepts 8ed CHAPTER 4: MULTITHREADED PROGRAMMING I.-C. Lin, Assistant Professor. Textbook: Operating System Concepts 8ed CHAPTER 4: MULTITHREADED PROGRAMMING Chapter 4: Multithreaded Programming Overview Multithreading Models Thread Libraries Threading

More information

LECTURE 4 Python Basics Part 3

LECTURE 4 Python Basics Part 3 LECTURE 4 Python Basics Part 3 INPUT We ve already seen two useful functions for grabbing input from a user: raw_input() Asks the user for a string of input, and returns the string. If you provide an argument,

More information

ChatBlazer 8 Site Administrator Usage Guide

ChatBlazer 8 Site Administrator Usage Guide ChatBlazer 8 Site Administrator Usage Guide Using the Site Adminstrator Other than the modification of ChatBlazer 8 s client configuration to affect the Flash chat client s runtime behavior, the Site Administrator

More information

Torndb Release 0.3 Aug 30, 2017

Torndb Release 0.3 Aug 30, 2017 Torndb Release 0.3 Aug 30, 2017 Contents 1 Release history 3 1.1 Version 0.3, Jul 25 2014......................................... 3 1.2 Version 0.2, Dec 22 2013........................................

More information

Quick Start SAP Sybase IQ 16.0

Quick Start SAP Sybase IQ 16.0 Quick Start SAP Sybase IQ 16.0 Windows DOCUMENT ID: DC01686-01-1600-01 LAST REVISED: February 2012 Copyright 2013 by Sybase, Inc. All rights reserved. This publication pertains to Sybase software and to

More information

How to be a 1337 h4ck3r: Git + Linux

How to be a 1337 h4ck3r: Git + Linux How to be a 1337 h4ck3r: Git + Linux An introduction to Git, version control, and Linux by Samsara Counts, Pat Cody, and Joseph Schiarizzi Slides adapted from Neel Shah and Phil Lopreiato DISCLAIMER: GW

More information

L i (A) = transaction T i acquires lock for element A. U i (A) = transaction T i releases lock for element A

L i (A) = transaction T i acquires lock for element A. U i (A) = transaction T i releases lock for element A Lock-Based Scheduler Introduction to Data Management CSE 344 Lecture 20: Transactions Simple idea: Each element has a unique lock Each transaction must first acquire the lock before reading/writing that

More information

20.5. urllib Open arbitrary resources by URL

20.5. urllib Open arbitrary resources by URL 1 of 9 01/25/2012 11:19 AM 20.5. urllib Open arbitrary resources by URL Note: The urllib module has been split into parts and renamed in Python 3.0 to urllib.request, urllib.parse, and urllib.error. The

More information

DEC Computer Technology LESSON 6: DATABASES AND WEB SEARCH ENGINES

DEC Computer Technology LESSON 6: DATABASES AND WEB SEARCH ENGINES DEC. 1-5 Computer Technology LESSON 6: DATABASES AND WEB SEARCH ENGINES Monday Overview of Databases A web search engine is a large database containing information about Web pages that have been registered

More information

How Oracle Does It. No Read Locks

How Oracle Does It. No Read Locks How Oracle Does It Oracle Locking Policy No Read Locks Normal operation: no read locks Readers do not inhibit writers Writers do not inhibit readers Only contention is Write-Write Method: multiversion

More information

CSCI 2132 Software Development. Lecture 5: File Permissions

CSCI 2132 Software Development. Lecture 5: File Permissions CSCI 2132 Software Development Lecture 5: File Permissions Instructor: Vlado Keselj Faculty of Computer Science Dalhousie University 14-Sep-2018 (5) CSCI 2132 1 Files and Directories Pathnames Previous

More information

Processes. Johan Montelius KTH

Processes. Johan Montelius KTH Processes Johan Montelius KTH 2017 1 / 47 A process What is a process?... a computation a program i.e. a sequence of operations a set of data structures a set of registers means to interact with other

More information

Department of Electrical Engineering and Computer Science MASSACHUSETTS INSTITUTE OF TECHNOLOGY Fall Quiz I

Department of Electrical Engineering and Computer Science MASSACHUSETTS INSTITUTE OF TECHNOLOGY Fall Quiz I Department of Electrical Engineering and Computer Science MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6.858 Fall 2010 Quiz I All problems are open-ended questions. In order to receive credit you must answer

More information

Operating Systems 2 nd semester 2016/2017. Chapter 4: Threads

Operating Systems 2 nd semester 2016/2017. Chapter 4: Threads Operating Systems 2 nd semester 2016/2017 Chapter 4: Threads Mohamed B. Abubaker Palestine Technical College Deir El-Balah Note: Adapted from the resources of textbox Operating System Concepts, 9 th edition

More information

Virtual File System. Don Porter CSE 506

Virtual File System. Don Porter CSE 506 Virtual File System Don Porter CSE 506 History ò Early OSes provided a single file system ò In general, system was pretty tailored to target hardware ò In the early 80s, people became interested in supporting

More information

A process. the stack

A process. the stack A process Processes Johan Montelius What is a process?... a computation KTH 2017 a program i.e. a sequence of operations a set of data structures a set of registers means to interact with other processes

More information

Basic OS Programming Abstractions (and Lab 1 Overview)

Basic OS Programming Abstractions (and Lab 1 Overview) Basic OS Programming Abstractions (and Lab 1 Overview) Don Porter Portions courtesy Kevin Jeffay 1 Recap We ve introduced the idea of a process as a container for a running program This lecture: Introduce

More information

Altering the Control Flow

Altering the Control Flow Altering the Control Flow Up to Now: two mechanisms for changing control flow: Jumps and branches Call and return using the stack discipline. Both react to changes in program state. Insufficient for a

More information

CS 326: Operating Systems. Process Execution. Lecture 5

CS 326: Operating Systems. Process Execution. Lecture 5 CS 326: Operating Systems Process Execution Lecture 5 Today s Schedule Process Creation Threads Limited Direct Execution Basic Scheduling 2/5/18 CS 326: Operating Systems 2 Today s Schedule Process Creation

More information

Writing Shell Scripts part 1

Writing Shell Scripts part 1 Writing Shell Scripts part 1 EECS 2031 21 November 2016 1 What Is a Shell? A program that interprets your request to run other programs Most common Unix shells: Bourne shell (sh) C shell (csh) Korn shell

More information

APPLICATION USER GUIDE

APPLICATION USER GUIDE APPLICATION USER GUIDE Application: FileManager Version: 3.2 Description: File Manager allows you to take full control of your website files. You can copy, move, delete, rename and edit files, create and

More information

CSE 380 Computer Operating Systems. Instructor: Insup Lee. University of Pennsylvania Fall 2003

CSE 380 Computer Operating Systems. Instructor: Insup Lee. University of Pennsylvania Fall 2003 CSE 380 Computer Operating Systems Instructor: Insup Lee University of Pennsylvania Fall 2003 Lecture Note 2: Processes and Threads Lecture Note 2.1: Processes and System Calls 1 Process q Consider a simple

More information

5/8/2012. Creating and Changing Directories Chapter 7

5/8/2012. Creating and Changing Directories Chapter 7 Creating and Changing Directories Chapter 7 Types of files File systems concepts Using directories to create order. Managing files in directories. Using pathnames to manage files in directories. Managing

More information

Foreword Preface Db2 Family And Db2 For Z/Os Environment Product Overview DB2 and the On-Demand Business DB2 Universal Database DB2 Middleware and

Foreword Preface Db2 Family And Db2 For Z/Os Environment Product Overview DB2 and the On-Demand Business DB2 Universal Database DB2 Middleware and Foreword Preface Db2 Family And Db2 For Z/Os Environment Product Overview DB2 and the On-Demand Business DB2 Universal Database DB2 Middleware and Connectivity DB2 Application Development DB2 Administration

More information

Virtual File System. Don Porter CSE 306

Virtual File System. Don Porter CSE 306 Virtual File System Don Porter CSE 306 History Early OSes provided a single file system In general, system was pretty tailored to target hardware In the early 80s, people became interested in supporting

More information

PathInfo: A file information object in Python

PathInfo: A file information object in Python PathInfo: A file information object in Python John W. Shipman 2013-09-25 16:24 Abstract Describes a class in the Python programming language that represents information about a file, as well as several

More information

Quick Start SAP Sybase IQ 16.0 SP08

Quick Start SAP Sybase IQ 16.0 SP08 Quick Start SAP Sybase IQ 16.0 SP08 UNIX/Linux DOCUMENT ID: DC01687-01-1608-01 LAST REVISED: December 2013 Copyright 2013 by SAP AG or an SAP affiliate company. All rights reserved. No part of this publication

More information

Recommended Maintenance Plan for Siriusware Clients for SQL server 2005

Recommended Maintenance Plan for Siriusware Clients for SQL server 2005 Recommended Maintenance Plan for Siriusware Clients for SQL server 2005 PURPOSE The purpose of this document is to describe how to automate the periodic rebuilding of indexes for the SiriusSQL database.

More information

Files and Directories

Files and Directories Files and Directories Stat functions Given pathname, stat function returns structure of information about file fstat function obtains information about the file that is already open lstat same as stat

More information

RCU. ò Dozens of supported file systems. ò Independent layer from backing storage. ò And, of course, networked file system support

RCU. ò Dozens of supported file systems. ò Independent layer from backing storage. ò And, of course, networked file system support Logical Diagram Virtual File System Don Porter CSE 506 Binary Formats RCU Memory Management File System Memory Allocators System Calls Device Drivers Networking Threads User Today s Lecture Kernel Sync

More information

Store and Manage Data in a DBMS With ArcView Database Access. Presented By: Andrew Arana & Canserina Kurnia

Store and Manage Data in a DBMS With ArcView Database Access. Presented By: Andrew Arana & Canserina Kurnia Store and Manage Data in a DBMS With ArcView Database Access Presented By: Andrew Arana & Canserina Kurnia Overview Topics to be Covered: General method for accessing data database themes, database tables

More information

OVERVIEW OF RELATIONAL DATABASES: KEYS

OVERVIEW OF RELATIONAL DATABASES: KEYS OVERVIEW OF RELATIONAL DATABASES: KEYS Keys (typically called ID s in the Sierra Database) come in two varieties, and they define the relationship between tables. Primary Key Foreign Key OVERVIEW OF DATABASE

More information

Chp1 Introduction. Introduction. Objective. Logging In. Shell. Briefly describe services provided by various versions of the UNIX operating system.

Chp1 Introduction. Introduction. Objective. Logging In. Shell. Briefly describe services provided by various versions of the UNIX operating system. Chp1 Objective Briefly describe services provided by various versions of the UNIX operating system. Logging In /etc/passwd local machine or NIS DB root:x:0:1:super-user:/root:/bin/tcsh Login-name, encrypted

More information

Updating Skype for Business Phone Firmware from Microsoft Skype for Business Server. Table of Contents

Updating Skype for Business Phone Firmware from Microsoft Skype for Business Server. Table of Contents 1 Table of Contents Updating Phone Firmware from Microsoft Skype for Business Server... 1 Uploading the Update Package... 1 Creating Test Device... 2 Triggering Update... 3 Approving Updates... 4 Allowing

More information

FILE SYSTEMS. Jo, Heeseung

FILE SYSTEMS. Jo, Heeseung FILE SYSTEMS Jo, Heeseung TODAY'S TOPICS File system basics Directory structure File system mounting File sharing Protection 2 BASIC CONCEPTS Requirements for long-term information storage Store a very

More information

Message-Passing Shared Address Space

Message-Passing Shared Address Space Message-Passing Shared Address Space 2 Message-Passing Most widely used for programming parallel computers (clusters of workstations) Key attributes: Partitioned address space Explicit parallelization

More information

Exceptions & a Taste of Declarative Programming in SQL

Exceptions & a Taste of Declarative Programming in SQL Exceptions & a Taste of Declarative Programming in SQL David E. Culler CS8 Computational Structures in Data Science http://inst.eecs.berkeley.edu/~cs88 Lecture 12 April 18, 2016 Computational Concepts

More information

Chapter 4: Threads. Chapter 4: Threads

Chapter 4: Threads. Chapter 4: Threads Chapter 4: Threads Silberschatz, Galvin and Gagne 2009 Chapter 4: Threads Overview Multithreading Models Thread Libraries Threading Issues Operating System Examples Windows XP Threads Linux Threads 4.2

More information

CMSC421: Principles of Operating Systems

CMSC421: Principles of Operating Systems CMSC421: Principles of Operating Systems Nilanjan Banerjee Assistant Professor, University of Maryland Baltimore County nilanb@umbc.edu http://www.csee.umbc.edu/~nilanb/teaching/421/ Principles of Operating

More information

Student Database Challenge Problem

Student Database Challenge Problem Student Database Challenge Problem For this challenge problem, we will create a small database of user information. The python code we write will be able to add new data to the database, save it to a file,

More information

dbmapper User Guide March 2003 Prepared by: ONSD Software Group Park Center Road, Herndon, VA NEC America

dbmapper User Guide March 2003 Prepared by: ONSD Software Group Park Center Road, Herndon, VA NEC America dbmapper User Guide March 2003 Prepared by: ONSD Software Group 14040 Park Center Road, Herndon, VA 20171 NEC America Email: onsd@necam.com Web: http://www.onsd.nec.com/software 1 of 63 1 Introduction...

More information

PyFilesystem Documentation

PyFilesystem Documentation PyFilesystem Documentation Release 0.5.0 Will McGugan Aug 09, 2017 Contents 1 Guide 3 1.1 Introduction............................................... 3 1.2 Getting Started..............................................

More information

File Systems Overview. Jin-Soo Kim ( Computer Systems Laboratory Sungkyunkwan University

File Systems Overview. Jin-Soo Kim ( Computer Systems Laboratory Sungkyunkwan University File Systems Overview Jin-Soo Kim ( jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Today s Topics File system basics Directory structure File system mounting

More information

Context-Oriented Programming with Python

Context-Oriented Programming with Python Context-Oriented Programming with Python Martin v. Löwis Hasso-Plattner-Institut an der Universität Potsdam Agenda Meta-Programming Example: HTTP User-Agent COP Syntax Implicit Layer Activation Django

More information

A Practical Introduction to git

A Practical Introduction to git 1 / 59 A Practical Introduction to git Emanuele Olivetti 1 Rike-Benjamin Schuppner 2 1 NeuroInformatics Laboratory (NILab) Bruno Kessler Foundation (FBK), Trento, Italy Center for Mind and Brain Sciences

More information

Distributed KIDS Labs 1

Distributed KIDS Labs 1 Distributed Databases @ KIDS Labs 1 Distributed Database System A distributed database system consists of loosely coupled sites that share no physical component Appears to user as a single system Database

More information

Database Technology. Topic 8: Introduction to Transaction Processing

Database Technology. Topic 8: Introduction to Transaction Processing Topic 8: Introduction to Transaction Processing Olaf Hartig olaf.hartig@liu.se Motivation A DB is a shared resource accessed by many users and processes concurrently Not managing concurrent access to a

More information

Review -Chapter 4. Review -Chapter 5

Review -Chapter 4. Review -Chapter 5 Review -Chapter 4 Entity relationship (ER) model Steps for building a formal ERD Uses ER diagrams to represent conceptual database as viewed by the end user Three main components Entities Relationships

More information

Програмиранев UNIX среда

Програмиранев UNIX среда Програмиранев UNIX среда Използванена команден шел и създаванена скриптове: tcsh, bash, awk, python Shell programming As well as using the shell to run commands you can use its built-in programming language

More information