/SampleCode

Code from the mCoding sample videos

Primary LanguagePythonMIT LicenseMIT

This repository contains all the source code shown in my mCoding programming videos on YouTube.

All code in this repository is licensed under the open source MIT license. You don't need to ask permission to use it, feel free! It's not required, but I'd appreciate if you would link my YouTube channel if you used my code!

mCoding YouTube channel

mCoding website

James and his team are available for consulting, contracting, code reviews, and interview prep services.

N Code Video
142 src What you need to know about Startup and Shutdown Events in FastAPI and ASGI Applications
141 src Application classes vs. functions
140 src Asynchronous Web Apps in Python
139 src New Windows Command Escape Vulnerability - Critical CVE ... or is it?
138 src Async for loops in Python
137 src The ins and outs of context managers and try-finally in Python
136 src Python Debugging (PyCharm + VS Code)
135 src Modern Python logging
134 no src Why Zero times Anything is Zero
133 src You won't believe it! Import from the Cloud
132 src Bloom Filters
131 no src Actually, you CAN divide by zero.
130 src Python 3.12 is HERE!
129 src Lambda in a Loop is a Code Smell
128 src A forbidden Python technique to put ANYTHING in a dict or set.
127 src Don't make this big O mistake!
126 src Why I prefer attrs over dataclasses
125 src type(obj) vs. obj.class in Python, and changing an object's class.
124 src Python's collections.abc | InvertibleDict
123 src unique_ptr is NOT just for heap allocations | custom deleters
122 src How to check if a file exists in Python
121 src unique_ptr: C++'s simplest smart pointer
120 src Does Python have a ternary operator?
119 src 21 MORE nooby Python habits
118 src str vs bytes in Python
117 src Intro to async Python | Writing a Web Crawler
116 src Complex (Gaussian) Rationals - Extending Python's Number hierarchy
115 src Fast pow
114 src Python Iterators! COPY or NO COPY?
113 src Getting around the recursion limit
112 src Every Python dev falls for this (name mangling)
111 src Functions within functions, closures, and variable scopes in Python
110 src Return Value Optimization and Copy Elision in C++
109 src It's time... for PYTHON 3.11!
108 src Python Generators
107 src 8 things in Python you didn't realize are descriptors
106 src str/int: Controversial breaking change added to Python
105 src Python's creator wishes this feature never existed
104 src Unlocking your CPU cores in Python (feat. multiprocessing)
103 src For loops are redundant
102 src How to use Python features from future versions!
101 src Use THIS for looping over several Python dictionaries
100 src Python's most DISLIKED __dunder__ (and what to use instead)
99 src sum(range(n)) != n(n+1)/2
98 src Permutations - A Python itertools Algorithm
97 src Python's secret second argument to iter()
96 src Why do some Python classes inherit from object?
95 src Method Chaining Classes in Python
94 src Positional-only and keyword-only arguments in Python
93 src super, Python's most misunderstood feature.
92 src Pythonizing Imgui (feat. Cython)
91 src Python lists remember what you did to them
90 src The real purpose of Python's match statement, feat. CSTs
89 src Analyzing Python Code from Python - AST Parsing and Custom Lint Checks
88 src Does std::endl fix your multithreaded prints? (C++)
87 no src A technical interview with the creator of C++, Bjarne Stroustrup
86 src 31 nooby C++ habits you need to ditch
85 no src Building a Python app with Anvil to email me if my website goes down
84 src Python's staticmethod and classmethod, what are they for?
83 src 25 nooby Python habits you need to ditch
82 src Avoiding import loops in Python
81 src Your code could be 2x faster! Gains from cache locality and branch predictability
80 src Python __slots__, slots, and object layout
79 src Which Python @dataclass is best? Feat. Pydantic, NamedTuple, attrs...
78 src The best way to keep your repos tidy.
77 src Mind-bending metaclasses - adding function overloads to Python
76 src __new__ vs __init__ in Python
75 src You can pip install straight from GitHub
74 src Automated Testing in Python with pytest, tox, and GitHub Actions
73 src Why does Python even allow this? Chained comparison jank.
72 src Multiple Assignments in Python
71 src Should you use "not not x" instead of "bool(x)" in Python?
70 src restrict: the only C keyword with no C++ equivalent
69 src A fun game show probability problem | Bonus cash stop riddle
68 src Skyline Problem with C++ Solution Explained
67 src You should put this in all your Python scripts
66 src How an x becomes a bool in Python, C++, and C
65 src A crypto breakfast: salt, pepper, and hash | Secure Python
64 src MD5 - A broken secure hash algorithm | Python implementation
63 src Diagnose slow Python code. (Feat. async/await)
62 src Python f-strings can do more than you thought. f'{val=}', f'{val!r}', f'{dt:%Y-%m-%d}'
61 src Time to Hack - Cracking passwords using timing information | Secure Python
60 src Mathematically Perfect Tongue Twisters | Python Linguistics
59 src Python + YouTube API | Automating descriptions
58 src Not all exceptions are Exceptions | Python Exceptions
57 src Python's New Match Statement is Tricky! Q&A
56 src Introducing mZips! Python Zip and Zip Longest
55 src The error messages Python always needed! New in Python 3.10 - Part II
54 src Can you BELIEVE all this new type hinting stuff? New in Python 3.10 - Part I
53 src 0.1 + 0.2 is NOT 0.3 in Most Programming Languages
52 src How To Install Python for Data Science
51 src Efficient Exponentiation
50 src Variable Lookup Weirdness in Python
49 src The Best Way to Check for Optional Arguments in Python
48 src Binary Search - A Different Perspective | Python Algorithms
47 src Python's sharpest corner is ... plus equals? (+=)
46 src Every PROOF you've seen that .999... = 1 is WRONG
45 src C++ Sudoku Solver in 7 minutes using Recursive Backtracking
44 src Python dataclasses will save you HOURS, also featuring attrs
43 src [April Fools 2021] Python 4.0! New old print, mandatory static typing, StackOverflow integration
42 src Thank you for 100x-ing my channel in 2 weeks!
41 src C++ First Missing Int, faster than 100%!
40 src How Fast is Python's Sort? Performance Testing
39 src The Hottest New Feature Coming In Python 3.10 - Structural Pattern Matching / Match Statement
38 src Longest Increasing Subsequence - Python explanation
37 src 50 Million Primes In 5 Seconds - Segmented Sieve of Eratosthenes
36 src Magic Methods - Making Python builtins work with your classes
35 src How to find the Maximum Increasing Sum of a List
34 src Chaos and Order - A Brownian Fractal Infinite Zoom to Classical Music
33 src Infinite Zoom on Brownian Motion with Chill Music (4k 60fps 10^541 Zoom)
32 src Numpy Broadcasting Explained
31 src The Fastest Way to Loop in Python - An Unfortunate Truth
30 src The Single Most Useful Decorator in Python
29 src Simulating Brownian Motion in Python
28 src JSON Tutorial Python | Basic Python Recipes
27 src Trapping Rain in Python with Numpy | LeetCode Hard Interview Solution
26 src Turing Machine Example Program | Doubling Ones
25 src Find the First Missing Positive Int | Hard Interview Question on LeetCode
24 src Merge K Sorted Lists using a C++ Heap | Hard LeetCode Interview Question
23 src Hard LeetCode Interview Question | Regular Expression Matching
22 src Solving Hard LeetCode Interview Questions | Median of Two Sorted Arrays
21 src How Many Matches in a Single Elimination Tournament? | Challenge Question
20 src Cycles in Linked Lists Part 2 - Find the Start of the Cycle
19 src Stream Sample - Random Sampling a Read Once Stream | Neat Trick
18 src Detecting Cycles in Linked Lists Using the Tortoise and Hare Algorithm
17 src Remove Unicode �? Characters from CSV files
16 src Why a list[Derived] is NOT a list[Base]
15 src Writing a Turing Machine in Python Step by Step
14 src Finding Primes in Python with the Sieve of Eratosthenes
13 src Finding Your Largest Files | Basic Python Recipes
12 src Code that runs BEFORE you call a function | Python Weirdness
11 src 'and' and 'or' do NOT return bools in Python!
10 src Ordering dependencies with TopologicalSorter - New in Python 3.9
9 src How to flatten a list | Basic Python Recipes
8 src randbytes and printing garbage for fun - New in Python 3.9
7 src Metadata in type annotations using Annotated - New in Python 3.9
6 src removeprefix and removesuffix string methods - New in Python 3.9
5 src Python Weirdness - The comma equals ,= operator?
4 src Empty Truth in Python
3 src Relaxed restrictions on decorators - New feature in Python 3.9
2 src Goodbye, List! Type hinting standard collections - New in Python 3.9
1 src Doeblin Tree
0 src Dictionary Union (or/pipe operator) - New Feature in Python 3.9