Algorithms + Data Structures = Programs - Episode 149: CityStrides.com, Graph Algorithms and More!

Episode Date: September 29, 2023

In this episode, Conor and Bryce chat about CityStrides.com, graph algorithms and more!Link to Episode 149 on WebsiteDiscuss this episode, leave a comment, or ask a question (on GitHub)TwitterADSP: Th...e PodcastConor HoekstraBryce Adelstein LelbachShow NotesDate Recorded: 2023-09-25Date Released: 2023-09-29Hana Dusíková on TwitterHana’s co_curlNDC TechtownPeter principleADSP Episode 137: Sean Parent on Val (vs Rust)!CityStrides.comOpen Street MapsOverPasscity-strides-hacking GitHub RepoThrust Parallel Algorithm LibraryElon Musk by Ashlee VanceElon Musk by Walter IsaacsonEpisode 143 Comment About R |>Episode 142 Comment About Rust charsIntro Song InfoMiss You by Sarah Jansen https://soundcloud.com/sarahjansenmusicCreative Commons — Attribution 3.0 Unported — CC BY 3.0Free Download / Stream: http://bit.ly/l-miss-youMusic promoted by Audio Library https://youtu.be/iYYxnasvfx8

Transcript
Discussion (0)
Starting point is 00:00:00 Gee, what do you mean by direction? Well, you're running. You're running. I'm a runner. I'm running forward. Most people run forward. Welcome to ADSP, the podcast, episode 149, recorded on September 25th, 2023. My name is Connor and today with my co-host Bryce, we are back from the Slovenia 2023 road trip and record for the first time in almost four months. We chat about my new obsession with CityStrides.com and more. So, yeah. What's going on? How's it been?
Starting point is 00:00:47 It's been a while. We haven't talked for a while. Yeah, I just got back from Europe. I got to meet Hana's dog. Hana has an Italian greyhound. Very adorable Italian greyhound. And that was a lot of fun. Although my dog hasn't forgiven me for uh for playing with and loving another dog this is for uh clarity for those that are not steeped in the c++ lore conference world hannah dusakova of ctre fame that is compile time regular expressions and i've seen she's actually been giving some
Starting point is 00:01:25 i saw her gave a talk i can't remember if it was at c++ on c or it was some other i don't think it was c++ on c actually because i don't recall seeing her there but she gave a talk i can't remember if it was on coroutines or modules it was some she you know she she was showing me some of the stuff she's doing with coroutines right now. She wrote a library called co curl, like curl the command line tool for accessing a website and downloading stuff from websites. So she wrote like a C++ wrapper around curl that is coroutine, that's based on coroutines. It has a coroutine interface for managing asynchrony. And it's super, super cool and very slick.
Starting point is 00:02:12 And she was showing me how it worked. And it does some very clever, clever things. She actually inspired a secret coroutine project that I'm working on that I can't talk about right now, but is also very cool. And I actually just did some interesting stuff with my secret curating project today but yeah it's uh she's given that talk um i think at a a meetup in uh the czech republic but she's about to give it uh at ndc tech town or i guess she's by, now she has given it at NDC Tech Town.
Starting point is 00:02:46 When I saw her, she was just about to leave for NDC Tech Town. Yeah, that conference I think has just happened in, was it Kongsberg in Norway? It is Kongsberg in Norway, which is about an hour or so away from Oslo. I was considering going there for a day on my way out of Europe,
Starting point is 00:03:07 but I had to get back to Milan from the Czech Republic to fly back to New York and figuring out how to get from the Czech Republic to Konzberg and then from Konzberg to Milan was just too complicated for me. In Milan, is that where you were for your wedding stuff? If I recall correctly? Uh, not a wedding. Uh, no, just a family trip. Um, and no, we were in Tuscany and it was amazing. Um, we had a great time. Uh, we stayed at this like villa, this 15th century Medici villa that my, uh, stepfather had rented out to get the whole family together. And it's a really cool tour company where they, they bring in all these, this like Italian chef who cooks for you for the
Starting point is 00:03:55 whole week. But like, she's, she's only a chef by night. Her, her, like her, her educational background is she has a PhD in geology and she's cooking dinner every night. And like one of the people who's the travel coordinator for this tour company has like a PhD in physics. They're all like super smart and interesting people in addition to being great hosts and tour guides. So we had like this very authentic, homey,
Starting point is 00:04:30 Italian experience where we had home-cooked meals every day. It was great and amazing. And then I, then after that, I went to Cicicchio to spend a couple days hanging out with Hana. I spent a day in Vienna. You and I spent a day in Vienna, but I spent a slightly longer day in Vienna. Technically, I spent two hours in one day in Vienna, and then I spent like a full day in Vienna. So I spent like a day and a half in Vienna. And then I spent a day and a half in Milan, and then I came back, and I just got home, and now I'm uh trying to recover and get back into the swing of things it's like the first vacation vacation I've taken in a
Starting point is 00:05:11 while I'm uh I'm jealous you were in Milan Milan is on I was I was in Milan during fashion week well I could care less about fashion week what I care about there were there were a lot of pretty girls at fashion week not not you pretty sure ramona still doesn't listen to this podcast well ramona is actually within earshot so i'm sure she heard that uh all right good luck to you good luck to you but i mean we'll spend a whole episode on this because listen folks we haven't actually mentioned this but this is the first today is september 25th 2023 the last time you and i recorded bryce sitting behind our computers was may 31st that is yeah wow for almost exactly four months ago minus a couple days yeah we obviously recorded a bunch of times potentially too many times while we did our Slovenia 2023 road trip because it
Starting point is 00:06:16 ended up I don't actually have the exact count but I think it was plus or minus like eight episodes and because we only do this weekly that's that's onesixth, that's 17% of our annual content. And how have those episodes been received? That's really the question. That really answers whether it was too much, is whether they're doing well or not. I think they're doing just as well. Honestly, I think at this point, I've been following the stats. We've kind of hit a plateau. Well, I guess it's, yeah, a plateau. But that kind of sounds bad. We have advanced to our level of incompetence. What?
Starting point is 00:06:51 It's like a thing. I'll find the reference. Yeah, find a link and we'll put it in the show notes. I'm confused. But I think it's at this point within, I think, a week or two, it's usually a couple thousand downloads, according to the site. Who knows how accurate it is? And then within a month or two, it peaks at about 3,000. And I think that's been level for now half a year, a year, something like that. So the reference is the Peter Principle, which is a concept in
Starting point is 00:07:23 management developed by Lawrence J. Peter, which observes that people in a hierarchy tend to rise to a level of respective incompetence. So you get promoted based on your success in previous jobs until you reach a level at which you are no longer competent. And I think that applies here, too. Oh, I see. We have become successful enough. We've gotten to a certain level where we now have an audience. And we're-
Starting point is 00:07:52 I disagree. We're still, we may be at a temporary plateau, but I have great plans for the pod. I mean, I think the traveling, the trip angle I think is, is really a, a fascinating thing that might, might take us to a whole new horizons. Yeah.
Starting point is 00:08:12 I mean, I, I really do hope that the listeners are enjoying and being entertained by our antics on the road. That being said, I mean, I have so much fun. I mean that three episode,
Starting point is 00:08:26 which was just all one hour and a half bit when we were interviewing Sean at C plus plus on C not only is that like one of the highlights of this podcast for me, that's like one of the highlights of my life. Yeah, that was, that was a ton of fun. And,
Starting point is 00:08:39 and on it. So I, I looked at some of the comments on the interview that we, uh, we just put in the last episode on Rob Leahy. Leahy? Rob, you're a dear friend of mine. I hope you're not listening to me butchering your name.
Starting point is 00:08:54 But we interviewed Rob in Venice, and there were two comments on Reddit, and both of them were, like, positive comments. And I was just like, wow. Like, we did a good job. And I haven't checked since, so nobody ruined it for me, but like a hundred percent when I, at the time I looked, it was a hundred percent positive feedback. And it wasn't just like, oh, this is an okay episode. It was like, one of them was like amazing. And the other one was like unreal. Wow.
Starting point is 00:09:21 Yeah, actually I hadn't, uh, I hadn't been keeping up with that. That's good to hear. I mean, that, that, that episode as well. I just honestly, it is some of those episodes. I mean, I was thinking we should correspond our conferences next year because I want to try and prioritize conferences that I haven't been to. I know you've been to Core CPP. Have you been to NDC Tech Town? I have not been to NDC Tech Town. I have not been to Core CPP. But the thing is, is if we both go to the same conferences, we can do little, you know, interviewing speakers slash
Starting point is 00:10:06 attendees. I mean, we, I think historically have tended to focus on interviewing the speakers and podcast hosts like we did at C++ on C. But I think it would be fun to like, if we're giving out stickers, like we still don't have stickers yet, but we will have stickers in the future. And if we're giving them out, you know, just getting like little two minute, three minute, you know, sound bites from attendees that, you know, aren't recognizable names or anything of just like, you know, what is this your first conference, you know, second conference, how are you enjoying it, etc. I think that is, you know, really fun and just like a great way to connect with the community and you know, people that you don't already know. Anyways, we'll save that for another episode. I was you something up and then i said this is the first time we're
Starting point is 00:10:48 recording oh and then i said yes we're going to dedicate a whole episode to this at some point in the future but you went to milan yeah and i'm jealous that you went to milan because that is on my list of cities to visit and spend some time in because you do know this because you actually referred to it when we were walking in Venice and I was collecting the nodes, but I have become like, uh, obsessed like it to say, I can't remember who said it once that I don't have passions. I have obsessions, but like if I was, you know, focused on city strides and collecting nodes back in June, I am now like a full blown like addict. I have gone and written two, well, technically I wrote one Python graph algorithm to generate like optimal routes and I've become like a open street map. I wouldn't say expert,
Starting point is 00:11:37 but there's like an equivalent, an open source equivalent. We're going to, we're going to talk about that Python script in a little bit. Yeah. Well, I wrote it initially in Python. And then I was like, this is too slow. I need to speed it up. Let's convert it to, you know, Rust. Why not? And I just got ChatGPT to do it. And it worked amazingly, man. Nice.
Starting point is 00:11:55 And anyways, my point is I've become very much obsessed. And I'm going to be – I said this on my other podcast as well, that I'm currently ranked – I think at the time on my other podcast, I was ranked 116th. I'm now ranked 114th. I will be ranked number one in my lifetime, probably within the next few years. I'm thinking about even starting like a vlog series of like, you know,
Starting point is 00:12:19 running the world, and it's going to be half running, half programming, because it's Python, Rust, exciting. Anyways, we have a couple things to... Wait, wait, wait. I want to hear more about your script. What algorithm the G is. So, wait, why don't you first describe in a short and concise fashion the problem that you're trying to solve and then tell me how you go about solving it.
Starting point is 00:12:46 It's very complicated. But so before I jump into what will hopefully be less than a two-minute explanation of this algorithm, I have a list of things that were comments, things that we need to mention in the first episode back because it's been four months since we've recorded, not on the road, not at a conference. So we're catching up. We're going to address a comment from Andrew Craig on Twitter about the R pipeline from episode 143. We are going to read a comment from the GitHub discussion on episode 142 with respect to Rust. And we'll do that stuff at some point.
Starting point is 00:13:18 All right. I don't know. Start the timer. We'll see if it's 120 seconds or less. The problem is, given a set of nodes that define streets, or what are called ways on a open source version of Google Maps called OpenStreetMaps, which from henceforth will be referred to as OSM, you get these nodes that define streets, and you want to generate a path that is kind of like a traveling salesman path but it you were trying to optimize so so can i ask a question when you say nodes here um i'm thinking
Starting point is 00:13:54 about this in terms of graph theory and usually when i think of like nodes in terms of graph theory i think of them as being like the points um the vertices. Yes. But streets, like in a graph, I would imagine are edges. Well, so imagine you have a neighborhood that is all straight streets. Nodes are basically like the minimal set of, I don't want to say intersections, but points that define the roads that represent them. And so a way, which is very confusing. So if you go to, I'll leave some links in the description. If you go to either Overpass or the OpenStreetMap website, they have all these metadata for describing the world.
Starting point is 00:14:38 And basically every single institution, street, park, everything is represented in this database. And it's hundreds of gigabytes, if not, you know, what is that, terabytes of info. And you can zip it up and download it for Canada, Italy, wherever you want, America. And what they describe as streets, they actually label as ways, technically highways. And those represent everything, like footpaths bicycle paths highways residential areas and so a road is basically a highway or a way and a way is represented by a list of nodes in order so if you've got a simple street that's just straight it's probably just going to be two nodes okay one at the beginning one at the end if you've got a curved street
Starting point is 00:15:22 you're going to end up with a bunch of nodes because you have to represent that curve with a bunch of basically straight subcomponents. So if you have a very curvy road, you're going to end up with like, you know, 50 nodes, even though it might be shorter than a straight street that has two nodes. And so basically you can build yourself a graph that represents the area you want to run. And currently I have a parameters dot YAML file. So I basically enter a city, enter a starting node, enter a distance in kilometers. And then there's a bunch of things that tweak how the algorithm works. And the goal of the algorithm, it'll improve over time. But currently the goal is just to find the path that completes the maximum number of streets possible. Oh, interesting.
Starting point is 00:16:07 So it's probably some – you're in the given distance. Yes. So it's interesting because what you have here is both a graph theory problem and an optimization problem. Exactly. Yeah, I'm trying to think about what is there some some classical algorithm to uh yeah there's a bunch of algorithms like hamiltonian paths which complete everything and that's the thing is in the future i want two different algorithms one for when i'm living somewhere like toronto and my goal is to complete every street in the city. So every time I go on a run,
Starting point is 00:16:46 I don't want to leave any nodes left behind because that means on my next run, I have to go and run two kilometers to one node that I missed. That's super inefficient. So you basically want like a no node left behind algorithm that also is as efficient as possible. And that's the thing. There are a bunch of city striders
Starting point is 00:17:02 that call themselves purists that aren't actually trying to do street completion efficiently. They're actually trying to run every meter of every street so they have a pretty looking picture afterwards. I could care less about being a purist. I want to run as little as possible in order to get as quickly up the leaderboards as possible, right? Because you could imagine if you're in a neighborhood that's just like rectangular and you've got a bunch of streets that all just have two nodes that are parallel to each other, I could do it like a zigzag up and down each street, or I could just run like east to west at the top and then hop down to the bottom and then run west to east and then complete all of them without actually running any of the streets.
Starting point is 00:17:46 That question of you have all the nodes in the city, and you want to find the shortest possible route that visits each one. Not each one, a subset. Because in a city like Toronto, you have literally like 10,000 kilometers. You want to pick a starting node within a given distance, like 20 kilometers, complete as many as you can. Play along with me for a minute here. So you have all the nodes in the city. And suppose you want to find the shortest possible path that will visit each one of those nodes. Yeah, that's just traveling salesman. Exactly. That's what I was getting at.
Starting point is 00:18:35 And so I wonder if that knowledge that there's an existing well-known computer science problem here. I wonder whether that could help you research what the optimal algorithms are to tackle the actual problem that you're interested in, which is, I think, of a related family. And of course, there's another graph theory problem, which is fairly common in computer science, which is the shortest path problem, which is that like, you've got a graph, um, uh, find the, the shortest path through that graph. Um, yeah, those don't really help, or at least, I mean, I already, I already, you know, studied that at some point and that's not really like, this is the objective of this has nothing to do with like the, the distance covered
Starting point is 00:19:23 with respect to streets completed matters but like actual shortest distance uh from point a to point b doesn't sure but uh explain to me why that why why why why the shortest path problem isn't a related thing i mean it's just it's the objective function of shortest path is shortest path point between point A and point B. Like, whereas, yeah, my main goal has nothing to do with like, like, I do have in my objective function of which path to choose while I'm running my algorithm does have something that basically divides the number of streets. You do want to maximize number of nodes, right? Number of streets you do want to maximize number of nodes right number of streets but yes um but so then maybe the shortest path problem gives you the uh the the minimum distance and and perhaps the inverse of that an inverse problem is how do you maximize um especially if you think about a weighted graph um like what what you really want to do is,
Starting point is 00:20:28 given some weighted graph where the edges have weights, how do you maximize the number of nodes that you visit while also... How do you get the maximum nodes visited per weight of edge takings? See what I'm saying? Yeah, and I do have something like that, not using the weight of edges, but while I'm...
Starting point is 00:20:48 I basically have... I haven't even really described it. We should explain. The weight of edges here is the distance between the two nodes because in these graphs that we're describing here, not all nodes are equidistant. Maybe in a city like Venice, there are like two nodes that are like, you know, 10 meters apart, but in a more rural area, you
Starting point is 00:21:11 know, two nodes may be like a kilometer or two kilometers apart. And so obviously your algorithm needs to account for that. And so the way that you do that is you assign a weight to the edges. Yeah. I mean, I don't do any weight assigning to edges. What I do is. Well, you probably consider the distance. I do. I do. So like the distance is the weight. I mean, sure. You can explain it that way. I would not explain it that way. Cause that's not, I don't have a weighted graph. I do not have a graph that calculates uh the distance of each street and then you know explores based on maybe you're doing it wrong well if you understood the i have like literally in these cities hundreds of thousands of nodes and the dimensionality of the problem
Starting point is 00:21:57 is like the hardest thing this is not like a simple graph problem like and and there's an extra layer of that the streets that i am trying to complete are basically one query where it ignores a bunch of you know private thing private roads and unwalkable roads and highways like you know high traffic highways and like overpasses and stuff like that and you and and it also the key thing is that you only a road is only completable if it's named if it doesn't have a name uh it it's not it doesn't show up on city strides as something to be completed however in order to build your path you need all roads whether they're named oh that's interesting so so and so I'm traversing based on one set of data and then calculating my roads,
Starting point is 00:22:48 my streets completed on another set of data. Is it possible that for a given city that there may be, that the graph may not be connected? I don't think so. I mean, I ran into that at one point and that's how I discovered that I needed two sets of data
Starting point is 00:23:02 because I was running this algorithm in Bangkok and it would never, it seemed like my algorithm should go one direction where there was this really dense collection of nodes because i have a part of my algorithm is what i call hot spot seeking because it's not like i have a greedy algorithm that works iteratively that goes and just tries to look at the next 10 steps and find the best path and then basically repetitively do that but at a certain point it runs out of path and then basically repetitively do that. But at a certain point, it runs out of stuff and then it just arbitrarily starts choosing a direction. And really what you want is in a certain city, if there is a really, really dense collection of
Starting point is 00:23:35 nodes, you want to head towards that. And my algorithm wasn't doing that. And that's because I figured out that in order to get to that place, you needed to go over an overpass over like a highway. And that wasn't being picked up in my initial set of data. Because like it wasn't, out that in order to get to that place you needed to go over an overpass over like a highway and that wasn't being picked up in my initial set of data because like it wasn't because it wasn't uh it wasn't a named path so it wasn't yeah yeah it was like a unnamed you know uh bridge over a highway which yeah doesn't have a name um interesting anyways i haven't really like so the way my algorithm works i mean it's it's like said, we should kick this to a whole, what are we at? We're at the 25 minute mark. And then it's going to calculate at the end of that 10 steps, how many streets did you complete?
Starting point is 00:24:28 And then it also, it divides the distance, divides by the distance that it took to complete those streets. And then there's a couple other heuristics. And there's some other things that, yeah, get like the hotspot seeking that sort of is an adjustment if you're getting closer to that hotspot. Okay, and do you do this predictive thing because um exploring all possible paths is just like like you need to limit the sphere of
Starting point is 00:24:51 what you're looking at right like if you just try to look at like everything yes yeah if i were to just like bfs the like number of steps that it would take to complete a 20k run which would be like roughly like 600 or 700 i'm not sure i'm not certain that depth first search is the the correct tool for you to be like reaching for here i'm not i'm not depth first i'm breadth first but it's breadth first even so even so i'm not sure that's the right tool for you to be searching for hey man if you want to come and fix my algorithm or if some person listening, this is open source on github.com slash code report slash city strides hacking. Well, the thing that might be interesting would us to find a reading list, give each other some homework, and read up a little bit on graph theory,
Starting point is 00:25:54 and see if we can use this problem as a way to teach the dear listener a little bit about graph theory. I say teach. That suggests that we somehow have some knowledge here for us to learn a little bit of graph theory. But I'm certain that there's some applicable literature out there. I mean, I would be surprised if there is some nice, clean algorithm that is exactly what I want because I just don't think it exists. I'm sure there's not something that's exactly what you want, but I'm sure that there's applicable techniques out there that might inspire you towards a more optimal algorithm. And I mean, I think the interesting thing about the problem here is it's this nice mix
Starting point is 00:26:50 of optimization theory and graph theory. Yeah, I mean, honestly, I would be less interested to read something from a textbook because I just like, I've read a lot of that stuff or not necessarily from textbooks, but like, you know, Dijkstra's algorithm and Prim and all that stuff and Hamiltonian past. but like you know dykstra's algorithm and prim and all that stuff and hamiltonian past and they're always just so clean it's for this like one
Starting point is 00:27:10 problem whereas this problem is incredibly messy like probably like i would be much more interested to to know the algorithms that like uber and google use yeah like u like Uber or Google Maps. Well, do you know what library Uber uses to accelerate their dispatch routing? I'm going to guess Thrust. They use Thrust. Yeah, they use Thrust. They use Thrust. Back like my first year at NVIDIA,
Starting point is 00:27:42 my VP sent me a link to to an article from uber talking about how they use thrust yeah my i mean my guess is like the the algorithms that google maps and like uber use to calculate point a to point b one that's a much simpler problem than like what i'm trying to solve but two they do they have – like the data they – Not necessarily when you throw in things like traffic. No, it's an easier problem. Like root – well, anyways, we can debate whether it is or is not. But the point being is I think that they have a very simplified – You heard it here first, people.
Starting point is 00:28:20 Google Maps, trivial. I said point A to point b is easier to solve than uh what i'm doing like the the you should look at some of the runs and the roots that are generated by my algorithm they're completely somebody who's our listener surely must work on google maps or some equivalent thing or know somebody who does reach out to us let us know we want to talk to you sure i'd love to talk to you but i think my the point that i'm trying to say is that my guess is that they have a very specific graph node set that is for the purposes of generating like each of those paths whether it's uh you know via car via via bicycle, whereas I am using everything.
Starting point is 00:29:06 I don't care if I have to hop on a bicycle path in order to complete my nodes. I will do that, right? Like there's... But okay, but how does that make it an easier problem? It just means that you view all roads. It means that like the dimensionality of the data that I'm dealing with
Starting point is 00:29:27 is massive. I don't know that makes it an easier problem. It's just a question of the compute intensity, the tractability of the problem. Also, too, because I'm running, my graph is undirected. I can go anywhere. When you are designing something,
Starting point is 00:29:46 your edges have directions, like the dimensionality of a point. You do have to start and end. I don't even have an end. Uh, that's like a to do feature. My right now, when, if I want to run 20 K I'll just put 15 K in and then I'll run the last five K back. Uh, because adding, adding an end point, which is typically quite close to the start. if you're traveling, like you're starting at your hotel, ending at your hotel, that complicates it drastically. Because basically, you're going to be going out one direction. And the easiest way is once you hit the halfway point, you then start adding in some reward for closing the distance back to where you started.
Starting point is 00:30:21 Well, let me ask you an interesting question. Suppose if you lived in a world, if this problem, if this problem was small enough, or you lived in a world where compute power and storage was infinitely cheap, how would it change how you solve this problem? I would have the exact same algorithm. You just increase the step count. Like the main thing that I need to do to improve this algorithm, in my opinion, is to parallelize the BFS.
Starting point is 00:30:52 Because right now I'm limited to like eight to 12 steps, which still gets me pretty fantastic results. But there are cases where, I mean, it would just... And by steps here, I think you may want to clarify, you don't mean actual steps, but you mean like an edge... Iterations of BFS, yeah. Yeah, yeah. Of the BFS.
Starting point is 00:31:15 So you pass in some integer and then it gets decremented until it hits zero. But it represents how many segments? It represents how many choices you make. Right, right, okay. So technically a part of the algorithm initially was if you are on a street that only has one node in front of you and one node behind you, always go forward. Because you don't want to be – if you're in a street that's curved and has 50 nodes in it, but it's only half a kilometer, and every single time you move forward, you then, you consider a choice being, do I go backwards or do I go forwards?
Starting point is 00:31:54 Then you go forwards again. Do I go backwards or do I go forwards? And exploring that, because then you just destroy your ability to make progress. However, always going forward, if you're on basically a street where you're not at an intersection where you have options isn't optimal because at some times you want to basically just get a node
Starting point is 00:32:11 that's like 10 meters in front of you but then the next node is like half a kilometer away and as soon as you take that first step to the one that's 10 meters away you then are forced to go half a kilometer to the next direction so you basically want to have some...
Starting point is 00:32:25 Like what direction is forward? Direction when you're on a street that only has a node in front of you and a node behind you where there's basically no option other than keep going forward or reverse direction and go back where you came from. What do you mean by direction? Well, you're running. You're running. I'm a runner. I'm running forward.
Starting point is 00:32:44 Most people run for i understand there's no there's no direction like north east west south it's just i'm running to the next node but when i think about this problem what i would imagine is that your position wouldn't have a particular orientation all right so let me simplify this in general you can think of when you're this algorithm or when you're running, you're in two different possible situations. Situation one, you're at an intersection or you're at some place on a map where you have multiple options where you can go, you know, make a left-hand turn, right-hand turn, you know, keep going forward. If you've got some stairs that you can go up, you know, you could have upwards of, you know, like 10, 11, 12 different directions. But on average, you usually have like three or four. Or you are on a road where you can either, you technically
Starting point is 00:33:36 do have two options. You can continue to go the direction that you're currently going, or you can turn around. And as I mentioned before, you don't want to be in a situation where every single time you're going down this road in a direction, you're making a decision. Should I reverse direction or keep going forward? If you're doing that every single time, you're going to completely destroy your ability to make progress in this algorithm.
Starting point is 00:33:56 So I have a threshold that says you're only allowed to backtrack if the next node in front of you is further away above a certain distance. I think on average I have that set to like 200 meters. So you're allowed to backtrack. You're allowed to make the option to turn around and reverse direction. If the next node on this street where you only have two options, that's continuing to go forward and to go backward, is greater than 200 meters.
Starting point is 00:34:22 Otherwise, you have to keep going forward if it's only five meters away. Okay. When you talk about orientation, like, is it assumed that you have some knowledge of where you came from and that therefore the, or like, you know, I, okay. Yes, you have a path. You have a path that is defined by a set of nodes and the node that is at the top of that path or the back of the path is where you just were. And so you can prevent yourself from revisiting that by checking the nodes that I'm about to explore are always going to contain the node that you just came from. And in certain situations, you want to make sure that you're not just always, like I said, destroying your ability to make progress because you only have a certain number of choices. Like I said, the steps that
Starting point is 00:35:08 you make are really the choices that you make. So when you choose to take a left-hand turn or right-hand turn or, you know, go across an intersection, that reduces your number of choices. And if you're always including your ability to go backwards, I guess it's not going to make it impossible for you to make progress. But it's just, it explodes the dimensionality by like increasing, you know, the factor of N that your tree is growing out by.
Starting point is 00:35:35 Every node gets N plus five. So I have a couple of logistical questions, lighthearted questions. Humorous questions. Color commentary. I have some color commentary. All right. Go ahead.
Starting point is 00:35:52 So are you out there running and then you stop and you pull out your laptop and you type in where you need to go next? I, 95% of the time while I run, have my cell phone in hand, screen turned on, and am looking at it like every 10 seconds. Yes. And are running your algorithm? No, the algorithm is run in advance and generates the root. And the root is defined by a bunch of nodes that are latitude and longitude coordinates. And you can just... I think it would have been funnier if you were building it as you go. No. I mean, my roots are ridiculous, though. Like, the number of 180-degree turns and the areas that it takes me.
Starting point is 00:36:33 Like, when I was in Bangkok, there was this one – When were you in Bangkok? I was in Bangkok recently. My good friend, congratulations to Ethan and his partner, got married in Vietnam. Oh, yeah. You mentioned this to me. Yeah. So I was over in Bangkok recently. My good friend, congratulations to Ethan and his partner, got married in Vietnam. Oh, yeah. You mentioned this to me. Yeah.
Starting point is 00:36:47 And so I was over in Southeast Asia. And basically, I was just running down a street and then ducking into these like 50-meter streets of which there were 28 of them. So in like a two-kilometer stretch, I completed 30 streets. And like on average, I would say the the bare minimum depending on what city you're in you want like 10 streets per five kilometers um but a good run like my best run was 225 streets in 20 kilometers which was where was that that was in venice um yeah and which is why this brings me back to milan i've also i've been slowly i you know the amount of data that you i though i got
Starting point is 00:37:30 i gotta tell i gotta tell you i love milan as a city but the the streets in milan absolutely terrible doesn't matter i'll be running them all i care about all i care about is the nose. Seriously, it was bad enough that I took a scooter or one of the e-bikes once, and I was like, I'm not doing this again. And then just getting my luggage, rolling my luggage five to ten minutes between places I was staying in train stations was just such a hassle just because of the quality of the sidewalks in the streets. I mean, I loved everything about Italy, but Milan, you need to, you need to work on your streets. Also their, their, their curb cuts in, in Milan, like they have like a pretty noticeable bump on the curb cut, which like,
Starting point is 00:38:23 if you, if you're, you have some wheeled thing that you need to get noticeable bump on the curb cut which like if you if you're you have some wheeled thing that you need to get onto or off the curb having a big bump like sort of defeats the purpose of your curb cut but i i have some other color commentary questions so how many times has this algorithm gotten you lost never uh the the never the footnote on that answer is that I never get lost because I've got a phone in my hand with GPS. However, it has told me to run places that it is not possible to run, probably the worst of which was once again when I was in Bangkok in Thailand. It wanted me to run onto a military compound, and the men with guns at the entrance of this military compound.
Starting point is 00:39:09 I clearly did not try to run in, but it was apparent that when I got to that part of the map, I was taking a little detour. Well, I was just about to ask, how sketchy of a, like, have you built into your algorithm, like, the sketchiness of the neighborhoods? No, no. I will say, though, it is. Is this going to be what we're going to put on your tombstone? It's like Connor was in some city and he ran into the bad neighborhood because the algorithm killed him. It's not for the faint of heart, though, because a lot of the times you are running into a definitely like a residential street that is a dead end and people are staring at you being like what are you doing running down my residential
Starting point is 00:39:53 street and then you kind of have to pretend that or at least i do because i feel bad but like i'm looking for a way through and then i realize oh it's a dead end and then i i they they kind of point to you know you got to go that way and And I'm like, oh, thank you, thank you. Especially for the ones where it's like, you know, it's a 20-meter street that I'm going just to complete because it's short. So, yeah, no sketchy neighborhoods. There's been a couple of streets that I've skipped, though. Are you going to do this when we're in Nigeria? Yeah, why not?
Starting point is 00:40:24 Morocco? I mean why not? Morocco? I mean, I think Morocco, they have rules, though. Like, you can't actually – I mean, I'm not going to put my life on the line. Well, I mean, it actually depends on what the mortality rate would be. I'm not going to seriously put my life on the line. I mean, I've been running next to highways that is probably not advised. I've definitely been running places that, you know, and also I'm listening to my podcast while I'm doing it. So I've got my headphones in and,
Starting point is 00:40:50 you know. Yes. So it's a great situational awareness. Yeah. I mean, but listen, listen, you got to have life goals. And my current life goal is to be number one on this website. And it's going to happen, folks. This is your current life goal well look i i can't complain because my current life goals revolve around uh flying and spending money on on ridiculous we all have we all have the things that make us make us happy anyways we're at the 43 minute mark we haven't even we have this is a long episode. So we got to – let's skip over to the two things I was going to mention. Episode 143, we mentioned R, and we got a comment on Twitter. Also, we're not calling it X.com.
Starting point is 00:41:35 Maybe others will. It's going to be Twitter. You know, I feel like not enough people are with us on this, but I'm sorry. You don't just get to rename, rename a thing because you bought it. Nope. Yeah. I heard that actually, I heard on another podcast today that Elon Musk has a biography. He already has a biography or auto, not autobiography, but a biography written by Ashley Vance. Musk, terrible person, fired his secretary after 20 years. You know, anybody that looks up to him, you should go read his, go read Ashley Vance's book. And, but apparently, uh, Walter Isaacson, the individual
Starting point is 00:42:09 behind the Steve Jobs biography and a couple other books has written one about Elon Musk. I will be consuming that ASAP. Anyways, we're going to call this website Twitter because screw that guy. And until we get some like Gen Xers or whatever, the kids, you know, until they're asking us what is Twitter and we start getting like active comments that we're confusing our listeners by calling it Twitter, we're calling it Twitter because I'm not calling it X.com. But calling it Twitter really – it's not just because like screw Elon. But also just, like, it's a dumb name. Like, and there was no need to rename the thing. So we're going to keep calling it Twitter. And also, we're not going anywhere. We're not leaving.
Starting point is 00:42:54 You know what? You can rename it. You can do all the stupid things you want. Connor and I are persistent. We're here. We're not leaving. This is our're here we're not leaving this is our space I will say that if
Starting point is 00:43:10 Mastodon or Blueski I know it's called Blue Sky but I heard someone say Blueski and I thought that was funny anyways if there is some viable alternative that actually isn't just like some nascent thing like I'm down to switch because I've heard enough people complaining about how the I refuse to let this man win I would rather thing like i'm down to switch because i've heard enough people complaining about how the i i i
Starting point is 00:43:25 refuse to let this man win i would rather stay here and bitch and moan and call him stupid and let him make a fool of himself until eventually he moves on or whatever let me let me let me like let me make my point though which is it is undeniable that the experience people are having on Twitter is degrading like at a serious rate. I've had people – multiple people say that they no longer see our tweets about the episodes. Like people are missing the content they want to see. Like the experience on Twitter is actually like getting worse and worse and worse. Since Elon has taken over, my follower count has like frozen too. Like nobody that I know in like the C++ Twitter sphere has really increased substantially in follower count since Elon took over. Like I still see some people's tweets,
Starting point is 00:44:26 but like that fact, I think says a lot about like whatever he's doing with the algorithm and just the degree to which they promote the random, you know, Twitter blue people over actual contributing members of the Twitter community. Yeah. So my point is, yes, I agree.
Starting point is 00:44:47 We're sticking. We're staying. But like once there is a viable alternative, I'm happy to switch at this point. That just doesn't exist. That being said. I would think about it, but I'm very stubborn and I still firmly believe, firmly believe that at some point this man is going to get bored of this and uh things will go back to the way they are that that being said before we get to you know i've been trying to read
Starting point is 00:45:10 andrew's tweet here for you know 10 minutes i was just uh when i was posting our most recent episode 148 on linkedin i noticed we actually have more followers on linkedin on our linkedin page than we do on twitter so you know what we already have a second home shout out to all the folks that follow us on LinkedIn oh god do I have to start caring about my LinkedIn now how many followers do we have on LinkedIn I can't remember the exact number was roughly 2,500 and I think on Twitter we have like roughly 21 or 2,000 or something like that how many followers do I have on LinkedIn? I don't know. Anyways. But is it more than you?
Starting point is 00:45:47 Wrapping, probably. Wrapping up. That's all the men. Wrapping up. Andrew Craig. It's more than JF. Episode 143, when we talked about R, and Andrew says on Twitter, my two favorite languages are R and Q,
Starting point is 00:46:00 so I was happy to hear R discussed, even if not very positively. In R's defense, the built-in pipe is pipe greater than, which is the pizza operator. And the built-in outer product is percent O percent. I agree that it would have been nice to have had a separate scan function. And I did not know that. And I think actually I replied at some point, maybe on a different thread. The point being, though, is I was whining about the pipeline operator, which I believe was percent something percent. It was a percent sandwich, and it was three characters, and it looked awful.
Starting point is 00:46:38 Apparently, that's actually a library pipeline operator, which is why it's so ugly. And the built-in pipe operator, which came in like a very recent version of R, I can't, 3.x, something like that, is actually the same one that is getting proposed, although it kind of died, which is going to bring us, if we're still recording, because I'd like to record one more episode, to episode, is it going to be, I think it's going to be 150. We're going to release 149 as an extra long 50-minute episode. My topic for 150, which is a pretty big number, is going to be exciting. I've done some prep.
Starting point is 00:47:07 I've got some podcast clips to let Bryce listen to. We're going to get his live reactions. Anyways, the topic, spoiler, you're going to have to wait a week, is going to be, is C++ dying? A little bit of clickbait.
Starting point is 00:47:20 A little bit of clickbait. Going to go with yes. Wait till episode 150, though, folks. Anyways, thank you for the comment, Andrew. And we are going to have someone from R. We've gotten a couple different suggestions. And it is very heartwarming to know that the pizza operator is the actual language one. And the one that I was talking about is the library one. That brings us to episode 142, when we were talking about Rust and
Starting point is 00:47:48 a solution to a problem that involved calling dot cars on a slice, I think, a string slice. And john-littlebarelabs on GitHub in one of our GitHub discussions replied saying that as to why it doesn't call cars, because I think you asked how come you can't just call.itter on a string slice, and you have to go.cars and then.itter. And the answer is that he provides or they provide is as to why it doesn't call cars for you, it doesn't want to make assumptions about what you mean versus UTF-8 versus bytes. And so he gives, or they give a couple different links. And the sort of highlights are that string slices are always valid UTF-8. And you have to sort of specify what that means. So what exactly
Starting point is 00:48:39 does it mean to iterate over UTF-8? You can specify what you mean with a method. And then there's the.cars method, but then they also provide an analog.bytes. And by byte, they mean the code units, aka 8-bit octets. Rust terminology often makes a reasonable car bit assumption. Anyways, there's a bunch of links. We will put it in the show notes. Thank you for the comments from both Andrew and John. Anything you'd like to say to wrap up episode 149? Bryce has just taken photos with Looney. I tell you, man, you got to bring a higher level
Starting point is 00:49:12 of professionalism to this pod. She lied down on me. Fascinating to know that we spent a good chunk of an episode talking to the pipeline operator without realizing that it was a library functionality, not the built-in one. So thank you for keeping us honest, dear listener. Yeah, I think that's my comment.
Starting point is 00:49:36 All right. Wrapping episode 149. be sure to check the show notes either in your podcast app or at adspthepodcast.com for links to anything we mentioned in today's episode as well as a link to a github discussion where you can leave comments thoughts or questions thanks for listening we hope you enjoyed and have a great day low quality high quantity that is the tagline of our podcast it's not the tagline our tagline is chaos with sprinkles of information

There aren't comments yet for this episode. Click on any sentence in the transcript to leave a comment.