C# Flashcards
String Concatenation
“Hello” + var
String Formatting
String.format(“Hello {0}”, var)
String Interpolation
$”Hello {name}”
Verbatim Strings
verbatim string starts with @ and tells the compiler to take the string literally and ignore any space or escape characters; great for file paths
Escape Characters
\n : next line
class
blueprint of an object; has properties and methods
class example AUDI
properties: doors, wheels; abilities: drive, light; inheritence: A5 < Audi < Car
diff between class and instance / member variables
class variables are static and belong to the class; instance variables belong to instantiated objects of the class
Intellisense
IDE’s autofill dropdown when writing code
full specification constructor vs partial specification constructor
all instance variables are defined in constructor vs not all instance variables are defined
Encapsulation
Core principle of OOP; Hiding of data and restriction of access within a class from its outside environment; for example, can be done by using private keyword and using getters and setters; reduces complexity (parts of the class don’t need to know about certain state of the object); c# uses properties for controlled access (can autogen)
python virtual env (create and activate command)
python -m venv .env ; .env/Scripts/activate
pip install modules command
pip install -r [file name + ext]
Hugging Face and NLP
field of linguistic + ML: voice-to-text, translation etc.
ML
teaching computers on task without explicit instructions; one popular method is giving computer large amount of data and with signals, it will teach itself to predict the goal of the task; the result is a model which takes input similar to trained data and returns what it thinks is the expected answer
OOP Principles
Abstraction, polymorphism, inheritance, encapsulation
Encapsulation
What: info hiding, data and method bundling
Benefit: better decoupling, access restriction
Polymorphism
What: substitutability, dynamic runtime behavior
Benefit: extensibility
Inheritance
What: reuse behavior > duplicate code
Benefit: spend time coding efficiently to solve similar problems
Abstraction
contract to concretion
What: model concepts
Benefit: simplify api usage
transformers / transformer library
ML models that are self-supervised trained on large amounts of data; transformer library is an api that has a wide selection of transformer models
encoding / decoding
encode: translate text to numbers; decode: translate numbers to text
tokenizer
converts text to rectangles to send to tensor, has a vocabulary (e.g. english), has encode decode methods
.NET framework vs .NET core
.NET framework is microsoft only