Initial transfer of larger repo from git. IF full history and branches are needed must go to github at https://github.com/DulcisL/CCUCoding.git

This commit is contained in:
dolcel committed 2026-10-20 23:59:02 +00:00
commit c09ce40be0
4048 files changed
+603256

No files matched your search

Binary file not shown.
Binary file not shown.
+39
View File
@@ -0,0 +1,39 @@
# Compilers
## Typical compilation statement
`g++ -std=c++11 -g ./main.cpp -o ../bin/main`
`-g for debug (also -p for profile)`
## What is a compiler?
A compiler is a software tool that translates high-level programming code written in a human-readable language (such as C++, Java, Python, etc.) into low-level machine code, or bytecode, that can be executed by a computer's CPU (Central Processing Unit). The process of translation performed by a compiler is known as compilation.
## Here's how a compiler typically works
### Parsing
The compiler first reads the source code written by the programmer and parses it to understand its structure and syntax. This involves breaking down the code into smaller elements, such as keywords, identifiers, operators, and symbols.
### Semantic Analysis
After parsing, the compiler performs semantic analysis to ensure that the code adheres to the rules and constraints of the programming language. This includes type checking, variable declarations, function definitions, and other language-specific rules.
### Intermediate Representation
Many compilers generate an intermediate representation (IR) of the code after parsing and semantic analysis. The IR is a platform-independent representation of the code that simplifies further optimization and code generation.
### Optimization
Compilers often perform various optimization techniques to improve the efficiency and performance of the generated code. These optimizations may include dead code elimination, constant folding, loop unrolling, and inlining of functions.
### Code Generation
Finally, the compiler translates the optimized code into the target machine's specific instructions or bytecode. This process involves mapping high-level constructs to their corresponding low-level instructions, such as assembly language or bytecode.
### Output
The compiled code is typically stored in an executable file or object file, depending on the compiler and the target platform. This file can then be executed by the computer's operating system or further linked with other object files to create a complete executable program.
Compilers play a crucial role in the software development process, enabling programmers to write code in high-level languages while ensuring that it can be efficiently executed on a computer. They are essential tools for translating abstract programming concepts into instructions that a computer can understand and execute.
+31
View File
@@ -0,0 +1,31 @@
{
/*
File Name: CPP template
Author: D. Blair
Creation Date: 5/23/2024
*/
"Print to console": {
"prefix": "#cpp",
"body": [
"/*",
" Name:",
" Class:",
" Project:",
" Last Date:",
"*/",
"#include <iostream>",
"using namespace std;",
"",
"/// @brief",
"/// @param argc the number of arguments passed into main",
"/// @param argv the list of arguments passed into main",
"/// @return integer code indicating success or not",
"int main(int argc, char* argv[])",
"{",
" cout << \"Hello World!\";",
" return 0;",
"}"
],
"description": "output header info"
}
}
+36
View File
@@ -0,0 +1,36 @@
# History
## Origins in C (1979-1983)
Bjarne Stroustrup, a Danish computer scientist, began developing C++ at Bell Labs in 1979.
Stroustrup's initial motivation was to create a language that provided higher-level abstractions for programming tasks while retaining the efficiency and low-level control offered by the C programming language.
The first version of C++ was named "C with Classes," as it introduced the concept of classes to C, enabling object-oriented programming (OOP) features like encapsulation, inheritance, and polymorphism.
In 1983, the language was renamed C++ ("C plus plus"), reflecting its evolution from C.
## Early Releases and Evolution (1985-1990)
The first official release of C++ came in 1985. This version included features like classes, inheritance, virtual functions, and function overloading.
Throughout the late 1980s and early 1990s, C++ gained traction among programmers, particularly in industries such as telecommunications, finance, and gaming, where its combination of performance and abstraction proved advantageous.
## Standardization Efforts (1990s)
In the early 1990s, efforts began to standardize the C++ language to ensure consistency and portability across different implementations.
The first standardized version of C++, often referred to as "C++98" or "ISO/IEC 14882:1998," was published by the International Organization for Standardization (ISO) in 1998.
Standardization played a crucial role in establishing C++ as a widely-used programming language for both commercial and academic purposes.
## C++11 and Modern Features (2010s)
C++11, released in 2011, marked a significant milestone in the language's evolution. It introduced numerous modern features, including auto type deduction, lambda expressions, range-based for loops, and smart pointers.
Subsequent updates, such as C++14 and C++17, built upon the foundation laid by C++11, focusing on refining existing features and introducing new ones.
These updates aimed to make the language more expressive, safer, and efficient, catering to the evolving needs of software developers across various domains.
## Recent Developments (2020s)
C++20, released in 2020, brought several new features and enhancements, including modules, concepts, coroutines, and ranges.
The C++ standards committee continues to work on further improvements and additions to the language, with C++23 and beyond expected to introduce additional features and refinements.
Throughout its history, C++ has maintained its position as one of the most widely-used and influential programming languages, owing to its versatility, performance, and extensive standard library. Its evolution continues to be guided by the needs of developers and advancements in computer science and software engineering.
### Credits
[C++ Reference Website](https://en.cppreference.com/w/cpp/language/history)
+47
View File
@@ -0,0 +1,47 @@
# Installation
## Linux
Note that if you are working on a Windows machine you will need to either use **Windows Subsystem for Linux**, Virtualbox, or VMware to create an instance of Linux on your machine. I personally prefer to use WSL but any of the three will work just fine. If you are on Mac or Linux then you can skip down to setup.
### WSL
Here is a link for [WSL](https://learn.microsoft.com/en-us/windows/wsl/). I am using Ubuntu 24.04 which is currently the latest, but almost any flavor will be fine.
Here is a WSL [Cheat-sheet](../Course_Docs/wsl_cheat_sheet.md) that you may find useful.
### VMWare and Virtualbox
[Video](https://youtu.be/rJ9ysibH768?si=u_dEqPVRRtGGggNa) on installing Ubuntu into VirtualBox.
[Video](https://youtu.be/ZWSoASXGYNU?si=EDkSptm8TrdySboY) on installing Ubuntu into VMWare Player.
You can download [Virtual Box](https://www.virtualbox.org/wiki/Downloads).
You can download [VMware Workstation Player](https://www.vmware.com/products/workstation-player/workstation-player-evaluation.html.html).
Then you will need to download an [Ubuntu iso](https://ubuntu.com/download) file and load it into either VMware or VirtualBox.
## Setup
1. Log into your Linux or Mac OS
2. Launch a terminal window
3. Install the following packages (see images below)
- Install:
- g++ (compiler) `sudo apt install g++`
- gdb (debugger) `sudo apt install gdb`
- vs code
- Install as needed:
- cmake (compile and link tooling) `sudo apt install cmake`
- git `sudo apt install git`
4. Verify everything installed (see image below)
![Verify Installs](./images/verifyinstalls.png "Verify Installs")
5. To check vs code, type "code ." while in wsl or other virtual machine, and that should start vs code.
6. In you home directory, create a working directory called "dev" that you will use during this course
7. Change directory into dev
8. Create a new directory called Module1
9. Change directory into Module1
10. Create a directories called bin and src
11. Add [cpp.vscode.snippet text](https://github.com/profdblair/CSCI-207/blob/main/JSON%20Docs/cpp.vscode.snippet)
- Go to properties in vscode, User Snippets, cpp.json and copy-paste text from cpp.vscode.snippet, save and restart vscode
**Now we are ready to start Programming C++!**
+4
View File
@@ -0,0 +1,4 @@
# Markdown
There are many markdown documents you can look over in my files, So there is no real need for an instruction page.
If you want to drill down, here is a reference: [markdown.org](https://www.markdownguide.org/basic-syntax/)
+35
View File
@@ -0,0 +1,35 @@
# Module 1: Introduction to C++
## TODO
- Review syllabus and other course docs
- Overview of C++ language history and its importance.
- Setup your environment
- Linux plus basic linux commands
- g++ / gdb / vscode
- vscode with cpp snippet json
- Basic structure of a C++ program.
- Introduction to variables, data types, and basic input/output (I/O).
- #cpp snippet in vscode
- JSON Docs / cpp.vscode.snippet
## Readings
- eBook: Chapter 2 through section 2.8 (next week we will finish Chapter 2)
- cpp_history.md
- install.md
- compilers.md
- markdown.md (recommended)
- wsl_cheat_sheet.md (recommended)
## Module 1 Quiz
- __No Quiz this week__
## Module 1 Lab
- __You should complete the lab for this week, however do not turn it in__
## Module 1 Project
- __No graded projects or labs this week__
+49
View File
@@ -0,0 +1,49 @@
# Windows Subsystem for Linux Cheat-Sheet
## list available distros
`wsl --list --online`
## list installed distros
`wsl --list --verbose`
## install a specific disto
`wsl --install --distribution <distro-name>`
## set default version
`wsl --set-default-version <distro-name>`
## start wsl in home directory
`wsl ~`
## update default version to latest version
`wsl --update`
## see general information about install
`wsl --status`
## check version
`wsl --version`
## run as a specific user
`wsl --user <username>`
## terminate (stop) all running distros
`wsl --shutdown`
## terminate a specific distro
`wsl --terminate <distro-name>`
## export a snapshot of a distro to a file, defaults to tar format
`wsl --export <distro> <filename>`
## import a snapshot tar file
`wsl --import <distro> <installation> <filename>`
## unregister and uninstall a wsl distro
`wsl --unregister <distro>`
## mount a disk or device
`wsl --mount <disk-path>`
## unmount a disk or device
`wsl --unmount <disk-path>`