WEBVTT

00:00:00.001 --> 00:00:05.460
Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.

00:00:05.460 --> 00:00:11.500
This is episode 304, recorded October 5th, 2022. I'm Michael Kennedy.

00:00:11.500 --> 00:00:12.840
I'm Brian Okken.

00:00:12.840 --> 00:00:14.220
Hey, Brian.

00:00:14.220 --> 00:00:18.540
Hey, you threw me for a wrench with the whole date thing.

00:00:18.540 --> 00:00:22.380
I know. Well, in our notes it has yesterday, but then we had to move it.

00:00:22.380 --> 00:00:23.460
Yeah, because of meetings.

00:00:23.460 --> 00:00:24.780
Some of us have meetings.

00:00:24.780 --> 00:00:27.740
Yeah, that's right. I've moved plenty for me. Plenty of moving.

00:00:27.740 --> 00:00:34.400
Yeah, very cool. Well, great to be back with you. Also, we have a sponsor that sponsored before, but has been a while, a compiler from Red Hat.

00:00:34.400 --> 00:00:36.560
Excellent show. Tell you more about that later.

00:00:36.560 --> 00:00:40.620
For now, Brian, I'm kind of hungry. What can you do for me here?

00:00:40.620 --> 00:00:47.340
I've got tasty ingredients for, let's see, add to stream. Tasty ingredients for a delicious pull request.

00:00:47.340 --> 00:00:52.240
So it's October now. So that means Hacktoberfest for some people, right?

00:00:53.360 --> 00:01:03.100
And actually, I didn't really want to just highlight Hacktoberfest. What I really like about this. So this is an article, 10 tasty ingredients for a delicious pull request.

00:01:03.100 --> 00:01:09.740
It's on the Wagtail blog and from LB on the Wagtail core team member. So thanks, LB.

00:01:09.740 --> 00:01:18.680
But this, it's kind of neat because there's, it's not, yeah, it's kind of clickbaity, but also it's just, it's actually nice information.

00:01:18.680 --> 00:01:28.700
So whether you're starting open source project or starting, want to start helping out with an open source project, or I think these tips are great, or at least majority of them are great.

00:01:28.700 --> 00:01:37.160
Even for people that are used to developing solo and are moving into developing with a team of people or a group of people.

00:01:37.160 --> 00:01:43.420
And there's, I've had questions about that, even from companies of like, yeah, we want to kind of work better as a team.

00:01:43.480 --> 00:01:52.800
How do we do that? So I'm going to run through these quickly. There's, there's 10 of them. First one is, is great. It's read the documentation or read the development instruction.

00:01:52.800 --> 00:02:04.640
So a lot of projects have contributing guidelines. So actually read those and understand them when we're used to it. It's just a, Hey, fork it and go. But that's not trivial for some people.

00:02:04.640 --> 00:02:21.480
So, right. Well, you may have a non-obvious details. Like for example, maybe you just fork the repo, you do your work there and you contribute, but well, you should obviously create a branch in your repo so that if they decide to not take it, then how do you stay in sync? Right. That's one of them.

00:02:21.480 --> 00:02:33.480
Another one is, well, maybe when you do the PR, it doesn't go back to the main branch. It goes to some other like dev branch or something, right? Like you need to know, here's where you put the PR back to you. And just like those kinds of details for, Hey, we're a team.

00:02:33.480 --> 00:03:02.700
Yeah. And then also there's details like, how do you run the tests and are there extra stuff that you have to install or any settings or for a lot of projects, it's just a, you know, do a virtual environment and clone it and go. But there's, there's, there's some that have like extra bits that you have to set up. So good to read the instructions, but then we're going into things like read the issues and comments. So if you want to help out, this is a great way is to read the issues, but don't just jump in and try to solve it right away.

00:03:02.700 --> 00:03:21.500
Read the comments around the issue. Also PRs that are related to the issue. If there's any PRs linked, because there's somebody that might be started on a fix and you want to, you want to help either help them get unstuck or just help out. You don't want to just take over and say, Oh, I could solve this. If somebody else is working on it already.

00:03:21.980 --> 00:03:40.460
But maybe you do. There's, there's different ways, but pay attention to that. So that's good. Create a French branch for your contribution. Like you mentioned it, it isn't always obvious because I'm already forking. What do we need a branch for? But it does help with the branch model. When it comes back in, it just looks better.

00:03:40.700 --> 00:03:48.420
It's a, it's not necessary until your change is not accepted or you want to make two changes, right?

00:03:48.420 --> 00:03:48.840
Yeah.

00:03:48.840 --> 00:03:53.220
If you ever want to get back in sync with the main repo, you need to do somewhere else.

00:03:53.480 --> 00:04:06.740
And it might be very much a possibility that you want to make several changes. You're really excited about a project and you're making several. And like you said, there, there might be a lot of discussion around some, and some of them are trivial things like fix and read me or something.

00:04:06.960 --> 00:04:16.040
And so yeah, multiple do a branch so that you've got multiple names and that's where we come to the next tip for is keep the change focused.

00:04:16.040 --> 00:04:26.780
So if a project would much rather have several focused pull requests, then a single pull request with like four different changes in it that are completely unrelated.

00:04:26.780 --> 00:04:44.200
So keep them focused. And this is great for personal or, you know, closed source projects too. It just makes the code review easier. And when you, when you get in the habit of doing focused changes, it just, it's not harder. It's just a workflow you got to get used to.

00:04:44.200 --> 00:05:06.820
Next is right unit tests. Definitely for the changes. But one of the comments that I loved in this is a bonus tip is it, there might be some either untested features in the project or under tested and adding tests around those features that you care about is a great way to contribute to, to a code base. So keep that in mind.

00:05:06.820 --> 00:05:14.380
That's a really good point because people often think, well, what can I do to contribute? I'm not an expert. Well, if it's missing tests, that's, that's pretty easy.

00:05:14.380 --> 00:05:34.060
And there could be even like, if you, so there's an idea of like testing is documentation and some tests work well like that. And some tests do not. So a great way also just, just to walk through, make tests around the onboarding documentation, like the getting starting guide, making sure that those features are tested is a good thing to throw in there.

00:05:34.060 --> 00:05:53.960
Give your pull request name, request a name with context. So naming well is good. And don't be surprised if you're, if your pull request name gets changed by one of the, one of the core contributors. That's not, it's just so that everybody can track what's going on inside better. So just learn from that.

00:05:54.200 --> 00:06:00.040
If mine is associated with an issue, I try to put the issue number as part of the branch.

00:06:00.040 --> 00:06:00.700
Yes.

00:06:00.700 --> 00:06:16.860
That I'm like, you know, it'd be like add such and such. If that add such and such is actually to fix, you know, issue 221, it'd be like the branch should be, you know, add such and such 221 or whatever for the branch name. Just so you're like, where the heck did this come from? Why is it here? Oh yeah, that's right. I can go find it.

00:06:16.860 --> 00:06:27.160
Yep. And reference the issue being fixed or resolved in the pull request. So referencing the issue in a way that, and you kind of got to get used to this with GitHub or GitLab or other things.

00:06:28.120 --> 00:06:53.640
They'll link to the thing. It links things up if you, if you name it correctly. So just play with that. And then some again, and then hopefully there's CI, CI going on and tests. So if your pull request has a break, has a break, the tests fail, address those. This is nothing more frustrating than a fairly decent pull request coming in, but the tests fail or the coverage fails or something.

00:06:53.640 --> 00:07:23.520
And the person that issued the pull request doesn't deal with it. They just leave it for you. And that's, that's not cool. So yeah, I know address those. only a couple more push to the same branch with fixes and do not open a new pull request. So if the CI breaks, just push to the same branch again. it'll work. and then the lastly is be patient. I know that you've worked really hard on, on a change and you want to see it go into the main project right away, but these are volunteer projects mostly. So, it might take a while.

00:07:23.520 --> 00:07:26.780
To, to, to review it and be comfortable with the changes. So.

00:07:26.780 --> 00:07:29.620
Yeah. That's a bit of a balance. yeah.

00:07:29.620 --> 00:07:53.400
It's frustrating when you work on a project, you work, try to enhance some project and then you put something out there and there's not even a response after, you know, like two weeks. You're like, well, yeah, I guess, I don't know. I don't know what to do with that, you know? but at the same time, it's absolutely volunteer. So there you go. All right. Let me tell you about something pretty cool for this next one, Brian. I learned about this from Rhett Turnbull. He and I had a chat over on Talk Python and built

00:07:53.400 --> 00:08:14.820
building native Mac apps in Python. recall we talked about TechSniper and he built a Python only equivalent and we actually covered on the show a little bit, but during our conversation there, this is one of the recommendations he had for something really cool. So imagine somebody comes to you and says, Hey, Michael, I have a Raspberry Pi or Arduino thing in my lab.

00:08:15.060 --> 00:08:30.120
And it controls, let's say this is a biology lab, right? It controls experiments and you can, you know, build up something with like a UI or whatever, but if people want to script it, wouldn't it be cool if there's a way to express in like, some form of syntax.

00:08:30.500 --> 00:08:50.500
Here's how somebody who is just a biologist can make it go. It could just be like, fill pipette seven, you know, mix, mix pipette seven and 10, wait 10 minutes, you know, heat to such and such, right? You could, sure. You could come up with a programming language for them. You say, well, here's your language. You know, we're going to give you C++. Good luck.

00:08:50.500 --> 00:09:05.640
You know, more ideally, maybe Python or oftentimes JavaScript, which feels like a real bad example or a choice because it's, it's kind of a complicated syntactical language, even though it's easy to execute, you know, it's like, it's easy to make a mistake and forget a semicolon or something weird.

00:09:05.640 --> 00:09:16.540
Anyway, what if you could come up with the words that I used to like introduce this idea? You just have like lines like fill pipette seven, mix pipette seven and eight or whatever.

00:09:16.540 --> 00:09:28.100
And so this thing I'm talking about here is called text X and text X is a Python library that allows you to build these kinds of grammars and map them Python implementations in a super easy way.

00:09:28.100 --> 00:09:29.100
Wow. Okay.

00:09:29.100 --> 00:09:40.140
So, so, let's see, it's a meta language for building domain specific languages, DSLs in Python. Basically it'll help you build a textual language in an easy way.

00:09:40.140 --> 00:09:44.560
And you can invent your own language, as I said, or build support for an existing format.

00:09:44.920 --> 00:09:54.260
So they have an example here. So they have this grammar and this is about, moving things around and basically drawing something in a language.

00:09:54.260 --> 00:10:00.540
So you come up with a grammar, you'd say, there's a shape command, which is just line two or circle.

00:10:00.540 --> 00:10:05.880
There's a move command, which is a move to or move by. And then you just have these words move.

00:10:05.880 --> 00:10:13.300
And then two that runs the move to command. If the word, the line is move space by, that's the move by command.

00:10:13.300 --> 00:10:18.840
And then you map to the additional information to these classes. So these are all Python classes, right?

00:10:18.840 --> 00:10:26.140
So you just come up, this is what is this? 10 lines, eight lines. and then you create the class, which is a point and other pieces.

00:10:26.140 --> 00:10:30.520
And you just say meta model from string, give it the grammar and the classes involved.

00:10:30.520 --> 00:10:38.360
And then here's the new language we just created. Move space to five comma 10 line to 10 comma 10. How cool is that?

00:10:38.360 --> 00:10:40.000
That's pretty interesting actually.

00:10:40.000 --> 00:10:46.540
Yeah. You just create the model from there and then you can, you can just basically parse it for command in the model.

00:10:46.680 --> 00:10:56.620
Start doing the things. If the commands move to or move by, right? It's already done the parsing. It has the command elements like the vector or the point already parsed and validated.

00:10:56.620 --> 00:10:58.340
And it just executes Python.

00:10:58.340 --> 00:10:58.920
Okay.

00:10:58.920 --> 00:10:59.280
What do you think?

00:10:59.520 --> 00:11:07.680
Well, so how do you use it? So do you call, like, do you, do you put all these commands in a, the, the, somebody that put all these move things in a file and then run?

00:11:07.680 --> 00:11:11.540
Yeah, exactly. So you would, you would implement the code that defines the grammar.

00:11:11.540 --> 00:11:22.240
You would implement the grammar classes. So like point and, and vector and those sorts of things. And then somebody would write the little, the grammar. So move space to five comma 10.

00:11:22.240 --> 00:11:28.900
And then they'd probably have either a CLI or they save it in a file in some location and like you auto discover it or however it runs.

00:11:28.900 --> 00:11:39.420
So basically from a, an external perspective, you now allow people to just program in this simple way. Like another way you could do it is like, you could write a, like a text adventure game, right?

00:11:39.460 --> 00:11:54.460
You could like look around, look at, move, right. Move, move east, west, north, right. Attack creature run. Like you could really easily in Python build like a pretty interesting text adventure game based on this. I would imagine probably it already exists.

00:11:54.460 --> 00:12:02.700
yeah, well, yeah. So the adventures around, so we could probably re-implement it with this. yeah, might be fine.

00:12:02.700 --> 00:12:03.360
Yeah, I'd be fine.

00:12:03.360 --> 00:12:18.240
But the, this, or like a complete, like burn way to burn up a summer. the, this, this looks cool though. There's a whole bunch of cases where DSL is appropriate, especially when you're interacting with non-programmer type people.

00:12:18.240 --> 00:12:26.920
exactly. You want to give them some kind of text ability to interact with what you've created, but you don't want to force them to do full on super precise programming.

00:12:26.920 --> 00:12:32.900
Yeah. Or maybe it is programmers and it's just easier to think about stuff in this manner. So neat.

00:12:32.900 --> 00:12:35.480
Yeah. I just have a real high level way to talk about what you want.

00:12:35.480 --> 00:12:35.880
Yeah.

00:12:35.880 --> 00:12:42.660
Indeed. Cool. Anyway, so text X, people can check it out. Another thing that's pretty awesome. Compiler from Red Hat, our sponsor this week.

00:12:42.860 --> 00:12:59.100
Yeah. Let me tell folks about that before we move on. So this episode, as I said, is sponsored by Compiler. Just like you, Brian and I are fans of podcasts, and I'm happy to share this new, highly respected one from an open source company. I'm sure you know, Compiler, an original red podcast from Red Hat.

00:12:59.100 --> 00:13:08.620
And if you want to stay on top of tech without dedicating tons of time to it, Compiler presents perspectives, topics, and insights from the tech industry free of jargon and judgment.

00:13:08.620 --> 00:13:15.280
They want to discover where technology is headed beyond the headlines and create a place for new IT professionals to learn, grow, and thrive.

00:13:15.280 --> 00:13:20.500
Compiler helps people break through barriers and challenges, turning code into community at all levels of the enterprise.

00:13:20.780 --> 00:13:32.780
One recent interesting episode is their The Great Stack Debate episode. I love, love, love talking to people about how they architect their code, the trade-offs and conventions they chose, and the costs, challenges, and smiles that result.

00:13:32.780 --> 00:13:42.860
This one is like that, The Great Stack Debate episode. Check it out and see if software is more like an onion or more like lasagna, or maybe it's more complicated than food.

00:13:42.860 --> 00:13:50.460
This is actually the first episode in Compiler's Software Stack series, and I think it'll be pretty interesting. So check that one out.

00:13:50.460 --> 00:13:55.740
Learn more about Compiler at pythonbytes.fm/compiler. The link is in your podcast player show notes.

00:13:55.740 --> 00:14:05.080
Yes, I know you can open up your podcast player and just search for Compiler, but please visit pythonbytes.fm/compiler and click on your podcast player's icon.

00:14:05.080 --> 00:14:10.760
That way they know it came from us. Our thanks to Compiler for keeping our podcast going strong.

00:14:10.760 --> 00:14:12.380
Nice. Yeah, very cool.

00:14:12.380 --> 00:14:14.060
Yeah. All right. What's next, Brian?

00:14:14.060 --> 00:14:20.500
Well, I want to talk about locks and semaphores and analogies and stuff.

00:14:20.500 --> 00:14:24.140
Oh my gosh, I've been thinking about them so much lately, actually.

00:14:24.140 --> 00:14:24.700
Have you?

00:14:24.700 --> 00:14:26.760
Yes, I have. Tell me more.

00:14:26.760 --> 00:14:30.720
Well, so this is a blog post by Guido Van Rossum.

00:14:30.720 --> 00:14:35.300
He doesn't blog often, but there's usually some interesting bits when he wants to.

00:14:35.300 --> 00:14:40.640
So this is a post called Reasoning About AsyncIO Semaphore.

00:14:40.640 --> 00:14:45.460
So it starts off with a kind of a story about a restaurant.

00:14:45.460 --> 00:14:50.160
So there's an analogy here about, okay, so you got a restaurant.

00:14:50.160 --> 00:14:54.740
It's a fast food place, but it only has one table and there's a line waiting for it.

00:14:54.740 --> 00:14:56.820
But you don't want to just wait in line.

00:14:56.820 --> 00:14:59.760
So there's a way for you to get a buzzer.

00:14:59.760 --> 00:15:02.140
So somebody hands you a buzzer and you go wait.

00:15:02.140 --> 00:15:07.240
And when the table's open, your buzzer rings and you go get seated and you can eat.

00:15:07.660 --> 00:15:12.200
This sort of analogy, he talks about this as a lock.

00:15:12.200 --> 00:15:17.800
And then so with concurrent programming, so only one person getting it at a time.

00:15:17.800 --> 00:15:22.200
But then if you've got multiple tables, things get a little more interesting.

00:15:22.200 --> 00:15:24.360
So that's where semaphores come in.

00:15:24.660 --> 00:15:35.000
And I love this mind shift of, and this is often difficult for people when they're doing asynchronous programming, to have this lock makes sense.

00:15:35.000 --> 00:15:41.140
You're either a thread or some code is using a resource and it can and nobody else can.

00:15:41.720 --> 00:15:46.220
But then you unlock it and somebody else can grab it.

00:15:46.220 --> 00:15:49.740
But what if there's like three people can at a time?

00:15:49.740 --> 00:15:53.480
Those are some of the different, some a little bit of a mind shift.

00:15:53.480 --> 00:15:57.980
So I love this idea of a three table restaurant as a way to think about this analogy.

00:15:58.440 --> 00:16:04.220
And so he goes through the analogy, but then talks about locks and semaphores.

00:16:04.220 --> 00:16:11.940
And this is apparently to help himself even with the implementation of the semaphore in the new ACIO code.

00:16:11.940 --> 00:16:23.280
So in making sure that things like work correctly and using an analogy to try to figure out how things are supposed to work and like an error.

00:16:23.280 --> 00:16:33.720
So if you've got an exception happening, one of the problems can be it's like somebody gets, but they go, they're waiting and they decide they don't want to wait anymore.

00:16:33.720 --> 00:16:35.200
So they go turn their buzzer in.

00:16:35.460 --> 00:16:45.160
Well, what happens if while they're when they're just as they've decided to turn it in, but it's their turn and they get buzzed and they but they turned it in anyway and they don't want to run.

00:16:45.160 --> 00:16:47.900
So they're never going to call the release code.

00:16:47.900 --> 00:16:56.720
And so with the common the interaction between cancel and release is difficult.

00:16:56.720 --> 00:16:59.920
So there's there's there's all this stuff.

00:16:59.920 --> 00:17:03.920
And it's so cool to think about this in terms of a restaurant because it's easy to visualize.

00:17:04.200 --> 00:17:05.840
So any great article.

00:17:05.840 --> 00:17:11.900
And then at the end, he actually links to the code that he was that he's finished writing.

00:17:11.900 --> 00:17:14.260
So the links it to yeah, current code.

00:17:14.260 --> 00:17:15.400
So that's pretty cool.

00:17:15.400 --> 00:17:15.900
Right on.

00:17:15.900 --> 00:17:16.600
Yeah.

00:17:16.600 --> 00:17:25.540
Semaphores are I would say these are the things that many people don't really didn't really think to grab and use, but they're so incredibly useful.

00:17:25.540 --> 00:17:35.040
Like so one example, like let's imagine your job is to go scan a bunch of URLs and ingest a bunch of data and you're going to run that like 8 a.m.

00:17:35.040 --> 00:17:36.000
Every day or whatever.

00:17:36.000 --> 00:17:44.260
If you've got 10,000 URLs, it would be way, way, way faster to use asyncio and HTTPX to kick off those requests.

00:17:44.360 --> 00:17:53.500
But if you just say for URL in URLs, start a task, got 10,000 pending requests and all that data is coming back into memory and it's going to you're going to have a bad time.

00:17:53.500 --> 00:17:53.720
Right.

00:17:53.720 --> 00:17:54.100
Yeah.

00:17:54.360 --> 00:18:01.880
So one thing you could do is you could create a semaphore and say, you know, I only want to allow 10, 20, 100 in-flight requests at a time.

00:18:01.880 --> 00:18:08.100
And you just create a semaphore of 100 and you just pass it off to every task and they just have to start at the beginning and, you know, acquire it and release it.

00:18:08.100 --> 00:18:08.860
Boom, you're done.

00:18:08.860 --> 00:18:17.020
You've now created like I only I'm going through 10,000 with a straight for loop and I'm doing nothing more than 100 at a time guaranteed.

00:18:17.020 --> 00:18:17.560
Yeah.

00:18:17.560 --> 00:18:18.100
Beautiful.

00:18:18.100 --> 00:18:18.440
Right.

00:18:18.440 --> 00:18:19.800
That's a really good analogy.

00:18:19.800 --> 00:18:28.280
I was trying to think of a good one where because I was actually even looking through the Python code of any cases where they use more than one.

00:18:28.280 --> 00:18:32.440
Like a semaphore with one is just like a lock.

00:18:32.440 --> 00:18:36.040
But if you can allow more than that, then it gets interesting.

00:18:36.040 --> 00:18:37.200
Yeah, absolutely.

00:18:37.200 --> 00:18:38.040
That's a cool thing.

00:18:38.040 --> 00:18:38.800
You can think about similar.

00:18:38.800 --> 00:18:39.360
Yeah, thanks.

00:18:39.360 --> 00:18:43.520
You can think about similar things for like databases if it like really can't handle a ton of requests.

00:18:43.520 --> 00:18:47.740
One thing I know that you point this out, I want to just give a quick shout out to any IO.

00:18:47.740 --> 00:18:49.640
I interviewed Alex.

00:18:49.640 --> 00:18:50.820
I believe it was Alex from there.

00:18:50.820 --> 00:18:53.940
I've worked on it and it's got a really cool idea.

00:18:53.940 --> 00:18:57.160
It's similar to the task groups and stuff that you talked about.

00:18:57.520 --> 00:19:06.140
And it has this thing called a capacity limiter, which is much like a, it's very much like a semaphore, but a little more async native.

00:19:06.140 --> 00:19:11.080
Because you can use it in a async context manager, like a width block, async width.

00:19:11.080 --> 00:19:14.260
So here I could create just a capacity limiter of like my example is 100.

00:19:14.260 --> 00:19:20.080
And you just say async width create a group for all the items, you know, tasks start soon, pass the limiter.

00:19:20.180 --> 00:19:24.120
And all the tasks just do like async width this limiter, do whatever you're going to do.

00:19:24.120 --> 00:19:26.960
And boom, now you only get, you know, N of them running at a time.

00:19:26.960 --> 00:19:27.480
Super easy.

00:19:27.480 --> 00:19:28.260
Very cool.

00:19:28.260 --> 00:19:28.580
Cool.

00:19:28.580 --> 00:19:28.980
Okay.

00:19:28.980 --> 00:19:30.440
That's not actually what I wanted to cover though.

00:19:30.440 --> 00:19:35.120
I want to talk about some annoying stuff that got slightly less annoying.

00:19:35.120 --> 00:19:42.660
Security and preventing people from doing just bad stuff to your, your things online, right?

00:19:42.660 --> 00:19:50.000
Web apps and mostly web apps, you know, think about a forum, people come in there, just like bots come in and start posting junk.

00:19:50.000 --> 00:19:56.920
Like, I don't know why YouTube can't fix it, but I would say about one out of every three shows gets some sort of like disgusting.

00:19:56.920 --> 00:20:01.760
Come see the, come see the ladies over here sort of post with clearly text.

00:20:01.760 --> 00:20:03.340
That was like, why is this still allowed?

00:20:03.340 --> 00:20:03.620
Right.

00:20:03.620 --> 00:20:07.220
And, you know, if you run a website, you're going to run into those kinds of problems.

00:20:07.580 --> 00:20:14.620
So like we had big problems at Talk Python training with a bunch of bots creating free accounts and they're just free.

00:20:14.620 --> 00:20:16.100
You don't get anything by creating an account.

00:20:16.100 --> 00:20:18.220
I don't know why they were doing it, but they, they were.

00:20:18.220 --> 00:20:22.400
And so I, but they were doing it from hundreds or thousands of different IPs.

00:20:22.400 --> 00:20:23.180
It was super annoying.

00:20:23.180 --> 00:20:25.460
So we ended up having to put a recapture on there.

00:20:25.460 --> 00:20:32.280
And every time I go to the site and I've got to sign in, I'm like, oh gosh, here come the crosswalks and the stoplights.

00:20:32.280 --> 00:20:33.360
And that's not a bus.

00:20:33.360 --> 00:20:34.100
There's no buses.

00:20:34.100 --> 00:20:34.880
What do you want me to do?

00:20:34.880 --> 00:20:36.200
You know, like how frustrating is this?

00:20:36.200 --> 00:20:40.560
So Cloudflare, they're doing a bunch of interesting branching out of just being a CDN.

00:20:40.560 --> 00:20:48.400
And they've announced this thing called TurnStyle, a user-friendly privacy preserving alternative to CAPTCHA or recapture.

00:20:48.400 --> 00:20:50.240
Like recapture is owned by Google.

00:20:50.240 --> 00:20:53.420
And like a lot of the stuff that you do there gets sent back over there.

00:20:53.420 --> 00:20:54.800
And it's, it's not ideal.

00:20:54.800 --> 00:20:58.180
So also finding all the crosswalks, not ideal.

00:20:58.180 --> 00:21:01.780
So this thing is something they announced and it's free to use.

00:21:01.960 --> 00:21:10.180
Even if you don't have some kind of other recapture thing, like you're not a customer, you just create an account for free, get an API key for this and use it.

00:21:10.320 --> 00:21:17.720
So here, if you go to the page that I'm linking to, the blog.cloudflare.com, all that happens is you go there and it just spins for a second.

00:21:17.720 --> 00:21:24.040
It does the work and the magic that Cloudflare is already using to verify that you're a human and you're a real machine.

00:21:24.040 --> 00:21:26.120
And, you know, maybe do some sort of like cost.

00:21:26.120 --> 00:21:28.660
Make you run like a tight loop for a second or whatever.

00:21:28.660 --> 00:21:29.820
And then you're verified.

00:21:30.180 --> 00:21:33.980
And if it doesn't work, then you can click a little button and verify you're human, hopefully.

00:21:33.980 --> 00:21:36.440
But yeah, so this is pretty cool.

00:21:36.440 --> 00:21:39.820
You can now replace your recapture with that.

00:21:39.820 --> 00:21:41.060
And it's pretty straightforward.

00:21:41.060 --> 00:21:45.300
Basically, you drop some JavaScript onto the page and a little widget.

00:21:45.300 --> 00:21:46.960
And then you put the widget in your form.

00:21:46.960 --> 00:21:53.640
If somebody submits it, it comes with that validation, like some sort of validation code that was created by Cloudflare.

00:21:53.800 --> 00:22:01.500
On the server side, you want to verify that because its presence isn't enough because anybody could just send like garbage with the right form ID, right?

00:22:01.500 --> 00:22:04.140
So there's a server side API.

00:22:04.140 --> 00:22:09.220
You've got a call to validate that and make sure that, yeah, this is actually, it came from your domain.

00:22:09.220 --> 00:22:10.340
It just was created.

00:22:10.340 --> 00:22:11.580
It is a real one.

00:22:11.580 --> 00:22:13.400
It's a unique one and all those things.

00:22:13.400 --> 00:22:13.840
Oh, cool.

00:22:13.840 --> 00:22:14.280
Yeah.

00:22:14.280 --> 00:22:17.560
So anyway, if people want to use this, it seems pretty awesome.

00:22:17.560 --> 00:22:21.360
Over on Talk Python, I switch the things over to it and we'll see how it goes.

00:22:21.440 --> 00:22:30.220
So for example, if you want to get notified about our mailing list, now you've got to wait about three quarters of a second before typing in your email address.

00:22:30.220 --> 00:22:37.460
Unless you're like some kind of beast and you can top it in, like select the form, type your email address and hit subscribe before like a second is up, right?

00:22:37.460 --> 00:22:38.620
But that's pretty much it.

00:22:38.620 --> 00:22:42.740
You hit submit and then it runs some magic on the server, right?

00:22:42.740 --> 00:22:45.060
But I've been doing this live.

00:22:45.060 --> 00:22:46.500
I'm going to check out PyPI.org.

00:22:46.500 --> 00:22:49.760
If you check out turn style, there's a bunch of stuff up here.

00:22:49.760 --> 00:22:53.120
There's like rate limiting things and other stuff, but nothing about Cloudflare.

00:22:53.120 --> 00:23:01.480
So I created for the moment a GitHub gist that has the server side implementation for anybody who wants to do this in Python, modern Python anyway.

00:23:01.480 --> 00:23:02.040
Nice.

00:23:02.040 --> 00:23:02.760
Cool, right?

00:23:02.760 --> 00:23:08.000
So over here, you just need this one file, this one module you can use here.

00:23:08.000 --> 00:23:16.080
This one's synchronous, but you could just as well use HTTPX and async if you want to do this validation in like an async view.

00:23:16.240 --> 00:23:24.920
So it has Pydantic models, like here's what you got to send over and here's what you'll expect to get back from the API endpoints, little examples.

00:23:24.920 --> 00:23:33.260
And then just has one function called validate, given the thing they submitted in the form and their user IP, just so you have that as like part of your information of what happened.

00:23:33.260 --> 00:23:34.240
They need to know that.

00:23:34.240 --> 00:23:35.000
And that's it.

00:23:35.000 --> 00:23:40.560
And it's kind of a cool example of seeing how to do like request response with Pydantic to APIs as well.

00:23:40.780 --> 00:23:41.460
That's pretty cool.

00:23:41.460 --> 00:23:42.060
Nice.

00:23:42.060 --> 00:23:42.640
Awesome.

00:23:42.640 --> 00:23:45.120
Well, that's a really good stuff.

00:23:45.120 --> 00:23:46.080
So here's the thing.

00:23:46.080 --> 00:23:47.320
Right now, it's not a package.

00:23:47.320 --> 00:23:49.720
I'm not sure I need more open source projects to manage.

00:23:49.720 --> 00:23:53.540
However, let's say if I was curious why you didn't make a package out of that.

00:23:53.540 --> 00:23:56.080
Well, because I only did this like Monday, right?

00:23:56.080 --> 00:23:58.340
So it's only I kind of wanted to stabilize a little.

00:23:58.640 --> 00:24:08.420
If sufficiently many people shoot me a text on Twitter, like a at mention, M. Kennedy, says, hey, please make this a package so I can use it too, more directly, or we could all contribute.

00:24:08.420 --> 00:24:09.400
Enough people do that.

00:24:09.400 --> 00:24:10.820
I'll turn it into a package.

00:24:10.820 --> 00:24:13.680
But I just haven't had the time because I've been playing with other stuff that I'll talk about in a minute.

00:24:13.680 --> 00:24:15.320
You can only have so many projects, you know?

00:24:15.320 --> 00:24:15.940
Yeah.

00:24:15.940 --> 00:24:16.560
Yeah.

00:24:16.560 --> 00:24:17.140
All right.

00:24:17.140 --> 00:24:19.940
Well, that brings us to all of our main items, Brian.

00:24:20.320 --> 00:24:20.480
Yeah.

00:24:20.480 --> 00:24:26.620
So one of the things for extras, I wanted to pop up just briefly.

00:24:26.620 --> 00:24:32.020
I was looking at a, so I was looking at, oh, let's go yours too.

00:24:32.020 --> 00:24:32.720
Do you have any extras?

00:24:32.720 --> 00:24:34.240
I do have some extras.

00:24:34.240 --> 00:24:34.780
Sweet.

00:24:34.780 --> 00:24:35.680
You go first, though.

00:24:35.680 --> 00:24:36.140
I have a ton.

00:24:36.140 --> 00:24:36.680
Okay.

00:24:36.680 --> 00:24:38.540
So I just have a couple.

00:24:38.540 --> 00:24:46.320
So this article says it's from testdriven.io, Heroku alternatives for Python-based applications.

00:24:46.320 --> 00:24:50.160
And to be fair, it's pretty fair to Heroku also.

00:24:50.700 --> 00:24:53.760
So really, it isn't don't use Heroku.

00:24:53.760 --> 00:24:57.900
It is, it's kind of like, what are all the things you can use?

00:24:57.900 --> 00:25:10.020
So it goes through Heroku, of course, but then it also goes through, does the pros and some description and pros and cons for DigitalOcean app platform and render and fly.io.

00:25:10.280 --> 00:25:18.160
And even some that we don't hear too much about, like Engine Yard, Railway.app.

00:25:18.160 --> 00:25:20.200
Railway looks pretty cool.

00:25:20.200 --> 00:25:21.640
Yeah, Railway does look cool.

00:25:22.080 --> 00:25:26.440
So really having one person compare, look at all of these and compare them.

00:25:26.440 --> 00:25:32.420
It's just kind of a nice thing to just hear what somebody has to say about all these different platforms that you might want to try out.

00:25:32.420 --> 00:25:33.220
So yeah.

00:25:33.220 --> 00:25:35.320
Yeah, that's a ton of, that's a lot of reviews.

00:25:35.680 --> 00:25:36.720
Yeah, it's pretty neat.

00:25:36.720 --> 00:25:41.540
And, you know, these are all in the platform as a service equivalent, it looks like.

00:25:41.540 --> 00:25:41.920
Yeah.

00:25:41.920 --> 00:25:44.560
It's not like just, here's where you run VMs.

00:25:44.560 --> 00:25:45.500
Like, well, okay, that's great.

00:25:45.500 --> 00:25:47.060
But that's not what Heroku was helping me with.

00:25:47.320 --> 00:25:47.580
Yeah.

00:25:47.580 --> 00:25:50.340
And so that, and that's actually one of the fair comments.

00:25:50.340 --> 00:25:58.740
It says, like, for instance, Heroku, one of the things that says is the price can go up as you, it's not too bad at the start, but it can go up as you grow.

00:25:58.740 --> 00:26:00.660
And same with all of these really.

00:26:00.660 --> 00:26:07.780
But the, and it's how many times more than running it just directly on AWS.

00:26:08.360 --> 00:26:19.100
But it's a, be careful because that's not a, a platform as a service is not a comparison, fair comparison to just running it all yourself, because then you have to do it all yourself.

00:26:19.100 --> 00:26:20.200
Exactly.

00:26:20.200 --> 00:26:23.860
Kind of paying the service instead of paying somebody to monitor it for you.

00:26:23.860 --> 00:26:25.280
So I think it's reasonable.

00:26:25.280 --> 00:26:33.540
So the other thing I wanted to bring up was we brought it up last time and maybe the time before the pytest course is going well.

00:26:33.540 --> 00:26:36.580
So I'm glad people are getting use, use out of the pytest course.

00:26:36.900 --> 00:26:46.840
But I wanted, I've been kicking around the idea of doing a, a cohort based thing, something like the pytest course, not the exact same content, but similar sort of things.

00:26:46.840 --> 00:26:49.360
Get people up to speed and do it as a cohort.

00:26:49.360 --> 00:26:52.340
And I'd like people to get in touch with me if they think that's a good idea.

00:26:52.340 --> 00:26:56.460
I'm thinking about maybe doing it in December, but I'm not sure, December or January.

00:26:56.460 --> 00:27:02.240
So hit me up on Twitter or you can get to the, my contact form on test and code as well.

00:27:02.240 --> 00:27:03.200
It'll get to me.

00:27:03.200 --> 00:27:04.260
So yeah, let me know.

00:27:04.260 --> 00:27:05.980
Those live events are really nice, right?

00:27:06.060 --> 00:27:07.920
It's, it's, it's a cool experience.

00:27:07.920 --> 00:27:09.640
So hopefully that, that goes off.

00:27:09.640 --> 00:27:10.040
Yeah.

00:27:10.040 --> 00:27:10.660
That'd be neat.

00:27:10.660 --> 00:27:11.140
Indeed.

00:27:11.140 --> 00:27:12.100
All right.

00:27:12.100 --> 00:27:15.720
Would you believe that just last night I was writing some C code?

00:27:15.720 --> 00:27:16.420
No.

00:27:16.600 --> 00:27:17.400
I typically do.

00:27:17.400 --> 00:27:19.140
I'm like, come on, another semi-colon.

00:27:19.140 --> 00:27:19.500
I forgot.

00:27:19.500 --> 00:27:20.180
Are you kidding me?

00:27:20.180 --> 00:27:21.180
Been a while.

00:27:21.180 --> 00:27:24.400
But I actually did a pretty good job without pulling up any references or anything.

00:27:24.400 --> 00:27:31.460
So more on that later, but I just want to give a quick shout out to this project called CPP Front from Herb Sutter.

00:27:31.840 --> 00:27:36.040
It's an experimental compiler for an alternative syntax to C++.

00:27:36.040 --> 00:27:40.320
That would make the language 10 times simpler, safer, and more coolable.

00:27:40.320 --> 00:27:47.300
I think it basically is, as the name would say, like CPP Front is like a slightly different language that compiles to C++.

00:27:47.300 --> 00:27:49.780
So it has an interoperability and whatnot.

00:27:50.580 --> 00:27:56.120
People do a lot of C++, like, you know, for low-level integration with Python and things might find this interesting.

00:27:56.120 --> 00:28:00.940
So you can jump over to the GitHub repo, and they have got some examples in here.

00:28:00.940 --> 00:28:01.940
Let me see if I can find it.

00:28:01.940 --> 00:28:05.820
I think you've got to maybe go check out the tests or something like that.

00:28:05.820 --> 00:28:08.080
They don't have great documentation.

00:28:08.080 --> 00:28:09.860
CP2.

00:28:09.860 --> 00:28:11.400
It's just text.

00:28:11.400 --> 00:28:12.180
Show it to me.

00:28:12.180 --> 00:28:12.540
Oh, wait.

00:28:12.540 --> 00:28:12.940
No, it's not.

00:28:12.940 --> 00:28:14.260
It's 4 megs, but it's okay.

00:28:14.900 --> 00:28:21.340
Anyway, it's got some pretty funky syntax, but it also looks pretty fun.

00:28:21.340 --> 00:28:22.180
People can check that out.

00:28:22.180 --> 00:28:24.860
So if that's interesting, then go for it.

00:28:24.860 --> 00:28:29.820
I don't know where I saw the cool examples or something, but, well, they had some in here.

00:28:29.820 --> 00:28:31.420
What's different about this?

00:28:31.420 --> 00:28:32.740
Yeah, I find them.

00:28:32.740 --> 00:28:33.280
Oh, well.

00:28:33.280 --> 00:28:34.440
You can look through the notes here.

00:28:34.440 --> 00:28:39.960
The language, it hardly looks like C++, but it still has the same kind of thing.

00:28:39.960 --> 00:28:40.860
What do you think about this, Brian?

00:28:40.860 --> 00:28:41.560
You do some C.

00:28:41.560 --> 00:28:47.580
I don't, well, I've been doing it for so long that I don't know if it's that hard to do C++.

00:28:47.580 --> 00:28:53.660
I mean, it's hard to get it right, but there's, I don't know, we have a lot of help now with

00:28:53.660 --> 00:28:57.320
the modern compilers and linters and everything.

00:28:57.320 --> 00:29:03.080
But I always think it's a neat idea if it's really easier.

00:29:03.080 --> 00:29:06.700
That little snippet you showed me didn't look easier, but we'll see.

00:29:06.700 --> 00:29:08.080
Here's an example.

00:29:08.080 --> 00:29:13.100
If you check out this little graphic on the readme called, it says cathello.cpp2.

00:29:13.100 --> 00:29:13.720
Okay.

00:29:13.720 --> 00:29:16.420
It looks a little bit like Python type hints, doesn't it?

00:29:16.420 --> 00:29:18.940
Like the way you specify the return value and stuff.

00:29:18.940 --> 00:29:19.440
Yeah.

00:29:19.440 --> 00:29:19.900
Yeah.

00:29:19.900 --> 00:29:21.100
Anyway, could be fun.

00:29:21.100 --> 00:29:22.180
We'll see if it goes anywhere.

00:29:22.180 --> 00:29:22.700
All right.

00:29:22.700 --> 00:29:23.500
A few other things.

00:29:23.500 --> 00:29:26.560
TypeScript is definitely something that's going somewhere.

00:29:27.440 --> 00:29:33.660
Matt Kramer pointed out that Jeff Glass has been doing a bunch of things with iScript lately.

00:29:33.660 --> 00:29:38.720
So I want to highlight one thing and then I'm going to dive into it more next week.

00:29:38.720 --> 00:29:40.100
I just want to put this on people's radar.

00:29:40.100 --> 00:29:46.320
So PiScript September edition is out with lots of changes on it.

00:29:46.320 --> 00:29:51.240
So probably the easiest way to see that is to click on this blog post they got down there.

00:29:51.240 --> 00:29:56.080
So if you've been doing any PiScript, you kind of want to know about this because it's like super breaking changes.

00:29:56.080 --> 00:30:05.200
So for example, you used to have to say, use this thing Pi ENV for configuring like what libraries you would use and how you execute it.

00:30:05.200 --> 00:30:06.220
That thing's gone.

00:30:06.220 --> 00:30:10.500
Now you've got like a package section of a Pi config and a path section for files.

00:30:10.980 --> 00:30:18.040
A bunch of other things, better logging, multiple runtimes, upgraded Pyodide and whatnot.

00:30:18.040 --> 00:30:20.300
But check that out if you're doing PiScript.

00:30:20.300 --> 00:30:21.100
Nice.

00:30:21.100 --> 00:30:23.040
And they're not even Xerover yet.

00:30:23.040 --> 00:30:23.640
Yeah.

00:30:23.640 --> 00:30:24.860
Well.

00:30:24.860 --> 00:30:25.540
They're Calver.

00:30:25.540 --> 00:30:29.720
We're going to need some kind of like new calendar event or something.

00:30:29.720 --> 00:30:30.760
Yeah.

00:30:30.760 --> 00:30:31.360
Because they're Calver.

00:30:31.360 --> 00:30:31.820
Yeah.

00:30:31.820 --> 00:30:32.160
Cool.

00:30:32.160 --> 00:30:32.440
All right.

00:30:32.440 --> 00:30:33.200
Follow up.

00:30:33.200 --> 00:30:36.000
I talked about NextDNS last time.

00:30:36.000 --> 00:30:38.960
That's like basically like for people to do PiHoles.

00:30:38.960 --> 00:30:40.540
It's like PiHole, but it's on the internet.

00:30:40.660 --> 00:30:41.580
You don't have to manage it.

00:30:41.580 --> 00:30:45.160
I said I didn't really try it out that much last time.

00:30:45.160 --> 00:30:49.920
So I went in and I did an interesting experiment on the family, including myself.

00:30:49.920 --> 00:30:57.840
I went to the router and I just changed it to use this blocking, ad blocking, malware blocking DNS as like for all the network.

00:30:57.840 --> 00:31:02.260
Which is good because like my TV can no longer do bad things that it was doing.

00:31:02.260 --> 00:31:06.360
You know, my kid gets ad blocking without knowing it.

00:31:06.360 --> 00:31:07.360
Even visitors, I suppose.

00:31:07.360 --> 00:31:07.900
Right.

00:31:07.900 --> 00:31:10.100
And I was like, all right, well, let's see what breaks.

00:31:10.300 --> 00:31:12.200
Who goes, Michael, I can't do this anymore.

00:31:12.200 --> 00:31:13.800
Like nothing broke, which is great.

00:31:13.800 --> 00:31:16.260
So I'm super psyched about that.

00:31:16.260 --> 00:31:25.180
And if you create it, actually you can create a free, what I've learned is you get a free account for up to 300,000 DNS for queries a month.

00:31:25.180 --> 00:31:30.340
And what happens after that is it just falls back to like standard DNS with no blocking, which is pretty awesome.

00:31:30.340 --> 00:31:31.280
And there's like $2.

00:31:31.280 --> 00:31:31.680
Yeah.

00:31:31.680 --> 00:31:32.800
There's not an ad for them.

00:31:32.800 --> 00:31:33.940
It's just, I think it's pretty awesome.

00:31:33.940 --> 00:31:39.140
So I went and ran, I went to adblock-tester.com.

00:31:39.140 --> 00:31:39.640
Okay.

00:31:39.900 --> 00:31:48.480
With Vivaldi with its max blocking, no plugins, no extensions for ad blocking, just the built-in one because I don't want to install more extensions.

00:31:48.480 --> 00:31:56.060
But with that turned on and the next DNS, private DNS, I get 96 out of 100 on ad block tester.

00:31:56.060 --> 00:31:58.560
With Brave, I got 100 out of 100, which is pretty awesome.

00:31:58.820 --> 00:32:05.460
But even if I turn all the blocking off on Vivaldi, I still get 80 out of 100 just using that DNS.

00:32:05.460 --> 00:32:06.660
That's pretty awesome, right?

00:32:06.660 --> 00:32:10.660
It's like 80% everything is just killed before it ever gets through the network.

00:32:10.660 --> 00:32:12.820
Oh, I was curious what the number was.

00:32:12.820 --> 00:32:14.160
So it's not 80 get through.

00:32:14.160 --> 00:32:15.420
It's 80 get blocked.

00:32:15.420 --> 00:32:17.040
It's 80 blocked.

00:32:17.040 --> 00:32:18.300
So you can actually scroll through.

00:32:18.300 --> 00:32:22.340
It'll show you like the wild cat Giphy wasn't blocked.

00:32:22.340 --> 00:32:24.180
The static image wasn't blocked, basically.

00:32:24.180 --> 00:32:28.040
But, you know, pretty much everything else was blocked.

00:32:28.420 --> 00:32:30.040
So, yeah, pretty awesome.

00:32:30.040 --> 00:32:30.500
Yeah.

00:32:30.500 --> 00:32:30.820
Yeah.

00:32:30.820 --> 00:32:37.740
And last thing here, one of the things you got to do to make this work, this is like a new extra, but it is like one flows into another.

00:32:37.740 --> 00:32:43.300
One of the things you got to do to make this work is if your IP address changes and you have a crap router,

00:32:43.300 --> 00:32:46.220
I have like an insanely good router that has crap configuration.

00:32:46.220 --> 00:32:47.080
Let's put it that way.

00:32:47.080 --> 00:32:54.440
Where I can't do IP over, sorry, DNS over HTTPS or set up any details.

00:32:54.440 --> 00:32:58.080
I can just say, here's the four numbers for the DNS server.

00:32:58.080 --> 00:32:58.520
Yeah.

00:32:58.520 --> 00:32:58.920
Right.

00:32:58.920 --> 00:33:00.160
Just the IP address.

00:33:00.160 --> 00:33:13.240
Well, if that's the way you do it and you have some account that does blocking, you've got to go into your DNS account and associate your IP address with your account by just like clicking a button or calling an API endpoint.

00:33:13.660 --> 00:33:15.240
But what do you do when your IP address changes?

00:33:15.240 --> 00:33:16.240
How do you remember?

00:33:16.240 --> 00:33:22.760
Like all your ad blocking stops every time, you know, maybe the power goes out and you've got to like your things come back on and they get a new IP address.

00:33:22.760 --> 00:33:24.440
So I was like, well, what could I do?

00:33:24.440 --> 00:33:28.000
I've always wanted to have like a little circuit Python project that would be fun.

00:33:28.220 --> 00:33:30.260
So originally I wanted to get a Raspberry Pi.

00:33:30.260 --> 00:33:31.500
Those are unattainable.

00:33:31.500 --> 00:33:32.040
It turns out.

00:33:32.040 --> 00:33:33.420
Have you tried to get a Raspberry Pi, Brian?

00:33:33.420 --> 00:33:35.720
Not recently, years ago.

00:33:35.720 --> 00:33:40.880
But yeah, I think they're like 35, 40 bucks for a new nice one, but they're all sold out.

00:33:40.880 --> 00:33:43.000
And you can find them on Amazon for like $200.

00:33:43.460 --> 00:33:47.700
People have bought them up and then are scalping them back to you on Amazon, which is super frustrating.

00:33:47.700 --> 00:33:48.480
Lame.

00:33:48.480 --> 00:33:52.840
You can find them for about $100 on eBay, right?

00:33:52.840 --> 00:33:53.800
Anyway, they're hard to get.

00:33:53.800 --> 00:33:57.000
And then if you get them, they're way marked up and it's kind of frustrating.

00:33:57.000 --> 00:33:58.240
Well, what else could I use?

00:33:58.240 --> 00:33:59.320
So check this thing out.

00:33:59.320 --> 00:34:00.520
See, I got on the screen here.

00:34:00.520 --> 00:34:11.460
This Adafruit ESP32-S2 feather is a full-blown circuit Python in Arduino, basically, for $17.50.

00:34:11.760 --> 00:34:13.080
And it's in stock.

00:34:13.080 --> 00:34:13.640
Nice.

00:34:13.640 --> 00:34:15.400
So I got that yesterday.

00:34:15.400 --> 00:34:21.120
And just to give you a sense of how small it is, like if you put it in your hand, it's probably two-thirds the size of your hand.

00:34:21.120 --> 00:34:29.640
And it's a full 240 megahertz computer, four megs of RAM, Wi-Fi, Bluetooth, temperature.

00:34:29.640 --> 00:34:32.420
But the most important thing is Wi-Fi, make no doubt.

00:34:32.420 --> 00:34:34.180
And I see Paul Cutler out there.

00:34:34.180 --> 00:34:34.880
Yes, thank you, Paul.

00:34:34.880 --> 00:34:37.240
I was actually thinking of you last night when I was working on this.

00:34:37.240 --> 00:34:40.720
It took a bit of time to set up and it was a little bit painful, like getting it configured

00:34:40.720 --> 00:34:43.320
from originally it was Arduino, which is C.

00:34:43.320 --> 00:34:44.020
So I was writing.

00:34:44.020 --> 00:34:49.260
I tried to do all this stuff in C, which basically tried to like hold that endpoint and pull out my IP address.

00:34:49.260 --> 00:34:54.040
And everything seemed fine except for nothing I could find supports HTTPS in C.

00:34:54.420 --> 00:34:59.080
All the REST frameworks only supported HTTP unencrypted.

00:34:59.080 --> 00:35:01.200
I'm like, what endpoint is unencrypted these days?

00:35:01.200 --> 00:35:02.020
What is this madness?

00:35:02.020 --> 00:35:03.300
Give me some requests.

00:35:03.300 --> 00:35:05.460
So I got CircuitPython going on it.

00:35:05.460 --> 00:35:12.360
And now it's happily sitting over there in the corner, sending me a little rake reports through like sort of like Morse code through its LED.

00:35:12.360 --> 00:35:13.960
And then, yeah, it's beautiful.

00:35:13.960 --> 00:35:20.460
I just plug it into the power and it just goes constantly, checks my IP address, updates that DNS setting periodically with an API.

00:35:20.840 --> 00:35:21.140
Okay.

00:35:21.140 --> 00:35:22.340
So it's monitoring.

00:35:22.340 --> 00:35:25.740
And if your IP address changes, it uploads it?

00:35:25.740 --> 00:35:26.580
Yeah.

00:35:26.580 --> 00:35:33.700
Basically, it just has to call the API from the network and that'll like go, well, wherever you're coming from, that's where we're going to treat you as being from.

00:35:33.700 --> 00:35:34.200
Okay.

00:35:34.200 --> 00:35:34.700
Nice.

00:35:34.700 --> 00:35:35.000
Yeah.

00:35:35.000 --> 00:35:37.520
You might say, well, why don't you just run that Python code on your computer?

00:35:37.520 --> 00:35:41.600
My computer is running a VPN, which is not the right IP address.

00:35:41.600 --> 00:35:44.460
All my devices, I can't run it on.

00:35:44.460 --> 00:35:45.980
I don't want to run a whole computer for it.

00:35:46.040 --> 00:35:50.860
So like this thing is incredibly small and cheap and it was just a fun project.

00:35:50.860 --> 00:35:52.280
Nice use of that.

00:35:52.280 --> 00:35:52.600
Cool.

00:35:52.600 --> 00:35:52.940
Yeah.

00:35:52.940 --> 00:35:53.440
Yeah.

00:35:53.440 --> 00:35:54.440
So that was a lot of fun.

00:35:54.440 --> 00:35:57.200
A lot of learning, a lot of differences with CircuitPython.

00:35:57.200 --> 00:36:00.220
Like similar, but then wait, why doesn't that work?

00:36:00.220 --> 00:36:03.900
Like, oh, I want to find out, you know, the relative path is, oh, there's no pathlib.

00:36:03.900 --> 00:36:04.120
Sorry.

00:36:04.120 --> 00:36:05.500
Oh, well, let me try again.

00:36:05.500 --> 00:36:07.420
Let me find some other way to answer that question.

00:36:07.420 --> 00:36:07.940
Oh, yeah.

00:36:07.940 --> 00:36:08.420
It was still fun.

00:36:08.420 --> 00:36:08.880
Yep.

00:36:08.880 --> 00:36:09.280
All right.

00:36:09.280 --> 00:36:10.360
Well, those are all my items.

00:36:10.360 --> 00:36:12.200
I know I had a bunch of extras, but there they are.

00:36:12.200 --> 00:36:12.940
That's all right.

00:36:12.940 --> 00:36:14.060
Well, do we have a joke?

00:36:14.060 --> 00:36:15.260
Oh, you know that we do.

00:36:15.260 --> 00:36:20.280
So following on, like one of the things I had last night, I was like, God, why, why can I

00:36:20.280 --> 00:36:21.840
get CircuitPython installed in this?

00:36:21.840 --> 00:36:26.220
And it was, when it came out of the box from Adafruit, maybe I'm missing something, but it

00:36:26.220 --> 00:36:28.080
didn't show up as a drive.

00:36:28.080 --> 00:36:32.160
It only could be communicated with over the serial port, right?

00:36:32.160 --> 00:36:37.680
And the way that you normally install CircuitPython is you drag this bootloader just over the drive

00:36:37.680 --> 00:36:39.640
and it just restarts and off it goes.

00:36:39.640 --> 00:36:41.120
I'm like, well, how do I get this on?

00:36:41.120 --> 00:36:42.060
It just wouldn't work.

00:36:42.060 --> 00:36:42.680
Wouldn't work.

00:36:42.760 --> 00:36:44.140
And I'm like, I'm trying all these things.

00:36:44.140 --> 00:36:48.740
And eventually I figured there's like a sequence of little clicks I got to do on like some of

00:36:48.740 --> 00:36:50.300
the buttons to like put it into a mode.

00:36:50.300 --> 00:36:50.980
Then I could do it.

00:36:50.980 --> 00:36:52.140
I could have used some help.

00:36:52.140 --> 00:36:52.380
Okay.

00:36:52.380 --> 00:36:56.180
So this woman, Annie here, she's got it figured out.

00:36:56.180 --> 00:37:00.860
If I just went on to Stack Overflow or to Reddit or whatever and post that, people are

00:37:00.860 --> 00:37:01.680
just going to ignore it, right?

00:37:01.680 --> 00:37:02.320
They're going to, yeah, whatever.

00:37:02.320 --> 00:37:03.760
Newbie, he doesn't know what he's doing.

00:37:03.760 --> 00:37:04.680
Just go away.

00:37:04.680 --> 00:37:06.820
However, Annie has another idea.

00:37:06.820 --> 00:37:11.180
She says, every time I have a programming question and I really need help, I post it on Reddit and

00:37:11.180 --> 00:37:15.540
then I log in with another account to reply to it with an obscenely incorrect answer.

00:37:15.540 --> 00:37:19.340
People don't care about helping each other, but they love correcting others.

00:37:19.340 --> 00:37:21.320
This works 100% of the time.

00:37:21.320 --> 00:37:23.780
That's pretty funny.

00:37:23.780 --> 00:37:24.500
Yeah.

00:37:24.720 --> 00:37:25.860
I bet it works too.

00:37:25.860 --> 00:37:26.660
Yeah.

00:37:26.660 --> 00:37:27.220
Right.

00:37:27.220 --> 00:37:31.620
If you went in there, like what you need to do is just type dash R, you know, RM dash RF

00:37:31.620 --> 00:37:32.780
on forward slash.

00:37:32.780 --> 00:37:34.940
No, no, no, don't do that.

00:37:34.940 --> 00:37:35.420
Yeah.

00:37:35.420 --> 00:37:37.540
It's a take on a different take on it.

00:37:37.540 --> 00:37:43.500
So I used to do the similar thing of just a post, post a blog post with the wrong answer

00:37:43.500 --> 00:37:50.900
and, and have, or a bad tutorial and leave comments on and, and then let people tell me what,

00:37:51.000 --> 00:37:53.880
how much of an idiot I am and then delete that and write the real post.

00:37:53.880 --> 00:37:54.900
Thank you.

00:37:54.900 --> 00:37:56.320
I incorporated your changes.

00:37:56.320 --> 00:37:57.200
I really appreciate it.

00:37:57.200 --> 00:38:00.200
I tried to give people credit, of course, but.

00:38:00.200 --> 00:38:00.920
Of course.

00:38:00.920 --> 00:38:01.600
Of course.

00:38:01.600 --> 00:38:02.160
Awesome.

00:38:02.160 --> 00:38:03.960
Well, here's a tip.

00:38:03.960 --> 00:38:07.540
If people need help and you just got to have that secondary Reddit account to get in there

00:38:07.540 --> 00:38:08.660
and stir the pot.

00:38:08.660 --> 00:38:09.520
Or a friend.

00:38:09.520 --> 00:38:10.500
So ask.

00:38:10.500 --> 00:38:11.060
Or a friend.

00:38:11.060 --> 00:38:11.360
That's right.

00:38:11.360 --> 00:38:14.480
Hey, could you just come answer this really like with this bad answer?

00:38:14.480 --> 00:38:14.940
Yeah.

00:38:14.940 --> 00:38:16.780
A good idea.

00:38:16.780 --> 00:38:17.420
That's nice.

00:38:17.420 --> 00:38:18.040
All right.

00:38:18.180 --> 00:38:20.220
Well, thanks again for a wonderful episode.

00:38:20.220 --> 00:38:20.820
You bet.

00:38:20.820 --> 00:38:21.440
Lots of fun.

00:38:21.440 --> 00:38:22.200
Thanks for being here.

00:38:22.200 --> 00:38:23.000
See you later, everyone.

00:38:23.000 --> 00:38:23.560
Bye.

