Transcript #126: WebAssembly comes to Python
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:05 This is episode 126, recorded April 17th, 2019. I'm Michael Kennedy.
00:10 And I'm Brian Okken.
00:11 And Brian, we have a special guest, don't we?
00:13 Yes.
00:13 Yeah, Cecil, Cecil Philip. Welcome to the show, man.
00:16 Thank you so much for having me on. Appreciate it.
00:18 It's great to have you on the show. You've been on Talk Python. I've been on your podcast, Away From The Keyboard.
00:22 So we might as well round this thing out, right?
00:24 Yeah, we may as well go for the trifecta.
00:25 - Yeah, exactly, exactly.
00:27 So, super excited to have you here.
00:29 We got a bunch of cool stuff to cover.
00:31 Before we get to it, just want to say thank you to DigitalOcean for sponsoring this episode like they do many.
00:35 Check them out at pythonbytes.fm/digitalocean.
00:38 More on that later.
00:39 Brian, there's some really interesting news around Python being used for X, where Xs find the Higgs boson or get the Nobel Prize in economics or something else, right?
00:54 You got a new one for us.
00:55 - Well, yeah, I was actually, I was the last to the list.
00:58 I was surprised nobody else took it, but in the news recently, there's a picture of a black hole, which is cool.
01:05 And it's really neat that there's a bunch of Python involved in it.
01:09 And of course, this is a big team with lots of software and whatnot, but a couple of people did some digging.
01:13 I'm linking to a quick write-up from Mike Driscoll.
01:16 So the Python used to take the photo of the black hole.
01:20 He's referencing a paper, which is a paper from the Event Horizon team.
01:24 It includes references to lots of our favorites, like NumPy and SciPy, Pandas, Jupyter, Matplotlib, and Astropy.
01:33 So yeah, lots of Python used in astronomy and in this black hole picture.
01:38 - That's so cool.
01:39 And the reason this is a big deal is this is literally the first picture of a black hole ever, right?
01:44 - Yeah, one of the reasons why I linked this article as well is it links to a TED talk from a couple years ago, basically of how they took some of the concepts around how this picture was generated.
01:55 Not the technical part, but just in high level concepts.
01:58 And that there's a lot of people involved in it.
02:00 And it's a pretty big deal.
02:02 And I'm looking forward to every time anybody ever asks me for the rest of my life, so what can you do with Python?
02:08 I can say, well, we helped with the entire picture of the black hole thing, so whatever you need it for, we can probably handle it.
02:16 (laughing)
02:17 - That's funny. - Yeah.
02:18 - That's pretty awesome.
02:19 I wonder if it was used in the detection of the gravitational waves for black holes as well.
02:24 So maybe that'd be a nice way to round it out, but I honestly don't remember there.
02:28 Cecil, are you into astronomy?
02:29 - I am a little bit, to be honest with you.
02:31 We actually have the Kennedy Space Center that's pretty close by.
02:34 I'm in Florida for everybody that's listening that doesn't know.
02:36 And so it's definitely something that we'd love to go over and do.
02:39 There's like a little observatory in there, if you remember.
02:42 So it's really kind of interesting to take the little one over and see how excited he gets over stars and planets and those types of things.
02:49 - That's so cool.
02:50 definitely been at Kennedy Space Center as well, taking my daughter there.
02:53 And it's a great place.
02:54 And it's so awesome that Python and all these tools, I mean, this is like the big hitters list of all the data science in Python used for this real cool discovery.
03:03 - Yeah, this is amazing.
03:03 You should definitely get, I can't remember her name at the moment, but the girl that they attributed to taking the pictures on your show.
03:09 - Yes, Dr. Bowen, Bowman?
03:11 Yeah, I almost have it right, Katie Bowman.
03:13 - There you go, yeah.
03:14 - That's right.
03:14 And she, yeah, I've invited her to the show as to talk Python.
03:17 It would be great to have her come and talk about this 'cause it's so exciting.
03:21 You know, what's really unfortunate is there was such a weird internet backlash against her in particular.
03:29 There were so many trolls and other weird stuff.
03:30 For example, I tried originally to reach out to her through Twitter and somebody had set up a fake account with pictures of her and video posts and all sorts of stuff to make it look real, but it got suspended 'cause apparently it was, I don't know what the deal is, you know, sorry that she had to go through that, but it's awesome, the stuff she's doing, which is really cool.
03:49 - Yeah, that's really sad to see.
03:51 We all have a very supportive community in developer relations in general, but you're always gonna have one or two folks that are gonna just try and be nasty for no reason.
04:01 I think what she's done was totally amazing, and I think she deserves all the credit that she gets for it.
04:06 - Absolutely.
04:06 The problem is you take 1% of 1% of 1% of people who are absolute jerks, and then you put them on the internet where they can reach out to you all the time.
04:16 It feels like there's way more jerks than there actually are, Yeah, I still got to deal with it.
04:19 It's a bummer.
04:20 - Definitely.
04:21 - Yeah, cool.
04:22 So Cecil, something I'm super excited about is WebAssembly and the possibility to bring various desktop or native code to browsers, right?
04:33 So you don't have to just go, well, does it compile to JavaScript and run in JavaScript?
04:36 Like WebAssembly means you don't have to, right?
04:38 - Yeah, exactly.
04:38 So just for everyone that might be listening, so WebAssembly essentially is this new standard that's in most modern browsers today.
04:45 And essentially it allows you to target somewhat of a virtual machine, right?
04:50 But essentially it's running in the browser.
04:52 And so if whatever your language of choice happens to be can compile down into WebAssembly, then you can run it in the browser.
04:59 What I actually ran into when I was on Reddit was this thing called Wasimer.
05:03 And what this is, is a project that allow you to take that WebAssembly output, right?
05:08 And run it in a Python application, which is kind of interesting.
05:11 - Yeah, that's like the opposite of what I expected actually.
05:13 - Right, it's actually pretty interesting.
05:14 So this is not Python running on WebAssembly in the browser, although I'm pretty sure there's a few products that can do that.
05:20 This is Python taking the WebAssembly output, the .wasm file, W-A-S-M file, and running it in your Python application, which is interesting.
05:29 So if you think about, again, WebAssembly is, you know, allows us to run these different languages in the browser.
05:35 So if we have these different languages targeting WebAssembly, and then we have a Python module that allows us to run that executable, Essentially, we could run any language on Python, right?
05:45 - Yeah. - Or at least we'll have that ability to interoperate between all these things, just using WebAssembly as that common language, I guess, that we're all speaking. - That's so cool.
05:54 So what we have in Python now is you can compile stuff to C and then use the C extensions and bring it in and run it.
06:01 But this means anything that compiles to WebAssembly can now execute sort of natively in Python, regardless of whether there's decent integration between those two languages.
06:10 - Yeah, I think that's really interesting, right?
06:12 And so this is like the essence of cross-platform software development, right?
06:16 Like when you think about it.
06:17 - You know what I thought about when you said this is like, I was thinking like, oh, this is kind of like Node.
06:20 I can take stuff that used to be on the web, but now I can run it like locally, but running it instead of like JavaScript, I run it like Python, but it takes anything that kind of was on the web, which is pretty wild.
06:31 - Exactly.
06:32 So the folks that are really behind this WebAssembly movement was actually Mozilla.
06:36 And so they already have some implementations of their Rust programming language that targets WebAssembly.
06:41 So I could write Rust that targets, now you know that, that builds down to that, this .wasm file and then run it in my browser.
06:47 So now you imagine I could write something in Rust or C or something like that, that targets this WebAssembly file and I could just run it in Python, right?
06:53 So, you know, if there so happens to be something that's missing or a module that I want to use, like I could totally just bring it into my Python application and just use it.
07:00 - Ooh. - I'm pretty excited about this.
07:01 - Thinking I can use some of the awesome Python testing tools to test my WebAssembly projects then.
07:07 - Yeah, probably too.
07:08 That'd be pretty interesting to try out.
07:10 I ran this a little bit yesterday just to try it out and it actually works pretty well.
07:13 And so now as the WebAssembly community just starts to grow, you can imagine as these different runtimes and languages wanna start a target WebAssembly, you know, that just kind of opens up the world to everybody else, right?
07:23 'Cause now I can just pull those into my Python application and just run them.
07:27 - I love it, this is a super cool find.
07:28 Yeah, I mean, I don't know how much of the, is it this now, but I can see a future where there will be stuff that's like WebAssembly only.
07:35 You know, once the adoption is greater, you're like, oh, that's only available in WebAssembly.
07:39 Like, well, now it's also available in Python.
07:41 I love it.
07:41 And Brian, I think you totally could, right?
07:43 There's an example here that's a Rust function that takes two numbers and returns the values and things like that.
07:48 And then the Python example of calling it.
07:50 So yeah, you could wrap that up in pytest, I think.
07:53 Pretty sweet.
07:53 Yeah, Cecil, that's a really, really cool one.
07:55 The next one I want to talk about is called cooked input.
07:59 And this one is a really cool little project.
08:02 Do you remember Bullet, Brian?
08:04 Yeah.
08:04 Cecil, I don't know if you caught this one, but Bullet is this library that lets you basically create dropdown combo boxes in the terminal with like arrow control.
08:15 So you can like, and scroll bars and stuff.
08:17 So you can say, I would like to get the, ask the user for this, and here's the five options.
08:22 And then the five options is like a dropdown with like the things, and you can like arrow through it and stuff like that.
08:27 And also has some features to say, I want a number from you, like with some limitation.
08:31 So cooked input is like that latter half to the extreme.
08:34 So you can do all sorts of cool stuff.
08:36 And the name comes from the idea of like Python 2, the way you got input from the user was raw_input.
08:41 So validated input is cooked input, not raw input.
08:44 Yeah, that kind of thing.
08:45 - Oh, I like that.
08:46 Nice, nice.
08:47 - Yeah, it's funny, right?
08:48 So the idea is you can ask for all sorts of stuff and it has this cleaning and this converting option and then this validation option.
08:57 So I could go and say, I'd like to say, go to the user and get a string called, I asked the prompt is, what is your name?
09:04 And of course you could do that with input, but here you can specify, like, I would like whatever they type to be transformed to cap words.
09:10 So like if you type your name, all lowercase, or like it'll put just first, capitalized first letters and everything else is lowercase.
09:17 Or you can say like, I would like to get an integer.
09:20 How old are you?
09:21 And the minimum is a one.
09:22 You know, it just keeps asking the question and tells you what's wrong until it gives you the answer.
09:26 So it's a really nice way to get input from the user on the terminal that's like pre-validated.
09:32 - That's pretty interesting.
09:32 So let's say, could I do something like, I don't want to say a very bad word here, use regex and do something like, get like my date formatted a certain way or four numbers inputted a certain way.
09:44 - Yeah, it has all these different validators and some of the validators have to do with dates and other types of things.
09:49 So like, give me an email address, give me a date and you know, give me, you can give an example of like the year, month, day or whatever and it won't let the user go on until they answer it correctly.
10:00 - That's pretty cool.
10:01 - Pretty nice, Brian, what do you think?
10:01 You like it?
10:02 - You're bringing a bullet.
10:03 Is it a reason?
10:04 Is it just a similar project?
10:07 - I bring it up because it's another utility or library that takes just get standard input from the user on the terminal and makes it a lot better.
10:16 - Yeah, okay.
10:17 - Right, it's kind of like, not exactly a competitor, but a similar but different take on that idea.
10:22 - Probably can use them together, like if you wanted to do these free form entries, get it through--
10:27 - Yeah, and then drop down, yeah.
10:29 I wouldn't see why you couldn't do that.
10:30 This also sort of came inspired by Bullet because our listeners are awesome.
10:35 Anytime we mention something that we thought was like, oh, here's this new unique thing we've never heard of, they're like, and here's five other amazing ones you also haven't heard of and talked about yet, right?
10:43 - Yeah. - So pretty cool.
10:44 All right, before we get to the next one, let me tell you all about DigitalOcean.
10:48 So DigitalOcean run our infrastructure, they're really great, super happy with them.
10:53 And one of the things they've recently done is launch their DigitalOcean Marketplace, which is cool.
10:57 So you just go to the marketplace and you say, I'd like a pre-configured Linux machine that's set up to run Django properly, like with micro-whiskey and g-unicorn and all that.
11:07 Or I want a MongoDB server, or I want a ghost server, whatever, and you just say I want one of those and bam, it just creates the whole virtual machine droplet ready to go, pre-configured.
11:16 So they've got like GitLab Enterprise, Nginx, Postgres, Certbot, all that kind of stuff that you might need.
11:23 So quite cool, which is one of the things you can get at DigitalOcean to get started more easily and quicker.
11:28 So check them out at pythonbytes.fm/digitalocean.
11:31 get a $100 credit for new users.
11:33 Brian, you're starting to be a fan of PyCharm these days, right?
11:36 I'm slowly, slowly wearing off on you.
11:38 Is that right?
11:39 Oh, no.
11:39 I've been using it for a while.
11:40 But I use it with VI mode, of course, because I can't unlearn Vim.
11:46 It's just built into my head now.
11:49 So one of the things I've been trying to do is use more Jupyter Notebooks for various presentations and tutorials and stuff, and just playing with stuff, especially with big data sets.
12:00 But it bugged me that maybe there's a way to use VI within a web browser, but I don't know how to do it.
12:06 But I can do it within PyCharm.
12:08 And so the neat thing that I'm announcing right now, I guess I'm not really announcing it, I just wanna highlight it, is that JetBrains and PyCharm, they have announced that they're working with the Anaconda group to get more support for things like conda environments and notebooks into PyCharm.
12:29 And I'm using the 2019.1.1 recently, the most recent build, and the pro version, of course, but it makes it so that I can just edit my notebooks within PyCharm with the Vim emulation, all my normal things that I have hooked up to PyCharm, and it just works great, I love it.
12:48 - That's super cool, and they have a special distribution for PyCharm for Anaconda, which has even better support.
12:54 Now, I don't do much with Anaconda, I'm a fan of it, but I just don't have a use case for it, So I don't know a whole lot about it, but that sounds pretty cool.
13:00 - I don't use it myself either, but I know that a lot of people, especially if they're behind firewalls and stuff, it's just an easier install for other people to put that on there.
13:09 - That's pretty cool.
13:10 Cecil, you ever use PyCharm or being at Microsoft, are you mostly on the Visual Studio Code side of the world these days?
13:16 - To be honest with you, I'm still a big PyCharm user.
13:19 Like I was using PyCharm prior to coming to Microsoft, I still use it a little bit.
13:23 I do use our Python extension for Visual Studio Code, depending.
13:27 - It's getting nicer and nicer, yeah.
13:29 - Yeah, it's getting better and better.
13:30 And people love it obviously 'cause it's free and it's open source and you can contribute back to it.
13:34 But honestly, I'm still a PyCharm guy.
13:37 I think when you think about IDEs versus editors, there's a different use case for those, right?
13:42 And there's a group of folks that just need an editor, making really quick changes or just kind of going through, I guess your run of the mill, edits, builds, view type lifecycle.
13:53 But I think when it comes down to debugging and really getting deep introspection into what's happening into your application, that you honestly can't beat the power of an IDE.
14:02 - Yeah, I'm with you.
14:03 - I'm sorry, Brian, I know you're a VI guy, I apologize.
14:07 - I'm 100% in PyCharm now.
14:08 - You just have it set up in VI mode.
14:10 Yeah, I tried that for a minute, then I was like, whoa, somebody broke my PyCharm.
14:13 I gotta disable this extension here.
14:15 That was when we were playing with AceJump, which is really cool, but that's a different topic for a different time.
14:22 Yeah, so over at Azure, You guys have some interesting stuff going on there.
14:27 And one of the big trends, I don't know if it's really where the world is, but it's certainly where a lot of the hype and excitement is, is around serverless code, right?
14:37 - Yeah, definitely.
14:38 So serverless is where we hide your servers from you.
14:41 I'm like, so it's essentially like, we're just taking the burden away from you in terms of like capacity planning, right?
14:48 So that means that the servers are still there, but essentially all you need to do as a company, as a developer is just, you just need to give us your code or upload it to GitHub or what have you.
14:58 And then we'll take care of deploying it, scaling it and doing all those types of things.
15:02 So again, like you'd have to worry about, this is how many virtual machines I need or this is how much RAM I need and worry about backups and some of those types of things.
15:10 But along with serverless, like you start to see like some interesting workloads that people want to build with them, right?
15:14 So a lot of folks use it for APIs or the mobile backends to your web applications.
15:20 Actually, I found a really interesting article yesterday And this is on dev.2, which is a really cool online community for developers of, you know, this guy that created this serverless solution using Python, and it connected it to a Raspberry Pi to get like telemetry data.
15:35 And so he connected the Raspberry Pi to this other offer we have called Azure IoT hubs, and that allows you to do two way communication to your IoT device.
15:44 And so we connected to that and then we send information over into Azure functions.
15:49 And then now he has like this real time chart of telemetry showing up in web browser, which I thought was pretty cool.
15:54 So the pieces that he has connected to this are pretty straightforward, right?
15:57 So he uses, again, he uses Python, he uses D3 for actually generating the charts.
16:03 - Oh, nice. Yeah, D3 is beautiful, yeah.
16:05 - Yeah, and he has this thing called C3, which I never heard about before.
16:08 So C3 sits on top of D3 and makes D3 easier specifically for creating charts.
16:14 - Okay, nice.
16:15 - If anybody's ever used D3, you know it's not like the easiest learning curve thing.
16:20 You can do more than just create charts, but there's a charting library on top of that, which I think is actually pretty cool.
16:24 But again, this article is pretty interesting.
16:26 Again, it uses Visual Studio Code and the Python extension.
16:29 It uses functions, serverless functions, and it shows you how you can take telemetry from an IoT device, specifically a Raspberry Pi, push it up into the cloud, and now you're getting this real-time telemetry.
16:40 So if you think about it, I don't know, maybe you have a garden in your yard and you wanna have moisture sensor or even a heat sensor or anything like that.
16:48 Like you could start to get like interesting telemetry from your house or from your different devices and then push it up into a real-time chart using Python.
16:55 - That's a really cool use case and I like the way they lay it out.
16:58 What's really interesting to me is the two-way communication.
17:01 Like calling into your Raspberry Pi seems more interesting than it talking out or more impressive, I guess.
17:08 - Yeah, so when you think about it, I mean, messaging is a hard thing to do sometimes, particularly when you're talking about a device that you don't necessarily have close by, right?
17:18 And so definitely IoT Hub helps a lot with this.
17:20 But I think for this particular use case is just using it one way, but you can go both ways if you needed to.
17:24 - Yeah, that's pretty cool.
17:25 I like it.
17:26 So if anybody wants to create a cool IoT thing, here's a nice little write up with Python and Azure.
17:32 - Yeah.
17:33 - What would you create with IoT if you could?
17:36 Like Brian and I talk about this every now and then.
17:37 I always like, it's so cool, but I actually can't think of anything I wanna build that's not already out there.
17:43 What would you build with some sort of IoT stuff if you had some time and energy?
17:47 - I have two coworkers that actually built some interesting things.
17:49 And I think I might copy them, so I'm gonna call them out a little bit.
17:53 So one of my coworkers lives in Tampa, and so he's into barbecue, and he has a professional-grade barbecue grill in his backyard.
18:00 - Okay. - He has multiples of them.
18:03 So we went over to his house one day for barbecue, and I'm like, "Dude, what are all these wires "you have attached to this grill?" He has a sensor attached to the grill that's checking temperature and whatnot, And he had a raspberry pie, could you not, like hanging from the grill that was connected to his Wi-Fi in his house.
18:20 And it was pushing telemetry to Grafana that was running on a server in his house.
18:24 If folks on the letter listening don't know what Grafana is, Grafana is essentially like an open source dashboard.
18:30 You know, you send it some information and it just generates a chart for you.
18:33 So he has this Grafana chart that's like in his house.
18:37 And so he could look and see, oh, well, this is what temperature the steak is.
18:40 and this is what temperature like the sausages are.
18:43 I thought it was super cool.
18:43 - That's pretty awesome.
18:45 Brian, have you come up with any IoT things yet?
18:47 - Actually, I'm intrigued by this whole barbecue thing.
18:49 And it sounds great to me.
18:50 You could even have extra probes in there to just to probe your meat while it's cooking.
18:55 - What's cool with the two-way communication now is that, so now he could look at it and be like, okay, this is hot enough, and then he could turn it down.
19:02 'Cause again, you can do bi-directional communication with your device, right?
19:04 So when you say it's getting too hot, maybe it's not hot enough.
19:08 the IoT device again because it's connected to the temperature gauge, like he could adjust it, but he doesn't have to be right next to his grill.
19:15 That's cool.
19:15 Yeah, and you could do a feedback loop, a control loop, and have like an AI actually cook your food for you then.
19:21 Yes, exactly.
19:23 You could do like 10 good grillings and then just like feed it to like some ML and go, "Do more of that. That was good." I actually like that idea.
19:31 So maybe that's my project now.
19:32 I'm going to have ML cook food for me.
19:34 That'll be awesome.
19:34 That actually would be incredible.
19:36 I would love to have some ML cooked barbecue with you.
19:39 That'd be great.
19:40 All right, the last one is not nearly as fun as machine learning cooked barbecue, but it's pretty useful.
19:44 So in Python, the whole threading parallelism story is a little bit complicated, right?
19:49 We've got threads, but they can only do IO bound stuff.
19:52 They can't really do computational stuff 'cause of the GIL.
19:55 We've got async and await, and that's really even better for IO driven concurrency, but it also doesn't work with the computational stuff.
20:02 So if you really wanna do computational concurrency, you have to use multiprocessing or C or something like that.
20:08 Right?
20:08 But the way you've exchanged data while those are running has been somewhat limited.
20:13 Like certain structures can be shared and you wait for the response to come back from the thing you're running over there.
20:20 So new in Python 3.8, there's a new set of modules called multiprocessing.sharedmemory.
20:29 And the idea is you can create shared memory segments that are directly shared with all the multiprocessing subprocesses that are running in your parallel work.
20:38 So if you're doing any multiprocessing, it's pretty cool.
20:41 And a lot of it's fairly complicated.
20:43 You're like reading and writing bytes directly, which sounds kind of gnarly, but there's also a shareable list, which is pretty cool.
20:50 You can throw stuff on the list, you can pull stuff off the list, and it's shared just like straight shared memory across the various processes, which I thought was a pretty cool addition.
20:58 - I'm wondering, so does it control access to who's writing?
21:01 'Cause I'm guessing multiple people can't write to it at the same time.
21:04 So I'm guessing there must be like some type of control that says this person's writing first and then this person's writing second kind of thing.
21:10 - One would hope there's some serialized like shared critical section or something that doesn't let it like corrupt the shared memory.
21:16 But yeah, it's still pretty.
21:18 I haven't looked, but I would guess so.
21:19 I didn't see anything in the documentation about explicitly programming for that.
21:25 It was just like, you put something in the list, you get something out of the list.
21:27 But I bet internally, it's probably down at the C level or something that's pretty careful about that.
21:32 - Sure.
21:32 At the very least, this is a building block that we can build things like that on top of.
21:35 - It's pretty cool.
21:36 And it's nice to see new stuff coming in the threading world or parallelism world on Python.
21:41 So this is like I said, brand new in 3.8, so it's cool.
21:43 - Yeah, nice.
21:44 - Indeed.
21:45 All right, well, guys, that's it for our main items, but there's always a few extra things at the end to talk about.
21:50 So Brian, what do you got that you want to throw out there?
21:52 - Well, I'm just totally gearing up and getting excited for PyCon.
21:56 I just got my stickers ordered.
21:57 So I'm going to have also bring in a bunch of copies of the Pytest book, try to sell some of those there.
22:04 I only took like four last year and they sold out.
22:06 So I'll bring more next time.
22:07 >> Probably on your way to the booth, right?
22:09 People mobbed you and got your book before you could even set them down?
22:12 >> Yeah, I was going to bring a whole bunch, but it turns out that a whole bunch of books is heavy.
22:16 So I'll bring some.
22:18 >> That sounds good.
22:19 >> Also, I've never done live interviews for Testing Code.
22:22 I think it'd be fun to do some live interviews.
22:24 You've done those before.
22:25 So I'll pick your brain on how to do that best and get some of those set up.
22:29 Absolutely.
22:30 I'm super excited about some live recordings at PyCon.
22:32 I'm sure you and I'll do some open session live Python bites, but there'll also be some other stuff happening as well.
22:38 I actually just bought some two little cool desktop, Mike holders for exactly that to bring to PyCon.
22:44 So we'll see how they work.
22:45 Nice.
22:45 How about you Cecil?
22:46 In terms of sharing.
22:47 So I actually found a workshop online that I thought was pretty cool.
22:51 So, you know, everybody's always talking about machine learning and I want to get into it, but I don't know what exactly I could do with it.
22:58 So I found this interesting Python workshop, and it's called Attendee Detector Workshop.
23:03 So essentially, you go through this process of creating a Flask application, but essentially what you do is you upload a picture of, let's say, a group of people or an audience or the background or what have you, and using machine learning, it'll help you pick out the faces of the people that are in that picture that you put out.
23:23 And then it'll tell you if they're smiling, if they're happy, if they're sad, or what have you.
23:28 So I think it's pretty cool.
23:29 So you can imagine, again, as a speaker, or maybe you go to a basketball game or something, you take a picture, and you can be like, "Hey, I don't really think these people are really interested as to what you're saying or what's going on here." Or, "Hey, somebody just scored some points.
23:42 I'm really super excited about it." But I think it's a really interesting practical application of using machine learning, but also something that's very approachable, because I think it's something that we all could relate to.
23:51 I think that's awesome.
23:52 to get a camera and point it on your audience while you're doing a presentation and just have like a little meter of like audience engagement as like that only you see while you're presenting something unrelated to this.
24:02 - And then it'll show you like the faces of the people that aren't paying attention.
24:04 So you can like walk by them and like stare.
24:06 (laughing)
24:08 - You've been singled out by the AI.
24:10 We have to talk.
24:11 - Exactly.
24:12 I thought that was pretty cool.
24:13 So I put that on the extras.
24:15 Another thing I wanted to talk about too.
24:17 So I've actually downloaded your Talk Python mobile app.
24:21 I have it on my phone, actually.
24:22 - Nice.
24:23 - So I took it with me when I was traveling last week.
24:25 And I actually say, I actually pretty like it.
24:27 I know we've been working on this probably for a while.
24:29 We spoke about doing offline video content and whatnot for your show.
24:33 So I'm really happy to see that this came up, man.
24:35 This is super cool.
24:36 - Yeah, thanks.
24:36 I'm really happy the way it came out as well.
24:38 And it's really fun.
24:39 Even I am experiencing going through my courses differently.
24:43 You might think, well, why would you do that?
24:45 But I have other authors, I'm going through their content, they're going through mine, right?
24:48 Like I'm kind of a student as well.
24:50 And it's super fun.
24:51 We almost have the iOS version out, just the Android currently.
24:54 But yeah, it's super, super close.
24:56 So that was a fun project.
24:57 Let's see, I do have a couple other things I want to throw out as well.
25:00 There's an interesting interview with Guido van Rossum on MIT's AI podcast.
25:06 This was sent over by Tony Cappinelli.
25:09 Thanks for sharing that with us.
25:10 And this is just-- it's not really worth going into the whole thing, but it's a different look at his perspective, like his perspective on science fiction and on machine learning and on just all sorts of stuff.
25:21 So if you've got an hour or something, you want to just catch up with Guido and sort of a historical look on what he did and his accomplishments, it's pretty cool.
25:29 Another one, that's in the whole Microsoft realm, is Visual Studio IntelliCode for VS Code, which is pretty awesome.
25:37 So we talked about some other projects that are like this, but this is, I think, a more legitimate one.
25:43 So IntelliCode is like autocomplete, IntelliSense, but actually is based on the usage of your code.
25:50 So this works for Python among other things, and it goes through like say popular libraries on GitHub.
25:55 So when you go to your, if you install this extension, say VS Code, and you go to, you hit, you know, regex.
26:02 The stuff that shows up in the list first is not just alphabetical, but is actually the most commonly used things for like say popular libraries that use regex and stuff like that.
26:14 It really kind of shows you, and it's contextual as well.
26:17 So it's pretty cool that people can check that out and install that.
26:20 And then finally, my buddy Dan Koster sent me this yesterday.
26:23 It just made me laugh.
26:24 Somebody had gotten-- was running a Craigslist thing and gotten a message.
26:28 Hey, here's my proposal or something to your Craigslist ad.
26:32 Click here to sign up and fill it out or whatever.
26:36 And it turned out to be a complete scam.
26:37 It was like craigslist.somerandomdomain.com.
26:40 And he's like, all right, well, I could just ignore this.
26:43 or I could write a program to destroy this guy.
26:45 And so it's a video of him going through, figuring out where the, like basically what it does is it shows you a fake Craigslist login to steal your credentials.
26:54 So he used requests and some other APIs to actually go and just overflow the guy's database, you know, just generate like a hundred million fake logins and just blast him into his database.
27:06 So that's enjoyable.
27:07 Anyone who feels like a little bit of schadenfreude, you can watch that, it's pretty good.
27:12 - Nice, I love that.
27:13 - Yeah, it's pretty short and sweet.
27:14 It is Python too, so it's a bit of a knock on it, but still, it's all good and funny.
27:19 Speaking of funny, Brian, what do you got for us, man?
27:21 - Okay, well I used our PyJoke, which I probably used it too much, but whatever.
27:26 - You can't use PyJoke too much.
27:27 And Cecil, we gotta tell you, the way we get our jokes these days, sometimes people send them to us, but we found that there's a package called PyJokes, and if you pip install PyJokes, you can just go to your terminal and just type PyJoke anytime you need a developer joke.
27:40 - Are you serious?
27:41 - It's a package and it'll just randomly generate jokes?
27:43 - Exactly, it's beautiful.
27:44 - Do you know if it's like machine learning jokes or is it like just static jokes and they just give you one?
27:48 - I think it's static.
27:49 - Oh, okay.
27:50 - Yeah, it's just a list.
27:51 - But there's quite a few.
27:51 - Here's one.
27:52 To understand recursion, you must first understand recursion.
27:56 - It's very meta.
27:57 - But I wanted to make a comment on that because we teach recursion to new computer science people all the time and I don't use it.
28:04 I never use it.
28:06 It blows up your stack.
28:07 I don't think I've used it once in 23 years.
28:10 and I've never needed a Fibonacci sequence generator.
28:13 That is that.
28:14 - Yeah, I kind of felt that way when I learned CSM.
28:16 Like, this is cool and mind-blowing, but will I ever use this?
28:19 After I saw your comment here, I decided to think about it.
28:21 I probably have legitimately, professionally used recursion like five times.
28:24 - Yeah, I can attest to that.
28:26 I've probably done similar, to be honest with you.
28:28 - It's not zero, but it's not very high given the number of years that I've been doing this.
28:33 Same for you, huh, Cecil?
28:34 - Yeah, 'cause when you think about it, what would you use recursion for, right?
28:36 And it's probably, more commonly, you probably use it for like processing of lists of things, you know, and breaking up lists of things into different pieces.
28:43 And now most programming languages have things that are in the box in their standard library that'll help you do that.
28:48 So I really haven't had the need to go down that rabbit hole.
28:51 - Exactly, I agree.
28:52 All right, I have one for you as well.
28:55 I have two actually, because I had to run Pie Joke as we were talking about it.
28:58 So here's one, I really like this one.
29:01 A programmer was found dead in the shower.
29:03 Next to their body was a bottle of shampoo.
29:06 with the instructions, lather, rinse, repeat.
29:08 (laughing)
29:10 He just did it until they died.
29:11 An infinite loop.
29:14 And then, this one's special for you, Brian, 'cause I just ran it and it came up in Pie Joke.
29:18 How do you know whether a person is a Vim user?
29:20 - I don't know how.
29:21 - Don't worry, they'll tell you.
29:22 (laughing)
29:24 - Well, I use Vim.
29:27 - Oh, man.
29:30 I love our joke segment.
29:31 - Oh, man, this is crazy.
29:35 All right, it is.
29:36 All right, guys.
29:37 Brian, thank you as always.
29:38 Cecil, thank you for being here.
29:39 It was a lot of fun to have you on the show.
29:41 - Sure, definitely.
29:41 Thank you so much for having me on.
29:42 Appreciate it.
29:43 - You bet.
29:44 Bye, guys.
29:45 Bye, everyone.
29:46 - Bye. - Bye.
29:46 - Thank you for listening to Python Bytes.
29:47 Follow the show on Twitter via @pythonbytes.
29:49 That's Python Bytes as in B-Y-T-E-S.
29:52 And get the full show notes at pythonbytes.fm.
29:55 If you have a news item you want featured, just visit pythonbytes.fm and send it our way.
29:59 We're always on the lookout for sharing something cool.
30:02 On behalf of myself and Brian Okken, This is Michael Kennedy.
30:05 Thank you for listening and sharing this podcast with your friends and colleagues.