Watch out for this common generator pitfall. What happens to a try/finally, with block, or async with block inside a generator if the generator isn't exhausted? Does the cleanup code still run? When and how does it run? In this video we take a look at the answers to these...
Watch out for this common generator pitfall.
What happens to a try/finally, with block, or async with block inside a generator if the generator isn't exhausted? Does the cleanup code still run? When and how does it run? In this video we take a look at the answers to these questions and learn how to avoid a common situation where cleanup code doesn't run when you want it to.
― mCoding with James Murphy (https://mcoding.io)
PEP 533: https://peps.python.org/pep-0533/
Discussion on GH issue: https://github.com/python/cpython/issues/88684
Source code: https://github.com/mCodingLLC/VideosSampleCode
SUPPORT ME ⭐
---------------------------------------------------
Sign up on Patreon to get your donor role and early access to videos!
https://patreon.com/mCoding
Feeling generous but don't have a Patreon? Donate via PayPal! (No sign up needed.)
https://www.paypal.com/donate/?hosted_button_id=VJY5SLZ8BJHEE
Want to donate crypto? Check out the rest of my supported donations on my website!
https://mcoding.io/donate
Top patrons and donors: Laura M, Neel R, Dragos C, Jameson, Matt R, Pi, Vahnekie, Johan A, Mark M, Mutual Information
BE ACTIVE IN MY COMMUNITY 😄
---------------------------------------------------
Discord: https://discord.gg/Ye9yJtZQuN
Github: https://github.com/mCodingLLC/
Reddit: https://www.reddit.com/r/mCoding/
Facebook: https://www.facebook.com/james.mcoding
CHAPTERS
---------------------------------------------------
0:00 Intro
1:21 The cleanup question
5:30 The async case
Download Docker Desktop: https://dockr.ly/46NkFOJ This video is sponsored by Docker. https://www.docker.com/ Large Language Models (LLMs) are a type of AI model that have proven to be extremely powerful and useful for a wide variety of tasks. They may be "large" in the sense...
Download Docker Desktop: https://dockr.ly/46NkFOJ
This video is sponsored by Docker. https://www.docker.com/
Large Language Models (LLMs) are a type of AI model that have proven to be extremely powerful and useful for a wide variety of tasks. They may be "large" in the sense that they use billions of parameters, but that doesn't mean you need to be a big company in order to run one. In fact, you can run some of the latest and greatest LLMs on your own machine, on your GPU, completely for free. We'll see how to do all that and more in this video using Docker Desktop! We'll even write an app to detect YouTube comment spam using an LLM.
― mCoding with James Murphy (https://mcoding.io)
Docker: https://www.docker.com/
Ollama: https://ollama.com/
Ollama Docker image: https://hub.docker.com/r/ollama/ollama
Ollama Python: https://github.com/ollama/ollama-python
GPU compatibility: https://developer.nvidia.com/cuda-gpus
Docker Tutorial Video: https://youtu.be/b0HMimUb4f0
Fast Pow algorithm Video: https://youtu.be/GrNJE6ogyQU
YouTube Data API Video: https://youtu.be/0F9sdRtbwkE
Source code: https://github.com/mCodingLLC/VideosSampleCode
SUPPORT ME ⭐
---------------------------------------------------
Sign up on Patreon to get your donor role and early access to videos!
https://patreon.com/mCoding
Feeling generous but don't have a Patreon? Donate via PayPal! (No sign up needed.)
https://www.paypal.com/donate/?hosted_button_id=VJY5SLZ8BJHEE
Want to donate crypto? Check out the rest of my supported donations on my website!
https://mcoding.io/donate
Top patrons and donors: Laura M, Neel R, Dragos C, Jameson, Matt R, Pi, Vahnekie, Johan A, Mark M, Mutual Information
BE ACTIVE IN MY COMMUNITY 😄
---------------------------------------------------
Discord: https://discord.gg/Ye9yJtZQuN
Github: https://github.com/mCodingLLC/
Reddit: https://www.reddit.com/r/mCoding/
Facebook: https://www.facebook.com/james.mcoding
CHAPTERS
---------------------------------------------------
0:00 Intro
0:56 Prerequisites
2:24 Running an model
4:33 Building an app
8:33 Containerizing the script
Docker Tutorial for Beginners teaching you everything you need to know to get started. This video is sponsored by Docker. https://www.docker.com/ Whether you're a student or a professional, let's learn the fundamentals of Docker by example, from start to finish in an easily...
Docker Tutorial for Beginners teaching you everything you need to know to get started.
This video is sponsored by Docker. https://www.docker.com/
Whether you're a student or a professional, let's learn the fundamentals of Docker by example, from start to finish in an easily understandable way, using hands-on demos and code examples along with explanations detailing the important points.
By the end of this tutorial, you will understand the basics of Docker, including what Docker is and what problems it solves, what's the difference between containers and virtual machines, how to install Docker, what's the difference between containers and images, how to pull images and run, run containers with environmental variables, arguments, and mapped ports, how to reduce Docker image size using slim and Alpine images, how to persist data in volumes and bind-mounts and understand the difference between volumes vs bind-mounts, how to build your own custom images using Dockerfiles and understand Docker layers, how to create multistage builds, how to use Docker compose to manage multiple containers, how to publish Docker images to Docker Hub, and some advice on deploying Docker containers in the cloud.
Throughout the course we will create a fully functioning containerized app with an NGINX frontend, Python FastAPI backend, and MongoDB database.
― mCoding with James Murphy (https://mcoding.io)
Docker: https://www.docker.com/
Dockerfile reference: https://docs.docker.com/reference/dockerfile/
Compose file reference: https://docs.docker.com/compose/compose-file/
Docker Hub: https://hub.docker.com/
Source code: https://github.com/mCodingLLC/VideosSampleCode
SUPPORT ME ⭐
---------------------------------------------------
Sign up on Patreon to get your donor role and early access to videos!
https://patreon.com/mCoding
Feeling generous but don't have a Patreon? Donate via PayPal! (No sign up needed.)
https://www.paypal.com/donate/?hosted_button_id=VJY5SLZ8BJHEE
Want to donate crypto? Check out the rest of my supported donations on my website!
https://mcoding.io/donate
Top patrons and donors: Laura M, Neel R, Dragos C, Jameson, Matt R, Pi, Vahnekie, Johan A, Mark M, Mutual Information
BE ACTIVE IN MY COMMUNITY 😄
---------------------------------------------------
Discord: https://discord.gg/Ye9yJtZQuN
Github: https://github.com/mCodingLLC/
Reddit: https://www.reddit.com/r/mCoding/
Facebook: https://www.facebook.com/james.mcoding
CHAPTERS
---------------------------------------------------
0:00 Intro
1:24 What is Docker and Why?
3:21 Docker containers vs Virtual Machines
4:17 Installing Docker, Docker Desktop
6:21 Docker hello world
7:17 Docker containers vs images
8:35 Port mapping Docker containers
10:00 Run Docker container in background
11:29 Docker tags and digests
13:33 Running with env vars and args
14:28 Slim images and Alpine images
16:04 Debugging running Docker containers
17:16 Persistence with Docker volumes and bind-mounts
22:25 Custom Docker images, Dockerfiles, frontend NGINX
26:06 Docker layers
29:01 Custom Docker images, backend Python FastAPI
33:40 Docker multistage builds
36:39 Docker compose
39:53 More compose, adding a MongoDB database
45:09 More compose, adding mongo express to explore the db
46:58 How to publish Docker image to Docker Hub
49:34 Deploying Docker containers in the cloud
50:23 Thanks
The key to iteration in Python A key feature of Python is it's incredible support for lazy iteration. Defining and consuming lazy sequences in Python are easy. You can even define an infinite sequence like powers of 2 or prime numbers! To make working with iterables in Python...
The key to iteration in Python
A key feature of Python is it's incredible support for lazy iteration. Defining and consuming lazy sequences in Python are easy. You can even define an infinite sequence like powers of 2 or prime numbers! To make working with iterables in Python even easier, Python provides some basic building blocks to help you compose iteration primitives in different ways, which is what the itertools module is for. This module comes with 21 different primitives (and many more recipes for how to combine them), which we go over in this video. Will you use them?
― mCoding with James Murphy (https://mcoding.io)
Docs: https://docs.python.org/3/library/itertools.html
Source code: https://github.com/mCodingLLC/VideosSampleCode
SUPPORT ME ⭐
---------------------------------------------------
Sign up on Patreon to get your donor role and early access to videos!
https://patreon.com/mCoding
Feeling generous but don't have a Patreon? Donate via PayPal! (No sign up needed.)
https://www.paypal.com/donate/?hosted_button_id=VJY5SLZ8BJHEE
Want to donate crypto? Check out the rest of my supported donations on my website!
https://mcoding.io/donate
Top patrons and donors: Laura M, Jameson, Dragos C, Vahnekie, Neel R, Matt R, Johan A, Casey G, Mark M, Mutual Information, Pi
BE ACTIVE IN MY COMMUNITY 😄
---------------------------------------------------
Discord: https://discord.gg/Ye9yJtZQuN
Github: https://github.com/mCodingLLC/
Reddit: https://www.reddit.com/r/mCoding/
Facebook: https://www.facebook.com/james.mcoding
CHAPTERS
---------------------------------------------------
0:00 Intro
1:47 An initial warning
2:30 Lookahead motivating multi-accumulate
3:09 ALL 21 ITERTOOLS - itertools.count
3:41 itertools.cycle
4:01 itertools.repeat
4:17 itertools.accumulate
4:58 itertools.batched
5:28 itertools.chain
5:58 itertools.chain.from_iterable
6:18 itertools.compress
6:42 itertools.dropwhile
7:32 itertools.filterfalse
8:18 itertools.groupby
10:08 itertools.islice
11:04 itertools.pairwise
11:47 itertools.starmap
12:43 itertools.takewhile
13:02 itertools.tee
14:22 itertools.zip_longest
14:48 itertools.product
15:43 itertools.permutations
16:15 itertools.combinations
16:55 itertools.combinations_with_replacement
17:22 multi_accumulate example
19:43 Thanks
How many did you know? A quick rundown of EVERY single one of the 71 builtin Python functions. Technically, these are not all functions, but these are the 71 callables that are listed in the Python docs as "Builtin functions". These are the global names that are available to...
How many did you know?
A quick rundown of EVERY single one of the 71 builtin Python functions. Technically, these are not all functions, but these are the 71 callables that are listed in the Python docs as "Builtin functions". These are the global names that are available to call that you don't need to install or even import anything to use.
― mCoding with James Murphy (https://mcoding.io)
Docs: https://docs.python.org/3/library/functions.html
Source code: https://github.com/mCodingLLC/VideosSampleCode
SUPPORT ME ⭐
---------------------------------------------------
Sign up on Patreon to get your donor role and early access to videos!
https://patreon.com/mCoding
Feeling generous but don't have a Patreon? Donate via PayPal! (No sign up needed.)
https://www.paypal.com/donate/?hosted_button_id=VJY5SLZ8BJHEE
Want to donate crypto? Check out the rest of my supported donations on my website!
https://mcoding.io/donate
Top patrons and donors: Laura M, Jameson, Dragos C, Vahnekie, Neel R, Matt R, Johan A, Casey G, Mark M, Mutual Information, Pi
BE ACTIVE IN MY COMMUNITY 😄
---------------------------------------------------
Discord: https://discord.gg/Ye9yJtZQuN
Github: https://github.com/mCodingLLC/
Reddit: https://www.reddit.com/r/mCoding/
Facebook: https://www.facebook.com/james.mcoding
CHAPTERS
---------------------------------------------------
0:00 Intro
0:24 Math - bool int float complex max min divmod abs pow round sum
2:56 Collections - dict list tuple set frozenset
3:44 Strings - bytes bytearray str memoryview open
5:18 Strings - chr ord bin oct hex format input ascii repr
7:04 Iteration - iter next enumerate zip reversed sorted filter map
9:17 Iteration - all any range slice aiter anext
10:42 Debugging - breakpoint help print
11:16 Object - object getattr setattr delattr hasattr dir id
14:19 Object - hash len isinstance issubclass callable super type
16:29 Descriptors - property classmethod staticmethod
17:49 Dynamic - eval exec compile globals locals vars __import__
Save time programming With all the tools available to us in modern IDEs, being a more productive programmer isn't about typing faster. Instead, knowing and taking advantage of powerful IDE features can automate a lot of the mundane and error prone tasks that waste your time,...
Save time programming
With all the tools available to us in modern IDEs, being a more productive programmer isn't about typing faster. Instead, knowing and taking advantage of powerful IDE features can automate a lot of the mundane and error prone tasks that waste your time, allowing you to get on with the good stuff. In this video we take a look at my top 5 IDE productivity hacks that save you time by letting your IDE do the work for you.
CONTEST CURRENTLY CLOSED! The winners have been contacted!
OFFICIAL CONTEST RULES:
1. All entries must comply with the YouTube community guidelines ( http://www.youtube.com/t/community_guidelines) and YouTube Terms of Service (http://www.youtube.com/static?gl=US&template=terms). Entries that violate YouTube guidelines are automatically disqualified.
2. YouTube is not a sponsor of the contest and viewers are required to release YouTube from any liability related to the contest.
3. Privacy notice: no personal data will be collected for this contest.
4. In order to enter, you must (a) be one of my subscribers, AND (b) make a top-level comment to the video including #mcoding somewhere in the comment.
5. The contest is free, there is no fee required to enter.
6. Winners will be chosen randomly 1 week after the date the video went live from all users who have entered and not been disqualified.
7. Each winner will be notified via a comment reply from me that details what prize was won (e.g. "Congratulations! You have won XYZ. Please email me."). I will ask the winner to contact me by email, and I will reply through email with a random token which must be posted as another reply to the winning comment from the winning account in order to verify account ownership and prevent fraud.
8. Each winner will have 72 hours to respond AND prove account ownership or their prize is automatically forfeited and another winner will be chosen.
9. A winner can only win 1 prize per contest.
10. The prize pool for this contest is: 2 licenses ("Free 1-Year Personal Subscription") to any of these JetBrains IDEs: AppCode, CLion, DataGrip, DataSpell, GoLand, IntelliJ IDEA Ultimate, PhpStorm, PyCharm, ReSharper, ReSharper C++, Rider, RubyMine, WebStorm, or dotUltimate. A prize consists of 1 license, which will be delivered in the form of a redeemable code that can be redeemed at https://www.jetbrains.com/store/redeem/ before July 17, 2024.
11. You may not enter the contest if doing so would be a violation of any relevant federal, state, and local laws, rules, and regulations, including U.S. sanctions.
― mCoding with James Murphy (https://mcoding.io)
SUPPORT ME ⭐
---------------------------------------------------
Sign up on Patreon to get your donor role and early access to videos!
https://patreon.com/mCoding
Feeling generous but don't have a Patreon? Donate via PayPal! (No sign up needed.)
https://www.paypal.com/donate/?hosted_button_id=VJY5SLZ8BJHEE
Want to donate crypto? Check out the rest of my supported donations on my website!
https://mcoding.io/donate
Top patrons and donors: Laura M, Jameson, Dragos C, Vahnekie, Neel R, Matt R, Johan A, Casey G, Mark M, Mutual Information, Pi
BE ACTIVE IN MY COMMUNITY 😄
---------------------------------------------------
Discord: https://discord.gg/Ye9yJtZQuN
Github: https://github.com/mCodingLLC/
Reddit: https://www.reddit.com/r/mCoding/
Facebook: https://www.facebook.com/james.mcoding
CHAPTERS
---------------------------------------------------
0:00 Intro
0:23 #5 Show type hierarchy
1:03 #4 Code folding
2:15 #3 Introduce var/const/param/func
5:08 #2 Rename
6:58 #1 Move
8:40 Runner ups
Get started in FastAPI, Starlette, and ASGI! How do startup and shutdown events work in FastAPI, Starlette, and other ASGI applications? ASGI defines startup and shutdown events through the "lifespan" of an application, which it models as a connection between the server and...
Get started in FastAPI, Starlette, and ASGI!
How do startup and shutdown events work in FastAPI, Starlette, and other ASGI applications? ASGI defines startup and shutdown events through the "lifespan" of an application, which it models as a connection between the server and the app. In this video we see the right way to do it in FastAPI, Starlette, and then understand the lifespan connection type in general, which we use to build our own lifespan handler from scratch that mimics what FastAPI does.
― mCoding with James Murphy (https://mcoding.io)
Source code: https://github.com/mCodingLLC/VideosSampleCode
ASGI Spec: https://asgi.readthedocs.io/
App class video: https://youtu.be/ai7y--6ElAE
SUPPORT ME ⭐
---------------------------------------------------
Sign up on Patreon to get your donor role and early access to videos!
https://patreon.com/mCoding
Feeling generous but don't have a Patreon? Donate via PayPal! (No sign up needed.)
https://www.paypal.com/donate/?hosted_button_id=VJY5SLZ8BJHEE
Want to donate crypto? Check out the rest of my supported donations on my website!
https://mcoding.io/donate
Top patrons and donors: Laura M, Jameson, Dragos C, Vahnekie, Neel R, Matt R, Johan A, Casey G, Mark M, Mutual Information, Pi
BE ACTIVE IN MY COMMUNITY 😄
---------------------------------------------------
Discord: https://discord.gg/Ye9yJtZQuN
Github: https://github.com/mCodingLLC/
Reddit: https://www.reddit.com/r/mCoding/
Facebook: https://www.facebook.com/james.mcoding
CHAPTERS
---------------------------------------------------
0:00 Intro
0:32 Startup in FastAPI
2:38 What to do at startup?
4:00 Lifespan connections in ASGI
8:10 Comparing against FastAPI
12:30 An important pro-tip
To function or to class? According to the spec, an ASGI application is an async callable, but when we use FastAPI, Starlette, or other ASGI frameworks, that callable is hidden in plain sight. In this video, we see how it's possible to use an application class instead of a...
To function or to class?
According to the spec, an ASGI application is an async callable, but when we use FastAPI, Starlette, or other ASGI frameworks, that callable is hidden in plain sight. In this video, we see how it's possible to use an application class instead of a literal async def function, and we go over reasons for preferring the class approach.
― mCoding with James Murphy (https://mcoding.io)
Source code: https://github.com/mCodingLLC/VideosSampleCode
ASGI Spec: https://asgi.readthedocs.io/
SUPPORT ME ⭐
---------------------------------------------------
Sign up on Patreon to get your donor role and early access to videos!
https://patreon.com/mCoding
Feeling generous but don't have a Patreon? Donate via PayPal! (No sign up needed.)
https://www.paypal.com/donate/?hosted_button_id=VJY5SLZ8BJHEE
Want to donate crypto? Check out the rest of my supported donations on my website!
https://mcoding.io/donate
Top patrons and donors: Jameson, Laura M, Dragos C, Vahnekie, Neel R, Matt R, Johan A, Casey G, Mark M, Mutual Information, Pi
BE ACTIVE IN MY COMMUNITY 😄
---------------------------------------------------
Discord: https://discord.gg/Ye9yJtZQuN
Github: https://github.com/mCodingLLC/
Reddit: https://www.reddit.com/r/mCoding/
Facebook: https://www.facebook.com/james.mcoding
Building your future web app. Stop copy-pasting snippets to piece together a FastAPI app you don't really understand. Instead, buckle down and take the time to learn the fundamental building blocks that async web app frameworks in Python are built on top of. That way, you...
Building your future web app.
Stop copy-pasting snippets to piece together a FastAPI app you don't really understand. Instead, buckle down and take the time to learn the fundamental building blocks that async web app frameworks in Python are built on top of. That way, you won't be stuck when there's no tutorial to copy from.
― mCoding with James Murphy (https://mcoding.io)
Source code: https://github.com/mCodingLLC/VideosSampleCode
ASGI Spec: https://asgi.readthedocs.io/
SUPPORT ME ⭐
---------------------------------------------------
Sign up on Patreon to get your donor role and early access to videos!
https://patreon.com/mCoding
Feeling generous but don't have a Patreon? Donate via PayPal! (No sign up needed.)
https://www.paypal.com/donate/?hosted_button_id=VJY5SLZ8BJHEE
Want to donate crypto? Check out the rest of my supported donations on my website!
https://mcoding.io/donate
Top patrons and donors: Jameson, Laura M, Dragos C, Vahnekie, Neel R, Matt R, Johan A, Casey G, Mark M, Mutual Information, Pi
BE ACTIVE IN MY COMMUNITY 😄
---------------------------------------------------
Discord: https://discord.gg/Ye9yJtZQuN
Github: https://github.com/mCodingLLC/
Reddit: https://www.reddit.com/r/mCoding/
Facebook: https://www.facebook.com/james.mcoding
CHAPTERS
---------------------------------------------------
0:00 Intro
1:14 The ASGI Specification
3:04 What an ASGI app looks like
4:37 Our first ASGI app
7:41 The lifespan connection
9:10 HTTP connections
12:05 Routing like FastAPI
13:27 The Response object
14:42 Starting to see the big picture
Critical! ... or is it? CVE-2024-24576 is a freshly reported 10/10 critical CVE affecting Rust, Python, and many other programming languages on Windows that, if exploited, can allow a malicious user to execute arbitrary code as the current user. The 10/10 rating is the worst...
Critical! ... or is it?
CVE-2024-24576 is a freshly reported 10/10 critical CVE affecting Rust, Python, and many other programming languages on Windows that, if exploited, can allow a malicious user to execute arbitrary code as the current user. The 10/10 rating is the worst severity that can be given to a CVE. However, of 9 affected programming languages, 5 have chosen to either not fix the CVE or fix it only by updating their documentation. Let's take a look at this vulnerability, which appears to take advantage of programming languages improperly escaping arguments while creating sub-processes, understand how it's performed, and see why so many languages are choosing not to fix it.
― mCoding with James Murphy (https://mcoding.io)
Source code: https://github.com/mCodingLLC/VideosSampleCode
Python discussion: https://discuss.python.org/t/is-python-affected-by-cve-2024-24576/50740/1
NIST CVE details: https://nvd.nist.gov/vuln/detail/CVE-2024-24576
Rust advisory: https://blog.rust-lang.org/2024/04/09/cve-2024-24576.html
Subprocess docs: https://docs.python.org/3/library/subprocess.html
Subprocess source: https://github.com/python/cpython/blob/main/Lib/subprocess.py
CreateProcessW docs: https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessw
Security researcher blog post: https://flatt.tech/research/posts/batbadbut-you-cant-securely-execute-commands-on-windows/
SUPPORT ME ⭐
---------------------------------------------------
Sign up on Patreon to get your donor role and early access to videos!
https://patreon.com/mCoding
Feeling generous but don't have a Patreon? Donate via PayPal! (No sign up needed.)
https://www.paypal.com/donate/?hosted_button_id=VJY5SLZ8BJHEE
Want to donate crypto? Check out the rest of my supported donations on my website!
https://mcoding.io/donate
Top patrons and donors: Jameson, Laura M, Dragos C, Vahnekie, Neel R, Matt R, Johan A, Casey G, Mark M, Mutual Information, Pi
BE ACTIVE IN MY COMMUNITY 😄
---------------------------------------------------
Discord: https://discord.gg/Ye9yJtZQuN
Github: https://github.com/mCodingLLC/
Reddit: https://www.reddit.com/r/mCoding/
Facebook: https://www.facebook.com/james.mcoding
CHAPTERS
---------------------------------------------------
0:00 Intro
1:43 How it happens
3:21 Subprocesses and shell=True
5:24 The CVE doesn't use shell=True
6:23 Diving into the subprocess module
7:31 The meaning of running a batch file
8:42 A compromise fix
Await for it! A deep dive into the purpose of the async for loop in Python. How to use the async for loop, why to use the async for loop, and how to write your own async iterators using both async generators as well as by learning the async iterator protocols and writing your...
Await for it!
A deep dive into the purpose of the async for loop in Python. How to use the async for loop, why to use the async for loop, and how to write your own async iterators using both async generators as well as by learning the async iterator protocols and writing your own async iterator. We'll see an example ASGI app that computes the SHA256 hash of an uploaded file using Starlette and uvicorn, and write a test client using httpx. Then we implement a simple rate limiter.
― mCoding with James Murphy (https://mcoding.io)
Source code: https://github.com/mCodingLLC/VideosSampleCode
Starlette: https://github.com/encode/starlette
FastAPI: https://github.com/tiangolo/fastapi
Httpx: https://github.com/encode/httpx
Uvicorn: https://github.com/encode/uvicorn
SUPPORT ME ⭐
---------------------------------------------------
Sign up on Patreon to get your donor role and early access to videos!
https://patreon.com/mCoding
Feeling generous but don't have a Patreon? Donate via PayPal! (No sign up needed.)
https://www.paypal.com/donate/?hosted_button_id=VJY5SLZ8BJHEE
Want to donate crypto? Check out the rest of my supported donations on my website!
https://mcoding.io/donate
Top patrons and donors: Jameson, Laura M, Dragos C, Vahnekie, Neel R, Matt R, Johan A, Casey G, Mark M, Mutual Information, Pi
BE ACTIVE IN MY COMMUNITY 😄
---------------------------------------------------
Discord: https://discord.gg/Ye9yJtZQuN
Github: https://github.com/mCodingLLC/
Reddit: https://www.reddit.com/r/mCoding/
Facebook: https://www.facebook.com/james.mcoding
CHAPTERS
---------------------------------------------------
0:00 Intro
0:36 Async for syntax and purpose
2:17 Async web app
8:30 Async generators
11:01 Async iterator protocols
You can't forget! Context managers (used with the "with" statement) and try-finally are both constructs in Python that help you ensure certain cleanup code runs even in the presence of exceptions. Becoming familiar with these constructs is important for developing good coding...
You can't forget!
Context managers (used with the "with" statement) and try-finally are both constructs in Python that help you ensure certain cleanup code runs even in the presence of exceptions. Becoming familiar with these constructs is important for developing good coding habits in Python. Don't put the burden of remembering how to do cleanup on yourself, use a context manager to let the object handle its own cleanup! In this video, we take a deep dive into the semantics of context managers and try-finally, including the basic examples, sharp corners (and how to avoid them!), as well as less common use-cases.
― mCoding with James Murphy (https://mcoding.io)
Source code: https://github.com/mCodingLLC/VideosSampleCode
With statement docs: https://docs.python.org/3/reference/datamodel.html#with-statement-context-managers
Try-finally docs: https://docs.python.org/3/reference/compound_stmts.html#finally-clause
Pythonizing Imgui video: https://www.youtube.com/watch?v=wh_W-veFpKU
SUPPORT ME ⭐
---------------------------------------------------
Sign up on Patreon to get your donor role and early access to videos!
https://patreon.com/mCoding
Feeling generous but don't have a Patreon? Donate via PayPal! (No sign up needed.)
https://www.paypal.com/donate/?hosted_button_id=VJY5SLZ8BJHEE
Want to donate crypto? Check out the rest of my supported donations on my website!
https://mcoding.io/donate
Top patrons and donors: Jameson, Laura M, Dragos C, Vahnekie, Neel R, Matt R, Johan A, Casey G, Mark M, Mutual Information, Pi
BE ACTIVE IN MY COMMUNITY 😄
---------------------------------------------------
Discord: https://discord.gg/Ye9yJtZQuN
Github: https://github.com/mCodingLLC/
Reddit: https://www.reddit.com/r/mCoding/
Facebook: https://www.facebook.com/james.mcoding
CHAPTERS
---------------------------------------------------
0:00 Intro
0:34 Without context managers...
1:00 Common context managers
2:01 WHEN does cleanup run?
4:36 Try-finally
7:01 With in terms of try-finally
8:11 How to write a context manager
11:38 Suppressing exceptions
12:53 Wrapping an external api
13:54 contextmanager decorator
14:51 "Actual" context managers
15:40 Decimal library
16:21 Limitations
18:51 Thanks
Step by step through your program. Debugging is an essential and unavoidable part of programming. Everyone writes bugs, and we'd like to get rid of them. Print statements are fine to a certain point, but live debugging is usually a better option. With live debugging, you can...
Step by step through your program.
Debugging is an essential and unavoidable part of programming. Everyone writes bugs, and we'd like to get rid of them. Print statements are fine to a certain point, but live debugging is usually a better option. With live debugging, you can step through your program one statement at a time, and set breakpoints at interesting places to stop, view, and interact with the state of the program before it proceeds. This is a very beginner-friendly tutorial on how to use PyCharm and VS Code for live debugging in Python.
CONTEST CURRENTLY CLOSED! The winners have been contacted.
OFFICIAL CONTEST RULES:
1. All entries must comply with the YouTube community guidelines ( http://www.youtube.com/t/community_guidelines) and YouTube Terms of Service (http://www.youtube.com/static?gl=US&template=terms). Entries that violate YouTube guidelines are automatically disqualified.
2. YouTube is not a sponsor of the contest and viewers are required to release YouTube from any liability related to the contest.
3. Privacy notice: no personal data will be collected for this contest.
4. In order to enter, you must (a) be one of my subscribers, AND (b) make a top-level comment to the video including #mcoding somewhere in the comment.
5. The contest is free, there is no fee required to enter.
6. Winners will be chosen randomly 1 week after the date the video went live from all users who have entered and not been disqualified.
7. Each winner will be notified via a comment reply from me that details what prize was won (e.g. "Congratulations! You have won XYZ. Please email me."). I will ask the winner to contact me by email, and I will reply through email with a random token which must be posted as another reply to the winning comment from the winning account in order to verify account ownership and prevent fraud.
8. Each winner will have 72 hours to respond AND prove account ownership or their prize is automatically forfeited and another winner will be chosen.
9. A winner can only win 1 prize per contest.
10. The prize pool for this contest is: 2 licenses ("Free 1-Year Personal Subscription") to any of these JetBrains IDEs: AppCode, CLion, DataGrip, DataSpell, GoLand, IntelliJ IDEA Ultimate, PhpStorm, PyCharm, ReSharper, ReSharper C++, Rider, RubyMine, WebStorm, or dotUltimate. A prize consists of 1 license, which will be delivered in the form of a redeemable code that can be redeemed at https://www.jetbrains.com/store/redeem/ before March 17, 2024.
11. You may not enter the contest if doing so would be a violation of any relevant federal, state, and local laws, rules, and regulations, including U.S. sanctions.
― mCoding with James Murphy (https://mcoding.io)
Source code: https://github.com/mCodingLLC/VideosSampleCode
SUPPORT ME ⭐
---------------------------------------------------
Sign up on Patreon to get your donor role and early access to videos!
https://patreon.com/mCoding
Feeling generous but don't have a Patreon? Donate via PayPal! (No sign up needed.)
https://www.paypal.com/donate/?hosted_button_id=VJY5SLZ8BJHEE
Want to donate crypto? Check out the rest of my supported donations on my website!
https://mcoding.io/donate
Top patrons and donors: Laura M, Dragos C, Jameson, Neel R, Jameson, Pi, Matt R, Vahnekie Johan A, Mark M, Mutual Information
BE ACTIVE IN MY COMMUNITY 😄
---------------------------------------------------
Discord: https://discord.gg/Ye9yJtZQuN
Github: https://github.com/mCodingLLC/
Reddit: https://www.reddit.com/r/mCoding/
Facebook: https://www.facebook.com/james.mcoding
CHAPTERS
---------------------------------------------------
0:00 Intro
1:28 Grocery app
3:56 Debugging in PyCharm
12:23 Conditional breakpoints
16:09 Debugging in VS Code
21:49 A useful tip... TESTING
23:38 Outro
A logging tutorial. At some point, print statements aren't enough. When that time comes in Python, you should reach for the builtin logging package. It may be old (committed in 2002!), but it is the standard in Python. Unfortunately though, it being so old means that it's...
A logging tutorial.
At some point, print statements aren't enough. When that time comes in Python, you should reach for the builtin logging package. It may be old (committed in 2002!), but it is the standard in Python. Unfortunately though, it being so old means that it's full of stuff you shouldn't use, it doesn't follow modern conventions like PEP8 coding style, and many tutorials are vastly outdated. If you'd like to understand the modern picture of logging in Python, then this video is for you.
― mCoding with James Murphy (https://mcoding.io)
Source code: https://github.com/mCodingLLC/VideosSampleCode
logging docs: https://docs.python.org/3/library/logging.html
Make your own diagrams: https://excalidraw.com/
Local Elevator by Kevin MacLeod is licensed under a Creative Commons Attribution 4.0 license. https://creativecommons.org/licenses/by/4.0/
SUPPORT ME ⭐
---------------------------------------------------
Sign up on Patreon to get your donor role and early access to videos!
https://patreon.com/mCoding
Feeling generous but don't have a Patreon? Donate via PayPal! (No sign up needed.)
https://www.paypal.com/donate/?hosted_button_id=VJY5SLZ8BJHEE
Want to donate crypto? Check out the rest of my supported donations on my website!
https://mcoding.io/donate
Top patrons and donors: Jameson, Laura M, Dragos C, Vahnekie, Neel R, Matt R, Johan A, Casey G, Mark M, Mutual Information, Pi
BE ACTIVE IN MY COMMUNITY 😄
---------------------------------------------------
Discord: https://discord.gg/Ye9yJtZQuN
Github: https://github.com/mCodingLLC/
Reddit: https://www.reddit.com/r/mCoding/
Facebook: https://www.facebook.com/james.mcoding
CHAPTERS
---------------------------------------------------
0:00 Intro
0:34 Self-sponsorship
0:48 logging is the standard
1:21 basicConfig
2:08 dictConfig
2:44 the complete logging picture
7:51 Example: log to stdout
9:37 logging JSON/YAML config
10:44 Example: errors to stdedd and all to file
12:37 JSON logs
15:46 Extra context with the extra param
16:13 Custom filter
17:10 A glaring flaw
17:44 Log off the main thread with QueueHandler
19:15 Success!
19:26 Library logging?
20:16 logging4p
21:02 Thanks!
Zero, destroyer of things. We take for granted that 0 times anything equals 0. But why? You might think of counting numbers, but we use 0 for a lot of different systems like naturals, reals, modular arithmetic, function spaces, and in all these cases we still have 0 times...
Zero, destroyer of things.
We take for granted that 0 times anything equals 0. But why? You might think of counting numbers, but we use 0 for a lot of different systems like naturals, reals, modular arithmetic, function spaces, and in all these cases we still have 0 times anything equals 0. Something about 0 makes this happen in many different spaces. In this video we see the proof and discover why zero times anything equals zero!
― mCoding with James Murphy (https://mcoding.io)
Ring axioms: https://en.wikipedia.org/wiki/Ring_(mathematics)
SUPPORT ME ⭐
---------------------------------------------------
Sign up on Patreon to get your donor role and early access to videos!
https://patreon.com/mCoding
Feeling generous but don't have a Patreon? Donate via PayPal! (No sign up needed.)
https://www.paypal.com/donate/?hosted_button_id=VJY5SLZ8BJHEE
Want to donate crypto? Check out the rest of my supported donations on my website!
https://mcoding.io/donate
Top patrons and donors: Jameson, Laura M, Dragos C, Vahnekie, Neel R, Matt R, Johan A, Casey G, Mark M, Mutual Information, Pi
BE ACTIVE IN MY COMMUNITY 😄
---------------------------------------------------
Discord: https://discord.gg/Ye9yJtZQuN
Github: https://github.com/mCodingLLC/
Reddit: https://www.reddit.com/r/mCoding/
Facebook: https://www.facebook.com/james.mcoding