Transcript #311: Catching Memory Leaks with ... pytest?
Return to episode page view on github00:00 Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.
00:04 This is episode 311, recorded November 22nd, 2022.
00:10 And I am Brian Okken.
00:11 I'm Michael Kennedy.
00:12 And I'm Murilo Cunha.
00:13 So welcome, Murilo.
00:15 So tell us a little bit about yourself before we jump into the topics.
00:18 TLDR is, I'm a machine learning engineer at a data and AI consultancy company called Data Roots.
00:24 I'm from Brazil, but I actually live in Belgium.
00:26 And I guess that's it.
00:29 Thanks for having me.
00:30 Thanks for showing up.
00:31 It's great to have you here.
00:32 Well, Michael, why don't you kick us off with the first topic?
00:35 All right, let's kick it off.
00:36 I've got some fun stuff.
00:38 Let's see what Murilo thinks about this.
00:40 This is, it's a little bit mathy, what I got going on here.
00:44 That is not the right screen.
00:45 How about that screen?
00:46 So this comes in from one of the big friends of the show, Brian Skin.
00:51 And he sent me a tweet and it just says, what?
00:54 At Python Bytes.
00:55 And it's a quote tweet from somebody here saying, holy, latexify is the sexiest thing I've ever seen.
01:04 And look at this.
01:06 So when I studied a ton of math and the symbols of mathematics are really important and they communicate stuff like really, really quickly.
01:16 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.
01:23 And you're like, I know what that means.
01:25 When you translate that into Python or into computer code, it usually becomes something kind of gnarly looking.
01:31 Right.
01:32 So the example here on this tweet has a function called solve and it's solving the quadratic equation.
01:38 I guess just for one variation of the root, not the plus minus, but that's fine.
01:42 It just says like negative B plus math dot square root B star star two.
01:48 It's like symbol soup, right?
01:49 Yeah.
01:50 So this latexify thing, latexify, latex is the language of expressing those symbols the way mathematicians would have written them in, you know, the 16th century or whatever.
02:01 Like the fancy flowing sort of, you know, sum symbols and integral symbols and whatnot.
02:07 And so what this does is you just put a decorator onto that Python function.
02:11 You say latexify dot with latex, latex.
02:14 When you show that function in a notebook, it shows the math, formal mathematics of it.
02:22 Wow.
02:22 Like, like there's one that was doing, I said, the quadratic equation.
02:26 Another one that says if x is zero, return one else, return math sine of x divided by x.
02:32 And then the symbols is like this sort of like branching equation, you know, like what you would write that in latex conceptually.
02:38 What do you think?
02:39 Oh, wow.
02:40 Is that insane?
02:41 This is great.
02:42 But it just changes the ripple of the function, I guess, right?
02:45 Like if you call the function, it's all fine.
02:47 Yeah, exactly.
02:47 It doesn't change the function at all.
02:49 It changes the wrapper or the stir.
02:51 So if you do this outside of a notebook, what it prints out, let me see if I can somehow communicate this back.
02:59 So if you print it out, what it returns, do I have it here?
03:03 No.
03:03 Yes.
03:04 There.
03:05 No, that's not it.
03:06 Sorry, I don't have it.
03:07 What it prints out is the latex escape codes.
03:09 So it'll say like backslash frack of, you know, like it's a weird, I don't know how to write latex.
03:16 I did a little bit when I was studying math and then I said, that's something I never need to remember.
03:20 And, you know, shot it out of my brain.
03:24 Never again.
03:25 Yeah.
03:25 Like, why do I need to know this?
03:26 I don't need to know this.
03:28 Yeah.
03:28 So the wrapper is just the latex escape codes and then the notebooks see that and then they render it as latex.
03:36 That's pretty cool.
03:37 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.
03:46 You can just see, did I get it right in code?
03:50 So, yeah.
03:51 It's pretty cool.
03:51 That's really interesting.
03:53 Yeah.
03:53 Could you round trip it, right?
03:54 Yeah.
03:54 I'm assuming people are doing this on their own code.
03:57 So they're, you know, I guess you could grab somebody else's.
03:59 It's the question about the inverse.
04:00 Yeah.
04:01 Right.
04:01 It's like, hey, if I have the math symbols, could I turn this into a Python function?
04:06 I mean, I don't see why I can't go both ways.
04:08 Sure.
04:08 Yeah.
04:09 True.
04:09 But I still think it would be easier to write the Python function than the latex code for rendering it.
04:14 Yeah.
04:14 That's true.
04:15 I think it's a pretty niche use case.
04:17 Well, you know, I'm sure.
04:18 Well, I'm sure someone's going to find a cool use case for it too, right?
04:22 Yeah.
04:22 This is pretty interesting.
04:24 We've got a couple of live comments.
04:27 Madison.
04:28 Hey, Madison.
04:28 Out in the audience.
04:29 Madison's been on the show before.
04:31 I'm blown away by how libraries like this are able to make math approachable.
04:35 I wonder how this could be used with auto-generated documentation.
04:37 Very cool.
04:38 I agree.
04:39 And Henry also says, I'm guessing it's working on the bytecode like Numba, but compiling it into a human language.
04:45 Yeah.
04:45 Compiling it into the latex escape codes.
04:48 Which is not human.
04:49 Yeah.
04:50 Which is the opposite of unilateral, but it is text, right?
04:53 And, you know, related to this, just.
04:55 Oh, yeah.
04:57 Henry.
04:58 Sempai.
04:58 Okay.
04:59 It's using inspect, get source and parsing the AST.
05:02 Yeah.
05:03 Perfect.
05:03 Another thing that's amazing, if people check out like the Sempai stuff,
05:07 it does some really, really interesting things.
05:11 Like if you go, say, to like calculus, you take a limit here.
05:15 It'll do similar outputs as well, right?
05:18 So you could put in this, and it'll actually express it as symbolic math, and it won't lose
05:24 precision because it solves it symbolically.
05:26 And you can say like, you know, back to this equation.
05:28 So that's kind of related.
05:30 But this just says, given any arbitrary Python function, not written in the symbolic form,
05:36 just turn it into a latex, which is pretty amazing.
05:38 So anyway, thank you, Brian Skin, for pointing that out.
05:41 That is pretty neat.
05:42 One final comment.
05:43 I could not get it to install on my Apple Silicon Mac.
05:47 Maybe that detail matters.
05:48 But I couldn't get it to pip install.
05:50 Out of PyPI, I had to pip install the Git plus the GitHub URL, and then it would install.
05:57 I don't know why, but if people want to play with it, that might be necessary.
06:00 Okay.
06:00 Yeah.
06:00 Over to you, Brian.
06:02 All right.
06:03 Well, while we're talking about math, I'm often working in the measurement world,
06:08 and where we care about prefixes a lot.
06:11 And a lot of people do, with big numbers or small numbers.
06:14 And this was actually suggested to us by Avram.
06:19 And I think he either works on this, or it's his project.
06:23 It's a project called Prefixed.
06:25 And what this does is it's just, it's a class, it provides a class called Float, capital F,
06:32 that is a, derives from the built-in float.
06:37 And it supports scientific decimal, or scientific and, yeah, IEC, which I'm not familiar with,
06:45 prefixes.
06:46 So things like scientific, like K and S and things like that.
06:52 If you go look at all the metric prefixes, you've got, like, there's some new ones, but
06:57 N, K, Mega, Giga, things like that.
07:00 And it just, so it adds these onto when you print them.
07:05 So it acts just like a normal float.
07:06 Most of the time, you can, you know, use it in math equations and everything.
07:11 The interesting thing is, if it is used in math, a math equation, the result will be
07:17 one of these prefix float types.
07:21 But then the nice thing about it is when you convert it to a string, it includes the little
07:26 prefix thing or the suffix or whatever, the little micro or K or M or something like that.
07:33 So I think this is actually super helpful.
07:36 I'm going to use this right away because I, you know, I use a lot of, like, big and small
07:41 numbers and reporting out just the huge thing or just the float is sometimes horrible to compare
07:48 with.
07:48 So this is, this is pretty cool.
07:50 It's very clever.
07:51 I love how, how simple the idea is.
07:54 So you can just F string one of these floats and say colon 0.2 H and that'll convert it to
07:59 its, and the H tells it to be either, you know, Killa or Micro or Mega or, you know, whatever
08:05 suffix is needed.
08:07 That's cool.
08:08 And then there's a, the byte example where they said, well, I'm going to, I'm going to
08:12 use the capital B for bytes, but that's after the, the formatting of the number.
08:17 And then the K comes in from the float thing.
08:20 So that's, that's pretty cool.
08:22 one of the other things that he passed along is there's some new prefixes.
08:26 So this is, this is apparently new, new scientific prefixes over the last, for
08:33 the new first ones, new, new ones for the last 30 years, apparently.
08:37 So we have, 10 to the 21st, which is Zeta and 10 to the 24th, which is Yada.
08:44 And, then negative is Zepto and Yocto.
08:47 So these are fun.
08:48 Maybe why, why now?
08:51 Why they, they decided to like need to, they have more money now and they need to come up
08:56 with new, prefixes or exactly.
08:59 I'm not sure why we need new prefixes, but our microscopes can now see smaller things.
09:04 We don't have words for this, that things are this small, like, yeah.
09:08 But, national debt, maybe.
09:11 yeah, very possible.
09:15 But, but also Avram notes that prefixed does handle these new ones.
09:20 So cool.
09:21 Good job.
09:21 Cool.
09:22 One thing, Python too, you can put the underscore, right?
09:24 To like, if you put underscore on the thousands, that also, that's something that makes it easier,
09:29 I think, to, to, to read the numbers too.
09:31 That's what I was using.
09:32 Yeah.
09:32 Like the digit grouping.
09:33 Yeah.
09:33 Yeah.
09:34 Do you do that a lot?
09:34 Not a lot.
09:35 I, but like some, whenever I can, I do, I think it makes it easier to, to distinguish
09:41 how big the number is, I guess.
09:42 I always forget to, I just, I know it's there, but I never use it.
09:46 but I think usually it's like when I'm counting the zeros with my finger on the screen,
09:50 I'm like, no, no, maybe I'll just put a underscore there.
09:52 It makes it makes everyone's life easier.
09:54 Yeah.
09:54 Yeah.
09:55 I've really started doing that a lot the last couple of years, but before then I didn't.
09:59 Cool.
09:59 Well, what is next?
10:00 Merlot, what you got for us?
10:02 I think that's me.
10:03 I think that's me.
10:04 Yeah.
10:04 Yeah.
10:05 DBT.
10:07 Have you ever heard?
10:07 Of course you got to accept, you got to accept some cookies.
10:09 Hold on.
10:09 Oh, my bad.
10:11 My bad.
10:11 Just kidding.
10:12 No, I'm just teasing.
10:14 These cookie things drive me crazy, man.
10:16 I don't know.
10:16 Yeah.
10:17 Yeah.
10:17 Yeah.
10:17 Yeah.
10:17 Yeah.
10:17 I think it's like, it's crazy how like now that it's popping up everywhere and then you
10:21 see like the data, the gathering all the time and this and this and it's like, okay.
10:24 Yeah.
10:24 Yeah.
10:25 but maybe DBT, have you ever heard of DBT?
10:27 Is this something?
10:28 Cause in the data world in my, my field, it's super popular, but, I don't know if it's
10:32 a bubble as well.
10:33 I've never heard of it.
10:34 Michael never heard.
10:35 Yeah.
10:35 I think I've, I think I've heard of it, but I couldn't tell you what it does.
10:38 So I was basically in the same spot.
10:40 Yeah.
10:40 Tell us about it.
10:42 No, it's a, it's a really cool tool.
10:43 It's open source as well.
10:44 They have their cloud, option, I guess.
10:46 Right.
10:46 So you can pay and they host it.
10:47 maybe a disclaimer as well that I never, I always see it and I always want to use it,
10:52 but I haven't found the use case.
10:54 So I don't have first-hand experience here.
10:56 but basically the way I would describe is that they add best practices around SQL projects.
11:01 So why am I, why am I mentioning this on Python bites?
11:04 it's built with Python.
11:06 Yay.
11:06 and the other thing too is that, yeah, they actually mix Jinja with SQL.
11:12 Right.
11:12 So you can actually do four loops.
11:14 You can do stuff like that.
11:15 So you don't have to repeat every time and just change the variable.
11:17 you, they also have these like reference macros and stuff.
11:20 So you can actually say, okay, this comes from that table that is on that file.
11:24 And this comes from this.
11:24 So you can actually chain a lot of these dependencies, right?
11:27 Like there's a lot of projects that you have this ETL stuff, right?
11:30 So you just have to basically transform it each step.
11:32 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.
11:40 wow.
11:41 Yeah.
11:42 So it's super cool.
11:43 They actually support a lot of like data platforms here.
11:45 Right.
11:45 So you see like big query data breaks, snowflake, all these things as well.
11:49 another thing that they also more things they do.
11:53 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.
12:00 And you want to make sure that that always happens.
12:02 And if it doesn't happen, you want to be flagged.
12:04 Right.
12:04 So that's super cool.
12:05 what else?
12:07 Ah, you also have some built-in documentation.
12:09 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.
12:15 So that's also super cool.
12:17 And recently actually, they actually started supporting, so like an SQL file kind of corresponds to a model, right?
12:23 Cookies again.
12:24 and, so they have SQL models.
12:27 So that's the, the one, but they also started supporting Python models.
12:30 Right.
12:30 So this is very tight to data.
12:32 So now you can actually mix and match, right?
12:34 You can say this step, this transformation is in SQL, but this one is actually in Python.
12:38 Right.
12:38 So the way they don't run anything on the machine, they actually send it to the cloud.
12:42 So snowflake has snow park, which is Python on its own snowflake.
12:46 big query has spark and Databricks as well.
12:49 Right.
12:50 So basically you can mix and match this transformation.
12:52 See, this transformation is there, but everything is like in a nice put in one place.
12:56 And because it's on Git as well, you can have CICD.
12:58 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.
13:05 So, and it's all in Python.
13:07 So super cool.
13:07 Wow.
13:08 That's really neat.
13:09 So what do the Python models look like?
13:11 Are they straight Python classes or are they Pydantic or?
13:15 I have, I watched, maybe I'm a bit lazy because I just watched the video and they were, they were showing here.
13:20 how, how it works.
13:21 Cause it's also doing a comparison, right?
13:23 maybe this is, can this, no, this doesn't work.
13:25 Does it?
13:25 Yeah.
13:25 It works.
13:26 no, this works.
13:27 Yeah.
13:27 It was wrong.
13:28 Okay.
13:28 this is, but the quality is horrible.
13:30 But in a nutshell, you have this basically, yeah.
13:33 You define a function.
13:34 Yeah.
13:35 You define a function that has a DBT and a session and then you create a reference.
13:38 So reference basically a table, right?
13:39 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.
13:45 Right.
13:45 So there's still some caveats, right?
13:47 Cause Panda is not super performant depending on how much data you have and whatnot.
13:50 So sometimes you probably still want to stick to, the SQL stuff, but then it opens a lot of possibilities there too.
13:56 Right.
13:57 So even stuff like deploying machine learning models on the SQL infrastructure and everything.
14:01 So, yeah.
14:01 So it's, kind of the same old, same old story.
14:05 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.
14:11 And then you would just do a sort of an update statement instead of pull back 10,000 models, change something and call save 10,000 times.
14:17 Right.
14:17 Like it's probably that kind of trade off, but it's really cool.
14:20 That you can bring it back into Python this way.
14:22 what are you using it for in your work?
14:25 Or like, what are you interested in using it for?
14:26 Well, I think we have a lot of these like ETL pipeline stuff, right?
14:30 A lot of these, we have some data here and then we want to like basically clean it up and make sure it's all uniform and put in a dashboard, calculate some KPIs and whatnot.
14:38 Right.
14:38 And so business people can see, are we doing better?
14:40 Are we making more money or not?
14:42 Kind of.
14:42 and like a lot of the times it's just SQL, right?
14:45 It's also more accessible for a lot of people.
14:47 So we stick to SQL.
14:48 but there are also limitations, right?
14:50 But before what I've seen is, people just kind of go in the UI and just execute stuff ad hoc.
14:55 Right.
14:56 So no versioning, nothing.
14:57 And I think this kind of puts everything in one place.
14:59 You can even add CICD because the CLI tool and everything, and just kind of make sure that everything goes to that versioned method.
15:04 Let's say, I mean, and again, yeah, if you need something more, more fancy, right.
15:08 Then you can throw some Python stuff in there, but usually we try to avoid it, to be honest.
15:12 I can imagine.
15:13 Oh, let's see here.
15:14 hold on.
15:15 Yeah.
15:16 The models, the, the way you express the code, it's like, it's really nice looking for SQL, which is surprising.
15:22 Right.
15:23 This, this code you write, like with customers as select these fields from this, this table.
15:28 And yeah.
15:29 And they have a, they also have like the different macros and like people can write different macros.
15:33 So like the describe function in Pandas, someone can just have written that and you can import that.
15:37 And like, it's, it's really nice to share like all these things as well.
15:40 So super cool.
15:41 Really, really eager to, to give it a try.
15:43 To be honest, I've been just like trying to scratch that.
15:45 Like scratch that.
15:46 Where's the next, where's the next project that we get to use this on?
15:49 Indeed, indeed, indeed.
15:50 Yeah.
15:51 All right.
15:51 Brian, anything you want to add before we jump over to, talking about our sponsor real quick?
15:56 Yeah, let's, no, let's talk about our sponsor.
15:58 All right.
15:59 So, today's episode of Python Bytes is brought to you by Microsoft for Startups Founders Hub.
16:05 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.
16:13 And they came up with Microsoft for Startups Founders Hub.
16:15 The Founders Hub provides all founders at any stage with free resources to help solve startup challenges.
16:21 The platform provides access to expert guidance, skilled resources, mentorship, and networking connections, technology benefits, and so much more.
16:29 Founders Hub is truly open to all.
16:31 You don't need to be investor backed, but you can be.
16:33 Speed up development with free access to GitHub and the Microsoft Cloud.
16:37 You can unlock credits over time.
16:39 And there's also discounts and benefits from innovative companies partnering with Founders Hub, such as OpenAI.
16:45 You'll have access to mentorship, their mentorship network, which includes hundreds of mentors across a range of disciplines.
16:52 Need advice on marketing, fundraising, idea validation?
16:55 There's tons of topics, including management and coaching.
16:57 You'll be able to book one-on-one meetings with the mentors, many of whom are former founders themselves.
17:04 It's no longer about who you know.
17:06 Get critical support you need from Microsoft for Startup Founders Hub and make your ideas a reality today.
17:13 Join the program by visiting pythonbytes.fm/foundershub 2022.
17:18 That link is also in your show notes.
17:20 Yep.
17:20 Thanks, Microsoft, for keeping us going strong.
17:22 All right.
17:23 What have I got next?
17:25 This one is a chain of really cool things.
17:27 So, Roman Wright of Beanie Fame and other things tweeted about this project that Pablo Galindo Salgado has been working on.
17:37 So, Pablo was the release manager for Python 3.11.
17:40 It was part of the live stream of releasing.
17:42 That was all fun.
17:43 But he also, I believe, works at Bloomberg, where they work on memory.
17:47 And I think we spoke about memory quite a while back, Brian.
17:50 It's a memory profiling tool.
17:53 Maybe.
17:54 Merlo, do you use profilers and that kind of stuff in your world?
17:58 No, I haven't used much.
18:00 I haven't had a need, to be honest.
18:01 Not yet.
18:02 I feel like so far, there's no...
18:05 Try to keep it simple.
18:05 So, a lot of times profilers are about performance.
18:10 Like, how fast did this code run?
18:11 And if it's slower, should I look at this loop or that loop?
18:14 Or, you know, where do you spend your time making it faster?
18:15 Because it's really surprising when you look at code.
18:18 You're like, this part looks complicated.
18:19 So, that must be the slow part.
18:20 Like, no, that doesn't matter.
18:22 Nothing you do to that will make any difference.
18:23 You got to look over here, right?
18:24 That kind of stuff.
18:25 But memory, as the name would suggest, is more about memory profiling and, like, talking about,
18:31 you know, how many of these different things have you allocated and those kinds of things.
18:35 What is coming?
18:36 Well, first, let me pull up.
18:38 We have a pytest plugin, which is super cool.
18:42 So, with the pytest plugin, you can do two things now.
18:46 You can say pytest --memory tests.
18:50 And it'll tell you things like, you can actually set limits on how much memory can be allocated for a certain operation.
18:57 And if it exceeds that, it'll say, oh, my gosh, there's something wrong.
19:00 This thing is, like, way over using the memory we expected.
19:03 So, that's an error.
19:04 But it also gives you, like, a cool emoji-filled summary, I guess.
19:10 Like, total memory allocated, the number of allocations, a histogram of allocation sizes.
19:16 So, like, Python memory has, like, size classes.
19:19 We've talked about its block arena, one other term.
19:23 I'm forgetting.
19:24 Like, that it uses to organize data structures.
19:26 And then you can actually get it overall, then, for individual tests.
19:30 And so, it'll tell you, like, the different things that were, you know, allocated.
19:34 And anyway, it's pretty insane.
19:37 Okay.
19:37 So, you can get that report.
19:39 And then you can also, where's the other one?
19:41 I think it's, where was it?
19:43 There's a place where you put a decorator, and you just say, on this test, if it exceeds this amount of allocation, that should fail the unit test.
19:51 It's just a pytest.mark.memorylimit or something.
19:54 I don't think it's a limit or memory limit.
19:56 I can't remember exactly what it's called.
19:58 You can say, if this test exceeds one megabyte of memory allocation, then that's a failed test, which is pretty cool, right, Brian?
20:05 That's really great.
20:07 So, yeah, they have a limit memory decorator and a check leaks decorator.
20:12 That's the one.
20:13 So, the check leaks is the new thing.
20:15 And so, what you can do now is you can say pytest.mark.checkleaks as a decorator on your test.
20:21 And if there's a memory leak in the code that runs during that, it will let you know.
20:25 Wow.
20:26 I don't know if anyone else has tried to track down memory leaks.
20:28 I would rather track down, like, a multi-threaded race condition than a memory leak.
20:33 I don't want anything to do with memory leaks.
20:35 This is no fun.
20:36 And so, if I can do it with a decorator, let's do it.
20:38 Well, and also decorating your test so you're not having to modify your code at all to do this.
20:44 I mean, the code under test, you're modifying your test code, if at all.
20:47 Or it looks like it gives you some benefits even with no modification.
20:51 It's pretty cool.
20:52 Maybe, pardon my ignorance here, but when would I worry about memory leaks in Python?
20:57 I think, so imagine you're writing pandas, right?
21:02 And you've written a bunch of C code that's getting imported.
21:06 And you know there's a memory leak in there somewhere.
21:09 And it's just like, okay, well, I don't really know how to do it.
21:14 But then it's more like the C part is the bandage.
21:18 You can also have memory leaks in the sense that you expected there to be no more things
21:23 allocated after the function was called.
21:25 But you could have signed it to a global variable or you could have, you know, stored it, held
21:30 on to a reference in some way that you weren't expecting.
21:33 So, it's not a leak in the super traditional sense, but it could build up if you're doing
21:38 something wrong in Python.
21:39 But certainly outside of that.
21:40 So, I think this is pretty cool.
21:42 Really, any long-running service is going to have, you're going to be concerned about
21:47 it.
21:47 There's a lot of Python applications that are short-running and it just cleans up after
21:52 itself when it's done.
21:52 So, there's cases, long-running services, also things like maybe you care about, things
21:58 that are using large amounts of data and need all of the data that they can get a hold of
22:04 without wasting any.
22:05 That's important as well.
22:08 Makes sense.
22:09 I'm also wondering.
22:10 If you're right at the limit.
22:11 Yeah.
22:12 No, sorry.
22:12 Go ahead.
22:12 Go ahead.
22:12 Yeah.
22:13 If you're right at the limit of like, I'm using 15 and a half gigs and I don't have more
22:18 than that.
22:18 So, I need that.
22:19 Or like, I just checked the Talk Python training site has been running for seven days and one
22:23 hour.
22:24 Yeah.
22:24 Like, if it had a memory leak, you know, it's even if it's, you know, 100 kilobyte here
22:28 and there, like it could turn out to be like a big hassle.
22:30 Okay.
22:31 Cool.
22:31 I'm wondering if you could use this for edge device stuff.
22:35 If we're going to limit the memory because we know the edge device won't have that much.
22:39 That's actually a really good point.
22:42 Oh, yeah.
22:42 Because if you're on one of these like CircuitPython little boards, they've got like 256k of RAM.
22:48 And that's very different than 16 gigs, isn't it?
22:51 Yeah.
22:52 Yeah.
22:52 Right.
22:53 So, you could test your application on a larger computer and limit how much memory
22:58 you give it.
22:58 Right.
22:59 Yeah.
23:00 I think you would want to do that with the limit rather than the check leaks, but still.
23:03 Yeah.
23:04 So, it's the same.
23:04 Yeah.
23:05 Cool.
23:06 Yeah.
23:06 Awesome.
23:06 All right.
23:07 Let's see.
23:07 A couple of comments from the audience.
23:09 Gareth out there.
23:10 Hey, Gareth.
23:10 Says, I ended up writing Docker containers that swapped out every couple hours to solve it.
23:14 I mean, that's actually what a lot of people do.
23:16 They're like, you know what?
23:16 If it runs more than 12 hours, it's a problem.
23:18 So, we just tell it to recycle itself.
23:21 And then Madison says, this is so cool.
23:23 I need memory profiling all the time with some of the data I do work with regularly.
23:26 So, people are digging it.
23:27 Cool.
23:28 Yeah.
23:28 Very cool.
23:28 So, thank you, Roman.
23:30 I know you didn't send that to us on purpose, but you shared it with us anyway.
23:33 Thanks.
23:34 Nice.
23:34 Over to you, Brian.
23:35 Okay.
23:36 Before I get on to the next topic, I want to point out that Henry Schreiner, I'm going
23:41 to paraphrase him by saying, Brian, you dork.
23:44 You didn't even read the article.
23:45 Yes, you're right, Henry.
23:46 Sorry.
23:48 So, the new prefixes, I was showing the previous new ones in 91 when they added yocto and zepto.
23:56 These are not the new ones.
23:57 The new ones are down here with ronacueta, ronto, and quecto.
24:04 Yes.
24:05 The reason why those sounded familiar is because they've been around.
24:09 These new ones, they're the new ones.
24:11 Okay.
24:11 So, thanks, Henry, for clarifying that.
24:13 But on to the next topic is Will McCoogan says, please steal my source code.
24:20 So, he wrote an article.
24:23 Will McCoogan wrote an article, stealing open source code from Textual.
24:27 And he says, I would like to talk about a serious issue with free and open source software.
24:33 Stealing code.
24:35 You wouldn't steal a car, would you?
24:37 And then, actually, he has this funny video that he embeds about how digital piracy really
24:43 is like stealing.
24:44 And it's sort of a funny video.
24:47 But the comment is real that, like, you need to, you can steal code from open source projects
24:53 as long as you can.
24:55 So, please read the MIT license or read the license to make sure that you can.
25:01 And in a lot of cases, you can.
25:03 So, like, I'm going to give an example that I use a lot is I'll think of something that I
25:09 want to do.
25:10 Like, I'm interacting with a library and maybe I don't quite get how to do that with the
25:14 documentation.
25:15 I could search GitHub for projects that use that library also as an example.
25:19 And so, that's a way to look at other source code of how to interact with a project that
25:25 maybe doesn't have the greatest documentation.
25:27 You can see how it's done.
25:28 I've honestly never thought to do that.
25:31 That's a great idea.
25:32 I'll go look at the tests and stuff.
25:34 I'm like, these tests suck.
25:35 There's not a single one that shows me, like, this use case that I'm looking for.
25:39 This is brilliant.
25:41 Some of the, yeah, I do that a lot with pytest plugins because I look at how other plugins
25:47 are testing their stuff.
25:48 And I'm like, oh, how do they do it?
25:50 So, the warning there is he's not advocating for piracy.
25:55 Open source code gives you explicit permission to use it.
25:59 And if you're actually just copying the whole thing, you probably should reference it and
26:04 use the same license.
26:05 Or if you're copying large chunks.
26:07 But the MIT license, for example, says it's substantial copying.
26:11 So, a little bit of copying is fine.
26:13 And Will says, Textual has some cool stuff in it that you might want to look at.
26:18 So, he's got a loop.
26:19 He points out some things you might want to steal.
26:22 The loop first and last.
26:23 So, he's got a loop iterator that he's got a couple versions of it that will not only
26:29 iterate through things, but it'll give you, it'll note which one's the first and the last.
26:35 So, if you need to do something cool on something different on the first and the last one, do that.
26:40 He tweeted recently or tooted or whatever about the LRU cache as well.
26:46 So, the Python's got a built-in LRU cache, but everything's global.
26:49 So, you can only kind of clear.
26:51 There's limits on how you can interact with it.
26:53 So, he has a more flexible LRU cache.
26:55 He's got a color class that looks pretty cool that you can convert to different color representations.
27:01 That's pretty neat.
27:02 And then, you know, he's been working on a ton of geometry stuff, 2D geometry.
27:06 So, he's like, you might want to use this for whatever 2D geometry you're using.
27:10 And so, here's there.
27:11 So, kind of cool, a reminder that open source, one of the benefits of open source is you get to see the source and learn from people.
27:18 I like it.
27:19 I love your idea.
27:20 You've never done that.
27:22 I'm like, it might dance.
27:24 I just can't figure this out.
27:25 Oh, how are other people using it?
27:27 So, I do that a lot.
27:28 I just get frustrated and go into a new library.
27:30 This one sucks.
27:31 I can't do this.
27:31 I'm going to find another one.
27:32 It's not good enough.
27:33 Merlo, are you an open source thief?
27:35 Do you do this kind of stuff?
27:36 I have to admit, yes.
27:38 Yes, I am.
27:38 Stack Overflow thief.
27:40 Open source thief is just, especially in the early, early days, right?
27:44 But I think with rich stuff too, it's very inviting for you to steal code.
27:49 Because even on the rich package, right?
27:51 Like if you do Python-M rich table or whatever, you always show some really nice stuff on the terminal, right?
27:58 And I was like, how does he do that?
28:00 Or like, I think for every component, he had a little demo that you can just run.
28:04 And it's very tempting.
28:05 Even if he didn't want people to steal stuff from him, I feel like you have a hard time just keeping the thieves away, you know?
28:11 Yeah.
28:11 Yeah.
28:12 Yeah, very cool.
28:13 And funny too.
28:14 I like it.
28:15 Good job.
28:15 Good job, Will.
28:16 Where are we at now?
28:17 All right.
28:18 Off to Merlo's final item.
28:21 Yes.
28:22 This one I had not heard of either.
28:23 And it looks pretty interesting.
28:24 Yeah.
28:25 I mean, it's a, I think it kind of, it's one of the things that I saw.
28:28 I was like, yeah, this makes so much sense.
28:29 Why?
28:30 How come I never, I didn't think of this before.
28:31 But this is Shed.
28:33 I'm a man.
28:34 This is a podcast, right?
28:34 So maybe Shed is, it basically, I think it's related to like bike shedding, shed your legacy code, right?
28:42 So it's like a superset of black, right?
28:45 They call it black plus plus here.
28:47 So they say here, a maximally opinionated auto formatting tool, right?
28:51 So it's all about configuration over, convention over configuration, which is also something that I can subscribe to.
28:57 They have no configuration options, but basically it's a bundling of a lot of tools, right?
29:03 So they have black here, but they also have eyesort and with the profile black, so it doesn't clash.
29:09 They also have pi upgrade, which I think you guys mentioned a couple of times, right?
29:12 Yeah, we did.
29:13 And autoflake as well.
29:14 Autoflake, I didn't know actually before.
29:16 But basically it removes unused imports and unused variables from your Python code.
29:23 So it's kind of like, yeah, that's all I wanted.
29:25 I wish I had this last week.
29:27 There you go.
29:29 Yeah.
29:29 But yeah, it's a one-stop shop.
29:32 And even do like a blackened docs, right?
29:34 So if you have doc strings or markdown or everything, you will take that.
29:37 It will black format that for you.
29:38 So I was like, yeah, this is what I wanted.
29:40 Okay.
29:41 Hold on.
29:41 Blackened docs.
29:42 This is new to me too.
29:44 All right.
29:44 Yeah.
29:45 Let's see.
29:45 So this is black on Python blocks, sample code blocks.
29:49 Yes.
29:50 So if you have rich structured text, markdown, even doc strings, it will format that for you.
29:56 Oh, like you like blackening your readme, for instance.
29:58 Yes.
30:00 Yes.
30:00 Yes.
30:01 Oh, okay.
30:02 This is good.
30:03 Indeed.
30:04 So I have some stuff to talk about at the very end, just a little bit about blogging and writing
30:09 and some platforms and stuff.
30:11 And that's all in Markdown.
30:12 Like I could run this against all of my code samples on my blog to basically auto format all
30:19 code in the blog.
30:19 That would be cool.
30:20 Yeah.
30:21 Yes.
30:22 Exciting.
30:22 The next time I write a book, I'm totally going to use that.
30:25 Yeah.
30:25 Or if you're doing a book.
30:26 Yeah.
30:26 I mean, absolutely.
30:28 So I literally just like yesterday, the day before I was cleaning up some code.
30:34 I finally got, you know, I kind of, I don't do it clean the whole time.
30:37 I get it to work.
30:38 And then I like, you know, then I look at what I did stupid.
30:41 And there's, there might be some imports laying around that I thought I needed because you add
30:46 an import and then you take that code out, but you sometimes forget to take the import
30:50 out.
30:50 So I ran black on everything, of course.
30:52 And then, and then I ran flake eight and I'm getting errors.
30:55 And I'm like, shoot, why didn't black just take those out?
30:58 So now I've got shed and I take those out.
31:00 It does it all.
31:01 Right.
31:01 Like it's, it's great.
31:02 Yeah.
31:02 Because maybe it's the same, right?
31:03 Like your flake eight is like, ah, yeah.
31:05 The unused variable.
31:05 Ah, okay.
31:06 They have to go there one by one, you know, it's like, it feels like there should be a
31:09 nicer way.
31:10 Right.
31:10 Yeah.
31:11 I mean, it's good.
31:12 You have to pay attention to that because your unused variable might be a typo or something.
31:16 You might think you're using it.
31:18 That's true.
31:20 Yeah.
31:20 Or it's like a global variable module supposed to share with something else.
31:24 And it's a library, but in general, I mean, you could probably put like a hash, you know,
31:28 QA or something on it.
31:29 Well, I mean, yeah.
31:29 And also you're, you're, you're testing.
31:32 So your test will catch it if you delete too much.
31:34 So.
31:34 Yeah.
31:36 All right.
31:37 Well, really, really good one.
31:38 Take your code out to the shed and whip it into shape behind the shed.
31:41 That's it.
31:43 All right.
31:44 All right.
31:44 Well, Brian, what else we got?
31:46 Extras?
31:46 I got some extras.
31:47 You got some extras.
31:48 Who should go first?
31:50 You go first.
31:51 Okay.
31:51 Well, the thing that I've been working on is, is by test check.
31:56 And I finally got, and I've been talking about this for like a month because I've been slowly
32:00 pulling this into shape.
32:02 It's almost a complete, not really a rewrite, but I moved everything around and the code's
32:07 a lot easier to read.
32:08 And so it makes me happy.
32:09 And I also changed the API.
32:11 So I wanted to mention to everybody that you can either use, so you can either use from
32:18 pytest check, import check to get this check object, or you can stick the check object as
32:24 a fixture.
32:24 And either way, you get access to everything in the library.
32:27 That's the only thing you have to do.
32:28 And for people unfamiliar, pytest check is a, is a library that allows you to have multiple
32:33 failures per test.
32:34 You know, normally the recommendation is try to fail on one thing, but sometimes you
32:40 need lots of data.
32:40 And I just threw in a little example that uses both.
32:43 So if like it's using HTTPX to grab, grab the status code.
32:47 And as long as the status code is 200, then I can check a whole bunch of stuff.
32:52 I can check to make sure the redirect and encoding is right.
32:55 And check for some, some stuff inside the, I mean, you, you, these could be multiple tests,
33:00 but if it really is, you're checking multiple parts of things.
33:03 And for scientific work that I'm in measurement work that I do, I'm often checking like a tons
33:08 of aspects of a waveform.
33:09 And it's really just making sure the waveforms right.
33:12 And that rightness is multiple checks.
33:15 So use that.
33:16 Anyway, I didn't intend to break anybody, but I did break Brian's skin.
33:21 So Brian came up at the beginning of the article, but he tagged me in a GitHub issue on his project.
33:27 And I looked at it and I'm like, oh, I didn't intend to break that.
33:30 So I fixed it this morning.
33:31 So hopefully if, if anybody gets broken by this, I was not intending to break anybody.
33:37 Just let me know and I'll try to fix it.
33:39 That looks great.
33:40 How about you?
33:41 Merlo, I know you have some as well.
33:42 I'll let you go as well.
33:43 Sorry.
33:44 Maybe.
33:44 Yeah, I feel like I should have opened that.
33:49 I didn't have the link up here.
33:50 But talking about breaking stuff, Flake 8 is not on GitLab anymore.
33:56 And I actually didn't have issues with that because with pre-commit, right?
34:00 You have to specify the repo.
34:01 I already was on GitHub, but I actually heard from people, some people that they heard a lot
34:06 of noise that Flake 8 is not on GitLab anymore.
34:08 And then there was also this video from Anthony that is maintaining, right?
34:11 Pre-commit and Flake 8.
34:12 He was explaining a bit because why, what was the motivation from going from GitLab to
34:16 GitHub?
34:17 And yeah, like what's relatable is that like sometimes you break people's code, but it's
34:22 like, it's not any intention, right?
34:24 But sometimes people can get very heated over these things.
34:26 So yeah, just maybe public service announcement, you know, change your Git repo to GitHub now
34:31 for if you're using Flake 8 as a pre-commit.
34:33 You also had Mastodon.py, right?
34:36 Yes, yes, yes.
34:37 That I did.
34:38 I just, sorry, I flipped the order because I thought it was, it was, it was a segue there.
34:42 Yeah, yeah, yeah.
34:43 I wish I knew about this like a week ago or so.
34:47 That would have been awesome.
34:48 You covered Toot, I think, right?
34:50 Yes, we covered Toot.
34:51 That's right.
34:52 Yeah, yeah.
34:52 So this is, to be very honest, I wasn't the one that found this, was my boss.
34:58 So shout out to Bart if you're listening right now.
35:00 But this is basically just a wrapper around the Mastodon API, right?
35:04 So you don't have to do requests.
35:05 You can usually have like a nice client library there to do all these things.
35:07 So if you want to play around, create some bots, you know, whatever, then yeah, there's
35:12 a nice convenient package now for you to do it.
35:15 Wow.
35:15 This is really cool.
35:16 And it has, you know what?
35:16 Documentations that say what functions it has.
35:19 I love it.
35:19 Documentation.
35:21 Just read the code.
35:23 It doesn't have to be much.
35:24 Like the seven or eight lines of code that are in the readme, like gives you a really good
35:28 boost.
35:28 But it lets you register your app, which is one of the things if you go to the website,
35:32 it'll show you which apps are registered for your access keys on Mastodon, but it won't
35:36 let you create one on the website.
35:38 So here's like a simple create app and just give it a kind of your instance name and what
35:42 file to save the access tokens over to and boom, you're good to go.
35:46 Have you guys already done stuff with the Mastodon or?
35:49 Yeah.
35:49 I, you know, on the stream deck, the thing that controls the stream, I already wrote that
35:53 thing where I, when I pushed the one button, it, it sends out the message automatically that
35:58 this live stream is starting.
35:59 And yeah, it uses, that uses a little bit of toot and mostly just the straight API with
36:04 HTTPX.
36:05 But if I'd known about this, you know, I already used it.
36:07 Now we know.
36:08 Yeah, I know.
36:09 Thanks for sharing that.
36:10 Anything else you want to share before we move on?
36:12 Yes.
36:12 So there are a couple more things, but this one, this is the, the, the, the, the,
36:16 Brazilian enemy that couldn't resist the world cup started.
36:19 I don't know if, are you guys soccer fans or not at all?
36:22 So we've a fun soccer team.
36:24 Here we go.
36:25 See, I go see with the kids and stuff in town.
36:27 Yeah.
36:27 So the, so I'm also in machine learning.
36:30 So a lot of data and like this time of the year, you know, there's a lot of like, oh yeah,
36:34 the AI models are predicting this.
36:35 This one is one from Oxford.
36:37 So I just wanted to give a quick shout out here.
36:39 So they, they have a video on YouTube as well, which is cool.
36:42 They explain the math.
36:43 And I, I will go on a limb here and say they use Python because they even mentioned Metplotlib
36:46 and whatnot.
36:47 But this is basically just a big excuse to say that they predict Brazil to win.
36:50 So, you know, if this doesn't happen, it's all rigged.
36:53 This, the math suggests, the math supports this.
36:56 So Brazil must win this World Cup and anything that is not there, I'm going to be extremely
37:00 disappointed.
37:00 This is really cool.
37:03 People are always looking for like realistic examples to learn and explore libraries and
37:09 tools.
37:09 And this, you know, if you're into soccer and you care about the World Cup, this is great.
37:12 Yeah.
37:13 I think if you, yeah, there's, there's people, people are very creative.
37:16 I feel like there's a lot of uses for it.
37:18 Well, I'm sure this will happen because there's absolutely no corruption in soccer.
37:21 Yeah.
37:22 Yeah.
37:22 For sure.
37:22 Yeah.
37:25 Not at all.
37:25 Not at all.
37:26 Cool.
37:27 Should I just keep going or you want to take over?
37:30 If you got more items?
37:32 Yeah.
37:32 Keep going.
37:32 Take us down the list.
37:34 I have two more.
37:35 Sorry.
37:36 I know you said I could have more than two.
37:37 So you can just wait.
37:39 That's what this whole section is about.
37:40 One.
37:42 So for me as a data scientist or machine learning engineer, we use a lot of notebooks.
37:46 Right.
37:46 And I think they have their place in data science, but there are some tools that don't, don't
37:50 play very nicely with it.
37:51 Right.
37:51 And I think in Git diffs or PRs, they don't, they don't play so nicely.
37:55 Right.
37:55 So this is a, I think it's public preview.
37:57 I want to say, but I haven't actually seen this, but now GitHub is going to start supporting
38:02 notebook diffs.
38:03 So if you have a pull request, they're going to have a nicer rendering of the notebook here
38:07 and you can actually see what the differences are.
38:09 And I think before there was a tool called review and be that you could add to GitHub.
38:13 But yeah, now they're just going to start supporting it.
38:17 So I haven't seen how it looks, but I'm pretty excited about this too.
38:20 One less headache for me.
38:21 Yeah.
38:21 That's excellent.
38:22 Because before the diff would just be like, here's the diff of the JSON file.
38:24 You're like, no, that's not what I want to say.
38:27 And also JSON is just JSON, like just key value.
38:29 So if you just change the order of some keys, it's just like, yeah, you have a lot of changes,
38:33 but it's not, you don't care.
38:34 Yeah.
38:34 Oh, this looks really useful.
38:36 Yeah.
38:36 And maybe one last, if that's okay.
38:39 Yeah.
38:40 Just pull this here.
38:41 This is Lancer.
38:42 So it's another CLI tool.
38:43 I talked about linting before, right?
38:45 So this is another kind of linting.
38:47 And I say kind of, because so, you know, some definition of linting or cleanup.
38:55 Yeah.
38:55 So this is like black, almost like black, but it's the opposite.
38:59 So instead of making your code look nice, it would just make it like a hideous, but working mess.
39:04 Right?
39:04 So these are some of the features.
39:06 It turns all your comments to pit bull lyrics or something safe for work, depending if you want.
39:10 It takes all your variable names and mix into like animal sounds and horribly look similar
39:16 looking characters.
39:17 So like bark underscore bark underscore zero, oh, oh, zero, oh.
39:21 It adds white spaces.
39:23 It adds completely irrelevant comments.
39:26 And the code still runs after these improvements.
39:29 So here's an example.
39:30 You have to hear some comments and everything.
39:34 So before, like nicely formatted.
39:36 And then afterwards, you see some comments like, bada bim, bada boom.
39:40 You know, there's nothing like Miami heat, some alpha characters in your variable name.
39:45 Pretty good stuff.
39:45 Pretty good stuff.
39:46 Again, I must say I haven't used this, but this is a tool that I'm not as excited to use.
39:52 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.
40:00 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.
40:08 You want to make it harder for people to just pick it up and like do something.
40:11 You could hit it with this.
40:13 They'd be like, yeah, no, no, we're just, no, we're just not doing that.
40:15 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.
40:28 And it's just funny that, I mean, that that's actually not gibberish.
40:31 It's just useless.
40:32 it's, it's really good.
40:37 The, the, comments out in the live stream are really great, as well.
40:42 People are enjoying it.
40:43 One of them is it's great for Twitter employees.
40:45 You can maximize your lines of code for review as it's coming up.
40:48 Then you just print it out and you take a sidebar.
40:51 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.
40:58 Like if the word print involves in is valuing code, like, no.
41:01 All right.
41:01 Just, I don't think so.
41:02 So, leave that where that is, but you could, you could put this on top of like, yeah, I'm kind of funky when I write codes.
41:09 It's a little different.
41:09 Let's get used to let's yeah.
41:11 I just, it's a farm.
41:13 It's a code farm.
41:14 Yeah.
41:14 Oink, oink, oink.
41:15 Yeah.
41:16 You can have two sets of books.
41:18 kind of, you got your real repo and then you port use this to, to put it into the actual one that you submit.
41:25 and you're like, I understand it.
41:27 I don't know what your problem is.
41:28 It works.
41:29 It works on my machine.
41:30 I don't know.
41:32 I kind of want to run this on a large code base.
41:35 I like something really complicated.
41:38 Squash all the commits.
41:40 Put force push.
41:41 Like, like textual.
41:43 Release it as textual.
41:45 Oink, oink.
41:45 Or something.
41:48 Yes.
41:48 Yes.
41:48 I love it.
41:49 Cool.
41:50 All right.
41:50 Well, this was, this was a good, a good find.
41:52 Awesome.
41:52 Thanks.
41:53 All right.
41:53 I'll, I'll, I'll make mine quick here.
41:54 So a new YouTube video.
41:56 I talked about how you can install the Mastodon web app on your iPad as a native app, as well
42:02 as on your desktop.
42:03 So, if you're doing that kind of stuff, not there.
42:06 Basically they just released Mastodon four a couple of days ago and all the apps don't have
42:12 features like edit and some of the other features that are there because they're like months behind.
42:17 And so if you install the web app as an app, then guess what?
42:20 It looks like an app.
42:21 It acts like an app, but it has like zero latency.
42:24 So as soon as something is released on the website, you get it, which is pretty cool.
42:27 So people can check that out.
42:28 I saw Madison in the audience, sent over a call for proposals or calling all Pythonistas,
42:36 if you will, for Pi Cascades.
42:38 So Pi Cascades is back in person this year in Vancouver, BC.
42:41 It goes from Vancouver to Seattle to Portland and cycles through that, there.
42:46 But so this year it's going to be in, Vancouver.
42:49 So if you want to go up there and, talk, be part of the conference, good conference.
42:53 So call for proposals are open there.
42:55 Yeah.
42:56 But they're not open for very much longer.
42:57 So, jump on that.
42:59 Yeah.
42:59 I don't remember what the date is, but it is, it closes a Wednesday 30th.
43:04 So what is that?
43:04 Yeah.
43:05 Well, Wednesday.
43:05 Yeah.
43:06 Next Wednesday.
43:06 Yeah.
43:07 Eight days.
43:07 And Madison and I feel an audience.
43:10 Thank you.
43:10 It's put in person this time.
43:11 We, and we really value the first time speakers and atypical talks.
43:15 So get out there and put yourself out there and, and get into public speaking.
43:18 It's not a huge conference, but it's, you know, it's, it's big enough.
43:21 A couple hundred people, three, 400 people, fun time.
43:24 this is just really quick and fun.
43:26 You know, if you're on a Mac, you're not as likely to get viruses sent your way that would
43:32 actually be able to do something like 90% of viruses are written for windows.
43:35 But what's a really interesting fact.
43:37 I just, if you do have a Mac, it turns out 50% of all macOS malware comes from one single
43:42 app.
43:43 Can you believe that?
43:44 What is it?
43:44 Safari?
43:45 No, it's, Mac keeper.
43:48 So if, if you have Mac keeper, it like organizes your files and it'll like clean up your, your
43:55 junky cache and stuff, but apparently it has to take over so much permissions and it is like,
44:00 it can get, I guess, plug in there.
44:02 I don't know what it does, but people can like plug into this.
44:05 And make it to all sorts of horrible stuff.
44:07 So 50% of all malware is written for Mac keeper.
44:10 So if you have Mac keeper, maybe unhabit.
44:13 I recently, as a Sunday, launched a new website that I hope will bring me back to writing some
44:23 more.
44:23 We'll see about how that goes.
44:25 But here I'm, I'm trying a new philosophy on, on blogging, Brian.
44:29 I don't know how you feel about it, but I have a blog been doing it for a long time,
44:32 but like I looked the last article I wrote was like 2020.
44:35 I'm like, Oh, that's not so good.
44:36 And the reason is I would always try to write like 2000 word posts that are really, and I'm
44:42 like, but I could post to Twitter and mass it on all day.
44:45 And it's like, I can just do that.
44:46 That's no problem.
44:47 I don't like fall behind on Twitter.
44:49 That's because these really should be super short posts.
44:52 So I have, I've got this new website that I wrote that are just super short, you know,
44:57 fits on a page type of articles that people can go and check out.
45:01 So, yeah.
45:02 Some of the people, some people are promoting like today I learned things, but short, and
45:07 why not?
45:07 I mean, if you think it, if you think it's going to be a thread, write a blog post.
45:12 Exactly.
45:13 Yeah.
45:13 Yeah.
45:14 So cool.
45:15 So all of these are written, and this is all based on Hugo, which is a, just learned
45:19 about it, but a ridiculously cool static site generator.
45:22 Either of you played with Hugo?
45:23 I use it.
45:24 I love it.
45:24 Python.
45:25 So python test.com is written on Hugo.
45:27 It's ridiculous, right?
45:29 No, you haven't?
45:31 Sorry.
45:31 No, I haven't used it, but I heard of it.
45:33 Yeah.
45:33 Yeah.
45:33 I heard nice things.
45:34 Yeah.
45:34 So you basically just go to your directory of Markdown files and images.
45:38 You just run Hugo dash D server, whatever.
45:40 And then as you write, you have your, your web page open in your browser and automatically
45:45 sees the Markdown file changes or the CSS changes, regenerates it and refreshes your
45:50 browser.
45:50 Just so your browser could be just over there.
45:52 And it's just periodically as you make changes, it instantly refreshes.
45:56 So you don't even go and refresh the page to see how that you just write.
45:59 And the browser just watches and, and reloads.
46:02 It's cool.
46:02 Yeah.
46:02 And I, so you got it so that you just, you just push it, push your changes to GitHub or
46:07 your, or your repo for, and it just appears on your website.
46:10 Exactly.
46:11 Yeah, exactly.
46:12 So that was my, my next thing is then I set up a Netlify free account with CD and SSL custom
46:18 domain name push.
46:19 It just has a prod branch that I connected it to.
46:21 And when I pushed a prod, boom, it just goes there instantly.
46:24 So anyway, people are looking at that.
46:25 That is super cool.
46:26 Push the prod.
46:27 Oh, that's kind of cool.
46:29 I just, I just edit on prod.
46:30 So I just log in.
46:32 I didn't edit over SSH.
46:34 Yeah.
46:34 Just edit on the server.
46:36 The server is the backup.
46:37 Anyway, I have stuff on the screen, but there are no more backups.
46:39 That's just stuff I pulled up while we're talking.
46:41 So no more extras.
46:42 I mean, so yeah, fun stuff.
46:44 People check out the, the, the blog website and the video and apply for speaking at PyCascades.
46:51 Nice.
46:51 Well, I feel like Lancer also was like already really funny, but do you have anything else
46:56 funny for us or?
46:57 I do.
46:58 I do.
46:58 Although I somehow forgot to pull them up on the screen.
47:00 So give me just a second here.
47:01 There's two.
47:02 These are really good.
47:03 Okay.
47:03 These are, these are pretty, pretty epic.
47:05 So this one is called, I think Merlo, you'll, you'll really like this one.
47:11 Cause it has to do with like algorithms and data science and it's called messing with the
47:15 algorithm.
47:16 And it shows this, this dude here, don't mind the thing at the bottom.
47:19 I have no idea what that's about, but see, there's this guy whose face is blurred out in
47:23 UK.
47:24 I think I can't remember where this was.
47:26 I know Berlin.
47:26 And he's got a wagon, like a little red wagon that you pull behind you full of 99 phones.
47:33 Now what he did is he got them all running Google maps and left them open and started walking
47:39 down the street real slow and notice his neighborhood is now red on the map and he got it.
47:44 So it thinks there's a traffic jam and it'll send cars around his neighborhood.
47:47 Nice.
47:48 I want to get one of these so bad.
47:50 And whenever I take my dog for a walk, just walk with the wagon behind me too.
47:54 This is no cars.
47:55 Yeah.
47:56 So good.
47:58 Isn't it?
47:58 Yeah.
47:59 This guy's so ahead of our time.
48:01 He's just like, oh, he's so brilliant.
48:03 Yeah.
48:03 And for his neighbors.
48:05 Yeah.
48:05 The next one, the next one here is going to take a little bit of a, I just got a, I
48:09 got to set the stage.
48:10 Give me a second to set, set the history.
48:11 Have you heard of, you've heard about these motivational posters.
48:13 You go to like a dentist's office and it'll be like an eagle soaring over like a sunset.
48:17 Like if you don't spread your wings, you'll never soar as high as you could or something
48:21 cheesy like that.
48:22 Yeah.
48:22 Well, there's this company called, yes, exactly.
48:24 There's a company called despair and despair creates these, but like in reverse.
48:29 They're called the demotivators.
48:31 Yeah.
48:31 Nice.
48:32 So have you, have you seen these?
48:33 No.
48:34 Okay.
48:34 So here's one like solutions.
48:35 And what does it say?
48:36 It has like a Rube Goldbergian type looking thing here.
48:40 And it says solutions.
48:42 This is what happens when the problem solver gets paid by the hour.
48:45 It's just, it's just out of control.
48:48 Here's one.
48:49 What is this?
48:49 It's a frog wearing with a snail on its head.
48:52 It says collaborate.
48:52 So the best of us have to carry the rest of us.
48:56 It's just like, they're really.
49:00 All right.
49:00 So that brings us to, I feel like this is a Brian's skin show a little bit.
49:04 This, a tweet that he shared here and it, it has the latexify, latexify thing, but recursion.
49:13 And for the recursion, it has that demotivator.
49:15 It's a picture that said recursion.
49:17 Here we go again.
49:17 And then embedded in that is recursion.
49:19 Here we go again.
49:20 It's like that.
49:20 Yeah.
49:21 Like your screen share, you see your own screen.
49:23 Yeah.
49:24 So it's kind of like that poster, but for recursion.
49:26 Yeah.
49:27 I kind of feel bad that people, people that don't get the recursion joke, because they can't
49:31 even look it up because it just, it's redirected.
49:34 It just keeps going.
49:36 Like the definition is the definition.
49:38 That's right.
49:38 Nice.
49:39 All right.
49:39 Well, that's what I got for y'all.
49:40 Well, thanks everybody.
49:42 And thanks Michael, of course.
49:43 And thanks Merlo for coming on the show.
49:45 Thanks for having me.
49:46 It was great.
49:47 Yeah.
49:48 You bet.
49:48 Bye everyone.