• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/733

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

733 Cards in this Set

  • Front
  • Back
null conditional operators

?[


?.

-3- are used to test for null before performing a member access or index operation. They help reduce the code required to perform null checks. They are short-circuiting. Another use for the -3- member access is invoking delegates in a thread-safe way. (Mental bonus: what do they look like?)
Adapter Pattern
The -2- is a design pattern that allows the interface of an existing class to be used as another interface. It is often used to make existing classes work with others without modifying their source code. It's essential purpose is to bridge incompatible entities thus providing more flexibility.
Application Domain
When an application is run, a new -2- is created. Several different instantiations of an application may exist on a machine at the same time, & each has its own -2-. An -2- acts as a container and boundary for the types defined in the application & the class libraries it uses.
Application
In the context of .NET Framework, an assembly that has an entry point is called an -1-.
Associativity
When two or more operators that have the same precedence are present in an expression, they are evaluated based on their -1-. Whether the operators in an expression are left- or right- -1-, the operands are evaluated first from left to right. Precedence and -1- can be controlled with parentheses.
Auto-Implemented Properties
Make property-declaration more concise when no additional logic is required in the property accessors. -3- also enable client code to create objects. Attributes are permitted on -3-, but not on backing fields since they are inaccessible from your source code. If you must use one then use a regular property instead.



Ex: public double TotalPurchases { get; set; }

Auxiliary/Worker Threads
By default a C# program has one thread; however -2- can be created & used to execute code in parallel with the primary thread. -2- can perform time consuming or critical tasks without tying up the primary thread.
Backing Field / Store
This is a private field that stores the data exposed by a public property. It allows setting and retrieving of the property value. The get accessor returns the field's value, and the set accessor may perform some data validation before assigning a value to the field. Both may also perform conversions on the data before it's stored or returned.
Bound Type
A -2- refers to a non-generic type or constructed type which is a type that includes at least one type argument. Each class declaration has an associated -2-, called the instance type.
CharEnumerator
This System namespace class supports iterating over a String object and reading it's individual characters. A -1- provides read-only access to the characters in a referenced String object. The -1- class has no constructor; instead call a String object's GetEnumerator method to obtain a -1- that is initialized to reference the string.
Common Language Runtime (CLR)
This is the engine at the core of managed code execution. The -3- supplies managed code with services such as: cross-language integration, code access security, object lifetime management, and debugging & profiling support.
Composite Keys
❶ -2- are used to perform join operations in which you want to use more than one key to define a match. It's created as an anonymous type or named type w/ the value to compare. The names of properties & the order they occur in must be identical in each -2-.



❷ Use -2- when you want to group elements according to more than one key.

decimal type / keyword
The -1- keyword indicates a 128-bit data type. It is more precise when compared to other floating-point types.



Range: ±1.0 x 10⁻²⁸ to ±7.9228 x 10²⁸


Precision: 28-29 digits


Size: 16 bytes


NET Type: System.-1-


Default value: 0




Because the -1- type has more precision and a smaller range than both float and double, it's appropriate for financial and monetary calculations. -1- does not support signed zeros, infinities, or NaN's. By default, a real numeric literal on the right side is treated as a double, so the suffix m or M must be used here.

default / default(T) expression
This keyword can be used in the switch statement to specify a case when the others don't match, or in a -1- value expression, where it will produce the -1- value of the type.
Derived Class
Since Inheritance is transitive, the -2- will gain the non-private members of any classes up the chain. Conceptually, this type of class is a specialization.
Destructor
-1- implicitly call the Finalize method to free up allocated resources. Programmer has no control over when a -1- is called; that is determined by the garbage collector. A -1- is also called when the program exits.
Empty Statement
Execution of an -2- simply transfers control to the end point of a statement. An -2- is used when there are no operations to perform in a context where a statement is required, because it does nothing. An -2- can be used when writing a while statement with a null body, or to declare a label just before the closing "}" of a block.
Extension Method
-2- enable you to add methods to existing types without creating a new derived type, recompiling, or otherwise modifying the original type. An -2- is a static method, but is called as if they were instance methods.
① Fields

② Constants


③ Properties


④ Methods


⑤ Events


⑥ Operators


⑦ Indexers


⑧ Constructors


⑨ Finalizers / Destructors


⑩ Nested Types

Name the 10 class members.
Fitt's Law
-2- is a predictive model of human movement primarily used in human-computer interaction & ergonomics. This scientific law predicts that "the time required to rapidly move to a target area is a function of the ratio between the distance to the target & the width of the target". Often used to model the act of pointing.
Get Accessor
This keyword defines an accessor method in a property or indexer that returns the property value or indexer element. Often the -2- consists of a single statement that returns a value. In C# 7.0 you can implement the -2- as an expression-bodied member.
goto
This jump statement transfers program control directly to a labeled statement. Within the context of a switch statement, -1- can transfer to a specific case label or the default case. It is also useful to get out of deeply nested loops.
Governing Type
The -2- is the part of a switch statement which is established by the switch expression.



Ex: switch (expr)



The -2- is the (expr) in the example.

group clause
This clause returns a sequence of IGrouping objects that contain 0+ items that match the key value for the -1-. A query can be ended with this clause. Sometimes used with the into contextual keyword.
HasValue (bool) / Value (T)
An instance of a nullable type T? has two public read-only properties. An instance for which -1- is true is said to be non-null. A non-null instance contains a known value and -1- returns that value.
Implicitly Typed Array
Sometimes you need to create an array without populating it & keep all the elements with their default values. Other times, however, you need an -3- which is based on the array's content, This can be used anywhere as long as the compiler can infer the element type. Also works with multi-dimensional arrays.
implicitly typed local variable declaration
In the context of a local variable declaration, the identifier var acts as a contextual keyword. When the local variable type is specified as var and no type named var is in scope, the declaration is an -5-, whose type is inferred from the type of the associated initializer expression.
Interface Segregation Principle
The -3- states that no client should be forced to depend on methods it doesn't use. This principle splits interfaces that are large into smaller & more specific ones, so that clients will only have to know about the methods that are of interest to them. These are then called role interfaces. -3- intends to keep a system decouple & thus easier to refactor, change, & redeploy.
① Labeled Statements

② Label

A ① -2- permits a statement to be prefixed by a ② -1-. These statements are permitted in blocks, but not as embedded statements. The statement declares a ② -1- with the name given by the identifier. A ② -1- can be referenced from goto statements within the scope of the ② -1-, which is the entire block in which the ① -2- is declared, including any nested blocks.
Lazy Initialization
-2- of an object means that its creation is deferred until it is first used. -2- is primarily used to boost performance, avoid wasteful computation, & reduce memory requirements.
Liskov Substitution Principle (LSP)
This OOP principle states that if S is a subtype of T, then objects of type T may be replaced with objects of type S, without altering any of the desirable properties of T. More formally, the -2- Principle is a particular definition of a subtyping relation. It is a semantic, rather than merely a syntactic relation because it intends to guarantee semantic interoperability of types in a hierarchy (object types in particular).
Member Lookup
A -2- is the process whereby the meaning of a name in the context of a type is determined. A -2- can occur as part of evaluating a simple name or a member access in an expression. If the simple name or member access occurs as the primary expression of an invocation expression, the member is said to be invoked.
namespace (keyword)
This keyword is used to declare a scope that contains a set of related objects. Use a -1- to organize code elements & to create globally unique types. Implicitly has unmodifiable public access.
non-nullable value type
The converse of T?, a -4- is any value type other than System.Nullable❬T❭ plus any type parameter that is constrained to be a -4- (that is, any type parameter with a struct constraint.)
Nullable Types
A -2- can represent all values of its underlying type plus an additional null value. A -2- is written T? , where T is the underlying type. This syntax is shorthand for System.Nullable❬T❭, and the two forms can be used interchangeably.
Numeric Promotion
-2- consists of automatically performing certain implicit conversions of the operands of the pre-defined unary & binary numeric operators. Unary -2- occurs for the operands of the pre-defined +, -, and ~ unary operators, and converts operands of the types: sbyte, byte, char, short, or ushort to int.
① Numeric

② Enumeration


③ Nullable


④ Reference


⑤ Dynamic


⑥ Constant Expression


⑦ User-Defined


⑧ Anonymous Function


⑨ Null Literal


⑩ Identity


⑪ Boxing


⑫ Method Group


⑬ Interpolated String

Name the 13 Types of Implicit Conversions in C#
① object type (keyword)

② System.Object

This type is an alias for ② -1-.-1- in .NET. When a variable or value type is converted to ① -1-, it is said to be boxed. The opposite action is unboxing.
Operators
-1- are constructs which behave mostly like methods, but which differ from them syntactically or semantically. The syntax of an expression involving an -1- depends on it's arity, precedence, & associativity.
Optional Parameters
When defining a method, you can specify a default value for -2-. If the corresponding arguments are missing when the method is called, it will use the default values. These can also be specified in indexers, constructors, & delegates.
① Parsing

② Parse

A ① -1- operation converts a string that represents a .NET base type into that base type. This is considered the opposite of a formatting operation. ① -1- is most commonly carried out via a ② -1- method. ① -1- also uses an object to implement the IFormatProvider interface.
Platform Invocation Services (P/Invoke)
-3- (abbr. -1-) is a feature of CLI implementations that enables managed code to call native code; the former provides access to classes, methods, & types defined within the libraries that comprise the .NET framework, while the latter is anything else, including lower-level OS libraries & 3ʳᵈ party libraries. Calls to functions within these libraries occur by declaring the signature of the unmanaged function within managed code, which serves as the actual function that can be called like any other managed method.
protected internal (Access Modifier)
This access modifier limits access to the current assembly or types derived from the containing class.
query
A -1- is a set of instructions that describes what data to retrieve from a given data source(s) & what shape & organization the returned data should have. A -1- is distinct from the results it produces. Given a source sequence, a -1- may:



▪ retrieve a subset to produce a new sequence without altering original elements, then sort or group


▪ transform a retrieved sequence into a new object


▪ retrieve a singleton value about the source data

Refactoring
-1- is the process of improving code after it has been written by changing the internal structure of the code, without changing its external behavior.
Return Type
The -2- defines and constrains the data type of the value returned from a method. It must be explicitly specified.
Roslyn .NET Compiler Platform
-4- is a set of open source compilers & code analysis APIs for C# and VB.NET. The project notably includes self-hosting versions of those languages compilers which are available via the traditional command-line programs, but also as APIs available natively from within .NET code. -4- exposes modules for syntactic (lexical) analysis of code, semantic analysis, dynamic compilation to CIL, & code emission.
sbyte (Integral Type)

-1- indicates an integral type that stores values according to the size and range shown in the following table.




Range: -128 to 127


Size: Signed 8-bit integer


NET Type: System.-1-



You can declare and initialize an -1- variable by assigning a decimal, hex, or binary literal. Integer literals that do not have a suffix indicating otherwise will default to the int type.
Semaphore
Use the -1- class to control access to a pool of resources. Threads enter the -1- by calling the WaitOne method, which is inherited from the WaitHandle class, and release the -1- by calling the Release method. The count on a -1- is decremented each time a thread enters the -1-, and incremented when a thread releases the -1-. When the count is zero, subsequent requests block until other threads release the -1-. When all threads have released the -1-, the count is at the maximum value specified when the -1- was created. There is no guaranteed order, such as FIFO or LIFO, in which blocked threads enter the -1-.
Simple Type
A value type is either a struct or an enumeration type. C# provides a set of predefined struct types call the -2-, which are further classified into numeric types & bool. Because a -2- aliases a struct type, every -2- has members. The -2- differ from other struct types in that they permit certain additional operations.
Stack Frame, Activation Record
A call stack is composed of -2-. These are machine-dependent & ABI-dependent data structures containing method state information. Each -2- corresponds to a call to a method which has not yet terminated with a return.
Stream
A -1- is a sequence of data elements made available over time. It can be thought of as items on a conveyor belt being processed individually rather than in large batches. -1- are also processed differently than batch data - normal functions cannot operate on -1- as a whole, as they have potentially unlimited data and formally, -1- are considered codata, not data (which is finite by definition).
struct
The -1- keyword denotes a value type typically used to encapsulate small groups of related variables like coordinates of a rectangle. This can contain constructors, constants, fields, methods, properties, indexers, operators, events, & nested types - although if several such members are needed, consider a class instead.
Structural Design Patterns
The -1- design patterns concern class & object composition. They use inheritance & define ways to compose interfaces and objects to obtain new functionality. Constituent -1- design patterns include Adapter, Decorator, and Flyweight.
System.Collections Namespace
The -1-.-1- namespace contains interfaces and classes that define various collections of objects: lists, queues, bit arrays, hash tables, & dictionaries. Among its classes include ArrayList and BitArray. Its main interface is ICollection.
System.Runtime.CompilerServices Namespace
The -1-.-1-.-1- namespace provides functionality for compiler writers who use managed code to specify attributes in metadata that affect the runtime behavior of the Common Language Runtime.
System.Windows.Forms Namespace
The -1-.-1-.-1- namespace contains classes for creating Windows-based applications that take full advantage of the Windows OS user interface features. Some of the categories -1-.-1-.-1- classes fall in include: Controls, Menus & Toolbars, Layout, Data & Binding, Components, and Common Dialog Boxes.
underlying type
In the context of an enum, the -2- is the set of values that represents the types of the enum's constant values. In the context of a nullable type, the nullable type can represent all values of its -2- plus an additional null value. A nullable type is written T? where T is the -2-. The -2- of a nullable type cannot be a nullable type or a reference type.
① Unwrapping

② Wrapping

The process of accessing the Value property of a nullable instance is referred to as ① -1-. The process of creating a non-null instance of a nullable type for a given value is referred to as ②-1-.
User-defined Conversions
C# allows the pre-defined implicit and explicit conversions to be augmented by -3-. A -3- consists of an optional standard conversion (implicit or explicit), followed by execution of a -3- operator, and then another optional standard conversion. -3- are introduced by declaring conversion operators in class and struct types.
Variance Conversions
The purpose of variance annotations is to provide for more lenient conversions to interface and delegate types. Therefore, the definitions of implicit and explicit conversions allow for -2-, which are defined as follows:



▪ A type T has a -2- to a type T if T is either an interface or a
delegate type declared with the variant type parameters T , and for each variant type parameter Xi one of the following holds:



Xi is covariant and an implicit reference or identity conversion exists from Ai to Bi
Xi is contravariant and an implicit reference or identity conversion exists from Bi to Ai
Xi is invariant and an identity conversion
exists from Ai to Bi

Windows Presentation Foundation (WPF)
The -3- is a graphical subsystem for rending user interfaces in Windows-based applications. -3- uses DirectX, attempts to provide a consistent programming model, and separates the user interface from the business logic. It employs XAML, an XML-based language, to define and link various interface elements.

byte keyword

-1- denotes an integral type.




Range: 0-255


Size: Unsigned 8-bit integer


NET Framework: System.-1-




You can declare & initialize a -1- variable by assigning a decimal, hex, or a binary literal.

case keyword

-1- labels define the statement to be executed in a switch statement, should a condition be matched. They can specify a pattern.

Main Method

This is the entry point of a C# application. Libraries & services do not require a -2- as such. When the application is started, the -2- is the first method that is invoked.




There can only be one entry point in a C# program. The -2- is declared inside a class or struct, must be static, & need not be public. -2- can have void, int, Task, or Task as a return type (though the latter two require the async modifier).

Command-Line Argument

You can send -3- to the Main Method by defining it in one of the following ways: static int Main(string[] args) or static void Main(string[] args). The parameter of the Main Method is a string array that represents the -3-. Usually you determine whether -3- exist by testing the Length property. You can convert the string -3- to numeric types by using Convert class or the Parse method.

volatile keyword

This indicates a field might be modified by multiple threads executing simultaneously. Fields declared -1- are not subject to compiler optimizations that assume access by a single thread. It is usually used when the lock statement is not used to serialize access. Can be used with: reference types & pointer types.

void keyword

When used as the return type for a method, -1- specifies that the method doesn't return any value. -1- isn't allowed in the parameter list of a method. -1- can be used in an unsafe context to declare a point to an unknown type. It is an alias for the NET Framework type System.-1-.




Example: public -1- SampMethod() { }

uint keyword

-1- signifies an integral type.




Range: 0 to 4,294,967,295


Size: Unsigned 32-bit integer


NET Type: System.UInt32


Default value: 0




The -1- type is not CLS-compliant, so use its signed alternative where possible.




-1- can be assigned decimal, binary, or hex literals. There is a predefined implicit conversion to long, ulong, float, double, & decimal. Only byte, ushort, or char convert to this.

ulong keyword

The -1- type signifies an integral type.




Range: 0 to 18,446,744,073,709,551,615


Size: Unsigned 64-bit integer


NET Type: System.UInt64


Default value: 0




This type is not CLS-compliant, so use its signed alternative where possible. Can be assigned decimal, binary, or hex literals.




Uses the suffix type specifier UL. A common use is to use the UL suffix when calling overloaded methods. There is a predefined implicit conversion to float, double, & decimal & no conversion to any integral type without an explicit cast.

set accessor

The -2- assigns a value to its respective element. Often it consists of a single statement that assigns a value which could instead be implemented as an expression-bodied member, or as part of an auto-implemented property. Used in a property or indexer.

Portable Executable (PE) File

The -2- (-1-) file format is for DLLs, object code, executables, and others used in both 32-bit & 64-bit versions of the Windows OS. The -2- is a data structure that encapsulates the information necessary for the Windows OS loader to manage the wrapped executable code. This includes dynamic library references for linking, API export & import tables, resource management data, and thread local storage (TLS) data.




The NET binary format is based on the -2- file format & NET class libraries are conformant -2-.

Graphics Device Interface (GDI)

The Windows -3- (abbr. -1-) enables apps to use graphics & formatted text on both the video display & the printer. Windows-based apps do not access the graphics hardware directly. Instead -1- interacts with device drivers on behalf of apps.

Converter❬TInput, TOutput❭ Delegate

-1- represents a method that converts an object of one type to another type.




Ex: public delegate TOutput -1- (TInput input);




This is used by the ConvertAll method of the Array class & List class to convert each element of the collection from one type to another.




Where TOutput is the type of object to be converted to, while TInput is the type of object to be converted from. Part of System namespace.

Object Graph

In an object-oriented program, groups of objects form a network through their relationships with each other, either through a direct reference to another object, or through a chain of intermediate references. These groups of objects are referred to as an -2-. An -2- is a view of an object system at a particular point in time.




Whereas a normal data model (i.e. UML) details the relationships between classes, the -2- relates their instances.

① Emit


② System.Reflection.Emit

(Note: Two answers) Upon analyzing the grammar of a program, you tokenize the contents of it and ① -1- (push out) assembly instructions, which can then generate binary code. The ② -3- (aka -1-.-1-.-1-) namespace contains classes that allow a compiler to ① -1- metadata & Microsoft Intermediate Language (MSIL) & optionally generate a portable executable (PE) file on disk.




The primary clients of these classes are script engines & compilers. Some potential uses include → ▪ Interface List Wrapping ▪ Comparing Objects ▪ Aspect Oriented Programming specifically for cache injection.

Assignment & Lambda Operators

These operators have the lowest precedence of all the operator groups →




▪ Assignment (x = y)


▪ Increment Assignment (x += y)


▪ Decrement Assignment (x -= y)


▪ Multiplication Assignment (x *= y)



▪ Division Assignment (x /= y)


▪ Modulo Assignment (x %= y)


▪ AND Assignment (x &= y)


▪ OR Assignment (x |= y)


▪ XOR Assignment (x ^= y)


▪ Bit Shift Left Assignment (x <<= y)



▪ Bit Shift Right Assignment (x >>= y)


▪ Lambda Declaration =>

BitArray Class

The -1- Class (System.Collections) manages a compact array of bit values, which are represented as Booleans, where true indicates that the bit is ON (1) & false indicates the bit is OFF (0). The -1- class is a collection class in which the capacity is always the same as the count. Elements are added/removed by increasing/decreasing the Length property. -1- provides methods that aren't found in other collections, such as And, Or, XOr, Not, & SetAll. These allow multiple elements to be modified at once with a filter.

anti-pattern

(Note → hyphenated answer) An -2- is a common response to a reoccurring problem that is usually ineffective & risks being counterproductive.

①Implements (general)


②Implementations

In OOP, when a concrete class ① -1- an interface, it includes methods, which are ② -1- of those methods, specified by the interface. In a more general sense, an ② -1- is a realization of a technical specification or algorithm, as a program, software component, or other computer system through programming & deployment.

Concrete Class

This is a synonym for non-generic classes. A -1- class defines a useful object that can be instantiated as an automatic variable on the program stack. Typically you create a generic class by starting with an existing -1- class.

Information Hiding

-2- is the principle of segregation of the design decisions in a computer program that are most likely to change, thus protecting another program's parts from extensive modification if the design decision is changed. This involves providing a stable interface that is resistant to any such local changes & is easily understood by its client. -2- is similar to Encapsulation, whereas the former is a principle, the latter is its technique. Both are rooted in the concept of modularity.

① #if


② #endif

When the compiler encounters an ① -1-, followed by an ② -1-, it will compile the code between them only if the specified symbol is defined. The ① -1- statement is Boolean and only tests whether the symbol has been defined or not. Use the == and != operators to test for true or false, and the &&, ||, and ! operators to evaluate whether multiple symbols have been defined. You can group symbols or operators with ( )'s. ① -1- & ② -1- can be useful when compiling for a debug build or a specific configuration.

nameof keyword

-1- is used to obtain the simple, unqualified string name of a variable, type, or member. When reporting errors in code, hooking up Model-View-Controller links, firing property-charged events, etc., you may want to use -1-. Using -1- helps keep your code valid when renaming definitions.

Base Class

These are a useful way to group objects that share a common set of functionality. A -2- is used to create, or derive, other classes. This is key to the concept of inheritance, as the derived classes inherit both data & behavior from the -2- in addition to their own, but do not inherit constructors & destructors. A -2- can be marked as abstract, which means it must be inherited.

Constructor

Whenever a class or struct is created, its -1- is called. A class may have multiple -1- that take different arguments, or none. A -1- enables the programmer to set default values, limit instantiation, & write legible & flexible code. If not provided, C# automatically creates a -1- that instantiates the object & sets member variables to the default values. A -1- is a method whose name is the same as its type & it has no return type.

Pinned Object / Pinning

A -2- is not allowed to move. This is done with the fixed statement. The garbage collector normally compacts memory by placing objects in a cluster(s) to create free space. If something else had been pointing to the memory address of an object that is moved, it may then point to random content; a -2- prevents this, and is generally only useful when working with pointers so that you can turn in an address to a structure, & if that is implemented in a class, you have a -2-.

Heap Fragmentation

When memory is allocated from the heap it is taken from the free space in blocks of different sizes depending on the size of the data that must be stored. When these blocks of memory are returned to the heap, the heap can get split up into small free blocks, separated by allocated blocks. This is called -2-. It means although the total amount of free memory may be high, large blocks cannot be allocated without running the garbage collector and/or expanding the heap because none of the existing block are large enough.

① Marshalling


② Unmarshalling

① -1- is the process of transforming the memory representation of an object to a data format suitable for storage or transmission & is often used when data must be moved between different parts of a CPU program, or from one program to another. ① -1- is similar to serialization, & is used to communicate to remote objects with an object; in this case, a serialized object. It simplifies complex communication, using composite objects instead of primitives. The inverse of① -1- is called② -1-.

Process Boundary

Historically, -2- have been used to isolate apps running on the same computer. Each app is loaded into a separate process to isolate them because memory addresses are process-relative; a memory-pointer from one process to another cannot be used in any meaningful way in the target process. Additionally, you cannot make direct calls between two processes.

① Open Type


② Closed Type

(Note: two answers) All types can be classified in two categories, ① -2- and ② -2-. An ① -2- is a type that involves type parameters:




▪ a type parameter defines an ① -2-


▪ an array type is an ① -2- if and only if its element type is also an ① -2-


▪ a constructed type is an ① -2- if and only if one or more of its type arguments is an ① -2-


▪ a constructed nested type is an ① -2- if and only if one or more of its type arguments, or the type argument of its containing type is an ① -2-.




A ② -2- is a type that is not an ① -2-. The runtime processing of statements of all statements & expressions always occurs with ② -2-, and ① -2- occur only during compile-time processing.



Conversion

A -1- enables an expression to be treated as being of a particular type. A -1- may cause an expression of a given type to be treated as having a different type, or an expression without a type to get a type. A -1- can be explicit or implicit.

① while keyword


② do keyword



The ① -1- statement executes a statement or block of statements until a specified expression evaluates to false. It can be paired with the ② -1- statement, in which case it always executes at least once.

① bool type / keyword


② System.Boolean

Alias of ② System.-1-. Used to declare variables to store the ① -1- values true & false, and is the result type of comparison and equality operators. If you require a ① -1- variable that can also have a value of null, use ① -1-? Defaults to false.




C# only provides two conversions that involve -1-. An implicit conversion to the corresponding nullable -1-? type and an explicit conversion from the -1-? type. .NET provides additional conversion methods.

Simple Name

A -2- consists of an identifier, optionally followed by a type argument list. A -2- is either of the form I, or of the form I❬T❭

Discards

-1- are temporary dummy variables that are intentionally unused in application code. -1- are the same as unassigned variables; they do not have a value. Because there is only a single -1- variable, and that variable may not even be allocated storage, -1- can reduce memory allocations. They make the intent of your code clear, enhancing it's readability & maintainability. They are represented with the underscore _ character.

Versioning/Version

Semantic -1- is a naming convention applied to -1- of your library to signify specific milestone events that should help developers determine the compatibility with their projects that make use of older -1- of that same library. Commonly follows the Major.Minor.Patch format.

Big O Notation

-3- is a notation that describes the limiting behavior of a function when the argument tends to a particular value or infinity. It is a member of the family of notations invented by Bachmann-Landau.

Race Condition

A -2- is the behavior of an electronic, software, or other system where the output is dependent on the sequence of timing of other uncontrollable events. It becomes a bug when events do not happen in the intended order. The term originates with two signals competing against each other to influence the output first. -2- occur often in logic circuits & multi-threaded or distributed programs.

Dynamic Linked Library (DLL)

The -3- (abbr. -1-) is Microsoft's implementation of the shared library concept in Windows & OS/2 operating systems. These libraries usually have the file extension -1-, OCX, or DRV. The file formats for -3- are the same as for Windows EXE files, that is, Portable Executable for 32-bit & 64-bit Windows. As with EXEs, -3- can contain code, data, & resources in any combination.

Persistence

-1- refers to the characteristic of state that outlives the process that created it. This involves storing the state as data in data storage. Programs have to transfer data to & from storage devices & provide mappings from the native programming language data structures to the storage device data structures. Common ways of implementing -1- include: system images, journals, & dirty writes.

Windows Registry

The -2- is a hierarchical database that stores low-level settings for the MS Windows OS, & for applications that opt to use the -2-. The kernel device drivers, services, Security Accounts Manager, & user interface can all use the -2-. It also allows access to counters for profiling system performance. When a new program is installed, a subkey is added to the -2-, containing settings such as the program's location, version, & operating instructions.

Invariant

An -1- is a condition that can be relied upon to be true during program execution or during some portion thereof. It is a logical assertion. For example, a loop -1- is a condition that is true at both the beginning & end of every execution of a loop. -1- are especially useful when reasoning about program correctness. The theory of optimizing compilers, the methodology of design by contract, & formal methods for determining program correctness, all rely heavily on -1-.

codebase

A -1- is a complete body of source code for a given program. Source code is the version of a program that a programmer writes & saves to file. A -1- usually includes only the human-written files, & files necessary for the build (such as config & property files). Typically a -1- is stored in a source control repository that belongs to a revision control system (i.e. GitHub)

Wrapper

A -1- is generally used to describe a class which contains an instance of another class, but which doesn't directly expose that instance. The main purpose of the -1- is to provide a different way to use the -1- object. This could include a simpler interface, or new functionality.

Pipeline

A -1- is a set of data-processing elements connected in a series where the output of one element is the input of another. The elements of a -1- are often executed in parallel, or in a time-sliced fashion. Some amount of buffer storage is often inserted between elements. A specific kind of -1- is a software -1-, which consists of a chain of elements (processes, threads, coroutines, etc.). Narrowly speaking, a -1- is linear & one-directional, though sometimes the term is applied to more general flows.

① unmanaged


② System.Delegate / System.MulticastDelegate


③ System.Enum

Beginning with C# 7.3, the following additional constraints on type parameters are available:




where T: ① -1-


▪ specifies that the type parameters must be an ① -1- type, which is a type that isn't a reference type & doesn't have reference type fields at any level of nesting




where T : ② -1-.-1- (or -1-.-1-)


▪ specified as a base class constraint & enables code that works with ② -1- in a type-safe manner




where T: ③ -1-.-1-


▪ Generics using this can provide type-safe programming to cache results from using the static methods in ③ -1-.-1-. Also a base class constraint

Dynamic Language Runtime (DLR)

The -3- (abbr. -1-) is a runtime environment that adds a set of services for dynamic languages to the CLR. The -3- augments development of dynamic languages that run on .NET & to add dynamic features to statically-typed languages. Advantages include: ▪ able to use REPL (rapid feedback loop), which lets you enter several statements & execute immediately to see results, ▪ easier code refactoring & modifications because no need to change static-type declarations


Stack❬T❭ Class

This class represents a variable-sized LIFO collection of instances of the same specified type. -1- is implemented as an array, and along with Queues are useful when you need temporary storage for information; that is, when you might want to discard an element after retrieving its value. Use Queue to access information in the same order that its stored in the collection, -1- to access in reverse order. A common use of -1- is to preserve variable states during calls to other procedures.

Token

An individual instance of a type of symbol; something serving as a sign of something else. One use of -1- is in system security authentication, so a -1- is created when a user login occurs. This -1- then represents that user's authentication status.

access modifier

The following six -2- are used to specify the declared accessibility of a member of a type: ▪ public ▪ private ▪ internal ▪ protected ▪ protected internal & ▪ private protected (added in C# 7.2)

URI Class

Form: public class -1-: System.Runtime.Serialization.


ISerializable




Namespace: System




Inheritance: Object → -1-




Attributes: TypeConverterAttribute, SerializableAttribute


The -1- class provides an object representation of a Uniform Resource Identifier, & easy access to parts of the URI. A URI is a compact representation of a resource available to your application on the Intra/Internet. It defines the properties & methods for handling URIs including: parsing, comparing, & combining.

CultureInfo Class

Form: public class -1-: ICloneable, IFormatProvider




Namespace: System.Globalization




Inheritance: Object → -1-




Attributes: ComVisibleAttribute, SerializableAttribute






The -1- class provides information about a specific -1-, called a locale for unmanaged code development. The information includes the name for the -1-, the writing system, the calendar used, the sort order for strings, & formatting for dates and numbers.

let clause

In a query expression, it is sometimes useful to store the result in a sub-expression in order to use it in subsequent clauses. You can do this with the -1- clause, which creates a new range variable and initializes it with the result of the supplied expression. Once initialized, it cannot store another value, but if it holds a queryable type, it can be queried.

join clause

The -1- clause can associate elements from different source sequences that have no direct relationship in the object model. The only requirement is that the elements in each source share some value that can be compared for equality. A -1- clause takes two source sequences as input. The shape of the output depends on the type of -1- you are performing: ▪ Inner ▪ Group ▪ Left Outer ▪ Etc.

① Instantiation


② Instance

(Note: two answers) The term ① -1- describes the fundamental concept of an object being created by a constructor from its class blueprint. The object is thereafter termed an ② -1- of the class, & the constructor may be called an ② -1- constructor.

Code Block

A -2- is a lexical structure of source code which is grouped together & consists of one or more declarations and statements. Control structures are formed from -2-.

named arguments

-2- enable you to identify an argument for a particular parameter by associating the argument with the parameter's name rather than its position within the parameter list. When using -2- the arguments are evaluated in the order in which they appear in the argument list, not the parameter list. Combined with -2- enable supplying arguments for only a few parameters from an -2- list, greatly facilitating class to COM interfaces.

Component Object Model (COM)

The -3- (abbr. -1-) technology enables software components to communicate. -3- is used by developers to create re-usable software components, link components together to build applications, and take advantage of Windows services.

managed code

-2- is managed by the Common Language Runtime (CLR) which compiles and executes it. The CLR also provides the -2- with services such as memory management, security boundaries, & type safety.




-2- is written in one of the high-level languages that run on .NET. Before -2- is converted into machine code, it's first converted to Microsoft Intermediate Language (MSIL); when the MSIL is run, the CLR takes over & starts the Just-In-Time process (JIT).

Comparison❬T❭ delegate

The -1- delegate represents the method that compares two objects of the same type. Form: public delegate int -1- (Tx, Ty). This is by the Sort(T[], -1-) method overload of the Array class and the Sort(-1-) method overload of the List class to sort the elements of an array or list. Contravariant.

Assembly cache

This is a code cache used for side-by-side storage of assemblies. It has two parts: the global -2- contains assemblies that are explicitly installed to be shared among many apps on the CPU; the download cache stores code downloaded from intra-/Internet sites isolated to the application that caused the download, so that code downloaded on behalf of one application or page doesn't impact other applications.

asynchronous

To be -1- means that something is not dependent on timing. Each application or command runs in the specified order, but the specified item doesn't wait for any previous started process to finish before an application or command runs.

readonly struct type

A -2- allows you to create an immutable struct which can be passed by readonly reference. This removes the defensive copies that take place when you access methods of a struct used as an in parameter. You can use the in modifier at every location where a -2- is an argument; also, you can return a -2- as a ref return when you are returning an object whose lifetime extends beyond the scope of the method returning the object. The compiler generates more efficient code when you call members of a -2-.

namespace alias qualifier

The -3- is used to lookup identifiers, & is always positioned between two of them.




Ex: global::System.Console.Writeline("Hi");




If the -3- is global this invokes a lookup in the global namespace rather than an aliased namespace - this is very useful when a member is hidden by another entity of the same name. Unlike the . qualifier, the left-hand identifier of the -3- is looked up only as an extern or using alias.

① Prototype pattern


② Prototype

(Note: 2 answers) The ① -2- creates new objects by cloning one of a few stored ② -1-. It has two advantages:




▪ it speeds up the instantiation of very large dynamically loaded-classes


▪ it keeps a record of identifiable parts of a large data structure that can be copied without knowing the subclass from which they were created




Objects are usually instantiated from classes that are part of the program, but the ① -2- provides an alternate way.

Encapsulation

-1- means that a group of related properties, methods, and other members are treated as a single unit or object, and refers to an object's ability to hide data & behavior that are not necessary to its user. The benefits of -1- include: ▪ protection from accidental data corruption ▪ specification of the accessibility of each of the members of a class in the code outside of the class ▪ code is less complex, more flexible & extensible ▪ lower coupling between objects, hence better code maintainability


-1- is specified with access modifiers.

Fields, Constants, Properties, Methods, Operators, Indexers, Events, Constructors, Finalizers/Destructors, and Nested Types

Name the 10 members types of a class

INotifyPropertyChanged Interface

The -1- interface is used to notify clients, typically binding clients, that a property value has changed. For change notification to occur in a binding between a bound client & a data source, your bound type should either: ▪ implement -1- (preferred) ▪ provide a change event for each property of the bound type

Virtual Execution System (VES)

The -3- (abbr. -1-) is a run-time system of the Common Language Infrastructure which provides an environment for executing managed code. It provides direct support for a set of built-in data types, defines a hypothetical machine with an associated machine model & state, a set of control flow constructions, & an exception handling model. To a large extent, the purpose of the -3- is to provide the support required to execute the Common Intermediate Language instruction set.

Inheritance

-1- is the ability to create a class from which attributes & behaviors are derived from an existing class. The newly created class is the derived class, & the existing class is the base class. When you define a class to derive from another class, the derived class implicitly gains all the members of the base class, except for its constructors and finalizers.

Polymorphism

-1- is the ability of objects of different types to provide an unique interface for different implementation of methods. -1- is used in the context of late-binding where the behavior of an object to respond to a call to its method members is determined based on the object type at run-time. -1- enables re-defining methods in derived classes. Method, constructor, & operator overloading are considered compile-time (aka static or ad-hoc) -1-, or early-binding. Method overriding, which involves inheritance & virtual functions is called run-time (aka dynamic inclusion or subtyping) -1-, or late-binding. In C#, -1- is implemented through inheritance & the virtual modifier.

checked keyword

-1- is used to explicitly enable overflow checking for integral-type arithmetic operations & conversions. By default, an expression that contains only constant values causes a compiler error if the expression produces an overflow. -1- can be used as part of an expression, or a -1- block to detect the overflow.

class keyword

Use -1- to declare a class. Only single inheritance is viable in C#, so a class can inherit implementation from one base class only. However, multiple interfaces can be implemented by one class.

where contextual keyword

The -1- clause is used in a query expression to specify which elements from the data source will be returned. It applies a Boolean condition (predicate) to each source element referenced by the range variable, & returns those for which the specified condition is true. A single query expression may contain multiple where clauses and a single clause may contain multiple predicate subexpressions.

struct keyword

-1- is used to declare a value type that is typically used to encapsulate small groups of related variables, such as the coordinates of a rectangle or the characteristics of an item in an inventory. -1- can also contain constructors, constants, fields, methods, properties, indexers, operators, events, and nested types, although if several such members are required, you should consider making your type a class instead.

params keyword/modifier

When using -1- you can specify a method parameter array that takes a variable number of arguments. You can send a comma-separated list of arguments of the type specified in the parameter declaration or an array of arguments of the specified type. You may send no arguments, in which case the length of the list is zero. No additional parameters are permitted after using -1- in a method declaration.

private access modifier/keyword

This is a member access modifier & the least permissive. -1- access members are accessible only within the body of the class or struct in which they are declared. Nested types in the same body also have access.

explicit keyword

Declare a user-type conversion operator that must be invoked with a cast with -1-. The conversion operator converts from a source type to a target type; the source type provides the conversion operator. Mark a conversion operation with -1- if it can cause exceptions or lose information.

event keyword

Declare an -1- in a publisher class with -1-, which is a special kind of multicast delegate that can only be invoked from within the class or struct it is declared in. Can be marked with any access modifier, and can be abstract, static, virtual, or sealed.

Method or Delegate Invocation Operator

In the context of methods & delegates, the -2-, represented by parentheses ()'s, will cause them to be invoked. This operator cannot be overloaded.

Modifiers

-1- are used to modify declarations of types & type members. -1- include the access modifiers & abstract, async, const, event, extern, new, override, partial, readonly, sealed, static, unsafe, virtual, & volatile. Also includes the generic -1- in & out.

System.Enum

-1-.-1- is the base class for all enumerations in the .NET Framework, and provides methods for comparing instances of -1-.-1-, converting the value of an instance to its string representation, converting a string representation of a number to an instance of -1-.-1-, & creating an instance of a specified enumeration & value.

Expression Trees

-2- represent code in a tree-like data structure, where each node is an expression. Examples include a method call, or a binary operation such as x < y. You can compile and run code represented by -2-. This enables dynamic modification of executable code, the execution of LINQ queries in various databases, & the creation of dynamic queries.

EventWaitHandle Class

Form: public class -1-: System.Threading.WaitHandle.




Namespace: System.Threading




Inheritance: Object → MarshalByRefObject → WaitHandle → -1-




Attributes: ComVisibleAttribute




-1- represents a thread synchronization event. Allows threads to communicate with each other by signaling. Often one or more threads block on an -1- until an unblocked thread calls the Set method, releasing one or more of the blocked threads. -1- provides access to named system sync events. The behavior of an -1- that's been signaled depends on its reset mode. There are automatic reset events, which provide exclusive access to a resource, & manual reset events, which are like gates.

Cohesion

-1- refers to the degree to which the elements inside a module belong together. -1- is an ordinal type of measurement & is often described as either high or low -1-; modules with high -1- tend to be preferable because it can signal robustness, reliability, reusability, & understandability.

Thread.Sleep method

The -1- method suspends the current thread for the specified amount of time. It changes the state of the thread to include WaitSleepJoin. You can specify Timeout.Infinite for the milliseconds Timeout parameter, & this will suspend indefinitely but it is recommended to use Mutex, Monitor, Semaphore, or EventWaitHandle instead. An alternate overload method takes the Timespan type instead of int. Neither performs standard COM & SendMessage pumping.

Value Types

A variable of a -2- can only contain the value null if it is an nullable type. Assignment to a variable of a -2- creates a copy of the value being assigned. -2- include ▪ Struct Types ▪ Simple Types ▪ Nullable Types ▪ Enum Types

Identity Conversions

The -2- converts from any type to the same type. An -2- exists such that an entity that already has a required type can be said to be convertible to that type. Because object & dynamic are considered equivalent, there is an -2- between them and between constructed types that are the same when replacing all occurrences of dynamic with object.

Implicit Enumeration Conversions

An -3- permits the decimal integer literal 0 to be converted to any enum type and to any nullable type whose underlying type is an enum type. In the latter case, the -3- is evaluated by converting to the underlying enum type and wrapping the result.

ValueTask❬TResult❭ struct

The -1- struct provides a value type that wraps a Task and a TResult only one of which is used. It implements the interface IEquatable <-1->. A method may return an instance of this value type when it's likely that the result of its operation will be available synchronously, & when it's expected to be invoked so frequently that the cost of allocating a new Task for each call will be prohibitive. May be specified as an async method return type because of its GetAwaiter method.

① Microsoft Intermediate Language (MSIL)


② callvirt

(Note: two answers) A call to a static method generates a call instruction in ① -3- (abbr. -1-), whereas a call to an instance method generates a ② -1- instruction which also checks for null object references. Usually there isn't a performance difference between the two.




② -1- can be used to call virtual methods. ② -1- calls a late-bound method on an object, that is, the method is chosen based on the run-time type of the object, rather than the compile-time class visible in the method pointer.

type specifier/type suffix

While specifying any value, a variable, or a literal, you can append a specific character which is called a -2-. They can be used to unambiguously identify the data type:




L for long F for float U for uint


D for double M for decimal


UL for ulong

variables

-1- are names given to a storage area that the program can manipulate. Each has a specific type & it cannot be redeclared with a new type. -1- can be initialized at the time of declaration, or afterwards. It must, however, be definitely assigned. Seven categories exist: static, instance, value parameters, reference parameters, output parameters, and local -1-.

Tuple Projection Initializer

In general, -3- work by using the variable or field names from the right hand side of a tuple. If an explicit name is given, that takes precedence over any -3- name. For any field where an explicit name is not provided, an applicable implicit name will be projected. Note that there is no requirement to provide semantic names either explicitly or implicitly. The implicit names given will be Item1, Item2, and so on, There are two conditions where candidate field names are not projected onto the tuple field: ▪ When the field name is a reserved tuple name ▪ When the field name is a duplicate of another tuple field name, either implicit or explicit

Conversion Operators

-2- allow for conversions to be declared on classes or structs so that they can be converted to and/or from other classes, structs, or basic types. Conversions are defined like operators, and are named for the type to which they convert. Either the type of the argument to be converted, or the type of the result of the conversion, but not both, must be the containing types.

Escape Character

-2- are characters which, when used, invoke an alternative interpretation on subsequent characters in a sequence. -2- are a particular case of meta-characters. Whether something qualifies as an -2- depends on the context.

Digit Separators

-2- are a feature for enhancing readability by using the _ underscore character to break up numbers. They can be used with decimal, hex, & binary literals.




Ex: int intValue = 90_946

Variant/Variance

A generic interface or delegate is called -1- if its generic parameters are declared covariant or contravariant. C# enables creating custom -1- interfaces & delegates. -1- support enables implicit conversion of classes that implement certain interfaces. -1- in interfaces is only supported for reference types. Classes that support implementing -1- interfaces are not -1- themselves. The ref & out parameters cannot be -1-. However, you can declare -1- generic interfaces by using the in & out keywords for generic type parameters.

Directory Class

Form: public static class -1-.




Namespace: System.IO




Inheritance: Object → -1-




Attributes: ComVisibleAttribute




The -1- class exposes static methods for creating, moving, & enumerating through directories & subdirectories. These perform security checks on all methods, so if you are going to reuse an object several times, consider the corresponding instance method of DirectoryInfo instead.

byte-order mark (BOM)

The -3- (abbr. -1-) is an optional Unicode character, U+FEFF, whose appearance as a magic number at the start of a text stream can signal several things to a program consuming the text: ▪ what byte order or endianness the text stream is stored in ▪ the face that the text stream is in Unicode with a high degree of confidence ▪ which of several Unicode encodings that text stream is encoded as.

Extensible Application Markup Language (XAML)

-1- (full name -4-) is a declarative language that can initialize objects and set their properties, using a language structure that shows hierarchical relationships between multiple objects, and using a backing-type convention that's supports extension of types. You can create visible UI elements in the declarative -1- markup, & then associate a separate code-behind file for each -1- file can respond to events & manipulate the objects you originally declare in -1-. Supports interchange of source between different tools & roles.

Base Element Classes (in XAML)

Four key classes known as the -3- implement a substantial percentage of the common element functionality available in Windows Presentation Foundation (WPF) programming. These -3- are: ▪ UIElement ▪ FrameworkElement ▪ ContentElement ▪ FrameworkContentElement



The DependencyObject class is also closed related.

Monitor Class

Form: public static class -1-.




Namespace: System.Threading




Inheritance: Object → -1-




Attributes: ComVisibleAttribute.




The -1- class syncs access to a region of code by taking & releasing a lock on a particular project by calling the Enter, TryEnter, & Exit methods. Object locks provide the ability to restrict access to a block of code (AKA critical section). Features of the -1- class:


▪ Associated with an object on demand ▪ It is unbound, meaning it can be called directly from any context ▪ An instance of the class can't be created; all of its methods are static ▪ Each method is passed the synchronized object that controls access to the critical section

Timeout Class

Form: public static class -1-.




Namespace: System.Threading


Inheritance: Object → -1-


Attributes: ComVisibleAttribute




The -1- class contains constants that specify infinite time-out intervals. This class cannot be inherited. The members of this class are used to specify infinite time-out intervals in threading operations. Infinite is used by methods that accept an integer millisecondsTimeout parameter, such as Thread.Sleep(Int32), Thread.Join(Int32), and ReaderWriterLock.AcquireReaderLock(Int32). InfiniteTimeSpan is used by methods that accept a timeout parameter of type TimeSpan, such as Thread.Sleep(TimeSpan), Thread.Join(TimeSpan), and ReaderWriterLock.AcquireReaderLock(TimeSpan).

Pre-processing directives

Although the compiler doesn't have a separate preprocessor, these -2- are processed as if they were one. They are also used in conditional compilation. -2- must be the only instruction on a line. -2- are commands that are interpreted by the compiler & affect the output or behavior of the build process. They begin with the # symbol.

Symbol/Atom

A -1- is a primitive data type whose instances have a unique human readable form. They may be used as identifiers. Uniqueness is enforced by holding them in a -1- table. Their most common use is for performing language reflection; particularly for callbacks, & indirectly used as a way to create object linkages.

Unbounded type parameters

Type parameters that have no constraints are called -3-, and have these rules:




❶ The != and == operators cannot be used because there is no guarantee that the concrete type argument will support them.




❷ They can be converted to and from System.Object, or explicitly converted to any interface type.



❸ You can compare to null, which will always return false if the type argument is a value type.


① Closed Constructed Type


② Open Constructed Type

(Note: two answers) For a generic class, client code can reference the class either by specifying a type argument to create a ① -3-; or, it can leave the type parameter unspecified to create an ② -3-. Generic classes can inherit from concrete, ① -3-, or ② -3- base classes.

Command Pattern

In Object-Oriented Programming (OOP), the -1- behavioral pattern is that in which an object is used to encapsulate all information needed to perform an action or trigger an event later on. This information includes the method name, & the object that owns the method & values for the method's parameters. Four associated terms include: -1-, receiver, invoker, & client.

Software Architecture

-2- refers to the fundamental structures of a software system & the discipline involved in their creation. Each structure comprises software elements, relations among them, & properties of both elements & relations. -2- acts as a blueprint for the system & the developing project, laying required tasks out to be executed by design teams.

Array Initializer

An -2- may be specified in field declarations, local variable declarations, & array creation expressions. An -2- consists of a sequence of variable initializers, enclosed by { }'s, and separated by commas. Each variable initializer is an expression, or in the case of a multi-dimensional array, a nested -2-. The context determines the type of the -2-.

System.String Class

Form: public sealed class -1- : ICloneable, IComparable, IComparable, IConvertible, IEquatable, System.Collections.Generic.


IEnumerable




Namespace: System




Inheritance: Object → -1-




Attributes: ComVisibleAttribute, SerializableAttribute




The -1- class represents text as a sequence of UTF-16 code units (System.Char objects), which represent the -1- value (it is immutable, with max size 2GB or one-billion characters).

Hooking/Hook

The term -1- covers a range of techniques used to alter or augment the behavior of an OS, applications, or other software components by intercepting function calls, messages, or events passed between components. -1- is the term for the code that hands said function calls. -1- can assist in debugging, extend functionality, etc.




Examples: ▪ intercepting keyboard or mouse event messages before reaching an application ▪ intercepting OS calls in order to monitor behavior or modify the function of an application

① referential transparency


② referential opacity


(Note: two answers) ① -2- and ② -2- are properties of parts of computer programs. An expression is called ① -2- if it can be replaced with its corresponding value without changing the program's behavior. This requires that the expression be pure; that is, the expression value must be the same for the same inputs & its evaluation must have no side effects. If it is not pure, it is considered ② -2-. The importance of ① -2- is in allowing the programmer & compiler to reason about program behavior as a rewrite system. This can help in proving correctness & simplifying algorithms.

Flyweight Pattern

The -1- structural design pattern utilizes a -1- object to minimize memory usage by sharing as much data as possible with other similar objects. It is a way to use objects in large numbers when a simple repeated representation would squander memory. Often, some parts of the object state can be shared & held in external data structures & passed back to the objects temporarily when they are used. A classic example is the data structures for graphical representation of characters in a word processor.

① Implicit Nullable Conversion


② Explicit Nullable Conversion

(Note: two answers) For each of the predefined implicit identity and numeric conversions that convert from a non-nullable value type S to a non-nullable value type T, the following ① -2- conversions exist:


▪ From S? to T? ▪ From S to T?


Evaluation of an ① -2- conversion based on an underlying conversion from S to T proceeds as follows:


▪ If from S? to T? ▫ If the source value is null then the result is the null value of the type T? ▫ Otherwise, the conversion is evaluated as an unwrapping from S? to S, followed by the underlying conversion from S to T, then a wrapping from T to T?


▪ If the ① -2- conversion is from S to T? the conversion is evaluated as the underlying conversion from S to T, followed by a wrapping from T to T?. Additionally, for each of the predefined explicit conversions (the aforementioned implicits plus implicit enumeration & explicit numeric & enumeration) the same② -2- conversion exists plus one:


▪ from S? to T; in which case the conversion is evaluated as an unwrapping from S? to S, followed by the underlying conversion from S to T.

identifier

An -1- is the name assigned to a type (class, interface, enum, struct, or delegate), member, variable, or a namespace. Their name much adhere to convention. To prevent a conflict with keywords, prefix the -1- with the @ symbol.




Ex: int @value;

① #elif


② #if


③ #else


④ #endif

① -1- lets you create a compound conditional directive. The -1- expression will be evaluated if neither the preceding ② -1- nor any preceding ① -1- evaluates to true. If an ① -1- expression evaluates to true, the compiler evaluates all code between it and the next conditional directive. ① -1- is equivalent to using the ③ -1- ② -1- directives, but is simpler because it doesn't require an ④ -1-.

Syntax Trees

-2- are a fundamental data structure exposed by the compiler APIs. -2- represent the lexical & syntactic structure of source code, and serve two important purposes:




▪ to allow tools such as an IDE, add-ins, code analysis tools, & refactorings to see & process the syntactic structure of source code in a user's project


▪ to enable tools such as IDE & refactorings to create, modify, & rearrange source code in a natural manner without having to use direct text edits


Deep Copy

-2- is a technique by which a copy of an object is created such that it contains copies of both instance members and the objects pointed to by reference members. -2- is intended to copy all the elements of an object, which includes value types & reference types, to a memory location that contains data rather than the data itself. -2- is used in scenarios where a new copy (clone) is created without any reference to original data. To implement -2-:




▪ the object has to be well-defined, not arbitrary


▪ properties won't be considered


▪ cloning has to be automated with intelligence

Directional Attributes

-2- are tags used to specify object method parameters with information related to the directional flow of data between the caller and callee. -2- control marshalling of the method parameters direction & return values. -2- are applied to modify run-time marshalling while communicating managed code, which is executed by the Common Language Runtime (CLR), and unmanaged code, which is executed outside the CLR's control. The two -2- used to map to COM's Interface Definition Language are InAttribute & OutAttribute.

Type Constraints

When you define a generic class, you can apply restrictions to the kinds of types that client code can use for type arguments when it instantiates your class. These are called -2-, and are specified by using where.




If you want to examine an item in a generic list to determine whether it is valid, or compare it to another item, the compiler must have some guarantee that the operator or method it has to call will be supported by any type argument that might be specified by client code. This guarantee is obtained by applying one or more -2- to your generic class definition. It tells the compiler that only objects of this type or derived from it will be used as a type argument.

Reification

-1- is the process by which an abstract idea about a program is turned into an explicit data model, or other object, created in a programming language. A computable/addressable object, a resource, is created in a system as a proxy for a non-computable/addressable.




By means of -1-, something that was previously implicit, unexpressed, & possible inexpressible, is explicitly formulated & made available to conceptual manipulation. Informally, -1- is often referred to as making something a first-class citizen within the scope of a particular system.

Memoization

-1- is an optimization technique used primarily for speeding up programs by storing the results of expensive function calls & returning the cached result when the same inputs occur again. This can be done in C# by using a lookup table. You can -1- multiple argument methods, which helps if there are few variants on most of the arguments. -1- is most effective on programs that repeatedly call a self-contained method with a small number of arguments.

Dispose Pattern

The -1- pattern is for resource management, & is used when a resource is held by an object & is then released by calling a method. Language constructs help to avoid explicitly calling this method in common situations. The -1- pattern may be styled as manual resource management in languages with automatic garbage collection. IDisposable should be implemented (in .NET) only if your type uses unmanaged resources directly.

self-referential class/object

A -2- class contains a reference member that refers to an object of the same class type. -2- objects can be linked together to form useful data structures, such as: lists, queues, stacks, & trees.

Solution

A -1- is the top-level definition of a project. Each -1- may contain one or more Project Files (not to be confused with the project you're working on itself), each of which gets compiled into a single binary. Each project may have its own dependencies too, whether they be a: core standard library, another project, or a NuGet package.

Assertion/Asserting

An -1- helps to make sure that a method has access to a particular resource even if the method's callers don't have the required permission. During a stack walk, if a stack frame -1- the required permission is encountered, a security check for that permission will succeed. An -1- can create security holes and should only be used with extreme caution.

Context

A -1- is an ordered sequence of properties that defines an environment for the objects resident in it. A -1- is created during the activation process for objects that are configured to require certain automatic services, such as: synchronization, transactions, just-in-time activation, security, and so on. Multiple objects can live in a -1-.

① Watson bucket


② bucket

(Note: two answers) A ② -1- is most commonly a type of data buffer or a type of document in which data is divided into regions. In the Common Language Runtime (CLR) ① -2- are used to group crash reports that are sent back to Microsoft. In case of unhandled managed exceptions, it is based upon nine details that the CLR collects:


▪ Application Name


▪ Application Build Date


▪ Module Name


▪ Module Version


▪ Module Build Date


▪ OS Exception Code/System Error Code


▪ Module Code Offset



Ideally, each ② -1- contains crash reports that are caused by the same bug.






① Modal Window


② Mode

(Note: two answers) In UI design a ① -2- is a graphical control element subordinate to an application's main window. It creates a ② -1- that disables the main window, but keeps it visible with the ① -2- as a child window in front of it. Users must interact with the ① -2- before they can return to the parent application.

① Kernel


② System Call

(Note: two answers) The ① -1- is a program with complete control over a computer's OS, & is usually one of the first to load. It handles the rest of startup, & I/O requests from software, translating them into data-processing instructions for the CPU. The ① -1- handles memory & peripheral devices. When a process makes a request of the ① -1-, it's called a ② -2-.

① Message Loop / Pump


② Message Queue


③ Message

The ① -2- is an obligatory section in every program using a GUI in Windows. All such programs are event-driven. Windows maintains an individual ② -2- for each thread that has created a window, then places a ③ -1- into that ② -2- when activity occurs. Each thread must continuously retrieve ③ -1- from its ② -2- & act on them. A programmer creates an indefinite loop to enact this process called the ① -2-.

Friend Assembly

A -2- is an assembly that can access another assembly's internal types & members. If identified as a -2-, you no longer have to mark types & members as public for them to be accessed by other assemblies. You can use the InternalsVisibleToAttribute attribute to identify one or more -2- for a given assembly.

① immutable type


② mutable type

An ① -2- is a type whose instance data, fields, & properties do not change after the instance is created. Most value types are ① -2-.




A ② -2- is a type whose instance data, fields, & properties can be changed after the instance is created. Most reference types are ② -2-.

① goto case


② goto default

When execution of a switch section is to be followed by execution of another switch section, either an explicit ① -2- or ② -2- statement must be used.

Exception Propagation

When an exception is thrown, control is transferred to the first catch clause in an enclosing try statement that can handle the exception. The process that takes place from the point of the exception being thrown to the point of transferring control to a suitable exception handler is known as -2-.

Generic Interface

The preference for generic classes is to use -2- in order to avoid boxing & unboxing operations on value types. The .NET Framework class library defines several -2- for use with collection classes in the System.Collections.Generic namespace. When specified as a constraint on a type parameter, only types that implement the -2- can be used. Multiple -2- can be specified as constraints on a single type. A -2- can define more than one type parameter.

① IEnumerable


② IEnumerator


(Note: both can be generic as well)

(Note: two answers) The ① -1- interface exposes an enumerator which supports a simple iteration over a non-generic collection. ① -1- is the base interface for all non-generic collections that can be enumerated, & contains a single method GetEnumerator, which returns an ② -1-. ② -1- provides the ability to iterate through the collection by exposing a Current property & methods MoveNext & Reset. It is a best practice to implement ① -1- & ② -1- on your collection classes to enable the foreach syntax. Enumerators can be used to read the data in a collection, but not to modify it.

finally keyword

By using the -1- block, either with both try-catch blocks, or just with a try block, you can clean up any resources that are allocated by the try block, & you can run code even if an exception occurs in it. Typically runs when control leaves a try statement, but can occur as a result of normal execution.

fixed keyword/statement

The -1- statement prevents the garbage collector from relocating a movable variable, & is only viable in an unsafe context. The -1- statement can also be used to create -1- size buffers. The -1- statement sets a pointer to a managed variable & "pins" it during execution. Without it, these pointers would be of no use since garbage collection moves variables unpredictably.

Common Language Specification (CLS)

To enable full interoperability scenarios, all objects that are created in code must rely on some commonality in the languages that call them. Since there are many languages, .NET specifies those commonalities in the -3- (abbr. -1-), which defines a set of features that are needed by many common applications. It can provide a sort of recipe for any language implemented on top of .NET on what to support.

① Blittable Types


② Blittable

(Note: two answers) ① -2- are data types in .NET that have an identical presentation in memory for both managed and unmanaged code. These can aid in using COM Interop or P/Invoke. Specifically, ② -1- expresses whether it is legal to copy an object using a block transfer.


Object.GetHashCode

A hash code is a numeric value that is used to insert & identify an object in a hash-based collection such as Dictionary. The -1- method provides this hash code for algorithms that need quick checks of object equality. Two objects that are equal return hash codes that are equal; however, equal hash codes does not imply the reverse. Consequently, you should never persist or use a hash code outside the application domain of its origin.

JavaScript Object Notation (JSON)

-3- (abbr. -1-) is an open-standard file format that uses human readable text to transmit data objects consisting of attribute-value pairs & array data types (or any other serializable value). It's a very common data format used for async browser-server communication, including as a replacement for XML in some AJAX-style systems.

continue keyword

The -1- statement passes control to the next iteration of the enclosing while, do, for, or foreach statement in which it appears.

throw keyword

Using -1- signals the occurrence of an exception during program execution. Method callers then use a try-catch or try-catch-finally block to handle the exception. -1- can also be used to -1- again in a catch block.

break keyword

The -1- statement terminates the closest enclosing loop or switch statement, & control is passed to the statement following the terminated statement, if any.

internal access modifier/keyword

The -1- access modifier designates types or members that are accessible only within files in the same assembly. A common use is in component-based development, because it enables a group of components to cooperate in a private manner without being exposed to other code.

as operator/keyword

The -1- operator can perform certain types of conversions between compatible reference or nullable types. It acts like a cast operation, but if conversion isn't possible, then it returns null instead of an exception. Only performs reference, nullable, & boxing conversions. User-defined conversions should use the cast expression instead.

protected access modifier/keyword

The -1- access modifier denotes a member that is accessible within its class & by derived class instances. A -1- member of a base class is accessible in a derived class only if the access occurs through the derived class type.

public access modifier/keyword

The -1- member access modifier denotes the most permissive access level for members & types. There are no restrictions for accessing members of this type.

&


② address of

(Note: two related answers) The unary ① -1- (the symbol) operator returns the ② -2- its operand. The operand of the ① -1- operator must be a fixed variable, which are variables that reside in storage locations that are unaffected by operation of the garbage collector. That means obtaining the ② -2- of a movable variable is only valid inside a fixed block.

Memory Address

A -2- is a reference to a specific memory location used at various levels by hardware & software. -2- are fixed length sequences of digits, conventionally displayed & manipulated as unsigned integers. Such numerical semantics bases itself upon features of the CPU as well as upon use of the memory like an array, endorsed by various programming languages. -2- can be physical, or logical/virtual.

Caller Information Attributes

By using -3-, you can obtain information about the caller to a method, obtain the file path of source code & its line number, and the member name of the caller. This is helpful for tracing, debugging, and creating diagnostic tools. These -3- are applied to optional parameters, each with default values, & in the System.Runtime.CompilerServices namespace.

Exception.StackTrace Property

Form: public virtual string -1- { get; }




Namespace: System




The -1- property gets a string representation of the immediate frames on the call stack. The execution stack keeps track of all the methods that are in execution at a given instant. The -1- property returns the frames of the call stack that originate at the location where the exception was thrown. Additional frames information can be obtained by an instance of the System.Diagnostics class, & using the ToString method on -1- property. The CLR updates the -1- property whenever an exception is thrown.

Return Task

Invocation of a task returning async function causes an instance of the returned task type to be generated. This is called the -2- of the function, which is initially in an incomplete state. The async function body is then evaluated until it is either suspended by reaching an await expression, or terminates, at which point control is returned to the caller, along with the -2-, & the -2- is moved out of the incomplete state.

||


② conditional logical-OR

The ① -1- (its symbol) operator performs a ② -2- of its bool operands. If the 1ˢᵗ operand evaluates to false, then the 2ⁿᵈ operand determines whether the expression as a whole evaluates to true or false. If the 1ˢᵗ operand evaluates to true, then the 2ⁿᵈ isn't evaluated due to Boolean short-circuit evaluation.

① stateful


② state

A program is described as ① -1- if it is designed to remember preceding events or user interactions; the remembered information is called the ② -1- of the system. The set of ② -1- a system can occupy is its ② -1- space. In a discrete system, the ② -1- is countable & often finite, & the system's internal behavior or interaction with its environment consists of separately occurring individual actions or events, such as accepting input or producing output, that may or may not cause the system to change its ② -1-.

Binding

-1- is an action that depends on the stage in which it occurs - early or late. Early -1- describes that the compiler knows about what kind of object it is & its methods & properties, so that as soon as the object is declared, it can have those methods & properties populated. Late -1- means that the compiler doesn't have this information, & after declaration you'll later need to get the object's type, methods, etc. Everything will be known at run-time.

System.ActionDelegate / Action delegate

Form: public delegate void -1-




Namespace: System




Inheritance: Object → Delegate → -1-




The -1- delegate encapsulates a method that has no parameters, and doesn't return a value. You can use -1- delegate to pass a method as a parameter without explicitly declaring a custom delegate. The encapsulated method must correspond to the method signature defined by the -1- delegate, so it must have no parameters/return value (void).

breakpoint

A -1- is an intentional stop marked in the code of an application where execution pauses for debugging. This allows the programmer to inspect the internal state of the application. This is more efficient than going line-by-line. When the -1- is hit, the application & debugger are said to be in break mode, which allows you to:


▪ inspect values of local variables set in the current block of code in a separate local window


▪ terminate single or multi-app execution, etc.


① #line


② #line hidden


③ #line filename


④ #line default

① -1- lets you modify the compiler's line number & optionally the file name output for errors & warnings. It might be used in an automated, intermediate step in the build process.




② -1- hides the successive lines from the debugger such that when you step through the code, any lines between a ② -1- & the next ① -1- will be stepped over. ② -1- doesn't affect file names or line numbers in error reporting.




③ -1- specifies the file name you want to appear in compiler output. By default the actual name of the source code file is used. The name must be in double quotes & preceded by a line number.




④ -1- returns numbering to its default.

Lifted operators

-2- permit predefined & user-defined operators that operate on non-nullable value types to also be used with nullable forms of those types. -2- are constructed from predefined & user-defined operators that meet certain requirements; based on whether they are unary, binary, equality, or relational operators, those requirements are slightly different.

Type Inference

When a generic method is called without specifying type arguments, a -2- process attempts to determine the type arguments for the call. The presence of -2- allows a more convenient syntax to be used for calling a generic method & allows the programmer to avoid specifying redundant type information.

Creational Patterns

-2- are designed to deal with object creation mechanisms trying to create objects in a manner suitable to the situation. The basic form of object creation could result in design problems or in added complexity to the design. -2- solve this problem by somehow controlling this object creation. They are also classified as object -2- & class -2-. -2- are composed of two dominant ideas:


⍟ encapsulating knowledge about which concrete classes the system uses


⍟ hiding how instances of these concrete classes are created and combined


Algorithm

An -1- is an unambiguous specification of how to solve a class of problems. -1- can perform calculations, data-processing, and automations of reasoning tasks. An -1- is an effective method that can be expressed within a finite amount of space & time, and in a well-defined formal language.

① Implicit Dynamic Conversion


② Explicit Dynamic Conversion

(Note: two related answers) The ① -2- & ② -2- conversions exist from an expression of type dynamic to any type T. The conversion is dynamically bound, meaning a conversion will be sought at run-time from the run-time type of the expression to T. If no conversion is found, a run-time exception is thrown. The expression can also be first converted to object and then to the designed type.

① Left Shift Operator


② Right Shift Operator

(Note: two related answers)


The ① -2- operator (<<) shifts its first operand left by the number of bits specified by its second operand. The type of the 2ⁿᵈ operand must be an int or a type that has a pre-defined implicit numeric conversion to int.


The ② -2- operator (>>) shifts its 1ˢᵗ operand right by the number of bits specified by its 2ⁿᵈ operand. User-defined types can overload either operator; the type of the 1ˢᵗ operand must be user-defined, & 2ⁿᵈ must be int. Its corresponding assignment operator will be implicitly overloaded.

Generic Delegate

A -2- can define its own type parameters. Code that references the -2- can specify the type argument to create a closed constructed type, just like when instantiating a generic class or calling a generic method.


The feature, method group conversion, which applies to concrete & -2- types, enables a simplified syntax. -2- defined within a generic class can use the generic class type parameters in the same way that class methods do. -2- are especially useful in defining events based on the typical design pattern, because the sender argument can be strongly-typed.

Method Group

A -2- is an expression classification that is a set of overloaded methods resulting from a member lookup. A -2- may have an associated instance expression, & an associated type argument list. When an instance expression is invoked, the result of its evaluation becomes the instance represented by this. A -2- is viable in either an invocation or delegate create expression, & as the left-hand side of an is operator, & can be implicitly converted to a compatible delegate type.

Task Parallel Library (TPL)

The -3- (abbr. -1-) is based on the concept of a task, which represents an asynchronous operation. In some ways, a task resembles a thread or ThreadPool work item, but at a higher level of abstraction. The term task parallelism refers to one or more independent tasks running concurrently. Tasks provide two primary benefits:




⍟ more efficient and more scalable use of system resources



⍟ more programmatic control than is possible with a thread or work item

① async-await syntax


② async


③ await

The combined①-2- syntax makes use of asynchrony, which is essential for activities that are potentially blocking, by defining ② -1-methods. In the signature is the ② -1- modifier, a Task<> return type, & the method name which ends with ②"-1-". Next is a reference to System.Net.Http to declare a client. A Task is returned by the appending GetStringAsync to the client. Any independent work can then be done, followed by the ③ -1- operator.

① ISerializable interface


② SerializableAttribute Class


③ SerializationInfo Class

(Note: three answers) The ① -2- allows an object to control its own serialization & deserialization. Part of the System.Runtime.Serialization namespace.


Any class that might be serialized must be marked with the ② -1-.


The Formatter calls the GetObjectData method to populate the supplied ③ -1- with data to represent the object. Formatter creates ③ -1- with the type of the object in the graph. ③ -1- stores all the data needed to serialize or deserialize an object.


① Scheduling


② Scheduler

(Note: two closely related answers) The method by which work is assigned to resources that complete it is called ① -1-. Work may be virtual computation elements such as threads, processes, or data flows, which ① -1- uses on hardware resources.



A ② -1- carries out ① -1- activity, & they are often used to keep all CPU resources busy (as in load balancing), allowing multiple users to share resources effectively. ① -1- is fundamental to computation itself, and makes it possible to have computer multitasking with a single CPU.

Math Class

Form: public static class -1-




Namespace: System




Inheritance: Object → -1-




The -1- class provides constants and static methods for trigonometric, logarithmic, & other common mathematical functions.

Member Lookup

A -2- is the process whereby the meaning of a name in the context of a type is determined. A -2- can occur as part of evaluating a simple name or a member access in an expression. If either the simple name or member access occurs as the primary expression of an invocation expression, the member is said to be invoked. If a member is a method or event, or if it is a constant, field, or property of either a delegate type, or the type dynamic, then the member is said to be invokable. -2- also considers the number of type parameters & accessibility.

Jagged Array

This is an array whose elements are arrays. The elements of a -1- array can be of different dimensions & sizes. Before you can use a -1- array, its elements must be initialized. Since a -1- array is an array of arrays, its elements are reference types that are initialized to null. -1- arrays can be mixed with multi-dimensional arrays.




Ex: int [][] arr = new int [3][]

Delegates

A -1- is a type that safely encapsulates a method. They are object-oriented, type-safe, & secure. A -1- object is normally constructed by providing the name of the method the -1- will wrap, or with an anonymous method. Once instantiated, a method call made to the -1- will be passed by the -1- to that method. The parameters passed to the -1- are also passed to the method, & the return value, if any, from the method is returned to the caller. The type of a -1- is defined by its name.




Ex: public -1- void Name(string message);

sealed modifier/keyword

When applied to a class, the -1- modifier prevents other classes from inheriting from the -1- class. This can also be used on a property or method that overrides a virtual method/property in a base class. This enables you to allow classes to derive from your class, and prevent them from overriding specific virtual methods/properties. When applied to a property/method, this modifier must be used with override. Structs are implicitly -1-.

short keyword

The -1- type denotes an integral data type.




Range: ±32,768


Size: Signed 16-bit integer


NET Type: System.Int16


Default Value: 0




A -1- variable can be assigned a decimal, binary, or hex literal. A cast must be used when calling overloaded methods & ensuring the correct type is called.




There is a pre-defined implicit conversion from -1- to int, long, float, double, or decimal, but not vice-versa unless a cast is used.


① Null-coalescing operator


??

The ① -2- operator returns the left-hand operand if the operand is not null; otherwise it returns the right-hand operand. Represented by the ②-1- notation. A nullable type can represent a value from the type's domain, or the value can be undefined or null.

Lambda Operator (=>)

In this context, the => stands for the -1- operator, where it separates the input variables from the lambda body. It has the same precedence as the == (equality) operator, & is right-associative.

extern modifier/keyword

The -1- modifier is used to declare a method that is executed externally. It is often used with the DllImportAttribute when using Interop services to into unmanaged code. In this case, the static modifier must also be used on the method. Also defines an external assembly alias.

else keyword

Used within an if statement to define an alternate -1- statement to be executed should the if statement evaluate to false.

static modifier/keyword

The -1- modifier declares a -1- member which belongs to the type itself, rather than to a specific object. -1- can be used with classes, fields, methods, properties, operators, events, & constructors, but not with indexers, finalizers, or types other than classes. If -1- is applied to a class, all of its members must also be -1-. It's not possible to use this access to reference -1- methods or property accessors. To refer to a -1- member, use the fully qualified name.

string type/keyword

The -1- type represents a sequence of zero or more Unicode characters. Although it is a reference type, the equality operators (==, !=) are defined to compare the values of -1- objects, not references, which makes it more intuitive. The + operator concatenates -1- objects. A -1- is also immutable, meaning you can't actually change them; rather a new one is created.

Member Access operator (.)

Symbolized by the . token, this operator is used for -2-. It specifies a member of a type or namespace. It can also be used to form qualified names which specify to whom they belong. The using directive makes them optional.

Indexer Operator

Square brackets, [], are typically used for array, indexer, or pointer element access. An array's elements are accessed by placing the index of the element in []. The -1- operator cannot be overloaded, but types can define indexers & properties that take one or more parameters. Indexer parameters, also in [], can be declared to be of any type. [] are also used to specify attributes, and to index off a pointer.

① State Pattern


② Finite-state Machine

The ① -1- behavioral pattern allows an object to alter its behavior when its internal ① -1- changes. It can also be interpreted as a strategy pattern, which can switch strategy by invoking methods defined in its interface. It is closely related to the concept of the ② -2- machines. The ① -1- pattern is used to encapsulate various behaviors for the same object, based on its internal ① -1-. ① -1- - specific behavior should be defined independently. Adding a new ① -1- shouldn't affect the behavior of an existing ① -1-.





A ② -2- machine is a mathematical model of computation. It is an abstract machine that can be in exactly one of a finite number of ① -1- at any given time. The ② -2- machine can change from one ① -1- to another in response to some external inputs and/or a condition is satisfied; the change from one ① -1- to another is called a transition.

Abstraction Layer/Level

In computing, an -2- (AKA-2-) is a way of hiding the working details of a subsystem, allowing the separation of concerns to facilitate interoperability & platform independence.




In computer science, an -2- is a generalization of a conceptual model or algorithm, away from any specific implementation. These generalizations arise from broad similarities that are best encapsulated by models expressing similarities present in varying specific implementations.

readonly modifier/keyword

-1- is a modifier that can be used on fields, so assignments to them can only occur as part of the declaration or in a constructor in the same class. For an instance field, in a instance constructor of the class that contains the field declaration, you can use -1- to assign a value.

ref parameter/modifier/keyword

-1- is used in four contexts:




❶ in a method signature & in a method call to pass an argument to a method by reference


❷ also in a method signature to return a value to the caller by reference


❸ in a member body to indicate that a reference value is stored locally as a reference that the caller intends to modify


❹ in a struct declaration to declare a -1- struct or a readonly -1- struct

enum type/keyword

-1- declares an enumeration; a distinct type that consists of a set of named constants called the enumerator list. Usually best defined directly within a namespace, so all its classes can access with equal convenience, but may also be nested in a class or struct.

false operator/keyword

-1- is used in two contexts:




❶ used as an overloaded operator, -1- returns the Boolean value true to indicate the operand is false, & returns false otherwise, although nullable value types are preferable to use.




❷ used as a literal it simply represents the Boolean value false

① labeled


② expression statement


③ declaration


④ embedded


⑤ block


⑥ empty


⑦ jump


⑧ selection


⑨ iteration


⑩ try


⑪ checked


⑫ unchecked


⑬ lock


⑭ using


⑮ yield


⑯ embedded statement unsafe

(Mega-challenge - 16 answers) Name the sixteen kinds of statements.

① value


② variable


③ namespace


④ type


⑤ method group


⑥ null literal


⑦ anonymous function


⑧ property access


⑨ event access


⑩ indexer access


⑪ nothing

(Mega-challenge - 11 answers) Name the eleven kinds of expressions.

Arity

The -1- of a function or operation is the number of arguments or operands that the function/operation takes. There is often a syntactical distinction between functions & operators; syntactical operators usually have an -1- of 0, 1, or 2 (the ternary ?: operator is also common). Functions vary widely in number of arguments, though large numbers can become unwieldy.

Boolean Short-circuiting

-3- is the semantics of some Boolean operations in which the 2ⁿᵈ argument is executed or evaluated only if the 1ˢᵗ argument doesn't suffice to determine the value of the expression. -3- operators are in effect control structures rather than simple arithmetic operators as they aren't strict. This can help prevent expensive calculations from running when unnecessary & stop execution where a run-time error may occur.

Collections/Collection

There are two ways to create & manage groups of related objects: arrays and -1-. While arrays are best for creating & working with a fixed number of strongly-typed objects, -1- allow the object group to grow & shrink dynamically as the application's needs change.




For some -1- you can assign a key to any object you put in the -1- so it can be quickly retrieved. A -1- is a class, so you must declare an instance before adding elements to it. If the -1- contains elements of only one data type, you can use generic classes. A generic -1- enforces type-safety, so no other type can be added.

Lists/List❬T

A -1- represents a strong-typed -1- of objects that can be accessed by index, & provides methods to search, sort, & manipulate -1-.




It is part of the System.Collections.Generic namespace. It is an object which holds variables in a specific order. The type of variable that the -1- can store is determined by generic syntax.




-1- are dynamically-sized, so if you don't know the amount of variables an array should hold, use a -1- instead. Once initialized, you can use Add to insert items, AddRange to add an entire array, Remove to remove an item, RemoveAt to specify the index of the item to remove from the -1-.

Two's Complement

-2- is a math operation on binary numbers best known for its role in computing as a method of signed number representation and is the most important example of a radix complement.




The -2- of an N-bit number is defined as its complement with respect to 2ᴺ. For instance, for the three-bit number 010, the -2- is 110 because combined they equal 1000. In this scheme, if the binary number 010 encodes the signed integer 2 then its -2- 110 encodes the inverse -2₁₀.


① Static Variables


② Instance Variable


③ Array Elements


④ Value Parameters


⑤ Reference Parameters


⑥ Output Parameters


⑦ Local Variables

(Note: seven answers) Name the seven variable types.

Shallow Copy

A -2- is the process of creating a clone of an object by instantiating a new instance of the same type as the original object & copying the non-static members of the existing object to the clone. The members of the value type are copied bit-by-bit, while the reference type members are copied such that the referred object and its clone refer to the same object. -2- is used when performance is key & the condition that the object not be mutated throughout the application.

Shim

Two contexts:




❶ A -1- is a template class that is derived from a base class with derived classes that inherit the data & behavior of the base class, and vary only in the type.




❷ A -1- modifies the compiled code of your app at run-time so that instead of making a specified method call it runs the -1- code that your test provides. -1- can be used to replace calls to assemblies that you can't modify, such as .NET assemblies.

Patterns

-1- test that a value has a certain shape & can extract information from the value when it matches. -1- matching provides more concise syntax for algorithms you already use today, such as if or switch statements; the new syntax are is and switch. -1- matching enables idioms where data & code are separated, unlike those structured in a class hierarchy. These rules mean you are unlikely to accidentally access the result of a -1- match expression when that -1- is not met.

in modifier/keyword

The -1- modifier is used to pass arguments to a method by reference. The -1- modifier specifies that you are passing the parameter by reference and the called method doesn't modify the value passed to it. The -1- modifier may be applied to any member that takes parameters: methods, delegates, lambdas, local functions, indexers, & operators. You may use literal values or constants for the argument, & you don't need to apply the -1- modifier at the call site.

Barrier Class

Form: public class -1- : IDisposable




Namespace: System.Threading




Inheritance: Object → -1-




Enables multiple tasks to cooperatively work on an algorithm in parallel through multiple phases. Each in the group signals it has arrived at the -1- in a given phase and implicitly waits for all the others to arrive. The same -1- can be used for multiple phases.

① Actor Model of Concurrency


② actor

(Note: two related answers) The ① -4- is a mathematical model of concurrent computation that treats ② -1- as the universal primitives of concurrent computation. In response to a message that it receives, an ② -1- can:




▪ make local decisions


▪ create more ② -1-


▪ send more messages


▪ and determine how to respond to the next message received





② -1- may modify their own private state, but can only affect each other through messages, which avoid the need for any locks.


Parameter Arrays

A -2- permits a variable number of arguments to be passed to a method & is declared with the params modifier. Only the last parameter of a method can be a -2-, & the type of a -2- must be a single-dimensional array type. The Write & WriteLine methods of the System.Console class are good examples of -2- usage.

DateTime struct

Form: public struct -1- : IComparable, IComparable<-1->, IConvertible,


IEquatable<-1->, IFormattable, System.Runtime.Serialization.


ISerializable




Namespace: System




Inheritance: Object → ValueType → -1-




Attributes: SerializableAttribute




The -1- struct represents an instant in time, typically expressed as a date & time of day. The -1- struct has values ranging from 00:00:00 January 1, 0001 Anno Domini through 11:59:59 P.M., December 31, 9999 A.D. in the Gregorian calendar.




Time values are measured in 100-nanosecond units called ticks. A -1- value is always expressed in the context of an explicit or default calendar. You can create a new -1- value by:


▪ calling any overloads of the -1- constructor


▪ using compiler-specific syntax


▪ assigning a -1- object a date & time value returned by property or method

First-Class Citizen

A -3- is an ambiguous term whose exact meaning shifts from language to language. Generally, a language construct is said to be a -3- value in that language when there are no restrictions on how it can be created & used.




-3- features can be stored in variables, passed as arguments to methods, created within methods, & returned from methods. The C# reflection library provides some -3- types.

Generic Classes

-2- encapsulate operations that are not specific to a particular data type. Commonly used with collections like linked lists, hash tables, stacks, trees, queues.




You can create -2- by starting with an existing concrete class, & changing types into type parameters one at a time, until you reach the optimal balance of generalization & usability.

Assembly Manifest

An -2- is an integral part of every assembly that renders it as self-describing. The -2- contains the assembly's metadata. It establishes the identity, composition files of the implementation, & specifies the types & resources that make up the assembly. Also, it itemizes the compile-time dependencies on other assemblies, & specifies the set of permissions required for the assembly to run properly. This information is used at run-time to resolve references, enforce binding policy, & validate the integrity of loaded assemblies.

Context Property

A -2- is the implicit state & code to managed that state, held on behalf of an object instance. For example, the transaction -2- holds the transaction identifier of the transaction that the object is participating in.

TimeSpan struct

Form: public struct -1- : IComparable, IComparable<-1->, IEquatable<-1->, IFormattable




Namespace: System




Inheritance: Object → ValueType → -1-




Attributes: ComVisibleAttribute, SerializableAttribute




The -1- struct represents a time interval, which is a duration of time or elapsed time that is measured as ± number of days, hours, minutes, seconds, and fractions of a second.




The -1- struct can be used to represent the time of day, but only if the time is unrelated to a particular date; otherwise, the DateTime or DateTimeOffset structs should be used.




The largest unit of time that the -1- struct uses to measure duration is a day because larger units are inconsistent.

Value Types

The -2- consist of two main categories: structs & enumerations. Structs fall into these categories:



⍟ Numeric Types


○ Integral Types


○ Floating-point Types


○ Decimal Type


⍟ bool Type


⍟ User-defined structs




Main features of -2- include:



▪ variables that are based on -2- directly contain values


▪ assigning one -2- variable to another copies the contained value


▪ you cannot derive a new type from a -2-, but structs can implement interfaces


▪ -2- cannot contain the null value, but nullable types allow -2- to be assigned to null


▪ Each -2- has an implicit default constructor








① Subtyping


② subtype


③ superset

(Note: three answers) In programming language theory, ① -1- is a form of type Polymorphism in which a ② -1- is a data type that is related to another data type (called the ③ -1-) by some notion of substitutability; meaning that program elements, typically methods, written to operate on elements of the ③ -1- can also operate on elements of the ② -1-. If S is a ② -1- of T, the ① -1- relation is often written S <᠄ T to mean that any term of type S can be safely used in a context where a term of type T is expected.




The precise semantics of ① -1- crucially depends on the particulars of what "safely used in a context where" means in a given programming language, since the type system of each language defines its own ① -1- relation.






"is-a" relationship

The -3- is a subsumption relationship between abstractions (i.e. - types, classes) wherein one class A is a subclass of another class B (and so B is a superclass of A). In other words, type A is a subtype of type B when A's specification implies B's specification. That is, any object (or class) that satisfies A's specification also satisfies B's specification because B's specification is weaker.




Subtyping enables a given type to be substituted for another type or abstraction, which establishes an -3- that can be expressed via Inheritance either implicitly or explicitly.

Observer Pattern

The -1- pattern involves an object called the subject that maintains a list of its dependents, called -1-, & notifies them automatically of any state changes, usually by calling one of their methods.




The -1- pattern is mainly used to implement distributed event handling systems. It also plays a key role in the MVC pattern.

Windows Shell

The -2- is the term for the MS Windows OS. Its readily identifiable elements includes the:




▪ Desktop ▪ Taskbar


▪ Start Menu ▪ Action Center


▪ and more. . .




In Windows 10, the -2- Experience Host Interface drives visuals & also implements a namespace that enables CPU programs running on Windows to access the CPU's resources via the hierarchy of -2- objects of which the "Desktop" is the top. Below it are a number of files & folders stored on the disk, as well as special folders whose contents are either virtually or dynamically created.

Local Functions

C# 7 introduced -2-, which are private methods of a type that are nested in another member. They can only be called by their containing member. -2- can be declared in and called from:




▪ methods, especially iterator & async methods


▪ constructors


▪ property & event accessors


▪ anonymous methods


▪ lambda expressions


▪ and finalizers

Method Overloading

-2- occurs when multiple methods have the same name, but different parameters. The definitions of the methods must different from each other by the types and/or number of parameters.




When it is in effect, -2- specifies that the method called is based on the arguments.

Reflection

-1- provides objects (of type Type) that describes assemblies, modules, & types. You can use -1- to dynamically create an instance of a type, bind the type to an existing object, or get the type from an existing object and invoke its methods or access its fields and properties. If you are using attributes in your code, -1- enables you to access them.




-1- is useful in these situations:




▪ when you have to access attributes in your program's metadata


▪ for examining and instantiating types in an assembly


▪ for building new types at runtime by using classes in System.-1-.Emit


▪ for performing late binding, accessing methods on types created at run-time

Native code

-2- is machine code executed directly by the computer. This doesn't run under the Common Language Runtime (CLR) as opposed to managed code, which does run under the CLR's control.




It is possible to interoperate between these two types by use of Platform Invoke (P/Invoke) and COM interoperation. The C++/CLI programming language lets you access managed components from -2-, but there are performance penalties often involved.

DLLImportAttribute Class

Form: public sealed class -1- : Attribute




Namespace: System.Runtime.InteropServices




Inheritance: Object → Attribute → -1-




Attributes: AttributeUsageAttribute, ComVisibleAttribute




The -1- provides the information needed to call a function exported from an unmanaged DLL. At a minimum, you must supply the name of the DLL containing the entry point. -1- doesn't support marshalling of generic types.

Field

A -1- is a variable of any type that is declared directly in a class or struct. They are members of their containing type. A class or struct may have either, or both, instance or static -1-.




Generally, -1- should be used only for variables that have private or protected accessibility. -1- typically store the data that must be accessible to more than one class method.

Types of Constraints (Original)


① where T : struct


② where T : class


③ where T : new()


④ where T : base-class


⑤ where T : interface-name


⑥ where T : U

(Note: six answers) Before C# 7.3, there were six types of constraints. Constraints begin with the where clause followed by a generic type, a colon, and then the type of constraint.



where T : -1-


The type argument must be a value type. Any value type except Nullable.




where T : -1-


The type argument must be a reference type. This also applies to any class, interface, delegate, or array type




where T: -1-


The type argument must have a public parameterless constructor. When used with other constraints, this must be specified last.




where T : < -2- name >


The type argument must be or derive from the specified -2-.



where T : < -1- name >


The type argument must be or implement the specified -1-. Multiple -1- constraints can be specified & may be generic.




where T : -1-


The type argument specified for T must be or derive from the argument specified for -1-.

Concrete Class

A -2- is a synonym for non-generic classes. -2- define a useful object that can be instantiated as an automatic variable on the program stack.




Typically, you create generic classes by starting with an existing -2-, and changing types into type parameters one at a time until you reach the optimal balance of generalization & usability.




Ex:


class NodeSolid : BaseNode { }

Multi-dimensional Array

-3- are arrays & are declared as in the following example:




int[,] array = new int[4,2]




-3- may be initialized on declaration. You can specify additional dimensions by adding commas in the []'s.




The Rank property returns the rank of the array, which is its number of dimensions. The GetLength method returns the number of elements in the -3-.




You may also initialize without specifying the rank. If you declare an array variable without initializing, you must use the new operator.

Interface

An -1- defines a contract, & a class or struct that implements an -1- must adhere to the contract.




An -1- may inherit from multiple base -1-. An -1- can contain methods, properties, events, & indexers, but the -1- doesn't provide implementations for the members it defines; it merely specifies the members that must be supported by the implementing class or struct.




An -1- declaration is a type declaration that declares a new -1-.

① Unified Modeling Language (UML)


② modeling language


③ Language for Pattern Uniform Specification [LePUS₃]

(Note: three answers) The ① -3- (abbr. -1-) is a general-purpose, developmental ② -2- that is intended to provide a standard way to visualize the design of a system. Its diagrams help to visualize elements such as:




▪ activities/jobs


▪ individual system components & their interactions with other software components


▪ how the system will run


▪ how entities interact with others (that is, components & interfaces)


▪ external user interfaces




① -3- diagrams represent two views of a system model: static/structural emphasizes the static structure using objects, attributes, operations, & relationships. Dynamic/behavioral emphasizes the dynamic behavior by showing collaborations among objects & changes to their internal states.




Related to ① -3- is ③ -5- (abbr. -1-) which models and visualizes Object-Oriented Programming programs & patterns, with these purposes:




▪ scalability ▪ rigour


▪ generality ▪ design abstraction ▪ automated verifiability ▪ pattern implementations, etc . . .







partial modifier/keyword

The -1- modifier defines partial classes, structs, and/or methods throughout the same assembly. -1- type definitions allow for the definition of a class, struct, or interface to be split into multiple files. Splitting one of the aforementioned types over several files can be useful when working with large projects, or with auto-generated code.

Nested Type

A type defined within a class or struct is called a -2-, and is one of the ten class members.




-2- default to private. In a class they may be any access level, unless it is sealed, in which case protected & protected internal are invalid. In a struct they may be public, internal, or private.




The -2- may access the containing type by passing it as an argument to the constructor of the -2-.

Atomicity/Atomic

-1- is a trait of variables and operations, which implies indivisibility & irreducibility. It's an operation during which a processor can simultaneously read & write a location in the same bus operation, during which nothing else can access the memory.




Variable references have -1- if of the following types:




bool char byte sbyte


short ushort uint int float ▪ and reference types





Other types; long, ulong, double, decimal, & user-defined types, are not guaranteed to be -1-.


System.IO namespace

The -1-.-1- namespace contains types that allow reading & writing to files and data, streams, & types that provide basic file & directory support.




Some of the classes in -1-.-1- include:





Directory File


DriveInfo Path


StreamReader


StreamWriter, etc.

Assembly/Assemblies

-1- form the fundamental unit of deployment, reuse, version control, activation scoping, & security permissions for a .NET-based application. -1- take the form of an executable (.exe) or dynamic link library (.dll) file & provide the Common Language Runtime (CLR) with the information it needs to be aware of type implementations. -1- can contain one or more modules.



-1- properties include:




▪ can be shared between applications by placing in the global assembly cache, but must first be strong-named


▪ only loaded into memory if needed, so can be resource-efficient


▪ used with reflection to obtain info about -1-


▪ to only inspect, use method such as ReflectionOnlyLoadFrom.

System.ValueType

Form: public abstract class -1-




Namespace: System




Inheritance: Object → -1-




Attributes: ComVisibleAttribute, SerializableAttribute




The -1- class overrides the virtual methods from Object with more appropriate implementations for value types. The Enum class inherits from -1-. Data types are separated into value types & reference types; the former are either stack-allocated or allocated in-line in a structure, while the latter are heap-allocated.




Although -1- is the implicit base class for value types, you cannot create a class that inherits from -1- directly.

Heap (data structure)

A -1- is a specialized tree-based data structure that satisfies the -1- property: if P is a parent node of C, then the key (the value) of P is either greater than or equal to (in a max -1-) or less than or equal to (in a min -1-) the key of C.




The node at the top of the -1- is the root node. The -1- is one maximally efficient implementation of an abstract data type called a priority queue. A common implementation of a -1- is the binary -1-, in which the tree is binary.

System.Delegate unique methods


① Clone()


② Combine(Delegate[])


③ Combine(Del, Del)


④ CombineImpl(Del)


⑤ CreateDelegate(Type, MethodInfo)


⑥ DynamicInvoke(Object[])


⑦ DynamicInvokeImpl(Object[]) ⑧ GetInvocationList()


⑨ GetMethodImpl()


⑩ GetObjectData(SerializationInfo, StreamingContext)


⑪ Remove(Del, Del)


⑫ RemoveAll(Del, Del)


⑬ RemoveImpl(Del)


⑭ BeginInvoke


⑮ EndInvoke



(Note: fifteen answers) These are the unique methods of the System.Delegate & System.MulticastDelegate classes:




① -1- creates a shallow copy of the delegate.


② -1- concatenates the invocation lists of two delegates.


③ -1- concatenates the invocation lists of an array of delegates.


④ -1- concatenates the invocation lists of the specified multicast (combinable) delegate and the current multicast (combinable) delegate.


⑤ -1- creates a delegate of the specified type to represent the specified static method.


⑥ -1- dynamically invokes (late-bound) the method represented by the current delegate.


⑦ -1- dynamically invokes (late-bound) the method represented by the current delegate.


⑧ -1- returns the invocation list of the delegate.


⑨ -1- gets the static method represented by the current delegate.


⑩ (MulticastDelegate only)-1- populates a SerializationInfo object with all the data needed to serialize this instance.


⑪ -1- removes the last occurrence of the invocation list of a delegate from the invocation list of another delegate.


⑫ -1- removes all occurrences of the invocation list of a delegate from the invocation list of another delegate.
⑬ -1- removes the invocation list of a delegate from the invocation list of another delegate.


⑭ & ⑮ The common language runtime provides each delegate type with -1- and -1- methods, to enable asynchronous invocation of the delegate


StreamReader Class

Form: public class -1- : System.IO.TextReader




Namespace: System.IO




Inheritance: Object → MarshalByRefObject →
TextReader → -1-




Attributes: ComVisibleAttribute, SerializableAttribute




The -1- class implements a TextReader that reads characters from a byte stream in a particular encoding. -1- is designed for character input in a particular encoding, whereas the Stream class is designed for byte input & output.




Use -1- for reading lines of information from a standard text file. -1- implements IDisposable & should be disposed of directly or indirectly. -1- defaults to UTF-8, unless specified. -1- is not thread-safe; see TextReader.Synchronized for a thread-safe wrapper.


private protected access modifier/keyword

-2- is a member access modifier. A -2- member is accessible by types derived from the containing class, but only within its containing assembly.

Classes are always invariant. Certain interfaces are designated either covariant or contravariant. Delegates can be either covariant, contravariant, or in some cases both.


Interfaces: ① ③ ⑤ ⑧ ⑪ ⑬ ⑭


Delegates: ② ④ ⑦ ⑨ ⑫


Classes: ⑥ ⑩


Covariant: ① ⑪ ⑬ ⑭


Contravariant: ③ ⑤ ⑧


Invariant: ⑥ ⑩

Classify the following as either interfaces, classes, or delegates; if it is an interface, specify if it is covariant, contravariant, or invariant:


① IEnumerable❬T


② Action❬T


③ IComparable❬T


④ Comparison❬T


⑤ IComparer❬T


⑥ EventArgs


⑦ Converter❬TInput, TOutput


⑧ IEqualityComparer❬T


⑨ Predicate❬T


⑩ Comparer❬T


⑪ IGrouping❬TKey, TElement


⑫ Func❬TResult


⑬ IEnumerator❬T


⑭ IQueryable❬T

① Message Passing


② Message(s)

(Note: two related answers) ① -2- is a technique for invoking behavior on a computer (i.e. - running a program). The invoking program sends a ② -1- to a process (which may be an actor or an object), & relies on the process & the supporting infrastructure to select and invoke the actual code to run.



① -2- differs from conventional programming where a process, subroutine, or function is directly invoked by name. ① -2- is key to some models of concurrency & object-oriented programming.

① Indirection


② Indirection Node

(Note: two related answers) ① -1- is the ability to reference something using a name reference or container instead of the value itself. Often this is the act of manipulating a value through its memory address; (i.e. - accessing a variable through the use of a pointer).




A stored pointer that exists to provide a reference to an object by double ① -1- is called an ② -2-. Object-oriented programming makes extensive use of ① -1-:


▪ Dynamic Dispatch


▪ Proxy Pattern


▪ Delegation, etc.






Iteration Structures

You can create loops by using the -2- which cause embedded statements to be executed a number of times, subject to the loop termination criteria. These statements are executed in order except where a jump statement is encountered. The following are classified as -2-:




▪ do ▪ for ▪ foreach


▪ in ▪ while



Jump Statements

Branching is performed using -2-, which cause an immediate transfer of the program control. The following are classified as -2-:


break continue goto


return throw



Lookup Table

A -2- is an array that replaces runtime computation with a simpler array indexing operation. Processing time saved can be significant, since retrieving a value from memory is often faster than undergoing an expensive computation or I/O operation.




The -2- may be stored in (after pre-calculation) static program storage; calculated (pre-fetched) as part of a program's initialization phase (Memoization), or even stored in hardware in app-specific platforms.

Traits

A -1- is a concept used in Object-oriented programming, which represents a set of methods that can be used to extend the functionality of a class. -1- both provide a set of methods that implement behavior to a class, & require that the class implement a set of methods that parameterize the provided behavior. For inter-object communication, -1- are somewhat between an object-oriented protocol (interface) & an mixin.

Operator Overloading

-2- is the process of re-defining an operator for custom actions by use of the operator keyword. These are methods with special names, and have a return type & parameter list. All arithmetic (binary & unary) and comparison operators are eligible for -2-, but the latter must be done in pairs.

① Pointer Dereferencing and Member Access Operator


② Pointer Dereferencing Operator


③ Address Of/Reference Operator

(Note: three answers)


The -> operator combines pointer ① -1- with -2-. x -> y is an expression where x is a pointer of type T* and y is a member of Y, is equivalent to (*x).y. This operator can only be used in an unsafe context, and can't be overloaded.



The * operator is simply for ② -2-, which allows for reading and writing to a pointer.



The unary & operator returns the ③ -2- its operand. It is typically used in conjunction with the * unary operator.

Dialects

A -1- of a programming language or a data exchange language is a variation or extension that doesn't change its intrinsic nature. With regards to C#: CW, Spec#, Polyphonic C#, & Enhanced C# are considered to be its -1-. Sometimes standards may be considered inadequate, or a -1- may be created for use in a domain-specific language.

Spec#

-1- is a programming language with specification language features that extends the capabilities of C# with Eiffel-like contracts, including object invariants, preconditions, & postconditions. -1- includes a static checking tool based on a theorem prover that can statically verify many of these invariants. It also includes minor extensions such as non-null reference types.

Unbound Type

An -2- refers to a non-generic type or an -2- generic type - to the entity declared by a type declaration. An -2- generic type is not itself a type, and cannot be used as the type of a variable, argument, or return value, or as a base type. The only construct in which an -2- generic type can be referenced is the typeof expression.

StreamWriter Class

Form: public class -1- : System.IO.TextWriter




Namespace: System.IO




Inheritance: Object → MarshalByRefObject


→ TextWriter → -1-




Attributes: ComVisibleAttribute, SerializableAttribute




The -1- class implements a TextWriter for writing character to a stream in a particular encoding. Classes derived from -1- are designed for byte input & output. It defaults to an instance of UTF-8 encoding, unless otherwise specified.




This instance is constructed without a byte-order mark (BOM), so its GetPreamble method returns an empty byte array. To specify a BOM & determine whether an exception is thrown on invalid bytes, use a constructor with an encoding object parameter.


Runtime

At this point we know nothing about a program's invariants, they are whatever the programmer put in; -1- invariants are rarely enforced by the compiler alone, they need the programmer's help. Possible -1- errors include:


▪ division by zero ▪ dereferencing a null pointer


▪ running out of memory
Also, errors detected by the program itself:


▪ trying to open non-existing files


▪ trying to find a web page but alleged URL is malformed



If -1- succeeds, the program finishes or continues running without crashing. Inputs & outputs are at the programmer's discretion.


System.Numerics.BigInteger Struct

The -1-.-1-.-1- struct type is an immutable type that represents an arbitrarily large integer whose value, in theory, has no upper or lower bounds. Its members closely parallel other Integral Types:


▪ Byte ▪ Int16 ▪ Int32


▪ Int64 ▪ SByte ▪ UInt


▪ UInt32 ▪ UInt64



Because it is immutable & boundless, -1-.-1-.-1- can incur performance penalties, or cause an OutOfMemoryException to be thrown.



Side Effect

A -2- is defined as a read-or-write of a volatile field, a write to an external resource, a write to a non-volatile variable, and the throwing of an exception. The critical execution points at which the order of these -2- must be preserved are:




▪ references to volatile fields ▪ lock statements


▪ and thread creation & termination



Execution of a C# program proceeds such that the -2- of each executing thread are preserved at critical execution points.


Queue

A -1- is a particular kind of abstract data type or collection in which the entities in the collection are kept in order, and the principle, or only, operations on the collection are the addition of entities to the rear terminal position, known as en-1-, and removal of entities from the front terminal position, known as de-1-. This makes the -1- a FIFO (first-in, first-out) data structure.

Associativity

When two or more operators that have the same precedence are present in an expression, they are evaluated based on -1-. Whether the operators in an expression are left -1- or right -1-, the operands of each expression are evaluated first, from left to right.




The assignment operators, null coalescing, and conditional operator are all right -1-; all other binary operators are left -1-. Precedence and -1- can be controlled with parentheses (). User-defined operator declarations cannot modify syntax precedence or -1-.

Numeric Promotion

-2- consists of automatically performing certain implicit conversions of the operands of the pre-defined unary & binary numeric operators. Unary -2- occurs for the operands of the pre-defined +, -, and ~ unary operators, and converts the operands of type: sbyte, byte, char, short, or ushort to int. Also the - operator converts uint to long.




Binary -2- occurs for operands of the +, -, *, /, %, &, |, ^, ==, !=, >, <, >=, <= binary operators and converts both operands to a common type.



① CPU Cache


② cache


③ cache miss

(Note: three answers) A ① -2- is a hardware ② -1- used by the central processing unit (CPU) of a computer to reduce the average cost (time or energy) to access data from the main memory. A ② -1- is a smaller, faster memory, located closer to a processor core, which store copies of the data from frequently used main memory locations. A ③ -2- is a failed attempt to read or write data.

ComVisibleAttribute Class

Form: public sealed class -1- : Attribute




Namespace: System.Runtime.InteropServices




Inheritance: Object → Attribute → -1-




The -1- class controls accessibility of an individual managed type or member, or of all the types within an assembly, to COM. The -1- can be applied to assemblies, interfaces, classes, structs, delegates, enums, fields, methods or properties. It is set to true by default, if applied. Only public types can use -1-, & it isn't necessary on public managed types or assemblies since they are already visible to COM.


Digest

A -1- is the result of a one-way hash function that takes a variable length input string and converts it to a fixed length output string. This output string is probabilistically unique for every different input string, and thus can act as a fingerprint of a file. It can determine if a file was tampered with.

Generic Types

-2- can be a class, interface, or struct whose definition includes placeholders, called generic type parameters, for one or more types used in its member definitions (i.e. as method parameter types).




A user specifies real types (generic type arguments) for the type parameters when creating an instance of the -2-.

Explicit Conversions

-2- require a cast operator. Casting is required when a conversion might lose information, or fail for other reasons. To perform a cast, specify the type that you are casting to in parentheses ()'s in front of the value or variable to be converted.




Typical uses include numeric conversions to a type with less precision or a small range, and conversion of a base class instance to a derived class for reference types (this doesn't change the run-time type of the underlying object, it only changes the type of the value used as a reference to it).

System.TypeInitializationException

The -1- exception is thrown when a static constructor throws an exception and no catch clauses exist to catch it.

Heuristic

A -1- is an approach or algorithm that leads to a correct solution of a programming task by non-rigorous or self-learning means. Usually this is accomplished in a more expedient manner than through classic methods. It may refer to a -1- function, which is a function that ranks alternatives in search algorithms at each branching step based on available information to decide which branch to follow. The trade-off for deciding whether to use a -1- include:




▪ optimality ▪ completeness


▪ accuracy ▪ precision


▪ and execution time








Dynamic Objects

The purpose of dynamic binding is to allow C# programs to interact with -2-, which don't follow the normal rules of the type system. -2- may be from other languages with different type systems, or they may be programmatically setup to implement their own binding semantics for different operations.

class member

Classes & structs have -2- that represent their data & behavior. A class's -2- include all the -2- declared in it, along with all -2- (except constructors & finalizers) declared in all classes in its inheritance hierarchy.

Scope

-1- is an enclosing context or region that defines where a name can be used without qualification. This is separate from, but closely related to declaration space. Both are defined by a statement block enclosed by braces, such as with namespaces, methods, classes, & properties.

while

The -1- statement executes a statement, or block of statements, until a specified expression evaluates to false. This expression takes place before execution, so it will execute zero or more times. This can be terminated early by a jump statement such as continue.

const keyword

Use the -1- keyword to declare a constant field or a constant local. Constant fields & locals aren't variables & can't be modified. Constants can be numbers, Boolean values, strings, or a null reference. The type of a constant declaration specifies the type of members introduced. The initializer of a constant local or field must be a constant expression that can be implicitly converted to the target type.

① Statement Lambda


② Expression Lambda


③ Async Lambda


④ async keyword


⑤ await keyword

(Note: five answers) A ① -1- lambda has a body that can consist of any number of statements enclosed in braces. A ① -1- lambda cannot be used to create expression trees.




② -1- lambdas and ① -1- lambdas can easily be created that incorporate asynchronous processing by using the ③ -1- and ④ -1- keywords; these are then called ⑤ -1- lambdas. You can add an event handler by adding an ③ -1- modifier before the lambda parameter list.



Data Parallelism

-2- refers to scenarios in which the same operation is performed concurrently, or parallel, on elements in a source collection or array. In -2-, the source collection is partitioned so that multiple threads can operate on different segments concurrently. -2- is supported by the Task Parallel Library (TPL) through the System.Threading.Tasks.Parallel namespace.

IEquatable❬T❭ interface

This interface defines a generalized method that a value type or class implements to create a type-specific method for determining equality of instances. The -1- interface is implemented by types whose values can be equated.




-1- is used by generic collection objects such as Dictionary, List, & LinkedList when testing for equality in methods such as Contains, IndexOf, LastIndexOf, & Remove. It should be implemented for any object that might be stored in a generic collection. Replace the T with the type that is implementing -1-. When implementing -1-, you should also implement IComparable.

keywords

-1- are predefined reserved words with special syntactic meaning. There are two types; contextual -1-, which are activate based on the situation, and reserved -1-, which may only be used for that purpose.

goto keyword

The -1- statement transfers control directly to a labeled statement. In a switch statement, -1- transfers to a specific case label or the default label. It can help exit deeply nested loops, and is considered a jump statement.

Aggregation

An -1- operation computes a single value from a collection of values, such as calculating an average. In another context, -1- is a concept similar to composition, except that it doesn't imply ownership. -1- is a way to combine simple objects or data types into more complex ones, but when the owning object is destroyed, its contained objects may not be.




In -1- the object may only contain a reference or pointer to the object (and not have a lifetime responsibility for it). In COM, -1- means that an object exports one of several interfaces of another object it owns.

Composition(s)

Object -1- is a way to combine simple objects or data types into more complex ones. -1- relate to, but are not the same as, data structures, including the tagged union, set, sequence, and various graph structures, as well as the object used in object-oriented programming.




While inheritance denotes an "is-a" relationship between objects, -1- denotes an "is-a-part-of" relationship.

Front Controller

-2- are often used in web applications to implement workflows. It is much easier to control navigation across a set of related pages from a -2- than it is to make the individual pages responsible.




The three benefits to using the -2- patterns include:




▪ Centralized control


▪ Thread-safety


▪ Configurability



SOLID Principles

The -1- mnemonic acronym stands for five design principles intended to make software designs more understandable, flexible, & maintainable. These patterns are:




▪ Liskov Substitution


▪ Single Responsibility


▪ Dependency Inversion


▪ Interface Segregation


▪ Open/Closed


① Reference Equality


② Identity


③ ReferenceEquals method


④ boxed


⑤ Value Equality


⑥ Equivalence

(Note: six answers) ① -2- means that two object references refer to the same underlying object. This can occur through simple assignment. ① -2- is also known as ② -1-, and can be tested for by using the ③ -1- method.




The concept of ① -2- applies only to reference types. Value types cannot have it because when an instance of a value type is assigned to a variable, a copy of the value is made. This is because each variable is ④ -1- into a separate object instance. ⑤ -2-, or ⑥ -1-, means two objects contain the same value or values.

Lambda Expression

The -2- is an anonymous function that creates delegate or expression tree types, & can write local functions that can be passed as arguments or returned as the value of function calls. -2- must:




▪ contain the same number of parameters as the delegate type


▪ each input parameter in the -2- must be implicitly convertible to its corresponding delegate parameter


▪ the return value, if any, must be implicitly convertible to the delegate's return type




-2- can refer to outer variables that are in scope in the method that defines the -2-.


module

A -1- is a loadable unit which can contain type declarations & type implementations. The -1- contains enough information to enable the Common Language Runtime (CLR) to locate all implementation bits when the -1- is loaded.




The format for a -1- is an extension of the Windows PE format (portable executable). When deployed, a -1- is always contained in an assembly.

Hash/Hash Code

A fixed size result that is obtained by applying a one-way mathematical function, sometimes called a hash algorithm, to an arbitrary set of data. If the input data changes, the -1- (alt. -2-) changes. The -1- can be used in many operations, including authentication and digital signing, and is commonly used to index data for quick retrieval.

① Null String


② Empty String

A string that has been declared but has not been assigned a value is a ① -1- string, and is different from an ② -1- string which is a string whose value is "", or ② String.-1-.




There are two methods that test for these strings: IsNullOrEmpty or IsNullOrWhitespace.

Normalization

The Unicode standard defines a process called -1- that returns one binary representation when given any of the equivalent binary representations of a character. -1- can be performed with several algorithms, called -1- forms, that follow different rules. .NET supports Unicode -1- forms C, D, KC, and KD.




When two strings are represented in the same -1- form, they can be compared by ordinal comparison.



❶ Obtain strings to be compared from input source


❷ Call the -1- method


❸ Call a method that supports ordinal string comparison


❹ Emit the strings

① Instance Field


② Static Field

A class or struct may have ① -1- fields or ② -1- fields, or both. ① -1- fields are specific to an ① -1- of a type. If you have a class T with the ① -1- field F, you can create two objects of type T, and modify the value of F in each object without affecting the value in the other object.




By contrast, a ② -1- field belongs to the class itself, and is shared among all ① -1- of that class. Changes made to ① -1- A will be visible immediately to ① -1- B & C if they access the field.

Deadlock

A -1- is caused when two or more threads come into conflict over some resource in such a way that no execution is possible. The most common cause of -1- occurs when two or more threads wait for a resource owned by the other thread. Single-thread -1- can occur when a thread attempts to take a lock it already owns. The common denominator in all cases is that lock hierarchy is not respected.

Implicit Interpolated String Conversion

This conversion permits an interpolated string expression to be converted to System.IFormattable or System.FormattableString (which implements System.IFormattable). When the -3- conversion is applied, a string value is not composed from the interpolated string; instead, an instance of System.FormattableString is created.

① Resumption Delegate


② Current Caller

An async function has the ability to suspend evaluation by means of await expressions in its body. Evaluation may later be resumed by means of a ① -2- at the point of the suspending await expression. The ① -2- is of type System.Action, & when it is invoked, evaluation of the async function invocation will resume from the await expression where it left off.




The ② -2- of an async function invocation is the original caller if the invocation has never been suspended, or the most recent caller of the ① -2- otherwise.

value keyword

The -1- contextual keyword is similar to an input parameter on a method. It references the value that client code is attempting to assign to a property. It is used to define the value being assigned by a set accessor.

when keyword

You can use the -1- contextual keyword to specify a filter condition in two contexts:




❶ In the catch statement




❷ In the case label of a switch statement




In the 1ˢᵗ context, -1- can be used to specify a condition that must be true for the handler for a specific exception to execute:




catch ExceptionType[e] -1-(expression)




Here, expression evaluates to a Boolean value. If it returns true then it executes.




In the 2ⁿᵈ context -1- can be used to specify a condition that causes its associated case label to be true only if the filter condition is also true:




case (expression) -1- (-1- - condition)




Here, expression is a constant or type pattern that is compared to the match expression.

Calling Convention

A -2- is an implementation-level (low-level) scheme for how subroutines (aka methods) receive parameters from their caller & how they return a result. Differences in various implementations include where parameters, return values/addresses, & scope links are placed, & how the tasks of preparing for a function call and restoring the environment afterward are divided between the caller & callee.

Evaluation Strategy

Programming languages use -2- to determine when to evaluate the arguments of a function call, and what kind of value to pass to the function. Some examples of -2- include:




▪ call by value ▪ call by reference


▪ eager evaluation ▪ lazy evaluation


▪ partial evaluation ▪ remote evaluation


▪ short-circuit, etc.




① Interpolated Strings


② Interpolated

(Note: two related answers) ① -2- are used to construct strings. They look like a template string that contains ② -1- expressions. An ① -2- returns a string that replaces the ② -1- expressions that it contains with their string representations.




Contrast ① -2- with composite format strings. The structure of an ① -2- is:




$" { < ② -1- - expression > [ , ] [:]} ... "




Here, field-width is a signed integer that indicates the number of characters in the field. Format-string is a format string or name for the type argument.

Decorator Pattern

The -2- is a behavioral design pattern that allows behavior to be added to an individual object, dynamically, without affecting the behavior of other objects from the same class.



The -2- is often useful for adhering to the Single Responsibility Principle, as it allows functionality to be divided between classes with unique areas of concern. Also, it is structurally nearly identical to the chain of responsibility (CoR) pattern, the difference being that in a CoR, exactly one of the classes handles the request, while for the -2-, all classes handle the request.

Contravariance

In C#, -1- enables implicit reference conversion for arrays, delegates, & generic type arguments. -1- reverses assignment compatibility.




-1- support for method groups allows for matching method signatures with delegate types. An object that is instantiated with a less derived type argument is assigned to an object instantiated with a more derived type argument.

IComparer interface

The -1- interface defines a method that a type implements to compare two objects. -1- is used with the List.Sort & List.BinarySearch methods. It provides a way to customize the sort order of a collection.




Classes that implement -1- include the SortedDictionary & SortedList generic classes. -1- supports ordering comparisons, so when the Compare method returns 0, it means that two objects sort the same.

return keyword

The -1- statement terminates execution of the method in which it appears & returns control to the calling method. It can also return an optional value.




If the method is a void type, the -1- statement can be omitted. If it is inside of a try block, the finally block, if it exists, will be executed before control returns the calling method. -1- is a jump statement.

switch keyword

The -1- statement is a selection statement that chooses a single -1- section to execute from a list of candidates based on a pattern match with the match expression, which provides the value to match against, and must return a value of one of these types:




char string bool


▪ an integral value ▪ enum




Beginning with C#7, it can return a value of any non-null expression. Only one statement may execute, but multiple cases may represent a single statement.





Mixin

A -1- class provides some, but not all of the implementation for a virtual base class. Derivation done just for the purpose of re-defining the virtual function in the base classes is often called -1- inheritance. -1- classes do not usually share common bases.




In C# these aren't directly supported, but any class implementing an interface with extension methods defined will have the extension methods available as pseudo-members.

Constructor Chaining

-2- is a way to connect two or more classes in a relationship; every child class constructor is mapped to a parent class constructor implicitly by the base keyword, so when an instance of the child class is formed, it will also call the parent class constructor.

Attribute

An -1- associates metadata, or declarative information, with code/assemblies, types, methods, properties, and other member types. After an -1- is associated with a program entity, the -1- can be queried at run-time by using the reflection technique.




Metadata is information about the type's defined in a program. All .NET assemblies contain a specified set of metadata describing the types & type members defined in the assembly.




A custom -1- can be added to specify any additional information that is required. You can apply one or more -1- to entire assemblies and modules, or smaller program elements such as classes. -1- can accept arguments in the same way as methods & properties. -1- names are placed in square brackets [].

Property

A -1- is a member that provides a flexible mechanism to read, write, or compute the value of a private field. A -1- can be used as if it is a public data member, but it is actually special methods called accessors which enables data to be accessed easily, while promoting the safety & flexibility of methods.




A -1- enables a class to expose a public way of getting & setting values, while hiding implementation of verification code. A get -1- accessor is used to return the -1- value, and a set -1- accessor is used to assign a new value, both may have different access levels.

Fixed-size Buffer

You can use the fixed statement to create a -3- with a fixed-size array in a data structure. This is useful when you are working with existing code, such as code written in other languages, pre-existing DLLs or COM projects. The fixed array can take any attributes or modifiers that are allowed for regular struct members. The only restriction is that the array type must be:




bool byte char short int long


sbyte ushort uint ulong float double



Attribute Specification

-2- is the application of a previously defined attribute to a declaration. This can take place at the global scope (on the containing assembly or module), and for type declarations, class member declarations, interface member declarations, struct member declarations, enum member declarations, accessor (including event) member declarations, and formal parameter lists.




An -2- of a conditional attribute is included if one or more of its associated conditional compilation symbols is defined at the point of specification; otherwise the -2- is omitted.

Containment

Composition that is used to store several instances of the composited data type is referred to as -1-. Examples include:




▪ arrays ▪ associative arrays


▪ binary trees ▪ linked lists, etc.




In object-oriented programming (OOP), -1- means that an object is created within another object, and is useful when:



▪ a derived class needs only partial functionality from the base class


▪ loose coupling is desirable


▪ if the base class should be determined at runtime based on a condition


▪ when control access to public members is important, etc.





Model-View-Controller Pattern (MVC)

The -3- (abbr. -1-) pattern is a software architectural pattern used for developing user interfaces that divides an application into three interconnected parts. This separates internal representations of information from the ways information is presented to, & accepted from, the user. -3- decouples these components, allowing for efficient code reuse & parallel development.

Events

-1- enable a class or object to notify other classes or objects when something of interest occurs. The publisher class sends (or raises) the -1-, and the classes that receive (or handle) the -1- are called subscribers.




Typically in C#, Windows Forms, or Web applications you subscribe to -1- raised by controls. -1- have these properties:



▪ the publisher determines when an -1- is raised, and the subscribers determine the responding action


▪ an -1- can have multiple subscribers, or a subscriber can have multiple -1- from multiple publishers


▪ -1- without subscribers are never raised


▪ typically -1- signal user actions


▪ based on the -1-Handler delegate & -1-Args class



Common Language Infrastructure (CLI)

The -3- (abbr. -1-) is an open specification that describes executable code, and a runtime environment that allows multiple high level languages to be used on different computer platforms without being rewritten for specific architectures (platform-agnostic).




The .NET Core, .NET Framework, Portable.NET, Mono, & DotGNU are implementations of the -3-. Four major aspects include:




❶ The Common Type System


❷ Metadata


❸ The Common Language Specification


❹ The Virtual Execution System

Anonymous Function Conversion

(Note: two answers) The -2- expression doesn't have a type, but can be implicitly converted to a compatible delegate type or expression tree type. Either an anonymous method expression or lambda expression is able to be converted using an -2- conversion.

① Output Unsafe


② Input Unsafe

The occurrence of variance annotations in the type parameter list of a type restricts the places where types can occur within the type declaration. A type T is ① -2- if:




T is a contravariant type parameter


T is an array type with an ① -2- element type.


T is an interface or delegate type S<A1, ..., Ak> constructed from a generic type S<X1, ..., Xk> where for at least one Ai:




Xi is covariant or invariant, and Ai is ① -2-


Xi is contravariant or invariant and Ai is ② -2-




A type T is ② -2- if one of the following holds:




T is a covariant type parameter


T is an array type with ② -2- element type


T is an interface or delegate type S<A1, ...., Ak> constructed from a generic type S<X1, ..., Xk> where for at least one Ai one of the following holds:




Xi is covariant or invariant, and Ai is ② -2-


Xi is contravariant or invariant and Ai is ① -2-




Intuitively, an ① -2- type is prohibited in an output position, and an ② -2- type is prohibited in an input position.



Canonical Form

When representing math objects in a computer, there are usually multiple ways to represent the same object. In this context, a -2- is a representation such that every object has a unique representation. Thus, the equality of two objects can be test via their -2-. -2- can also mean a differential form that is defined in a natural way.

System.MulticastDelegate / Multicast Delegate

Represents a -1- delegate; that is, a delegate that can have more than one element in its invocation list.




System.-1- is a special class. Compiler and other tools can derive from System.-1-, but not explicitly. It has two special methods: BeginInvoke & EndInvoke. System.-1- has a linked list of delegates, called an invocation list, consisting of one or more elements that are called in appearance order.

in keyword

This contextual keyword is used in four contexts:




❶ generic type parameters in generic interfaces & delegates, where it specifies that the type parameter is contravariant


❷ from & join clauses in LINQ query expressions


❸ as a parameter modifier, which lets you pass an argument to a method by reference rather than by value


❹ as part of a foreach statement


int type/keyword

The -1- type denotes an integral type that stores values according to size & range.




Range: -2,147,483,648 to 2,147,483,647


Size: Signed 32-bit integer


NET Type: System.Int32


Default value: 0





You can declare and initialize an -1- variable by assigning a decimal, hex, or binary literal. Integer literals that do not have a suffix indicating otherwise will default to the -1- type.

float type/keyword

The -1- type signifies a simple type.




Range: ±1.5 x 10⁻⁴⁵ to ±3.4 x 10³⁸


Precision: ~6-9 digits


Size: 4 bytes


NET Type: System.Single


Default value: 0




By default, a real numeric literal on the right side is treated as a double, so the suffix f or F must be used here. You can mix numeric types in an expression & have them converted to floating-point type.

for keyword / for loop

By using a -1- loop, you can run one, or a block, of statements until a specified expression evaluates to false. Useful for iterating over arrays & other times when you know the number of times you want the loop to iterate. Each loop contains an optional initializer, a condition, and an iterator.

double floating-point type / keyword

The -1- type signifies a simple type that stores 64-bit floating-point values.





Range: ±1.5 x 10⁻³²⁴ to ±3.4 x 10³⁰⁸


Precision: ~15-17 digits


Size: 8 bytes


NET Type: System.-1-


Default value: 0




By default, a real numeric literal on the right side of an operator is treated as a -1-. For an integer, use the suffix D or d.

descending keyword

The -1- contextual keyword is used in the orderby clause in query expressions to specify that the sort order if from largest to smallest.

Ahead of Time Compilation (AOT)

-4- (abbr. -1-) is the act of compiling a high-level programming language, or an intermediate representation, into a native (system-dependent) machine code, so that the resulting binary file can execute natively.




-4- produces machine optimization code, just like a standard native compiler. The difference is that -4- transforms the bytecode of an extant virtual machine (VM) into machine code. -4- compiles before execution, rather than during it, & can possibly drop a useful fraction of the runtime environment, saving disk space, memory, battery life, etc.

Random Class / pseudo-randomness

Form: public class -1-




Namespace: System




Inheritance: Object → -1-




Represents a -1- number generator, which is a device that produces a sequence of numbers that meet certain statistical requirements for being -1-. -1- numbers are chosen with equal probability from a finite set of numbers.




The current implementation of the -1- class is based on Donald E. Knuth's subtractive pseudo- -1- number generator algorithm, Also see the RNGCryptoServiceProvider class for secure cryptographic numbers.

the instance type

Each class declaration has an associated bound type, the -2-. For a generic class declaration, the -2- is formed by creating a constructed type from the type declaration with each of the supplied type arguments being the corresponding type parameter. The -2- uses the type parameters and can only be used while they are in scope.




The -2- is the type of this for code written inside the class declaration. For non-generic classes, the -2- is simply the declared class.

① MarshalByRefObject Class


② Marshal by Value

① -1- is the base class for objects that communicate across application domain boundaries by exchanging messages via proxy. Objects that don't inherit from ① -1- are implicitly ② -3-.


When a remote application domain references a ② -3- object, a copy of it is passed across boundaries. ① -1- objects are accessed directly within the boundaries of the local application domain. The 1ˢᵗ time an application in a remote application domain accesses a ① -1-, a proxy is passed back. Later calls go through the proxy.


Func❬❭/ Func❬TResult

The -1- delegate encapsulates a method that has no parameters and returns a value of the type specified by the TResult parameter.




Form: public delegate TResult -1-();




Use -1- to represent a method that can be passed as a parameter without explicitly declaring a custom delegate. The encapsulated method must correspond to the method signature defined by -1-. This is useful when you have an expensive computation that you want to execute only if the result is actually needed.

LocalDataStoreSlot Class

Form: public sealed class -1-




Namespace: System




Inheritance: Object → -1-




Attributes: ComVisibleAttribute





The -1- class encapsulates a memory slot to store local data. Cannot be inherited.




The NET Framework provides two mechanisms for using thread local storage (TLS):




❶ thread relative static fields


❷ data slots




The former are static fields that are marked with the ThreadStaticAttribute and provide better performance than data slots, and enable compile-time checking. The latter are slower and more awkward to use, and data is stored as type object so it must be cast before being used. However, they can be used when you have insufficient information at compile-time to allocate static fields.

Thread Pool

Many applications create threads that linger in a sleeping state, waiting on an event to occur. Others might enter that state only to be awakened periodically to poll for a change or update status information. The -2- enables the use of threads in a more efficient manner by providing the application with a -2- of threads that are managed by the System. Operations such as creating a Task object to perform a Task can use a -2-.

① Event Tracing for Windows (ETW)


② event tracers/tracing

① -4- (abbr. -1-) provides application programmers the ability to start & stop ② -2- sessions, instrument an application to provide ② -2- & consume ② -2-. ② -2- contain an event header & provider-defined data that describes the current state of an application or operation. You can use events to debug and perform capacity & performance analysis on your application.

Explicit Conversion Classifications


① All implicit conversions


② Explicit Numeric


③ Explicit Reference


④ Explicit Enumeration


⑤ Explicit Nullable


⑥ Explicit Interface


⑦ Unboxing


⑧ Explicit Dynamic


⑨ User-defined Explicit



(Note: nine answers) Classify the types of explicit conversions.



① AND Assignment Operator


② OR Assignment Operator


③ XOR Assignment Operator

The operators &=, |=, and ^= perform logical bitwise ① -1-, ② -1-, & ③ -1- operations on integral operands, and logical -1-, ② -1-, and ③ -1- on bool operands. These operators cannot be overloaded directly, but user-defined types can overload the binary &, |, and ^ operators.

① readonly ref struct


② ref struct


③ readonly struct

Declaring a struct as a ① -3- combines the benefits & restrictions of a ② -2- and a ③ -2- declaration. The memory used by the readonly span is restricted to a single stack frame, and the memory used by the readonly span cannot be modified.




Use a ② -2- or a ① -3- such as Span❬T❭ or ReadOnlySpan❬T❭ to work with memory as a sequence of bytes.


Object.MemberwiseClone method

The -1- method creates a shallow copy by creating a new object, and then copying the non-static fields of the current object to the new object. If a field is a value type, a bit-by-bit copy of the field is performed. If it is a reference type, the reference is coped but the referred object is not; therefore, the original object & it clone refer to the same object.

Representational State Transfer (REST)

-1- (acronym for -3-) Web services are a way of providing interoperability between computer systems on the Internet. -1- - compliant Web services allow requesting systems to access and manipulate textual representations of Web resources using a uniform and predefined set of stateless operations.




Requests made to a resources URI will elicit a response in many formats, such as XML, JSON, & HTML. -1- systems aim for faster performance, reliability, & extensibility.

NuGet Package Manager

The -1- package manager is a free & open-source package manager designed for the MS Dev platform. -1- is also integrated with Visual Studio, and with SharpDevelop.




-1- can be used from the command line & automated with scripts to help automate the development process. It is a mechanism whereby developers can create, share, & consume libraries of code. These libraries are called packages.

Integral Types

The following constitute the -2-:




sbyte byte char short ushort


int uint long ulong




The -2- are a subset of the simple types.



① Implicit Numeric Conversions (✓)


② Explicit Numeric Conversions (x)

System.Text

The -1-.-1- namespace contains classes that represent ASCII & Unicode character encodings; abstract base classes for converting blocks of characters to and from blocks of bytes; & a helper class that manipulates & formats String objects without creating intermediate instances of String.




The encoding classes are primarily used to convert between different encodings or code pages & a Unicode encoding. The StringBuilder class is for operations that perform extensive manipulations on a single string. Unlike the String class, it is mutable & provides better performance when concatenating or deleting strings.

① default value expressions


② default value

① -3- are very useful in generic classes & methods. One issue when using generics is how to assign a ② -2- of a parameterized type T when you don't know in advance:




▪ whether T is a reference or value type


▪ if T is a value type, whether it's a numeric value or a struct




Given a variable t of a parameterized type T the statement t = null is only valid if T is a reference type. The assignment t = 0 only works for numeric value types, but not for structs. To solve these problems use a① -3-. ① -3- can also be used with any managed types.


①using keyword


② using static

❶ As a directive, ①-1- is used to create an alias for a namespace, or to import types defined in other namespaces; so you don't need to qualify the use of a type in one.


❷ In this context, ②-2- allows access to static members of a type without qualification.


❸ Finally, the ①-1- statement provides a convenient syntax that ensures the correct use of IDisposable objects, which when limited in lifetime to a single method should be declared & instantiated in a -1- statement. Within the -1- block, the object is read-only. This ensures Dispose is called, even if an exception occurs.

sizeof operator/keyword

The -1- operator is used to obtain the size in bytes for an unmanaged type, which include the built-in types:




sbyte (1 byte) ▪ byte (1) ▪ short (2) ▪ ushort (2)


int (4) ▪ uint (4)


long (8) ▪ ulong (8) ▪ char (2 - Unicode)


float (4) ▪ double (8) ▪ decimal (16) ▪ bool (1)




For the other types: enums, pointers, user-defined structs that don't contain any fields or properties that are reference types, unsafe mode must be used.

unchecked operator / keyword

The -1- operator suppresses overflow-checking for integral type arithmetic operations and conversions. In this context, if an expression produces a value that is outside the range of the destination type, the overflow is not flagged. Expressions with non-constants are -1- by default. -1- can possibly improve performance.

unsafe modifier / keyword

The -1- modifier denotes an -1- context, which is required for any operation involving pointers. You can use the -1- modifier in the declaration of a type or member. The entire textual extent is then considered -1-.




Ex: -1- static void FastCopy(byte[] src, byte[] dst, int count) {//Can use pointers here}




The scope of the -1- context extends from the parameter list to the end of the method, so pointers can also be used in the parameter list. You can also use an -1- block to enable the use of -1- code inside it. You must use the /-1- compiler option to compile -1- code.

stackalloc operator / keyword

The -1- operator is used in an unsafe code context to allocate a block of memory on the stack.




Ex: int* block = -1- int [100];




-1- is valid only in local variable initializers. because pointer types are involved, -1- requires unsafe context, which is less secure, but -1- automatically enables buffer overrun detection features in the Common Language Runtime (CLR); if one is detected, the process is terminated immediately before malicious code can execute.

ushort type / keyword

-1- indicates an integral value type.




Range: 0 - 65,535


Size: Unsigned 16-bit integer


NET Type: System.UInt16


Default value: 0




-1- can be assigned decimal, bin, or hex literal values. A cast must be used when you call overloaded methods that use -1- & int parameters. There is a predefined implicit conversion from -1- to:




▪ int ▪ uint ▪ long ▪ ulong


▪ float ▪ double ▪ decimal




... and from byte or char to -1-. Otherwise, use an explicit conversion.


yield statement / contextual keyword

When using -1- in a statement, you indicate that the method operator, or get accessor, in which it appears is an iterator, removing the need for an explicit extra class when you implement the IEnumerable & IEnumerator pattern for a custom collection type. You use a -1- return statement to return one element at a time. -1- break ends the iteration.

char type / keyword

The -1- type is used to declare an instance of the System.-1- structure that the NET Framework uses to represent a Unicode character. The value of a -1- object is a 16-bit numeric (ordinal) value. Constants of this type can be written as character literals, hex escape sequences, or Unicode U+0000 to U+FFFF. You can also cast the integral character code. Can be implicitly converted to:




▪ ushort ▪ uint ▪ long ▪ ulong


▪ float ▪ double ▪ decimal




... but not vice-versa.


Member Access

A -2- consists of a primary expression, a pre-defined type, or a qualified alias member, followed by a "." token (not including quotes), followed by an identifier, and optionally followed by a type argument list.

Expression-bodied Members

These definitions let you provide a member's implementation in a very concise, readable form. You can use -3- whenever the logic for any supported member consists of a single expression & takes the form:




member => expression;




-3- are allowed in the context of:




▪ methods ▪ constructors ▪ finalizers


▪ property get/set ▪ indexers




Note that -3- were introduced in C# 6.0, but some of the applicable forms were not available until C# 7.0.



Cast Operator ( )

In this context, ( )'s are used to specify a -2-, or type conversions. A -2- explicitly invokes the conversion operator from one type to another; the -2- fails if no such operator is defined.




The -2- is not overloadable. A -2- expression could lead to ambiguous syntax.




Ex: double x = 1234.7;


int a;


a = (int) x;

① Delegate Concatenation Operator


② Delegate Removal Operator

The binary + operator performances delegate ① -1- when both operands are of same delegate type D. If the 1ˢᵗ operand is null, the result of the operation is the value of the 2ⁿᵈ operand, & vice-versa. Otherwise, the result is a new delegate instance, that when invoked, invokes the 1ˢᵗ & then 2ⁿᵈ operand.




To perform delegate ② -1-, use the binary - operator.

① Reverse Polish Notation (postfix)


② Polish Notation (prefix)

① -2- notation specifies that operators follow their operands, and doesn't require any parentheses as long as each operator has a fixed number of operands. ① -2- notation is often used in Stack-oriented and concatenative programming languages.




Ex: Add 3 and 4: 3 4+ instead of 3 + 4




With multiple operations, operators are given immediately after their second operands; so the expression written: 3 - 4 + 5 in conventional notation would be written: 3 4 - 5 in ① -2- notation.




The opposite of ① -2- notation is ② -1- notation.

Referent Type

The type specified before the * in a pointer type is called the -1- type. Only an unmanaged type can be a -1- type since pointers aren't tracked by the garbage collector. The -1- type represents the type of the variable to which a value of the pointer type points.

into contextual keyword

The -1- contextual keyword can be used to create a temporary identifier to store the results of a group, join, or select clause into a new identifier. This itself can be a generator for additional query commands. With group or select this is sometimes a continuation.



is operator / keyword

The -1- operator checks if an object is compatible with a given type, or tests an expression against a pattern. Type compatibility is evaluated at run-time, and determines whether an object instance or the result of an expression can be converted to the specified type.




Ex: expr -1- type;




Here, type is the type of the result of expr to be converted.

Partial Type Declaration

A type declaration can be split across multiple -3-. The type declaration is constructed from its parts by following certain rules, whereupon it is treated as a single declaration during the remainder of the compile-time & run-time processing of the program. -3- specifically do not allow already compiled types to be extended.




The attributes of a -3- are determined by combining, in an unspecified order, the attributes of each of the parts. If an attribute is placed on multiple parts, it is equivalent to specifying it multiple times on the type.

Object Initializer

An -2- allows you to assign values to any accessible fields or properties of an object at creation time without having to invoke a constructor followed by lines of assignment statements. The -2- syntax enables you to specify arguments for a constructor or omit the arguments (and parentheses).




-2- are very useful in LINQ query expressions which make frequent use of anonymous types, which must be initialized with an -2-. -2- cannot be used with nullable structs.

Generic Method

A -2- is a method that is declared with type parameters. You can omit the type argument and the compiler will infer it. The same rules for type inference apply to static methods and instance methods. The compiler can infer the type parameters based on the method arguments you pass in; it cannot infer the type parameters only from a constraint or return value. Therefore type inference does not work with methods that have no parameters. Type inference occurs at compile time before the compiler tries to resolve overloaded method signatures. The compiler applies type inference logic to all -2- that share the same name. In the overload resolution step, the compiler includes only those -2- on which type inference succeeded.

Covariance

-1- enables implicit reference conversion for array types, delegate types, & generic type arguments. -1- preserves assignment compatibility. An object that is instantiated with a more derived type argument is assigned to an object instantiated with a less derived type argument. -1- for arrays enables implicit conversion of an array of a more derived type to an array of a less derived type, but this operation is not type-safe.

Hashtable Class

Form: public class -1-: ICloneable, System.Collections.IDictionary, System.Runtime.Serialization.


IDeserializationCallback, System.Runtime.Serialization.


ISerializable





Namespace: System.Collections





Inheritance: Object → -1-





Attributes: ComVisibleAttribute, SerializableAttribute




The -1- class represents a collection of key-value pairs that are organized based on the hash code of the key. Each element is stored in a DictionaryEntry object. A key cannot be null but a value can.

Implicit Inheritance

Besides any types obtained through single inheritance, all types in the .NET Type System -1- inherit from Object or a type derived from it. If Reflection is used on an empty class it will indicate that it has nine members: a parameterless default constructor, and eight members -1- inherited from Object.

Abstract Classes

An -1- class cannot be instantiated. It may contain the same type methods & accessors as the type class. It cannot be sealed, because it must be inherited. Classes that are not likewise marked as -1- that derive from it, must include actual implementations of its type methods & accessors.

Lifted Conversion Operator

Given a user-defined conversion operator that converts from a non-nullable value type S to a non-nullable value type T, a -3- exists that converts from S? to T?. This -3- performs an unwrapping from S? to S, followed by the user-defined conversion from S to T, followed by a wrapping from T to T? except that a null-valued S? converts directly to a null-valued T?.

Liskov-Substitution Principle

This object-oriented programming (OOP) principle states that if S is a subtype of T, then objects of type T may be replaced with objects of type S, without altering any of the desirable properties of T. More formally, the -2- principle is a particular definition of a subtyping relation called (strong) behavioral subtyping. It is a semantic, rather than merely syntactic, relation, because it intends to guarantee semantic interoperability of types in a hierarchy (object types in particular).

Common Language Runtime (CLR)

The -3- (abbr. -1-) is the engine at the core of managed code execution. The -3- supplies managed code with services such as:




• cross-language integration


• code access security


• object lifetime management


• debugging & profiling support



statement

This is the smallest standalone element of a programming language that expresses some action to be carried out. Each has an end point. If reachable by execution, it is said to be reachable; otherwise, it is unreachable. A -1- can be part of a list when one or more are in sequence.

Structure

Within a -1- declaration:




• fields cannot be initialized unless declared as const or static


• a default constructor or a finalizer cannot be declared


• -1- are copied on assignment; when assigned to a new variable, all data is copied, and any modification to the new copy doesn't change the data for the original copy; this is important when working with collections of value types


• -1- are value types


• can be instantiated without using a new operator


• can declare constructors with parameters


• cannot inherit from a struct or a class, and can't be the base of a class


• inherit directly from System.ValueType


• can implement interfaces


• can be nullable







Runtime Callable Wrapper

Libraries expose interfaces which are used by its clients to execute routines. -3- libraries consist of a thin layer of code, called a shim, which translates a library's interface into a compatible interface. This is done to:




▪ refine a poorly designed or complex interface


▪ allow code to work together which otherwise cannot


▪ enable cross-language, and/or run-time interoperability




-3- libraries can be implemented using the Adapter, Facade, and Proxy design patterns. To bridge differences between COM and the .NET Framework, -3- classes are provided by the run-time whenever your managed client calls a method on a COM object, a -3- is created & can be used in reverse.


Critical Sections/Regions

In concurrent programming, concurrent accesses to shared resources can lead to unexpected or erroneous behaviour, so parts of the program where this can happen are protected; these parts are then called -2-, and cannot be executed by more than one process.




Typically, the -2- accesses a shared resource, such as a data structure, peripheral device, or a network device, that wouldn't operate correctly in the context of multiple concurrent accesses. Different codes or processes may consist of the same variable or resource that needs to be read or written, but whose results depend on the order in which the actions occur, which is undesirable & precludes the need for -2-.




A -2- is often used when a multi-threaded program must update multiple related variables without a separate thread making changes to that data.

Mock Object / Fake / Stub

In OOP, -2- (aka -1- or -1-) are simulated objects that mimic the behavior of real objects in controlled ways. A programmer typically creates a -2- to test the behavior of some other object that may be impractical or impossible to incorporate into a unit test. Objects with any of the following traits might use a -2- in their place:




• supports non-deterministic results


• has states to create or reproduce


• slow (i.e. a complete database)


• doesn't yet exist, or may change behavior


• would have to include behavior information and methods exclusively for testing purposes & not for its actual task




-2- have the same interface as the objects they mimic, allowing a client object to remain unaware of whether it is using a real object or a -2-.





Assertion / Assert Class

An -1- is a statement that a predicate (Boolean-valued function) is expected to always be true at that point in the code. If the -1- evaluates to false at run-time, an -1- failure results. Programmers can use an -1- to reason about program correctness.




In the Common Language Runtime (CLR), the -1- class verifies conditions in unit tests using true/false propositions. The -1- class contains a set of static methods that evaluate a Boolean condition - if it evaluates to true, the -1- passes. An -1- verifies an assumption of truth for compared conditions; it is central to the unit test.

Program Lifecycle Phases

The -3- are stages a computer program undergoes from initial creation to deployment & execution. The seven stages are:




❶ edit time


❷ compile time


❸ distribution time


❹ installation time


❺ link time


❻ load time


❼ run-time




The -3- do not necessarily happen in a linear order, and can be intertwined in various ways.



Library

A -1- is a collection of non-volatile resources used by programs often to develop software, and may include configuration & help data, documentation, message templates, pre-written code & subroutines, classes, values, & type specifications.




A -1- is also a collection of implementations of behavior, written in terms of a language that has a well-defined interface by which the behavior is invoked. This behavior is provided for reuse by multiple, independent programs. -1- code is organized so that these unrelated programs can use it, while code that is part of a program is organized only for use within that program. The user only needs to know about the interface of the -1-, & not its internal details.

① Correctness


② Partial Correctness


③ Total Correctness





(Note: three related answers) ① -1- of an algorithm is asserted when it is said to be ① -1- with respect to a specification. Functional ① -1- refers to the input/output behavior of the algorithm (for each input it produces the expected output). A distinction is made between ② -2- which requires that if an answer is returned it will be ① -1-, and ③ -2- which additionally requires that the algorithm terminates.


① Coinduction


② Codata

(Note: two answers) In computer science, ① -1- is a technique for defining and proving properties of systems of concurrent interacting objects. ① -1- is the Mathematical dual to structural ① -1-. A ① -1- defined type is known as ② -1-, and is typically an infinite data structure such as a stream. As a definition or specification, ① -1- describes how an object may be "observed", "broken down", or "destructed" into simpler objects.


SafeHandle Class

Form: public abstract class -1- : System.Runtime.ConstrainedExecution.


CriticalFinalizerObject, IDisposable




Namespace: System.Runtime.


InteropServices





Inheritance: Object → CriticalFinalizerObject


→ -1-



Attributes: SecurityCriticalAttribute




The -1- class represents a wrapper class for OS handles & must be inherited. The -1- class provides critical finalization of handle resources, preventing premature garbage collection of handles & from being recycled by Windows to reference unintended unmanaged objects.

① Span❬T❭ Struct


② ReadOnlySpan❬T❭ Struct

Form: public struct ① -1-




Namespace: System




Inheritance: Object → ValueType → ① -1-




The ① -1- struct provides a type & memory-safe representation of a contiguous region of arbitrary memory. ① -1- is a ref struct that is allocated on the stack rather than on the managed heap. Ref structs have a number of restrictions to ensure they can't be promoted to the managed heap (no boxing or assignment to variable of type object, dynamic or to interfaces; cannot be fields in reference types, & cannot be used across await & yield boundaries).




Calls to the Equals(obj) or GetHashCode methods throw exceptions. Has an immutable, read only version called ② -1- struct.


Bytecode

-1-, also called portable or p-code, is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, -1- are compact numeric codes, constants, & references (normally numeric addresses) that encode the result of compiler parsing & semantic analysis of things like type, scope, & nesting depth of program objects.

Link Time / Link Editor

① -2- refers to the period of time during the creation of a computer program in which a ② -1- is being applied to that program. ① -2- occurs after compile time and before run-time. Specifically, a ② -1- is a program that takes one or more object files generated by a compiler & combines them into a single executable file, library file, or another object file. A simpler version that writes its output directly to memory is called the loader, though loading is typically considered a separate process.




The operators performed at ① -2- usually include fixing up the addresses of externally referenced objects & functions, various kinds of cross-module checks (i.e. type checks on externally visible identifiers), & some optimizing compilers delay code generation until ① -2- because it is here that information about a complete program is available to them. Also, resolving external variables is done at ① -2-.

Reflection

-1- is the ability of a program to examine, introspect, & modify its own structure and behavior at run-time. -1- - oriented program components can monitor the execution of an enclosure of code, and can modify itself according to a desired goal, related to that enclosure; typically by dynamically assigning code at run-time. In OOP languages, -1- allows inspection of classes, fields, interfaces, & methods without knowing their names at run-time.

select clause / contextual keyword

The -1- clause is used in a query expression to specify the type of values that will be produced when the query is executed. The result is based on the evaluation of all the previous clauses & on any expressions in the -1- itself.




A query expression must end with either a -1- or group clause.

this keyword

The -1- keyword refers to the current instance of the class & is also used as a modifier of the first parameter of an extension method. It can be used to qualify members hidden by similar names, to pass an object as a parameter to other methods, or to declare indexers. Static member functions cannot use the -1- pointer.

try statement / keyword

The -1- statement can be used in three contexts:




❶ with the catch block


❷ with the finally block


❸ or with both the catch & finally blocks




In each case, the -1- statement is the first block that contains the guarded code that may cause the exception. The block is executed until completion, or until an exception is thrown. From inside this block, initialize only variables declared within.

typeof operator / keyword

The -1- operator is used to obtain the System.Type instance for a type. To obtain the run-time type of an expression, you can use the NET Framework method GetType(). The -1- operator cannot be overloaded.




-1- can also be used on open generic types. Types with more than one type parameter must have appropriate number of commands in specification.




Form: System.Type type = -1- (int);

Separation of Concerns Principle

-3- is a design principle for separating a program into distinct sections such that each section addresses a separate concern. A concern can be as general as the details of the hardware the code is being optimized for, or as specific as the name of a class to instantiate. A program embodying -3- is called modular, & is achieved through encapsulation of information inside a section of code with a well-defined interface.

Helper Class

A -2- is used to assist in providing some functionality which isn't the main goal of the application or class in which it is used. This may be implemented as a static class with only static methods; this helps when functionality needs to be global and grouped together.

Binder Class

Form: public abstract class -1-




Namespace: System.Reflection




Inheritance: Object → -1-




Attributes: ClassInterfaceAttribute, ComVisibleAttribute, SerializableAttribute




The -1- class selects a member from a list of candidates and performs type conversion from actual argument type to formal argument type. Implementations of this class are used by methods such as Type.InvokeMember, which selects from a set of parameter types & argument values; Type.GetMethod which selects a method based on parameter types, and so on.




A default implementation is provided by the Type.Default-1- property.

Dynamic Runtime Lookup (DLR) or Dynamic Language Runtime

The -3- (abbr. -1-) is the run-time environment that adds a set of services for dynamic languages to the Common Language Runtime (CLR). The -3- makes it easier to develop dynamic languages to run on the .NET Framework, & to add dynamic features to statically-typed languages.




Dynamic languages can identify the type of an object at run-time, whereas in statically-typed languages, you specify them at design time. Advantages of the -3- include:




▪ simplifies porting


▪ enables dynamic features in statically-typed languages


▪ sharing libraries


▪ fast dynamic dispatch


Futures, Promises, Delays, & Deferreds

-1- (AKA -1-, -1-, and/or -1-) refer to constructs used for synchronizing program execution in some way in concurrent programming languages. They describe an object that acts as a proxy for a result that is initially unknown, usually because the computation of some value isn't complete.

① Continuation Tasks


② Antecedents

(Note: two related answers) A ① -2- (or simply -1-) is an asynchronous task that is invoked by another task, which is known as the ② -1-, when the ② -1- finishes.




Traditionally, ① -2- have been done by callback methods. You can:




▪ pass data from the ② -1- to the ① -2-


▪ specify the precise conditions under which the ① -2- will be invoked or not


▪ cancel a ① -2- either before it starts, or cooperatively as its running, etc.






Method

A -1- is a code block that contains a series of statements. A program causes the statements to be executed by calling the -1- & specifying arguments. The -1- signature includes:




▪ an access level ▪ optional modifiers


▪ the return value ▪ the -1- name


▪ any parameters




Unless the return value is void, the -1- can return a value to the caller with the return keyword.



System.Threading

The -1-.-1- namespace provides classes & interfaces that enable multi-threaded programming. In addition to the classes for synchronizing thread activities and access to data (Mutex, Monitor, Interlocked, AutoResetEvent, etc.) this namespace includes a ThreadPool class that allows you to use a pool of system threads & a Timer class.

Memento Pattern

The -1- design pattern provides the ability to restore an object to its previous state (undo via rollback). It is implemented with three objects:




❶ the originator


❷ a caretaker


❸ and the -1-




The originator has an internal state that the caretaker will alter, but it has the -1- which it can return to the originator, thus rolling back any changes.

① Containerization
② Container




(Note: two related answers) ① -1- is an approach to software development in which an application or service, its dependencies, and its configuration (abstracted as deployment manifest files) are packaged together as a ② -1- image. The ① -1- of the application can then be tested as a unit and deployed as a ② -1- image instance to the host OS.

Object.ToString Method

This method is a major formatting method in which the default implementation returns the fully qualified name of the object's type. Types frequently override the -1- method to provide a more suitable string representation of a particular type, or to provide support for format strings or culture-sensitive formatting.




Both structs and enumerations can override -1-; interfaces and delegates do not. Additionally, types may overload -1- to provide versions with parameters; or they may extend it by altering its behavior. Implement IFormattable if more formatting control is desirable.

System.ComponentModel Namespace

The -1-.-1- namespace provides classes that are used to implement the run-time and design-time behavior of components & controls. It also includes the base classes & interfaces for implementing attributes & type converters, binding to data sources, & licensing components.

Generic Class Considerations

When creating your own -2- consider:




❶ Which types to generalize into type parameters - as a rule, the more types you can parameterize, the more flexible & reusable your code becomes; but, too much generalization can create code that is difficult to read & understand.



❷ What constraints to apply to the type parameters - apply the max constraints possible that will still let you handle the types you must handle.




❸ Whether to factor generic behavior into base classes & subclasses - -2- can serve as base classes, so the same design considerations apply here as with concrete classes.



❹ Whether to implement one or more generic interfaces - if you're designing a class that will be used to create items in a generics-based collection, you may have to implement an interface such as IComparable, where T is the type of your class.

Anonymous Types

-2- are class types that derive directly from object and that cannot be cast to any type except object. The compiler provides a name for each -2-, although your application cannot access it.




The Common Language Runtime (CLR) makes no difference between an -2- and any other reference type. -2- provide a way to encapsulate a set of read-only properties into a single object without explicitly defining a type first. Create -2- by using the new operator with an object initializer.

System.Runtime.Serialization Namespace

The -1-.-1-.-1- namespace contains classes that can be used for serializing and deserializing objects. Its ISerializable interface provides a way for classes to control their own serialization behavior. Classes in -1-.-1-.-1-.Formatters namespace control the actual formatting of various data types encapsulated in the serialized objects.

System.Console Class

Form: public static class -1-




Namespace: System




Inheritance: Object → -1-




Attributes: None




The -1- class represents the standard input, output, and error streams for -1- applications. The -1- is an operating system window where users interact with the OS or with a text-based -1- application by entering text input through a keyboard.




The -1- class provides basic support for applications that read characters from, and write character to, the -1-.

Windows Presentation Foundation (WPF)

The -3- (abbr. -1-) is a graphical subsystem for rendering user interfaces in Windows-based applications. -3- uses DirectX and attempts to provide a consistent programming model and separates the user interface from the business logic. -3- employs XAML, an XML-based language, to define and link various interface elements.

System.Diagnostics

The -1-.-1- namespace provides classes that allow you to interact with System processes, event logs, & performance counters. It also provides classes for debugging applications & to trace the execution of code.

Turing Machine

A -2- is a mathematical model of computation that defines an abstract machine, which manipulates symbols on a strip of tape according to a table of rules. Despite the model's simplicity, given any computer algorithm, a -2- can be built to simulate its logic. A -2- consists of:




• a tape divided into cells


• a head that reads and writes symbols on the tape


• a state machine tracking the state of the -2-


• a finite table of instructions



Trust Boundary

In computer science & security, a -2- is a limit beyond which program data or execution changes its level of "trust". It refers to any distinct boundary within which a system trusts all sub-systems (including data). A "-2- violation" refers to a vulnerability where software trusts unvalidated data that crosses the boundary.

Unary Operators

The -1- operators are 2ⁿᵈ in precedence, after the Primary operators. These are the -1- operators:




+x / -x Returns value/Numeric negation


!x Logical Negation


~x Bitwise Complement


++x / --x Prefix Increment/Decrement


(T)x Type casting


await Awaits a Task


&x Address-of


*x Pointer Derefencing

Relational & Type-testing Operators

The -3- operators are 6ᵗʰ in precedence, coming after the Shift operators. These are the -3- operators:




x < y Less than


x > y Greater than


x y Less than or equal to


x y Greater than or equal to


is Type compatibility


as Type conversion

① await operator


② await expression


③ anonymous function


④ lock statement


⑤ unsafe context


⑥ query expression


⑦ Task


⑧ awaitable


⑨ awaiter

(Note: nine answers; difficult) The ① -2- is used to suspend evaluation of an async function enclosing it until the async operation has completed. Within that function, an ② -2- may not occur:




⍟ within a nested (non-async) ③ -2-


⍟ inside the block of a ④ -2-


⍟ inside an ⑤ -2-


⍟ also, most places in a ⑥ -2- (because those are syntactically transformed to use non-async lambda expressions)




The operand of an ② -2- is the ⑦ -1- (represents async operation that may or may not be complete at the time ② -2- is evaluated). The ⑦ -1- is required to be ⑧ -1-. The purpose of the GetAwaiter method is to obtain an ⑨ -1- for the ⑦ -1-.



① Binary Search Algorithm
② Search Algorithm




(Note: two related answers) ① -2- is an ② -1- algorithm that finds the position of a target value within a sorted array. It compared the target value to the middle element of the array. If they are not equal, the half in which the target cannot lie is eliminated & the ② -2- continues on the remaining half, again taking the middle element to compare to the target value, & repeating this until the target value is found.




Implementing ① -2- requires attention to its subtleties like its exit conditions & midpoint calculation, particularly if the values in the array are not all of the whole numbers in the range.

Buffer Class

Form: public static class -1-




Namespace: System




Inheritance: Object → -1-




Attributes: ComVisibleAttribute




The -1- class manipulates arrays of primitive types. -1- only affects arrays of primitive types, and doesn't apply to objects. Each primitive type is treated as a series of bytes without regard to any behavior or limitation associated with the primitive type.




-1- provides methods to copy bytes from one array of primitive types to another, get a byte from an array, set a byte in an array, & obtain the length of an array.

Environment Class

Form: public static class -1-




Namespace: System




Inheritance: Object → -1-




Attributes: ComVisibleAttribute




-1- provides information about and means to manipulate the current environment and platform. Information includes:




▪ command-line arguments


▪ exit code


▪ environment variable settings


▪ call stack contents


▪ system boot times


▪ CLR version





Priority Inversion

-2- is a problematic scenario in scheduling & can occur when a high priority task is indirectly preempted by a low-priority task, which effectively inverts their relative priorities. This violates the priority model that high-priority tasks can only be prevented from running by other high-priority tasks & briefly by low-priority tasks, which will quickly complete their use of a resource shared by both.

① Arithmetic Shift


② Logical Shift

(Note: two related answers) An ① -2- is a shift operation whose left operand is a signed quantity. In a right shift operation, the sign bit is propagated into the bits vacated by the -2-.




A ② -2-, also called a bitwise shift, is a bitwise operation wherein the bits in the 1ˢᵗ operand are shifted by the number of positions specified by the 2ⁿᵈ operand. The operator specifies the direction the bits are shifted.


① Tlbimp.exe (Type Library Importer)


② Ildasm.exe (IL Disassembler)


③ Ilasm.exe (IL Assembler)

(Note: three related answers) The ① -3- (abbr. -1-) converts the type definitions found within a COM type library into equivalent definitions in a common language runtime assembly. The output of ① -3- is a binary file (an assembly) that contains runtime metadata for the types defined within the original type library. You can examine this file with tools such as the ② -2- (abbr. -1-) which takes a PE file containing IL code & creates a text file suitable as input to its tool counterpart ③ -2- (abbr. -1-).

① Pointer Conversions
② Pointer Types




(Note: two related answers) There exists implicit conversions of ② -2- which might occur in situations such as method invocations & assignment statements:




• from any ② -2- to void*


• from null to any ② -2-




There are also explicit ① -2-:




• from any ② -2- to any other ② -2-


• from sbyte, byte, short, ushort, int, uint, long, or ulong to any ② -2-, & vice-versa


Abstraction

-1- involves the facility to define objects that represent abstract "actors" that can perform work, report on and change their state, and communicate with other objects in the system. Encapsulation refers to hiding state details, but extending the concept of data type to associate behavior most strongly with the data, & standardizing the way that different data types interact, is the beginning of -1-.




When -1- proceeds into the operations defined, enabling objects of different types to be substituted, it is called polymorphism.

dynamic type / keyword

The -1- type enables the operations in which it occurs to bypass compile-time checking; these are instead resolved at run-time. It helps to simplify access to COM APIs, such as the Office Automation APIs, & also -1- APIs such as IronPython libraries, etc.




-1- behaves like object in most cases, however expressions are not resolved or type checked by the compiler.

① Identity


② Implicit Numeric


③ Implicit Reference


④ Implicit Enumeration


⑤ Implicit Nullable


⑥ Implicit Interface


⑦ Unboxing


⑧ Implicit Dynamic


⑨ Implicit Null Literal


⑩ Implicit Constant Expression


⑪ Anonymous Function


⑫ Method Group


⑬ User-defined Implicit





Name the thirteen types of implicit conversions.

Singleton Pattern

The -1- pattern allows for designing a class which only allows a single instance of itself to be created and usually gives simple access to that instance. Most commonly, -1- don't allow any parameters to be specified. They are typically created lazily. There are various ways of implementing the -1- pattern, & they share four characteristics:




❶ a single constructor that is private & parameterless


❷ the class is sealed


❸ a static variable which holds a reference to the single created instance


❹ a public static means of getting the reference to the single created instance, creating one if necessary

Ref Locals

A -2- variable is used to refer to values returned using ref return. A -2- variable must be initialized & assigned to a ref return value. Any modifications to the value of the -2- are reflected in the state of the object whose method returned the value by reference.




Define a -2- by using the keyword ref before the variable declaration, as well as immediately before the call to the method that returns the value by reference.

Deconstruction Operation

Retrieving multiple field & property values from an object can be difficult since you have to assign a field or property value to a variable on a member-by-member basis. The same is true with tuples. However, with a -1- operations, you can retrieve multiple elements from a tuple, or field, property, & computed values from an object; in both cases you assign these to individual variables.

Binary-Code Compatible (AKA Object-Code Compatible)

-3- (aka -3-) is a property of computer systems, meaning they can run the same executable code, typically machine code, for a general-purpose computer CPU (central processing unit). For a compiled program on a general OS, -3- often implies that not only the CPUs (instruction set) of the two computers are -3-, but also that interfaces & behaviors of the OS & ABIs, & the ABIs corresponding to those APIs are sufficiently equal. -3- is a major benefit when developing programs for multiple OSs.

Explicit Enumeration Conversion

The -2- conversions are:




❶ From sbyte, byte, short, ushort, int, uint, long, ulong, char, float, double, or decimal to any enum type; and from any enum type to the aforementioned types.


❷ From any enum type to any other enum type.

① #define


② #undef

(Note: two related answers) You use ① -1- to specify a symbol, but can't be used to declare constant values. Symbols can be used to specify conditions for compilation. You can test for the symbol with either #if or #elif. Use the ConditionalAttribute to perform conditional compilation. You can undefine a symbol with ② -1-.




A variable name should not be passed to a preprocessor directive, & a symbol can only be evaluated by one. The scope of a symbols created by ① -1- is the file it was defined in.

foreach statement / keyword

The -1- statement repeats a group of embedded statements for every element in an array or an object collection that implements the System.Collections.IEnumerable, or its generic interface. Cannot add or remove items with -1-, so use a for loop instead.

from contextual keyword

A query expression must begin with the -1- clause, and can contain subqueries which also begin with it. -1- specifies:




• the data source on which the query will be run


• a local range variable that represents each element in the source sequence




Both the data source and range variable are strongly-typed. Compound -1- clauses may be used in cases where each element in the source sequence is, or contains, a sequence.

① mscorlib.dll


② Multi-language Standard Common Object Runtime Library


③ assembly

(Note: three answers) Some of the .NET types are used directly by the CLR & are essential for the managed hosting environment. These types reside in an ③ -1- called ① -1- and include C#'s built-in types, basic collection classes, types for stream processing, serialization, reflection, threading, & native interoperability.




① -1- is an abbreviation for ② "-7-".

① Hypertext Transfer Protocol (HTTP)


② HTTP/2


③ hypertext

(Note: three related answers) The ① -3- (abbr. -1-) is an application protocol for distributive, collaborative, hypermedia information systems. ① -3- is the foundation of data communication for the WWW, where ③ -1- documents include hyperlinks to other resources that users can easily access.




② -1- is the most recent version of ① -3-; it changes how the data is framed & transported between the client and the server.


① Abstract Factory Pattern


② Factory

(Note: two related answers) The ① -2- pattern provides a way to encapsulate a group of individual ② -1- that have a common theme without specifying their concrete classes.




In normal usage, the client software creates a concrete implementation of the ① -2- pattern & then uses the generic interface of the ② -1- to create the concrete objects that are part of the theme. The client doesn't know or care which concrete object it gets from each of these internal ② -1-, since it uses only the generic interfaces of their product.




This pattern separates the details of implementation of a set of objects from their general usage & relies on object composition as object creation is implemented in the methods exposed in the ② -1- interface.




A ② -1- is the location of a concrete class in the code at which objects are constructed. The intent of the ① -2- pattern is to insulate the creation of objects from their usage & to create families of related objects without depending on their concrete classes.



① Semaphore


② Local Semaphore


③ Named System Semaphore

(Note: three related answers)


Form: public sealed class -1- : System.Threading.WaitHandle




Namespace: System.Threading




Inheritance: Object → MarshalByRefObject →
WaitHandle → -1-




Attributes: ComVisibleAttribute




The ① -1- class limits the number of threads that can access a resource/pool of resources concurrently. Threads enter the ① -1- by calling the WaitOne method, which is inherited from the WaitHandle class, & release the ① -1- by calling the Release method; these cause the ① -1- to increment (Release) or decrement. When the count is zero, further requests block until other threads release the ① -1-. There is no guaranteed order, such as LIFO/FIFO, in which blocked threads enter.




① -1- are of two types: ② -1- and ③ -2-. A ② -1- only exists within your process and can be used by any thread with a reference to the local ① -1- object. ③ -2- are visible throughout the OS & can sync process activities.






① #region


② #endregion

(Note: two related answers) ① -1- lets you specify a block of code that can be expanded or collapsed when using the outlining feature in Visual Studio. A ① -1- must be terminated with a ② -1- directive, and cannot overlap with a #if block. It can be nested in a #if block & vice-versa.

Syntax Nodes

-2- are one of the primary elements of syntax trees. -2- represent syntactic constructs such as declarations, statements, clauses, & expressions. Each category of -2- is represented by a separate class derived from Microsoft.CodeAnalysis.-2-. The set of classes isn't extensible.




All -2- are non-terminal nodes, which means they always have other nodes & children. Because nodes & trees are immutable, the parent of a node never changes. These can be accessed with the SyntaxNode.Parent property.

Late-bound object

A -3- is an object that is assigned to a variable of type object at runtime. It is used in object-oriented programming (OOP) in the object binding process. It attaches the object library within the code at program/application runtime. A -3- might also be called a dynamic bound object.

Mutex Class

Form: public sealed class -1- : System.Threading.WaitHandle




Namespace: System.Threading




Inheritance: Object → MarshalByRefObject → WaitHandle → -1-




Attributes: ComVisibleAttribute




A -1- is a synchronization primitive that can also be used for inter-process synchronization. This stands for mutual exclusion & ensures blocks of code are executed only once at a time. It can use the OpenExisting method to check for existence of a -1-, and it provides the WaitOne, WaitAll, and WaitAny methods to block the current thread until the -1- is released.

Dictionary Class

Form: public class -1- : System.Collections.Generic.


ICollection❬System.Collections.Generic.


KeyValuePair❬TKey, TValue❭❭, System.Collections.


Generic.IDictionary❬TKey, TValue❭, System.Collections.


Generic.IEnumerable❬System.Collections.Generic.


KeyValuePair❬TKey, TValue❭❭, System.Collections.


Generic.IReadOnlyCollection❬System.Collections.Generic.


KeyValuePair❬TKey, TValue❭❭, System.Collections.


Generic.IReadOnlyDictionary❬TKey, TValue❭, System.Collections.IDictionary, System.Runtime.Serialization.


IDeserializationCallback, System.Runtime.Serialization.


ISerializable




Namespace: System.Collections.Generic




Inheritance: Object → -1-




Attributes: ComVisibleAttribute, SerializableAttribute




-1- are special lists, whereas every value in the list has a key, which is also a variable. When defining a -1-, a generic definition must be provided with two types: the type of the key and the type of the value.




To add a single value to the -1-, use the Add method. To check if the -1- has a certain key in it, use the ContainsKey method. The Remove method removes an item from the -1- very quickly & efficiently; in contrast to removing an item from a list which can be slow. This is because the other finds the item by its key instead of its value.

Tuple

A -1- is a type that is pre-defined with a lightweight syntax, rules for conversions based on number (aka cardinality), types of elements, and consistent rules for copies & assignments. As a trade-off, -1- do not support some of the OOP idioms associated with inheritance.




A -1- is a finite, ordered list of values, possibly of different types, which is used to bundle related values together without having to create a specific type to hold them. Since they are classes, i.e. reference types, they must be allocated on the heap, & garbage collected when no longer in use. They can also be null. They do not need specific names as they are implicitly given the names Item1, Item2, and so on. You may also explicitly name them.

Synchronization Context

If the return type of an async function is void, then because no task is returned, the function instead communicates completion & exceptions to the current thread's -2-.




The definition of the -2- is implementation-defined, but it is a representation of "where" the current thread is running. The -2- is notified when evaluation of a void-returning async function commences/completes successfully, or causes an uncaught exception to be thrown. This allows the -2- to track how many void-returning async functions are running under it, and to decide how to propagate their exceptions.

① Implicit Constant Expression Conversion


② Constant Expression

(Note: two related answers) An ① -3- conversion permits the following conversions:




• A ② -2- of type int can be converted to sbyte, byte, short, ushort, uint, or ulong provided the value of the ② -2- is within the range of the destination type.




• A ② -2- of type long can be converted to ulong provided the value of the ② -2- is not negative.


Logic Gate

In electronics, a -2- is an idealized or physical device implementing a Boolean function on one or more binary inputs and producing a single output. An idealized -2- may have, i.e., zero rise time & unlimited fan-out.




-2- are primarily implemented using diodes or transistors acting as electronic switches, but can be constituted from many other components. With amplification, -2- can be cascaded in the same way that Boolean functions can be composed, allowing the construction of a physical model of all Boolean logic, and thus describing all the related algorithms & mathematics.

① relation


② binary relation

(Note: two related answers) A ① -1- is a function which takes two items and returns a bool which indicates whether the given relationship holds or doesn't hold. More formally, a ② -2- on a Set A is a set of ordered pairs of element A. It is a subset of the Cartesian product: A² = A × A. ② -2- are used to model concepts like "is greater than", "is equal to", & "divides" in Arithmetic, "is congruent to" in Geometry, etc.



Assignment Compatibility

-2- is the ability to assign a value of a more specific type to a storage of a compatible, less specific type. The two types are compatible for the purposes of verifying legality of assignments. -2- stands in relation to the variance of interfaces & their type parameters.

constituent type

Types that are used in the declaration of a member are called the -1- types of that member. Possible -1- types are the type of a constant, property, field, event, or indexer, the return type of a method or operator, & the parameter types of a method, indexer, operator, or instance constructor.




The -1- types of a member must be at least as accessible as the member itself.

① volatile read


② volatile write


③ write


④ volatile

(Note: four related answers) A ① -2- has "acquire semantics"; that is, it is guaranteed to occur prior to any references to memory that occur after it in the instruction sequence. A ② -2- has "release semantics"; that is, it is guaranteed to happen after any memory references prior to the ③ -1- instruction in the instruction sequence.




Both of these are restrictions on optimization techniques that re-order instructions in multi-threaded programs. Specifically, these re-orderings affect fields, unless declared as ④ -1-.


interface type / keyword

An -1- contains only the signatures of methods, properties, events, or indexers. The -1- keyword is used to declare the aforementioned type. A class or struct that implements the -1- must implement the members of the -1- that are specified in the -1- definition.




-1- can be a member of a namespace or class, and can inherit from one or more base -1-.

abstract keyword

The -1- keyword indicates that the thing being modified has a missing or incomplete implementation. Used with classes, methods, properties, indexers, & events. When used with classes it means that the class is intended only as a base class. When used with members, or those in such as class, it must be implemented by derived classes.

Magic Numbers

The term -1- has several meanings:




❶ a constant numerical or text value used to identify a file format or protocol


❷ distinctive, unique values to be mistaken for other meanings, i.e. - GUIDs


❸ unique values with unexplained meaning or multiple occurrences which could, preferably, be replaced with named constants.

Open / Closed Principle

The -2- principle states: "software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification"; that is, such an entity can allow its behavior to be extended without modifying its source code. There are two variations that both incorporate inheritance, but differ in other ways:




❶ Polymorphic


❷ Meyers


WebAssembly

-1- is an open standard that defines a portable binary code format for executables & corresponding textual assembly languages, as well as interfaces for facilitating interactions between such programs, & their host environments.




-1- main goal is to enable high performance applications on web pages, but it works in other environments as well.

Transparent Identifiers

-2- are represented by an * (an asterisk) and take the place of an identifier in a from clause in a query expression. According to the specification:




❶ they are introduced only by query rewriting


❷ each -2- has exactly one associated anonymous type (introduced in the same re-write step as the -2-)


❸ when a -2- is in scope, so are its members (transitively)




Ex: from * in e1.Select(x1 => new { x1, x2 = e2 })...




Business Logic

This is the part of the program that encodes the real-world business rules that determines how data can be created, stored, & changed. -2- is contrasted with the rest of the software that might be concerned with lower-level details of managing a database, or displaying the user interface, system infrastructure, or generally connecting various parts of the program.

HTTPClient Class

Form: public class -1- : System.Net.Http.


HttpMessageInvoker




Namespace: System.Net.Http




Inheritance: Object → HttpMessageInvoker


→ -1-




-1- provides a base class for sending HTTP requests and receiving HTTP responses from a resource identified by a URI. An instance acts as a session to send requests, and is a collection of settings applied to all of its received requests. Also, each uses its own connection pool, isolating its requests from requests executed by other instances.

① System.Nullable❬T


② Nullable Type

② -2- are instances of the ① -1-.-1- struct. A ② -2- can represent the correct range of values for its underlying value type, plus an additional null value. ② -2- have the following characteristics:




❶ represent value-type variables that can be assigned the value of null; they cannot be based on reference values


❷ The syntax T? is shorthand for ① -1-.-1-, where T is a value-type


❸ Use GetValueOrDefault method to return either the assigned value or the default value for the underlying type if it is null




① Stack Allocation
② Stack




(Note: two related answers) ① -2- is the process of static memory allocation whereby variables are stored directly to the memory. Access to this memory is very fast and its allocation is dealt with when the program is compiled. The ② -1- is always reserved in a LIFO order. You should use ① -2- when you know exactly how much you need to allocate before compile-time & it is not too big. The ② -1- is thread-specific and is important to consider in exception handling & thread executions.

Standard Conversions

The -1- conversions are those pre-defined conversions that can occur as a part of a user-defined conversion.




The following implicit conversions are classified as -1- implicit conversions:




• Identity


• Implicit numeric


• Implicit Nullable


• Implicit Reference


• Boxing


• Implicit constant expression


• Implicit conversions involving type parameters




The implicit user-defined conversions are specifically excluded. The -1- explicit conversions include all of the aforementioned plus a subset of the explicit conversions for which an opposite -1- implicit conversion exists.




In an unsafe context a -1- implicit conversions exists from any pointer type to the type void*. The CallerInfo attributes make use of -1- conversions. No -1- conversion exists between bool and other types.




Implicit Null Literal Conversion

The -3- conversion produces the null value of the given nullable type, and exists from the null literal to any nullable type.

① Proxy Server


② Proxy/Proxies


③ Adaptive Proxy


④ Static Proxy

A ① -2- handles client requests for resources. A ② -1- can return a requested resource from its cache or forward the request to the server where the resource resides. ② -1- can improve network performance by reducing the number of requests sent to remote servers. ② -1- can also restrict access to resources.




In the .NET Framework, a ② -1- can come in two varieties:




❶ ③ -2- adjust their settings when the network configuration changes


❷ ④ -2- are usually configured explicitly by an application


Behavioral Patterns

-2- identify common communication patterns among objects and realize these patterns. By doing so they increase flexibility in carrying out this communication.

① #warning


② #error

(Note: two answers) ① -1- lets you generate a level one warning from a specific location in your code. It is commonly used as a conditional directive. Similarly, ② -1- lets you generate an error from a specific location.




These are also diagnostic directives. These are treated like normal warnings & errors.

Graph Reduction

-2- implements an efficient version of non-strict evaluation, which is an evaluation strategy where the arguments to a function are not immediately evaluated. -2- can also be referred to as lazy evaluation.

Predicate Delegate

A -1- is a pre-made delegate that takes a type, as well as an instance of said type, and returns a Boolean value.




Ex: public delegate bool Something (T obj);




-1- evaluates a condition and returns true or false accordingly. It is often used in LINQ statements where it can filter a sequence of values; the -1- is defined as a parameter to the Where method.




-1- is used by several methods of the Array & List classes to search for elements in a collection.

Using Statement

The -2- provides a convenient syntax that ensures the correct use of IDisposable objects. When the lifetime of an IDisposable object is limited to a single method, you should declare & instantiate it with a -2-.




The -2- calls the Dispose method on the object in the correct way, and it causes the object to go out of scope as soon as Dispose is called. Within the -2- block, the object is read-only and cannot be modified or reassigned.

Parametric Polymorphism

-2- is a technique that enables the generic definition of functions & types without a great deal of concern for type-based errors. -2- allows languages to be more expressive while writing generic code that applies to various types of data. Functions written in context with -2- work on various data types. -2- is the core principle behind generic programming.

Stack Unwinding

-2- is the technique used when deconstructing function entries to restore or clean up records during runtime. This is usually done when control is switched from one record to the calling record, or when an exception is discarded & control is transferred from a try block to a handler. It may be done automatically on exiting a process by deconstructors.

Meta-programming

-1- is a programming technique in which programs can treat programs as their data. Programs can be designed to read, generate, analyze, or transform other programs, & even modify itself while running.




-1- can be used to move computations from run-time to compile-time, to generate code using compile-time computations, & to enable self-modifying code.




In the .NET Framework, -1- is supported via the Reflection API and T4 Text Templates.

Facade Pattern

The -1- design pattern involves an object (called a -1-) that provides a simplified interface to a larger body of code, such as a class library.




A -1- can:




▪ make a software library easier to use and understand


▪ make the library more readable


▪ reduce dependencies of outside code on the inner workings of a library


▪ wrap a poorly designed set of APIs within a single good API



operator keyword

Use the -1- keyword to overload a built-in -1- or to provide a user-defined conversion in a class or struct declaration.




-1- defines a static member function.

out keyword

❶ As a parameter modifier, the -1- keyword causes arguments to be passed by reference, except it doesn't require that the variable be initialized before it is passed. To use this, both the method definition & the calling method must explicitly use the -1- keyword. The called method must assign a value before the method returns. This isn't considered part of the method signature at compile-time.



❷ For generic type parameters, the -1- keyword specifies that the type parameter is covariant. It can be used in generic interfaces & delegates.

true literal / operator / keyword

❶ As an overloaded operator, -1- returns the Boolean value true to indicate an operand is true, and false otherwise. A type that overloads to true & false operators can be used for the controlling expression in if, do, while, & for statements, and in conditional expressions.




❷ In this context, -1- represents the Boolean value true.

by contextual keyword

The -1- contextual keyword is used in the group clause in a query expression to specify how the returned items should be grouped.

Code Folding

-2- is a feature in text editors, source code editors, and Integrated Development Environments (IDEs) that allow the user to selectively hide and display sections of a currently-edited file as part of routine edit operations. -2- allows the user to manage large amounts of text while only viewing relevant subsections at a given time.

Integrated Development Environment (IDE)

An -3- (abbr. -1-) is a software application that provides facilities to programmers for software development. It consists of a source code editor, build automation tools, and a debugger.




The C# -3- also contains the Toolbox & Designer, Solution Explorer, Project Designer, Class View, Properties Window, Object Browser, and Document Explorer.

var type / keyword

Variables that are declared at the method scope can have this implicit type, -1-, which is just as strongly-typed, but is determined by the compiler. -1- must be used when the result is a collection of anonymous types, whose type is available only to the compiler.

virtual modifier / keyword

The -1- keyword is used to modify a method, property, indexer, or event declaration, and allow for it to be overridden in a derived class. The implementation of a -1- method can be changed by an overriding member in a derived class. The run-time type of the object is checked for such a member on invocation of the -1- method. By default, methods are non- -1-, and cannot be overridden.

AttributeUsageAttribute

The -1- attribute specifies the usage of another attribute class. The indicated attribute class must derive from Attribute either directly or indirectly. The three properties of -1- are set by defining the following parameters:




❶ ValidOn, a positional parameter that specifies program elements


❷ AllowMultiple, named parameter that allows more than one attribute to be applied


❸ Inherited


System.OverflowException

System.-1- is the exception thrown when an arithmetic operation in a checked context overflows.

Anonymous Method

Creating an -2- is essentially a way to pass a code block as a delegate parameter. Lambda expressions supersede -2- as the preferred way to write inline code, but -2- allow you to omit the parameter list while lambdas cannot. This means that an -2- can be converted to delegates with a variety of signatures.




By using an -2-, you reduce the code overhead in instantiating delegates, because you don't have to create a separate method.

Object Pool Pattern

The -2- pattern uses a set of initialized objects kept ready to use rather than allocating & destroying them on demand. A client of the -2- will request an object from the -2- & perform operations on the returned object. When finished, it returns the object to the -2- rather than destroying it; this is done either manually or automatically.




The -2- pattern is primarily used for performance, often boosting it significantly. Care must be taken to implement, as this will complicate object lifetime.

Thread

A -1- of execution is the smallest sequence of programmed instructions that can be managed independently by a scheduler, which is often part of the OS. Implementation varies, but usually a -1- is a component of a process; several -1- can be in one process executing concurrently & sharing resources such as memory while different processes don't share resources.

① Inferred Return Type


② Inferred Result Type

The ① -2- type of an anonymous function F is used during type inference & overload resolution. The ① -2- type can only be determined where all parameter types are known, either because they're explicitly given, provided through an anonymous function conversion, or inferred during type inference on an enclosing generic method invocation.




The ② -2- type is determined as follows:




• if the body of F is an expression that has a type, then the ② -2- type of F is the type of that expression


• if the body of F is a block & the set of expressions in the block's return statements has a best common type T then the ② -2- type of F is T


• otherwise, an ② -2- type cannot be inferred




The ① -2- type is determined as follows:




• if F is async & its body is either an expression classified as nothing, or a statement block where no return statements have expressions, the ① -2- type is System.Threading.Tasks.Task


• if F is async & has an ② -2- type T, the ① -2- type is System.Threading.Tasks.Task<T>


• if non-async & has ② -2- type T, the ① -2- type is T


• otherwise, none is determined.





Overflow Exception Control

The checked & unchecked operators & statements allow for -3- by allowing programmers to control certain aspects of some numeric calculations.

Type Information

You can use members of the Type class to get -2- on the members of that type. This is part of the Reflection process.

① Bubble Sort


② bubble

① -2- is a simple algorithm that repeatedly steps through a list, comparing adjacent pairs & swapping them if they're incorrectly ordered until the list is completely sorted. The algorithm (a comparison sort) is named for how its elements ② -1- to the top of the list.




Although ① -2- is simple, it is too slow & impractical for most problems when compared to insertion sort.

① Dynamic Expression


② dynamic

If an expression is a ① -2- this indicates that any binding that it participates in should be based on its run-time type rather than its type at compile-time. If no ① -2- are involved, C# defaults to static-binding.




When evaluating a null coalescing operator of the form: a ?? b, if b is a ① -2-, the result type is ② -1-. At run-time a is first evaluated. If a is not null, a is converted to ② -1- and becomes the result. Otherwise b is evaluated and this becomes the result.

Generations

The heap is grouped into -1- so it can handle long-lived & short-lived objects. Garbage collection primarily occurs with the reclamation of short-lived objects that typically occupy a small part of the heap. There are three -1- of objects on the heap based on their age. Younger objects (smaller) are reclaimed more often in -1- zero. Survivors are promoted to the next -1- (one). -1- two contains the older & larger (> 85,000 bytes) objects.

Array Covariance

For any two reference types A and B, if an implicit reference conversion or explicit reference conversion exists from A to B, then the same reference conversion also exists from the array type A[R] to the array type B[R], where R is any given rank specifier (but the same for both types). This relationship is known as -2-, which in particular means that a value of an array type A[R] may actually be a reference to an instance of an array type B[R] provided an implicit reference conversion exists from B to A.

Builder Pattern

The -1- pattern is a creational design pattern. Unlike the Abstract Factory & Factory Method patterns, whose intent is to enable Polymorphism, the intent of the -1- pattern is to separate the construction of a complex object from its representation. By doing so the construction process can create different representations.




Creating and assembling the parts of a complex object directly within a class is inflexible because it commits to a particular representation and makes it impossible to change later independently of the class.

Closure Function

A -2- is a block of code which can be executed at a later time, but which maintains the environment in which it was first created, i.e. - it can still use the local variables, etc., of the method which created it, even after that method has finished executing.




The general feature of a -2- is implemented in C# by anonymous methods and lambda expressions.

Anonymous Delegate

With the support of an -2- you are able to create "inline" delegates without having to specify any additional type or method; you simply inline the definition of the delegate where needed. An -2- is similar to lambda expressions.




Ex: ... List result = list.FindAll(


delegate(int no) { return(no % 2 == 0)});


foreach (var item in result)


Console.Writeline(item);

Collection Initializer

A -2- let you specify one or more element initializers when you initialize a collection that that implements IEnumerable and has Add with the appropriate signature as an instance method or an extension method. The element initializers can be a simple value, an expression, or an object initializer.




By using a -2- you don't have to specify multiple calls to the Add method of the class in your source code. The compiler will.

Indexer

-1- allow instances of a class or struct to be indexed just like arrays. The indexed value can be set or retrieved without explicitly specifying a type or instance member.




-1- resemble properties, except that their accessors type parameters: the get accessor returns a value, & the set accessor assigns a value. The this keyword is used to define an -1-. The value keyword is used to define a value assigned by the set accessor.

Explicit Interface Member Implementation

For the purpose of implementing interfaces, a class or struct may declare -4-, which is a method, property, event, or indexer declaration that references a fully qualified interface member name. Such members can only be accessed via the interface type and can never be invoked in a way that permits arguments to be omitted. An accessor modifier may not be used in an interface or an -4-, nor can the -4- include access modifier, abstract, virtual, static, or override.




-4- serve two primary purposes:




❶ because they're inaccessible through class or struct instances they allow interface implementations to be excluded from the public interface of a class or struct



❷ they allow disambiguation of interface members with the same signature.


Projection Initializer

A -2- is a declaration for a member of an anonymous type that does not include a property name. A -2- is shorthand for a declaration of and assignment to a property with the same name. A member declarator can be abbreviated to a simple name, a member access, a base access, or a null-conditional member access - this is called a -2-.




Specifically, member declarators of the forms: identifier and expression identifier are precisely equivalent to: identifier = identifier and expression identifier = expression identifier




Thus in a -2- the identifier selects both the value and the field or property. A -2- projects a value and its name.

catch clause / keyword

The -1- clause is paired with a try statement, and specifies handlers for different exceptions. If a -1- clause is not found while propagating up the call stack, an unhandled exception terminates the program. Multiple -1- clauses are supported.

.NET Framework

The -2- is a is a managed execution environment for Windows that provides a variety of services to its running apps. It consists of two major components: the common language runtime (CLR), which is the execution engine that handles running apps, and the -2- Class Library, which provides a library of tested, reusable code that developers can call from their own apps. The services that the -2- provides to running apps include the following:




• memory management


• a common type system


• an extensive class library


• development frameworks & technologies


• language interoperability


• version compatibility


• side-by-side execution


• multitargeting






① abstract method


② abstract

Use the ② -1- modifier in a property or method declaration to indicate that they don't have an implementation. ① -2- are:




▪ implicitly virtual


▪ only permitted in a ② -1- class


▪ don't have a method body


▪ simply end with a semicolon


▪ no curly braces


▪ implemented by override modifier

Implicit Implementation

C# does not support multiple inheritance, but interfaces mimic it in two ways. Using -2- means you access the interface(s), methods, & properties as if they were part of the class, as opposed to only being able to access them when treating the class as the implemented interface.

Constant Pattern

The -2- tests whether a match expression equals a specified constant. Its syntax is:




case constant:




... where constant is the value to test for and can be any of the following constant expressions:




bool literal


▪ any integral constant


▪ the name of a declared const variable


enumeration constant


char literal


string literal





The -2- is evaluated as follows: if expr and constant are integral types, the equality operator (==) determines whether true; if not, it is determined by a call to the static Object.Equals(expr constant).


Expression Statement

An -2- evaluates an expression. The value computed by the expression is discarded (if it exists). The following are valid -2-:




⍟ invocation expression


⍟ null-conditional invocation expression


⍟ object creation expression


⍟ await expression


⍟ assignment expression


⍟ post-/pre-increment expressions


Specifically, expressions that calculate a value & nothing else are excluded. Execution of an -2- evaluates the contained expression & then transfers control to the endpoint of the -2- (which is reachable if that -2- is reachable).




Both the for iterator and initializer can contain -2-. An expression classified as nothing is valid only in the context of an -2- (likewise with an event assignment expression which yields no value).

Type Declaration

-2- creates new types for programs by specifying the name & the members of the new type. -2- is used to define classes, structs, interfaces, enumerations, & delegates. The kinds of members allowed in a -2- depend on the form of the -2-.




A -2- can occur as a top-level -2- in a compilation unit, or as a member -2- within a class, struct, or namespace; the latter results in a nested type, while the former has the fully qualified name of T.

Function Member

-2- are members that contain executable statements, and are always members of types & not namespaces. They include:




⍟ methods ⍟ properties ⍟ events ⍟ indexers


⍟ user-defined operators


⍟ static/instance constructors


⍟ destructors




Except for destructors & static constructors (which cannot be invoked explicitly), the statements contained in -2- are executed through -2- invocations, whose syntax depends on the member.




Overload Resolution

-2- is a binding-time mechanism for selecting the best function member to invoke given an argument list and a set of candidate function members. -2- selects the function member to invoke in the following contexts:





• a method named in a invocation expression


• an instance constructor named in an object creation expression
• an indexer accessor through an element access


• a predefined or user-defined operator referenced in an expression








① Data-binding


② binds


① -2- is a general technique that ② -1- data sources from the provider and consumer together and synchronizes them. This is usually done with two data/information sources with different languages. In C#, this is facilitated by Windows Presentation Foundation (WPF) which supports four types of ① -2-:




❶ one-time - where client ignores server updates


❷ one-way - client only has read access


❸ two-way - causes changes to either the source property or the target property to automatically update the other


❹ one-way to source - the reverse of one-way

Mutator/Property

A -1- method has a public accessibility & is used to assign a new value to the private field of a type. It forms a tool to implement encapsulation by only controlling access to the internal field values that must be modified. Its benefits include:




• prevents user from directly accessing private data of an object instance


• provides flexibility in modifying the internal representation of fields of an object that represents the internal state without breaking object's client interface

① Applicable Function Member


② Normal Form

A function member is said to be an ① -1- function member with respect to an argument list A when:




• each argument in A corresponds to a parameter in the function member declaration as described in corresponding parameters, and any parameter to which no argument corresponds in an optional parameter


• for each argument in A the parameter passing mode of the argument is identical to the passing mode of the corresponding parameter, and:


○ for a value parameter or a parameter array, an implicit conversion exists from the argument to the type of the corresponding parameter, or


○ for a ref or out parameter the type of the argument is identical to the type of the corresponding parameter.




For a function member that includes a parameter array, if the function member is ① -1- by the above rules, it is said to be ① -1- in its ② -2-.



Expression

This is a sequence of operators & operands. The final result of an -1- is never an namespace, type, method group, or event access; rather these categories of -1- are intermediate constructs that are only permitted in certain contexts.

System.StackOverflowException

The System.-1- exception is thrown when the execution stack is exhausted by having too many pending method calls, typically indicative of very deep or unbounded recursion.

Compile-time

At -2-, the program need not satisfy any invariants or be well-formed at all. Possible problems include: syntax or type-checking errors, & compiler crashes.




If -2- succeeds we know: the program was well-formed, and it is possible to start running the program (though it may still fail). Finally, the inputs and outputs: the input was the program being compiled, plus any header files, interfaces, libraries, etc. that it needed to import in order to get compiled; output is, hopefully, assembly code, relocatable object code, or an executable, or errors.

ref readonly return

Use the -3- modifier combination when you want to return a value type by reference, but disallow the caller from modifying that value. Attempts made to assign to the value directly will generate a compile-time error.




The compiler cannot know if any member method modifies the state of the struct, so to ensure that the object isn't modified, the compiler create a copy and calls member references with that copy. Any modifications are made to that defensive copy.

Recursive/Recursion

A -1- function is one that calls itself. In general, it is a method where the solution to a problem depends on solutions to smaller instances of the same problem. An example is the factorial function, which is defined -1- by :




0! = 1 and for all n > 0, n! = n(n - 1)!




Neither equation by itself is a complete definition; the first is a base case and the second is the -1- case. Because the base case breaks the chain of -1-, it is often called the terminating case.

Expressive Power

The -2- of a language is the breadth of ideas that can be represented and communicated in that language. The more -2- a language has, the greater the variety and quantity of ideas it can be used to represent.

Garbage Collection

In C#, memory leaks, associated with resource allocation, are addressed by independently managing the lifetime of all projects in use by an application. -2- is handled by the Common Language Runtime (CLR), which periodically checks the memory heap for any unreferenced objects & releases the resources held by them. This is part of a process termed Automatic Memory Management.

Array

A data structure that contains a number of variables, which are accessed through computed indices are referred to as elements of an -1-. An -1- has rank/dimensions, and can be of any element type, including an -1- type. Considered to be a reference type, even if its elements are value types.

Language Integrated Query (LINQ)

-3- (abbr. -1-) is the name for a set of technologies based on the integration of query capabilities directly into the C# language. With -3-, a query is a first-class language construct just like classes, methods, and events.




Query expressions are written in a declarative query syntax, which allows for filtering, ordering, & grouping operations on data sources.

Method Signature

The -2- must be unique within the class in which the method is declared. The -2- consists of the method's name, and the number, modifiers, & types of parameters

① Reference Types


② reference


Variables of ① -2- store a ② -1- to their data (objects). With ① -2-, two variables can ② -1- the same object. The following keywords are used to declare ① -2-:




• class • interface • delegate




C# also provides the following built-in ① -2-:




• dynamic • object • string




An array is also a ① -2-. The special value null is compatible with all ① -2- and indicates the absence of an instance. Boxing & unboxing provide a bridge between ② -1- and value types.



Statically-typed Languages

-2- programming languages do type-checking, which is the process of verifying and enforcing the constraints of a type at compile-time, as opposed to run-time.

Mono

-1- is a .NET implementation that is mainly used when a small run-time is required. It is the run-time that powers Xamarin applications on Android, Mac, iOS, tvOS, and watchOS, and is primarily focused on a small footprint.




-1- is typically used with a Just-in-Time compiler (JIT), but it also features a full static compiler (AOT) that is used on platforms like iOS. It emulates some popular UNIX capabilities.

Code Contracts APIs

-3- provide a way to specify preconditions, postconditions, and object invariants in your code. -3- include classes for marking your code, a static analyzer for compile-time analysis, and a run-time analyzer.




These classes can be found in the System.Diagnostics.Contracts namespace. The benefits of -3- include:




▪ improved testing


▪ static verification


▪ automatic testing tools


▪ reference documentation




Most methods in the -3- are conditionally compiled when a special symbol is defined.



Edit Distance/Levenshtein Distance

-2- is a way of quantifying how dissimilar two strings are to one another by counting the minimum number of operations required to transform one string into the other. There are many ways to do this; Levenshtein operations are the removal, substitution, or insertion of a character in the string, and are the most common form of -2-.

① Composition over Inheritance
② Composition


③ Inheritance/Inheriting




(Note: three related answers) ① -3- is the principle that classes should achieve polymorphic behavior and code reuse by the ② -1- (by containing instances of other classes that implement the desired functionality) rather than ③ -1- from a base or parent class.




Implementation of ① -3- typically begins with the creation of various interfaces representing the behavior that the system must exhibit, and the use of these instances allows this technique to support the desirable polymorphic behavior. Classes then are built to implement them.

Obsolete Attribute

This attribute marks a program entity as one that is no longer recommended for use. Each use of an entity marked with the -1- attribute will subsequently generate a warning or error, depending on how it is configured.




The -1- attribute is a single-use attribute and can be applied to any entity that allows attributes.

Qualified Identifier

A -2- is a string that includes a single identifier or a sequence of identifiers that are separated by a dot. It is declared within a namespace and can include one or more namespaces or types. A -2- is mainly used to uniquely specify a type or type member by allowing the inclusion of the namespace in which the -2- is declared.

Generic Type Parameters

In a generic type or method definition a -3- is a placeholder for a specific type that a client specifies when they instantiate a variable of the generic type. That specific type will then take the place of each -3-.




-3- may be of value or reference type; which type dictates how the -3- will be converted by the Microsoft Intermediate Language (MSIL). -3- naming guidelines:




Do name -3- descriptively, unless doing so wouldn't add value and a single letter is self-explanatory


Consider using T as the -3- for single letter types


Do prefix descriptive -3- names with T



Cross-Language Interoperability

-3- is the ability of code to interact with code written by using a different programming language. -3- can maximize code reuse and improve the efficiency of the development process. The Common Language Runtime (CLR) provides the foundation for -3- by enforcing a common type system & by providing metadata; so any language that targets the CLR adheres. Metadata defines a uniform mechanism for storing and retrieving information about types.

lock statement / keyword

The -1- statement marks a statement block as a critical section by obtaining the mutual-exclusion -1- for a given object, executing a statement, and then releasing the -1-. The -1- statement ensures one thread doesn't enter the critical section while another thread is in it.

long type / keyword

-1- denotes an integral type.




Range: ±9,223,372,036,854,775,808


Size: Signed 64-bit integer


NET Type: System.Int64


Default value: 0




Can be declared and initialized by assigning a decimal, hex, or binary literal. Uses the suffix L or l. A common use of the suffix is to call overloaded methods, which guarantees the correct overload is called.

Literal

A -1- is any notation for representing a value within source code. This is in contrast to an identifier, which refers to a value in memory. Examples include:




• "Hi" • null • true • false, etc.




There are four -1- keywords, including default.


Null-terminated String

A -3- is a character string stored as an array containing the characters and terminated with a null character. (\0, called NUL in ASCII)

Type Safety

-2- is the extent to which a programming language discourages or prevents type errors (erroneous or undesirable program behavior caused by a discrepancy between differing data types). -2- is sometimes considered to be a property of a program.

Pointer Types

In an unsafe context, a type may be a -2-, value type, or reference type. A -2- declaration takes one of these forms:




• type* identifier; • void* identifier;




Any of these may be a -2-:




• sbyte • byte • short • ushort • int


• uint • long • ulong • char • float


• double • decimal • bool • enum types


• any -2- • user-defined struct types that contain fields of unmanaged types only




-2- do not inherit from object, and no conversions exist between -2- and object.





Metadata

To enable the runtime to provide services to managed code, compilers must emit -1- that describes the types, members, and references in your code. -1- is stored with the code; every loadable Common Language Runtime (CLR) portable executable (PE) file contains -1-.




The runtime uses -1- to locate & load classes, layout instances in memory, resolve method invocations, etc. Attributes add -1- to a program.

Iterator Design Pattern

In the -1- design pattern, an -1- traverses a container to access the container's elements. The -1- pattern decouples algorithms from containers; in some cases, algorithms are container-specific and cannot be decoupled. The essence of the -1- pattern is to "provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation".

new keyword

❶ As an operator, the -1- keyword is used to create objects and invoke constructors. It is also used to create instances of anonymous types, or to invoke the default constructor for value types. It cannot be overloaded.




❷ As a declaration modifier, the -1- keyword explicitly hides a member that is inherited from a base class.



❸ As a constraint, the -1- keyword specifies that any type argument in a generic class declaration must have a public parameterless constructor. Cannot be abstract.

null literal / keyword

The -1- literal represents a -1- reference, one that doesn't refer to any object. It is the default value of reference type variables. Ordinary value types cannot be -1- under normal circumstances.

override modifier / keyword

The -1- modifier is required to extend or modify the abstract or virtual implementations of an inherited method, property, indexer, or event. An -1- method provides a new implementation of a member inherited from a base class, and is known as the -1- on base method. That base method must have the same signature as the -1- method.




You cannot -1- a non-virtual or static method: it must be virtual, abstract, or -1-. An -1- declaration cannot change the accessibility of the virtual method.

orderby clause / contextual keyword

In a query expression, the -1- clause causes the returned sequence or subsequence (group) to be sorted in either ascending (default) or descending order. Multiple keys can be specified in order to perform one or more secondary sort operations. The sorting is done by the default or custom comparer for the type of element.

Unmanaged Types

An -2- is any type that isn't a reference type, a type parameter, or a generic struct-type, and contains no fields whose type is not also an -2-. In other words:




▪ any enum type


▪ any pointer type


▪ any non-generic user-defined struct type that contains fields of -2- types only


sbyte byte short ushort int uint long ulong char float decimal double bool




The sizeof keyword is used to obtain the size in bytes for an -2-.




Just-in-Time Compiler (JIT)

Also known as dynamic translation, -4- (abbr. -1-) is a way of executing computer code that involves compilation during execution of a program - at run-time, rather than prior to execution. A system implementing -4- typically continuously analyzes the code being executed and identifies parts of the code where speed-up gained from compilation or recompilation would outweigh the overhead.

ActiveX

-1- is a software framework created by Microsoft that adapts its earlier COM and OLE (Object Linking and Embedding) technologies for content downloaded from a network; particularly from the World Wide Web.




-1- is one of the major technologies used in component-based software engineering. Many MS applications use -1- controls to build their feature-set, and also encapsulate their own functionality.

System namespace

The -1- namespace contains fundamental classes & base classes that define commonly used value & reference data types, events & event handlers, interfaces, attributes, and processing exceptions. Other classes provide services supporting data type conversions, method parameter manipulation, mathematics, remote & local program invocation, application environment management & supervision of managed & unmanaged applications.

Don't Repeat Yourself (DRY) Principle

In the field of software engineering, this principle is aimed at reducing redundant patterns & replacing them with abstractions and using data normalization. The -3- principle is described this way: "every piece of knowledge must have a single, unambiguous authoritative representation in the system".

constant

These are immutable values which are known at compile-time and don't change for the life of the program. Only built-in types may be declared -1-, except System.Object. For user-defined types, including classes, structs, and arrays, use the readonly modifier.




A -1- must be initialized when declared, cannot be passed by reference, and cannot be the left value in an expression.

Sandbox

A -1- is a testing environment that isolates untested code changes and outright experimentation from the production environment or repository, in the context of software development and revision control. A -1- protects live servers and their data and other collections of code form changes that could be damaging.

Type Pattern

The -1- pattern enables concise type evaluation and conversion. When used with the switch statement to perform pattern matching, it tests whether an expression can be converted to a specified type, and if so, casts it to a variable of that type.




Syntax: case type varname

ClassInterfaceAttribute Class

Form: public sealed class -1- : Attribute




Namespace: System.Runtime.InteropServices



Inheritance: Object → Attribute → -1-




Attributes: AttributeUsageAttribute, ComVisibleAttribute




The -1- attribute indicates the type of class interface to be generated for a class exposed to COM, if an interface is generated at all. This can be applied to assemblies or classes.




The -1- attribute controls whether the Type Library Exporter (Tlbexp.exe) automatically generates a class interface for the attributed class. A class interface carries the same name as the class, but prefixed with an underscore.


BindingFlags Enum

The -2- are specified by this enum to control binding and the way in which the search for members and types is conducted by reflection. This enum has a FlagsAttribute attribute that allows a bitwise combination of its member values.

if statement / keyword

The -1- statement identifies which statement to run based on the value of a Boolean expression. If true, a then-statement runs. If false, an else-statement runs.




The -1- statement can contain multiple, nested -1- statements, be paired with Boolean expressions such as &&, ||, |, and ! to make compound conditions.

implicit operator / keyword

The -1- conversion operator is used to declare an -1- user-defined type conversion operator. Use -1- if the conversion is guaranteed to not lose data. -1- can improve code readability by reducing unnecessary casts, but should be used cautiously to avoid exceptions.

Vector Struct

Form: public struct -1- : IFormattable




Namespace: System.Windows




Inheritance: Object → ValueType → -1-




Attributes: TypeConverterAttribute, SerializableAttribute




The -1- struct represents a displacement in 2D space. A point represents a fixed position, but a -1- represents a direction and magnitude (i.e. - velocity or acceleration). Thus, the endpoints of a line segment are points, but their difference is a -1-, that is, the direction & length of that line segment.


① Termination Model


② Resumption Model

After an exception is handled, program control does not return to the throw point in C# because the try block has expired (any of its local variables also go out of scope). Rather, control resumes after the last catch block. This is known as the ① -2- of exception handling.




In other languages, where control resumes after the throw point, this is known as the ② -2- of exception handling.

Copy Constructor

In C++, a -2- is used for creating a new object as a copy of the existing object. C# doesn't provide a -2-, but you can write one yourself. This is done by defining a constructor that takes as its argument an instance object. The values of the properties of the argument are assigned to the properties of the new instance.

Coroutine

A -1- is a program component that generalizes methods for non-preemptive multitasking by allowing multiple entry points for suspending and resuming execution at certain locations. -1- are well-suited for implementing familiar program components such as:




▪ cooperative tasks ▪ exceptions


▪ event loops ▪ iterators


▪ infinite lists ▪ pipes




Common uses include implementing:




▪ state machines within a single method where the state is determined by the current entry/exit point of the procedure


▪ Actor model of concurrency


▪ generators


▪ communicating sequential processes




The .NET Framework provides semi--1- functionality through the iterator pattern and yield keyword. Also, await syntax support.





① compile-time


② run-time

The ① -2- type of a variable is the variable's type as defined in its type declaration. The ② -2- type of a variable is the type of the instance that is assigned to that variable.


Data Structure

A -2- is a data organization, management, & storage format that enables efficient access and modification. Also it is a collection of data values, the relationship among them, and the functions or operations that can be applied to the data.






-2- serve as the basis for abstract data types (ADT) which define the logical form of the data type while the -2- implements the physical form of the data type. -2- provide a means to manage large amounts of data efficiently for uses such as large databases and Internet indexing services. They play a key role in designing efficient algorithms.

① String Interning / Interned String / Interned


② String.Copy(string)


③ String.Intern(string)


④ String.IsInterned(string)

(Note: four answers, and answer no. 1 has 3 variations) ① -2- is a method of storing only one copy of each distinct string value, which must be immutable. As a feature of C#, when a program declares two or more identical string variables, the compiler stores them all in the same location. By calling the ReferenceEquals method, you can see that the strings refer to the same location in memory.




To avoid ① -2-, use the ② String.-1- method. Retrieve a reference to an existing ① -2- by calling ③ String.-1-. Determine if a string is ① -1- by calling ④String.-1-.

① inline expansion


② inlining

① -2-, or ② -1- is a manual or compiler optimization that replaces a function call site with the body of the called function. It occurs during the compilation process. As a rule of thumb, some ② -1- will improve performance at very minor cost of space, but if used in excess, it will hurt speed by consuming too much of the instruction cache, and also cost significant space.


Coupling

-1- is the degree of interdependence between modules. It is usually contrasted with cohesion; low -1- often correlates with high cohesion and can be a sign of a well-structured computer system, & a good design.




In object-oriented programming, subclass -1- describes the relationship between a child and its parent; the child is connected to its parent, but not vice-versa. Also, temporal -1- is when two actions are bundled together into one module just because they happen to occur at the same time.

① Binding


② Static Binding


③ Dynamic Binding

The process of determining the meaning of an operation based on the type or value of constituent expressions (arguments, operands, receivers) is often referred to as ① -1-. This is usually determined at compile-time.




If an expression contains an error, it is detected and reported by the compiler and is known as ② -2-. If the expression is of type dynamic then ① -1- occurs at run-time, and this is known as ③ -2-.

① Strong Reference


② Weak Reference

The garbage collector cannot collect an object in use by an application while the application's code can reach that object. Thus the application is said to have a ① -2- to that object. A ② -2- permits the garbage collector to collect the object while still allowing the application to access the object. A ② -2- is only valid during the indeterminate amount of time until the object is collected when no ① -2- exists.




When using a ② -2- a ① -2- can still be established, however there is always the risk that collection will occur before it is re-established. ② -2- are useful for objects that use a lot of memory but can be recreated easily if they are collected.





System.Type class

Form: public abstract class -1- : System.Reflection.MemberInfo, System.Reflection.IReflect, System.Runtime.InteropServices._-1-




Namespace: System




Inheritance: Object → MemberInfo → -1-




Attributes: ClassInterfaceAttribute, ComVisibleAttribute, SerializableAttribute




The System.-1- class represents type declarations: classes, interfaces, arrays, value types, enumerations, type parameters, generic type definitions, and open or closed constructed generic types.




-1- is the root of the System.Reflection functionality, and is the main way to access metadata. Use its members to get information about a type declaration, about the members of a type, as well as the module and assembly in which a class is deployed.

Serialization/Serialized

(Answer has a variant)-1- is the process of converting an object, or graph of objects, into a linear sequence of bytes for either storage or transmission to another location. It's main purpose is to save the state of an object in order to be able to recreate it when needed. The object is -1- to a stream which carries its data and information about its type before storage or transmission.

Factory Method Pattern

The -3- is a way of creating objects, but letting subclasses decide which class to instantiate. Various subclasses might implement the interface; the -3- instantiates the appropriate subclass based on information supplied by the client, or extracted from the current state.




The -3- is a lightweight pattern that achieves independence from application-specific classes. The client programs to the interface let the pattern sort out the rest.

Shim

A -1- modifies the compiled code of an application at runtime, so that that instead of making a specified method call, it runs the -1- code that your test provides. A -1- can be used to replace calls to assemblies that you cannot modify, such as NET assemblies. A -1- is considered a fake & can help with testing by isolating code.

① Data Source


② Range Variable


③ Let Clause

In a LINQ query, the from clause comes first in order to introduce the ① -2- and the ② -2- (which ranges over the elements of a sequence). Each ③ -2- introduces a ② -2- representing a value computed by means of previous ② -2-. The ② -2- is like the iteration variable in a foreach loop, except that no actual iteration occurs in a query expression. When the query is executed, the ② -2- will serve as a reference to each successive element in the ① -2-. For non-generic sources, the ② -2- must be explicitly-typed.


① readonly field


② Defensive Copy

A ① -1- field of a value type means that the value itself should be the same for the entire lifetime of the enclosing instance. To prevent potential mutations, the compiler makes a ② -2- of the field each time a property or method is used. This ② -2- has a performance cost, so take certain measures to avoid it.


① Deterministic System


② Deterministic


A ① -2- is a system in which no randomness is involved in the development of future states of the system. A ② -1- model will thus always produce the same output from a given starting condition or initial state.




A ② -1- algorithm is one in which, given a particular input, will always produce the same output, with the underlying machine always passing through the same sequence of states.


Implicit Reference Conversions

These are the possible -3-.


❶ From any reference type to object.


❷ From any class type D to any class type B, provided D is inherited from B.


❸ From any class type A to interface type I, provided A implements I


❹ From any interface type I2 to any other interface type I1, provided I2 inherits I1


❺ From any array type to System.Array


❻ From any delegate type to System.Delegate


❼ From any array type or delegate type to System.ICloneable


❽ From null type to any reference type


❾ From any array type A with element type a, to an array type B with element type b, provided A & B differ only in element type (but same number of elements) and both a & b are reference types and an -3- exists between a & b.

Primary Operators

As a group, the -2- have the highest precedence, and include the following operators:




▪ x.y Member Access


▪ x?.y Null-conditional Member Access


▪ x?[y] Null-conditional Index Access


▪ f(x) Function Invocation


▪ a[x] Aggregate Object Indexing
▪ x++ / x-- Postfix Increment/Decrement


typeof System.Type returned
checked / unchecked Overflow Checking
default(T) Returns default value of type


delegate Declares/Returns Delegate


new Type Instantiation


sizeof Returns size of type operand


-> Pointer Dereferencing Combined with Member Access





① Exception Handling


② Exception

An ② -1- is a problem that arises during the execution of a program. ① -2- is built on four keywords: try, catch, finally, and throw. ① -2- provide a way to transfer control from one part of a program to another. Assuming a block raises an ② -1-, a method catches it using a combination of the try/catch syntax. Within a block of that syntax, the code is referred to as protected.

Call Stack

A -2- is the list of names of methods called at run-time from the beginning of a program until the execution of the current statement. A -2- is intended to keep track of the point to which each active method should return control when it finishes executing. It acts as a debug tool for an application when the method to be traced can be called in more than one context.

ArrayList

Form: public class -1- : ICloneable, System.Collections.IList




Namespace: System.Collections




Inheritance: Object → -1-




Attributes: ComVisibleAttribute, SerializableAttribute




The -1- class implements the IList interface using an array whose size is dynamically increased as required. It is designed to hold heterogeneous collections of objects, however its performance isn't always optimal, and List (for heterogeneous) and List (for homogeneous) are preferred.

Dependency Inversion Principle

The -3- refers to a specific form of decoupling software modules. The conventional dependency relationships established from high-level policy setting modules to low-level dependency modules are reversed, thus rendering the high-level independent of the low-level details.




• High-level modules should not depend on low-level ones. Both should depend on abstractions.




• Abstractions shouldn't depend on details, rather vice-versa.


Interlocked Class

Form: public static class -1-




Namespace: System.Threading




Inheritance: Object → -1-



Attributes: None




The -1- class provides atomic operations for variables that are shared by multiple threads. The methods of this class help protect against errors that can occur when the scheduler switches contexts while a thread is updating a variable that can be accessed by other threads, or when two threads are executing concurrently on separate processors. This classes members do not throw exceptions.

AutoMapper

-1- is a library that can be downloaded with NuGet and can map the properties of two different classes. As a best practice you would centralize the mapping code and reuse it often. -1- will sit in the middle and act as a bridge between objects.




Using -1- is a two-step process:




❶ create the map




❷ use the map so the objects can communicate

StringBuilder class

Form: public sealed class -1- : System.Runtime.Serialization.


ISerializable




Namespace: System.Text




Inheritance: Object → -1-




Attributes: ISerializable




The -1- class represents a mutable string of characters. An object of this class isn't a string, but an auxiliary object for manipulating characters. It has a buffer that can be manipulated in place with inserts, appends, replacements, and removals. Then a string can be extracted with the .ToString method. This class's indexer is readable and writable and returns char.

Enumerations

The -1- type provides an efficient way to define a set of named constants (integral) that may be assigned to a variable. By default, the underlying type of each element in the -1- is int, but a new underlying integral numeric type can be specified by using a colon. You can verify the underlying numeric values by casting to the underlying type. The advantages of using an -1- type instead of a numeric: you can clearly specify for client code which values are okay.

Functor

A -1- is a type of mapping between categories in category theory. Given two categories C & D, a -1- F maps objects in C to objects in D - it's a function on objects. -1- can be though of as homomorphisms between categories.

AggregateException class

An -1- represents one or more errors that can occur during application execution. -1- is used to consolidate multiple failures into a single throwable exception object. It is used extensively in the Task Parallel Library (TPL) and Parallel LINQ (PLINQ).

ICollection interface

Form: public interface -1- : System.Collections.IEnumerable




Namespace: System.Collections




Attributes: ComVisibleAttribute




-1- defines size, enumerators, and synchronization methods for all non-generic collections. -1- is the base interface for classes in its namespace. IDictionary and IList are more specialized interfaces that extend -1-. Some collections that limit access to their elements, such as the Queue & Stack classes, directly implement -1-.

Dot Operator

The -2- is used for member access, & specifies a member of a type or namespace. It can also be used to form qualified names which specify the namespace or interface.

GUID Struct

Form: public struct -1- : IComparable, IComparable<-1->, IEquatable<-1->, IFormattable




Namespace: System



Inheritance: Object → ValueType → -1-




Attributes: ComVisibleAttribute, SerializableAttribute




-1- represents a 128-bit integer that can be used across all computers and networks wherever such is required. The odds of a -1- being duplicated are close enough to zero to be considered negligible. In COM, these are often used as interface identifiers, class identifiers, type library identifiers, and category identifiers. -1- do not rely on any central registration authority to be generated.





Evidence Class

Form: public sealed class -1- : System.Collections.ICollection




Namespace: System.Security.Policy




Inheritance: Object → -1-




Attributes: ComVisibleAttribute, SerializableAttribute




-1- defines the set of information that constitutes input to security policy decisions. Common forms of -1- include signatures and location of origin of code, but can potentially be anything.




Objects of any type that are recognized by security policy represent -1-. -1- is the set of inputs to policy that membership conditions use to determine which code groups an assembly belongs to. -1- is a collection of a set of objects.



Convert Class

Form: public static class -1-




Namespace: System




Inheritance: Object → -1-




Attributes: None




The static methods of the -1- class are primarily used to support conversion to and from the base data types in the .NET Framework. These include:




▪ Boolean ▪ Char ▪ SByte ▪ Byte


▪ Int16 ▪ UInt16 ▪ Int32 ▪ UInt32


▪ Int64 ▪ UInt64 ▪ Single ▪ Double


▪ Decimal ▪ DateTime ▪ String





Composite Formatting / Placeholders

The -2- feature takes a list of objects and a -2- string as input. A -2- string consists of fixed text intermixed with indexed placeholders, called format items, that correspond to the objects in the list. The formatting operation yields a result string that consists of fixed text intermixed with the string representation of objects in the list.

System.Array Class

Form: public abstract class -1- : ICloneable, System.Collections.IList, System.Collections.


IStructuralComparable, System.Collections.


IStructuralEquatable




Namespace: System




Inheritance: Object → -1-




Attributes: ComVisibleAttribute, SerializableAttribute




This class isn't part of the System.Collections namespace, but is still considered a collection because it is based on the IList interface. It is the base class for language implementations that support arrays, but only the system and compilers can derive explicitly from it, so users should employ the constructs provided by the C# language.

Classes

-1- are a construct that enable you to create your own custom types by grouping together variables of other types, methods, and events. This defines the data and behavior of a type. If not declared as static, client code can use it by creating objects/instances which are assigned to a variable, which will remain in memory until all references to it go out of scope. If static, then only one copy exists in memory, and can only be accessed through the -1- itself.

Name Hiding / Hidden

The scope of an entity typically encompasses more program text than the declaration space of the entity. In particular, the scope of an entity may include declarations that introduce new declaration spaces containing entities of the same name. Such declarations cause the original entity to become -1-. Conversely, an entity is said to be visible when it is not -1-.

MoveNext Method

The -1- method advances the enumerator to the next element of the collection. It has a bool return type, which returns true if the enumerator was successfully moved to the next element, and false if it has passed the end of the collection. If any changes are made to the collection, the enumerator is irrecoverably invalidated and the next call to -1- throws an exception InvalidOperationException.

dotnet commands

This is the general driver for running the command-line commands. Invoked on its own, it provides brief usage instructions. The only time -1- is used on its own is to run framework-dependent applications by specifying an application DLL after the -1- verb. Commands include (all preceded by -1-):




• build • clean • help • new • migrate


• msbuild • pack • publish • restore • run


• sln • store • test




Project References:




• add reference • list reference


• remove reference




Nuget:




• add/remove package • nuget delete/locals








ActiveX Data Objects (ADO)

-1- can be used to access databases from webpages. -1- is a Microsoft technology that works with ActiveX Data Objects. It is automatically installed with IIS, and is a programming interface to access data in a database. It is recommended to have an understanding of: HTML, ASP, & SQL before using -1-.

EventArgs Class

Form: public class -1-




Namespace: System




Inheritance: Object → -1-




Attributes: ComVisibleAttribute, SerializableAttribute




-1- represents the base class for classes that contain event data and provides a value to use for events that do not include event data. To create a custom event data class, create a class that derives from the -1- class and provide the properties to store the necessary data.




The name of your custom event data class should end with -1-. To pass an object that doesn't contain any data, use the Empty field.

EventListener Class

Form: public abstract class -1- : IDisposable



Namespace: System.Diagnostics.Tracing




Inheritance: Object → -1-




Attributes: None




-1- provides methods for enabling and disabling events from event sources. An -1- represents the target for all events generated by event source (EventSource object) implementations in the current application domain.




When a new -1- is created, it is logically attached to all event sources in that application domain. An -1- can enable/disable on a per-current event source basis by using event levels & event keywords to restrict set of events to be sent to -1-.

① Event Publisher


② Event Subscriber

Events enable a class or object to notify other classes or objects when something interesting occurs. The class that sends or raises the events is called the ① -1-, and the classes that receive or handle the event are called ② -1-.




An event can have multiple ② -1- which can then also handle events from multiple ① -1-. When an event has multiple ② -1-, the event handlers are invoked synchronously. This can be asynchronous too.


Bridge Pattern

This pattern is meant to decouple an abstraction from its implementation so that the two can vary independently. The -2- uses encapsulation, aggregation, and inheritance to separate responsibilities into different classes. When a class varies often, the features of object-oriented programming are useful since changes to the program code can be made with little prior knowledge.

Pointer

This is an object whose value refers to another value stored elsewhere in program memory. A -1- to data significantly improves performance for repetitive operations such as traversing strings, lookup tables, control tables, and tree structures.




In object-oriented programming, -1- to functions are used for binding methods, often using virtual method tables.

① Big Endian


② Little Endian


③ Endianess

A ① -2- machine stores data such that the first byte is the biggest (among multiple bytes); a ② -2- machine stores data so that the first byte is the smallest. This is called the ③ -1- of the machine, and is only relevant when considering multiple-bytes and how to process them.

ASP.NET

-1- is a web framework for NET-based programming languages like C#. It allows writing in C# to handle HTTP (and WebSockets) requests in a similar manner to PHP, but different in that code still needs compiling. Compiled code is then managed by a web server. Has been largely replaced by .NET Core.

Thread Local Storage (TLS)

You can use -3- (abbr. -1-) to store data that is unique to a thread & application domain. The .NET Framework provides two ways to use managed -3-:




❶ thread-relative static fields


❷ data slots




-3- is a method that uses static or global memory local to a thread.

this access

In this context, the type of a -2- is the instance type. Depending on whether it is in a class or a struct it can be classified as a value (former) or a variable (latter). A -2- is permitted only in the block of an instance constructor, instance method, or an instance accessor. In a class, -2- references an object being constructed (.cctor) or references an object for which method access was invoked.

① IntPtr Struct


② UIntPtr Struct

Form: public struct ① -1- : System.Runtime.Serialization.


ISerializable




Namespace: System




Inheritance: Object → ValueType → ① -1-




Attributes: ComVisibleAttribute, SerializableAttribute




The ① -2- is designed to be an integer whose size is platform-specific. That is, an instance of this type is expected to be 32-bits on 32-bit hardware & operating systems, and 64-bits on 64-bit hardware & operating systems. ① -2- can be used to represent a pointer or a handle (i.e. - instances of ① -2- are used extensively in the System.IO.Filestream class to hold file handles).




The ①-2- is CLS-compliant, while its counterpart, the ② -2- is not.

① Event Routing


② Direct Routing


③ Bubbling


④ Tunneling

This is the concept of an event moving in a tree of elements. There are three types of ① -2-:




❶ The event doesn't move in the tree and behaves like a standard Common Language Runtime event is called ② -2-.



❷ When the event moves from the source of the event up to the top of the tree it is called ③ -1-.




❸ When the event instance starts at the top of the tree and moves down to the source of the event it is called ④ -1-.

Denial / Denied

By preventing its callers from exercising the privilege represented by a permission, a method is -1- that permission; if it does so on a call stack, then during a stack walk checking for permission A will fail, unless a valid assertion is found on the stack between the -1- method and the method that initiated the permission check.

Generator

This is a special routine that can be used to control the iteration behavior of a loop. All -1- are iterators. A -1- is very similar to a function that returns an array, in that a -1- has parameters, can be called, and generates a sequence of values; however, instead of building an array containing all the values and returning them all at once, a -1- yields the values one at a time, which requires less memory, and allows the caller to start processing them immediately.

System.Object's methods




① & ② - Equals(Obj) / Equals(Obj, Obj)


③ Finalize()


④ GetHashCode()


⑤ GetType()


⑥ MemberwiseClone()


⑦ ReferenceEquals()


⑧ ToString()

Name all of System.Object's methods:




① & ② -1- (Obj)/ -1- (Obj, Obj) - determines if special object is equal to the current object or if the specified object instances are considered equal.




③ -1-() - Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.




④ -1-() - serves as the default hash function.




⑤ -1-() - Gets the Type of the current instance.




⑥ -1-() Creates a shallow copy of the current Object.




⑦ -1-(Object, Object) - Determines whether the specified Object instances are the same instance.




⑧ -1-() - Returns a string that represents the current object.


① Exception Filter


② throw statement


③ when keyword

An ① -2- is a type specification in a catch block that specifies the type of exception to catch. It should be derived from System.Exception, but not directly specified as such unless all possible thrown exceptions can be handled or a ② -2- has been included at the end of the catch block.




Multiple catch blocks with different ① -2- can be chained together. An ① -2- is specified by the ③ -1- contextual keyword.

File Type Handler

Registering a file type is the first step in creating a file association which makes that file type known to the Windows Shell, however without -3- the Shell is unable to expose information to the user from and about the file.




Using an image file as an example, -3- provide functionality such as: thumbnail or preview, image specific verbs in the shortcut menu (rotate, set as desktop background), and properties (date taken, rating).

① EventSource Class


② event source

Form: public class ① -1- : IDisposable




Namespace: System.Diagnostics.Tracing




Inheritance: Object → ① -1-




Attributes: None




The ① -1- class provides the ability to create events for event tracing for Windows (Event Tracing for Windows AKA ETW) and is intended to be inherited by a user class for that purpose. Its basic functionality is sufficient for most applications, but if you want more control over the created ETW manifest you can apply the EventAttribute to its methods.




① -1- provides channel support in .NET 4.6+. This means its types may now implement interfaces. Also, the concept of a utility ② -2- type has been introduced which enables sharing code across multiple ② -2- types. Since ① -1- implements IDisposable, it should be disposed of directly or indirectly.

① Process Class


② process / processes


③ processor

Form: public class ① -1- : System.ComponentModel.


Component




Namespace: System.Diagnostics




Inheritance: Object → MarshalByRefObejct →
Component → ① -1-




Attributes: None




The ① -1- class provides access to local and remote ② -1- and enables you to start and stop local system ② -1-. A ① -1- component is a useful tool for starting, stopping, and controlling/monitoring applications. It can obtain a list of the ② -1- currently running, and can start new ones. In basic terms, a ② -1- is a running application. A thread is the unit to which the OS allocates ③ -1- time. It can execute any part of the code or the ② -1-.


① Bitwise (Logical) Operators


② Logical AND


③ Logical XOR (exclusive or)


④ Logical OR

The ① -1- class of operators come after the Equality operators in terms of precedence, and are ranked in this order:




❶ x & y ② -2- operator


❷ x ^ y ③ -2- operator


❸ x | y ④ -2- operator




The -1- operators are typically used with integer and enum types.

① Add Accessor


② Remove Accessor

The ① -2- is used to define a custom event accessor that is invoked when client code subscribes to your event. If supplied, you must also supply a ② -2-, which is invoked when client code unsubscribes from your event.




You do not typically need to provide your own custom event accessors because the accessors that are auto-generated by the compiler on event declaration are sufficient for most scenarios.

Compilation Unit

A -2- defines the overall structure of a source file, and consists of:




▪ zero or more using directives


▪ followed by zero or more global attributes


▪ followed by zero or more namespace member declarations




A C# program consists of one or more -2-, each contained in a separate source file, and when it is compiled all -2- are processed together; this means -2- can depend on each other, possibly in a circular fashion.



The using directives of a -2- affect the global attributes & namespace member declarations of that -2-, but have no effect on other -2-. The global attributes permit the specification of attributes for the target assembly and module. The namespace member declarations of each -2- of a program contribute members to a single declaration space called the global namespace.

① Lexical Grammar


② Syntactic Grammar

The ① -2- defines how Unicode characters are combined to form line terminators, white space, tokens, comments, and preprocessing directives.




The ② -2- defines how the tokens resulting from the ① -2- are combined to form C# programs.


LinkedList❬T❭ Class

Form: public class -1- : System.Collections.Generic.


ICollection❬T❭, System.Collections.Generic.


IEnumerable❬T❭, System.Collections.Generic.


IReadOnlyCollection❬T❭, System.Collections.ICollection, System.Runtime.Serialization.


IDeserializationCallback, System.Runtime.Serialization.ISerializable




Namespace: System.Collections.Generic




Inheritance: Object → -1-




Attributes: ComVisibleAttribute, SerializableAttribute




The -1- class supports enumerators. It provides separate nodes of type -1-Node, so insertion and removal are O(1) operations, and this can be done in the same list or in another list, which results in no additional objects allocated on the heap. The list also maintains an internal count, so getting the Count property is an O(1) operation.




Because the -1- is doubly-linked, each node points both forwards and backwards to the adjacent nodes. Lists that contain reference types perform better when a node and its value are created at the same time. -1- accepts null as a valid value property for reference types, and allows duplicate values. If the -1- is empty, the First & Last properties contain null.




The -1- class doesn't support chaining, splitting, cycles, or other features that can leave the list in an inconsistent state; the list remains consistent on a single thread.

Activator Class

Form: public sealed class -1- : System.Runtime.InteropServices._-1-




Namespace: System




Inheritance: Object → -1-




Attributes: ClassInterfaceAttribute, ComVisibleAttribute




The -1- class contains methods to create types of objects, locally or remotely, or obtain references to existing remote objects. The CreateInstance method creates an instance of a type defines in an assembly by invoking the constructor that best matches the specified arguments. If none are specified, the default constructor is invoked. You must have permission to search for and call a constructor. A binder parameter specifies an object that searches an assembly.

Gap Buffer

A -2- is a dynamic array that allows efficient insertion and deletion operations clustered near the same location. A -2- is especially common in text editors where most changes to the text occur at or near the current cursor position. The text is stored in a large buffer in two contiguous segments, with a gap between them for inserting new text. Moving the cursor involves copying text to the other side of the gap. Text is represented as two strings which take little space and can be searched and displayed quickly compared to complex data structures.

① Syntax Error


② Semantic/Logic Error


③ Runtime Error

There are three types of errors in programming:




① -1- errors - occur during development when you write illegal code identified by the compiler.




② -1- errors (aka -1- errors) - code runs to completion but results in an incorrect I/O operation; identified by software testing.




③ -1- errors - an error which causes premature termination of a program; identified through execution.


Flags / FlagsAttribute Class

Form: public class -1- : Attribute




Namespace: System




Inheritance: Object → Attribute → -1-




Attributes: AttributeUsageAttribute, ComVisibleAttribute, SerializableAttribute




The -1- attribute indicates that an enumeration can be treated as a bit field; that is, a set of -1-. Bit fields are generally used for lists of elements that might occur in combination, whereas enumeration constants are generally used for lists of mutually exclusive elements. Therefore, bit fields are designed to be combined with a bitwise OR operation to generate unnamed values, whereas enumeration constants are not.


① Application Isolation / Isolation


② Application

Operating systems and runtime environments typically provide some form of ① -2-. For example, Windows uses processes to accomplish ① -2-. This is to ensure code running in one ② -1- cannot affect another, unrelated ② -1-.




② -1- domains provide an ② -1- boundary for security, reliability, and versioning, and for unloading assemblies. ② -1- domains are typically created by runtime hosts, which are responsible for bootstrapping the Common Language Runtime before an ② -1- is run.




Backus-Naur Form

-3- is a notation technique for context-free grammars, often used to describe the syntax of languages used in computing. It is applied wherever exact descriptions of languages are needed: i.e. - official language specifications, in manuals, & in textbooks on programming language theory.




Many extensions and variants of the original notation are used, including extended -3- and augmented -3-.

① Callbacks


② Synchronous Callback


③ Asynchronous Callback

A ① -1- is any executable code that is passed as an argument to other code which is expected to ① -1- (execute) the argument at a given time. This execution may be immediate as in a ② -2-, or delayed until later as in an ③ -2-. In all cases, the intention is to specify a method/function as an entity (a variable) which is passed as an argument to another method. These can be implemented with lambda expressions, etc.




① MethodImplAttribute Class


② MethodImplOptions Enum


③ CorMethodImpl Table

Form: public sealed class


① -1- : Attribute




Namespace: System.Runtime.


CompilerServices





Inheritance: Object →


Attribute → ① -1-




Attributes: AttributeUsageAttribute, ComVisibleAttribute, SerializableAttribute




The ① -1- attribute specifies the details of how a method is implemented. This attribute can be applied to both methods and constructors. It lets you customize their configuration by supplying a ② -1- enum value to the attribute's class constructor.




The members of the ② -1- enum correspond to bit fields in the ③ -1- metadata table, which means that information on the attribute cannot be retrieved at run-time by calling MemberInfo.GetCustomAttributes; instead, use MethodInfo.


GetMethodImplementationFlags, or ConstructorInfo.


GetMethodImplementationFlags.



Identity

An -1- describes the property of objects that distinguishes them from other objects. A reference can be made to an object with a specific -1-. Object -1- is less useful as a semantic concept in scenarios in which the structure of objects is not encapsulated, and two objects are considered to be the same based on having identical properties, even if not the same physical instance.

General Responsibility Assignment Software Patterns (GRASP)

-5- (abbr. -1-) consists of guidelines for assigning responsibility to classes and objects. The different patterns and principles used in -5- are:




⍟ Controller


⍟ Creator
⍟ Indirection


⍟ Information Expert
⍟ High Cohesion & Low Coupling


⍟ Polymorphism


⍟ Protected Variations


⍟ Pure Fabrication




All of these answer some software problem.

STAThreadAttribute Class

Form: public sealed class -1- : Attribute




Namespace: System




Inheritance: Object → Attribute → -1-




Attributes: AttributeUsageAttribute, ComVisibleAttribute




This attribute indicates that the COM threading model for an application is single-threaded apartment (STA).




Apply -1- to the Main method because it is useless on other methods. To set the threading model for an application, you use the -1- or the Thread.SetApartmentState or Thread.TrySetApartmentState methods before starting the thread. COM threading models only apply to applications using COM Interop.


① Eager Evaluation


② Lazy Evaluation

In ① -2- the first call to an iterator will result in the entire collection being processed. A temporary copy of the source collection might also be required. In contrast ② -2- is where a single element of the source collection is processed during each call to the iterator, and is the typical way in which iterators will be implemented.


Contract

A -1- is the behavior and state that a class provides which is matched with what a client of that class can expect to hold. A -1- is expressed partly by the signatures for all public fields, methods, properties, and events of that class. This is augmented by a description of what each field or property represents, together with what each method does.

① Widening/Implicit Conversion


② Narrowing/Explicit Conversion

A ① -2- occurs when a value of one type is converted to another type of equal or greater size; while a ② -2- occurs when a value of the type is converted to a value of another type that is of a smaller size. Some ① -2- to float (AKA single) or double can cause a loss of precision; while a ② -2- can cause a loss of information under the same circumstances.


① Cardinality


② Cardinal

The term ① -1- refers to the number of ② -1- (basic) members in a set. ① -1- can be finite (a non-negative integer) or infinite. For example, the number of possible integers in a set could have infinite ① -1-, while the set of people in a hospital with the last name Jones would have a ① -1- of three if that's how many were present.




In tables, the number of rows/tuples is called the ① -1-. In practice, tables always have positive integer ① -1-. This is because tables with no rows/tuples or with negative tuples/rows cannot exist.



① Interface Mappings


② re-implement / re-implementation

A class or struct must provide implementations of all members of the interfaces that are listed in the base class list of the class or struct. The process of locating implementations of interface members in an implementing class or struct is known as ① -2-.




A class that inherits an interface implementation is permitted to ② -1- the interface by including it in the base class list. A ② -1- of an interface follows exactly the same ① -2- rules as an initial implementation of the interface. Thus, the inherited ① -2- have no effect on the ① -2- established for the ② -1- of the interface.


① Prototype-based Programming


② Prototype

① -2- programming is a style in which behavior reuse (AKA inheritance) is performed via a process of re-using existing objects via delegation that serve as ② -1-. Delegation supports ① -2- programming.




① -2- programming use generalized objects which can then be cloned and extended. There may not be any explicit classes.


① Positional Parameters


② Named Parameters

Attribute classes can have ① -2- and ② -2-. Each public instance constructor for an attribute class defines a valid sequence of ① -2- for that attribute class. Each non-static public read-write field and property for an attribute class defines a ② -2- for the attribute class.




Example: [AttributeUsage(AttributeTargets.Class)] public class HelpAttribute: Attribute {


public HelpAttribute(string url) { ... }


public string Topic { get { ... } set { ... } } }


Explicit Reference Conversions

The possible -3- are:




❶ Each object to any reference type.


❷ From any class type B to any class type D, provided B is the base class of D.


❸ From any class type A to any interface type I, provided A isn't sealed, and doesn't implement I.


❹ From any interface type I to any class type A, provided A isn't sealed, and does not implement I.


❺ From any interface type I2 to any interface type I1, provided I2 is not derived from I1.


❻ From System.Array to any array type.


❼ From System.Delegate to any delegate type.


❽ From System.ICloneable to any array type or delegate type.

Bootstrap

-1- is a framework for developing websites and web applications. It contains HTML and CSS-based design templates for typography, forms, buttons, and navigation, and other interface components, as well as optional JavaScript extensions.

① Search Algorithm


② Search Problem

A ① -2- is any algorithm which solves the ② -2- namely to retrieve information stored within some data structure or calculated in the search space of a problem domain, either with discrete or continuous values. Applications include:



• vehicle routing problem (in combinatorial optimization)


• filling in a sudoku puzzle (constraint satisfaction)


• retrieving a record from a database, etc.




① Resource


② Resource Acquisition


③ Dynamic

A ① -1- is a class or struct that implements System.IDisposable which includes a single parameterless method named Dispose. Code that is using a ① -1- can call Dispose to indicate that the ① -1-is no longer needed. The using statement obtains one or more ① -1-, executes a statement, then disposes of the ① -1-. This is called ② -2-.




If the form of ② -2- is a local variable declaration, then the local variable declaration must be either ③ -1- or a type that is implicitly convertible to IDisposable. If it's the form of an expression, it must also be implicitly convertible to IDisposable.




Local variables declared within a ② -2- are readonly, and must include an initializer. Usage of the ① -1- is implicitly enclosed in a try statement that includes a finally clause.




① #pragma


② #pragma warning


③ #pragma checksum

① -1- gives the compiler special instructions for the compilation of the file in which it appears. The instructions must be supported by the compiler.




② -2- can enable or disable certain warnings, while ③ -2- generates checksums for source files to aid with debugging ASP.



① Event Handler


② EventHandler Delegate


③ EventHandler❬TEventArgs❭


Delegate

Clients react to events through ① -2-. ① -2- are attached using the += operator and removed using the -= operator.




Form: public delegate void ② -1-(object sender, EventArgs e);




... where sender is the source of the event, and e is an object without event data. ② -1- delegate represents the method that will handle an event that has no event data.



Similar to the previous definition, ③ -1- delegate is used when an event does have data.

System.Windows Namespace

-1-.1- namespace provides several important Windows Presentation Foundation (WPF) base element classes, various classes that support the WPF property system, and event logic, and other types that are more broadly consumed by the WPF Core and Framework.

① Boxing Conversion


② Unboxing Conversion

① -1- is the process of converting a value type to the type object or to any interface type. Implemented by this value type. It wraps the value inside a System.Object instance and stores it on the managed heap. ② -1- extracts the value type from the object. ① -1- is implicit; ② -1- is explicit.




These processes underlie the C# Unified Type System in which a value of any type can be treated as an object.




Ex: int i = 123;


object o = i; // ① -1-




o = 123;


i = (int)o; // ② -1-




File Class

Form: public static class -1-




Namespace: System.IO




Inheritance: Object → -1-




Attributes: ComVisibleAttribute




The -1- class provides static methods for the creation, copying, deletion, moving, and opening of a single file, and aids in the creation of FileStream objects.




You can also use the -1- class to get and set file attributes or DateTime information related to the creation, access, and writing of a file. If you want to perform operations on multiple files, use Directory.GetFiles or DirectoryInfo.GetFiles.




Many of the -1- methods return other I/O types when you create or open files. You can use these other types to further manipulate a file.




Because all -1- methods are static, it might be more efficient to use a -1- method rather than a corresponding FileInfo instance method if you want to perform only one action. All -1- methods require the path to the file that you are manipulating.

① Lazy❬T❭ Class


② Lazy Initialization

Form: public class -1-




Namespace: System




Inheritance: Object → -1-




Attributes: ComVisibleAttribute, SerializableAttribute




The ① -1- class uses ② -2- to defer creation of a large or resource intensive object/task (to be executed); and to prepare you require an instance of ① -1-.




① -1- is generic with a type argument T which is the type of object that is being (undergoing) ② -2-. ② -2- occurs the first time the ① -1-.Value property is accessed. Choosing a constructor is based on these criteria:




• thread-safety


• amount of code being written




The latter of those depends on whether exceptions will need handling. If you need to write initialization text, or handle exceptions, use one of the constructors that takes a factory method.






Thread Synchronization

For simple operations on integral numeric data types, -2- can be accomplished with members of the Interlocked class. For all other data types and non-thread safe resources, -2- can only be safely performed using these constructs:




• the lock keyword - creates a mutual exclusion lock for a given object for the duration of a code block


• monitors via the Monitor class


• synchronization events and wait handles


• mutex objects


• Interlocked class


• ReaderWriter locks


• deadlocks




IDisposable Interface

The -1- interface provides a mechanism for releasing unmanaged resources. The garbage collector automatically releases the memory allocated to a managed object when it is no longer in use. It is not possible to predict when garbage collection will occur, and the garbage collector has no knowledge of unmanaged resources such as window handles, open files, or streams. Use this interface's Dispose method to explicitly release unmanaged resources in conjunction with the garbage collector.

Finalizer (or Destructor)

A -1- is used to destruct instances of classes. -1- cannot be used in structs, only classes, and there can only be one in a class. -1- cannot be inherited or overloaded. They cannot be called, rather they are invoked automatically, and don't take modifiers or have parameters.




Ex: class Corwin


{


~Corwin()


}

ANTLR (ANother Tool for Language Recognition)

-1-, short for -5-, is a powerful parser generator for reading, processing, executing, or translating structured text or binary files. -1- is used to build languages, tools, and frameworks. From a grammar, -1- generates a parser that can build and walk parse trees.

Method Group Conversion

An implicit conversion exists, called a -2- conversion, from a -2- to a compatible delegate type. Given a delegate type D and an expression E that is classified as a -2-, an implicit conversion exists from E to D if E contains at least one method that is applicable in its normal form to an argument list constructed by use of the parameter types & modifiers of D as follows:




• the compile-time application of a conversion from a -2- E to a delegate type D is described in the following:




○ a single method M is selected corresponding to a method invocation of the form E(A) with the following modifications:




◦ the argument list A is a list of expressions, each classified as a variable and with the type and modifier (ref or out) of the corresponding parameter in the formal parameter list of D.




• the candidate methods considered are only those applicable in their normal form (not extended form)




• if the algorithm of the method invocations produce an error, then a compile-time error occurs, otherwise it produces a single best method M with the same number of parameters as D and the conversion is considered to exist.




• the selected method M is an instance method, the instance expression associated with E determines the target object of the delegate




M must be compatible with D




• If M is an extension method, which is denoted by means of a member access on an instance expression, that instance expression determines the target object of the delegate




• the result of the conversion is a value of type D, a delegate that refers to the selected method and target object






Proxy Pattern

A -1-, in its most general form, is a class functioning as an interface to something else: a net connection, a large object in memory, a file, or another resource that's expensive or impossible to duplicate. Thus, a -1- is a wrapper being called by the client to access the real serving object behind the scenes. Use of the -1- pattern can forward to the real object, or provide additional logic.

delegate type / keyword

The declaration of the -1- type is like a method signature. It has a return value and any number of parameters of any type. It is declared with a keyword bearing its type name. It is a reference type that can encapsulate a named anonymous method.




Similar to function points in C++, but the -1- is type-safe and secure. -1- are the basis for events. They must be instantiated with compatible method(s)/lambda expressions.

base access / keyword

Use -1- to:




• access members of the base class from within a derived class




• call a method on the base class that has been overridden by another method




• specify which base class constructor should be called on creating instances of derived classes




Use of -1- is okay only in a constructor, instance method, or an instance property accessor, and not within a static method.

Discard Pattern

In C#'s pattern matching system, the -1- pattern can be employed by the is and switch keywords, as well as the use of the discard, which uses an underscore for its syntax. Every expression always matches the -1- pattern.


Object-relational Mapping

-3- (abbr. -1-) is a technique for converting data between incompatible type systems using OOP languages. This creates, in effect, a "virtual object database" usable within the programming language. A metadata descriptor connects object code to a relational database.

Object-oriented Programming (OOP)

-3- (abbr. -1-) is a software programming model constructed around objects - it compartmentalizes data into objects (data fields) and describes object contents and behavior through the declaration of classes (methods). Key features of -3- include:




⍟ Encapsulation


⍟ Polymorphism


⍟ Inheritance


Interpreter Pattern

The -1- design pattern specifies how to evaluate sentences in a language. The basic idea is to have a class for each symbol (terminal or nonterminal) in a specialized computer language. The syntax tree of a sentence in the language is an instance of the composite pattern and is used to evaluate the sentence for a client.




The -1- pattern is designed to solve:




• a grammar for a simple language should be defined,


• so that sentences in the language can be interpreted




Solutions the -1- pattern helps to describe:




• define a grammar for a simple language by defining an expression class hierarchy and implementing an -1-() operation


• represent a sentence in the language by an abstract syntax tree (AST) made up of Expression instances


• -1- a sentence by calling -1-() on the AST



Chain-of-responsibility Pattern (CoR)

The -3- design pattern consists of a source of command objects and series of processing objects. Each processing object contains logic that defines the types of command objects that it can handle; the rest are passed to the next processing object in the chain. A mechanism also exists for adding new processing objects to the end of this chain. Thus, the -3- is an object-oriented version of the if - else if - else idiom, with the benefit that the condition-action blocks can be dynamically rearranged and reconfigured at runtime.




The -3- pattern is designed to solve:




• coupling the sender of a request to its reciever should be avoided


• it should be possible that more than one receiver can handle a request




The solution described by -3-:




• defines a chain of receiver objects having the responsibility, depending on run-time conditions, to either handle a request or forward it to the next receiver on the chain (if any)


Ad hoc Polymorphism

-3- refers to polymorphic functions that can be applied to different argument types known by the same name in a programming language. -3- is also known as function overloading or operator overloading because a polymorphic function can represent a number of unique and potentially heterogeneous implementations depending on the type of argument it is applied to.




-3- defines operators that can be used for different argument types. It follows a dispatch mechanism in which the control moving from one named function is dispatched to several other functions without specifying the function being called. This function overloading permits multiple functions taking different argument types to be known by the same name as the compiler and interpreter calls the right function.

Forwarding

In OOP, -1- means that using a member of an object (either a property or a method) results in actually using the corresponding member of a different object: the use is -1- to another object.




-1- is used in a number of design patterns, where some members are -1- to another object, while others are handled by the directly used object. The -1- object is frequently called a wrapper object, and explicit -1- members are called wrapper functions.




-1- is often confused with delegation; formally, they are complementary concepts. In both cases, there are two objects, and the first (sending, wrapper) object uses the second (receiving, wrappee) object, for example to call a method. They differ in what this (access) refers to on the receiving object (formally, in the evaluation environment of the method on the receiving object): in delegation it refers to the sending object, while in -1- it refers to the receiving object. Note that this is often used implicitly as part of dynamic dispatch (method resolution: which function a method name refers to).

① field declaration


② readonly struct


③ readonly member


④ ref readonly method return

The readonly modifier can be used in four contexts:


❶ in a ① -1- declaration, it indicates assignment can only occur as part of the declaration or in the constructor of the same class


❷ in a ② readonly -1- definition, where it indicates the ② -1- is immutable


❸ in a ③ readonly -1- definition, indicating that a ③ -1- of a ② -1- doesn't mutate the internal state of the ② -1-


❹ in a ④ -4-, the readonly modifier indicates that the method will return a reference, but writes aren't allowed to that reference.

Mediator Pattern

Programs often consist of many classes which have business logic and computation distributed among them. However, as many more classes are added to a program, especially during maintenance or refactoring, communication between classes may become more complex, making the program more difficult to read and maintain, or change due to high coupling; but with the -1- pattern, communication between objects is encapsulated with a -1- object, so they no longer communicate with each other - only through the -1-.

① Index from End Operator ^


② System.Index Struct

The ① -4- indicates the element position from the end of a sequence. For a sequence of length length, ^n points to the element with offset length - n from the start of a sequence.




Ex: ^1 will point to the sequence's last element, while ^length points to the first element.




^e, where e is an expression of the ② -1-.-1- type, must have a result that's implicitly convertible to int.

① ‣ instance method ‣ object


② ‣ instance method ‣ this


‣ open


③ ‣ static method


④ ‣ static method ‣ object ‣ method ‣ closed




The declaration of a delegate type establishes a contract that specifies the signature of one or more methods. A delegate is an instance of a delegate type that has references to:




① an -2- of a type and a target -1- assignable to that type


② an -2- of a type, with the hidden -1- parameter exposed in the formal parameter list; the delegate is said to be an -1- instance delegate


③ a -2-


④ a -2- and a target -1- assignable to the first parameter of the method; the delegate is said to be -1- over its first argument.

! (postfix)


② null-forgiving operator

The unary postfix ① -1- operator is the ② -2- operator. In an enabled nullable annotation context, you use the ② -2- operator to declare that expression x of a reference type isn't null: x ① -1-.




The ② -2- operator has no effect at run-time. It only affects the compiler's static flow analysis by changing the null state of the expression. At run-time, expression x ① -1- evaluates to the result of the underlying expression x.





Visitor Pattern

The -1- behavioral pattern is a way of separating an algorithm from an object structure on which it operates. A practical result of this separation is the ability to add new operations to existing object structures without modifying them. This keeps in line with the open/closed principle.




In essence, the -1- allows adding new virtual methods to a family of classes, without modification of those classes. A -1- class is created and implements relevant specializations of the virtual method.

① Cryptography


② System.Security.


Cryptography

① -1- is the practice or study of techniques for secure communication in the presence of third parties called adversaries. More generally, ① -1- is about constructing and analyzing protocols preventing third parties and the public from reading private messages.




① -1- is represented in .NET by way of the ② -1-.-1-.-1- namespace, which provides ① -1- services, including secure encoding and decoding of data, hashing, random number generation, and message authentication.


① Default Interface Methods


② interfaces


③ methods


④ default


⑤ Android


⑥ Swift

As of C# 8.0, via the feature ① -3- you can now add members to ②-1- and provide their implementation. This feature enables API authors to add ③ -1- to an ② -1- without breaking source or binary compatibility with existing implementations. Those existing implementations instead inherit the ④ -1-implementation.




① -3- enable scenarios similar to a traits language feature, and enable C# to interoperate with APIs that target the ⑤ -1- OS/mobile platform or the ⑥ -1- programming language, which is in turn targeted at iOS, macOS, and similar Apple platforms.




Software Development Kit (SDK)

A -3- (abbr. -1-) is a collection of software development tools in one installable package. They ease creation of applications by having compiler, debugger, and sometimes a software framework.

① Regular Expressions


② RegEx Class


③ System.Text.


RegularExpressions

A ① -2- is a sequence of characters that define a search pattern. Usually such patterns are used by string-searching algorithms for "find" or "find and replace" operations on strings, or for input validation. It is a technique developed in theoretical computer science and formal language theory.




In .NET, ① -2- are represented by the ② -1- class in the ③ -1-.-1-.-1- namespace.


① nullable reference types


② non-nullable reference types


③ null


④ ? (question mark)

① -3- and ② -4- enable you to make important statements about the properties for reference type variables:





• a reference is not supposed to be ③ -1-


• a reference may be ③ -1-





Depending on the statement, it affects the compiler's behavior by allowing it to enforce rules to your benefit. This is in comparison to earlier versions of C# where the compiler could not determine your intention.




A ① -3- is noted using the ④ -1- symbol. Any reference types without the ④ -1- are therefore ② -4-.

① Red-Black Tree
② Search Tree




A ① -3- is a kind of self-balancing binary ② -2- where each node of the binary ② -2- has an extra bit that is interpreted as the color of the node. The color bits help ensure the ① -3- remains balanced during insertions and deletions. The ① -3- is used to organize pieces of comparable data such as numbers or text fragments.

① Range operator (a . . b)


② range


③ inclusive


④ exclusive


⑤ System.Range

The ① -2- specifies the start and end of a ② -1- of indices as its operands. The left-hand operand is an ③ -1- start of a ② -1-. The right-hand operand is an ④ -1- end of a ② -1-. Either operand can be an index from the start or end of a sequence.




The ① -2- is of the ⑤ -1-.-1- type. The result of its expression must be implicitly convertible to either int or index.

Compiler

A -1- is a program that translates code written in one programming language (the source language) into another language (the target). This transition is usually from a high-level language to a lower-level language (i.e. assembly, object, or machine code) to create an executable file. There are many different types of -1-.




Common operations performed by a -1- include: preprocessing, lexical analysis, semantic analysis, parsing, code optimization, and code generation.

① Recursive Pattern


② Switch Expression

C# 8.0 has expanded its pattern matching toolset. A ① -2- is simply a pattern expression applied to the output of another pattern expression. Patterns are used in the is pattern operator, in a switch statement, and in a ② -2- to expression the shape of data against which incoming data (the input value) is to be compared. A pattern may be a ① -2- so that parts of the data may be matched against sub-patterns.




Often a switch statement produces a value in each of its case blocks. ② -2- enable you to use more concise expression syntax, with fewer repetitive case and break keywords, and fewer curly braces. Specifically:




▪ the variable comes before the switch keyword. The different order makes it easier to distinguish from a switch statement


▪ the case and : elements are replaced with =>, which is more concise and intuitive


▪ the default case is replaced with a _ discard


▪ the bodies are expressions, not statements






new modifier

When used as a declaration modifier, -1- explicitly hides a member that is inherited from a base class. When you hide an inherited member, the derived version of the member replaces the base class version. Although you can hide members without using -1-, you get a compiler warning that would otherwise be suppressed.