Brought to you by Michael and Brian - take a Talk Python course or get Brian's pytest book


Transcript #154: Code, frozen in carbon, on display for all

Return to episode page view on github
Recorded on Wednesday, Oct 23, 2019.

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

00:04 This is episode 154, recorded October 23rd, 2019.

00:10 I'm Michael Kennedy.

00:10 And I'm Brian Okken.

00:11 And we have a special guest, Bob Belderbos.

00:13 Welcome, Bob.

00:14 Hi, thanks for having me.

00:15 Yeah, yeah, welcome back.

00:16 Nice to be here.

00:16 Been too long since you've been on the show.

00:18 Yeah, I was a while back.

00:20 Glad to be back.

00:21 For sure.

00:21 Glad you're here.

00:22 So before we get on to other things, this show is brought to you by Datadog.

00:26 Check them out at pythonbytes.fm.

00:28 Datadog.

00:28 All sorts of good stuff happening there.

00:30 Tell you more about that later.

00:31 Brian, I feel like when I'm working on my editors, I'm never done tweaking my colors or picking like the right font.

00:38 And as soon as I get comfortable with one, I'm like, oh, but did you see this one?

00:41 I'm going to switch to that now.

00:42 You have that same problem?

00:43 No, I don't, actually.

00:45 You find them and stick with them, huh?

00:48 I never really thought about the font I use during coding.

00:51 I mean, I do sometimes.

00:54 So I'm nearing 50 years old.

00:57 My eyes are 50-year-old eyes.

00:59 So I do have to do things like make the font bigger and stuff.

01:03 It never occurred to me to try a different font for my editor until I read this article.

01:08 So there's an article called Lesser Known Coding Fonts that talks about some of the benefits and drawbacks,

01:16 or mostly benefits of some of the different fonts out there that I hadn't even heard of.

01:20 There's an APL 385 Unicode font, which actually looks pretty nice.

01:25 Go Mono that was developed.

01:27 I'm not sure if it's part of the Go programming language thing, or I don't know.

01:33 The one that interested me at the end, there's one called Input Mono.

01:39 And there's a professional font designer, Jonathan David Ross, that developed it.

01:43 It's not free, but it's sort of free.

01:46 If it's for your personal use and for coding fonts, that's pretty much your personal use.

01:52 You can just download it and add it.

01:54 And I just downloaded this and added it.

01:56 And I kind of like using it.

01:58 It's easier for me to read quickly.

02:00 And there's a really kind of a nice video called Cracking the Code, where Jonathan himself talks about developing it and basically why he cares about fonts and coding fonts.

02:12 Anyway, I thought it was interesting, especially people that might have trouble seeing their screen or having to push their monitor closer to their eyes.

02:21 Maybe trying a different font might be a good idea.

02:23 Yeah, for sure.

02:24 You know, the thing that I did, I love this article.

02:26 The thing that I did that has made a tremendous difference, and I'm getting older, my eyes are definitely getting less good as well,

02:33 is to get a 4K 32-inch monitor night and day.

02:36 It's made all the difference.

02:37 And it's only made me more obsessive about my fonts, because now they're even more crisp and clear.

02:41 I'm like, oh, now I really got to dial these babies in.

02:44 I love some of the ones mentioned here.

02:45 I use Hack a lot.

02:47 That's a great one.

02:47 SourceCode Pro is really nice.

02:50 But I am just all about the Fear of Code these days.

02:53 Fear of Code with its font ligatures on.

02:55 Okay.

02:56 We should put a link to some of those, because I've never heard of some of these.

02:59 Yeah, I mean, they're referenced, but they're not linked in this article.

03:02 Fear of Code, and I guess all the font ligature ones, are crazy, because, you know, in like math, you were taught that not equals,

03:09 you have the equal sign, you put a line through it, right?

03:11 But we don't have that symbol on our keyboard.

03:13 You would say exclamation mark equals.

03:16 Or if you said less than, you would have like the arrow, and then like the double arrow on the bottom to say less than or equal to.

03:21 When you turn on font ligatures with like Fear of Code, and I see some of the fonts you're calling out here also,

03:26 it has a category of font ligatures, yes or no.

03:28 When you turn those on, it becomes those symbols.

03:31 So like exclamation mark equals is one character on the screen with like an equal and a slash through it.

03:36 Okay.

03:36 That's useful.

03:37 It's really interesting.

03:38 What's cool is it's not changing your code.

03:40 It just changes how your code is shown to you.

03:43 So you're not actually, no one else on your team has to like it or agree with it or whatever.

03:46 But if you like it, it's like, and it does a bunch of cool stuff for like other representations.

03:50 Yeah, I really like this one here at the end that you pick input mono.

03:54 And the input family, it's a huge family.

03:56 And there's even like some non-monos based fonts within it.

03:59 And they're all intended to be good on your eyes while editing.

04:04 It didn't even occur to me to not use a monos based font.

04:07 But sometimes it's nice to have things a little bit more condensed.

04:11 And an eye character doesn't have to take up the same width as a Z, for instance, or whatever.

04:16 That's cool.

04:17 Bob, how about you?

04:18 What's your thoughts on that?

04:19 I have honestly not really used many font types, but I'm really eager to check it out now.

04:26 It's, yeah, as you get older and older screen time, it's definitely fundamental.

04:31 And a big screen I lately started using at work, it makes all the difference.

04:36 So yeah, I'm eager to try it out now.

04:39 Yeah, you might have even a higher res screen than I do.

04:41 You might have 5K or something like that, right?

04:44 Pretty close.

04:46 I'm not exactly sure.

04:47 I have the iMac 27.

04:49 So it's pretty awesome.

04:51 Got some potential there.

04:52 So Mike, you just wrote down fear of code and it's F-I-R-A.

04:57 And yes, I have tried that.

04:58 That's nice.

04:58 When you said it at first, I thought you were saying like fear of code.

05:02 Fear of code.

05:03 You may have fear of code and you may be looking at that code with fear of code, but they're not necessarily related.

05:10 It's awesome.

05:12 Yeah, I love that, that the font literature is turned on.

05:16 And you've got to, even if you enable those fonts, you have to enable your editor to show

05:20 the ligatures, not just the fonts, just so you know, like if you're trying that out.

05:24 Also, another thing that's down here that kind of is blowing my mind.

05:28 I was thinking maybe you pulled up something not safe for work here, Brian.

05:31 It has something on Reddit at slash r slash Unix porn.

05:34 But then I pulled up the link and wow, what a cool place to just flip through awesome stuff

05:39 about Linux, like screenshots and fonts and all sorts of stuff.

05:43 What a weird name for a Reddit channel or Reddit, whatever you call those things.

05:48 It is weird, but man, it's I could just flip through those for a while.

05:50 It's pretty awesome.

05:51 Let's move on to the next one.

05:54 Bob, what do you got for us here?

05:55 You're a fan of Django, right?

05:56 And not a news item per se.

05:58 I think this resource has been out there for a while.

06:01 It's the Django admin handbook.

06:04 It's a free online page and PDF if you subscribe with your email.

06:09 I think the PDF is about 40 pages or so.

06:12 You can just read it in the evening.

06:13 And it's chock full of useful tips and tricks using the Django admin.

06:18 And as a Django developer, you inevitably will be using the admin.

06:23 I use it both for code challenges as well as a project at work.

06:28 And just reading this doc, I learned a bunch of useful tricks.

06:33 I have a couple of favorite, actually.

06:36 Yeah, what are they?

06:37 On the list view of an admin page of a model, I had some expensive property going on.

06:44 And that would trigger a query for every row.

06:47 So what I learned from the book was that you can override the get query set and do like one

06:54 annotated query.

06:55 And so for the whole list view, you then have like one big query instead of a query per row.

07:03 Oh, interesting.

07:04 It's almost like the N plus one problem of ORMs where you have a relationship that you

07:11 should have pre-joined, but you didn't.

07:12 I didn't realize that that was happening in the admin section.

07:14 That's cool.

07:15 Yeah, a bit like select related.

07:16 Yeah, exactly.

07:17 So I used that for a page.

07:19 And yeah, I had the problem with that property and got resolved just reading this document.

07:26 The other thing, a nice little trick there, how to export CSV from a Django admin.

07:31 So you have a lot of data in your database.

07:34 You can just export it to CSV and then dump it in a Jupyter notebook and do some pandas analysis.

07:40 So that's neat to have that interface.

07:43 And another one I liked is overriding the safe behavior for Django admin.

07:49 I used that lately when we did an exercise on the platform and we made an opt-in that people get an email right at the moment that we save the new exercise.

07:59 And for that, you can overwrite the safe method of the model.

08:03 Wow, you're using the admin to trigger like outbound notifications.

08:07 Interesting.

08:07 Yeah.

08:08 So you can just overwrite the safe method.

08:10 And if the object is not yet in the database, then the first time it's created, you do some action.

08:16 And then after that, you added the object and you don't do the action.

08:20 So it's really nice to do that with overwriting the safe method.

08:24 So that's all stuff I got from this document.

08:26 And then I subscribed to my email, got a couple of PDFs more.

08:29 That's a nice resource.

08:31 Yeah, that looks really cool.

08:32 Yeah, awesome.

08:33 Another one that looks really useful is sorting by calculated fields and filtering by them.

08:38 And yeah, a lot of nice stuff.

08:39 Cool.

08:40 Well, before we move on to the next one, let me tell you all about Datadog.

08:43 They're sponsoring this episode.

08:45 They're a cloud-scale monitoring platform built by engineers for engineers.

08:49 And they're tracing client auto instruments, all the good things like Django, for example,

08:55 but Flask and AsyncIO and MongoDB and all that.

08:58 And lets you pivot seamlessly between requests across your different systems.

09:05 So from your database to your web app, things like that, down to the frameworks, get metrics and logs,

09:11 and just visit pythonbytes.fm/Datadog.

09:14 Start a free trial.

09:15 Get a cool Datadog t-shirt to go with it.

09:18 Now, I want to cover something that's kind of major here.

09:22 I'm going to talk about a project that has been in the works, oh, geez, almost 30 years.

09:30 I don't know.

09:30 A very long time, right?

09:32 So I'm going to talk to you about CPython, the code, source code.

09:36 So Anthony Shaw, friend of the show, and we haven't covered that much by him.

09:41 It's probably been a few weeks since we've covered something that Anthony's done.

09:44 And he wrote this article that Bob properly referred to as a book over at RealPython, right, Bob?

09:52 Yeah.

09:52 It's really good over there.

09:55 It's called Your Guide to the CPython Source Code.

09:58 Now, basically, it gets you started by checking out the source code and then talks you through it

10:03 and, like, highlights a bunch of different scenarios and then looks at the CPython source code

10:08 so you understand it better, right?

10:10 Like, the article talks about Python's memory management.

10:13 It says, and here are the objects, and here is the data structure that does X, Y, and Z.

10:17 And it's, oh, look here how it's implemented as a linked list of arenas for small object allocation,

10:23 for example, right?

10:25 We actually talked about that a while ago, Brian.

10:27 And so if you are thinking, hey, I want to understand CPython code better, like the source code of CPython,

10:34 definitely check out this article.

10:37 So I'm just going to talk about a few things that I pulled out that I thought were pretty awesome.

10:40 So first of all, if I want to get the code to CPython, there used to be a bunch of options.

10:46 It was under Mercurial for a while, but now it's pretty natural.

10:50 Gitclone, github.com/Python slash CPython.

10:54 That's it, right?

10:55 I think it's awesome that CPython is on GitHub.

10:57 Yeah, that's nice.

10:58 Indeed.

10:59 Yeah.

10:59 And then how do you compile it?

11:01 Like, something as massive as CPython itself, with all the variations and all the C code,

11:09 you might think it's going to be challenging to compile.

11:12 But he has a bunch of good steps for the three main platforms, macOS, Windows, and Linux, how you go through them.

11:18 On macOS, I did that.

11:20 It took me about five minutes to get the whole thing compiled, set up and compiled, and super easy to follow along.

11:25 So that was great.

11:26 And on Windows, you know, there's a Visual Studio solution project.

11:30 You just open that up, set a few settings, and you're off to the races.

11:34 So getting the source code and compiling it is actually, you know, just a couple of commands on command prompt, terminal, and you're good to go.

11:41 Then one of the things that's pretty interesting is to look at what you get after you check it out, right?

11:47 So let's just maybe talk through the structure of CPython a little bit.

11:51 So you've got, I don't know, what is this?

11:53 14, 13 different directories.

11:56 So if you look at what you get when you get CPython, you get the docs, which is source for documentation.

12:01 You get the grammar on how that's all defined, right?

12:05 It's the thing that's converted by the peg parser into actual parser that you can use.

12:11 All the C include header files.

12:13 And then a lib folder that has all the parts of the standard library that are written in Python.

12:20 And looking through here, I saw a bunch of interesting stuff.

12:23 So there's some cool little hidden goodies.

12:25 I think of them as, so for example, I was looking at the concurrency section.

12:30 So lib, concurrent, futures.

12:32 There's like process.py and thread.py and stuff like that.

12:36 And I'm like, oh, what's the process one look like?

12:38 If you open that up, there's a giant ASCII diagram.

12:42 Inside there that shows you the workflow and the data exchange, like swim lanes and all sorts of stuff in the source code in the comments.

12:50 Oh, wow.

12:51 Yeah.

12:51 Similarly, if you go to like the JSON module, it's got like diagrams in ASCII about what's happening in there.

12:58 I was like, wow, really?

12:59 This is better than I expected.

13:00 Wow.

13:01 So it's super fun to poke around in there and see the parts of the library that are written in Python.

13:06 I also have some other stuff.

13:07 Mac support files, miscellaneous modules.

13:10 This is the opposite of the lib section.

13:12 This is the standard library parts written in C.

13:15 So if you want to see how that works.

13:17 Stuff for the object model, the parser, PC and PC build stuff for Windows,

13:23 programs for source code for the Python executable and binaries and things like that.

13:29 Then actually this Python for the CPython interpreter and tools for standalone tools for building and extending Python.

13:36 So this is what you get.

13:38 And then this article kind of talks you through a whole bunch of it.

13:40 So you can read the article and dig in some more stuff that I don't think we really have time to cover,

13:46 but I thought was pretty interesting was like deeply looking at the Python interpreter process and how that works,

13:52 you know, with the C source code as reference, the CPython compiler and execution loop.

13:59 People don't think of your CPython code as it compiled, but it is.

14:03 It's only just partway compiled.

14:04 It's compiled to the bytecode, the PYC files, and then it's evaluated, not JIT compiled or whatever.

14:11 Looking at the objects and how those are managed in Python and the standard library.

14:15 And then finally, one of the things covered in the article, just like a little minor section of it,

14:20 because it covers so much, it's like, oh yeah, well, let's add actually a new keyword to Python and whatnot

14:25 as like a small part in the parsing section.

14:30 And so if you actually wanted to like do some change and then deploy it and run it,

14:34 it talks about installing like a custom version, like taking this version and installing it and stuff.

14:38 So, you know, as I was going through this, I'm thinking really, you know,

14:42 if you're a professional Python developer knowing this kind of stuff, you should probably know it.

14:47 You should know Python has two types of garbage collection, primarily reference counting,

14:52 but also garbage collection.

14:53 Oh, and when does it run?

14:54 And like, what are the pressures and what are the trade-offs and so on?

14:57 Like this type of reference is what you need to dig down at that detail without actually becoming a core developer.

15:02 That's really impressive.

15:04 The amount of detail and the diagrams and the code.

15:08 I'm really thankful that this article is out there, right?

15:12 Because it can be quite intimidating.

15:15 And here you have this guy that walks you through it with nice graphs and explanations.

15:20 Yeah, for sure.

15:21 I'm going to look into it and set aside.

15:24 It used to be a lot more complicated than it is now.

15:27 So highlighting it in an article that it really is only a few minutes to get started.

15:31 That's really cool.

15:33 Absolutely.

15:33 Brian, what do you got next for us?

15:34 The next one is, I'm not sure why I hesitated.

15:37 Six Django template tags not often used in tutorials.

15:41 And so this intrigued me.

15:43 I'm not a Django expert, but I've looked through several tutorials before and done some, a couple Django sites.

15:50 These are fun and I haven't used them either.

15:52 So the article goes through six tags, but I'm pulling out a few of them.

15:57 So the empty tag, there's a for loop you can do with it with the tagging system.

16:02 So you can iterate through collections or arrays to populate, to fill out your HTML file.

16:09 But if there's nothing in the array, you can have an empty section to have some extra text or extra HTML output for if there's nothing there.

16:18 That's kind of neat.

16:18 Yeah.

16:19 Like here's where the list would go, but you know, nothing yet.

16:22 Or oops, there's nothing there yet.

16:23 You have to add.

16:24 That's cool.

16:25 There's a built-in lorem ipsum generator.

16:27 I had no idea.

16:28 Bob, did you know about this?

16:30 So this is just cool.

16:31 And basically, that's it.

16:32 You don't have to add anything.

16:34 Django apparently has a built-in lorem ipsum generator.

16:37 That's neat.

16:38 So have you used this, Bob?

16:39 No.

16:41 I'm surprised that I don't know about any of those six.

16:45 And I see already some refactoring candidates, especially the four empty.

16:50 I would definitely look if student list had something before looping.

16:54 Now you can just use empty.

16:56 Or lorem, I would probably pass in some lorem text from the view and just do it in the template.

17:01 Pretty impressive.

17:02 Well, especially when you're trying to get your template looking right, it's hard to see that when it's empty.

17:08 So being able to throw some stuff in there, that's kind of cool.

17:11 And then verbatim, that'd be good if you're going to basically, for instance, if you're going to talk about Django template tags, it would be hard to do that unless you had some way to turn off the parsing of it.

17:25 So you can use these.

17:26 You know a place where that verbatim looks really interesting?

17:28 I had the office hours for Talk Python courses.

17:32 And so folks in there were saying, I found it a little bit tricky to combine Django and Vue.js because they have the same similar tags.

17:40 The double handlebars mean certain things and whatnot.

17:43 Yeah.

17:43 And they're like, well, I'm going to put some Vue.js section into my Django templates.

17:49 But Django keeps like wrecking my Vue.js templates.

17:51 You can just wrap your whole Vue.js app in this.

17:54 In the article, it mentions that if you've got something else down the tool chain, like your JavaScript library or something that's going to rechange things, you can use this to make sure Django doesn't.

18:04 I think it's really cool that it's got built in lorem ipsum.

18:08 It's something that I've been using just that seems like lorem ipsum is cool, right?

18:12 You can get like random sort of Latin stuff in there that obviously is fake, but it looks like real text, right?

18:19 It doesn't look like just the same words repeated or something.

18:22 But, you know, being from Portland, I find that it's, you got to take it up a notch.

18:26 And there's a place called Hipster Ipsum.

18:29 Ipsum.co.

18:32 And if you go there, you can generate, it has a little generator to say, how many paragraphs do you want?

18:37 And do you want like hipster neat or hipster with a shot of Latin?

18:39 And you run it and it comes up with like stuff that is like super hipstery.

18:45 Oh, yeah.

18:47 I just did that.

18:48 Selfies 3, Wolf, Moon, Edison, Bulb, AdaptGen, Cray Organic, Venmo.

18:54 What do you got?

18:55 Portland, Bonmi, Vaporware, Polaroid, Farm to Table, Iceland, Selfies.

19:00 I love it.

19:02 I love it.

19:03 But it is really cool that lorem ipsum is built into Django.

19:07 I had no idea.

19:08 Could we get ipsum built into Django?

19:10 That would be better.

19:10 We should definitely get it built in there.

19:12 Awesome.

19:15 So, Bob, this one that you're going to cover next, this is brand new to me.

19:19 I guess I've seen it all over, but I just learned that what it is today.

19:24 Yes.

19:25 So you want to post some code on Twitter and you want to look at nice.

19:30 So we're using carbon.now.sh a lot, which basically lets you create those terminal PNG images of code with nice color formatting.

19:44 And yeah, it's very easy to use.

19:46 You just choose the font.

19:48 I'm talking about fonts.

19:49 Yes, exactly.

19:50 So we're using the language and put the code in there and that's nice integration with Twitter.

19:56 So you can click Tweet button.

19:58 But we actually use it with Selenium to populate it automatically with our tips.

20:04 And it generates a cached image or I think it posts the image to Twitter and then it provides you a Twitter link.

20:12 And then you can embed that link in your tweets.

20:14 And so actually today, yeah, more developers overall these days using it on Twitter.

20:20 I see a lot of those images and they're probably all from carbon.now.

20:24 Yeah, they probably are.

20:25 They just look very nice.

20:27 Yeah, this is great.

20:27 Yeah, it gives you like a screenshot of a generic-ish terminal with code in it that's like color formatted and indented.

20:36 And then it just lets you export an image or directly tweet it.

20:40 I love it.

20:40 I say generic-ish because it's got the three Mac windowing icons in the left and not the Windows or the Ubuntu ones or whatever.

20:48 But still, like it's really cool.

20:50 I like it.

20:51 Yeah, especially for Twitter, right?

20:53 The code doesn't fit in 140 characters.

20:57 It's nice to put it on an image.

20:58 And besides, it just looks way better.

21:01 I love it.

21:02 This is awesome.

21:02 I'm going to start using this.

21:03 I don't know yet for what.

21:04 I'm very tempted to use it for my courses, but I'm not sure it fits the Zen exactly.

21:10 So I have to decide.

21:11 It looks like the default font is Hack.

21:13 That's nice.

21:15 Oh, yeah.

21:15 Speaking of which, that's a good one.

21:17 Yeah, I love Hack.

21:17 That's cool.

21:18 Great.

21:19 All right.

21:19 Well, this is a great one.

21:20 And if you want to post any code, yeah, one of the problems with posting any form of

21:24 code, you know, certain places, it'll like not accept the formatting.

21:29 It'll just completely wreck it.

21:30 Like, for example, if I'm in a Zoom meeting, I'm going to say, yeah, here, this code, you

21:35 know, that's going to come out completely destroyed.

21:37 The people receiving it.

21:39 And then on Twitter, like you said, you want to talk about the code, but you don't want

21:42 the code to count as towards your 280 words.

21:46 I really like this.

21:47 It's great.

21:47 I'm going to start using it.

21:48 So the last thing I want to cover our made items this week is about bugs in Python code.

21:55 And yeah, it's pretty interesting.

21:58 This one was sent to us by actually quite a few people this week.

22:04 So it comes from Jacqueline Wilson, Jesper Sorensen, sorry about that, and Eric Palmer all sent this

22:12 over and said, hey, this is crazy.

22:14 You all should talk about this.

22:16 So researchers found a bug in a Python script that was super subtle, really based on an

22:22 assumption that may have affected hundreds of academic peer-reviewed published studies.

22:29 That sounds bad, right?

22:30 Yeah.

22:32 So it turns out that in this, there's a paper, of course, how do you rebut code bugs in academia?

22:41 You publish a paper.

22:43 So in a paper published in October 8th, a couple weeks ago, some folks at the University of Hawaii,

22:48 researchers there, found a programming error in a set of Python scripts used for computational

22:54 analysis of chemistry data.

22:56 It started returning different results based on the operating system you were running on.

23:01 That's bad.

23:01 That's not amazing.

23:03 It turns out that they were using Python's glob.glob and assuming it was sorted, but it was not

23:11 sorted sometimes.

23:12 Wow.

23:13 The reason that matters is something that I'm kind of thinking is it worked.

23:17 This script works with a bunch of files, one after another, after another, and they kind of build up

23:22 together to generate a result.

23:23 And so if you don't take them in order, it doesn't mean the same thing.

23:27 I'm sure everyone's thinking like, oh, yeah, it was probably on Windows it did this, but on Linux

23:32 it did that, but on Mac it did that.

23:34 It was actually worse.

23:35 It was more subtle than that.

23:37 So they found that it returned correct results on macOS Mavericks and Windows 10, but on macOS

23:44 Mojave and on Ubuntu, the results were off.

23:47 So even across different versions of macOS, it changed because they were relying on the underlying

23:55 operating system to do some sorting that they needed, and apparently not so much.

23:59 Glob is very close to the OS, right?

24:02 Yeah.

24:02 It's just basically, there's no promises about sorting.

24:05 It just happened to be the OS they first developed it on.

24:08 It was.

24:09 Yeah.

24:09 So they were trying to analyze the results from an experiment involving cyanobacteria, and

24:16 they discovered significant variations in the results run against the same nuclear magnetic

24:21 resonance spectroscopy, NMR data.

24:23 And yeah, it turned out to be not so good.

24:25 So basically, the fix was incredibly simple, right?

24:29 Like you get the glob data and you just like call sort on the result.

24:32 You know what I mean?

24:34 And then you process it.

24:35 It's just one of those things.

24:37 You make an assumption and the assumption is wrong or it becomes wrong over time because

24:42 it was never a promise.

24:43 It was just implicit.

24:44 And yeah, stuff breaks.

24:45 Wow.

24:46 Testing on multiple machines is good.

24:49 Yes.

24:49 It's a very good idea, right?

24:51 One of the reasons.

24:51 I mean, especially running some of these tests on, this would be like a system level,

24:57 having to have the files there and test them.

25:00 I don't know how you would do that individually.

25:02 But doing it out on continuous integration service that used multiple operating systems, I guess,

25:10 would be good.

25:11 That seems like it could work in a reasonable way for sure.

25:13 Yeah.

25:14 So basically, the conclusion of all this, one of the professors who discovered the problem,

25:19 William, said that he hopes the paper will get scientists to pay more attention to the computational side of experiments in the future

25:26 and maybe do a little more things like unit testing and whatnot, right?

25:30 Yeah.

25:31 Last part is my bit I threw in there for him.

25:33 But yeah, anyway, this is rough.

25:37 I don't know.

25:37 I feel like a lot of science is both science is incredibly amazing and yet like kind of rickety.

25:44 It's on a very unstable foundation sometimes.

25:48 One of the differences now is that people can follow what kind of they're even able to reproduce some science

25:55 or able to reproduce the analysis part, whereas this wouldn't have been caught before.

26:01 It wouldn't have even ever been run again.

26:03 It was just it would be run once on somebody's computer in their lab.

26:07 They publish the paper and then they put it away.

26:09 Right.

26:09 They say, here's the results of our computation.

26:11 Here's what we did.

26:12 And here was our methodology for doing it.

26:14 But not here is the open source package on PyPI.

26:17 Why is it not working for you, right?

26:19 That's pretty cool.

26:19 So this is good to highlight some of the things to look for.

26:23 And I mean, we always have to be a little bit more cautious than we were before.

26:26 Yeah, absolutely.

26:27 Well, pretty cool.

26:28 And that's it for our main topics this week.

26:31 Brian, you got anything else you want to throw out there?

26:32 This wasn't really big enough to warrant a big topic, but there was an interesting discussion called using big tech tools.

26:41 And I just wanted to highlight it because it's a little bit interesting.

26:45 Basically, the question is, Vicki Boykus brought it up, or at least she highlighted it on Twitter, that if you like things like PyTorch and other things, there are some projects that are sponsored and heavily built by large corporations.

27:03 Should you use them if you don't like the corporation?

27:06 I don't have an answer for it, but it's an interesting question.

27:09 Oh, how interesting.

27:10 Yeah.

27:11 And Vicki's doing some really cool stuff.

27:13 She's got this.

27:14 She did Hack Your Name for a while, which was that Y Combinator startup namer thing.

27:20 And yeah, a bunch of cool projects.

27:22 That's cool.

27:22 I think it was.

27:23 Yeah.

27:24 Hopefully, I don't misattribute that.

27:25 It's not up anymore, so I can't double check it.

27:27 But yeah, I think it was.

27:28 Yes, he's doing a bunch of cool work.

27:30 This is great.

27:30 Yeah.

27:30 The other thing I wanted to bring up is the second Portland West Python meetup is November 5th.

27:37 So that's a week earlier.

27:39 We're shifting to the first Tuesday of the month because the second Tuesday is colliding with the data meetup.

27:46 That's awesome.

27:47 It's going really well.

27:48 The first meetup we had was a big success.

27:50 The venue that you got put together at your new office is fantastic.

27:55 We had like four 4K 70-inch screens or something all up there for people to watch on.

28:01 And yeah, it's going really well.

28:03 Unfortunately, I can't make this one.

28:04 I'm going to be out of town.

28:05 But generally, definitely going to go to this.

28:07 It's great.

28:08 It'll be awesome.

28:08 Yeah.

28:09 How about you?

28:09 So just reminded yesterday that it's turtles all the way down.

28:14 And sometimes you have to stand upon a turtle but not control the turtle.

28:18 What I mean is the Talk Python training site started behaving weirdly for some users.

28:24 It seems like it's working for me.

28:26 I don't know what's going on.

28:27 And it turns out we use Amazon for some of the video delivery of the courses.

28:34 And Amazon was under a DDoS attack for like 12 hours straight yesterday.

28:39 And so more of the DDoS attack that I'm talking about.

28:42 But it like basically knocked a whole bunch of stuff off the internet, which was crazy.

28:47 Wow.

28:47 Yeah.

28:48 So people can check that out.

28:49 But they were trying to mitigate the DDoS attack against their DNS systems.

28:54 And by doing so, they were basically overprotecting and like blocking all the other systems that were just trying to get their job done.

29:01 Another big piece of news for us is over on PyPI.org.

29:06 201,227 projects.

29:09 We have passed over 200,000 projects, which is awesome.

29:13 Thanks to RealPython for shouting that out.

29:16 And then, Brian, we discussed about this XKCD that we talked about a few episodes ago.

29:22 And said, well, it was episode 100 or 1425.

29:28 And it talked about how some things that are either hard or easy in programming are sometimes difficult to distinguish.

29:37 So, Andre Janisch sent over this thing called explainxkcd.com, which is a wiki of every one of those with like a detailed analysis of the XKCD and also includes the date.

29:51 Yeah.

29:51 So, this one has, do you remember what the date is?

29:53 This was the date that we talked about or the date when it was done.

29:57 It was done.

29:57 It was like done in 2014 or something, right?

30:00 Yeah.

30:00 Yeah.

30:00 Yeah.

30:00 Exactly.

30:01 It was explaining that checking to see whether a photo had a bird in it was a difficult problem in 2014.

30:07 And now you can have code that figures that out on a Raspberry Pi.

30:12 Exactly.

30:13 Maybe your watch will do it.

30:15 Like you just shake your watch at the picture and it just like vibrates in a bird shape.

30:19 I don't know.

30:20 That was before not a hot dog.

30:22 Yes, exactly.

30:23 All right.

30:24 Bob, what have you been up to?

30:25 Anything you want to tell people about?

30:27 Yeah, the platform, cochallenge.es.

30:29 It's growing rapidly.

30:31 And a lot of development work.

30:33 So, we added some nice linters, flake 8, black.

30:37 You can now blackify your code.

30:39 And yeah, UI changes, making it easier.

30:43 And more Python ninjas coming in.

30:46 A lot of coding down there.

30:48 Yeah, that's awesome.

30:48 Last week, we talked about all the auto formatters, auto PEP 8 and black and stuff.

30:53 So, you're using black basically to, as people work on the website, like it'll just clean it up for them?

30:59 Well, they have to do it manually.

31:01 It's just a button, right?

31:02 But they press it, but then it'll like clean it up automatically with black.

31:05 Yeah.

31:05 Yeah.

31:06 Made a new lambda and it runs black against the code.

31:10 And yeah.

31:11 Returns it.

31:12 Yeah.

31:13 Good to see that that's coming along strong.

31:14 All right.

31:15 Now, let's wrap this up with a joke.

31:17 I think it's safe for work, but it's a little bit off.

31:20 But I don't know.

31:21 Brian wants to make me say it.

31:22 I'm giggling in the background.

31:25 So, here's our joke.

31:27 What did the network administrator say when they caught an at-stivirus?

31:31 I don't know.

31:32 What?

31:32 It hurts when the IP.

31:34 The letter IP.

31:35 Oh, I love this joke.

31:39 It's so bad.

31:40 Yeah.

31:40 But this episode was not bad.

31:42 It was good.

31:43 Thank you guys for being here.

31:44 Thanks, Brian.

31:44 Thanks, Bob.

31:45 Is it IPv4 or IPv6?

31:47 It hurts way worse when it's IPv6.

31:49 All right.

31:51 Thanks a lot.

31:52 All right.

31:52 Thanks.

31:53 Bye, guys.

31:54 Thank you for listening to Python Bytes.

31:56 Follow the show on Twitter via at Python Bytes.

31:58 That's Python Bytes as in B-Y-T-E-S.

32:01 And get the full show notes at pythonbytes.fm.

32:05 If you have a news item you want featured, just visit pythonbytes.fm and send it our way.

32:09 We're always on the lookout for sharing something cool.

32:11 On behalf of myself and Brian Okken, this is Michael Kennedy.

32:15 Thank you for listening and sharing this podcast with your friends and colleagues.

Back to show page