This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * stb_vector.h - v1.0 - public domain type-safe generic dynamic arrays | |
| * | |
| * This is a single-header-file library that provides easy-to-use | |
| * dynamic arrays for C (also works in C++). | |
| * | |
| * DO THIS ONCE, AT THE START OF ONE SOURCE FILE: | |
| * #define STB_VECTOR_IMPLEMENTATION | |
| * #include "stb_vector.h" | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <vector> | |
| #include <string> | |
| #include <map> | |
| #include <functional> | |
| #include <stdexcept> | |
| #include <algorithm> | |
| #include <utility> | |
| #include <cctype> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT employee_name, department, salary | |
| FROM employees e | |
| WHERE salary = ( | |
| SELECT MAX(salary) | |
| FROM employees | |
| WHERE department = e.department | |
| ) | |
| ORDER BY department; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <setjmp.h> | |
| #include <stdbool.h> | |
| #include <string.h> | |
| #include <stdint.h> | |
| #ifdef _WIN32 | |
| #include <conio.h> | |
| void clear_screen() { system("cls"); } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <fstream> | |
| #include <string> | |
| #include <print> # C++ 23 print | |
| #include <stdexcept> | |
| bool is_binary_file(const std::string& filename) { | |
| std::ifstream input_file_stream(filename, std::ios::binary); | |
| if (!input_file_stream) { | |
| throw std::runtime_error("Could not open file '" + filename + "'."); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <string> | |
| #include <vector> | |
| #include <random> | |
| #include <thread> | |
| #include <chrono> | |
| void initialize_random_seed() { | |
| std::random_device rd; | |
| std::srand(rd()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdint.h> | |
| // Define ARCH_NAME based on the detected architecture | |
| #if defined(__x86_64__) || defined(_M_X64) | |
| #define ARCH_NAME "x86_64" | |
| #elif defined(__i386__) || defined(_M_IX86) | |
| #define ARCH_NAME "x86" | |
| #elif defined(__aarch64__) || defined(_M_ARM64) | |
| #define ARCH_NAME "ARM64" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <iomanip> | |
| #include <string> | |
| #include <stdexcept> | |
| #include <cstdint> | |
| #include <cstring> | |
| #include <limits> | |
| #include <cstdlib> | |
| float parse_hex_to_float(const std::string& hex_str) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Advanced File Type Detection Program like GNU file type detection tool | |
| // Note: This program is a simplified version and may not cover all possible file types. | |
| // Created by: HeavenHM. | |
| // Date: 2024-01-12 | |
| #include <iostream> | |
| #include <fstream> | |
| #include <string> | |
| #include <filesystem> | |
| #include <algorithm> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <bitset> | |
| #include <stdexcept> | |
| #include <iomanip> | |
| // Function to check if the system is little endian | |
| bool isSystemLittleEndian() { | |
| int testNumber = 1; | |
| return *(char*)&testNumber == 1; | |
| } |
NewerOlder