A concise reference on how C++ algorithms evolved from raw loops to composable, lazy pipelines — and why ranges represent the most significant leap in expressive power since the STL itself.
A comprehensive guide to std::span introduced in C++20.
std::span is a non-owning view over a contiguous sequence of objects. It provides a safe, lightweight way to reference arrays or array-like data structures without taking ownership.
| #!/bin/bash | |
| # Script to run YOLO predictions with two models and compose results side-by-side | |
| # Check if video input is provided | |
| if [ "$#" -lt 1 ]; then | |
| echo "Usage: $0 <input_video>" | |
| echo "Example: $0 /path/to/video.mp4" | |
| exit 1 | |
| fi |
Ninja is a small, fast build system designed to have its input files generated by a higher-level build system (like CMake). It's optimized for speed and is particularly useful for large C++ projects.
# Create build directory| #!/bin/bash | |
| ############################################################################### | |
| # extract_clip.sh | |
| # | |
| # 🎬 Extract a segment of a video from a given start time and duration. | |
| # | |
| # 📥 Usage: | |
| # ./extract_clip.sh input.mp4 start_time duration output.mp4 [--accurate] | |
| # |
| #!/bin/bash | |
| ###################################################################### | |
| # blackout_roi.sh | |
| # | |
| # 🔳 Blackout a Region of Interest (ROI) in a video for a given time window. | |
| # | |
| # 🎯 Usage: | |
| # ./blackout_roi.sh input.mp4 ROI t1 duration output.mp4 [x y w h] | |
| # |
This gist outlines the core parallel programming patterns (cornerstones) used in CUDA to leverage modern NVIDIA GPU architectures. These patterns are fundamental for exploiting CUDA’s Single Instruction, Multiple Thread (SIMT) execution model, memory hierarchy, and advanced thread management features for efficient parallel computation.
A key theme in modern CUDA development is the use of highly optimized libraries. For many common patterns, NVIDIA CUB provides state-of-the-art implementations. While the original standalone CUB repository is now archived, CUB is actively maintained as part of the CUDA C++ Core Libraries (CCCL). CCCL unifies CUB, Thrust, and libcu++ into a cohesive standard library included in every CUDA Toolkit. Using libraries like CUB is the recommended best practice for achieving maximum performance and reliability.
The cornerstones covered include:
- [Reduction](#1-red
| #!/bin/bash | |
| # Check if at least two inputs are provided | |
| if [ "$#" -lt 2 ]; then | |
| echo "Usage: $0 <video1> <video2> [output_file]" | |
| exit 1 | |
| fi | |
| # Assign inputs to variables | |
| video1="$1" |
| #!/bin/bash | |
| # NAS Share Mounter - Mount CIFS/SMB shares with enhanced features | |
| # Prerequisites: sudo apt-get install cifs-utils | |
| set -euo pipefail # Exit on error, undefined variables, pipe failures | |
| # ======= CONFIGURATION ======= | |
| SCRIPT_NAME=$(basename "$0") | |
| CONFIG_FILE="$HOME/.nas_mounter.conf" | |
| LOG_FILE="/tmp/nas_mounter_$(date +%Y%m%d).log" |