Lecture # 7 Engr. Ali Javed 18th March, 2014
|
|
- Magdalene McCormick
- 6 years ago
- Views:
Transcription
1 Lecture # 7 Engr. Ali Javed 18 th March, 2014
2 Instructor s Information Instructor: Engr. Ali Javed Assistant Professor Department of Software Engineering U.E.T Taxila ali.javed@uettaxila.edu.pk Contact No: Office hours: Monday, 09:00-11:00, Office # 7 S.E.D Engr. Ali Javed
3 Course Information Course Name: Mobile Application Development Course Code: SE-5020 Course Link: Engr. Ali Javed
4
5 Topics applications and isolated storage Using isolated storage to store files Storing name/value pairs An introduction to the Dictionary collection class Storing settings information in Isolated Storage
6 Isolated Storage [1-2] Each application or game has its own particular data storage needs. The storage can be as simple as a name value pair (for example HighScore=100). On the other hand you might be storing an entire product database along with all your customers. Or you might be storing text documents or pictures taken with the phone camera. A Silverlight application will need to hold settings and information the user is working on and an XNA game will wantto store informationabout the progress of aplayerthrough the game along with high score and player settings. Windows phone programs can use isolated storage to hold this kind of information. This storage is called isolated because each application on the phone has its own area One applicationcannotaccessthestorageof another The data is storedin the massstorage of the phone Aprogramcan store verylargeamountsof datain isolated storage 6
7 Isolated Storage [1-2] The Isolated Storage area can hold very large amounts of data, up to the limit of the storage available in the phone itself. A will have at least 8G of built in storage which is shared between media (stored music, pictures and videos) and all the applications on the device. When an application is removed from the phone all the isolated storage assigned to it is deleted. When an application is upgraded via Marketplace (i.e. we release a new version of our program or game) the isolated storage retains the original contents. 7
8 Isolated Storage Locations You might also want to know the location of isolated storage files. This location is different depending on the operating system. The following table shows the root locations where isolated storage is created on a few common operating systems Operating system Windows 2000, Windows XP, Windows Server 2003 (upgrade from Windows NT 4.0) Windows clean installation (and upgrades from Windows 98 and Windows NT 3.51) Windows XP, Windows Server clean installation (and upgrades from Windows 2000 and Windows 98) Location in file system Roaming-enabled stores = <SYSTEMROOT>\Profiles\<user>\Application Data Nonroaming stores = <SYSTEMROOT>\Profiles\<user>\Local Settings\Application Data Roaming-enabled stores = <SYSTEMDRIVE>\Documents and Settings\<user>\Application Data Nonroaming stores = <SYSTEMDRIVE>\Documents and Settings\<user>\Local Settings\Application Data Roaming-enabled stores = <SYSTEMDRIVE>\Documents and Settings\<user>\Application Data Nonroaming stores = <SYSTEMDRIVE>\Documents and Settings\<user>\Local Settings\Application Data Windows 8, Windows 7, Windows Server 2008, Windows Vista Roaming-enabled stores = <SYSTEMDRIVE>\Users\<user>\AppData\Roaming Nonroaming stores = <SYSTEMDRIVE>\Users\<user>\AppData\Local 8
9 Jotpad program This is the first version of the jotpad program It displays a textbox for the user to enter text It also has Load and Save buttons that can be used to load and save the jotted text to isolated storage 9
10 The Save button behaviour private void savebutton_click(object sender, RoutedEventArgs e) savetext("jot.txt", jottextbox.text); When the user presses the Save button the event hander calls a method to save the text from the TextBox into a file The savetext method is also given the name of the file to save the text in
11 The savetext method private void savetext(string filename, string text) using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication()) using (IsolatedStorageFileStream rawstream = isf.createfile(filename)) StreamWriter writer = new StreamWriter(rawStream); writer.write(text); writer.close(); The method can be used to save data in a file in isolated storage
12 Using IsolatedStorage private void savetext(string filename, string text) using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication()) using (IsolatedStorageFileStream rawstream = isf.createfile(filename)) StreamWriter writer = new StreamWriter(rawStream); writer.write(text); writer.close(); Obtains user-scoped isolated storage for use by an application The method starts by getting a reference to the isolated storage for this application IsolatedStorageFile Represents an isolated storage area containing files and directories
13 Creating a file private void savetext(string filename, string text) using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication()) using (IsolatedStorageFileStream rawstream = isf.createfile(filename)) StreamWriter writer = new StreamWriter(rawStream); writer.write(text); writer.close(); Initializes a new instance of the IsolatedStorageFileStream class giving access to the file designated by path, in the specified mode, and in the context of the IsolatedStorageFile specified by isf. Use this class to read, write and create files in isolated storage
14 Writing to the file private void savetext(string filename, string text) using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication()) using (IsolatedStorageFileStream rawstream = isf.createfile(filename)) StreamWriter writer = new StreamWriter(rawStream); writer.write(text); writer.close(); The method can nowwrite data to the file and close it StreamWriter Implements a TextWriter for writing characters to a stream Represents a writer that can write a sequential series of characters
15 The Load button behaviour private void loadbutton_click(object sender, RoutedEventArgs e) string text; if ( loadtext("jot.txt", out text ) ) jottextbox.text = text; else jottextbox.text = "Type your jottings here..."; The loadtextmethodtriesto openafile withthe nameit hasbeengiven. It thentries to readastringfromthatfile. If the file can be read correctly the loadtext method returns true and sets the output parameter to the contents of the file. Thisis thenusedto set the textin jottextbox. The load behaviour is more complex because the file might not be available If any part of the read operation fails the loadtext method returns false and jottextbox is set to a starting message.
16 Loading from Isolated storage try using (IsolatedStorageFileStream rawstream = isf.openfile(filename, System.IO.FileMode.Open)) StreamReader reader = new StreamReader(rawStream); result = reader.readtoend(); reader.close(); catch return false; Represents a reader that can read a sequential series of characters. This code reads a file from isolated storage It uses standard file input/output methods StreamReader Implements a TextReader that reads characters from a byte stream Note that it uses the ReadToEnd method to read from the file so that the program can read multi-line jottings.
17 Loading from Isolated storage try using (IsolatedStorageFileStream rawstream = isf.openfile(filename, System.IO.FileMode.Open)) StreamReader reader = new StreamReader(rawStream); result = reader.readtoend(); reader.close(); catch return false; Opens a file at a specified path using the specified sharing and access options. This member is overloaded OpenFile(String,FileMode) OpenFile(String,FileMode,FileAccess) OpenFile(String,FileMode,FileAccess,FileShare)
18 Loading from Isolated storage FileMode Specifieshowtheoperatingsystemshouldopenafile Member name Append Create CreateNew Description Opens the file if it exists and seeks to the end of the file, or creates a new file. Append can only be used in conjunction with Write. Specifies that the operating system should create a new file. If the file already exists, it will be overwritten. Create is equivalent to requesting that if the file does not exist, use CreateNew; otherwise, use Truncate. Specifies that the operating system should create a new file. Open Specifies that the operating system should open an existing file. A System.IO.FileNotFoundException is thrown if the file does not exist. OpenOrCreate Specifies that the operating system should open a file if it exists; otherwise, a new file should be created. Truncate Specifies that the operating system should open an existing file. Once opened, the file should be truncated so that its size is zero bytes.
19 Loading from Isolated storage FileAccess Definesconstantsforread,write,orread/writeaccessto afile Member name Read ReadWrite Write Description Read access to the file. Data can be read from the file. Combine with Write for read/write access. Read and write access to the file. Data can be written to and read from the file. Write access to the file. Data can be written to the file. Combine with Read for read/write access
20 Demo Demo 1: Jotpad Demo 20
21 Using Settings Isolated storage Creating files in isolated storage is useful, but often a program only wants to store name/value pairs Examples of this: Username Home directory Colour and display preferences In this case it seems a lot of effort to create files and streams just to store a simple value. To make it easy to store settings a program can 21 use the Isolated Storage settings store.
22 Settings and Dictionaries The settings storage works like a Dictionary collection Dictionaries are a very useful collection mechanism. A dictionary is made using two types. One is the type of the key, and the other is the type of the item being stored. A Dictionary holds a collection of a particular type which is indexed by key values of another type Programs can look up items based on the value of the key For example, we might create a class called Person which holds data about a person 22
23 A Dictionary example class Person public string Name; public string Address; public string Phone; The Person class holds information about a given person in our system The Person class could contain many more data properties than the ones above We need to store and find Person items
24 A Dictionary example [3] Dictionary<string, Person> Personnel = new Dictionary<string, Person>(); This creates a Dictionary called Personnel This holds a collection of Person records that are indexed on a string When we create a new Dictionary type we give it the type of the key (in this case a string because we are entering the name of the person) and the type of the item being stored (in this case a Person).
25 Storing in the Dictionary Person p1 = new Person Name = "Rob", Address = "His House", Phone = "1234" ; Personnel.Add(p1.Name, p1); This code makes a new Person instance and then stores it in the Personnel dictionary. The name value is used as the key The dictionary will not allow duplicate keys
26 Reading from a Dictionary Person findperson = Personnel["Rob"]; We can use a string indexer to locate items in the dictionary The findperson reference is set to refer to the Person instance with the name Rob. The dictionary does all the hard work of finding that particular entry. This makes it very easy to store large numbers of items and locate them later. The dictionary will refuse to store an item with the same key as one already present. In other words if I try to add a second person with the name Rob the Add operation will throw an exception. A program will also get an exception if it asks the dictionary for a record that doesn t exist:
27 Checking for Items if (Personnel.ContainsKey("Jim")) // If we get here the dictionary // contains Jim A Dictionary also provides a method that can be used to test for the existence of particular keys Your code should do this rather than throw exceptions
28 Dictionaries in action Dictionaries are very useful for storing collections that you want to index on a particular key value The storing and searching is managed very efficiently A system can contain multiple dictionaries to index on different key items For example we could add a second dictionary to our Personnel system that would allow us to find a person from their phone number 28
29 Dictionaries and Isolated Storage The IsolatedStorageSettings class provides a Dictionary based model for storing and retrieving setting information Provides a Dictionary<TKey, TValue> that stores key-value pairs in isolated storage. It stores any object indexed on a string key This makes it very easy to store settings objects Your application must call the Save method on the settings object to complete a save 29
30 Saving using settings private void savetext(string filename, string text) IsolatedStorageSettings isolatedstore = IsolatedStorageSettings.ApplicationSettings; isolatedstore.remove(filename); isolatedstore.add(filename, text); isolatedstore.save(); This Save method stores a string of text with the supplied name
31 Getting the isolated store private void savetext(string filename, string text) IsolatedStorageSettings isolatedstore = IsolatedStorageSettings.ApplicationSettings; isolatedstore.remove(filename); isolatedstore.add(filename, text); isolatedstore.save(); This statement gets a reference to the settings object Provides a Dictionary<TKey, TValue> that stores key-value pairs in isolated storage.
32 Removing an old version private void savetext(string filename, string text) IsolatedStorageSettings isolatedstore = IsolatedStorageSettings.ApplicationSettings; isolatedstore.remove(filename); isolatedstore.add(filename, text); isolatedstore.save(); This removes an existing item with this name Removing does not fail if the item is not there
33 Saving the data private void savetext(string filename, string text) IsolatedStorageSettings isolatedstore = IsolatedStorageSettings.ApplicationSettings; isolatedstore.remove(filename); isolatedstore.add(filename, text); isolatedstore.save(); This adds the item and then saves the settings back to the isolated store
34 SaveText Method This version of the savetext method uses the filename as the key. It removes an existing key with the given filename and then adds the supplied text as a new entry. The Remove method can be called to remove an item from a dictionary. It is given the key to the item to be removed. If the key is not present in the dictionary the Remove method returns false, but we can ignore this. Once we have made our changes to the store we need to call the Save method to persist these changes. 34
35 Reading from settings storage Reading is the reverse of writing Your program must provide the key of the item it wants to load The loadtext method fetches the requested item from the settings storage Note that the saved item will be returned in the form of an object reference which your program must cast to the required type The settings storage does not provide a ContainsKey method 35
36 Loading from the setting storage private bool loadtext(string filename, out string result) IsolatedStorageSettings isolatedstore = IsolatedStorageSettings.ApplicationSettings; result = ""; try result = (string)isolatedstore[filename]; catch return false; return true;
37 Managing the loading result = ""; try result = (string) isolatedstore[filename]; catch return false; Because it is not possible to check if a setting exists the load method must instead catch the exception that is thrown if a key is not found The loadtext method failed 37 returns false to indicate that the load
38 Isolated Storage A program can create and use as many files as the application requires It is also possible to create folders within isolated storage so an application can organise data as required We now have two ways to persist data on a device. We can store large amounts of data in a filestore that we can create and structure how we like. Alternatively we can store individual data items by name in a settings dictionary. 38
39 Demo 39
40 Reference Engr. Ali Javed 40
41 For any query Feel Free to ask Engr. Ali Javed 41
File Handling Programming 1 C# Programming. Rob Miles
08101 Programming 1 C# Programming Rob Miles Files At the moment when our program stops all the data in it is destroyed We need a way of persisting data from our programs The way to do this is to use files
More informationLecture # 6 Engr. Ali Javed 11th March, 2014
Lecture # 6 Engr. Ali Javed 11 th March, 2014 Instructor s Information Instructor: Engr. Ali Javed Assistant Professor Department of Software Engineering U.E.T Taxila Email: ali.javed@uettaxila.edu.pk
More informationSilverlight memory board ( Part 2 )
Silverlight memory board ( Part 2 ) In the first part this tutorial we created a new Silverlight project and designed the user interface. In this part, we will add some code to the project to make the
More information9.3 Launchers and Choosers. Fast Application Switching and Design. Forcing a Program to be removed from memory
debugging. If you then press the Back button you will find that the program will resume execution after being reactivated. Forcing a Program to be removed from memory When we are testing your program we
More informationMotivation for a Permanent Cache Foundations of Isolated Storage
CUTTING EDGE Managing Dynamic Content Delivery In Silverlight, Part 2 Dino Esposito Contents Motivation for a Permanent Cache Foundations of Isolated Storage Isolated Storage API Building a Permanent Cache
More informationCSC 415 ONLINE PHOTOALBUM: THE SEQUEL ASP.NET VERSION
CSC 415 ONLINE PHOTOALBUM: THE SEQUEL ASP.NET VERSION GODFREY MUGANDA In this project, you will convert the Online Photo Album project to run on the ASP.NET platform, using only generic HTTP handlers.
More informationAdvance Windows Phone Development. Akber Alwani Window Phone 7 Development EP.NET Professionals User Group
Advance Windows Phone Development Akber Alwani Window Phone 7 Development EP.NET Professionals User Group http://www.epdotnet.com 7 Agenda Page Navigation Application Bar and System tray Orientation-Aware
More informationFiles. C# Programming: From Problem Analysis to Program Design 2nd Edition. David McDonald, Ph.D. Director of Emerging Technologies
12 Working with Files C# Programming: From Problem Analysis to Program Design 2nd Edition David McDonald, Ph.D. Director of Emerging Technologies Chapter Objectives Learn about the System.IO namespace
More informationSolutions for Windows Phone are available:
C# 5.0 includes the async and await keywords to ease writing of asynchronous code In Windows Store Apps, new Task-based methods are used for networking exclusively,not supported on Windows Phone 8 Solutions
More informationC# Data Manipulation
C# Data Manipulation Hans-Wolfgang Loidl School of Mathematical and Computer Sciences, Heriot-Watt University, Edinburgh Semester 1 2018/19 H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC
More informationC# Data Manipulation
C# Data Manipulation Hans-Wolfgang Loidl School of Mathematical and Computer Sciences, Heriot-Watt University, Edinburgh Semester 1 2018/19 H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC
More informationChapter 14: Files and Streams
Chapter 14: Files and Streams Files and the File and Directory Temporary storage Classes Usually called computer memory or random access memory (RAM) Variables use temporary storage Volatile Permanent
More informationIndustrial Programming
Industrial Programming Lecture 6: C# Data Manipulation Industrial Programming 1 The Stream Programming Model File streams can be used to access stored data. A stream is an object that represents a generic
More informationA Summoner's Tale MonoGame Tutorial Series. Chapter 10. Creating Avatars
A Summoner's Tale MonoGame Tutorial Series Chapter 10 Creating Avatars This tutorial series is about creating a Pokemon style game with the MonoGame Framework called A Summoner's Tale. The tutorials will
More informationCISC 323 (Week 9) Design of a Weather Program & Java File I/O
CISC 323 (Week 9) Design of a Weather Program & Java File I/O Jeremy Bradbury Teaching Assistant March 8 & 10, 2004 bradbury@cs.queensu.ca Programming Project The next three assignments form a programming
More information05/31/2009. Data Files
Data Files Store and retrieve data in files using streams Save the values from a list box and reload for the next program run Check for the end of file Test whether a file exists Display the standard Open
More informationC# Crash Course Dimitar Minchev
C# Crash Course Dimitar Minchev BIO Dimitar Minchev PhD of Informatics, Assistant Professor in Faculty of Computer Science and Engineering, Burgas Free University, Bulgaria. Education Bachelor of Informatics,
More informationChapter 11. Data Files The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill
Chapter 11 Data Files McGraw-Hill 2010 The McGraw-Hill Companies, Inc. All rights reserved. Chapter Objectives Store and retrieve data in files using streams Save the values from a list box and reload
More informationData Structures. 03 Streams & File I/O
David Drohan Data Structures 03 Streams & File I/O JAVA: An Introduction to Problem Solving & Programming, 6 th Ed. By Walter Savitch ISBN 0132162709 2012 Pearson Education, Inc., Upper Saddle River, NJ.
More informationClasses. System. class String // alias for string
Classes System class String // alias for string Length char this [] operator string + (string, string) operator == (string, string) operator!= (string, string) static string Empty static Compare (string,
More informationTrinity File System (TFS) Specification V0.8
Trinity File System (TFS) Specification V0.8 Jiaran Zhang (v-jiarzh@microsoft.com), Bin Shao (binshao@microsoft.com) 1. Introduction Trinity File System (TFS) is a distributed file system designed to run
More informationCreating a Role Playing Game with XNA Game Studio Part 50 Items - Part 4b
Creating a Role Playing Game with XNA Game Studio Part 50 Items - Part 4b To follow along with this tutorial you will have to have read the previous tutorials to understand much of what it going on. You
More informationNetwork Media. File sharing guide
Network Media File sharing guide Table of contents Table of contents... 2 Introduction... 2 Create a UPnP server in Windows Vista... 3 Create a UPnP server in Windows 7... 4 Share files and folders in
More informationTable of Contents Web Service Specification (version 1.5)
Table of Contents Web Service Specification (version 1.5) Introduction... 3 Add TPS Screening to your Website or Application... 3 Getting Started... 3 What you can do with our API... 3 Be careful......
More informationCS Internet programming Unit- I Part - A 1 Define Java. 2. What is a Class? 3. What is an Object? 4. What is an Instance?
CS6501 - Internet programming Unit- I Part - A 1 Define Java. Java is a programming language expressly designed for use in the distributed environment of the Internet. It was designed to have the "look
More informationVisual Basic.NET for Xamarin using Portable Class Libraries
Portable Visual Basic.NET Visual Basic.NET for Xamarin using Portable Class Libraries Overview In this guide we re going to walk through creating a new Visual Basic class library in Visual Studio as a
More informationHow to read/write text file
How to read/write text file Contents Use StreamWriter... 1 Create button click event handler... 2 Create StreamWriter... 3 Write to file... 5 Close file... 8 Test file writing... 9 Use StreamReader...
More informationCompile error. 2. A run time error occurs when the program runs and is caused by a number of reasons, such as dividing by zero.
(טיפול בשגיאות) Exception handling We learn that there are three categories of errors : Syntax error, Runtime error and Logic error. A Syntax error (compiler error) arises because a rule of the language
More informationIBM Tivoli Composite Application Manager for Microsoft Lync Server Agent
IBM Tivoli IBM Tivoli Composite Application Manager for Microsoft Lync Server Agent KB Notes and HOW TOs CONTENTS Contents... 2 1 Overview... 3 1.1 Introduction... 3 1.2 Terms and abbreviations... 4 1.3
More informationWindows File I/O. Files. Collections of related data stored on external storage media and assigned names so that they can be accessed later
Windows File I/O Files Collections of related data stored on external storage media and assigned names so that they can be accessed later Entire collection is a file A file is made up of records One record
More informationDuhok Polytechnic University Amedi Technical Institute/ IT Dept. Halkawt Rajab Hussain
Duhok Polytechnic University Amedi Technical Institute/ IT Dept. By Halkawt Rajab Hussain 2016-04-02 String and files: String declaration and initialization. Strings and Char Arrays: Properties And Methods.
More informationJava file manipulations
Java file manipulations 1 Categories of Java errors We learn that there are three categories of Java errors : Syntax error Runtime error Logic error. A Syntax error (compiler error) arises because a rule
More informationImplementing Rules. Java rules ok
Implementing Rules Java rules ok This is a design discussion lecture for Sprint 2 of the game What types of Rule:s exist in the Game? After analysing the old specification, it seems that there are two
More informationC# Continued. Learning Objectives:
Learning Objectives: C# Continued Open File Dialog and Save File Dialog File Input/Output Importing Pictures from Files and saving Bitmaps Reading and Writing Text Files Try and Catch Working with Strings
More informationChapter 8 Managing Your Files
Chapter 8 Managing Your Files Learning Objectives LO8.1: Organize Files and Folders LO8.2: Manage Files and Folders LO8.3: Work with Compressed Files CMPTR Chapter 8: Managing Your Files 2 1 LO8.1: Organizing
More informationGetting Started with IVI-COM Drivers for the Lambda Genesys Power Supply
Page 1 of 17 1. Introduction This is a step-by-step guide to writing a program to remotely control the Genesys power supply using the Lambda IVI-COM drivers. This tutorial has instructions and sample code
More informationCSI 402 Systems Programming LECTURE 4 FILES AND FILE OPERATIONS
CSI 402 Systems Programming LECTURE 4 FILES AND FILE OPERATIONS A mini Quiz 2 Consider the following struct definition struct name{ int a; float b; }; Then somewhere in main() struct name *ptr,p; ptr=&p;
More informationSOFTWARE REQUIREMENTS ENGINEERING LECTURE # 7 TEAM SKILL 2: UNDERSTANDING USER AND STAKEHOLDER NEEDS REQUIREMENT ELICITATION TECHNIQUES-IV
1 SOFTWARE REQUIREMENTS ENGINEERING LECTURE # 7 TEAM SKILL 2: UNDERSTANDING USER AND STAKEHOLDER NEEDS REQUIREMENT ELICITATION TECHNIQUES-IV 12 th June, 2013 Instructor Information 2 Course Instructor:
More informationAn Introduction to Python
An Introduction to Python Day 2 Renaud Dessalles dessalles@ucla.edu Python s Data Structures - Lists * Lists can store lots of information. * The data doesn t have to all be the same type! (unlike many
More information05-01 Discussion Notes
05-01 Discussion Notes PIC 10B Spring 2018 1 Exceptions 1.1 Introduction Exceptions are used to signify that a function is being used incorrectly. Once an exception is thrown, it is up to the programmer
More informationTextbook. Topic 8: Files and Exceptions. Files. Types of Files
Textbook Topic 8: Files and A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. -Douglas Adams 1 Strongly Recommended
More informationFile System Interface. ICS332 Operating Systems
File System Interface ICS332 Operating Systems Files and Directories Features A file system implements the file abstraction for secondary storage It also implements the directory abstraction to organize
More informationEnn Õunapuu
Asünkroonsed teenused Enn Õunapuu enn.ounapuu@ttu.ee Määrang Asynchronous processing enables methods to return immediately without blocking on the calling thread. Consumers request asynchronous processing
More informationGetting Started with Banjos4Hire
Getting Started with Banjos4Hire Rob Miles Department of Computer Science Data Objects There are a number of objects that you will need to keep track of in the program Banjo Customer Rental You can use
More informationUsing Files. Wrestling with Python Classes. Rob Miles
Using Files Wrestling with Python Classes Rob Miles Persisting Data At the moment the data in our programs is discarded when we exit the Python system Programs need a way of persisting data Python can
More informationCOMP 202 File Access. CONTENTS: I/O streams Reading and writing text files. COMP 202 File Access 1
COMP 202 File Access CONTENTS: I/O streams Reading and writing text files COMP 202 File Access 1 I/O Streams A stream is a sequence of bytes that flow from a source to a destination In a program, we read
More informationLab 5: Java IO 12:00 PM, Feb 21, 2018
CS18 Integrated Introduction to Computer Science Fisler, Nelson Contents Lab 5: Java IO 12:00 PM, Feb 21, 2018 1 The Java IO Library 1 2 Program Arguments 2 3 Readers, Writers, and Buffers 2 3.1 Buffering
More informationCSCD 330 Network Programming
CSCD 330 Network Programming Lecture 8 Client-Server Programming Threads Winter 2015 Reading: Chapter 2, Relevant Links Some Material in these slides from J.F Kurose and K.W. Ross All material copyright
More information8/31/2015 BITS BYTES AND FILES. What is a bit. Representing a number. Technically, it s a change of voltage
Personal Computing BITS BYTES AND FILES What is a bit Technically, it s a change of voltage Two stable states of a flip-flop Positions of an electrical switch That s for the EE folks It s a zero or a one
More informationProgramming with Microsoft Visual Basic.NET. Array. What have we learnt in last lesson? What is Array?
What have we learnt in last lesson? Programming with Microsoft Visual Basic.NET Using Toolbar in Windows Form. Using Tab Control to separate information into different tab page Storage hierarchy information
More informationUpgrade Procedures from Version 9 to Version 12
Upgrade Procedures from Version 9 to Before this type of installation is performed the user must backup all the wells and logs in their database. The Hardware Key does have to be reprogrammed when a major
More information19 - This PC Inside This PC
19 - This PC Computer (also known as My Computer in Windows XP) was renamed to This PC in Windows 8.1, and Windows 10 keeps this new naming convention. From This PC, you can get access or browse to all
More informationSimple FTP demo application using C#.Net 2.0
Стр. 1 из 5 Source : Mindcracker Network (www.c-sharpcorner.com) Print Simple FTP demo application using C#.Net 2.0 By Mohammed Habeeb January 18, 2007 An article to demonstrate common FTP functionalities
More informationChapter 11: File-System Interface
Chapter 11: File-System Interface Silberschatz, Galvin and Gagne 2013 Chapter 11: File-System Interface File Concept Access Methods Disk and Directory Structure 11.2 Silberschatz, Galvin and Gagne 2013
More informationExceptions. CS162: Introduction to Computer Science II. Exceptions. Exceptions. Exceptions. Exceptions. Exceptions
CS162: Introduction to Computer Science II A typical way to handle error conditions is through the return value. For example, suppose we create a loadfile() function that returns true if it loaded the
More informationSkinning Manual v1.0. Skinning Example
Skinning Manual v1.0 Introduction Centroid Skinning, available in CNC11 v3.15 r24+ for Mill and Lathe, allows developers to create their own front-end or skin for their application. Skinning allows developers
More informationChapter 8 Files. File Streams
Chapter 8 Files Few programs are written that don t involve some type of file input/output. Way back in the days when the C language became popular a set of library functions were designed that have been
More informationHELPLINE. Dilwyn Jones
HELPLINE Dilwyn Jones Remember that you can send me your Helpline queries by email to helpline@quanta.org.uk, or by letter to the address inside the front cover. While we do our best to help, we obviously
More informationIntroduction to Linked Lists. Introduction to Recursion Search Algorithms CS 311 Data Structures and Algorithms
Introduction to Linked Lists Introduction to Recursion Search Algorithms CS 311 Data Structures and Algorithms Lecture Slides Friday, September 25, 2009 Glenn G. Chappell Department of Computer Science
More informationFinal Exam Review April 18, 2018
Engr 123 Name Final Exam Review April 18, 2018 Final Exam is Monday April 30, 2018 at 8:00am 1. If i, j, and k are all of type int and i = 0, j = 2, and k = -8, mark whether each of the following logical
More informationUnit 10: exception handling and file I/O
Unit 10: exception handling and file I/O Using File objects Reading from files using Scanner Writing to file using PrintStream not in notes 1 Review What is a stream? What is the difference between a text
More informationA Summoner's Tale MonoGame Tutorial Series. Chapter 11. Battling Avatars
A Summoner's Tale MonoGame Tutorial Series Chapter 11 Battling Avatars This tutorial series is about creating a Pokemon style game with the MonoGame Framework called A Summoner's Tale. The tutorials will
More informationVideo 2.1. Arvind Bhusnurmath. Property of Penn Engineering, Arvind Bhusnurmath. SD1x-2 1
Video 2.1 Arvind Bhusnurmath SD1x-2 1 Topics Why is testing important? Different types of testing Unit testing SD1x-2 2 Software testing Integral part of development. If you ship a software with bugs,
More informationCOMPUTER BASICS LESSON 4 COMPUTER OPERATION SYSTEMS. Edited by C. 1Rhodes 9/11
COMPUTER BASICS LESSON 4 COMPUTER OPERATION SYSTEMS Edited by C. 1Rhodes 9/11 ESSENTIAL STANDARD Computer Basics ESSENTIAL QUESTIONS What are the parts and features of a computer? What are the functions
More informationProcedures, Parameters, Values and Variables. Steven R. Bagley
Procedures, Parameters, Values and Variables Steven R. Bagley Recap A Program is a sequence of statements (instructions) Statements executed one-by-one in order Unless it is changed by the programmer e.g.
More informationExceptions, Case Study-Exception handling in C++.
PART III: Structuring of Computations- Structuring the computation, Expressions and statements, Conditional execution and iteration, Routines, Style issues: side effects and aliasing, Exceptions, Case
More informationDistributed Data Analytics Transactions
Distributed Data Analytics G-3.1.09, Campus III Hasso Plattner Institut must ensure that interactions succeed consistently An OLTP Topic Motivation Most database interactions consist of multiple, coherent
More informationMT264 Course Revision
MT264 Course Revision Written by : Rifat Hamoudi (staff number : 00567451) GUI - 1 - Forms A graphical user interface or GUI is a means of interacting with a device by using graphical images. For example,
More informationCS 200 File Input and Output Jim Williams, PhD
CS 200 File Input and Output Jim Williams, PhD This Week 1. WaTor Change Log 2. Monday Appts - may be interrupted. 3. Optional Lab: Create a Personal Webpage a. demonstrate to TA for same credit as other
More informationCSCD 330 Network Programming
CSCD 330 Network Programming Lecture 8 Client-Server Programming Threads Spring 2018 Reading: Chapter 2, Relevant Links - Threads Some Material in these slides from J.F Kurose and K.W. Ross All material
More informationIndex. Cambridge University Press Functional Programming Using F# Michael R. Hansen and Hans Rischel. Index.
(),23 (*,3 ->,3,32 *,11 *),3.[...], 27, 186 //,3 ///,3 ::, 71, 80 :=, 182 ;, 179 ;;,1 @, 79, 80 @"...",26 >,38,35
More informationCS1092: Tutorial Sheet: No 3 Exceptions and Files. Tutor s Guide
CS1092: Tutorial Sheet: No 3 Exceptions and Files Tutor s Guide Preliminary This tutorial sheet requires that you ve read Chapter 15 on Exceptions (CS1081 lectured material), and followed the recent CS1092
More informationChapter 14 Sequential Access Files
Chapter 14 Sequential Access Files Objectives Create file objects Open a sequential access file Determine whether a sequential access file was opened successfully Write data to a sequential access file
More informationCSCE 206: Structured Programming in C++
CSCE 206: Structured Programming in C++ 2017 Spring Exam 2 Monday, March 20, 2017 Total - 100 Points B Instructions: Total of 13 pages, including this cover and the last page. Before starting the exam,
More informationCOP 1220 Introduction to Programming in C++ Course Justification
Course Justification This course is a required first programming C++ course in the following degrees: Associate of Arts in Computer Science, Associate in Science: Computer Programming and Analysis; Game
More informationDATA STRUCTURE AND ALGORITHM USING PYTHON
DATA STRUCTURE AND ALGORITHM USING PYTHON Advanced Data Structure and File Manipulation Peter Lo Linear Structure Queue, Stack, Linked List and Tree 2 Queue A queue is a line of people or things waiting
More informationDealing with Bugs. Kenneth M. Anderson University of Colorado, Boulder CSCI 5828 Lecture 27 04/21/2009
Dealing with Bugs Kenneth M. Anderson University of Colorado, Boulder CSCI 5828 Lecture 27 04/21/2009 University of Colorado, 2009 1 Goals 2 Review material from Chapter 11 of Pilone & Miles Dealing with
More informationAbsolute C++ Walter Savitch
Absolute C++ sixth edition Walter Savitch Global edition This page intentionally left blank Absolute C++, Global Edition Cover Title Page Copyright Page Preface Acknowledgments Brief Contents Contents
More informationCSCE 121 ENGR 112 List of Topics for Exam 1
List of Topics for Exam 1 If statements o How is an if statement constructed? o Does every if need an else? Looping o While loop! What does a while loop look like?! How do you ensure you will not have
More informationPage 1. Recap: File System Goals" Recap: Linked Allocation"
Recap: File System Goals" CS162 Operating Systems and Systems Programming Lecture 14 File Systems (cont d), Key Value Storage Systems" Maximize sequential performance Efiicient random access to file Easy
More informationInstallation Instructions. Your Guide to Installing and Getting Started with WinSteam Version 4.0
Installation Instructions Your Guide to Installing and Getting Started with WinSteam Version 4.0 Copyright 1992-2012 Techware Engineering Applications, Inc. www.techwareeng.com Toll Free (866) TECHWAR
More informationC# Continued. Learning Objectives:
Learning Objectives: C# Continued Open File Dialog and Save File Dialog File Input/Output Importing Pictures from Files and saving Bitmaps Reading and Writing Text Files Try and Catch Working with Strings
More informationCSCD 330 Network Programming
CSCD 330 Network Programming Lecture 8 Client-Server Programming Threads Spring 2017 Reading: Chapter 2, Relevant Links - Threads Some Material in these slides from J.F Kurose and K.W. Ross All material
More informationDO NGHIEM AN RAPID ROLLER: A GAME FOR WINDOWS PHONE
DO NGHIEM AN RAPID ROLLER: A GAME FOR WINDOWS PHONE Telecommunications and Technology 2012 2 VAASAN AMMATTIKORKEAKOULU UNIVERSITY OF APPLIED SCIENCES TELECOMMUNICATIONS AND TECHNOLOGY ABSTRACT Author Do
More informationAnnouncements/Reminders
Announcements/Reminders Additional rmiregistry notes on the newsgroup CMPSCI 377: Operating Systems Lecture 15, Page 1 Today: File System Functionality Remember the high-level view of the OS as a translator
More informationCopy Music from CDs for Videos & Slideshows
Copy Music from CDs for Videos & Slideshows C 528 / 1 Easily Create Music to Use in Your Personal Video Projects Digital cameras make it easy to take pictures and movie clips, and programs like Windows
More informationSE06: In-Sight Explorer New Tools for Defect Detection - Hands On Lab Werner Solution Expo April 8 & 9
SE06: In-Sight Explorer New Tools for Defect Detection - Hands On Lab Werner Solution Expo April 8 & 9 Learning Goals: At the end of this lab, the student should have familiarity with the most common settings
More informationInput/Output (I/0) What is File I/O? Writing to a File. Writing to Standard Output. CS111 Computer Programming
What is File I/O? Input/Output (I/0) Thu. Apr. 12, 2012 Computer Programming A file is an abstraction for storing information (text, images, music, etc.) on a computer. Today we will explore how to read
More informationHow to update Windows and Office offline
How to update Windows and Office offline Computers which have fast Internet access can download and install Windows and Office updates automatically, through the Windows Automatic Updates service in the
More information1 Strings (Review) CS151: Problem Solving and Programming
1 Strings (Review) Strings are a collection of characters. quotes. this is a string "this is also a string" In python, strings can be delineated by either single or double If you use one type of quote
More informationIntroduce C# as Object Oriented programming language. Explain, tokens,
Module 2 98 Assignment 1 Introduce C# as Object Oriented programming language. Explain, tokens, lexicals and control flow constructs. 99 The C# Family Tree C Platform Independence C++ Object Orientation
More information.NET-6Weeks Project Based Training
.NET-6Weeks Project Based Training Core Topics 1. C# 2. MS.Net 3. ASP.NET 4. 1 Project MS.NET MS.NET Framework The.NET Framework - an Overview Architecture of.net Framework Types of Applications which
More informationIDPort User Guide.
IDPort User Guide www.monitorbm.com ID Port User Guide 2012 Monitor Business Machines Ltd. The software contains proprietary information of Monitor Business Machines Ltd. It is provided under a license
More informationLogistics. Final Exam on Friday at 3pm in CHEM 102
Java Review Logistics Final Exam on Friday at 3pm in CHEM 102 What is a class? A class is primarily a description of objects, or instances, of that class A class contains one or more constructors to create
More informationMT264 Course Revision
MT264 Course Revision Written by : Rifat Hamoudi (staff number : 00567451) GUI Forms A graphical user interface or GUI is a means of interacting with a device by using graphical images. For example, mobile
More information5 MANAGING USER ACCOUNTS AND GROUPS
MANAGING USER ACCOUNTS AND GROUPS.1 Introduction to user accounts Objectives.2 Types of User Accounts.2.1 Local User Account.2.2 Built-in User Account.2.3 Domain User Account.3 User Profile.3.1 Content
More informationFILE SYSTEMS. CS124 Operating Systems Winter , Lecture 23
FILE SYSTEMS CS124 Operating Systems Winter 2015-2016, Lecture 23 2 Persistent Storage All programs require some form of persistent storage that lasts beyond the lifetime of an individual process Most
More informationObjects and Classes Continued. Engineering 1D04, Teaching Session 10
Objects and Classes Continued Engineering 1D04, Teaching Session 10 Recap: HighScores Example txtname1 txtname2 txtscore1 txtscore2 Copyright 2006 David Das, Ryan Lortie, Alan Wassyng 1 recap: HighScores
More informationExceptions - Example. Exceptions - Example
- Example //precondition: x >= 0 public void sqrt(double x) double root; if (x < 0.0) //What to do? else //compute the square root of x return root; 1 - Example //precondition: x >= 0 public void sqrt(double
More informationOOPs Concepts. 1. Data Hiding 2. Encapsulation 3. Abstraction 4. Is-A Relationship 5. Method Signature 6. Polymorphism 7. Constructors 8.
OOPs Concepts 1. Data Hiding 2. Encapsulation 3. Abstraction 4. Is-A Relationship 5. Method Signature 6. Polymorphism 7. Constructors 8. Type Casting Let us discuss them in detail: 1. Data Hiding: Every
More information