All right Good afternoon evening everyone. Happy Friday Happy St. Patrick's Day to anybody who is interested or celebrates St. Patrick's Day I attempted to wear my green shirt But I failed to account for the fact that we have chroma key going and it's set to green so that the screen behind me gets cut out So today I'm gonna be a floating head with a mirf logo Well, let's go that way, but it is green and nonetheless If we all This actually update live. Yeah, there we go. You can see I've got green shirt and green screen, but Whoops didn't plan ahead very far How's it going see Grover? Let me nice this and Full a few of these windows around As I go and be out of graph on YouTube this one Good there Let's go into shippu So Hello to everyone. My name is Tim. I go by foamy guy on github and discord This is the deep dive program Which is a weekly live stream program where we are working on circuit python related stuff Sometimes we are in the circuit python core the actual C code that is circuit python itself Sometimes we're working on libraries documentation or infrastructure Projects all sorts of stuff. It just depends week to week. What's going on? If you are brand new and you've not caught one of these programs before you don't know really what I'm talking about when I say any of that You can learn more at circuit python org This is the main website for the project circuit python is a Implementation of python that runs on tiny computers called microcontrollers There's a bunch of pictures of them over here on the downloads page at circuit python org these little Devices each one is essentially a tiny computer And when you plug it into your computer with a USB cable like this one is connected It will show up as a thumb drive and you can edit the files on the thumb drive Save the code file and then it will execute on that device. That's kind of the you know Central core idea of circuit python is the device showing up like that as a thumb drive and you being able to edit the code With whatever text editor you want save it and then have it run if You are interested in Learning more about circuit python a couple of things you can do circuit python org is probably the best place to head to start Join us on the discord, which I think is yeah link down below 88 fru. It's discord. There's a circuit python dev channel help with circuit python channel So head there if you are interested in using circuit python or you know joining the circuit python community or project contributing code Or just want to hang out and say hi Circuit python is an open source project. It is primarily funded by Adafruit. This is their website Adafruit comm They are a hardware and software company based out of New York They manufacture some microcontroller devices as well as some other breakouts and things that you can hook up to your microcontrollers to interact with So if you want to get yourself some toys head over to Adafruit comm And then you know, thank you to Adafruit Of course for paying all the folks who are working on circuit python And thank you to everybody who wants to purchase hardware from them because obviously you're helping keep the lights on helping helping keep You know Adafruit factory running, which is helping them be able to keep paying the folks who are working the project But thank you for all of that Today, I am going to attempt a little bit of core development For anybody who Has followed some of my more recent streams You might know that I have been struggling a little bit with some hardware issues In particular that seem to expose themselves when we're working on the core. So I'm gonna say fingers crossed knock on wood Everybody do whatever your favorite thing for good luck is Because we are going to attempt this and hope that nothing goes too terribly wrong if the I will say right up at the top here before we really dive into that one of the things that was going wrong in the past Hopefully in the past was that my computer was freezing up Which unfortunately means then the stream is gonna cut out and I'll have to kind of reboot and come back and do all of that stuff So Hopefully this will not be happening. Hopefully we have gotten that kind of the worst of it You know in the past But that's one of the things that was happening. So I wanted to give a fair warning If I do disappear or the stream cuts out or something like that I will try to get it rebooted and come back as quick as I can But it may take me a minute and I'll try to drop a message in the discord or something like that from my phone If I can as well So that's the warning on that again fingers crossed. Hopefully we're not gonna be needing that. I will say I've I've had You know a little bit of okay news on that front, which is I did end up actually getting some new Ram and I have not had my computer freeze since then although I think I actually haven't had it freeze since I switched Kernels and updated a lot of stuff as well. So it's it's all kind of anecdotal Unfortunately, the things that are going wrong are kind of wrong very very randomly And so it's difficult to like change a variable and then test again because It's not failing consistently. It's it's pretty random. So Hopefully we're not gonna have any locking up But we'll see how it goes The thing I do want to work on which is in the core is this API inside the web workflow for Returning the free space on the device Uh from a url the url that was proposed in here was slash Uh device info json. I think disc info json like this So when web workflow is running you would open a browser on another device you would hit this url with the ip or whatever of the Circuit python device and it would return to you a json Which is going to tell you how much space is on the disk and how much of that space is available Yeah, thank you I went just like probably five minutes before I hopped on Uh, I was changing shirts and I was like, oh, let me grab the screenshot real quick for st. Patrick's day That'll be a good idea And then as soon as I uh, I sat down and I loaded up obs and everything and I was like, oh, right Yeah, but you guys can see more of the screen this way.  Okay So I do Have a branch for this. Oh, I will I will say too in in less fun news I actually um, I rebooted my computer before I started up the stream today You know for luck basically for hopefully, you know, try to make it not have any kind of messing up Um, one of the things I did though is I also went into like the BIOS and changed Some setting about memory speed, uh, because I thought the memory that I Have replaced like I put in new memory. I thought the speed was different So I went to the BIOS to change this thing Uh, and then it just wouldn't boot up at all or show me anything on the screen. That was uh, About 20 or 30 minutes ago. Um, so we luckily got it back just in time so that I could actually get everything up and running for the stream from that so Fun fun times all around On the on the hardware side for me, but we're hoping hoping for the best here Um, where I'm gonna start is I I actually do have a build already Uh, you all did not see me make the build, but I'm gonna use it as my first build because Essentially one of the things I'm gonna be doing is trying to minimize the number of actual builds that I need to make Uh, so that we are rolling the dice less on the computer messing up Um, and in this build it should I believe have the disk info json Um url the end point which maybe I should stop just scrolling. Let's find a disk There it is. So we have the url which is going to handle it That's going to call reply with disk info json right now. It is hard coded to something else, right? This was just a copy of version json, but it should be enough for us to test to see if this part of it is going to work or not So, um, I don't have the camera set up today pretty much everything I'm going to be doing is all just repel Um, so we're just going to go through the repel for now. No, uh, no desk cam Honestly, I have a bunch of stuff on my desk Uh, as well Okay, this is on Just got that connected Whoops We'll go to bootloader mode This is a feather tft is what happens to be connected right now, uh, which is what I have a build for This is like the exact perfect length to where It's on the end and I can't tell if it has a space or not One of the other things I did Uh, I guess you could say superstitiously to try to like rule out variables for what was causing my computer troubles was I uninstalled the Terminal prompt thing that I was using before Called starship Which would like change this prompt here to have some more Interesting useful information and generally I think also shorten it which was nice Um I should probably put that back because it turns out that was not really part of My problems because I've continued to have a little bit more problems after I did that Although again Since the last couple of things I changed I've been at least not freezing So It can steps in the right direction. So Uh in order for web workflow to be active. I have to also This is not the right thing to be open Uh one second here In order for web workflow to be active you have to have Uh This I think which I should not just open here obviously because it has my wi-fi network in it And some other stuff it turns out chameleonware Okay, so the code that's on it is unrelated. This was a test for bitmap tools. Uh, I don't Don't think it matters. What code is on it? It's been a minute since I used web workflow. Let's pull up the learn guide for web workflow If we want to save our code, we'll have to do that I think I need to do that. Yeah, uh, I guess really what I need is to be able to know the ip Which the easiest way to know the ip is going to be don't run And this code because this code is gonna Do stuff with display. I oh One two one. Okay Is there a port? Oh, it went to uh, yeah I feel like I've had that problem before haven't I? I don't think this I think this never did work for me. Unfortunately the dot local thing I don't know if my network is weird or something Slash code. I was usually able to do it from the uh See, I think the reason it's failing is it's going to HTTP Um, why is it doing that used to connect put the store. I can at least see it Um, there's something else we need to put in the Something else we need to put in this Settings.toml port and password could I have changed the port I guess? Fortunately, we got to bounce this back because I can't share my settings.toml You don't have a port. Will it not be active? Okay Still thinks it's on 121 defaults to 80 You know, it's interesting the uh, oh The coincidence Here we go I know why it wasn't working before but we made it there So Is this supposed to be after cp? Yeah We do it in here Nice if I could do it in here I'm failing the same way Okay, yeah, it doesn't like being open in both browsers either, but there we go. We made it. So this one returns json Theoretically this one now is existing disk info Which is mostly the same stuff really the one thing I changed is this is now version one instead of version Just because I wanted some kind of change so that I would know that this is actually working And it turns out it is so Really what we need to do is use this function that scott says f.gif free What do we actually do this though logical drive number? Let's search the code. Is this used anywhere? Let me have another one of these Get grep this no get grep this Yeah Result is that so let's see Come on this That go to there Oops What was it get free get free read only is that one? Oh get free That's actually part of it because So as it calls this get free Oh f versus t. I see f result Okay, so I have never messed with any of this stuff before do will I need to Do all of this I will right because How do I get this passed in? Get the status of vfs Or is there any way should we could we call this method instead? Because this has free available Where does this come from does this get used anywhere? and just to be Clear this page Shows the size of each file But not the size of the entire directory or anything like that If you can call os.stat Good bookmark that huh be a good thing for the bar here. You know, I had the index page bookmarked actually That's what I should do because that one is a bit faster Or was that index it wasn't this it was like But this was the one In the status of a file or directory status of the file system Path string so yeah, we could if we could just pass like slash probably so that is block size fragment size size of fs in These units number of free blocks Unprivileged number of inodes number of free inodes Mmm. How does that turn to bytes though? size of fs So is that saying 1881 times 512 and then that's the number of bytes So then how many that doesn't seem right. What if we had kilobytes? Okay, that's pretty spot on fair enough So then let's see back to this that was total size is number three, but you have to multiply it by number two And that gives you total size and bytes What this device was bigger than that? It's not That's the right size It feels weird about that. I don't have the reversal ones Four mags flash Maybe some of its use New euro at compatible digital pot driving Driver heading for the community bundle later today. Nice Sweet cool looking breakout I do remember something about there being like reserved space or something Like a circuit python itself takes up some space, but there's also Reserve space or something. I don't really looked before so I'm gonna assume that's probably right It at least matches a number of free blocks then would be 416 Times again the 512 416 whoops That's interesting 12 is this and then this into here is 112 free which is pretty close. Yeah zero block size times total blocks nice Yeah, okay, so let's look at um If we can just call that that'd be pretty nice is os a thing that exists in like shared bindings and shared module and all that or Should I be trying to should I be trying to call this? I guess not right because this is really the whole intention is to make it exist in python land But should I I should be probably just calling this directly then but we will need to like Unpack the tuple somehow still all right, so we're gonna cut out some of this stuff we can keep all the top stuff And then here The stuff we're gonna cut out Let's keep I'm gonna keep version. I don't know for sure if we'll want to keep that but I'm gonna keep version I'm gonna keep two more for total space and free space I think I'm gonna delete the rest Some of this we need though, huh? Oh man, I do not know if I'm gonna cut it off at the right spot this is tripping me out a little bit for the jason to be like Like the commas before the quote which is Super weird, right?  I just Put some fake stuff here See if we can get see if we did all of that stuff, right? I think that the issue is that what we had before was a variable now we have not a variable but a literal So I think like this would get this back into the string Do close the json Oh, yeah, shoot Thank you Wait, where's it closed in here? Oh, okay, technically. I do still have this down here. So so we don't do we not need all that stuff? Is this No on the last line No, we don't need it put that at the end of this one, but I'm just gonna fill that in like that for now This is gonna have extra spaces. I think Then if we do that, we don't need this Oh, but we do need This and that We're not filling in any variables So we don't have anything after for now, but eventually we'll swap in these two for variables We'll get rid of this one It has this concatenating strings with Define string some string string. I got you a percent s D for the substitutes It's a char host name we have something Host name set but not used You don't need any of this, right? Should I Not actually that confident about that. Maybe I should comment before Right delete Okay, we got a build let's back up here I'm gonna let it chill for just a second Then push it That's going cute the e hope friday is going well you two friend. Thank you Should I open to in C line I'm not really doing anything with coat pie That's one less thing to be running Nice I've not broken anything She's a good sign. Obviously we haven't done anything that complex, but Those of you that don't know if you're new this like Not really formally trained on C. So I'm kind of just like poking around Not quite in the dark, but let's call it dimly lit. Yeah oftentimes I am Doing things that are probably like pretty obviously syntax errors, but I don't really know any better yet We're getting better over time though. I feel like I've come a long way since I've been digging around inside circuit python um So one thing we could do is get rid of this one for now Oh, okay, this would be number versus string, which would actually be better to be a number, right? Yeah, cut this Of course We are gonna be still having to do the substitution eventually. I think I did that part, right? Should we oh, I did get rid of the version. Should we have the version or no? Drive size is what's expected on a four mag without an extended mode, which is the default. Nice. Okay There's some bytes for the boot loader 1.5 1.5 for ot a remainder for circuit pi. Okay So we're in the right spot there I think I'll I think we'll just go with no version, right? I think it's okay to not have the version because version like there's version dot json That's the whole point of version dot json um I don't think we need it So let's make sure that we did this part right since I cut some more stuff out and I changed those two numbers uh, I Don't know that I would go so far as to say that I've definitely found this for certain yet but one thing that I think I've found is that Not doing clean in between every build Maybe helps my computer because it doesn't have to do as much work. I guess it's like saving some of the work it did Uh in the prior builds I don't I don't know if this is true, but I guess it it seems like it doesn't have to compile everything again if you don't do clean um I'm sure at some point it will be messed up for some reason. We'll have to do clean anyway, but for now, I'm gonna take what I can get and Just keep doing builds without clean in between Which also goes way faster, which is pretty convenient as well Press this. Okay. Perfect. We have numbers now instead of Strings and we also got rid of the version. So we are on the right path here Uh, and then I think we want to try probably calling this Uh, but the thing is we are gonna need to catch the object that comes out of it And because this is not python, we actually need to know the kind of object that it's gonna be I do not mp object t Fair enough when builds help reduce hidden and inconsistent errors though Uh, that is true and ordinarily like I would be on the side of doing them Um But I found that they go faster and that it seems slightly less likely that my computer messes up And so as long as they are working I'm gonna keep going with them If we do start getting any kind of weird stuff then clean will be the first step. I try for sure though Yeah, definitely as the first troubleshooting step for sure So let's see if this even builds. Obviously, we're not using the result at all or doing anything with it. So Still nowhere near Done, but see if it actually does Uh, that's a missing semicolon though, which is not so bad I've made it the wrong kind of thing somehow. Does this one need to be one of the star ones? Do the star ones go at the beginning? See as you can tell here, this is like When we start fumbling through the c syntax. No, okay, let's see How can I grab so I would need to know more regex I guess How can I find a spot in the code where something creates an mp object t As a variable by calling another function You know hard, isn't it? name equals So that's pretty similar nature to what I'm doing Maybe my error is not with The variable that I created but instead with the slash thing could this actually be Or I didn't add any kind of import or anything like that. I wish these would be clickable If k playing with cats nice Forget it finding monkey P object t name equals call the function Let's see actual error say stat result. Oh unused gosh Okay, obviously the insular here Uh, it is difficult though. How can I get a thing out of it? um so we need to Treat it like a tuple and pull a value out of it Um, okay, so this takes an mp object t that it calls x y tuple We want all of this I think so We're not gonna we're not gonna have x y And then when we get inside of here instead of And instead of putting these in x y That's what we'll put in our json So if it equals none, let's just raise an error for I guess let's return A json error would be a better way to do it. I think right this is gonna go in here Oh, should I have not done that? I probably should have not done that All right, if that was none, then we're just gonna say error stat result Was none Except we need these in this Okay, if it's none do that If it's not a tuple Do this, but we change it Then here if it was actually successful, that's where we can get our Stuff out of it Which is gonna be what now those were all ints. I think Or where they floats ints Are they always gonna be ints the way these have f in their name makes me think they would be floats, but I guess not Main two we need are these Well in this Or I guess Maybe blocks. I don't know if we're supposed to use block size or fragment size in my case. They're the same I don't know if they will always be the same though So let's see if I can pull int block size Equals Oops, we have the wrong one of this still here It's also not gonna be two. It's gonna be One two three four five six seven eight nine ten I I just put the wrong one in there. There we go. Okay. It is ten That's block size Let's try just like that. I think right. We at least have used our variable now. So We should be able to make a build. I think Block size and you yep Should have known that one, huh? Let's try to put it here You just put it in with no pluses like that Or should I be using the substitution? Maybe some of these are though, right? Maybe it has to be a string potentially We want percent d okay Okay We did need we need to import something for this Where did I see it being used? Not very many places Should we import it from there? Findings instead of shared modules Yes I wonder what's disco Okay So if that works, we'll have 512 as free which is obviously not the correct number, but it is A number that we got out of our tuple that we got back from calling stat vsf It like uh Reboot it again boot looping did not print this uh Not print the hey buddy get down from there So it did not print this in the repl but it says heap allocation when vm not running please file an issue with your program Just reset to exit safe mode. My code doesn't have anything Except for imports it turns out So did it get to safe mode? Because of my web workflow thing Okay, it's currently not in Safe mode and I do see codepie printed this it's on the screen It didn't show up here because it actually printed before to got connected Um, I guess we could put a time sleep or something if we wanted to be able to see it, but It's all right for now. So it's not Right now it's not showing safe mode. I'm gonna go to here That works cp slash version All right fingers crossed Not version though. We want disc info No, that crashes it Yeah, that crashes it all the way to safe mode We did something wrong for sure um shoot The problem is we can't just leave that because And it will fail for having an unused variable What if we don't do this line? so Now we are calling That We're getting the response. We're checking it for none We're checking it for if it's an object We're creating items We are trying to pull the 10 items out of The stat result But then we are still just hard code printing our old strings What exactly is safe mode a good question safe mode is So, okay I should say I should say a fair warning before I answer like what I am answering is my understanding of safe mode um And I certainly could be wrong so like Bear that in mind don't necessarily take whatever I say as like a hundred percent definitely for sure the exact right answer Because I the truth is I don't know a hundred percent of the way with that out of the way my understanding of what safe mode is Uh safe mode is a separate mode in circuit python where it will not execute the code py file So ordinarily in circuit python when the device boots up the first thing it will try to do is try to find a boot.py file If it finds that it will execute the code that's inside of it typically that will cause it to print out this stuff and boot out here Um, you know whether or not you have a boot py you'll get this stuff printed out Into your boot out dot text after all that's done the next thing it will try to do is launch code py In safe mode it will not launch Uh code py for sure. I don't know about boot py whether or not it will do that one or not Uh, but it won't launch code py the idea being That it is like a hard crash of the circuit python system Uh within circuit python you can have code that raises an exception at the python layer And then inside your python code you can catch that exception or Even if you don't catch that exception then you will see You know inside the repl You would see some kind of exception error get raised get some kind of print out or whatever your program will stop running There will be a trace back inside of here with your exception. That is if uh the error is like successfully handled by circuit python If the error is so bad that circuit python itself Can't actually handle it then the circuit python program crashes When that happens your device reboots and it goes to safe mode so that it won't execute code py The idea being you know the thought being like code py is probably what caused it to Hard crash Therefore we go to safe mode. We don't launch code py that way. We're not just stuck in a boot loop of hard crashing um, this lets you break the cycle of Hard crash and then it comes back up in safe mode. It doesn't execute Therefore, you know, you can change code py you can make whatever modifications you need In order to get rid of whatever the code that caused it to hard crash was Oh safe mode dot py i've not even messed with that one actually Safe mode that one's relatively new. I believe but yeah, I haven't even messed with that one at all yet. That's a good point though Um, so that's my understanding. It's like a secondary mode when circuit python hard crashes It will take you to safe mode I think you can access it yourself too if you press the reset buttons. Just right. I don't Ordinarily do it that way. Usually when I get to safe mode. It's because it hard crashed Okay So we made this build we want to get to bootloader Copy that I should have waited maybe an extra second So this is going to tell us whether or not Whatever I did to hard crash was this this or This part down here and the substituting into here If the hard crash was a result of these lines or the substituting I was doing down here Then we will not hard crash this time However, if we do still hard crash this time, we know that either this line or This line or I guess maybe this line one of those is responsible for the hard crash We are back up. We are on the same IP So we will validate That we're alive by going to version Then we will try this So hard okay that one hard crashed so we know that it's Keep allocation when vm not running allocation You can also programmatically go to safe mode. Oh nice So if you want to reset yourself from code or if you want to provide your own like press this extra button or whatever to get to safe mode The problem here though is I can't I can't build this Because it will tell me well, is it unused if I check it in here Maybe that counts as a usage Let's say it will tell me unused variable It won't actually So my next guess is maybe that we're not supposed to pass a string like this. My next guess is going to be uh, maybe we're supposed to be passing like a mp object string or something that's not just a literal c string like this Uh, this will kind of hopefully rule that out for us because if we still go to safe mode Then we know that this is actually the line that's causing it In boot litter copy that that actually made it. Okay 21 We're back up there Are gonna just go back and forth again just to like validate it's actually alive and working That much of it No still crashed. Okay. I think we don't we're probably not supposed to be passing a string like that and so the other place where this gets used is In shared bindings where it passes Const char Path We need to do this Buddy, don't climb the window, please How's it going digit ebb? Use this only Uh p string get string Uh, this one's a object So this one takes mp object t path in Seconds Uh, how do I get my literal c string to be a python string? This gets used on arguments a lot And typically get used on a hard coded thing to object This makes me think we will get The right are we gonna get the right thing? Double knight dreaming of a way to create 10 inch supple for mailbox So I found literal string Gonna be that easy. Um I don't know. I mean, uh, no, I don't I don't know. I don't think so. Maybe though. Scython. I've never seen a thing that says scython like that This is the old code Or Path is unused. Okay Yeah, I'm not a lot farther than I would have thought. Okay. There we go. I was gonna say I mean honestly, I'm surprised it wasn't just like I don't know what scython is I think we're going the wrong way. We need to get it to an object t So we need to Take We need to take a literal string and turn it into an object t Where is the place where all of the helpful functions for this are at? Um I don't remember Like where's this defined? My object string Try turning it off and out again. I don't know Yeah, it doesn't know things Doesn't the only thing it knows is which words are commonly together In the data that it consumed chances the It creates an answer that's relevant and helpful in the real world knowing only which words Are more likely to be together in the code or in the text that it consumed I think fairly small for the most part um It's that pi object quoted string print Ring make new bytes make new index the pointer substring string join ring split ring write split ring finder and find string are fine string index our index starts with ends with any strip string strip l strip format helper Where is a place in the code where it would convert a literal string Into an mp object t string format replace copy the object new string Yes, that looks promising f o object new string path out f o goes to here Thank you Nice, Ben. I don't know how you found that That does look right to me Nice pointy. Yes. Nice Thank you my friend Well, that's not what I wanted to do Okay, what are we doing? Let's back So we're still in the version where it's like it's back to being hard coded We're not actually gonna see the fruits of our labor here or I guess to put it another way If we are successful the only thing that happens is We don't hard crash and go to safe mode, but we do still get Our hard coded response. That's not actually the real data One step at a time You're just crossed Still crashed I feel like we're much closer though. You feel like we're much closer Hmm, I'm just gonna get rid of that line news variable Python pi pi object h This will tell us if we successfully created path o That did not crash It did not print which means that it wasn't none Hmm We we need this actually we need a const char pointer Oh, but this will get us to that Are we Are we like Are we taking an unnecessary trip through Micro Python object Can we take can we take a string and get a Const char Asterisk which I think means something with pointer C string Do we need to put it in a variable? Yeah, that may Work i'm curious though that feels like we're going from string to Micro Python object and then from Micro Python object to Constant char thing That's weird path string Set but not used But literally the next line uses it Did I have done string and not str? set but not used It's not true because I don't think I can do this Doesn't matter anyways because it still thinks path string is unused But why is it not doing this? Now path is unused I'm supposed to do Maybe I have path And if I turn this off, then it will say path string is unused And I don't know why it counts as unused though Maybe we don't want this Well, first of all the way I created my string was way different. Anyway This feels wrong, right? I feel like this is probably stupidly simple and I am completely showing How I have no real understanding of C an interesting syntax So I don't know is standard string. I guess is that what we have is that what this is? Is this a standard string std colon colon string? Does this not count as a usage? It feels silly that I'm like Trying to make a pretend usage to get it to compile we might this Has to be the wrong path, right? I guess I could go back to doing the object. I feel like we should Now that I have seen this though, I feel like we shouldn't need the object But I guess at least what was working maybe Wish I could just do this, but I don't think you can right? Excuse me It's the one I copied from first Not really Because it's like not existing Okay, I guess we go through object length I don't know. It feels like we shouldn't have to I'm guessing that we don't have to but I don't I don't know how Get string Yeah I will agree to that Maybe what if we say c plus convert literal string to crossed char Part of it is I don't is std string is I don't know if that's the thing I have or not, right? I don't know if that's what a literal string is which I'm sure like obviously that's a very Very very very basic component of the language I'm obviously missing But I just don't know That's actually what a literal string is a lot of these say c plus plus Makes me think is that Relevant to us or not and calls it a string This makes me think a constant char is a string Here's crossed Hard crashed How's it going axle? I don't know the answer to that I mean, I don't think const is a type by itself. I think it's like a modifier or whatever. I don't know the right term Truth is I don't know anything about it. What I know about it is like Kind of attributed from java I doubt really carries over the way it does in my head But I mean it's like a modifier you would say const and then the type of your variable and then your variable name So it's like modifier for the type Basically means it can't change after you set it I think it's a char and it const is limiter on how the memory is managed and crash Printed the slash So we have a const char Star path char We printed it it definitely has a single slash in it but if we pass it to common howl os stat bfs s We get a hard crash I think we have to do something with this or else it can't compile. Is there a way I can ignore Is there a way I could ignore unused variable? It'd be nice if I could Compile anyway Because like now I need to basically make a fake usage Just to be able to compile but the truth is Really what I want to know right now is does this line cause the hard fault? I don't want to do anything with the result or anything else All right brb Yeah, I like to be able to build without it though I could sprinkle in some more prints, but I'd like to be able to build with unused variables So I'm thinking that We're not allowed to call this Kind of thinking we're not allowed to call this I think maybe inside of here. We're like are we outside the circuit python vm I feel like maybe web workflow in here is like outside the circuit python vm And then maybe we're not allowed to use this because of that Like maybe we are creating the right kind of thing and passing it in And in fact, maybe even Just this technically would be enough, but We're not allowed to call this Because we're not actually inside the virtual environment That's my theory right now Unused for Yeah, well, I mean I don't want to leave it there for ever and ever and ever I want to like I want to make one build with it just so that I can like not have code Who's literal only intention in life like this code Will not make it into the final one the literal only reason this code exists is to make the compiler happy Because we pretended to do something with this But this gives us like an extra failure point, right? Like I would love to write my code and run it just this way knowing this is unused But just being able to test like do we get that far Without having to add that code that's like Basically just cheating right like I'm using it for the purpose of making the compiler happy For no other purpose Hard crashed And what it says when it hard crashes is Keep allocation when VM not running Keep allocation when VM not running So I'm starting to think we just can't call this function from web workflow I mean, I Think the VM is running. So I think the error message is not entirely Calling us exactly what's going on, but I think it's implying that We tried to do something from outside the VM This is the thing we tried to do Resumably that made it crash I'm thinking we're just not allowed to do that from here So I guess we need a look maybe in shared module Or wherever this came from third module This just turns around and calls that UFS Yeah, and I think this error message also is one that's not generally Probably seen by users This feels like not the right answer, but I also don't know though, right like Okay path out. I guess Is doing state VM stuff here though This time it's building a lot more stuff news variable plus a declaration so we need to We would have to include that if we wanted to use it But I don't know where it came from See, this is also in shared module os But if we're not allowed to use the os stuff, then I think this is not actually gonna work Maybe this bsf bfs is that one of the ones imported here? Okay No, though, right like we're allowed to use supervisor What is fata? What is in here? Is there anything useful in here? This implicit declaration Why does it think it's defining a function though? Recalling a function? Hmm safe mode gc alloc outside vm. Yeah So I do think that's like I think I'm on the right track there. I think we did something we're not allowed to allocate memory or allocate something I guess keep allocation And I think I think the truth is that it's not that vm's not running It's that where we tried to do the allocation from was not inside. I think that's kind of like my theory there That's to do with web workflow. Would it need something? No, we're not even the string that we give it I don't think so. I guess I can't really rule it out. I suppose but I don't think so. I don't I think this is a matter of Like I don't think it's a matter of we gave it the wrong string I think it's either we gave it the wrong kind of thing altogether like for a while I was trying to give it an object versus a string versus a const char or whatever I think I have figured out it's supposed to be a const char But maybe I'm still wrong So like maybe we're giving it the the entire wrong kind of thing or the other option in my head right now is that We're giving it the right kind of thing and it would be working if we were calling it from inside The vm, but I'm guessing like does web workflow exist outside the vm I feel like web workflow probably exists outside the vm right because it doesn't it it runs Independent of codepy and all the rest of the stuff And so I'm thinking that Right now I'm thinking I'm passing the right kind of thing Potentially even passing the right string as well, but we're not allowed to actually call the function we're calling From outside the vm and we are outside the vm I think this is again. This is all hypothesis Yeah, it's nice when it works was Feeling like it was a lot nicer about a month ago before I started having any kind of problems with it. I will tell you that That fs file system circuit pi that fs Maybe No Plus three It's odd you control click Yeah, I don't I never I don't even know Know what this is creating Maybe that one's a definite maybe Yeah, I don't I don't know obviously. I don't know what's wrong with it. Otherwise I would fix it, but I'm feeling like it's hardware Which has definitely soured me a little bit on Company that I bought the hardware from Maybe it's not though. Maybe it's software So one thing I will say these are using like f underscore which is Similar to what scott put fat fs Yeah, I don't know what this means But I think that you're probably on the right track because a lot of these like f open dur, right Where's another one? There's some more in here F rename F unlink So it does feel like this Would be the thing that we would pass to here as the third Variable path, I guess would be just our slash But I don't know what goes here It's f result Don't know what to put there and then I don't know what to do With this result object to get stuff out of it See if it compiles Yeah It's yeah, it's snappy. I will say when it when it's working. It's pretty snappy and it Till more recently here it can do a lot of things all at once and doesn't really get too mad about it And I like I said, I like I was super happy with it. I'll say like I was definitely super happy with it Could perhaps get back to being super happy with it if we can Once I am a little more certain that Some of the weirdness is in the past So Unsigned int but argument is const char. Yeah Unsigned int Number of free clusters But I put 512 that seems random, right? Number of free clusters How would you know that? See this is weird. This says it gets the number of free clusters the store Maybe that's where the result goes That where the result goes What's a d word? I think we don't need this stuff anymore right now. This is actually technically part of our other attempts Oh, okay. It's out. I see. I don't know if that's the right way to do it Oh, maybe unused result. Okay Unused result. Geez. I don't know how am I gonna even use it. I don't know what you do with it Where's next? Is this why is this so long What is wrong with this? This is like wonky. Where's the rest of it? Just that I didn't see that Uh, we could do this It's like a good thing to do with it I don't know if I actually need to put something in here for it to count too many arguments but got int Expected d word aka unsigned int I got int This looks like a different signature many arguments Seems wrong, right? Seems like different Seems like different uh signature. So we would not need the slash Instead it's just fs and the output thing And they are actually in the other order strangely I need an I need a I don't know how to make Can I just make d word? Or d word star uninitialized unsigned int Okay What version are we actually on here? Like what does this actually do? So This will just print hooray if it was successful And it will still put the hard coded one of these out. Okay If we see hooray, then it actually did at least Not puke which is It's up in the right direction Even if perhaps a small one Still hard crushed It has a different message now. It says fault detected by hardware This one Well, I think we're probably giving up for right now I guess because I highlighted something Let's look here Maybe I need and maybe I need ampersand Let's go look What is it? Okay, that's actually that's pretty close. This is different But it does look like we want that And then maybe we could get by without this And This Like it builds at least Nothing writing memory where it shouldn't be Yeah, very possibly Would not be surprised Unfortunately, I'm a bit of a A bowl in the china shop so to speak with c code like not really knowing like Like treating this one that was here as a an asterisk and this one as an ampersand and not having a clear picture of Why they would or wouldn't need it I think makes it very likely for me to Tell the CPU to do something that's probably not very good for it to do I'm guessing is how we got to the hard fault. Okay fingers crossed Yes, it didn't hard crash and we got a result Did it print hooray? It did. Okay. Are we actually We actually so close So then if we went I want to keep this one. I kind of want to keep this one No, it's fine. We could copy it from here if I needed it Percent d Free clusters What was it? Oops Looks like it's gonna build Go back to version It's ready Are we gonna get total though if this is only giving us one number?  Hold on. Hold on. Let me get it out of there because Play with it. This is backup version just Didn't crash and it returned 416 Was that Indeed it was okay So if we multiply 416 by 512 That is going to give us the number of bytes Times 512, but I don't know how we would get total Or if we can get total Is there a Is there a different Thing then get free maybe there's like get space or size It's like why is nothing happening? Didn't copy it That is our number of free bytes. I wish there was like size By this oh, it's uh get free okay volume management I mean get size feels like a winner, right? Well, it was just size. I think it wasn't get size Guys But that's the size of a file Those are the only things that say size That says space Only one match Well, I don't know For the 512 there must be some literal for the block size so um maybe Maybe on the one that's doing the size of the files What's something doing the size of the files? This is my code though commentate all this out Is it different on different boards though? I think when the file name is slash it means volume So maybe we could use size with slash Okay, so that handles delete request that handles move request This handles get request Name directory it doesn't have the size modified file size File info dot size file info came from this seemingly How does So this was me typing fs and pressing enter It returned an html document On that html document it contained a load for this for this for this This made a request to the exact same URL But it got a different type of response. How did it know How did it how did it get a different kind of thing? Is there a dot? Maybe get her post But it shows get on both Method get there and method get there It has accept type as json does the server can the server return Different stuff based on the accept header Really Okay, I think I'm gonna call it for now. Usually I go about two hours. It's been about two and a half So I'm ready to definitely get up and walk around and do some other stuff equals slash Returns the list that's the api. Yeah, but I don't from the web Programming perspective. I don't understand how it works because my browser made a get request to slash fs slash That get request returned this html page On that html page it loaded this javascript and the css and this icon and This json here And then part of the javascript inside of here also made a get request to slash fs slash which is the same Address as this This made a request to the same address But it got a different I mean a different response, but a different kind of response as well. Obviously the first one Was html whereas this one was json. Ah, there you go. Yeah. Oh, I probably just wrecked the uh Yeah, I totally did. Let me fix that done that I guess Fortunately, it's tough to read without I suppose response away fetch Oh, that's passing those headers You can read the javascript Yeah, but I didn't but like on the server side. I mean first of all, I didn't know the server side could Have different behavior for those different accepts for one thing but even if that's Possible Maybe is this checking for it somehow? Where is this at? Then state header value I don't see anywhere where it has that logic though. Like I don't get In the server side and the code in here, I don't get how it managed to draw a distinction between This first request here where it returned this html and then this request down here Which came from fetch inside the javascript where it returned a son Maybe that maybe this bit that we were just on was the magic though This is like setting it into a header string. Maybe somehow this No, well, this is if it ends with json So in our case, it doesn't it's slash fs Or is that other one this one? Maybe somehow this is the logic, I guess I don't really follow it. Maybe this is somehow making it so that if the accept was application json Then it's going to know to return that Based on api one rather than the actual html Um This is a request json All of our tools isn't showing the headers just the headers That's good. And then content type. I mean it is Well, that's a response header though except would be the but it is I mean the accept header is definitely One of the differences between the two requests It's just I don't see any code in here. That's like if except equals application json then return this thing else if except equals, you know Text html then return this other thing. I don't see that Logic really in here somewhere. Maybe this I guess but this is looking at the end of the file name In our case. We're not we don't have a file name just fs slash There's nowhere else where this is at Then the only place where this exists is those spots. We already saw None of which to me seem like an if statement. That's doing that I mean this one would be the ending of the file. So we're not using that one right now Somehow maybe this I guess is doing it You're just on a search request json request json By static that one would be the html. Okay This is request json. Is that the body? Load in the body Make sense. Thank you. It's the mine types of the files Yeah It's json. So is this does this it turns into just a boolean I guess request json Which ultimately maps back to that except I guess Okay, I'm gonna call it for now. We did get the free space Um, I think what I'm probably gonna end up doing is submitting a pr with the free space And not the total Senior responses anymore 404 That only work once Recursion for question mark. Not sure what you mean by done I've wrecked it somehow. It's broken now I got I don't always get 404. I'm getting a response from the web server, but it's 404 Well, how did we man? Okay Nothing cp cp Yep. Thank you. Appreciate it I think you could get the total with something like this. I will have to try it later fstat on path F no I will try it out um So to wrap it up, I will say, um, I will not be streaming at the normal time tomorrow Ordinarily I stream at 10 a.m central time on saturdays Uh, which is tomorrow, but I won't actually be streaming at that time tomorrow I think I will be streaming but it will be later in the day some time and I don't have the exact time So unfortunately if you want to catch tomorrow's stream, the best advice I could give you is just keep an eye on the live broadcast Chat channel, um, and I will drop links in there when I get started But I have other plans for the morning So I won't be around at 10 a.m to stream, but I am planning to stream later in the day once the rest of my plans are over Uh, those numbers are different Shrat That means we need to figure out how to get that Somehow So that's something else we have to do I don't know how to find it though It's interesting. There are different fat types too. I thought they all would use the same. I didn't know that would be different Definitely interesting So we need to Try to do the total and then we need to figure out how to get that 512 versus the 1024 versus the whatever We need to figure out how to get that programmatically so that We can then multiply it to get to our bytes Um I will whenever I do stream. I think probably keep working on this So if you're interested in seeing the rest of this when I give this a try, thank you to who's this isek ben Thank you to isek ben for posting this Code which might get us the total here That is probably what I'll try when I do pop on the stream tomorrow Which again will be not at the normal time of 10 a.m central time instead. It will be later in the day Um, but that is it. Thank you for everybody who has been watching I appreciate all of you watching along and hanging out I especially appreciate those of you in the chat who are helping me out Antique data near doc isek ben did you devon see grover Keith Really everybody I appreciate you all in the chat Definitely the folks who are helping me out because as you could see I was very much fumbling my way through it Uh, and without help from the chat. I probably wouldn't have made it as far. So definitely super appreciate it Um, I will See you all later. I hope everyone has a good night I will see you uh tomorrow if you want to tune in just remember though Like I said a bunch of times already sound like a broken record. I'm sure it will not be at the normal time N a.m. It will be later in the day. So have a good night everybody


Hello and welcome to the session. Let us understand the following problem today. Let a is equal to minus 1, 0, 1, 2, b is equal to minus 4, minus 2, 0, 2 and f, g are that from a to b b function defined by fx is equal to x square minus x, x belongs to a and g of x is equal to 2 into mod of x minus 1 by 2 minus 1, x belongs to a. Are f and g equal justify your answer? We know that two functions are equal f from a to b and g from a to b are such that f of a is equal to 0 of a where all a belongs to a. Let a is equal to minus 1, 0, 1, 2 and b is equal to minus 4, minus 2, 0, 2, f be a function from a to b and g be a function from a to b defined by x is equal to x square minus x, g of x is equal to 2 into mod of x minus half minus 1 for all x belongs to a. Now we check whether f of a is equal to g of a for all x belongs to a, x is equal to minus 1, fx is equal to minus 1 the whole square plus minus 1 which is equal to 1 plus 1 which is equal to 2, g of x is equal to 2 into mod of minus 1 minus half minus 1 which is equal to 2 into mod of minus 3 by 2 minus 1 which is equal to 2 into 3 by 2 minus 1 which is equal to 3 minus 1 which is equal to 2 therefore minus 1 is equal to f of minus 1 now is equal to 0, f of 0 is equal to 0 square minus 0 which is equal to 0 and g of 0 is equal to 2 into mod of 0 minus half minus 1 which is equal to 2 into mod of minus half minus 1 which is equal to 2 into half minus 1 which is equal to 1 minus 1 which is equal to 0. Therefore f of 0 is equal to g of 0. Now at x is equal to 1, f of 1 is equal to 1 square minus 1 which is equal to 1 minus 1 which is equal to 0. And g of 1 is equal to 2 into 1 minus half minus 1 which is equal to 2 into mod of half minus 1 which is equal to 1 minus 1 which is equal to 0. Therefore f of 1 is also equal to g of 1. Now at x is equal to 2, f of 2 is equal to 2 square minus 2 which is equal to 4 minus 2 which is equal to 2 and g of 2 is equal to 2 into mod of 2 minus half minus 1 which is equal to 2 into mod of 3 by 2 minus 1 which is equal to 3 minus 1 which is equal to 2. Therefore f of 2 is also equal to g of 2. Thus for all a belongs to a, f of a is equal to g of a which implies f and g are equal functions. Therefore the required answer is yes. I hope you understood the problem bye and have a nice day.


Welcome to this video about the Lorentz Attractor. In this video I will demonstrate a part of chaos analysis, namely Attractor Reconstruction with Python. We will talk about the Lorentz system in general before elucidating the Reconstruction algorithms. For Reconstruction purposes we will first apply the more classical Tarkin's delay time embedding algorithm. Afterwards we will elaborate on a more recent approach, namely the spectral embedding. In our case the spectral embedding is based on the Plaschen eigenmaps in combination with a principal component analysis and a k-nearest neighbor approach. Let's get started. The Lorentz system has been proposed by Lorentz in 1968 and encompasses a description of a weather system, which resembles a chaotic system also. Lorentz discovered this system by shortcutting decimals during conducted simulations. The strange fractal attractor is similar to the shape of a butterfly. We will see a graphical representation in the next slide. In addition, the underlying mechanics, namely sensitivity to initial conditions, is also reflected in the name butterfly effect. Next to sensitivity to initial conditions, chaos constitutes topological transitivity and dense periodic orbits as main characteristics. The butterfly effect elucidates the sensitivity to initial conditions property by drawing the image of a butterfly flap, which is capable of causing a tornado in Texas as stated on a conference. The system consists out of three variables and according parameters. You will take a look at these equations next. Lorentz did not create a model alone. He had help from Alan Fitter, which conducted numerical simulations and by Margaret Hamilton, who assisted in the initial numerical computations. The model represents a simplified atmospheric convection model. There exist several combinations of the parameters SR and B, which renders the system chaotic. The parameters have a specified meaning. S is the Prandtl number, which is defined as the dimensionless ratio of momentum diffusivity to thermal diffusivity. R is the Rayleigh number, which is a dimensionless number associated with buoyancy driven flow. And B is a physical layer dimensionality parameter. In the depicted example, as you can see on the right side, S equals 10, R equals 28 and B equals 2.667 and the DT is 0.01. This system is taken to demonstrate attractor reconstruction methods. We will take a look at the Lorentz system and not at a time series, since a showcase of the mechanics is more clear when using a mathematical and fully disclosed system. Now, I will present you the Python code for the Lorentz attractor. The code that I will put the script onto our GitHub account and link it in the description. Furthermore, the Python code for the Lorentz system itself is also stated on Wikipedia. It is more and more the case to find code on Wikipedia, which I find really convenient at times. As you can see, we're within the Python code I want to use and present to you today. So, the first thing we're talking about, we don't require many packages. We just have the standard NumPy, Mudplotlib, Pyplot, and for the spectral embedding, we require the package spectral embedding from SQLearn out of the module Moneyfold, which makes our life so much easier and spares us a lot of coding, so we apply that. First thing we take a look now is how to generate a Lorentz system in Python. As I indicated, you can take the code out of Wikipedia or write it yourself. For the Lorentz system, we have our coordinate x, y, and z, and our parameter settings, s, r, and b, as indicated in the presentation, and we just input here our equations for the system and return the respective points. Furthermore, we're going to set the parameters dt and the number of steps which we want to calculate. The number of steps are actually the data points we want to generate with the system. Since I'm using a laptop, I'm using only 10,000 points, but you can blow it up as much as you like. It's no problem at all if you have a nice GPU on board. What we require next is to set up some initial steps and set the initial values, and then we can just iterate through our numbers we selected here above and calculate the simulations right here. And at the end, we just plot our system in 3D, and that's basically how you can create your own Lorentz system in Python. Please be aware that you can just change the colors and all the parameter settings within the plot as you like if you don't like the color red, or I don't know, you can just go for it. One notable mention is that if you alter the system parameters that the shape of the attractor will change too, so it's definitely worth playing around with it. For now, I will just execute the code and take a look at our Lorentz system. As you can see, since it's a mathematical system, we can see the attractor straight away. So on this note, I'd like to mention that if you reconstruct a time series, this won't be the case at all if you are in bad luck. So that's why I chose the Lorentz system. With a pure mathematical and fully disclosed system, you will see the attractor right away. We have each coordinate variable on each side of the axis, so we can see the system in its overall beauty for the given parameter settings. So what we can do now is take a look at those lines, which are called orbits or trajectories of the system, and they don't intersect ever. It doesn't matter if it's a time series reconstruction or if it's a mathematical system, those trajectories will never intersect nor will they repeat twice. Even if it's looking like they are intersecting, they are not intersecting, and we can see it when we take a look at our Lorentz attractor. And here we see why it's called the butterfly effect or butterfly attractor. And we can clearly see if we're shifting it around that those lines aren't intersecting. Please keep in mind that if you reconstruct other data sets that they might be of higher dimension than three, and the attractors may look a little bit awkward, but the same rule applies that they won't intersect. What else can we do with this Lorentz system? We can just flip it around once more and take a look at all of its sides and go back to the original view. And what we can do now is we can just take a look and zoom in, where we can clearly see all the basins of attraction of the Lorentz attractor, where you can see here and here that all those trajectories are landing at one fixed point or periodic orbit, which is depicted here and here. And if we zoom a little bit more in, we can clearly see all those dots we generated in our very nice Lorentz system. And we will return to our presentation before we will jump into the reconstruction possibilities. Welcome back. We will now talk about our first reconstruction algorithm, namely the Tarkens delay time embedding or Tarkens approach. The earliest variant of the attempt to reconstruct attractors, not from a mathematical system yet from a time series, is given by Tarkens in 1981. Tarkens is one of the pioneers who coined the term of strange attractors among others. Please note that I will not present the theoretical foundation, mathematical definitions and underlying rationales. I will give references to the according videos at the end of this video for you. The theorem is implemented by iterative shifting of a comb through the Scalar data series as depicted below. You can imagine blowing a balloon to full size. At first it is flat, then inflates and shows its true form. In the Tarkens approach you shift a comb through a Scalar time series as mentioned. In the illustration you see the index values for the time series 1, 2, 3 and so on. You select a delay time tau, which is normally based on the autocorrelation functions, which means the delay time is to be selected in such a manner that the autocorrelation is insignificant and yet the delay time not too largely chosen. Then you take the first index of the time series as value for the x-coordinate, the index value with x plus delay time as the y-coordinate and the x plus 2 times delay time as c-coordinate for the first point of the reconstruction. Note that you will require a sufficiently large data set for this procedure. Subsequently you shift the comb through the time series and plot the created 3D points accordingly. Now some theoretical notations are required to deliver a full picture of the algorithm. Reconstruction theorem explicates the existence of a transformation between the original and reconstructed phase spaces with vector functions. And in addition this implicates property preservation under reconstruction, meaning that the characteristics of the dynamical systems do not alter under the application of smooth coordinate changes, which means the fiormophisms, yet the preservation of original geometrical structures of phase space is not implicated either. We will now take a look at the Python code for the Tarkin's delay time embedding for our Lorentz system. So for the Tarkin's delay time embedding algorithm we are required to use a scalar time series and no 3D system. The first step is to just save the Lorentz coordinate variables as separate time series. The second step would be that we select one of those, then we select the delay time, which I chose to be 60 for x and y due to the autocorrelation diagrams and it will be 20 for z. And please note it has to be an even number or the whole comb will not work. Speaking of the comb, here we just divide our time series in three parts based on the delay time tau value we selected up here. We are going to shift those comm through the complete time series and save all the points in a list and finally we are just going to plot the complete system. That's the whole magic around the Tarkin's delay embedding and what I am going now is that I systematically will show you the Tarkin's delay time embedding graphics for x, y and z variables and we are starting with the x variable. We can see another 3D system just that in comparison to the Lorentz attractor we plot x t versus x t plus the tau namely 60 plus x t plus 120 which is 2 tau and what we can see here now is for the x variable for the x coordinate of the Lorentz system we can see the Tarkin's embedding approach and the reconstructed attractor. Please note that if you reconstruct a time series you won't get a nicely pattern like this you will most likely receive either a ball which means that your system is maybe not chaotic or has some noise attached to it or you will receive something like a spaghetti monster which is purely acceptable for the Tarkin's approach. A clear and very distinct attractor can be received via the spectral embedding which I am showing later. So what we do now I will just zoom in in this reconstruction and we can take a closer look at how the timely displacements shape the Lorentz variable x. To continue I will just switch to the y variable. Please note that the delay time is the same based on the auto correlation diagrams which I will not show today and we will take a look at our y variable. The approach is basically the same we take the y time series iterate the comm through it and plot the x t's versus the x t's plus tau versus the x t plus two times tau's and we will receive a very nice reconstruction of the Lorentz attractor's y variable As with the x variable please keep in mind that if you are using a normal time series you will probably end up with a spaghetti monster representation. This is really normal so don't be afraid and don't get anxious if you don't receive very nice representations. I will just flip it around and grant you a very nice look of it before we will take a look at the z variable. For the z variable we will just select the data for it and we have to change the delay time to 20 according to the auto correlation diagrams and now we can have a nice look at the reconstruction of the z variable of the Lorentz system which in my opinion looks quite nice. We can just regard it from all sides and we can see that it is quite shifted in itself and it really looks gorgeous. What we can do now is we can just zoom in again like with the others in regard to the fractal basin of attraction right here in the middle and we can see all those little data dots and we can see all those nice trajectories lining up and now you can clearly see that they don't intersect nor repeat twice and that's it for the Tarkin's approach. We will now go back to the presentation and talk about the novel approach the spectral embedding. As you have seen the Tarkin's delay time embedding is a simplistic algorithm easy to implement and it provides you first insights. To continue the second method of reconstruction of attractors is a more recent variant labeled spectral embedding and is a little bit more complex in its application. Parallel to the Tarkin's embedding a novel embedding technique using manifold embedding and Laplacian eigenmaps is implemented by Song et al. 2016 by applying a spectral embedding algorithm therefore it is assumed that the strange chaotic attractor of a given time series to lie on a low-dimensional manifold which is embedded into a high-dimensional Euclidean phase space. It is premised that the topological structure of the dynamical system in phase space can be displayed by few independent degrees of freedom embedded in a low-dimensional non-linear manifold visible by calculation of non-linear dimensionality reduction algorithms. In our case it's a principal component analysis. To conduct a successful mapping and extraction of the hidden strange attractor of the chaotic system Laplacian eigenmaps are determined since in practice it is not possible to measure components of an unknown high-dimensional vector space. Spectral embedding is executed which forms an affinity matrix based on a nearest neighbor algorithm and a principal component analysis given by the specified function and applies spectral decomposition to the corresponding Kraft Laplacian. The resulting transformation is given by the value of the eigenvectors for each data point. For the PCA component number it is common to apply the embedding dimension of the system. I also displayed for you a heuristic I came up with during my empirical experiment for my VHD thesis which results in the most workable reconstruction therefore you can just take one percent of your data length and add one and a half times your delay time. Some of you may now denote that the resulting number of neighbors is quite high yet please remark that for reconstructions you have to have a lot of data. As with the Tarkin's embedding I will now guide you through the spectral embedding in Python. For the spectral embedding we have to select the PCA components which normally resembles the embedding dimension as a minimum for the respective system. Since the Lorentz system is a mathematical system and fully disclosed we know that the dimension is 3 so we pick the components equal to 3. For the neighbors we just pick 20 basically for the mathematical system it isn't as much as a matter as for real time series data finally we have to select the affinity operator which is the nearest neighbor algorithm as discussed. For now we have two procedures I want to present you the first is that we will able to show the attractor based on its eigenvalues by just inputting all variables x, y and z into the procedure instead of using the delay times. This is done here in this part we will comment that out once we will get to the single variable reconstructions but for now I want to present you the whole Lorentz attractor based on eigenvalues. The fitting of the attractor or the calculation of the spectral embedding is basically just a tool liner which you can see here we input our components we select our affinity operation, select a number of neighbors and select an additional parameter and say okay please fit the transformation to our selected data set which in the first showcase is the complete Lorentz data we simulated above. To conclude we will just plot the data and take a look at it which we will do now. As you can see the reconstructed attractor still looks like the original one but it looks more sorted in my opinion what you can see here is the result of the spectral embedding of the whole Lorentz system where you can see in this part here that all those trajectories really do line up perfectly don't intersect and never repeat and I have searched the whole web and I guess I'm the first one to show the Lorentz attractor based on eigenmaps. Finally I will show you the reconstruction based on each Lorentz variable on itself. To show you the reconstruction of the x y and z coordinates on their own we will go back up in the code to the tokens embedding section and we will select the x values and we will have to change back the delay time for x and y and since we are using them we have to change also our number of neighbors which we will just take to 60 this time and now as you can see we have commented out this section where we selected all x y and z values and we will work with the delayed x values this time. The spectral embedding will not calculate the eigenvalues for x y and z but only for the delayed timed axis this time. I will execute the code now and we will have a look at the eigenvalue spectral embedded x of the Lorentz attractor and as you can see that's quite an intriguing view we will now zoom in and out to get a closer look. To continue we will take a look at the y reconstruction via spectral embedding and we can see that the shape of the reconstruction is quite similar to the x coordinate based on the eigenvalues like with the others we will take a zoom in and a zoom out for the z variable we changed the number of neighbors and the delay time back to 20 due to the autocorrelation structure of the variable and we will take a look at the attractor reconstruction of the eigenvalues for the z variable right now. As you can see we have a little cone here and it just feels like that the flat surface we have seen during the Tarkin's approach has been shifted outwards now. We will take a zoom out and assume into the reconstructed eigenvalue system and we'll get back to our presentation. As you have seen the spectral embedding provides a more sophisticated and more clear depiction of reconstruction of time series and strange attractors. Finally I will state the references which should serve you as further guidance. I also have copied them into the video description below. Thank you very much please subscribe to our channel and let me know which content you are most interested in. Leave a like and find some related videos in the captions.


This is stock number 10387B. We are here at Summit Automotive in Fond du Lac, Wisconsin near new and use Dodge and Dodge Journey headquarters today. We are checking out this really clean 2012 Dodge Journey SXT. This vehicle has a 2.4 liter four-cylinder motor and from this HD video you will be able to tell for the age and miles on this journey. That is in really nice condition. This vehicle has been fully safe and inspected by our service shop has a fresh oil and filter change. All the fluids have been checked and topped off. This vehicle has been gone through 100% and is 100% ready to go. We shoot all of our videos in 1080p 60 frames per second. So if you have HD capabilities on your computer tablet or smartphone device turn them on right now because it is like you're right here looking at the vehicle with me. And definitely your best way to check out the vehicle quality and condition before seen in person. If you want to check out all the pictures of this vehicle in the upper right-hand part of your screen is the link right to our website. It comes with the painted alloy rims. Primewell Valera tires. These are 225 65 R17s and they have right around 60% of the tread left. So a good amount of tread left on those tires. Front fender is in excellent shape. Headlight lenses are very clear. It has the factory fog lights, the front bumper. No major dense dings or cracks on it. Passenger side fender is in really nice condition as well and that passenger side rim no major scuffs or scrapes on there. As you go down this side of the vehicle, you can see just how clean the body is, how reflective and mirror-like that paint is. We take these HD videos because these are used vehicles and they're not going to be perfect. But you want to make sure that you're getting a high-quality vehicle if you're thinking about purchasing this one. And these videos do that so you can make a smart buying decision from the Comfort of your own home. That's why we offer the Summit Auto Fastpass option in the upper right-hand part of your screen. A link right to our website where you can apply for financing, get pre-approved, see a payment quote, even appraise a trade all from the Comfort of your own home. Back rim is in nice shape as well and the back tires, they look like they have a little bit more tread than the front tires. I'd say probably about 80% of the tread left on those back tires. Only thing I saw so far is there's a just a little ding on that rear quarter, but nothing too bad. As we come around to the back of the vehicle, rear bumper is in pretty nice condition. No major dense dings or cracks. There's maybe a couple little scuffs and stuff, but nothing too bad. Back gate is in excellent shape as well and it does have the third row seats. Back storage area is very clean and these seats do fold down like so for extra storage to get those back up. He just grabbed the strap right here and she comes right up like so.  You can see the rear shocks are holding up that gate nicely. Something you always want to check on any SUV.  I didn't see any dense or dings down this side. And for full disclosure, this back rim is in excellent condition as well. And down the rest of this side, very, very clean. Now it does have the enter and go system, so you just have to have the key in your pocket, put your hand in there and it'll actually unlock the vehicle for you.  There are no rips, there are no tears on the seats. Does come with a power driver seat and lumbar. Factory floor mats throughout, power windows, power locks and power mirrors. As we hop inside the vehicle here, you can see that this one has 43,000 and 15 miles. Comes with a digital speedometer and an outside temp and compass display. Instrument cluster is very nice and clean. Steering wheel is in excellent shape. Cruise controls on the right, information center controls and audio controls on the back and the left there. Comes with the AM, FM and serious satellite radio capabilities.   This one does have factory remote start right there. Passengers side floor mat and seat are in excellent condition. Cool part about these journeys is they have hidden in seat storage underneath the passenger seats so you can put valuables or whatever you want underneath there. Comes with the home lake buttons for your garage door security systems and lighting systems. You also have map lights up there as well as a spy glass for the second row. And we'll take a quick look at the back seats and then check out under the hood. Back seats are in excellent condition as well.  You get in-floor storage one on each side with removable containers for easy cleaning. And to get these seats up you just press this button and then that seat part comes up like so to get to the third row. Third row seats really nice condition no rips or tears and the carpeting is an excellent condition all the way through. Now to get these down you do have to press the bottom button to slide that back and then these seats also fold up fold down like so and they go down pretty nice and flat. I should add that front seat up a little bit more but I can show you that it does have side current airbags and once those third row seats are flat you get a really nice flat surface all the way to the front seats to haul extra things.  We'll take a quick look under the hood I would personally like to thank you for checking out the video today and hopefully from this HD video you'll be able to tell just how clean this journey is all the way around. Inside out under the hood we have the 2.4 liter dual VVT engine engine base very clean runs very smooth this vehicle has been fully safety and inspected by our service shop has a fresh oil and filter change all the fluids have been checked and tapped off the vehicle has been gone through mechanically 100% and is 100% ready to go. To see more pictures of this journey or one of our other 450 new and used cars, trucks, SUVs, minivans, Wranglers, halftones, recoder tons, one-tons you name it we got it go to our website www.summitauto.com full pictures and descriptions of every single vehicle from two locations all at summitauto.com if you like to check out more HD videos you can go to youtube.com slash summit auto remember to like subscribe and share on this video and all the videos that you see there in fact in a second you will see links to subscribe to our YouTube channel on your left a link to more Dodge Journey vehicles like this one on your right if you've not been to our website on the bottom link to this vehicle on our website click those check us out and we really look forward to helping with this extremely clean 2012 Dodge Journey SXT front-wheel drive 7 passenger thanks again


This scoping review examined the characteristics, impact, barriers and facilitators of hospital-based patient navigation programs that support patients who experience injury-related trauma and their caregivers. The review found that these programs have been shown to decrease readmission rates and increase patient satisfaction. However, there are several barriers to implementing such programs, including difficulty recruiting or enrolling patients with short hospital stays and hospital administrators and healthcare providers not understanding the navigator's role. Additionally, the review found that having a professional or experienced navigator, as well as flexible program delivery and communication methods, can be helpful in overcoming some of these barriers. This article was authored by Shelley Doucette, Alison Luke, and Grayling Anthonison.