The document discusses working with files in .NET. It shows how to open, read from, and write to text files using FileStream, StreamReader, and StreamWriter. Code examples are provided to open an existing file, append new lines of text to the file, then read the entire file contents back into a text box. The document also demonstrates using a save file dialog to allow the user to select a file path before writing to a new or existing file.
The document is a lesson on Windows Forms controls in C++.NET. It introduces common controls like buttons, checkboxes, labels, etc. It discusses control properties and events that can be used at design time and runtime. It provides examples of changing control properties like a button's text and form opacity through event handlers. The document also covers key concepts like the difference between Hide and Close, using the Application class's Exit method, and differences between managed and unmanaged memory in .NET.
This document discusses switching between forms in a C++.NET Windows Forms application. It provides steps to include a second form header in the first form, instantiate the second form, and switch to it by calling its Show() method. It also describes how to pass a reference to the first form to the second form so it can switch back by updating properties of the first form. Additional controls like labels, textboxes, trackbars and progressbars are described along with common properties and events. NumericUpDown and parsing string values to integers is also covered.
This document discusses various Windows Forms controls in C++.NET including TabPage, ListBox, CheckBox, CheckedListBox, RadioButton, and GroupBox. It provides examples of how to use each control at design time and runtime, how to add, remove, and select items, and how properties like SelectionMode work. Code examples are given for handling events like SelectedIndexChanged and clicking buttons to demonstrate interacting with the different controls programmatically.
This document provides an overview and examples of using various Windows Forms controls in C++.NET, including:
- The Focus method, which programmatically sets keyboard focus to a control like a text box.
- DataGridView, for displaying tabular data from a database or other source. Examples demonstrate populating and accessing cells.
- StatusBar, for displaying status messages. Code shows updating a status label on button clicks.
- Timer, for performing periodic tasks like progress bar updates. Code demonstrates starting a timer on button click.
- OpenFileDialog and SaveFileDialog, for selecting files. Examples show opening, reading, and writing files selected through the dialogs.
This document discusses inheritance and multiple inheritance in C++.NET Windows Forms. It shows how to inherit from a Button class to create a custom button that can set its own text and location. It then demonstrates how to inherit from multiple classes is not supported, and provides a workaround using composition instead of inheritance to combine the functionality of a Button and ComboBox within a single custom class. The class initializes the button properties and adds event handlers, and also initializes a composed ComboBox and sets its location based on button clicks.
The document discusses various .NET collections classes in C++/CLI including LinkedList, List, Stack, Queue, Dictionary, SortedDictionary, ArrayList and how to use them. It provides examples of initializing the collections, adding and retrieving elements, and using foreach loops. It also covers potential errors like not initializing objects before adding them to collections, using invalid indexes, and type casting issues when retrieving elements.
This document provides an overview of using GDI+ and System.Drawing to perform graphics drawing in C++.NET Windows Forms applications. Key points covered include:
- How to get a Graphics object from a control to perform drawing
- Using pens, brushes, points and other classes to draw lines, rectangles and images
- Storing drawing objects in lists to persist drawings across repaints
- Clearing and refreshing the drawing surface
- Examples of drawing strings and tracking mouse input for rectangles
- Using a timer to continuously redraw animated drawing objects
This document discusses instantiating controls at runtime in C++.NET Windows Forms. It explains how to dynamically create a button in code, set its properties like location and text, and add event handlers for click and hover events. It demonstrates how to use dynamic_cast to cast the sender object to the correct control type within event handlers. It also shows how to continuously resize the button on hover by refreshing and sleeping the thread, and resize it back on leave. The key points are how to instantiate controls, set their properties, add event handlers, and dynamically modify control properties during events at runtime in C++.NET Windows Forms applications.
The document is a lesson on Windows Forms controls in C++.NET. It introduces common controls like buttons, checkboxes, labels, etc. It discusses control properties and events that can be used at design time and runtime. It provides examples of changing control properties like a button's text and form opacity through event handlers. The document also covers key concepts like the difference between Hide and Close, using the Application class's Exit method, and differences between managed and unmanaged memory in .NET.
This document discusses switching between forms in a C++.NET Windows Forms application. It provides steps to include a second form header in the first form, instantiate the second form, and switch to it by calling its Show() method. It also describes how to pass a reference to the first form to the second form so it can switch back by updating properties of the first form. Additional controls like labels, textboxes, trackbars and progressbars are described along with common properties and events. NumericUpDown and parsing string values to integers is also covered.
This document discusses various Windows Forms controls in C++.NET including TabPage, ListBox, CheckBox, CheckedListBox, RadioButton, and GroupBox. It provides examples of how to use each control at design time and runtime, how to add, remove, and select items, and how properties like SelectionMode work. Code examples are given for handling events like SelectedIndexChanged and clicking buttons to demonstrate interacting with the different controls programmatically.
This document provides an overview and examples of using various Windows Forms controls in C++.NET, including:
- The Focus method, which programmatically sets keyboard focus to a control like a text box.
- DataGridView, for displaying tabular data from a database or other source. Examples demonstrate populating and accessing cells.
- StatusBar, for displaying status messages. Code shows updating a status label on button clicks.
- Timer, for performing periodic tasks like progress bar updates. Code demonstrates starting a timer on button click.
- OpenFileDialog and SaveFileDialog, for selecting files. Examples show opening, reading, and writing files selected through the dialogs.
This document discusses inheritance and multiple inheritance in C++.NET Windows Forms. It shows how to inherit from a Button class to create a custom button that can set its own text and location. It then demonstrates how to inherit from multiple classes is not supported, and provides a workaround using composition instead of inheritance to combine the functionality of a Button and ComboBox within a single custom class. The class initializes the button properties and adds event handlers, and also initializes a composed ComboBox and sets its location based on button clicks.
The document discusses various .NET collections classes in C++/CLI including LinkedList, List, Stack, Queue, Dictionary, SortedDictionary, ArrayList and how to use them. It provides examples of initializing the collections, adding and retrieving elements, and using foreach loops. It also covers potential errors like not initializing objects before adding them to collections, using invalid indexes, and type casting issues when retrieving elements.
This document provides an overview of using GDI+ and System.Drawing to perform graphics drawing in C++.NET Windows Forms applications. Key points covered include:
- How to get a Graphics object from a control to perform drawing
- Using pens, brushes, points and other classes to draw lines, rectangles and images
- Storing drawing objects in lists to persist drawings across repaints
- Clearing and refreshing the drawing surface
- Examples of drawing strings and tracking mouse input for rectangles
- Using a timer to continuously redraw animated drawing objects
This document discusses instantiating controls at runtime in C++.NET Windows Forms. It explains how to dynamically create a button in code, set its properties like location and text, and add event handlers for click and hover events. It demonstrates how to use dynamic_cast to cast the sender object to the correct control type within event handlers. It also shows how to continuously resize the button on hover by refreshing and sleeping the thread, and resize it back on leave. The key points are how to instantiate controls, set their properties, add event handlers, and dynamically modify control properties during events at runtime in C++.NET Windows Forms applications.
Drawing graphics in C++.NET requires:
1. Creating a Pen object to define the line/shape color and thickness.
2. Getting a Graphics object from the control to draw on using CreateGraphics().
3. Calling DrawLine() or other drawing methods on the Graphics object, passing the Pen and point coordinates.
The document contains source code for several .NET programming examples including currency conversion, degree conversion, string manipulation, calculator, and employee salary calculation. The code demonstrates how to design forms, add controls, handle events, perform calculations and insert data into a SQL database. Output for the examples is not shown. The last example contains code to calculate an employee's gross pay and net pay based on their base pay and standard deductions.
The Ring programming language version 1.8 book - Part 7 of 202Mahmoud Samir Fayed
Ring 1.8 includes several new features and improvements such as better performance, new applications like Find in Files and String2Constant, more 3D samples, compiling on Manjaro Linux, updated libraries, and notes for extension creators. Key updates include 10-100% faster performance, a Find in Files application, a String2Constant tool to convert code to use constants, a StopWatch application, improved Form Designer, RingQt, and code generator for extensions. The release provides better compiler, virtual machine, and overall performance.
The Ring programming language version 1.5.2 book - Part 7 of 181Mahmoud Samir Fayed
The document summarizes updates and new features in Ring version 1.5, including:
1) A calculator application added to the Applications folder. Better Ring Notepad updated with new styles and a main file toolbar.
2) The Ring Notepad output window displays new lines correctly and contains a clear button. It also opens and switches between large files while preparing function/class lists.
3) New functions added to the StdLib - Print2Str(), ListAllFiles(), and SystemCmd(). The WebLib updated with an HTMLPage class to create HTML outside of web applications.
4) Better support for RingQt classes including QStringRef and Bluetooth classes. An example parses an XML response from
The Ring programming language version 1.5.3 book - Part 7 of 184Mahmoud Samir Fayed
The document summarizes the new features and changes in Ring 1.5. Key updates include new applications like a video player, startup manager, and calculator. Libraries like StdLib, WebLib, and RingQt were improved. New features include a smart garbage collector, trace library, type hints, and improved documentation generator for extensions.
The Ring programming language version 1.5.1 book - Part 6 of 180Mahmoud Samir Fayed
The document summarizes the new features and changes in Ring 1.5. Key updates include new applications like a video player and calculator, improved libraries for graphics, web development and more, better debugging tools, and increased flexibility and quality of the Ring programming language and tools.
The document provides an overview of .NET technology and VB.NET programming. It discusses key aspects of .NET including the Common Language Runtime (CLR), Common Type System, Windows Forms, Web Forms, Web Services, ADO.NET, XML support, and multiple language support. It also covers VB.NET programming concepts like forms, events, databases, dialog boxes, menus, classes, and arrays of objects. The document is intended as teaching material for a course on .NET and VB.NET programming.
The Ring programming language version 1.5.1 book - Part 13 of 180Mahmoud Samir Fayed
Ring 1.1 includes several new features and improvements:
1) Better support for natural language programming including calling methods when expressions are evaluated.
2) The ability to generate and execute Ring object files for easier application distribution without source code.
3) Increased syntax flexibility including different styles for input/output and control structures.
4) Many new functions and classes added to the standard library written in Ring itself.
The Ring programming language version 1.3 book - Part 83 of 88Mahmoud Samir Fayed
This document provides examples and explanations for common questions about using Ring programming language. It demonstrates how to summarize uninitialized variables, print lists containing objects, insert items into lists, print new lines and characters, create GUI applications using Qt, work with modal windows, and connect to SQLite and other databases using ODBC. Various functions, classes and concepts in Ring like Try/Catch, NULL, ISNULL(), lists, Qt classes and ODBC are explained through code examples.
The Ring programming language version 1.7 book - Part 7 of 196Mahmoud Samir Fayed
The Ring 1.7 release includes several new features and improvements:
1. A new "Load Package" command allows loading Ring libraries into separate namespaces to avoid conflicts.
2. New ringvm_see() and ringvm_give() functions allow redefining the behavior of the See and Give commands.
3. New ring_state_new() and ring_state_mainfile() functions enable running Ring programs from other Ring programs while controlling state deletion.
4. The Trace library debugger now includes a "callstack" command, and Ring Notepad, RingQt, and other tools received updates and enhancements.
This document introduces ClojureScript and building applications with it. It discusses how ClojureScript compiles Clojure to JavaScript and can run anywhere JavaScript runs. It covers the basics of the ClojureScript language like syntax, data structures, and functions. It also discusses tools for ClojureScript development like Leiningen, Figwheel, Shadow CLJS, and Cursive. Additionally, it covers building web applications with ClojureScript using templates like Hiccup and libraries like Reagent and Reframe.
The Ring programming language version 1.5.3 book - Part 6 of 184Mahmoud Samir Fayed
- Ring is a simple, dynamically typed scripting language designed for productivity. It aims to have clear program structure and encourage organization.
- Key features include object-oriented support, reflection, exception handling, math/string/file functions, and embedding capabilities. It can be used to create applications, games, and declarative domain-specific languages.
- The language focuses on transparency - its implementation and each compiler stage can be clearly seen. It also aims to have natural, minimal syntax and encourage nesting and organization of code.
DOM-based Test Adequacy Criteria for Web ApplicationsSALT Lab @ UBC
The document proposes DOM-based test adequacy criteria for evaluating test coverage of web applications. It introduces two inter-state criteria to assess DOM state and transitions, and four intra-state criteria to evaluate explicit, implicit, checked and actionable elements. It then describes the Domcovery tool which implements these criteria by instrumenting test suites, collecting DOM coverage data, and generating reports. An evaluation shows Domcovery improves testers' ability to locate covered elements and identifies untested features faster and more accurately than other methods.
This document compares several JVM languages including Java, Scala, Groovy, Kotlin, Clojure and Ceylon. It discusses their classification as functional or object-oriented, static or dynamic typing. It also summarizes key features of each language such as support for functional programming paradigms, closures, immutable data structures, and parallel processing capabilities. The document provides code examples to illustrate concepts in Scala, Kotlin, and Groovy.
Testing in Python: doctest and unittestFariz Darari
The document discusses testing in Python. It defines testing vs debugging, and explains why testing is important even for professional programmers. It introduces doctest and unittest as systematic ways to test Python code. Doctest allows embedding tests in docstrings, while unittest involves writing separate test files. The document also covers test-driven development, which involves writing tests before coding to define desired behavior.
Testing in Python: doctest and unittest (Updated)Fariz Darari
The document discusses testing in Python. It defines testing vs debugging, and explains why testing is important even for professional programmers. It provides examples of manually testing a square area function that initially had a bug, and how the bug was detected and fixed. It then introduces doctest and unittest as systematic ways to test in Python, providing examples of using each. Finally, it discusses test-driven development as a software development method where tests are defined before writing code.
This document summarizes a C# lesson that covers LINQ, generics, attributes, reflection, and the System.Collections.Generic namespace. It begins with an agenda that lists the topics to be covered. It then provides examples and explanations of LINQ queries, generic classes and constraints, commonly used collection classes like List and Dictionary, how to define and apply attributes to classes and properties, how to obtain type information at runtime using reflection, and concludes with a demo of an exporter application.
Python 3.6 includes several new features and improvements related to asynchronous programming and language syntax. PEP 525 introduces asynchronous generators to allow async and await in generator functions. PEP 530 adds asynchronous comprehensions for concise creation of asynchronous iterators. Other PEPs improve class attribute definition order preservation, string formatting syntax, and the addition of asynchronous APIs to the standard library. Python 3.6 continues Python's progress towards native asynchronous programming capabilities.
Kotlin Bytecode Generation and Runtime Performanceintelliyole
In this talk, we'll dive into the details of how various language features supported by Kotlin are translated to Java bytecode. We'll use the JMH microbenchmarking tool to study the relative performance of various constructs and to understand how we can ensure top performance of the Kotlin code that we write.
This document provides an introduction to Apache Flink. It begins with an overview of the presenters and structure of the presentation. It then discusses Flink's APIs, architecture, and execution model. Key concepts are explained like streaming vs batch processing, scaling, the job manager and task managers. It provides a demo of Flink's DataSet API for batch processing and explains a WordCount example program. The goal is to get attendees started with Apache Flink.
This document discusses Python-GTK and provides information about:
- Installing necessary packages like python-pywapi and glade
- Links to the author Yuren Ju's online profiles
- An assumption that the audience has experience with at least one programming language
- A graph showing Python's popularity based on the TIOBE index
- Comments from others that Python is suitable for beginners and experts alike and is flexible
- Examples of successful projects using Python including the author's first experience four years ago
Drawing graphics in C++.NET requires:
1. Creating a Pen object to define the line/shape color and thickness.
2. Getting a Graphics object from the control to draw on using CreateGraphics().
3. Calling DrawLine() or other drawing methods on the Graphics object, passing the Pen and point coordinates.
The document contains source code for several .NET programming examples including currency conversion, degree conversion, string manipulation, calculator, and employee salary calculation. The code demonstrates how to design forms, add controls, handle events, perform calculations and insert data into a SQL database. Output for the examples is not shown. The last example contains code to calculate an employee's gross pay and net pay based on their base pay and standard deductions.
The Ring programming language version 1.8 book - Part 7 of 202Mahmoud Samir Fayed
Ring 1.8 includes several new features and improvements such as better performance, new applications like Find in Files and String2Constant, more 3D samples, compiling on Manjaro Linux, updated libraries, and notes for extension creators. Key updates include 10-100% faster performance, a Find in Files application, a String2Constant tool to convert code to use constants, a StopWatch application, improved Form Designer, RingQt, and code generator for extensions. The release provides better compiler, virtual machine, and overall performance.
The Ring programming language version 1.5.2 book - Part 7 of 181Mahmoud Samir Fayed
The document summarizes updates and new features in Ring version 1.5, including:
1) A calculator application added to the Applications folder. Better Ring Notepad updated with new styles and a main file toolbar.
2) The Ring Notepad output window displays new lines correctly and contains a clear button. It also opens and switches between large files while preparing function/class lists.
3) New functions added to the StdLib - Print2Str(), ListAllFiles(), and SystemCmd(). The WebLib updated with an HTMLPage class to create HTML outside of web applications.
4) Better support for RingQt classes including QStringRef and Bluetooth classes. An example parses an XML response from
The Ring programming language version 1.5.3 book - Part 7 of 184Mahmoud Samir Fayed
The document summarizes the new features and changes in Ring 1.5. Key updates include new applications like a video player, startup manager, and calculator. Libraries like StdLib, WebLib, and RingQt were improved. New features include a smart garbage collector, trace library, type hints, and improved documentation generator for extensions.
The Ring programming language version 1.5.1 book - Part 6 of 180Mahmoud Samir Fayed
The document summarizes the new features and changes in Ring 1.5. Key updates include new applications like a video player and calculator, improved libraries for graphics, web development and more, better debugging tools, and increased flexibility and quality of the Ring programming language and tools.
The document provides an overview of .NET technology and VB.NET programming. It discusses key aspects of .NET including the Common Language Runtime (CLR), Common Type System, Windows Forms, Web Forms, Web Services, ADO.NET, XML support, and multiple language support. It also covers VB.NET programming concepts like forms, events, databases, dialog boxes, menus, classes, and arrays of objects. The document is intended as teaching material for a course on .NET and VB.NET programming.
The Ring programming language version 1.5.1 book - Part 13 of 180Mahmoud Samir Fayed
Ring 1.1 includes several new features and improvements:
1) Better support for natural language programming including calling methods when expressions are evaluated.
2) The ability to generate and execute Ring object files for easier application distribution without source code.
3) Increased syntax flexibility including different styles for input/output and control structures.
4) Many new functions and classes added to the standard library written in Ring itself.
The Ring programming language version 1.3 book - Part 83 of 88Mahmoud Samir Fayed
This document provides examples and explanations for common questions about using Ring programming language. It demonstrates how to summarize uninitialized variables, print lists containing objects, insert items into lists, print new lines and characters, create GUI applications using Qt, work with modal windows, and connect to SQLite and other databases using ODBC. Various functions, classes and concepts in Ring like Try/Catch, NULL, ISNULL(), lists, Qt classes and ODBC are explained through code examples.
The Ring programming language version 1.7 book - Part 7 of 196Mahmoud Samir Fayed
The Ring 1.7 release includes several new features and improvements:
1. A new "Load Package" command allows loading Ring libraries into separate namespaces to avoid conflicts.
2. New ringvm_see() and ringvm_give() functions allow redefining the behavior of the See and Give commands.
3. New ring_state_new() and ring_state_mainfile() functions enable running Ring programs from other Ring programs while controlling state deletion.
4. The Trace library debugger now includes a "callstack" command, and Ring Notepad, RingQt, and other tools received updates and enhancements.
This document introduces ClojureScript and building applications with it. It discusses how ClojureScript compiles Clojure to JavaScript and can run anywhere JavaScript runs. It covers the basics of the ClojureScript language like syntax, data structures, and functions. It also discusses tools for ClojureScript development like Leiningen, Figwheel, Shadow CLJS, and Cursive. Additionally, it covers building web applications with ClojureScript using templates like Hiccup and libraries like Reagent and Reframe.
The Ring programming language version 1.5.3 book - Part 6 of 184Mahmoud Samir Fayed
- Ring is a simple, dynamically typed scripting language designed for productivity. It aims to have clear program structure and encourage organization.
- Key features include object-oriented support, reflection, exception handling, math/string/file functions, and embedding capabilities. It can be used to create applications, games, and declarative domain-specific languages.
- The language focuses on transparency - its implementation and each compiler stage can be clearly seen. It also aims to have natural, minimal syntax and encourage nesting and organization of code.
DOM-based Test Adequacy Criteria for Web ApplicationsSALT Lab @ UBC
The document proposes DOM-based test adequacy criteria for evaluating test coverage of web applications. It introduces two inter-state criteria to assess DOM state and transitions, and four intra-state criteria to evaluate explicit, implicit, checked and actionable elements. It then describes the Domcovery tool which implements these criteria by instrumenting test suites, collecting DOM coverage data, and generating reports. An evaluation shows Domcovery improves testers' ability to locate covered elements and identifies untested features faster and more accurately than other methods.
This document compares several JVM languages including Java, Scala, Groovy, Kotlin, Clojure and Ceylon. It discusses their classification as functional or object-oriented, static or dynamic typing. It also summarizes key features of each language such as support for functional programming paradigms, closures, immutable data structures, and parallel processing capabilities. The document provides code examples to illustrate concepts in Scala, Kotlin, and Groovy.
Testing in Python: doctest and unittestFariz Darari
The document discusses testing in Python. It defines testing vs debugging, and explains why testing is important even for professional programmers. It introduces doctest and unittest as systematic ways to test Python code. Doctest allows embedding tests in docstrings, while unittest involves writing separate test files. The document also covers test-driven development, which involves writing tests before coding to define desired behavior.
Testing in Python: doctest and unittest (Updated)Fariz Darari
The document discusses testing in Python. It defines testing vs debugging, and explains why testing is important even for professional programmers. It provides examples of manually testing a square area function that initially had a bug, and how the bug was detected and fixed. It then introduces doctest and unittest as systematic ways to test in Python, providing examples of using each. Finally, it discusses test-driven development as a software development method where tests are defined before writing code.
This document summarizes a C# lesson that covers LINQ, generics, attributes, reflection, and the System.Collections.Generic namespace. It begins with an agenda that lists the topics to be covered. It then provides examples and explanations of LINQ queries, generic classes and constraints, commonly used collection classes like List and Dictionary, how to define and apply attributes to classes and properties, how to obtain type information at runtime using reflection, and concludes with a demo of an exporter application.
Python 3.6 includes several new features and improvements related to asynchronous programming and language syntax. PEP 525 introduces asynchronous generators to allow async and await in generator functions. PEP 530 adds asynchronous comprehensions for concise creation of asynchronous iterators. Other PEPs improve class attribute definition order preservation, string formatting syntax, and the addition of asynchronous APIs to the standard library. Python 3.6 continues Python's progress towards native asynchronous programming capabilities.
Kotlin Bytecode Generation and Runtime Performanceintelliyole
In this talk, we'll dive into the details of how various language features supported by Kotlin are translated to Java bytecode. We'll use the JMH microbenchmarking tool to study the relative performance of various constructs and to understand how we can ensure top performance of the Kotlin code that we write.
This document provides an introduction to Apache Flink. It begins with an overview of the presenters and structure of the presentation. It then discusses Flink's APIs, architecture, and execution model. Key concepts are explained like streaming vs batch processing, scaling, the job manager and task managers. It provides a demo of Flink's DataSet API for batch processing and explains a WordCount example program. The goal is to get attendees started with Apache Flink.
This document discusses Python-GTK and provides information about:
- Installing necessary packages like python-pywapi and glade
- Links to the author Yuren Ju's online profiles
- An assumption that the audience has experience with at least one programming language
- A graph showing Python's popularity based on the TIOBE index
- Comments from others that Python is suitable for beginners and experts alike and is flexible
- Examples of successful projects using Python including the author's first experience four years ago
This presentation about Python Interview Questions will help you crack your next Python interview with ease. The video includes interview questions on Numbers, lists, tuples, arrays, functions, regular expressions, strings, and files. We also look into concepts such as multithreading, deep copy, and shallow copy, pickling and unpickling. This video also covers Python libraries such as matplotlib, pandas, numpy,scikit and the programming paradigms followed by Python. It also covers Python library interview questions, libraries such as matplotlib, pandas, numpy and scikit. This video is ideal for both beginners as well as experienced professionals who are appearing for Python programming job interviews. Learn what are the most important Python interview questions and answers and know what will set you apart in the interview process.
Simplilearn’s Python Training Course is an all-inclusive program that will introduce you to the Python development language and expose you to the essentials of object-oriented programming, web development with Django and game development. Python has surpassed Java as the top language used to introduce U.S. students to programming and computer science. This course will give you hands-on development experience and prepare you for a career as a professional Python programmer.
What is this course about?
The All-in-One Python course enables you to become a professional Python programmer. Any aspiring programmer can learn Python from the basics and go on to master web development & game development in Python. Gain hands on experience creating a flappy bird game clone & website functionalities in Python.
What are the course objectives?
By the end of this online Python training course, you will be able to:
1. Internalize the concepts & constructs of Python
2. Learn to create your own Python programs
3. Master Python Django & advanced web development in Python
4. Master PyGame & game development in Python
5. Create a flappy bird game clone
The Python training course is recommended for:
1. Any aspiring programmer can take up this bundle to master Python
2. Any aspiring web developer or game developer can take up this bundle to meet their training needs
Learn more at https://www.simplilearn.com/mobile-and-software-development/python-development-training
The document introduces C# as the first component-oriented language in the C/C++ family. It discusses key features of C# including everything being an object, robust and durable software through garbage collection and exceptions, and preservation of investment from C++. It provides examples of basic C# concepts like classes, structs, interfaces, enums, delegates, properties and events.
The document introduces C# as the first component-oriented language in the C/C++ family. It discusses key features of C# including everything being an object, robust and durable software, and preservation of investment from other languages. It provides examples of basic C# syntax and programming structures.
The document introduces C# as the first component-oriented language in the C/C++ family. It discusses key features of C# including everything being an object, robust and durable software, preservation of investment from C++, and providing a unified type system where all types ultimately inherit from object. It provides examples of key C# concepts like classes, structs, interfaces, enums, delegates, properties, events, and attributes.
The document introduces C# as the first component-oriented language in the C/C++ family. It discusses key features of C# including everything being an object, robust and durable software through garbage collection and exceptions, and preservation of investment from C++. It provides examples of basic C# concepts like classes, structs, interfaces, enums, delegates, properties and events.
The document introduces C# as the first component-oriented language in the C/C++ family. It discusses key features of C# including everything being an object, robust and durable software through garbage collection and exceptions, and preservation of investment from C++. It provides examples of basic C# concepts like classes, structs, interfaces, enums, delegates, properties and events.
The document introduces C# as the first component-oriented language in the C/C++ family. It discusses key features of C# including everything being an object, robust and durable software, preservation of investment from C++, and providing a unified type system where all types ultimately inherit from object. It provides examples of core C# concepts like classes, structs, interfaces, enums, delegates, properties, events, and attributes.
Object-Oriented Programming (OOP) is a programming technique that treats data and functions as objects. OOP uses classes to define objects that contain properties and methods. Classes act as blueprints for objects. Objects are instances of classes that inherit properties and methods from their class. Key elements of OOP include classes, objects, properties, methods, inheritance, and interfaces.
This document discusses principles for writing clean code in functions. It recommends that functions should be small, do one thing, have descriptive names, and avoid side effects. Functions with many arguments or switch statements are harder to understand. Exceptions should be used instead of return codes to indicate errors. Overall, following best practices for functions helps produce code that is easy to read and maintain.
The document discusses events, creating custom events, and processing event streams in F#. It provides an overview of events, how they allow objects to communicate asynchronously, and how to create and handle events through the Event class. It also covers creating custom events for a Worker class to notify when the name or shift changes, attaching callback functions to event handlers, and an example of implementing an interface using events.
Google App Engine allows developers to build and deploy web applications on Google's infrastructure. It provides automatic scaling, high availability, easy management, and supports Python. Developers write application code and App Engine handles tasks like traffic handling and database scaling. The document discusses how to set up the development environment, deploy apps, and introduces key App Engine concepts like scalability and the datastore.
The document provides an introduction to object-oriented programming concepts in C++ including objects, classes, data abstraction, encapsulation, inheritance, polymorphism, dynamic binding, and message passing. It then describes the structure of a C++ program including include files, class definitions, data declarations, member functions, and main functions. Finally, it discusses control structures in C++ including decision making statements like if/else and switch statements, looping statements like while, do-while and for loops, and functions.
The document discusses classes and objects in C++. It defines what a class is - a blueprint for an object that contains data members and member functions. An object is an instance of a class that allocates memory. The document explains how to define a class with public and private members, create objects of a class, and access class members through objects using dot operators. It also covers constructors and how they initialize objects automatically upon creation.
C# is a component-oriented language that introduces object-oriented improvements to the C/C++ family of languages. Key features include garbage collection, exceptions, type safety, and preservation of investments in C++. C# supports classes, interfaces, structs, enums, delegates and events to provide a unified object model.
C# is a component-oriented language that introduces object-oriented improvements to the C/C++ family of languages. Key features include garbage collection, exceptions, type safety, and preservation of C++ investments like namespaces and enums. Everything in C# is an object, unifying value and reference types without performance penalties. The language supports robust features like properties, events, generics and attributes to enable component-based development.
This document discusses writing a compiler in Go. It provides an overview of the different modules needed for a compiler, including tokenization, lexing, parsing, AST generation, code generation, and a virtual machine. It also demonstrates these concepts by summarizing the development of a Monkey compiler, with modules for tokens, lexer, parser, AST, objects, evaluation, and code generation. Key takeaways are gaining an understanding of how compilers work, learning more about Go, and laying foundations for static analysis tools.
Similar to C++ Windows Forms L06 - Utlitity and Strings (20)
Ultra Fast, Cross Genre, Procedural Content Generation in Games [Master Thesis]Mohammad Shaker
In my MSc. thesis, I have re-tackled the problem of procedurally generating content for physics-based games I have previously investigated in my BSc. graduation thesis. This time around I propose two novel methods: the first is projection based for faster generation of physics-based games content. The other, The Progressive Generation, is a generic, wide-range, across genre, customisable with playability check method all bundled in a fast progressive approach. This new method is applied on two completely different games: NEXT And Cut the Rope.
Short, Matters, Love - Passioneers Event 2015Mohammad Shaker
Short, Matters, Love is a presentation I prepared for freshmen students at the Faculty of Information Technology in Damascus, Syria organised by Passioneers - 2015
This document discusses Unity3D and game development. It provides an overview of Unity3D and other game engines like Unreal Engine, comparing their features and costs. Examples are given of popular games made with each engine. The document also lists several games the author has made using Unity3D and provides some additional resources and references.
The document discusses various topics related to mobile application design including cloud interaction, Android touch and gesture interaction, UI element sizing, screen sizes, changing orientation, retaining objects during configuration changes, multi-device targeting, and wearables. It provides examples and guidelines for designing applications that can adapt to different devices and configurations.
The document discusses principles of interaction design, color theory, and game design. It covers topics like primary and secondary colors, color harmonies, using color to attract attention and set mood, the importance of white space and negative space in design, and how games like Journey, Fez, Luftrausers, Monument Valley, Ori and the Blind Forest, and Limbo effectively use techniques like the rule of thirds, establishing a sense of goal, and game feel.
This document discusses various topics related to typography including letter shapes like the letter "T", how words for concepts like water have evolved across languages, symbols for ideas like fish, and different writing styles such as styles that would be impossible to write. It examines typography from multiple perspectives like shapes, language evolution, symbols, and stylization.
Interaction Design L04 - Materialise and CouplingMohammad Shaker
This document discusses various aspects of coupling and interaction design in mobile applications. It addresses good and bad examples of coupling on Android and iOS, such as how apps are switched between. It also discusses using accurate text to represent backend processes, and using faster progress bars to reduce cognitive load on users. Visualizations are suggested to improve progress bars.
The document discusses various options for storing data in an Android application including SharedPreferences for simple key-value pairs, internal storage for private files, external storage for public files, SQLite databases for structured data, network connections for storing data on a web server, and ContentProviders for sharing data between applications. It provides details on using SharedPreferences, internal SQLite databases stored in the application's files, and ContentProviders for sharing Contacts data with other apps.
The document discusses various interaction design concepts in Android including toasts, notifications, threads, broadcast receivers, and alarms. It provides code examples for creating toasts, setting notification priorities, and scheduling alarms to fire at boot or at specific times using the AlarmManager. Broadcast receivers can be used to set alarms during device boot by listening for the BOOT_COMPLETED intent filter and implementing the onReceive callback.
This document provides an overview of various mobile development technologies and frameworks including Cloud, iOS, Android, iPad Pro, Xcode, Model-View-Controller (MVC), C, Objective-C, Foundation data types, functions calls, Swift, iOS Dev Center, coordinate systems, Windows Phone, .NET support, MVVM, binding, WebClient, and navigation. It also mentions tools like Expression Blend and frameworks like jQuery Mobile, PhoneGap, Sencha Touch, and Xamarin.
This document discusses various topics related to mobile app design including user experience (UX), user interface (UI), interaction design, user constraints like limited data/battery and screen size, and using context like location to improve the user experience. It provides examples of a pizza ordering app and making ATM machines smarter. It also covers design patterns and principles like focusing on user needs and testing designs through feedback.
This document discusses principles of visual organization and responsive grid systems for web design. It mentions laws of proximity, similarity, common fate, continuity, closure, and symmetry which help organize visual elements. It also discusses column-based and ratio-based grid systems as well as responsive grid systems that adapt to different screen widths, citing examples from Pinterest, Bootstrap, and the website www.mohammadshaker.com which demonstrates responsive design.
This document provides an overview comparison of key aspects of mobile app development for iOS and Android platforms. It discusses differences in app store policies, pricing, monetization options like ads and in-app purchases, development tools including engines like Unity and Unreal, and the publishing process. Key points mentioned include Android apps averaging over 2.5x the price of similar iOS apps, Apple's restrictive app review policies, the 70/30 revenue split in Google Play Store, and tools for user testing and publishing on both platforms. It also shares stats on the revenue and success of specific apps like Monument Valley.
The document discusses various ways to implement cloud functionality in Android applications using services like Parse and Android Backup. It provides code examples for backing up app data to the cloud using Android Backup, setting up a backend using Parse, pushing notifications with Parse, and performing analytics tracking with Parse.
This document discusses several topics related to developing Android apps including:
1. Adding markers to maps by setting an onMapClickListener and adding a MarkerOptions to the clicked location.
2. Signing into apps with Google accounts using the Google Identity API.
3. Following Material Design guidelines for visual style and user interfaces.
4. Maintaining multiple APK versions and using OpenGL ES for games.
This document discusses various techniques for styling Android applications including adding styles, overriding styles, using themes, custom backgrounds, nine-patch images, and animations. It provides links to tutorials and documentation on animating views with zoom animations and other motion effects.
This document provides information about various Android development topics including:
- ListAdapters and mapping models to UI using an MVVM-like pattern
- Creating custom lists
- Starting a new activity using an Intent and passing data between activities
- Understanding the Android activity lifecycle and methods like onPause() and onResume()
- Handling configuration changes that recreate the activity
- Working with permissions
The document discusses common patterns for working with lists, launching new screens, and handling activity state changes. It also provides code examples for starting a new activity, passing data between activities, and handling the activity lifecycle callbacks.
This document provides an overview of various topics related to mobile application development including cloud computing, interaction design, Android, iOS, web technologies like HTML5 and JavaScript, programming languages like Java and Objective-C, frameworks, gaming, user experience design, and more. It discusses tools for Android development and covers basics of creating an Android app like setting up the IDE, creating the UI, adding interactivity, debugging, and referencing documentation.
Best 20 SEO Techniques To Improve Website Visibility In SERPPixlogix Infotech
Boost your website's visibility with proven SEO techniques! Our latest blog dives into essential strategies to enhance your online presence, increase traffic, and rank higher on search engines. From keyword optimization to quality content creation, learn how to make your site stand out in the crowded digital landscape. Discover actionable tips and expert insights to elevate your SEO game.
Driving Business Innovation: Latest Generative AI Advancements & Success StorySafe Software
Are you ready to revolutionize how you handle data? Join us for a webinar where we’ll bring you up to speed with the latest advancements in Generative AI technology and discover how leveraging FME with tools from giants like Google Gemini, Amazon, and Microsoft OpenAI can supercharge your workflow efficiency.
During the hour, we’ll take you through:
Guest Speaker Segment with Hannah Barrington: Dive into the world of dynamic real estate marketing with Hannah, the Marketing Manager at Workspace Group. Hear firsthand how their team generates engaging descriptions for thousands of office units by integrating diverse data sources—from PDF floorplans to web pages—using FME transformers, like OpenAIVisionConnector and AnthropicVisionConnector. This use case will show you how GenAI can streamline content creation for marketing across the board.
Ollama Use Case: Learn how Scenario Specialist Dmitri Bagh has utilized Ollama within FME to input data, create custom models, and enhance security protocols. This segment will include demos to illustrate the full capabilities of FME in AI-driven processes.
Custom AI Models: Discover how to leverage FME to build personalized AI models using your data. Whether it’s populating a model with local data for added security or integrating public AI tools, find out how FME facilitates a versatile and secure approach to AI.
We’ll wrap up with a live Q&A session where you can engage with our experts on your specific use cases, and learn more about optimizing your data workflows with AI.
This webinar is ideal for professionals seeking to harness the power of AI within their data management systems while ensuring high levels of customization and security. Whether you're a novice or an expert, gain actionable insights and strategies to elevate your data processes. Join us to see how FME and AI can revolutionize how you work with data!
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc
How does your privacy program stack up against your peers? What challenges are privacy teams tackling and prioritizing in 2024?
In the fifth annual Global Privacy Benchmarks Survey, we asked over 1,800 global privacy professionals and business executives to share their perspectives on the current state of privacy inside and outside of their organizations. This year’s report focused on emerging areas of importance for privacy and compliance professionals, including considerations and implications of Artificial Intelligence (AI) technologies, building brand trust, and different approaches for achieving higher privacy competence scores.
See how organizational priorities and strategic approaches to data security and privacy are evolving around the globe.
This webinar will review:
- The top 10 privacy insights from the fifth annual Global Privacy Benchmarks Survey
- The top challenges for privacy leaders, practitioners, and organizations in 2024
- Key themes to consider in developing and maintaining your privacy program
“An Outlook of the Ongoing and Future Relationship between Blockchain Technologies and Process-aware Information Systems.” Invited talk at the joint workshop on Blockchain for Information Systems (BC4IS) and Blockchain for Trusted Data Sharing (B4TDS), co-located with with the 36th International Conference on Advanced Information Systems Engineering (CAiSE), 3 June 2024, Limassol, Cyprus.
Fueling AI with Great Data with Airbyte WebinarZilliz
This talk will focus on how to collect data from a variety of sources, leveraging this data for RAG and other GenAI use cases, and finally charting your course to productionalization.
In the rapidly evolving landscape of technologies, XML continues to play a vital role in structuring, storing, and transporting data across diverse systems. The recent advancements in artificial intelligence (AI) present new methodologies for enhancing XML development workflows, introducing efficiency, automation, and intelligent capabilities. This presentation will outline the scope and perspective of utilizing AI in XML development. The potential benefits and the possible pitfalls will be highlighted, providing a balanced view of the subject.
We will explore the capabilities of AI in understanding XML markup languages and autonomously creating structured XML content. Additionally, we will examine the capacity of AI to enrich plain text with appropriate XML markup. Practical examples and methodological guidelines will be provided to elucidate how AI can be effectively prompted to interpret and generate accurate XML markup.
Further emphasis will be placed on the role of AI in developing XSLT, or schemas such as XSD and Schematron. We will address the techniques and strategies adopted to create prompts for generating code, explaining code, or refactoring the code, and the results achieved.
The discussion will extend to how AI can be used to transform XML content. In particular, the focus will be on the use of AI XPath extension functions in XSLT, Schematron, Schematron Quick Fixes, or for XML content refactoring.
The presentation aims to deliver a comprehensive overview of AI usage in XML development, providing attendees with the necessary knowledge to make informed decisions. Whether you’re at the early stages of adopting AI or considering integrating it in advanced XML development, this presentation will cover all levels of expertise.
By highlighting the potential advantages and challenges of integrating AI with XML development tools and languages, the presentation seeks to inspire thoughtful conversation around the future of XML development. We’ll not only delve into the technical aspects of AI-powered XML development but also discuss practical implications and possible future directions.
Have you ever been confused by the myriad of choices offered by AWS for hosting a website or an API?
Lambda, Elastic Beanstalk, Lightsail, Amplify, S3 (and more!) can each host websites + APIs. But which one should we choose?
Which one is cheapest? Which one is fastest? Which one will scale to meet our needs?
Join me in this session as we dive into each AWS hosting service to determine which one is best for your scenario and explain why!
Monitoring and Managing Anomaly Detection on OpenShift.pdfTosin Akinosho
Monitoring and Managing Anomaly Detection on OpenShift
Overview
Dive into the world of anomaly detection on edge devices with our comprehensive hands-on tutorial. This SlideShare presentation will guide you through the entire process, from data collection and model training to edge deployment and real-time monitoring. Perfect for those looking to implement robust anomaly detection systems on resource-constrained IoT/edge devices.
Key Topics Covered
1. Introduction to Anomaly Detection
- Understand the fundamentals of anomaly detection and its importance in identifying unusual behavior or failures in systems.
2. Understanding Edge (IoT)
- Learn about edge computing and IoT, and how they enable real-time data processing and decision-making at the source.
3. What is ArgoCD?
- Discover ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes, and its role in deploying applications on edge devices.
4. Deployment Using ArgoCD for Edge Devices
- Step-by-step guide on deploying anomaly detection models on edge devices using ArgoCD.
5. Introduction to Apache Kafka and S3
- Explore Apache Kafka for real-time data streaming and Amazon S3 for scalable storage solutions.
6. Viewing Kafka Messages in the Data Lake
- Learn how to view and analyze Kafka messages stored in a data lake for better insights.
7. What is Prometheus?
- Get to know Prometheus, an open-source monitoring and alerting toolkit, and its application in monitoring edge devices.
8. Monitoring Application Metrics with Prometheus
- Detailed instructions on setting up Prometheus to monitor the performance and health of your anomaly detection system.
9. What is Camel K?
- Introduction to Camel K, a lightweight integration framework built on Apache Camel, designed for Kubernetes.
10. Configuring Camel K Integrations for Data Pipelines
- Learn how to configure Camel K for seamless data pipeline integrations in your anomaly detection workflow.
11. What is a Jupyter Notebook?
- Overview of Jupyter Notebooks, an open-source web application for creating and sharing documents with live code, equations, visualizations, and narrative text.
12. Jupyter Notebooks with Code Examples
- Hands-on examples and code snippets in Jupyter Notebooks to help you implement and test anomaly detection models.
UiPath Test Automation using UiPath Test Suite series, part 6DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 6. In this session, we will cover Test Automation with generative AI and Open AI.
UiPath Test Automation with generative AI and Open AI webinar offers an in-depth exploration of leveraging cutting-edge technologies for test automation within the UiPath platform. Attendees will delve into the integration of generative AI, a test automation solution, with Open AI advanced natural language processing capabilities.
Throughout the session, participants will discover how this synergy empowers testers to automate repetitive tasks, enhance testing accuracy, and expedite the software testing life cycle. Topics covered include the seamless integration process, practical use cases, and the benefits of harnessing AI-driven automation for UiPath testing initiatives. By attending this webinar, testers, and automation professionals can gain valuable insights into harnessing the power of AI to optimize their test automation workflows within the UiPath ecosystem, ultimately driving efficiency and quality in software development processes.
What will you get from this session?
1. Insights into integrating generative AI.
2. Understanding how this integration enhances test automation within the UiPath platform
3. Practical demonstrations
4. Exploration of real-world use cases illustrating the benefits of AI-driven test automation for UiPath
Topics covered:
What is generative AI
Test Automation with generative AI and Open AI.
UiPath integration with generative AI
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/building-and-scaling-ai-applications-with-the-nx-ai-manager-a-presentation-from-network-optix/
Robin van Emden, Senior Director of Data Science at Network Optix, presents the “Building and Scaling AI Applications with the Nx AI Manager,” tutorial at the May 2024 Embedded Vision Summit.
In this presentation, van Emden covers the basics of scaling edge AI solutions using the Nx tool kit. He emphasizes the process of developing AI models and deploying them globally. He also showcases the conversion of AI models and the creation of effective edge AI pipelines, with a focus on pre-processing, model conversion, selecting the appropriate inference engine for the target hardware and post-processing.
van Emden shows how Nx can simplify the developer’s life and facilitate a rapid transition from concept to production-ready applications.He provides valuable insights into developing scalable and efficient edge AI solutions, with a strong focus on practical implementation.
Climate Impact of Software Testing at Nordic Testing DaysKari Kakkonen
My slides at Nordic Testing Days 6.6.2024
Climate impact / sustainability of software testing discussed on the talk. ICT and testing must carry their part of global responsibility to help with the climat warming. We can minimize the carbon footprint but we can also have a carbon handprint, a positive impact on the climate. Quality characteristics can be added with sustainability, and then measured continuously. Test environments can be used less, and in smaller scale and on demand. Test techniques can be used in optimizing or minimizing number of tests. Test automation can be used to speed up testing.
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfTechgropse Pvt.Ltd.
In this blog post, we'll delve into the intersection of AI and app development in Saudi Arabia, focusing on the food delivery sector. We'll explore how AI is revolutionizing the way Saudi consumers order food, how restaurants manage their operations, and how delivery partners navigate the bustling streets of cities like Riyadh, Jeddah, and Dammam. Through real-world case studies, we'll showcase how leading Saudi food delivery apps are leveraging AI to redefine convenience, personalization, and efficiency.
OpenID AuthZEN Interop Read Out - AuthorizationDavid Brossard
During Identiverse 2024 and EIC 2024, members of the OpenID AuthZEN WG got together and demoed their authorization endpoints conforming to the AuthZEN API
3. How to work with OOP in .NET
• Structure of Form class
• Adding variables
– Public
– Private
• Adding member functions
– Procedural
• Adding classes by “ref”
• Passing parameters
– %,^
26. DateTime
• Considering today is 22/10/2010, the output will be
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^
{
// Calculate what day of the week is 36 days from this instant
DateTime ^today= DateTime::Now;
TimeSpan duration(36, 0, 0, 0);
DateTime ^answer= today->Add(duration);
textBox1->Text= answer->ToString();
}
11/27/2010 1:49:12 AM
e)
33. Properties
• A compromise between a function and a variable!
• See, the following, how awesome!
private:
int MyInt;
public:
// property block
property int intProperty
{
int get()
{
return MyInt;
}
void set(int value)
{
MyInt= value;
}
}
34. Properties
The property keyword
introduces the
declaration of a
property and can
appear in a class,
interface, or value
type. A property can
have a getter function
(read only), a setter
function (write only),
or both (read-write).
public:
int MyInt;
// property block
property int intProperty
{
int get()
{
return MyInt;
}
void set(int value)
{
MyInt= value;
}
}
35. Properties
• So, how to use it? Like the following …
property int intProperty
{
int get()
{
return MyInt;
}
void set(int value)
{
MyInt= value;
}
}
private: System::Void button1_Click(System::Object^ sender,
System::EventArgs^ e)
{
textBox1->Text= intProperty.ToString();
}
37. Properties
• So, how to use it? Like the following …
property int intProperty
{
int get()
{
return MyInt;
}
void set(int value)
{
MyInt= value;
}
}
private: System::Void button1_Click(System::Object^ sender,
System::EventArgs^ e)
{
intProperty= 5;
textBox1->Text= intProperty.ToString();
}
46. stringint Conversion
• NewLine:
– Environment::NewLine;
• Converting from string to int:
– Int32::Parse(textBox1->Text);
– Int32::TryParse(textBox1->Text);
47. stringint Conversion
• Converting from int to string:
– Exp #1:
• int x;
• textBox1->Text= x.ToString();
– Exp #2:
• int ^;
x
• textBox1->Text= x->ToString();
– Exp #3:
• int ^;
x
• String ^S= x->ToString();
48. stringint Conversion
private: System::Void button1_Click_1(System::Object^
System::EventArgs^ e)
{
int i= 3;
i= int::Parse(textBox1->Text);
}
What happens if we have “435345” in textBox1?
What happens if we have “wewe” in textBox1?
What happens if we have “213s” in textBox1?
What happens if we have “” in textBox1?
sender,
49. stringint Conversion
private: System::Void button1_Click_1(System::Object^
System::EventArgs^ e)
{
int i= 3;
i= int::TryParse(textBox1->Text, i ;
}
What happens if we have “435345” in textBox1?
What happens if we have “wewe” in textBox1?
What happens if we have “213s” in textBox1?
What happens if we have “” in textBox1?
sender,
60. Use the console to trackdebug values!
Do not use messagebox for tracking!
61. Change between Console and
Windows Form
• In the project properties for all configurations (Project |
Properties, choose Configuration 'All Configurations', locate
Config Properties -> Linker -> System), change the SubSystem
from Console to Windows.
71. Peak on Exception Handling
• Test it live!
private: System::Void panel1_MouseClick(System::Object^ sender,
System::Windows::Forms::MouseEventArgs^ e)
{
try
{
if (textBox1->text == “Hi”)
{
MessageBox::Show(“It’s time for Exceptions! ");
}
}
catch (System::FormatException ^e)
{
MessageBox::Show("You Should Enter a String in textBox first ");
}
}
84. Strings in Action
• Comparing Strings (int):
– Compare :
• returns an integer that indicates the relationship of one string to a
second string in the sort order.
87. Strings in Action
private: System::Void button1_Click(System::Object^
sender, System::EventArgs^ e)
{
String ^str1 = "I Wanna go!";
String ^str2 = "I decided not to go!";
int i = String::Compare(str1,str2);
textBox1->Text = i.ToString();
}
88. Strings in Action
• Testing Strings for Equality (bool):
– You call the Equals method to determine whether two strings are
equal.
89.
90.
91. Strings in Action
private: System::Void button1_Click(System::Object^
System::EventArgs^ e)
{
String ^str1 = "I Wanna go!";
String ^str2 = "I decided not to go!";
bool b= String::Equals(str1,str2);
textBox1->Text = b.ToString();
}
sender,
92. Strings in Action
private: System::Void button1_Click(System::Object^
System::EventArgs^ e)
{
String ^str1 = "I Wanna go!";
String ^str2 = "I Wanna go!";
bool b = String::Equals(str1,str2);
textBox1->Text = b.ToString();
}
true
sender,
93. Strings in Action
private: System::Void button1_Click(System::Object^
System::EventArgs^ e)
{
String ^str1 = "I Wanna go!";
String ^str2 = "I Wanna go! ";
bool b = String::Equals(str1,str2);
textBox1->Text = b.ToString();
}
false
sender,
94. Strings in Action
• Finding Characters in a String :
– The String class includes two kinds of search methods:
• Methods that return a “ bool” value to indicate whether a particular
substring is present in a string instance. These include
the Contains, EndsWith, and StartsWith methods.
• Methods that indicate the starting position of a substring in a string
instance “int”. These include the IndexOf,IndexOfAny, LastIndexOf,
and LastIndexOfAny methods.
95. Strings in Action
• String::Contains Method (bool)
– Returns a value indicating whether the specified String object occurs
within this string.
96. Strings in Action
{
String^ s1 = "The brown fox jumps over the lazy dog";
String^ s2 = "fox";
bool b;
b = s1->Contains( s2 );
Console::WriteLine( "Is the string, s2, in the string, s1?: {0}", b );
}
Is string , s2, in string, s1? True
97. Strings in Action
• String::IndexOf Method (int)
– Reports the index of the first occurrence of one or more characters,
or the first occurrence of a string, within this string.
– This member is overloaded. For complete information about this
member, including syntax, usage, and examples, click a name in the
overload list.
98. Name
IndexOf(Char)
IndexOf(String)
IndexOf(Char, Int32)
Description
Reports the index of the first occurrence of the specified Unicode character in this
string.
Reports the index of the first occurrence of the specified string in this instance.
Reports the index of the first occurrence of the specified Unicode character in this
string. The search starts at a specified character position.
IndexOf(String, Int32) Reports the index of the first occurrence of the specified string in this instance.
The search starts at a specified character position.
IndexOf(String,
Reports the index of the first occurrence of the specified string in the
StringComparison)
current Stringobject. A parameter specifies the type of search to use for the
specified string.
IndexOf(Char, Int32,
Reports the index of the first occurrence of the specified character in this
Int32)
instance. The search starts at a specified character position and examines a
specified number of character positions.
IndexOf(String, Int32, Reports the index of the first occurrence of the specified string in this instance.
Int32)
The search starts at a specified character position and examines a specified number
of character positions.
IndexOf(String, Int32, Reports the index of the first occurrence of the specified string in the
StringComparison)
current Stringobject. Parameters specify the starting search position in the current
string and the type of search to use for the specified string.
IndexOf(String, Int32, Reports the index of the first occurrence of the specified string in the
Int32, StringComparison) current Stringobject. Parameters specify the starting search position in the current
string, the number of characters in the current string to search, and the type of
search to use for the specified string.
99. int main(array<System::String ^> ^args)
{
Console::WriteLine(L"Hello World");
// Create a Unicode String with 5 Greek Alpha characters
String^ szGreekAlpha = gcnew String( L'x0319',5 );
// Create a Unicode String with a Greek Omega character
wchar_t charArray5[3] = {L'x03A9',L'x03A9',L'x03A9'};
String^ szGreekOmega = gcnew String( charArray5,2,1 );
String^ szGreekLetters = String::Concat( szGreekOmega, szGreekAlpha, szGreekOmega>Clone() );
// Examine the result
Console::WriteLine( szGreekLetters );
// The first index of Alpha
int ialpha = szGreekLetters->IndexOf( L'x0319' );
// The last index of Omega
int iomega = szGreekLetters->LastIndexOf( L'x03A9' );
Console::WriteLine( String::Concat( "The Greek letter Alpha first appears at
index ", Convert::ToString( ialpha ) ) );
Console::WriteLine( String::Concat( " and Omega last appears at index ",
Convert::ToString( iomega ), " in this String." ) );
return 0;
}
100. Strings in Action
Hello World
Ω?????Ω
The Greek letter Alpha first appears at index 1
and Omega last appears at index 6 in this String.
Press any key to continue . . .
101. Strings in Action–Trim() method
• String::Trim Method
– Removes all leading and trailing white-space characters from the
current String object.
102. int main()
{
String^ animal1 = "fox";
String^ animal2 = "dog";
String^ strTarget = String::Format( "The {0} jumped over the {1}.", animal1, animal2 );
Console::WriteLine
( "The original string is:{0}{1}{0}", Environment::NewLine, strTarget );
Console::Write
( "Enter an adjective (or group of adjectives) to describe the {0}: ==> ", animal1 );
String^ adj1 = Console::ReadLine();
Console::Write
( "Enter an adjective (or group of adjectives) to describe the {0}: ==> ", animal2 );
String^ adj2 = Console::ReadLine();
adj1 = String::Concat( adj1->Trim(), " " );
adj2 = String::Concat( adj2->Trim(), " " );
strTarget = strTarget->Insert( strTarget->IndexOf( animal1 ), adj1 );
strTarget = strTarget->Insert( strTarget->IndexOf( animal2 ), adj2 );
Console::WriteLine
( " {0}The final string is: {0} {1}", Environment::NewLine, strTarget );
}
103. Strings in Action
The original string is:
The fox jumped over the dog.
Enter an adjective (or group of adjectives) to describe the fox: ==>
bold
Enter an adjective (or group of adjectives) to describe the dog: ==>
lazy
The final string is:
The bold fox jumped over the lazy dog.
104. Strings in Action
private: System::Void button1_Click(System::Object^
System::EventArgs^ e)
{
String ^str1 = "I Wanna go!";
String ^str2 = "I DeciDEd not to go!";
str2 = str2->ToLower();
textBox1->Text = str2;
}
sender,
105. Strings in Action
private: System::Void button1_Click(System::Object^
System::EventArgs^ e)
{
String ^str1 = "I Wanna go!";
String ^str2 = "I decided not to go!
";
str2 = (str2->ToLower())->Trim() ;
textBox1->Text = str2+str1;
}
sender,
106. Strings in Action
private: System::Void button1_Click(System::Object^
System::EventArgs^ e)
{
String ^str1 = "I Wanna go!";
String ^str2 = “
I DeCided not to go! ";
str2 = (str2->ToLower())->Trim() ;
textBox1->Text = str2;
}
sender,
107. Strings in Action
• String::Copy Method (String to String)
– Creates a new instance of String with the same value as a specified String.
// Sample for String::Copy()
using namespace System;
int main()
{
String^ str1 = "abc";
String^ str2 = "xyz";
Console::WriteLine( "1) str1 = '{0}'",
Console::WriteLine( "2) str2 = '{0}'",
Console::WriteLine( "Copy..." );
str2 = String::Copy( str1 );
Console::WriteLine( "3) str1 = '{0}'",
Console::WriteLine( "4) str2 = '{0}'",
}
1) str1
2) str2
Copy...
3) str1
4) str2
= 'abc'
= 'xyz'
= 'abc'
= 'abc'
str1 );
str2 );
str1 );
str2 );
108. Strings in Action
• String::CopyTo Method (String)
– Copies a specified number of characters from a specified position in
this instance to a specified position in an array of Unicode characters.
109. Strings in Action
• Parameters
– sourceIndexType: System::Int32
The index of the first character in this instance to copy.
– destinationType: array<System::Char>
An array of Unicode characters to which characters in this instance
are copied.
– destinationIndexType: System::Int32
The index in destination at which the copy operation begins.
– countType: System::Int32
The number of characters in this instance to copy to destination.
110. using namespace System;
int main()
{
// Embed an array of characters in a string
String^ strSource = "changed";
array <Char> ^destination = {'T','h','e',' ','i','n','i','t','i','a','l','
','a','r','r','a','y'};
// Print the char array
Console::WriteLine( destination );
// Embed the source string in the destination string
strSource->CopyTo( 0, destination, 4, strSource->Length );
// Print the resulting array
Console::WriteLine( destination );
strSource = "A different string";
// Embed only a section of the source string in the destination
strSource->CopyTo( 2, destination, 3, 9 );
// Print the resulting array
Console::WriteLine( destination );
}
111.
112. Strings in Action
The initial array
The changed array
Thedifferentarray
Press any key to continue . . .
113. Strings in Action
• String::Replace Method (String , String)
– Returns a new string in which all occurrences of a specified string in
the current instance are replaced with another specified string.
114. Strings in Action
using namespace System;
int main()
{
String^ errString = "This docment uses 3 other docments to docment the
docmentation";
Console::WriteLine( "The original string is:n'{0}'n", errString );
// Correct the spelling of S"document".
String^ correctString = errString->Replace( "docment", "document" );
Console::WriteLine( "After correcting the string, the result is:n'{0}'",
correctString );
}
This code example produces the following output:
The original string is:
'This docment uses 3 other docments to docment the docmentation'
After correcting the string, the result is:
'This document uses 3 other documents to document the documentation'