Arnav Ishaan
0 followers · 264 views
on the atlas — 25
- Configuring Blackfire Continuous Profiler for Rust1 savers
- Curius / Onboarding2621 savers
- Extended Euclidean Algorithm - Algorithms for Competitive Programming1 savers
- Euclidean algorithm for computing the greatest common divisor - Algorithms for Competitive Programming1 savers
- Fibonacci Numbers - Algorithms for Competitive Programming1 savers
- Binary Exponentiation - Algorithms for Competitive Programming1 savers
- Introduction to Dynamic Programming - Algorithms for Competitive Programming1 savers
- Summary - Rust for C-Programmers1 savers
- Summary - Rust for C-Programmers1 savers
- Moves, cloning, and copying - Rust for C-Programmers1 savers
- Summary - Rust for C-Programmers1 savers
- Summary - Rust for C-Programmers1 savers
- Getting Started - Asynchronous Programming in Rust2 savers
- Simple Explanation for the "Reactor Pattern" with its Applications - Stack Overflow1 savers
- Dynamic dispatch - Wikipedia1 savers
- Summary - Rust for C-Programmers1 savers
- Constants and statics - Rust for C-Programmers1 savers
- Memory safety and ownership - Rust for C-Programmers1 savers
- Modules and crates - Rust for C-Programmers1 savers
- Data types - Rust for C-Programmers1 savers
- The program structure - Rust for C-Programmers1 savers
- Rust for C programmers - Rust for C-Programmers1 savers
- What makes Rust special - Rust for C-Programmers1 savers
- Why Rust - Rust for C-Programmers1 savers
- Async Rust Is A Bad Language1 savers
highlights — 40
negative integers as well
Extended Euclidean Algorithm - Algorithms for Competitive ProgrammingGCD of the set of numbers
Euclidean algorithm for computing the greatest common divisor - Algorithms for Competitive Programming𝑎 mod 𝑏 a mod b $a \bmod b$ for the case 𝑎 ≥ 𝑏 a ≥ b $a \geq b$ is at least 2 2 $2$ times smaller than 𝑎 a $a$ , so the larger number is reduced at least in half on each iteration of the algorithm
Euclidean algorithm for computing the greatest common divisor - Algorithms for Competitive ProgrammingEuclidean algorithm works in 𝑂 ( log min ( 𝑎 , 𝑏 ) ) O ( log min ( a , b ) ) $O(\log \min(a, b))$ .
Euclidean algorithm for computing the greatest common divisor - Algorithms for Competitive Programmingconsecutive Fibonacci numbers are the worst case input for Euclid's algorithm.
Euclidean algorithm for computing the greatest common divisor - Algorithms for Competitive Programmingconvenient to define it as zero as well to preserve the associativity of gcd gcd $\gcd$
Euclidean algorithm for computing the greatest common divisor - Algorithms for Competitive Programmingthere are at least two identical pairs among them. This is sufficient to prove the sequence is periodic, as a Fibonacci number is only determined by its two predecessors
Fibonacci Numbers - Algorithms for Competitive ProgrammingIf 𝑚 m $m$ is a prime number 𝑥 𝑛 ≡ 𝑥 𝑛 mod ( 𝑚 − 1 ) ( mod 𝑚 ) x n ≡ x n mod ( m − 1 ) ( mod m ) $x^n \equiv x^{n \bmod (m-1)} \pmod{m}$ for prime 𝑚 m $m$ , and 𝑥 𝑛 ≡ 𝑥 𝑛 mod 𝜙 ( 𝑚 ) ( mod 𝑚 ) x n ≡ x n mod ϕ ( m ) ( mod m ) $x^n \equiv x^{n \bmod{\phi(m)}} \pmod{m}$ for composite 𝑚 m $m$ .
Binary Exponentiation - Algorithms for Competitive Programmingsplit the work using the binary representation of the exponent.
Binary Exponentiation - Algorithms for Competitive Programming(using the modulo operator) only maintaining the values we need.
Introduction to Dynamic Programming - Algorithms for Competitive ProgrammingUsing a binary search tree (map in C++) to save states will technically result in 𝑂 ( 𝑛 log 𝑛 ) O ( n log n ) $O(n \log n)$ as each lookup and insertion will take 𝑂 ( log 𝑛 ) O ( log n ) $O(\log n)$ work and with 𝑂 ( 𝑛 ) O ( n ) $O(n)$ unique subproblems we have 𝑂 ( 𝑛 log 𝑛 ) O ( n log n ) $O(n \log n)$ time.
Introduction to Dynamic Programming - Algorithms for Competitive ProgrammingThese alternative ways of saving state are primarily useful when saving vectors or strings as part of the state space.
Introduction to Dynamic Programming - Algorithms for Competitive ProgrammingLifetimes: Required when returning references (&T, &mut T) to ensure validity; Rust prevents returning references to local variables.
Summary - Rust for C-ProgrammersLifetimes: Ensure references never outlive the data they point to, preventing dangling references. Crucially, Rust lifetimes ('_ things) are about the duration of borrows, not directly about the liveness scope of values or variables, nor when values are destructed.
Summary - Rust for C-ProgrammersThis works because println! is a macro. Macros can be more flexible than regular functions. println! expands into code that uses formatting traits, and these traits typically operate on references. When you pass an owned String, the macro expansion effectively takes a shared reference (&String, which often further dereferences to &str for formatting) for the duration of the call. It borrows the value rather than consuming it
Moves, cloning, and copying - Rust for C-Programmerswrap (integers). Explicit handling methods (checked_, wrapping_, etc.)
Summary - Rust for C-ProgrammersShadowing: Re-declaring a variable name with let
Summary - Rust for C-ProgrammersMemory Safety: The ownership and borrowing system enables memory safety without a garbage collector, verified at compile time.
Summary - Rust for C-ProgrammersError Handling: Result and Option
Summary - Rust for C-Programmersprogrammer explicitly yielding control by using the await keyword.
Getting Started - Asynchronous Programming in RustAdaptive Communications Environment
Simple Explanation for the "Reactor Pattern" with its Applications - Stack OverflowC++ compilers typically implement dynamic dispatch with a data structure called a virtual function table (vtable)
Dynamic dispatch - WikipediaMake/CMake with a package manager like apt, Conan, or vcpkg.
Summary - Rust for C-ProgrammersLifetimes: The compiler uses lifetime analysis (a concept discussed later) to ensure references never outlive the data they point to.
Memory safety and ownership - Rust for C-Programmers2.6 Constants and Static Variables
Constants and statics - Rust for C-Programmersmemory safety (no dangling pointers, no use-after-free, no data races)
Memory safety and ownership - Rust for C-Programmerstypical C workflows that often require manual library linking and configuration
Modules and crates - Rust for C-ProgrammersItems within a module are private by default and must be explicitly marked pub
Modules and crates - Rust for C-Programmersreferences—safe, managed pointers
Data types - Rust for C-Programmerstrait-based conversions (using Into, From, or AsRef)
What makes Rust special - Rust for C-Programmers? operator provides a concise syntax for propagating errors upward, maintaining readability
What makes Rust special - Rust for C-Programmersunique ownership model, Rust guarantees memory safety without relying on a runtime garbage collector
Rust for C programmers - Rust for C-Programmersfailures might be silently ignored.
What makes Rust special - Rust for C-Programmersownership, borrowing, and move semantics, along with making immutability
What makes Rust special - Rust for C-ProgrammersResult and Option types for error handling
Why Rust - Rust for C-ProgrammersOOP concepts via traits and structs
Why Rust - Rust for C-Programmerspreventing data races at compile time
Why Rust - Rust for C-Programmersiterators and closures
Why Rust - Rust for C-Programmersgarbage collection and large runtime environments
Why Rust - Rust for C-Programmersconcurrent system is to split code into multiple processes
Async Rust Is A Bad Language