- Podcasts
- Python Bytes
- #311 Catching Memory Leaks with ... pytest?
#311 Catching Memory Leaks with ... pytest?
Python Bytes
- November 24, 2022
- 50 min
- Episode 311
About this episodeTopics covered in this episode: Latexify prefixed dbt Memray p ytest plugin Stealing Open Source code from Textual Shed Extras Joke See…
See the full show notes for this episode on the website at pythonbytes.fm/311
Transcript
From the publisherThis transcript comes from the podcast’s own feed, shown as the publisher wrote it.
#311 Catching Memory Leaks with ... pytest?
Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds. This is episode 311, recorded November 22nd, 2022. And I am Brian Okken. I'm Michael Kennedy. And I'm Murilo Cunha. So welcome, Murilo. So tell us a little bit about yourself before we jump into the topics.
TLDR is, I'm a machine learning engineer at a data and AI consultancy company called Data Roots. I'm from Brazil, but I actually live in Belgium. And I guess that's it. Thanks for having me. Thanks for showing up. It's great to have you here. Well, Michael, why don't you kick us off with the first topic?
All right, let's kick it off. I've got some fun stuff. Let's see what Murilo thinks about this. This is, it's a little bit mathy, what I got going on here. That is not the right screen. How about that screen? So this comes in from one of the big friends of the show, Brian Skin. And he sent me a tweet and it just says, what?
At Python Bytes. And it's a quote tweet from somebody here saying, holy, latexify is the sexiest thing I've ever seen. And look at this. So when I studied a ton of math and the symbols of mathematics are really important and they communicate stuff like really, really quickly. You can scan over and you see the symbol for the real numbers or you can see the symbol for subset or, you know, infinite sum.
And you're like, I know what that means. When you translate that into Python or into computer code, it usually becomes something kind of gnarly looking. Right. So the example here on this tweet has a function called solve and it's solving the quadratic equation. I guess just for one variation of the root, not the plus minus, but that's fine.
What do you think? Oh, wow. Is that insane? This is great. But it just changes the ripple of the function, I guess, right? Like if you call the function, it's all fine. Yeah, exactly. It doesn't change the function at all. It changes the wrapper or the stir. So if you do this outside of a notebook, what it prints out, let me see if I can somehow communicate this back.
So if you print it out, what it returns, do I have it here? No. Yes. There. No, that's not it. Sorry, I don't have it. What it prints out is the latex escape codes. So it'll say like backslash frack of, you know, like it's a weird, I don't know how to write latex. I did a little bit when I was studying math and then I said, that's something I never need to remember.
And, you know, shot it out of my brain. Never again. Yeah. Like, why do I need to know this? I don't need to know this. Yeah. So the wrapper is just the latex escape codes and then the notebooks see that and then they render it as latex. That's pretty cool. And then, but one of the nice things about this then is you can, you might have like the math that you're trying to convert to code and then you can like check your answer.
Compiling it into the latex escape codes. Which is not human. Yeah. Which is the opposite of unilateral, but it is text, right? And, you know, related to this, just. Oh, yeah. Henry. Sempai. Okay. It's using inspect, get source and parsing the AST. Yeah. Perfect. Another thing that's amazing, if people check out like the Sempai stuff, it does some really, really interesting things.
So that's kind of related. But this just says, given any arbitrary Python function, not written in the symbolic form, just turn it into a latex, which is pretty amazing. So anyway, thank you, Brian Skin, for pointing that out. That is pretty neat. One final comment. I could not get it to install on my Apple Silicon Mac.
Maybe that detail matters. But I couldn't get it to pip install. Out of PyPI, I had to pip install the Git plus the GitHub URL, and then it would install. I don't know why, but if people want to play with it, that might be necessary. Okay. Yeah. Over to you, Brian. All right. Well, while we're talking about math, I'm often working in the measurement world, and where we care about prefixes a lot.
And a lot of people do, with big numbers or small numbers. And this was actually suggested to us by Avram. And I think he either works on this, or it's his project. It's a project called Prefixed. And what this does is it's just, it's a class, it provides a class called Float, capital F, that is a, derives from the built-in float.
But then the nice thing about it is when you convert it to a string, it includes the little prefix thing or the suffix or whatever, the little micro or K or M or something like that. So I think this is actually super helpful. I'm going to use this right away because I, you know, I use a lot of, like, big and small numbers and reporting out just the huge thing or just the float is sometimes horrible to compare with.
That's cool. And then there's a, the byte example where they said, well, I'm going to, I'm going to use the capital B for bytes, but that's after the formatting of the number. And then the K comes in from the float thing. So that's, that's pretty cool. one of the other things that he passed along is there's some new prefixes.
But, national debt, maybe. yeah, very possible. But, but also Avram notes that prefixed does handle these new ones. So cool. Good job. Cool. One thing, Python too, you can put the underscore, right? To like, if you put underscore on the thousands, that also, that's something that makes it easier, I think, to, to, to read the numbers too.
No, it's a, it's a really cool tool. It's open source as well. They have their cloud, option, I guess. Right. So you can pay and they host it. maybe a disclaimer as well that I never, I always see it and I always want to use it, but I haven't found the use case. So I don't have first-hand experience here.
You can do stuff like that. So you don't have to repeat every time and just change the variable. you, they also have these like reference macros and stuff. So you can actually say, okay, this comes from that table that is on that file. And this comes from this. So you can actually chain a lot of these dependencies, right?
Like there's a lot of projects that you have this ETL stuff, right? So you just have to basically transform it each step. And, with dbt, they actually keep track of what depends on what, and you can say, oh, I want the freshest data here and you execute everything that it needs to be executed there.
wow. Yeah. So it's super cool. They actually support a lot of like data platforms here. Right. So you see like big query data breaks, snowflake, all these things as well. another thing that they also more things they do. They even have some data validation stuff, which in my field, it's a big thing too, you know, like maybe have an ID column that needs to be unique, cannot be null.
And you want to make sure that that always happens. And if it doesn't happen, you want to be flagged. Right. So that's super cool. what else? Ah, you also have some built-in documentation. So if you, once you have the dependencies, you can say, oh, show me the DAG, you know, show me where the data comes from and what depends on what.
big query has spark and Databricks as well. Right. So basically you can mix and match this transformation. See, this transformation is there, but everything is like in a nice put in one place. And because it's on Git as well, you can have CI/CD. I think also you mentioned, I think it was you, Brian, that mentioned SQL fluff and SQL fluff actually came from a DBT project as well.
Cause it's also doing a comparison, right? maybe this is, can this, no, this doesn't work. Does it? Yeah. It works. no, this works. Yeah. It was wrong. Okay. this is, but the quality is horrible. But in a nutshell, you have this basically, yeah. You define a function. Yeah. You define a function that has a DBT and a session and then you create a reference.
So reference basically a table, right? And you can say, and then from that point on, you can say two Pandas and then you can just basically use the Pandas API to transform that. Right. So there's still some caveats, right? Cause Panda is not super performant depending on how much data you have and whatnot.
So sometimes you probably still want to stick to, the SQL stuff, but then it opens a lot of possibilities there too. Right. So even stuff like deploying machine learning models on the SQL infrastructure and everything. So, yeah. So it's, kind of the same old, same old story. You know, even if you're working with an ORM, sometimes you don't want to bring all that data back to make some minor change.
Right. And so business people can see, are we doing better? Are we making more money or not? Kind of. and like a lot of the times it's just SQL, right? It's also more accessible for a lot of people. So we stick to SQL. but there are also limitations, right? But before what I've seen is, people just kind of go in the UI and just execute stuff ad hoc.
Right. So no versioning, nothing. And I think this kind of puts everything in one place. You can even add CI/CD because the CLI tool and everything, and just kind of make sure that everything goes to that versioned method. Let's say, I mean, and again, yeah, if you need something more, more fancy, right.
Then you can throw some Python stuff in there, but usually we try to avoid it, to be honest. I can imagine. Oh, let's see here. hold on. Yeah. The models, the way you express the code, it's like, it's really nice looking for SQL, which is surprising. Right. This, this code you write, like with customers as select these fields from this, this table.
So super cool. Really, really eager to, to give it a try. To be honest, I've been just like trying to scratch that. Like scratch that. Where's the next, where's the next project that we get to use this on? Indeed, indeed, indeed. Yeah. All right. Brian, anything you want to add before we jump over to, talking about our sponsor real quick?
Yeah, let's, no, let's talk about our sponsor. All right. So, today's episode of Python Bytes is brought to you by Microsoft for Startups Founders Hub. So Microsoft for Startups set out to understand what startups need to be successful and created a digital platform to help you overcome those challenges.
And they came up with Microsoft for Startups Founders Hub. The Founders Hub provides all founders at any stage with free resources to help solve startup challenges. The platform provides access to expert guidance, skilled resources, mentorship, and networking connections, technology benefits, and so much more.
Founders Hub is truly open to all. You don't need to be investor backed, but you can be. Speed up development with free access to GitHub and the Microsoft Cloud. You can unlock credits over time. And there's also discounts and benefits from innovative companies partnering with Founders Hub, such as OpenAI.
You'll have access to mentorship, their mentorship network, which includes hundreds of mentors across a range of disciplines. Need advice on marketing, fundraising, idea validation? There's tons of topics, including management and coaching. You'll be able to book one-on-one meetings with the mentors, many of whom are former founders themselves.
That was all fun. But he also, I believe, works at Bloomberg, where they work on memory. And I think we spoke about memory quite a while back, Brian. It's a memory profiling tool. Maybe. Merlo, do you use profilers and that kind of stuff in your world? No, I haven't used much. I haven't had a need, to be honest.
Not yet. I feel like so far, there's no... Try to keep it simple. So, a lot of times profilers are about performance. Like, how fast did this code run? And if it's slower, should I look at this loop or that loop? Or, you know, where do you spend your time making it faster? Because it's really surprising when you look at code.
You're like, this part looks complicated. So, that must be the slow part. Like, no, that doesn't matter. Nothing you do to that will make any difference. You got to look over here, right? That kind of stuff. But memory, as the name would suggest, is more about memory profiling and, like, talking about, you know, how many of these different things have you allocated and those kinds of things.
What is coming? Well, first, let me pull up. We have a pytest plugin, which is super cool. So, with the pytest plugin, you can do two things now. You can say pytest --memory tests. And it'll tell you things like, you can actually set limits on how much memory can be allocated for a certain operation.
And if it exceeds that, it'll say, oh, my gosh, there's something wrong. This thing is, like, way over using the memory we expected. So, that's an error. But it also gives you, like, a cool emoji-filled summary, I guess. Like, total memory allocated, the number of allocations, a histogram of allocation sizes.
So, like, Python memory has, like, size classes. We've talked about its block arena, one other term. I'm forgetting. Like, that it uses to organize data structures. And then you can actually get it overall, then, for individual tests. And so, it'll tell you, like, the different things that were, you know, allocated.
So, yeah, they have a limit memory decorator and a check leaks decorator. That's the one. So, the check leaks is the new thing. And so, what you can do now is you can say pytest.mark.checkleaks as a decorator on your test. And if there's a memory leak in the code that runs during that, it will let you know.
Wow. I don't know if anyone else has tried to track down memory leaks. I would rather track down, like, a multi-threaded race condition than a memory leak. I don't want anything to do with memory leaks. This is no fun. And so, if I can do it with a decorator, let's do it. Well, and also decorating your test so you're not having to modify your code at all to do this.
And you've written a bunch of C code that's getting imported. And you know there's a memory leak in there somewhere. And it's just like, okay, well, I don't really know how to do it. But then it's more like the C part is the bandage. You can also have memory leaks in the sense that you expected there to be no more things allocated after the function was called.
But you could have signed it to a global variable or you could have, you know, stored it, held on to a reference in some way that you weren't expecting. So, it's not a leak in the super traditional sense, but it could build up if you're doing something wrong in Python. But certainly outside of that.
So, I think this is pretty cool. Really, any long-running service is going to have, you're going to be concerned about it. There's a lot of Python applications that are short-running and it just cleans up after itself when it's done. So, there's cases, long-running services, also things like maybe you care about, things that are using large amounts of data and need all of the data that they can get a hold of without wasting any.
That's important as well. Makes sense. I'm also wondering. If you're right at the limit. Yeah. No, sorry. Go ahead. Go ahead. Yeah. If you're right at the limit of like, I'm using 15 and a half gigs and I don't have more than that. So, I need that. Or like, I just checked the Talk Python training site has been running for seven days and one hour.
Yeah. Like, if it had a memory leak, you know, it's even if it's, you know, 100 kilobyte here and there, like it could turn out to be like a big hassle. Okay. Cool. I'm wondering if you could use this for edge device stuff. If we're going to limit the memory because we know the edge device won't have that much.
That's actually a really good point. Oh, yeah. Because if you're on one of these like CircuitPython little boards, they've got like 256k of RAM. And that's very different than 16 gigs, isn't it? Yeah. Yeah. Right. So, you could test your application on a larger computer and limit how much memory you give it.
Right. Yeah. I think you would want to do that with the limit rather than the check leaks, but still. Yeah. So, it's the same. Yeah. Cool. Yeah. Awesome. All right. Let's see. A couple of comments from the audience. Gareth out there. Hey, Gareth. Says, I ended up writing Docker containers that swapped out every couple hours to solve it.
So, people are digging it. Cool. Yeah. Very cool. So, thank you, Roman. I know you didn't send that to us on purpose, but you shared it with us anyway. Thanks. Nice. Over to you, Brian. Okay. Before I get on to the next topic, I want to point out that Henry Schreiner, I'm going to paraphrase him by saying, Brian, you dork.
You didn't even read the article. Yes, you're right, Henry. Sorry. So, the new prefixes, I was showing the previous new ones in 91 when they added yocto and zepto. These are not the new ones. The new ones are down here with ronacueta, ronto, and quecto. Yes. The reason why those sounded familiar is because they've been around.
These new ones, they're the new ones. Okay. So, thanks, Henry, for clarifying that. But on to the next topic is Will McGugan says, please steal my source code. So, he wrote an article. Will McGugan wrote an article, stealing open source code from Textual. And he says, I would like to talk about a serious issue with free and open source software.
Stealing code. You wouldn't steal a car, would you? And then, actually, he has this funny video that he embeds about how digital piracy really is like stealing. And it's sort of a funny video. But the comment is real that, like, you need to, you can steal code from open source projects as long as you can.
So, please read the MIT license or read the license to make sure that you can. And in a lot of cases, you can. So, like, I'm going to give an example that I use a lot is I'll think of something that I want to do. Like, I'm interacting with a library and maybe I don't quite get how to do that with the documentation.
I could search GitHub for projects that use that library also as an example. And so, that's a way to look at other source code of how to interact with a project that maybe doesn't have the greatest documentation. You can see how it's done. I've honestly never thought to do that. That's a great idea.
But the MIT license, for example, says it's substantial copying. So, a little bit of copying is fine. And Will says, Textual has some cool stuff in it that you might want to look at. So, he's got a loop. He points out some things you might want to steal. The loop first and last. So, he's got a loop iterator that he's got a couple versions of it that will not only iterate through things, but it'll give you, it'll note which one's the first and the last.
So, if you need to do something cool on something different on the first and the last one, do that. He tweeted recently or tooted or whatever about the LRU cache as well. So, the Python's got a built-in LRU cache, but everything's global. So, you can only kind of clear. There's limits on how you can interact with it.
So, he has a more flexible LRU cache. He's got a color class that looks pretty cool that you can convert to different color representations. That's pretty neat. And then, you know, he's been working on a ton of geometry stuff, 2D geometry. So, he's like, you might want to use this for whatever 2D geometry you're using.
So, I do that a lot. I just get frustrated and go into a new library. This one sucks. I can't do this. I'm going to find another one. It's not good enough. Merlo, are you an open source thief? Do you do this kind of stuff? I have to admit, yes. Yes, I am. Stack Overflow thief. Open source thief is just, especially in the early, early days, right?
But I think with rich stuff too, it's very inviting for you to steal code. Because even on the rich package, right? Like if you do Python-M rich table or whatever, you always show some really nice stuff on the terminal, right? And I was like, how does he do that? Or like, I think for every component, he had a little demo that you can just run.
Yes. This one I had not heard of either. And it looks pretty interesting. Yeah. I mean, it's a, I think it kind of, it's one of the things that I saw. I was like, yeah, this makes so much sense. Why? How come I never, I didn't think of this before. But this is Shed. I'm a man. This is a podcast, right?
So maybe Shed is, it basically, I think it's related to like bike shedding, shed your legacy code, right? So it's like a superset of black, right? They call it black plus plus here. So they say here, a maximally opinionated auto formatting tool, right? So it's all about configuration over, convention over configuration, which is also something that I can subscribe to.
And autoflake as well. Autoflake, I didn't know actually before. But basically it removes unused imports and unused variables from your Python code. So it's kind of like, yeah, that's all I wanted. I wish I had this last week. There you go. Yeah. But yeah, it's a one-stop shop. And even do like a blackened docs, right?
Yes. So if you have rich structured text, markdown, even doc strings, it will format that for you. Oh, like you like blackening your readme, for instance. Yes. Yes. Yes. Oh, okay. This is good. Indeed. So I have some stuff to talk about at the very end, just a little bit about blogging and writing and some platforms and stuff.
So I literally just like yesterday, the day before I was cleaning up some code. I finally got, you know, I kind of, I don't do it clean the whole time. I get it to work. And then I like, you know, then I look at what I did stupid. And there's, there might be some imports laying around that I thought I needed because you add an import and then you take that code out, but you sometimes forget to take the import out.
You might think you're using it. That's true. Yeah. Or it's like a global variable module supposed to share with something else. And it's a library, but in general, I mean, you could probably put like a hash, you know, QA or something on it. Well, I mean, yeah. And also you're, you're, you're testing.
Who should go first? You go first. Okay. Well, the thing that I've been working on is, is by test check. And I finally got, and I've been talking about this for like a month because I've been slowly pulling this into shape. It's almost a complete, not really a rewrite, but I moved everything around and the code's a lot easier to read.
And so it makes me happy. And I also changed the API. So I wanted to mention to everybody that you can either use, so you can either use from pytest check, import check to get this check object, or you can stick the check object as a fixture. And either way, you get access to everything in the library.
That's the only thing you have to do. And for people unfamiliar, pytest check is a, is a library that allows you to have multiple failures per test. You know, normally the recommendation is try to fail on one thing, but sometimes you need lots of data. And I just threw in a little example that uses both.
So if like it's using HTTPX to grab, grab the status code. And as long as the status code is 200, then I can check a whole bunch of stuff. I can check to make sure the redirect and encoding is right. And check for some, some stuff inside the, I mean, you, you, these could be multiple tests, but if it really is, you're checking multiple parts of things.
And I actually didn't have issues with that because with pre-commit, right? You have to specify the repo. I already was on GitHub, but I actually heard from people, some people that they heard a lot of noise that Flake 8 is not on GitLab anymore. And then there was also this video from Anthony that is maintaining, right?
Pre-commit and Flake 8. He was explaining a bit because why, what was the motivation from going from GitLab to GitHub? And yeah, like what's relatable is that like sometimes you break people's code, but it's like, it's not any intention, right? But sometimes people can get very heated over these things.
Yeah, yeah, yeah. I wish I knew about this like a week ago or so. That would have been awesome. You covered Toot, I think, right? Yes, we covered Toot. That's right. Yeah, yeah. So this is, to be very honest, I wasn't the one that found this, was my boss. So shout out to Bart if you're listening right now.
But this is basically just a wrapper around the Mastodon API, right? So you don't have to do requests. You can usually have like a nice client library there to do all these things. So if you want to play around, create some bots, you know, whatever, then yeah, there's a nice convenient package now for you to do it.
Wow. This is really cool. And it has, you know what? Documentations that say what functions it has. I love it. Documentation. Just read the code. It doesn't have to be much. Like the seven or eight lines of code that are in the readme, like gives you a really good boost. But it lets you register your app, which is one of the things if you go to the website, it'll show you which apps are registered for your access keys on Mastodon, but it won't let you create one on the website.
So here's like a simple create app and just give it a kind of your instance name and what file to save the access tokens over to and boom, you're good to go. Have you guys already done stuff with the Mastodon or? Yeah. I, you know, on the stream deck, the thing that controls the stream, I already wrote that thing where I, when I pushed the one button, it, it sends out the message automatically that this live stream is starting.
And yeah, it uses, that uses a little bit of toot and mostly just the straight API with HTTPX. But if I'd known about this, you know, I already used it. Now we know. Yeah, I know. Thanks for sharing that. Anything else you want to share before we move on? Yes. So there are a couple more things, but this one, this is the, the, the, the, the, Brazilian enemy that couldn't resist the world cup started.
I don't know if, are you guys soccer fans or not at all? So we've a fun soccer team. Here we go. See, I go see with the kids and stuff in town. Yeah. So the, so I'm also in machine learning. So a lot of data and like this time of the year, you know, there's a lot of like, oh yeah, the AI models are predicting this.
This one is one from Oxford. So I just wanted to give a quick shout out here. So they, they have a video on YouTube as well, which is cool. They explain the math. And I will go on a limb here and say they use Python because they even mentioned Metplotlib and whatnot. But this is basically just a big excuse to say that they predict Brazil to win.
So, you know, if this doesn't happen, it's all rigged. This, the math suggests, the math supports this. So Brazil must win this World Cup and anything that is not there, I'm going to be extremely disappointed. This is really cool. People are always looking for like realistic examples to learn and explore libraries and tools.
Yeah. Yeah. For sure. Yeah. Not at all. Not at all. Cool. Should I just keep going or you want to take over? If you got more items? Yeah. Keep going. Take us down the list. I have two more. Sorry. I know you said I could have more than two. So you can just wait. That's what this whole section is about.
Right. So this is a, I think it's public preview. I want to say, but I haven't actually seen this, but now GitHub is going to start supporting notebook diffs. So if you have a pull request, they're going to have a nicer rendering of the notebook here and you can actually see what the differences are.
And I think before there was a tool called review and be that you could add to GitHub. But yeah, now they're just going to start supporting it. So I haven't seen how it looks, but I'm pretty excited about this too. One less headache for me. Yeah. That's excellent. Because before the diff would just be like, here's the diff of the JSON file.
So instead of making your code look nice, it would just make it like a hideous, but working mess. Right? So these are some of the features. It turns all your comments to pit bull lyrics or something safe for work, depending if you want. It takes all your variable names and mix into like animal sounds and horribly look similar looking characters.
So like bark underscore bark underscore zero, oh, oh, zero, oh. It adds white spaces. It adds completely irrelevant comments. And the code still runs after these improvements. So here's an example. You have to hear some comments and everything. So before, like nicely formatted. And then afterwards, you see some comments like, bada bim, bada boom.
You know, there's nothing like Miami heat, some alpha characters in your variable name. Pretty good stuff. Pretty good stuff. Again, I must say I haven't used this, but this is a tool that I'm not as excited to use. I mean, there's all, there's always times that you need to send out your code to different places and you would rather share it less than more.
You know, like if you're thinking of like, if you make a desktop app and you got to send out the code for that or whatever, and you would want to obfuscate it. You want to make it harder for people to just pick it up and like do something. You could hit it with this. They'd be like, yeah, no, no, we're just, no, we're just not doing that.
So my favorite one, my favorite ones on the screen is the, adding obvious comments, like, setting the value of some, like, that wasn't in the original. And it's just funny that, I mean, that that's actually not gibberish. It's just useless. it's, it's really good. The, the, comments out in the live stream are really great, as well.
People are enjoying it. One of them is it's great for Twitter employees. You can maximize your lines of code for review as it's coming up. Then you just print it out and you take a sidebar. Like if somebody says print out my code so we can review it, they're not, they're not, equipped to review the code that you may have written.
Awesome. Thanks. All right. I'll, I'll, I'll make mine quick here. So a new YouTube video. I talked about how you can install the Mastodon web app on your iPad as a native app, as well as on your desktop. So, if you're doing that kind of stuff, not there. Basically they just released Mastodon four a couple of days ago and all the apps don't have features like edit and some of the other features that are there because they're like months behind.
And so if you install the web app as an app, then guess what? It looks like an app. It acts like an app, but it has like zero latency. So as soon as something is released on the website, you get it, which is pretty cool. So people can check that out. I saw Madison in the audience, sent over a call for proposals or calling all Pythonistas, if you will, for Pi Cascades.
So Pi Cascades is back in person this year in Vancouver, BC. It goes from Vancouver to Seattle to Portland and cycles through that, there. But so this year it's going to be in, Vancouver. So if you want to go up there and, talk, be part of the conference, good conference. So call for proposals are open there.
Yeah. But they're not open for very much longer. So, jump on that. Yeah. I don't remember what the date is, but it is, it closes a Wednesday 30th. So what is that? Yeah. Well, Wednesday. Yeah. Next Wednesday. Yeah. Eight days. And Madison and I feel an audience. Thank you. It's put in person this time.
We, and we really value the first time speakers and atypical talks. So get out there and put yourself out there and, and get into public speaking. It's not a huge conference, but it's, you know, it's, it's big enough. A couple hundred people, three, 400 people, fun time. this is just really quick and fun.
You know, if you're on a Mac, you're not as likely to get viruses sent your way that would actually be able to do something like 90% of viruses are written for windows. But what's a really interesting fact. I just, if you do have a Mac, it turns out 50% of all macOS malware comes from one single app.
We'll see about how that goes. But here I'm, I'm trying a new philosophy on, on blogging, Brian. I don't know how you feel about it, but I have a blog been doing it for a long time, but like I looked the last article I wrote was like 2020. I'm like, Oh, that's not so good. And the reason is I would always try to write like 2000 word posts that are really, and I'm like, but I could post to Twitter and mass it on all day.
And it's like, I can just do that. That's no problem. I don't like fall behind on Twitter. That's because these really should be super short posts. So I have, I've got this new website that I wrote that are just super short, you know, fits on a page type of articles that people can go and check out.
So, yeah. Some of the people, some people are promoting like today I learned things, but short, and why not? I mean, if you think it, if you think it's going to be a thread, write a blog post. Exactly. Yeah. Yeah. So cool. So all of these are written, and this is all based on Hugo, which is a, just learned about it, but a ridiculously cool static site generator.
Either of you played with Hugo? I use it. I love it. Python. So python test.com is written on Hugo. It's ridiculous, right? No, you haven't? Sorry. No, I haven't used it, but I heard of it. Yeah. Yeah. I heard nice things. Yeah. So you basically just go to your directory of Markdown files and images.
You just run Hugo dash D server, whatever. And then as you write, you have your, your web page open in your browser and automatically sees the Markdown file changes or the CSS changes, regenerates it and refreshes your browser. Just so your browser could be just over there. And it's just periodically as you make changes, it instantly refreshes.
That is super cool. Push the prod. Oh, that's kind of cool. I just, I just edit on prod. So I just log in. I didn't edit over SSH. Yeah. Just edit on the server. The server is the backup. Anyway, I have stuff on the screen, but there are no more backups. That's just stuff I pulled up while we're talking.
So no more extras. I mean, so yeah, fun stuff. People check out the blog website and the video and apply for speaking at PyCascades. Nice. Well, I feel like Lancer also was like already really funny, but do you have anything else funny for us or? I do. I do. Although I somehow forgot to pull them up on the screen.
And it shows this, this dude here, don't mind the thing at the bottom. I have no idea what that's about, but see, there's this guy whose face is blurred out in UK. I think I can't remember where this was. I know Berlin. And he's got a wagon, like a little red wagon that you pull behind you full of 99 phones.
Now what he did is he got them all running Google maps and left them open and started walking down the street real slow and notice his neighborhood is now red on the map and he got it. So it thinks there's a traffic jam and it'll send cars around his neighborhood. Nice. I want to get one of these so bad.
And whenever I take my dog for a walk, just walk with the wagon behind me too. This is no cars. Yeah. So good. Isn't it? Yeah. This guy's so ahead of our time. He's just like, oh, he's so brilliant. Yeah. And for his neighbors. Yeah. The next one, the next one here is going to take a little bit of a, I just got a, I got to set the stage.
Give me a second to set, set the history. Have you heard of, you've heard about these motivational posters. You go to like a dentist's office and it'll be like an eagle soaring over like a sunset. Like if you don't spread your wings, you'll never soar as high as you could or something cheesy like that.
Yeah. Well, there's this company called, yes, exactly. There's a company called despair and despair creates these, but like in reverse. They're called the demotivators. Yeah. Nice. So have you, have you seen these? No. Okay. So here's one like solutions. And what does it say? It has like a Rube Goldbergian type looking thing here.
And it says solutions. This is what happens when the problem solver gets paid by the hour. It's just, it's just out of control. Here's one. What is this? It's a frog wearing with a snail on its head. It says collaborate. So the best of us have to carry the rest of us. It's just like, they're really.
And then embedded in that is recursion. Here we go again. It's like that. Yeah. Like your screen share, you see your own screen. Yeah. So it's kind of like that poster, but for recursion. Yeah. I kind of feel bad that people, people that don't get the recursion joke, because they can't even look it up because it just, it's redirected.
