This is an intermediate conversion course for C++, suitable for second year computing students who may have learned Java or another language in first year.
The document provides an introduction to the C++ Standard Template Library (STL). It discusses templates and generic programming in C++. It then describes the main components of STL - containers, algorithms, and iterators. It explains common sequence containers like vector, list, deque; associative containers like set and map; and container adaptors like stack and queue. It discusses how to define and use these containers to store and manipulate data. It also covers concepts like iterators to access container elements and algorithms that operate on containers.
An Introduction to Part of C++ STL for OI. Introduced the common use of STL algorithms and containers, especially those are helpful to OI.
Also with some examples.
STL stands for Standard Template Library. It provides common programming data structures and algorithms. The key components of STL are containers like vector and list that store data, iterators that access elements in containers, and algorithms that perform operations on data structures. STL aims to provide generic functions that work on different data types through templates. Common STL algorithms include searching, sorting, copying, and erasing elements from containers.
The document discusses the C++ Standard Library and Standard Template Library (STL). It explains that the Standard Library contains classes and functions organized into a Standard Function Library and Object-Oriented Class Library. It also describes templates as a way to write generic functions and classes that can work on different data types. The STL is further described as a set of template classes that provide common data structures like lists, stacks, and arrays. Key components of the STL include containers for storing data, iterators for accessing elements in containers, and algorithms for manipulating data. Common containers, iterators, and algorithms are defined along with examples.
The document provides an introduction to the Standard Template Library (STL) in C++. It describes the main components of STL including containers, iterators, algorithms and function objects. It explains that containers store data, iterators access data, algorithms manipulate data, and function objects can be used by algorithms. Specific containers like vector, deque, list, set and map are outlined along with their characteristics and sample functions. Iterators and their categories are also summarized. Common algorithms like for_each, find, sort and merge are demonstrated through examples. Finally, it shows how function objects can be used by algorithms to customize operations.
The document discusses new features in .NET 3.5 including automatic properties, extension methods, object initialization, anonymous types, partial methods, type inference, LINQ, lambda expressions, and query expressions. It explains that these language enhancements combined with query expressions enable LINQ by providing a unified way to query and manipulate data from various sources.
This document discusses different C++ STL containers and their usage. It describes the key properties and use cases of common sequential containers like vector, deque, and list, as well as associative containers like set and map. It also covers container adaptors like stack and queue. The document provides guidance on choosing the right container based on needs like random access, insertion/deletion frequency, and data structure type (e.g. LIFO for stack). It highlights when certain containers may not be suitable or have disadvantages.
This is an intermediate conversion course for C++, suitable for second year computing students who may have learned Java or another language in first year.
The document provides an introduction to the C++ Standard Template Library (STL). It discusses templates and generic programming in C++. It then describes the main components of STL - containers, algorithms, and iterators. It explains common sequence containers like vector, list, deque; associative containers like set and map; and container adaptors like stack and queue. It discusses how to define and use these containers to store and manipulate data. It also covers concepts like iterators to access container elements and algorithms that operate on containers.
An Introduction to Part of C++ STL for OI. Introduced the common use of STL algorithms and containers, especially those are helpful to OI.
Also with some examples.
STL stands for Standard Template Library. It provides common programming data structures and algorithms. The key components of STL are containers like vector and list that store data, iterators that access elements in containers, and algorithms that perform operations on data structures. STL aims to provide generic functions that work on different data types through templates. Common STL algorithms include searching, sorting, copying, and erasing elements from containers.
The document discusses the C++ Standard Library and Standard Template Library (STL). It explains that the Standard Library contains classes and functions organized into a Standard Function Library and Object-Oriented Class Library. It also describes templates as a way to write generic functions and classes that can work on different data types. The STL is further described as a set of template classes that provide common data structures like lists, stacks, and arrays. Key components of the STL include containers for storing data, iterators for accessing elements in containers, and algorithms for manipulating data. Common containers, iterators, and algorithms are defined along with examples.
The document provides an introduction to the Standard Template Library (STL) in C++. It describes the main components of STL including containers, iterators, algorithms and function objects. It explains that containers store data, iterators access data, algorithms manipulate data, and function objects can be used by algorithms. Specific containers like vector, deque, list, set and map are outlined along with their characteristics and sample functions. Iterators and their categories are also summarized. Common algorithms like for_each, find, sort and merge are demonstrated through examples. Finally, it shows how function objects can be used by algorithms to customize operations.
The document discusses new features in .NET 3.5 including automatic properties, extension methods, object initialization, anonymous types, partial methods, type inference, LINQ, lambda expressions, and query expressions. It explains that these language enhancements combined with query expressions enable LINQ by providing a unified way to query and manipulate data from various sources.
This document discusses different C++ STL containers and their usage. It describes the key properties and use cases of common sequential containers like vector, deque, and list, as well as associative containers like set and map. It also covers container adaptors like stack and queue. The document provides guidance on choosing the right container based on needs like random access, insertion/deletion frequency, and data structure type (e.g. LIFO for stack). It highlights when certain containers may not be suitable or have disadvantages.
The document discusses the Standard Template Library (STL) which provides common classes and functions for C++ programs. It has three main components: (1) containers which store and organize data, (2) algorithms which perform operations on data in containers, and (3) iterators which are used by algorithms to access elements in containers. Some common STL containers include vectors for sequential data, sets and maps for associative data, and queues and stacks as container adaptors.
The document discusses the key components of the Standard Template Library (STL) in C++, including containers, iterators, and algorithms. It explains that STL containers manage collections of objects, iterators allow traversing container elements, and algorithms perform operations on elements using iterators. The main STL containers like vector, list, deque, set, and map are introduced along with their basic functionality. Iterators provide a common interface for traversing container elements. Algorithms operate on elements through iterators but are independent of container implementations.
The document discusses the C++ Standard Template Library (STL). It provides three main components - containers, algorithms, and iterators. Containers like vectors, lists, and maps store and organize data. Algorithms like sort, search act on the containers. Iterators are generalized pointers that interface between containers and algorithms. The STL achieves efficiency through templates and provides commonly used data structures and algorithms out of the box.
The document discusses the C++ Standard Template Library (STL). It provides an overview of STL containers, algorithms, iterators and how to access STL components. The main STL containers include vectors, lists, stacks, queues, priority queues, sets, multisets, maps and multimaps. Common operations on containers like insertion, deletion and traversal are also covered along with examples of how to declare and use iterators to access container elements.
Python is a high-level, open source programming language with a large community and standard library. It can be used for rapid prototyping and has interfaces for GIS tools like ArcGIS. Key Python concepts include objects like strings, lists, tuples, and dictionaries that have built-in methods, as well as conditionals, loops, modules, and error handling.
The document discusses the key components of the Standard Template Library (STL) in C++, including containers, iterators, and algorithms. Containers store and organize data elements. Iterators provide a generalized pointer interface for traversing container elements. Algorithms operate on container elements using iterators to perform tasks like searching, sorting, and other manipulations without knowing details of the underlying container implementation.
Robin Milner made three major contributions to computer science: developing LCF for automated theorem proving, creating ML which was the first language with polymorphic type inference and type-safe exception handling, and developing frameworks for analyzing concurrent systems like CCS and the pi-calculus. The lecture discusses polymorphism, with control abstraction through higher-order functions and polymorphic type systems covered. Polymorphism allows values of different types to be handled through a uniform interface.
This document provides an overview of Java data structures including arrays, collections framework, and common collection interfaces like List, Set, and Map. It discusses how to use arrays to store and access data, the key methods of common collection interfaces, and hands-on exercises to work with arrays and collections in Java.
Processing data with Python, using standard library modules you (probably) ne...gjcross
Tutorial #2 from PyCon AU 2012
You have data.
You have Python.
You also have a lot of choices about the best way to work with that data...
Ever wondered when you would use a tuple, list, dictionary, set, ordered dictionary, bucket, queue, counter or named tuple? Phew!
Do you know when to use a loop, iterator or generator to work through a data container?
Why are there so many different "containers" to hold data?
What are the best ways to work with these data containers?
This tutorial will give you all the basics to effectively working with data containers and iterators in Python. Along the way we will cover some very useful modules from the standard library that you may not have used before and will end up wondering how you ever did without them.
This tutorial is aimed at Python beginners. Bring along your laptop so you can interactively work through some of the examples in the tutorial. If you can, install ipython (http://ipython.org/) as we will use it for the demonstrations.
Type Casting C# - Lec4 (Workshop on C# Programming: Learn to Build)Jannat Ruma
This is provided as a course material in the Workshop named "Workshop on C# Programming: Learn to Build" organized by East West University Computer Programming Club (EWUCoPC) & supported by Young Engineers Society (YES).
C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)Jannat Ruma
This is provided as a course material in the Workshop named "Workshop on C# Programming: Learn to Build" organized by East West University Computer Programming Club (EWUCoPC) & supported by Young Engineers Society (YES).
Data Type C# - Lec2 (Workshop on C# Programming: Learn to Build)Jannat Ruma
This is provided as a course material in the Workshop named "Workshop on C# Programming: Learn to Build" organized by East West University Computer Programming Club (EWUCoPC) & supported by Young Engineers Society (YES).
The document summarizes the key components of the Standard Template Library (STL) including containers, iterators, and algorithms. It describes common STL containers like vector, list, set, map and their uses. Iterators are used to point to container elements and algorithms perform operations on container elements. Examples are provided to demonstrate how to use STL containers like vector, set and map as well as common algorithms like sort.
This document discusses generics and collections in .NET. It introduces generics as a way to write reusable code for different data types. Generic methods and classes are covered, allowing a single definition to work with multiple types. The document also discusses collection classes like ArrayList, HashTable, Stack and Queue, which provide common data structures. It notes the benefits of generic collections over non-generic ones in terms of type safety and efficiency.
Generics are one of the most complex features of Java. They are often poorly understood and lead to confusing errors. Unfortunately, it won’t get easier. Java 10, release planned for 2018, extends Generics. It’s now time to understand generics or risk being left behind.
We start by stepping back into the halcyon days of 2004 and explain why generics were introduced in the first place back. We also explain why Java’s implementation is unique compared to similar features in other programming languages.
Then we travel to the present to explaining how to make effective use of Generics. We then explore various entertaining code examples and puzzlers of how Generics are used today.
Finally, this talk sheds light on the planned changes in Java 10 with practical code examples and related ideas from other programming languages. If you ever wanted to understand the buzz around declaration site variance now is your chance!
This document discusses generics in .NET. It introduces generics, generic classes, interfaces, structs and methods. Generics allow defining type-safe and reusable collection classes without compromising type safety or performance. Generic classes encapsulate operations that are not specific to a data type, commonly used for collections. Generic interfaces avoid boxing/unboxing for value types. Methods can also be generic with the ability to apply constraints.
Generics are one of the most complex features of Java. They are often poorly understood and lead to confusing errors. Unfortunately, it won’t get easier. Java 10, release planned for 2018, extends Generics. It’s now time to understand generics or risk being left behind.
We start by stepping back into the halcyon days of 2004 and explain why generics were introduced in the first place back. We also explain why Java’s implementation is unique compared to similar features in other programming languages.
Then we travel to the present to explaining how to make effective use of Generics. We then explore various entertaining code examples and puzzlers of how Generics are used today.
Finally, this talk sheds light on the planned changes in Java 10 with practical code examples and related ideas from other programming languages. If you ever wanted to understand the buzz around higher kinded types or declaration site variance now is your chance!
R is a programming language and environment for statistical analysis and graphics. It has many built-in statistical and graphical techniques. R can be installed from CRAN and runs on Windows, MacOS, and UNIX systems. The basic R interface is the console, but RStudio provides an integrated development environment. In RStudio, you can write scripts, see outputs and plots, and access help and packages. Packages extend R's functionality through additional functions and data. Common data types in R include numeric, integer, character, factor, and logical. Vectors are the basic data structure, but R also supports matrices, arrays, data frames and lists.
Regular expressions are a powerful tool for searching, parsing, and modifying text patterns. They allow complex patterns to be matched with simple syntax. Some key uses of regular expressions include validating formats, extracting data from strings, and finding and replacing substrings. Regular expressions use special characters to match literal, quantified, grouped, and alternative character patterns across the start, end, or anywhere within a string.
The .NET Framework is a development tool that supports building applications and XML web services. It supports 61 programming languages, including 9 designed by Microsoft. Code in .NET is compiled twice - first to MSIL then to native code using the CLR. The Framework Class Library is a huge reusable library of types for managed code, providing access to system functions. Namespaces organize types and provide context. Common namespaces include System, System.Data, and System.Collections. Keywords have special meanings and identifiers name variables, methods, etc. Arrays come in various types like normal, huge, static, dynamic, and jagged. The Array class provides methods like sort, clear, and copy.
This document provides an agenda and overview for a Python tutorial presented over multiple sessions. The first session introduces Python and demonstrates how to use the Python interpreter. The second session covers basic Python data structures like lists, modules, input/output, and exceptions. An optional third session discusses unit testing. The document explains that Python is an easy to learn yet powerful programming language that supports object-oriented programming and high-level data structures in an interpreted, dynamic environment.
This document provides guidance on database sizing including:
1. Reasons to size a database initially and continually such as selecting hardware, storage requirements, and understanding data characteristics.
2. Common data types and their storage sizes in bytes.
3. How to calculate average row size and the number of rows that fit in a database block.
4. How to calculate the number of blocks needed to store a table based on its number of rows and the rows per block.
5. Differences in sizing indexes compared to tables.
6. The process of sizing all major database objects and adding them to determine total disk space needs.
The document discusses the Standard Template Library (STL) which provides common classes and functions for C++ programs. It has three main components: (1) containers which store and organize data, (2) algorithms which perform operations on data in containers, and (3) iterators which are used by algorithms to access elements in containers. Some common STL containers include vectors for sequential data, sets and maps for associative data, and queues and stacks as container adaptors.
The document discusses the key components of the Standard Template Library (STL) in C++, including containers, iterators, and algorithms. It explains that STL containers manage collections of objects, iterators allow traversing container elements, and algorithms perform operations on elements using iterators. The main STL containers like vector, list, deque, set, and map are introduced along with their basic functionality. Iterators provide a common interface for traversing container elements. Algorithms operate on elements through iterators but are independent of container implementations.
The document discusses the C++ Standard Template Library (STL). It provides three main components - containers, algorithms, and iterators. Containers like vectors, lists, and maps store and organize data. Algorithms like sort, search act on the containers. Iterators are generalized pointers that interface between containers and algorithms. The STL achieves efficiency through templates and provides commonly used data structures and algorithms out of the box.
The document discusses the C++ Standard Template Library (STL). It provides an overview of STL containers, algorithms, iterators and how to access STL components. The main STL containers include vectors, lists, stacks, queues, priority queues, sets, multisets, maps and multimaps. Common operations on containers like insertion, deletion and traversal are also covered along with examples of how to declare and use iterators to access container elements.
Python is a high-level, open source programming language with a large community and standard library. It can be used for rapid prototyping and has interfaces for GIS tools like ArcGIS. Key Python concepts include objects like strings, lists, tuples, and dictionaries that have built-in methods, as well as conditionals, loops, modules, and error handling.
The document discusses the key components of the Standard Template Library (STL) in C++, including containers, iterators, and algorithms. Containers store and organize data elements. Iterators provide a generalized pointer interface for traversing container elements. Algorithms operate on container elements using iterators to perform tasks like searching, sorting, and other manipulations without knowing details of the underlying container implementation.
Robin Milner made three major contributions to computer science: developing LCF for automated theorem proving, creating ML which was the first language with polymorphic type inference and type-safe exception handling, and developing frameworks for analyzing concurrent systems like CCS and the pi-calculus. The lecture discusses polymorphism, with control abstraction through higher-order functions and polymorphic type systems covered. Polymorphism allows values of different types to be handled through a uniform interface.
This document provides an overview of Java data structures including arrays, collections framework, and common collection interfaces like List, Set, and Map. It discusses how to use arrays to store and access data, the key methods of common collection interfaces, and hands-on exercises to work with arrays and collections in Java.
Processing data with Python, using standard library modules you (probably) ne...gjcross
Tutorial #2 from PyCon AU 2012
You have data.
You have Python.
You also have a lot of choices about the best way to work with that data...
Ever wondered when you would use a tuple, list, dictionary, set, ordered dictionary, bucket, queue, counter or named tuple? Phew!
Do you know when to use a loop, iterator or generator to work through a data container?
Why are there so many different "containers" to hold data?
What are the best ways to work with these data containers?
This tutorial will give you all the basics to effectively working with data containers and iterators in Python. Along the way we will cover some very useful modules from the standard library that you may not have used before and will end up wondering how you ever did without them.
This tutorial is aimed at Python beginners. Bring along your laptop so you can interactively work through some of the examples in the tutorial. If you can, install ipython (http://ipython.org/) as we will use it for the demonstrations.
Type Casting C# - Lec4 (Workshop on C# Programming: Learn to Build)Jannat Ruma
This is provided as a course material in the Workshop named "Workshop on C# Programming: Learn to Build" organized by East West University Computer Programming Club (EWUCoPC) & supported by Young Engineers Society (YES).
C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)Jannat Ruma
This is provided as a course material in the Workshop named "Workshop on C# Programming: Learn to Build" organized by East West University Computer Programming Club (EWUCoPC) & supported by Young Engineers Society (YES).
Data Type C# - Lec2 (Workshop on C# Programming: Learn to Build)Jannat Ruma
This is provided as a course material in the Workshop named "Workshop on C# Programming: Learn to Build" organized by East West University Computer Programming Club (EWUCoPC) & supported by Young Engineers Society (YES).
The document summarizes the key components of the Standard Template Library (STL) including containers, iterators, and algorithms. It describes common STL containers like vector, list, set, map and their uses. Iterators are used to point to container elements and algorithms perform operations on container elements. Examples are provided to demonstrate how to use STL containers like vector, set and map as well as common algorithms like sort.
This document discusses generics and collections in .NET. It introduces generics as a way to write reusable code for different data types. Generic methods and classes are covered, allowing a single definition to work with multiple types. The document also discusses collection classes like ArrayList, HashTable, Stack and Queue, which provide common data structures. It notes the benefits of generic collections over non-generic ones in terms of type safety and efficiency.
Generics are one of the most complex features of Java. They are often poorly understood and lead to confusing errors. Unfortunately, it won’t get easier. Java 10, release planned for 2018, extends Generics. It’s now time to understand generics or risk being left behind.
We start by stepping back into the halcyon days of 2004 and explain why generics were introduced in the first place back. We also explain why Java’s implementation is unique compared to similar features in other programming languages.
Then we travel to the present to explaining how to make effective use of Generics. We then explore various entertaining code examples and puzzlers of how Generics are used today.
Finally, this talk sheds light on the planned changes in Java 10 with practical code examples and related ideas from other programming languages. If you ever wanted to understand the buzz around declaration site variance now is your chance!
This document discusses generics in .NET. It introduces generics, generic classes, interfaces, structs and methods. Generics allow defining type-safe and reusable collection classes without compromising type safety or performance. Generic classes encapsulate operations that are not specific to a data type, commonly used for collections. Generic interfaces avoid boxing/unboxing for value types. Methods can also be generic with the ability to apply constraints.
Generics are one of the most complex features of Java. They are often poorly understood and lead to confusing errors. Unfortunately, it won’t get easier. Java 10, release planned for 2018, extends Generics. It’s now time to understand generics or risk being left behind.
We start by stepping back into the halcyon days of 2004 and explain why generics were introduced in the first place back. We also explain why Java’s implementation is unique compared to similar features in other programming languages.
Then we travel to the present to explaining how to make effective use of Generics. We then explore various entertaining code examples and puzzlers of how Generics are used today.
Finally, this talk sheds light on the planned changes in Java 10 with practical code examples and related ideas from other programming languages. If you ever wanted to understand the buzz around higher kinded types or declaration site variance now is your chance!
R is a programming language and environment for statistical analysis and graphics. It has many built-in statistical and graphical techniques. R can be installed from CRAN and runs on Windows, MacOS, and UNIX systems. The basic R interface is the console, but RStudio provides an integrated development environment. In RStudio, you can write scripts, see outputs and plots, and access help and packages. Packages extend R's functionality through additional functions and data. Common data types in R include numeric, integer, character, factor, and logical. Vectors are the basic data structure, but R also supports matrices, arrays, data frames and lists.
Regular expressions are a powerful tool for searching, parsing, and modifying text patterns. They allow complex patterns to be matched with simple syntax. Some key uses of regular expressions include validating formats, extracting data from strings, and finding and replacing substrings. Regular expressions use special characters to match literal, quantified, grouped, and alternative character patterns across the start, end, or anywhere within a string.
The .NET Framework is a development tool that supports building applications and XML web services. It supports 61 programming languages, including 9 designed by Microsoft. Code in .NET is compiled twice - first to MSIL then to native code using the CLR. The Framework Class Library is a huge reusable library of types for managed code, providing access to system functions. Namespaces organize types and provide context. Common namespaces include System, System.Data, and System.Collections. Keywords have special meanings and identifiers name variables, methods, etc. Arrays come in various types like normal, huge, static, dynamic, and jagged. The Array class provides methods like sort, clear, and copy.
This document provides an agenda and overview for a Python tutorial presented over multiple sessions. The first session introduces Python and demonstrates how to use the Python interpreter. The second session covers basic Python data structures like lists, modules, input/output, and exceptions. An optional third session discusses unit testing. The document explains that Python is an easy to learn yet powerful programming language that supports object-oriented programming and high-level data structures in an interpreted, dynamic environment.
This document provides guidance on database sizing including:
1. Reasons to size a database initially and continually such as selecting hardware, storage requirements, and understanding data characteristics.
2. Common data types and their storage sizes in bytes.
3. How to calculate average row size and the number of rows that fit in a database block.
4. How to calculate the number of blocks needed to store a table based on its number of rows and the rows per block.
5. Differences in sizing indexes compared to tables.
6. The process of sizing all major database objects and adding them to determine total disk space needs.
The document discusses several advanced C++ programming concepts including abstract classes, exception handling, standard libraries, templates, and containers. It defines abstract classes as classes that contain pure virtual functions and cannot be instantiated. Exception handling allows programs to continue running or terminate gracefully after errors using try, catch, and throw blocks. The standard library provides common functions and classes for input/output, strings, and containers. Templates allow writing generic and reusable code for different data types, including class templates and function templates. The Standard Template Library includes common containers like vectors, lists, and maps that store and organize data using templates and iterators.
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptxMarco Parenzan
Did interfaces in C# need evolution? Maybe yes. Are they violating some fundamental principles? We see. Are we asking for some hoops? Let's see all this by telling a story (of code, of course)
The document provides contact information for Eric Nelson, a developer evangelist at Microsoft. It includes links to his blogs on MSDN which discuss .NET, Visual Basic, and UK developer events. It also lists his career history including his first computer experiences in the 1980s and his job at Microsoft since 1996.
What's New for Developers in SQL Server 2008?ukdpe
The document provides biographical information about Eric Nelson, including details about his early career and interests. It discusses his first computer experiences in the 1980s, his first computer job programming in Fortran in 1986, and joining Microsoft in 1996 where he worked on ASP and SQL Server. It also mentions that he enjoys editing the UK MSDN Flash publication.
This document discusses integration testing of ColdBox applications using TestBox and MockBox. It defines integration testing as testing individual units combined as a group to expose faults in their interaction. The key benefits outlined are that integration tests allow testing of real use cases faster than end-to-end tests. The document recommends always integration testing as part of the development process and provides an overview of how to set up and run integration tests for a ColdBox application using TestBox.
The document provides an overview of the C programming language. It discusses basic C programming concepts like data types, variables, functions, pointers, structures, file handling and more. It also includes examples of basic C programs and code snippets to illustrate various programming concepts.
SQL stands for Structured Query Language
SQL lets you access and manipulate databases
SQL became a standard of the American National Standards Institute (ANSI) in 1986, and of the International Organization for Standardization (ISO) in 1987
Python is a general-purpose programming language that is highly readable. It uses English keywords and has fewer syntactical constructions than other languages. Python supports object-oriented, interactive, and procedural programming. It has various data types like numbers, strings, lists, tuples and dictionaries. Python uses constructs like if/else, for loops, functions and classes to control program flow and structure code.
The document summarizes the internship training that Shivam Denge completed from July 5th to August 16th 2022 at iBase Technology. The 6-week online training covered topics like Python programming language features, variables, loops, data structures, Numpy, Tkinter, Turtle and MySQL database modules. Key aspects of Python like being an interpreted, object-oriented and cross-platform language were also highlighted.
This document provides an introduction and overview to learning R. It covers installing R and RStudio, basic data types and structures like vectors, matrices and data frames. It also discusses importing data, viewing and manipulating data through functions like filtering, binding and transforming. Finally, it discusses creating summary tables from data, joining datasets, and creating visualizations and plots in R using packages like ggplot2. The goal is to learn the basics of working with data in R, performing basic analysis and creating charts.
The document describes an internship training in Python conducted over 6 weeks. It provides an introduction to Python, describing it as a general purpose programming language that can be used for various applications. It then discusses key Python features and concepts like variables, loops, data structures, modules like NumPy, Tkinter, Turtle and how to connect Python to MySQL databases. Code examples are provided to demonstrate basic usage of these features and modules.
Collections and generics allow storing multiple objects of the same type. Generic collections like List<T>, Queue<T>, and Dictionary<TKey, TValue> provide type-safety without boxing/unboxing. Different collection types have different performance characteristics depending on their implementation - arrays and lists have fast indexed access but slow removal while linked lists are slower to access but more memory efficient. Choosing the right collection type depends on the specific access patterns and operations needed.
The document summarizes updates and future plans for .NET Core and C#. Key points include:
- .NET Standard 2.0 provides over 32,000 APIs, allowing better cross-platform compatibility.
- C# 7.0 introduced features like tuples, pattern matching, and binary literals. Future versions will focus on smaller releases with opt-in features like recursive patterns and nullable reference types.
- The tooling ecosystem including Visual Studio and the dotnet CLI continue to improve with a shared SDK and common project format.
Redis is an in-memory data store that can be used as a database, cache, or message broker. It supports various data structures like strings, lists, hashes, sets, and sorted sets. Redis stores the full dataset in memory for very fast access, and can persist data to disk using snapshots or append-only files. It is widely used for caching, session storage, real-time analytics, and more due to its high performance and flexibility in handling different data types.
Data structures is one of the important subject of computer science Engineering and plays important role in competitive programming. This PPT is all about introduction about data structures in easy language
The document provides an overview of the basics of the Python programming language. It discusses that Python is an interpreted, interactive, object-oriented scripting language. It also covers Python's history and describes it as being easy to learn and read, easy to maintain, portable, and extensible. The document then details Python's core data types including numbers, strings, lists, tuples, and dictionaries. It provides examples of how to define and manipulate variables of each data type in Python.
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeAftab Hussain
Understanding variable roles in code has been found to be helpful by students
in learning programming -- could variable roles help deep neural models in
performing coding tasks? We do an exploratory study.
- These are slides of the talk given at InteNSE'23: The 1st International Workshop on Interpretability and Robustness in Neural Software Engineering, co-located with the 45th International Conference on Software Engineering, ICSE 2023, Melbourne Australia
Graspan: A Big Data System for Big Code AnalysisAftab Hussain
We built a disk-based parallel graph system, Graspan, that uses a novel edge-pair centric computation model to compute dynamic transitive closures on very large program graphs.
We implement context-sensitive pointer/alias and dataflow analyses on Graspan. An evaluation of these analyses on large codebases such as Linux shows that their Graspan implementations scale to millions of lines of code and are much simpler than their original implementations.
These analyses were used to augment the existing checkers; these augmented checkers found 132 new NULL pointer bugs and 1308 unnecessary NULL tests in Linux 4.4.0-rc5, PostgreSQL 8.3.9, and Apache httpd 2.2.18.
- Accepted in ASPLOS ‘17, Xi’an, China.
- Featured in the tutorial, Systemized Program Analyses: A Big Data Perspective on Static Analysis Scalability, ASPLOS ‘17.
- Invited for presentation at SoCal PLS ‘16.
- Invited for poster presentation at PLDI SRC ‘16.
Takashi Kobayashi and Hironori Washizaki, "SWEBOK Guide and Future of SE Education," First International Symposium on the Future of Software Engineering (FUSE), June 3-6, 2024, Okinawa, Japan
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Łukasz Chruściel
No one wants their application to drag like a car stuck in the slow lane! Yet it’s all too common to encounter bumpy, pothole-filled solutions that slow the speed of any application. Symfony apps are not an exception.
In this talk, I will take you for a spin around the performance racetrack. We’ll explore common pitfalls - those hidden potholes on your application that can cause unexpected slowdowns. Learn how to spot these performance bumps early, and more importantly, how to navigate around them to keep your application running at top speed.
We will focus in particular on tuning your engine at the application level, making the right adjustments to ensure that your system responds like a well-oiled, high-performance race car.
Atelier - Innover avec l’IA Générative et les graphes de connaissancesNeo4j
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Allez au-delà du battage médiatique autour de l’IA et découvrez des techniques pratiques pour utiliser l’IA de manière responsable à travers les données de votre organisation. Explorez comment utiliser les graphes de connaissances pour augmenter la précision, la transparence et la capacité d’explication dans les systèmes d’IA générative. Vous partirez avec une expérience pratique combinant les relations entre les données et les LLM pour apporter du contexte spécifique à votre domaine et améliorer votre raisonnement.
Amenez votre ordinateur portable et nous vous guiderons sur la mise en place de votre propre pile d’IA générative, en vous fournissant des exemples pratiques et codés pour démarrer en quelques minutes.
Hand Rolled Applicative User ValidationCode KataPhilip Schwarz
Could you use a simple piece of Scala validation code (granted, a very simplistic one too!) that you can rewrite, now and again, to refresh your basic understanding of Applicative operators <*>, <*, *>?
The goal is not to write perfect code showcasing validation, but rather, to provide a small, rough-and ready exercise to reinforce your muscle-memory.
Despite its grandiose-sounding title, this deck consists of just three slides showing the Scala 3 code to be rewritten whenever the details of the operators begin to fade away.
The code is my rough and ready translation of a Haskell user-validation program found in a book called Finding Success (and Failure) in Haskell - Fall in love with applicative functors.
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppGoogle
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-fusion-buddy-review
AI Fusion Buddy Review: Key Features
✅Create Stunning AI App Suite Fully Powered By Google's Latest AI technology, Gemini
✅Use Gemini to Build high-converting Converting Sales Video Scripts, ad copies, Trending Articles, blogs, etc.100% unique!
✅Create Ultra-HD graphics with a single keyword or phrase that commands 10x eyeballs!
✅Fully automated AI articles bulk generation!
✅Auto-post or schedule stunning AI content across all your accounts at once—WordPress, Facebook, LinkedIn, Blogger, and more.
✅With one keyword or URL, generate complete websites, landing pages, and more…
✅Automatically create & sell AI content, graphics, websites, landing pages, & all that gets you paid non-stop 24*7.
✅Pre-built High-Converting 100+ website Templates and 2000+ graphic templates logos, banners, and thumbnail images in Trending Niches.
✅Say goodbye to wasting time logging into multiple Chat GPT & AI Apps once & for all!
✅Save over $5000 per year and kick out dependency on third parties completely!
✅Brand New App: Not available anywhere else!
✅ Beginner-friendly!
✅ZERO upfront cost or any extra expenses
✅Risk-Free: 30-Day Money-Back Guarantee!
✅Commercial License included!
See My Other Reviews Article:
(1) AI Genie Review: https://sumonreview.com/ai-genie-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
#AIFusionBuddyReview,
#AIFusionBuddyFeatures,
#AIFusionBuddyPricing,
#AIFusionBuddyProsandCons,
#AIFusionBuddyTutorial,
#AIFusionBuddyUserExperience
#AIFusionBuddyforBeginners,
#AIFusionBuddyBenefits,
#AIFusionBuddyComparison,
#AIFusionBuddyInstallation,
#AIFusionBuddyRefundPolicy,
#AIFusionBuddyDemo,
#AIFusionBuddyMaintenanceFees,
#AIFusionBuddyNewbieFriendly,
#WhatIsAIFusionBuddy?,
#HowDoesAIFusionBuddyWorks
WhatsApp offers simple, reliable, and private messaging and calling services for free worldwide. With end-to-end encryption, your personal messages and calls are secure, ensuring only you and the recipient can access them. Enjoy voice and video calls to stay connected with loved ones or colleagues. Express yourself using stickers, GIFs, or by sharing moments on Status. WhatsApp Business enables global customer outreach, facilitating sales growth and relationship building through showcasing products and services. Stay connected effortlessly with group chats for planning outings with friends or staying updated on family conversations.
SMS API Integration in Saudi Arabia| Best SMS API ServiceYara Milbes
Discover the benefits and implementation of SMS API integration in the UAE and Middle East. This comprehensive guide covers the importance of SMS messaging APIs, the advantages of bulk SMS APIs, and real-world case studies. Learn how CEQUENS, a leader in communication solutions, can help your business enhance customer engagement and streamline operations with innovative CPaaS, reliable SMS APIs, and omnichannel solutions, including WhatsApp Business. Perfect for businesses seeking to optimize their communication strategies in the digital age.
E-commerce Development Services- Hornet DynamicsHornet Dynamics
For any business hoping to succeed in the digital age, having a strong online presence is crucial. We offer Ecommerce Development Services that are customized according to your business requirements and client preferences, enabling you to create a dynamic, safe, and user-friendly online store.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Most important New features of Oracle 23c for DBAs and Developers. You can get more idea from my youtube channel video from https://youtu.be/XvL5WtaC20A
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesQuickdice ERP
Explore the seamless transition to e-invoicing with this comprehensive guide tailored for Saudi Arabian businesses. Navigate the process effortlessly with step-by-step instructions designed to streamline implementation and enhance efficiency.
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfUndress Baby
The quest for the best AI face swap solution is marked by an amalgamation of technological prowess and artistic finesse, where cutting-edge algorithms seamlessly replace faces in images or videos with striking realism. Leveraging advanced deep learning techniques, the best AI face swap tools meticulously analyze facial features, lighting conditions, and expressions to execute flawless transformations, ensuring natural-looking results that blur the line between reality and illusion, captivating users with their ingenuity and sophistication.
Web:- https://undressbaby.com/
Measures in SQL (SIGMOD 2024, Santiago, Chile)Julian Hyde
SQL has attained widespread adoption, but Business Intelligence tools still use their own higher level languages based upon a multidimensional paradigm. Composable calculations are what is missing from SQL, and we propose a new kind of column, called a measure, that attaches a calculation to a table. Like regular tables, tables with measures are composable and closed when used in queries.
SQL-with-measures has the power, conciseness and reusability of multidimensional languages but retains SQL semantics. Measure invocations can be expanded in place to simple, clear SQL.
To define the evaluation semantics for measures, we introduce context-sensitive expressions (a way to evaluate multidimensional expressions that is consistent with existing SQL semantics), a concept called evaluation context, and several operations for setting and modifying the evaluation context.
A talk at SIGMOD, June 9–15, 2024, Santiago, Chile
Authors: Julian Hyde (Google) and John Fremlin (Google)
https://doi.org/10.1145/3626246.3653374
4. WHAT IS .NET FRAMEWORK?
• SDK: A technology that supports building and running the next generation of
applications and XML Web services.
• Runtime: A managed execution environment that provides a variety of services
to its running applications:
• Memory management.
• A common type system
• An extensive class library.
• Development frameworks and technologies (ASP.NET, ADO.NET, WCF…)
• Language interoperability (CIL)
• Version compatibility.
• Side-by-side execution.
• Multitargeting (Windows, Windows Phone, Xbox…)
5. .NET OBJECTIVES
• Provide a consistent object-oriented programming environment.
• Provide a code-execution environment that
• Minimizes software deployment and versioning conflicts.
• Promotes safe execution of code.
• Eliminates performance problems of scripted or interpreted environments.
• Make developer experience consistent across widely varying types of
applications.
• Ensure that code based on the .NET Framework can integrate with any other
code.
10. .NET COMPILATION AND EXECUTION
C# COMPILER
VB COMPILER
M
S
I
L
COMPILED INTO NATIVE CODE
EXECUTION OF CODE
Compile Time Runtime
Source Code
Bytecode Native Code
14. MONO FOR ANDROID
• Use C# as development language
• Use .NET base class library
• Can be developed using Visual Studio or
MonoDevelop as an IDE
• Code will compiled into Mono IL
• Can be interop between Dalvik and
mono via Mono Callable Wrapper and
Android Callable Wrapper
16. C# DATA TYPES
• Value types:
Holds the data within its own memory
allocation
• Reference types:
Contains a pointer to another memory
location that holds the data.
Static memory Dynamic memory
17. VALUE TYPES
• All numeric data types
• Boolean, Char, and Date
• All structures, even if their members are reference types
• Enumerations
18. REFERENCE TYPES
• String
• All arrays, even if their elements are value types
• Class types, such as Form
• Delegates
19. STRUCT VS CLASS
Struct Class
Value type Reference type
Usually used for smaller amounts
of data
Usually used for large amounts of
data
Does not support Inheritance Support Inheritance
Cannot have Destructor Can have Destructor
Passed to method by value Passed to method by reference
20. STRUCT VS CLASS
Struct Class
Cannot contain explicit
parameterless constructors
Can create explicit parameterless
in class
Can not instance Field initializer Can instance Field initializer
Can not be garbage collector so
no memory management.
Can be garbage collector because
garbage collector works on heap
memory
24. SYSTEM.COLLECTIONS.GENERIC
Class Description
Dictionary<TKey, TValue> Collection of key/value pairs that are organized based on
the key.
List<T> List of objects that can be accessed by index. Provides
methods to search, sort, and modify lists.
Queue<T> FIFO collection of objects.
SortedList<TKey, TValue> Collection of key/value pairs that are sorted by key based
on the associated IComparer<T> implementation.
Stack<T> LIFO collection of objects.
HashSet<T>
25. SYSTEM.COLLECTIONS
Class Description
ArrayList Array of objects whose size is dynamically increased as required.
Hashtable Collection of key/value pairs that are organized based on the hash
code of the key
Queue FIFO collection of objects.
Stack LIFO collection of objects.
26. SYSTEM.COLLECTIONS.SPECIALIZED
Class Description
HybridDictionary Implements IDictionary by using a ListDictionary is small, and
then switching to a Hashtable when gets large.
ListDictionary Implements IDictionary using a singly linked list (< 10 items.)
NameValueCollection Represents a collection of associated String keys and String
values that can be accessed either with the key or index.
OrderedDictionary Collection of key/value pairs that are accessible by key or index.
StringCollection Represents a collection of strings.
StringDictionary Implements a hash table with the key and the value strongly
typed to be strings rather than objects.
BitVector32 Provides a simple structure that stores Boolean values and small
integers in 32 bits of memory.
27. LIST<T>
• A variable-size List that uses an array of objects to store the elements.
• A List has a capacity, which is the allocated length of the internal array.
private const int _defaultCapacity = 4;
private T[] _items;
[ContractPublicPropertyName("Count")]
private int _size;
28. LIST<T>
• The list is initially empty and has a capacity of zero.
static readonly T[] _emptyArray = new T[0];
public List() {
_items = _emptyArray;
}
• Construct a List with a given initial capacity.
public List(int capacity)
• Construct a List, copying the contents of the given collection. The size and capacity will
both be equal to the size of the given collection.
public List(IEnumerable<T> collection)
29. LIST<T>
• Adds the given object to the end of this list. The size of the list is increased by
one. If required, the capacity of the list is doubled before adding the new
element.
public void Add(T item) {
if (_size == _items.Length) EnsureCapacity(_size + 1);
_items[_size++] = item;
...
}
30. LIST<T>
• Upon adding the first element to the list the capacity is increased to 4, and then
increased in multiples of two as required.
• If the current capacity of the list is less than min, the capacity is increased to
twice the current capacity or to min, whichever is larger.
private const int _defaultCapacity = 4;
private void EnsureCapacity(int min) {
if (_items.Length < min) {
int newCapacity = _items.Length == 0?
_defaultCapacity : _items.Length * 2;
if (newCapacity < min) newCapacity = min;
Capacity = newCapacity;
...
31. DICTIONARY<TKEY, TVALUE>
• Purpose: Generic hash table implementation
private struct Entry {
public int hashCode; // Lower 31 bits of hash code, -1 if unused
public int next; // Index of next entry, -1 if last
public TKey key; // Key of entry
public TValue value; // Value of entry
}
private int[] buckets;
private Entry[] entries;
32. DICTIONARY<TKEY, TVALUE>
• Dictionary size will be expanded on demand
public void Add(TKey key, TValue value) {
Insert(key, value, true);
}}
private void Insert(TKey key, TValue value, bool add) {
if (buckets == null) Initialize(0);
...
if (count == entries.Length)
{
Resize();
...
33. DICTIONARY<TKEY, TVALUE>
• Entry size will be expanded to the prime number that greater than twice of
old size.
private void Resize() {
Resize(HashHelpers.ExpandPrime(count), false);
}
// (HashHelpers) Returns size of hashtable to grow to.
public static int ExpandPrime(int oldSize)
{
int newSize = 2 * oldSize;
return GetPrime(newSize);
}
34. DICTIONARY<TKEY, TVALUE>
• Array will be cloned and rehashed each time resizing
private void Resize(int newSize, bool forceNewHashCodes) {
int[] newBuckets = new int[newSize];
Entry[] newEntries = new Entry[newSize];
Array.Copy(entries, 0, newEntries, 0, count);
…
for (int i = 0; i < count; i++) {
if (newEntries[i].hashCode >= 0) {
int bucket = newEntries[i].hashCode % newSize;
newEntries[i].next = newBuckets[bucket];
newBuckets[bucket] = i;
…
36. add to end
remove
from end
insert at
middle
remove
from middle
Random
Access
In-order
Access
Search for
specific element
Notes
Array O(n) O(n) O(n) O(n) O(1) O(1) O(n)
Most efficient use of memory;
use in cases where data size is
fixed.
List<T>
best case O(1);
worst case O(n)
O(1) O(n) O(n) O(1) O(1) O(n)
Implementation is optimized
for speed. In many cases, List
will be the best choice.
Collection<T>
best case O(1);
worst case O(n)
O(1) O(n) O(n) O(1) O(1) O(n)
List is a better choice, unless
publicly exposed as API.
LinkedList<T> O(1) O(1) O(1) O(1) O(n) O(1) O(n)
Many operations are fast,
but watch out for cache
coherency.
Stack<T>
best case O(1);
worst case O(n)
O(1) N/A N/A N/A N/A N/A
Shouldn't be selected for
performance reasons, but
algorithmic ones.
Queue<T>
best case O(1);
worst case O(n)
O(1) N/A N/A N/A N/A N/A
Shouldn't be selected for
performance reasons, but
algorithmic ones.
Dictionary<K,T>
best case O(1);
worst case O(n)
O(1)
best case O(1);
worst case O(n)
O(1) O(1)* O(1)* O(1)
Although in-order access time
is constant time, it is usually
slower than other structures
due to the over-head of looking
up the key.
37. SELECTING A COLLECTION CLASS
Do you need a sequential list where the element is typically discarded after its
value is retrieved?
Yes:
• Consider using the Queue class or the Queue<T> generic class if you need first-in, first-
out (FIFO) behavior.
• Consider using the Stack class or the Stack<T> generic class if you need last-in, first-out
(LIFO) behavior.
No: consider using the other collections.
38. SELECTING A COLLECTION CLASS
Do you need to access the elements in a certain order, such as FIFO, LIFO, or
random?
• The Queue class and the Queue<T> generic class offer FIFO access.
• The Stack class and the Stack<T> generic class offer LIFO access.
• The LinkedList<T> generic class allows sequential access either from the head to the tail,
or from the tail to the head.
39. SELECTING A COLLECTION CLASS
Do you need to access each element by index?
• The ArrayList and StringCollection classes and the List<T> generic class offer access to
their elements by the zero-based index of the element.
• The Hashtable, SortedList, ListDictionary, and StringDictionary classes, and the
Dictionary<TKey, TValue> and SortedDictionary<TKey, TValue> generic classes offer
access to their elements by the key of the element.
• The NameObjectCollectionBase and NameValueCollection classes, and the
KeyedCollection<TKey, TItem> and SortedList<TKey, TValue> generic classes offer access
to their elements by either the zero-based index or the key of the element.
40. SELECTING A COLLECTION CLASS
Will each element contain one value, a combination of one key and one value,
or a combination of one key and multiple values?
• One value: Use any of the collections based on the IList interface or the IList<T> generic
interface.
• One key and one value: Use any of the collections based on the IDictionary interface or
the IDictionary<TKey, TValue> generic interface.
• One value with embedded key: Use the KeyedCollection<TKey, TItem> generic class.
• One key and multiple values: Use the NameValueCollection class.
41. SELECTING A COLLECTION CLASS
Do you need to sort the elements differently from how they were entered?
• The Hashtable class sorts its elements by their hash codes.
• The SortedList class and the SortedDictionary<TKey, TValue> and SortedList<TKey,
TValue> generic classes sort their elements by the key, based on implementations of the
IComparer interface and the IComparer<T> generic interface.
• ArrayList provides a Sort method that takes an IComparer implementation as a
parameter. Its generic counterpart, the List<T> generic class, provides a Sort method that
takes an implementation of the IComparer<T> generic interface as a parameter.
42. SELECTING A COLLECTION CLASS
• Do you need fast searches and retrieval of information?
• ListDictionary is faster than Hashtable for small collections (10 items or fewer).
• The Dictionary<TKey, TValue> generic class provides faster lookup than the
SortedDictionary<TKey, TValue> generic class.
43. SELECTING A COLLECTION CLASS
• Do you need collections that accept only strings?
• StringCollection (based on IList) and StringDictionary (based on IDictionary) are in the
System.Collections.Specialized namespace.
• In addition, you can use any of the generic collection classes in the
System.Collections.Generic namespace as strongly typed string collections by specifying
the String class for their generic type arguments.
45. C# GENERICS
• Introduce concept of type parameters,
• which make it possible to design classes and methods
• that defer the specification of one or more types
• until the class or method is declared and instantiated by client code.
• For example,
• by using a generic type parameter T
• you can write a single class that other client code can use
• without incurring the cost or risk of runtime casts or boxing operations,
// Declare the generic class.
public class GenericList<T>
{
void Add(T input) { }
}
46. C# GENERICS
• To maximize code reuse, type safety, and performance.
• The most common use of generics is to create collection classes.
• You can create your own generic interfaces, classes, methods, events and
delegates.
• Generic classes may be constrained to enable access to methods on particular
data types.
• Information on the types that are used in a generic data type may be obtained
at run-time by using reflection.
47. GENERICS IN RUNTIME
// Stack of references types
Stack<int> stackOne = new Stack<int>();
Stack<int> stackTwo = new Stack<int>();
stackOne
stackTwo
class Customer { }
class Order { }
// Stack of value types
Stack<Customer> customers;
Stack<Order> orders = new Stack<Order>();
customers = new Stack<Customer>();
customers
others
Stack<long> stackThree = new Stack<long>(); stackThree
class Stack<int>
class Stack<long>
class Stack<T>
Specialized version Instances
48. GENERIC CONSTRAINTS
• By constraining the type parameter,
• you increase the number of allowable operations and method calls
• to those supported by the constraining type
• and all types in its inheritance hierarchy.
class EmployeeList<T>
where T: Employee, IEmployee, System.IComparable<T>, new()
{
// ...
}
49. GENERIC CONSTRAINTS
Constraint Description
where T: struct Must be a value type
where T : class Must be a reference type
where T : new() Must have a public parameterless constructor.
When used together with other constraints, the
new() constraint must be specified last.
where T : <base class name> Must be or derive from the specified base class.
where T : <interface name> Must be or implement the specified interface.
where T : U Supplied for T must be or derive from the argument
supplied for U.
50. GENERIC SINGLETON
public abstract class AppSingletonMono<T> : MonoBehaviour
where T : MonoBehaviour
{
private static T singleton;
protected virtual void Awake()
{
if (singleton == null || singleton == this)
{
singleton = (T)(MonoBehaviour)this;
DontDestroyOnLoad(transform.root);
51. GENERIC SINGLETON
public static T instance {
get {
if (singleton == null) {
singleton = (T)FindObjectOfType(typeof(T));
if (singleton == null) {
GameObject obj = new GameObject();
obj.name = "[@" + typeof(T).Name + "]";
singleton = obj.AddComponent<T>();
60. VARIANCE IN C# 4.0
• Supported for generic interface and delegate types only.
• Verified/enforced staticaliy in the definition.
• Value types are always invariant
• IEnumerable<int> is not IEnumerable<object>
• Similar to existing rules for arrays
• ref and out parameters need invariant types
62. REFERENCES
• Overview of the .NET Framework, Microsoft Developer Network (https://msdn.microsoft.com/en-
us/library/zw4w595w(v=vs.110).aspx)
• CLR C# and dot net version comparison chart, Anil Kumar, Mar 22 2013 (http://www.c-
sharpcorner.com/blogs/clr-c-sharp-and-dot-net-version-comparison-chart1)
• Develop android application with mono for android, Nicko Satria Utama, Aug 3, 2012
(http://www.slideshare.net/nickotech2000/develop-android-application-with-mono-for-android)
• Six important .NET concepts: Stack, heap, value types, reference types, boxing, and unboxing, Shivprasad
koirala, 14 May 2012 (https://www.codeproject.com/Articles/76153/Six-important-NET-concepts-Stack-heap-
value-types)
• Collections (C#), Microsoft Developer Network, July 20, 2015 (https://msdn.microsoft.com/en-
us/library/mt654013.aspx)
• .NET framework 4.6.2 reference source, Microsoft (https://referencesource.microsoft.com/)
63. REFERENCES
• Generics (C# Programming Guide), (https://docs.microsoft.com/en-
us/dotnet/articles/csharp/programming-guide/generics/)
• Selecting a Collection Class, Microsoft Developer Network
(https://msdn.microsoft.com/en-us/library/6tc79sx1.aspx)
• Manning Publication, C# in depth, Third Edition, Jon Skeet, 2014