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