0:00before we kind of have our official start I just wanted to do a couple of quick Logistics things um which are um important the most important one is I wanted to mention uh for those of you who have been playing around with solvit or they're about to um there will be a 2 gigabyte quota a 2 gigabyte quter on your on your discs on your volumes uh anybody with more than 2 gabes uh your data is going to get deleted like all of
0:29it um so get it down beneath 2 gig before 2 days from now passes please and then after that there'll be a quota so that won't happen again you'll you'll find out you don't want to get too close to that 2 gig quota though because if SQL light tries to um write stuff uh into your you know into your volume and can't God knows what's going to happen so don't use lots of dis space uh you won't
0:57do it accidentally just don't download huge files or something my you know database is like 500 kilobytes or something it's it's tiny um and then secondly uh the solvit platform is not some super perfectly engineered thing it's a shared resource that we're all using um
1:25so please try not to like run something that takes up lots of CPU and stuff like um because that takes away from other people's ability to use it um over time we'll gradually add more controls to help you from doing this by mistake um during the course we'll show you how to stop your instance if you have accidentally got it using lots of CPU um but yes in general um please be careful
1:52um as best as you can um and then the third thing is um we had been using control shift for all of our keyboard shortcuts although today we also added command so people on Mac will probably want to use I'll be talking I'll be saying use command shift but most of the time you could also try control shift off you're if you're on the Mac um so okay so that's that then another
2:22quick admin thing that I wanted to mention is I know a lot of folks haven't used Discord very much so I wanted to give you a quick guided tour of how to use Discord effectively so I'm going to share my screen so Jon are you see my screen okay yep okay so um basically the key thing I think to making Discord work
2:49well is to like mute the stuff you don't want to see um and then um basically you can just go to the very top channel and if you press uh alt shift down or option shift down it'll take you to the next see there's these little half circles that means there's un RADS in that so if I press alt shift down or in my case I'm on a Mac option shift down it takes me to the next unread um and then I can go again next on
3:19red um and so this is how you can basically scroll through to see all of the stuff that's happened since last time and then um you'll see sometimes there are um threads so you can see this this here is a thread so if you see a thread if you're interested in it you make sure you click on it and then you'll see It'll appear down here and so once you've clicked on a thread um that now then becomes part of the stuff that
3:45you will be looping through um when you press uh alt shift down um it's a really uh helpful nice thing to do if you're replying to somebody and you know there might be more than one reply don't just reply but instead uh click on create thread um and that way you'll be creating a thread so kind of keeps things nicely organized um so uh that's that then another thing that's super useful then is for stuff
4:15you don't care about so for example the welcome channel is going to be full of wave to say hi so you can see what I've done is I've right clicked notification and I've uh uh actually what I did was I sorry I clicked on mute Channel um and that way you'll see it's actually grade out um and so I've muted the geographies that I'm not in um so that's a good way to make sure that yeah you only see the stuff you care about [Music]
4:43um and then the other thing I wanted to mention is uh sometimes you'll come across messages that um you would uh like to make sure you you you know remember to look at later I'll show you a really cool trick that's actually so as I know I think this is new functional in Discord you can click add server and you can create my own server for me and my friends and uh I created one which I
5:12called um which I called jph server even put my picture on it and when you do that um once you've created a server you can then just right click on anything you're interesting in and say forward and click on that and so now that'll get added to your server that's a really good way to keep track of stuff and you can always uh delete them once you've done
5:40them and then another really important one to know about is to go back to where you were is uh command or control left square bracket and that takes you back to where you were uh I think they're the main things I use to help me with Discord do do did I miss anything um jonno no I think that's good um there's the the non-technical side of you know being courteous to everybody and not tagging everyone and you know trying to keep it contain but I think that's um
6:09yeah that covers all the important bits to know and we'll keep the key information in announcements right announcements and admin um so even if you can't keep up with all of the different discussion groups on the different continents or whatever that'll be the place to check at minimum yep exactly right so do read or every announcement and so one thing that I do recommend is to right click on announcements and notification settings or messages and that way you'll get notified of every announcement um it's a good good idea to to scroll back and look at the ones that
6:39are already there and the most recent one you'll see is there's a fact um thanks to Nate um uh so that's kind of uh in progress as we speak um but we're trying to you know add things that people are mentioning quite a bit on um on Discord as they pop up so yeah do check a I keep an eye out on the fact um in general I'd say though like [Music]
7:08um all right so I think that's our Logistics unless I missed anything jonno should we start the on Logistics part yeah that sounds good I think that's also given people some time to join great um okay um welcome everybody uh I'm Jeremy um from uh um answer Ai and this is Jon o um fast AI is now part of answer AI so we're also from Fast AI
7:37answer AI doesn't generally um have you know brands that we directly do things under we have separate things for that like Fast HTML and so forth so fast AI is our educational brand if you like so um so we're super excited to to have the first lesson of the first course of fast ai's New Era um which is going to be super
8:06different and super interesting um uh I think so yeah welcome jonno what are you um excited about in this course yeah it's good to have everyone here uh I'm excited to see the direction we go I know um some of you have well a lot of you from the introductions Channel have done the past fast AI courses and especially towards the end of the fast AI series when it was quite a polished product the first half um yeah that might have set some
8:35expectations One Way whereas if you took part two the most recent part two you'll see that was a lot more exploratory in a research way and I think this one is going to be a lot more exploratory in a in a different way um so we excited to meet everyone who's doing this cohort I think the group will shape how the course goes forward um and then also yeah to explore what the platform and the mode of teaching looks like as we as we move into a different way of of doing this educational thing so yeah I'm pretty excited about
9:04that so we've got a really interesting group of people here for this course and uh do check out the introductions channel on the Discord to see who some of your um uh colleagues are uh I'll just say a couple of things about that though which is don't be intimidated I think the people most likely to introduce themselves so the people most likely to not be too shy about doing so so you might get the impression all AI researchers and professors and whatever but actually a lot of the people in the
9:33course are quite new programmers and the more experienced people who have joined uh you know many of them have told me they're doing so specifically because they want to help out um newer programmers and also because they're always interested to refresh their learning to to help teach others as well um so yeah don't be shy and also say like when it comes to participating in the community on Discord don't worry if you're not quite sure how to say things or how to behave or how to use it or
10:02whatever you absolutely don't have to be perfect you know um uh people will give you feedback in a in a kind and general way and help you improve and learn um but if somebody does give you some feedback to help you that's always only there to help you it's never a criticism you know our number one goal here is to learn together as Jon o mentioned this is a you know the whole thing is a bit of an experiment so um we're we're
10:29excited to be part of this experimental project um together uh also to help you with this um there's a number of things that you'll find on the Discord to help um there are um office hours so click on the uh events in the top left of the screen when an event's not currently running and you'll see that there's a number of upcoming events quite of those a few of those are office hours so
10:57office hours is when a um a member of the answer AI team um or or somebody that we work closely with is basically saying hey I'm available to help um and so we have uh or we'll have a channel for that a voice Channel um so if you scroll down in Discord you'll see voice channels you're always welcome to jump into any voice Channel but if there is an office hours going on then please leave the office hours voice channel for office hours and
11:26if you jump into the office hours you can just you can just lurk and listen or you can ask questions um uh and it can be either about um a problem that you're working on through the course or something to do with a solvit platform or anything else there's also study groups um study groups uh different to office hours in that again they'll be generally speaking in I think we guess we create a study groups um
11:55voice Channel there won't necessarily be any answer a folks there everybody is welcome to create a study group and it's just saying hey let's get together with other like-minded people that are perhaps in the same time zone or awake at the same time and help each other um work through this course together and then finally there are tutors um so there's a thread um in admin called tutors in Discord where if
12:24you um are happy to pay somebody to help you can get one-on-one shooter in um that's all like nothing to do with us formally we're not taking a cut of any of that or anything like that we're just making that available for folks who are um both interested in teaching others and maybe making a bit of extra income on the side and then on the other side for folks who would love a bit of um one-on-one help so with all that in mind jonno do you want to jump into
12:53maybe what the solv it platform is and how to use it unless you think there's other stuff we should do first uh no I think that'll be good that'll segue back into some obvious questions I think um okay so let me share just this entire
13:11screen so um we speaking of experimental course uh one other part of it that's very much um new and fresh is our platform so we've built uh solv it.
13:24fast.ai if you go to the/ dashboard this is something that's linked and if you part of the course you'll be able to see this um and so this is where you'll manage your access to the solvit um lessons and things but also importantly the Solve It app itself um so you can always stop the app if it's running um but then once you click connect that's going to launch you into this new uh application web app that we've created um to help with working through the course and so what I'll do is I'll give
13:54you a little tour um you can create dialogues or or load existing ones and we'll show that um yeah I'll give you a little tour of the features and then we'll step back and explain why on Earth are we doing this in a custom environment um okay so hopefully you can see Solve IT demo um we're faced here with something that looks um if you squint a little bit like any of the uh chat GPT clae Etc um boxes right I've got a little message box at the bottom um but the difference
14:22here is that it defaults to code and you can always change the default um and so if I type in some python code here and then hit submit or use the keyboard shortcut control enter and on Mac that'll be a command it's going to run that code right so that's one mode of interacting with this platform uh you also have notes so here this is something that accepts U markdown syntax so if I type in uh hello world you can do things like bold and italics this is
14:50just uh text that's rendered nicely when I I just mention um uh I did just check this for some reason this is streaming at 720p so uh on the side of large uh text so you might want to zoom in one or two more um sure thing the recording hopefully won't be at 720p so we'll see um so apologies for the low resolution folks I'm not quite sure how that
15:20happened cool um okay so these are two ways of adding uh you can think of these as messages in a dialogue um but the final one and those the sort of main exciting bit of this is that you can also call out to a specific little bit of AI assistants so we have here um I'll just ask it to introduce itself um we have here a way to add questions or prompts to the AI and that's going to
15:48come back and respond um and so these three ways of adding messages this is how we'll interact there's shortcuts for them so contrl J K and L to tole through you could just oh control shift yeah you're shift um command shift on Mac um yeah so this is the platform um if any of you have used Jupiter before there'll be some similarities in that when you run code it's not just oneoff executed and then you see the result and it all goes away so for example we'll get more
16:18into what is a variable and and how we're coding a little bit later but I just want to show you if I run some code that defines a variable I can access that in other shells sorry another um code messages I can see that in the variables pane so there'll be a little uh tool tip here this is the variable a um I can do the the sort of Dynamic Auto Complete that some of you may know from something like IPython shells or Jupiter
16:45whereas if I am start typing I have these are are methods or properties that are attached to this object specifically um if I start coding one of these in I should get the arguments for a function so this is not like a an AI based auto complete it's instead looking at what are the actual methods or Properties or arguments of that object um so that's pretty useful to be able to see more about something that's in this
17:13shared environment um if you mess something up or you're you know you've overwritten something or you're unsure you can always Clare which you'll see the time by the little code indicator there went away um and then if I run that again this is now running that from scratch and you'll notice there's no a that variable hasn't been run yet but if I click run all it'll run all of the code pieces including the one that creates that um so yeah these are the main parts of the interface you'll see us using these in in different ways and
17:41you can see which bits have been run because they've got the time after them to show you when they were run yeah yeah good point um oh one thing that's important to know you can edit past messages right you can't just only add them at the bottom so for example I can double click on the this one here and then I can change that possibly by the way that the double clicking thing may not last forever the thing that will last forever is that you can click anywhere in the title of a message the reason I'm not sure about the double
18:11clicking thing is it is quite helpful to double click on a word to select it when you try to select a word and then it deletes your code that's quite annoying so yeah yeah so okay keep an eye out for those the changes but definitely um the moment at least you can edit notes uh prompts code you can also edit the responses from the assistant and you'll see just now that that um is indeed just to clarify so you're definitely be to edit it either way the question is so right now you can edit it either by
18:40clicking anywhere in the title of the message or by double clicking the content um possibly in the future it'll only work by clicking on the title of the message like so right so yeah that's the that's the key Sol it interface um you can export your dialogues as IPython notebooks or as python files you can set up some additional context for the language model assistant behind the scenes um there's some settings for if
19:09you'd like a light theme or dark theme um and then you're also able to add Secrets which we'll use a little later um your dialogues are saved as you run them so you don't have to worry about hitting contrl s or anything like that um so if you refresh the page you'll get back that same dialogue and you can always load previous ones to go and see um different examples of something that you're working on um but if you really want to be sure you can export it to the notebook on GitHub and then that's like
19:38a hard copy separate from our system which is still you know as you've seen the last few days we're still ironing out the last few bugs um okay so yeah that's the interface I guess Jeremy then the next obvious question is why on Earth are we using this as opposed to any existing idees or platforms what was the the rationale behind creating a custom thing just before the course started yeah so um we've been working on this at answer
20:08AI for most of the year and this refers to not just the platform but a different approach to working with language models um so a lot of us and I expect a lot of you have experienced some frustration with the way we ways we currently have to interact with language models we often have to try to bully them or needle them or try every way we can to get them to actually do what we want and
20:36then the process of kind of uh then working with them combined with code can be quite messy if we're using something like Claude or chat GPT there's a lot of copying back and forth um and in cursor we often find ourselves L of like editing huge amounts of files and the AI ends up in control rather than us being in control of the process so we've been spending most of this year developing a new approach
21:06which we call dialogue engineering and that's what we'll be focusing on teaching in this course is learning how to solve problems with dialogue engineering um which is a approach where you're going to be in control of the process you're going to be doing a lot of the coding yourself um but you'll be interacting with the language model in a kind of much more iterative way um so
21:34certainly uh you don't have to use solve it to use dialogue engineering uh dialogue engineering is not the only thing we'll be teaching in the course but this is kind of like a key theme is is this new approach to um to working with combining code and language models together um we're going to be doing that
22:02via um specific examples of problem solving um and most of the specific examples of problem solving will'll be covering uh ones um from something called Advent of code so maybe jono you might want to explain what that is and why we're using it sure thing so um Advent of code has been around a fair while and many of you might even be familiar
22:30with it it's often used by programmers to to practice to keep their their skills sharp um maybe to try out a new language is how I've used it in the past and this is the Advent of code website Advent of code.com we'll be using the 2023 puzzles although the 2024 ones will start being released I believe on December 1st so that'll be nice fresh new puzzles for us and what these look like are unusually wellp specified programming problems
22:59right so many programming assignments you might get in the real world could be something like my father-in-law just asked me hey could you create an app for this game I'm designing and that's very fun but it's also very unspecified just check we're we're currently looking at a Google doc on your screen and the YouTu chat that's definitely incorrect sorry I must have shared the wrong screen um all right let's let's try that one more time back up and start again
23:24shall we right uh all right now can you see Advent of code yeah might want to make it a bit bigger maybe good good call um okay so Advent of code is a um series of programming challenges they usually come out once a day over December hence the Advent theme um we'll be using the ones from 2023 so make sure that you choose those although the 2024 ones will
23:54start coming out somewhat soon and what these are is very well specified programming challenges and unlike many um in the wild examples there's not going to be scope creep there's not going to be changing requirements there's not going to be you know multitudes of different inputs and outputs that may or may not still exist they're very well specified so the one we'll be looking at today there's a bit of a narrative around it introducing the problem there's some sample data and
24:22some examples of what the expected output for that data would be and then there's an answer field where you submit usually just a single number and then that's validated as to whether it's correct or not and if it's correct you can advance onto the next part of the puzzle and there's one every day um and so these are not the only problems we'll be showing I know a lot of people have asked um more about like what about real world applications we'll definitely be trying to demonstrate as many as possible you know additional cases where
24:52we've used the same approaches but the Advent of code are very nice as a grounding block that are definit challenging but also something that you can tackle without needing to know you know lots of different extensive libraries or any esoteric Concepts you can really tackle them with some fairly basic programming knowledge and so they're really nice sandboxes for us to play in and demonstrate the techniques um if you're someone who's done Advent of code a lot or you're a very experienced programmer in general
25:21you may want to um keep an eye on how we're doing them but you might also find out okay the first few lessons are some something that you can skip through quite quickly if you're completely new to programming it might be the opposite even the first one might be quite challenging um but hopefully we'll show as we go that even if you have very little prior programming knowledge you're still able to work through these and and get to the solution and there's a couple of kind of themes that jonno and I will aim for here which
25:49is you might so one of the interesting things that's kind of fun that happens as you finish a challenge is it opens up the Advent of code forum for that challenge where you can read other people's Solutions and as you get to the later ones you'll see pretty much all the solutions are from people who seem to have a very extensive background and probably a you know a university qualification in computer science who'll kind of say like oh this is a classic example of the algorithm on page 78 of
26:18the Dragon book and you know I use that with this well-known linkage structure and it's like it can make you think like oh the the way to solve these problems is to learn a th000 individual special case things but actually we're going to be explaining how to solve uh all of the things that we cover with nothing other than the python standard library and uh a basic understanding which we develop during the course of of lists and dictionaries there's never going to be a case where
26:48we're going to say oh to solve this you have to already know this special algorithm we're going to be showing how to do things in a really kind of Common Sense um step by step kind of approach um and so we hope that at the end of that you'll have a lot of you know feel very encouraged that you can take things that maybe at First Look Beyond you and by combining your coding press that you'll develop and Ai and one of the
27:17things you'll find with this dialogue engineering approach is that the process of solving a problem with code and AI you'll become a better coder just kind of the opposite of what a lot of people do with like oh clawed artifacts or cursor write the whole thing for me you know and I know a lot of people um I've spoken to feel like oh I'm becoming a worse coder because I'm just Outsourcing everything and things are getting more and more complicated and admired in technical debt so this is really trying
27:47to do the opposite of that and where you know we'll show ways of you know of how these basic techniques apply to all kinds of stuff well outside Advent of code problems you know particularly coming into next year you know things like screen scraping machine learning evaluations uh you know all kinds of interesting projects um like that but maybe jonno I might kind of jump into
28:17also talking about the problem solving process as well as the coding process um so one of the things you'll see in the announcement thread is I've got a link to a little summary of a book called How to solve it by a mathematician named um George POA
28:42um so um George poia um died a few decades ago um but a very famous mathematician and you'll look come across if you do much math a lot of his uh theorems but he was particularly famous actually as a teacher and so this book how to solve it is not new um but it's still probably the best of its kind um and interestingly you know as we were developing our own understanding and in
29:10fact I've been kind of building this approach to solving problems for uh trying to think over 30 years now I taught my first analytics course o over 30 years ago but then bringing in Ai and and I started to realize you know as I was reading poly book like wow there's a lot of overlap here so there's a lot of inspiration from polio um and so it's worth at least looking you know from time to time at the problem solving
29:40framework that's summarized here um and you can use Ai and we'll show you how to use AI to help you with these things each step like understanding the problem you know if like sometimes it's hard so you can ask like hey can you help me identify exactly what I'm being asked to do or like can you summarize for me what information do we actually have you know these are all things you can get AI to help with and particularly restating the problem can be super helpful you know it's like getting getting help to explain like oh what's the essence of
30:08this problem you know and then um you know what are some other similar problems that somebody in my kind of position might have seen before what pieces could we split this up into that if we put them together we would have ended up with a solution this one actually which is one Jon O's fond of I think is great is saying like well okay what would this point one step before the solution look like and it's like oh well okay that would just be
30:38this with these numbers and you know new lines here and here it's like okay well let's focus on creating that what would one step before that look like it's like oh okay let's focus on creating that and so you can and then you can kind of actually work from both directions until you find your way to the middle um so you know anyway that won't go through all of them but we will be over over the course um and you know there are some useful heuristic strategies that Paia talks about as well and again we'll be we'll be covering these in the
31:08course paa's book is all about math you know and it's interesting how none of this is math specific although if you read the book it kind of feels like wow this is a math book but actually the problem solving approach itself um is is not you know a um a math approach and so it's actually useful to um I'm going to remind myself how to
31:36stop sharing my screen so I guess I click that okay um now okay you know when you go through a math book If you ever did math at Uni or even if you think about at school you you do problems right and you solve lots of problems and it's a and it's really the solving of problems which is exercising your problem solving muscle and in the PO book you know also exercises and problems here AOC Advent
32:04of code are our problems um in fact quite a few of the first ones you'll find you can literally copy and paste them into chat GPT particularly into 01 their newest you know reasoning model and it'll solve it the first time um but doing that would be like you know having a primary school kid um use a calculator rather than never learn to add like the whole point of this is you take take your time doing things in using the techniques we're showing you in a way
32:33where you're in control and you're really solving the puzzles and the problems yourself and you will get to a point where o1 can't help you anymore uh and at that point you'll be glad that you didn't jump straight there um so Advent of code is are the problems we're using to exercise this muscle and you know um for some of you that are experienced coders jumping through the first few might be very fast but do them you know
33:02and try to use an approach somewhat like what we're displaying um um but feel free to to Jump Ahead in Discord there is a um separate uh channel for each day um of Advent of code so don't put spoilers there but if you want to discuss the puzzles and help with solving them that's a good place to go as well and then from a few days time
33:29Advent of code 2024 will appear and so we'll create a separate category for that uh jonno and I won't be going through the 2024 together you can certainly bring them to office hours um but we're hoping that a lot of you will go through 2024 each day as they come out and use these um techniques um so that's what's going to happen and this lesson the rest of the lesson we're going to do problem
33:591A um from Advent of code um and then yeah jonno do you want to talk a bit about what what happens after that sure so I mean today is a lot about getting set up getting familiar with the process so the we'll do the first half of the first problem uh not probably not much beyond that uh Future Days once this becomes a bit more familiar it's going to be repeating the same kinds of drills but showing lots of different aspects obviously and so so we won't
34:28just be doing Advent of code we've got bits of Show and Tell we'll potentially be surfacing uh examples from the Discord if people have uh cases where this dialogue approach has worked or questions about how one might apply it um so that's where you can be very helpful in in surfacing those kinds of suggestions otherwise we've got some pieces that we'd also like to show off as well um so most other lessons will have the Advent of code component and then like a a demo or a walk through or a a live like solving some problem with
34:56this approach um but today is going to be focused just on the Advent of code and getting set up and making sure that we can all you know be playing with these problems and starting to do the practice that's so critical um so I can start showing us how to get set up on the Advent of code data itself and like I just mention like before we do I just wanted to mention some of the other platforms that that we'll show so solit the platform that we're showing here is um a kind of a a simplified cut down
35:24education focused version of an of an in-house tool we've been developing this year called AI magic um it and so I've been using it for quite a few months uh longer than anybody because I was I started it and uh I started it for a reason which is that I was pretty unhappy with the existing approaches a lot of the time but that doesn't mean I'm unhappy about them all the time uh I still use Claude projects sometimes I still use uh curser sometimes um you
35:54know there there we'll be showing when and how to use these other tools as well but I will say for me personally as somebody that's been coding you know every day for over 30 years nowadays I use AI magic which is very similar to solver for 90 to 95% of my kind of computer work I guess so I've personally found it really helpful but we have no particular reason
36:22to evangelize it um uh we'll be showing a range of tools and it' be interesting for folks to experiment I think in the Discord with Claud projects for example Claude projects is generally at answer AI our kind of second favorite tool um uh we highly recommend it so you know we could definitely try that try cursa um um and see how the experience goes anyway sorry jonno to
36:50interrupt no that's good um maybe also like so Jeremy is the first one to start trying this um I'll just say one last thing before we dive into the actual practicalities is that so I I got to then start this and and everyone else that we work with got to then go through this process and often one of the initial feelings was frustration right like you're so used to being able to tab tab tab big chunks of code so used to thinking in a certain way um that there's this this overcoming of some
37:20inertia before it starts feeling really good so anyway that's just another like note from someone else who's started trying to put these disciplines into practice it was quite difficult and and this course I think will start out feeling like why why are we doing this especially if you're a good coder and you can solve the problem straight away um yeah just to say I found it very worthwhile and and Jonah you kind of mentioned to me in the past that the way these things are designed there's a certain dopamine hit right to like typing a sentence and getting 300 lines
37:48of code out and like it's not necessarily healthy and we're definitely not going to give that dopamine hit right yeah yeah like if you think how the models are trained they're like explicitly optimized for human preference right to make someone say oh I I like that response that that makes me happy uh but that's kind of the same way that like social media feeds or really addictive games are designed and it doesn't it doesn't feel good in a healthy kind of way it feels good in a junk food kind of way yeah and I should mention like AI magic is which I
38:17mentioned is our internal tool um so there's there isn't the external version of that is solver and so the folks in this course are going to see the very first time the thing that we've been using inh house for quite a while and over the coming months you know our hope to be honest when I wrote s it I wrote it in a really hacky way and like I'm not it's not something I would just want to hand over to somebody when people join answer AI I always have to be very apologetic
38:47about how messy it is and so solvit like good gradually we're bringing bits of this into into a toll that's actually fit for public consumption and that is you know more targeted um so this is the education targeted one and we imagine sometime in the coming months we'll also release a kind of more standard development targeted version as
39:11well cool okay I think that's a lot of a lot of good intro should we uh should we get to Advent of code marvelous all right so I will show you all how to get started one uh we're not going to be using too much fanciness but one convenience built into the Sol platform and so on for this course is going to be how do we take the data sets the like the inputs from Advent of code and load them up into the environment without having to you know save them as a text file or something like that so
39:41jono I see like a little example there right which you could just copy and paste but I guess the point is that there's something other than that right right yeah so there's a a button that you can click to get the puzzle input um and that's going to give you uh a big text file which you would then have to save or copy and and put somewhere um so to to work around that there's a lovely Library called uh Advent of code data this is already installed so you don't
40:09have to worry about that um but it does require Advent of code is a it's an account based thing you can see I've logged in with a a fresh account and so to authenticate for one of a better word to be able to like sign in and get the data there's a trick you're going to do you can either right click and choose inspect or there's a keyboard shortcut control shift c um and that's going to open up this browser Dev tools and then within that I'm going to go to the application
40:38Tab and go find cookies and then on the cookies for this page you'll see there's one called session so this is the this is the key that's in my browser where where I clicked on get input this is sent to the server and it's happy to send me the input back so I'm going to copy this and then if you look at the uh Advent of code data instructions you'll see it says um make sure you export your
41:07session ID and so this is a Syntax for Linux for setting um an environmental variable that's called right this is some variable that can be accessed uh on Windows that might be set um and in solve it for convenience you could type uh you know import OS os. Enon or whatever um but you can also just go to settings and we
41:33have this Secrets pane here and so very carefully copying and pasting AOC session in my um Solve IT settings OC session and I'm going to paste in that secret and save I would suggest actually pasting in the name as well cuz just at right now we don't even have a way to edit those secrets so we'll add that in the next couple of days days but yeah for now please copy and paste both parts so it's not
42:02wrong good good point yeah make sure that those are are matched um okay and so then once that's done um we should be able to add a new code cell and try out their example
42:20um okay so there we go that's that's run uh we could change this to 2023 and the data one and then that should give us the the data for today's Challenge and it looks like it is cool so that's how you load the Advent of code data into the Solve IT platform um I guess with that we can start on the actual puzzle uh do you want to take over staring Jeremy okay sure no worries
42:50so um I'll share my screen here and um there's a um uh in the fact and in the announcements you'll find there's a how to get your key from Advent of code instructions which you can follow uh as well um so in case you forget it or didn't want to go through the video um so I'm might just go back to
43:19the start here um so um this is what happens after you log in when you click connect to solve it what's actually going to happen is you'll see it's kind of cool actually you you'll get a URL with a unique subdomain here right inside solv it um this is your own little computer basically it's if you care it's running inside a Docker container um it's not a
43:48giant computer it's you know at the moment it's only got a gigabyte of ram you've got two gigabytes of hard disk you got one CPU but you know it's a computer um it saves everything that you save it's it's uh it's not Emeral it'll be there forever you can pip andall stuff um and as jonno said you can add you know uh environment variables and stuff like that um and things are structured around dialogues so basically a dialogue is a set of messages um they can be code
44:18note or prompt messages and then code and prompt messages can have responses code responses whatever is the result of evaluating that expression uh or anything printed or any graphs you created so forth and a prompt the responses um whatever the AI said
44:36um uh because I'm slightly scared I'm actually going to run it off my own computer today just in case you know there's any issues because we've never had uh hundreds of people using it at the same time um uh so after today if everybody finds it successful hopefully next time I will run it on the server like the rest of you all so this is a dialogue okay you can change its name um
45:03if you wish um and um we're going to go to Advent of code and basically the it's called a a dialogue for reason which is we're going to try to create a conversation um with the model and with the python interpreter so there's this persistent python interpreter running in the background um and so what I'm going to do is
45:32copy this and I'm going to talk to both myself uh and to the AI so this is kind of step one of Poa which is understand the problem um to explain um exactly what it is that I'm trying to do so I'm going to say um um Advent of code day one
46:002023 um and then I'm going to paste and this is actually markdown so if if you haven't used markdown before it's worth learning markdown it's quite handy so there's a bit this is a little bit of code here so I put this in what's called triple back text to say this is a bit of code um and this is just a note right so if I say submit it's not sending it to anybody right it's just you know it's just a note right but um that note I can
46:28see the note and the AI can see the note um and so let's uh read the problem together so um after today uh we want you to do the next days um Advent of code puzzle um so see how far you get in this case we'll probably only get through half of this today so we'll probably want you to do 1B and day two before next time it's fine if you don't but by having a go with it yourself it's going to be you know
46:57you'll learn more right um but this one we I'm just going to do it right so um now when I say I'm going to do it one of the things we want to talk about in terms of solving problems with code is uh the value of pair programming which jono and I do all the time so actually um jono is going to solve the problem now that may seem weird to you because I'm the one typing um but actually uh at least the way we do pair programming is
47:26we have a navigator and a driver the driver is basically the typist right it's my job to not mess up the the syntax um you know to to you know jono will say like I'll solve it in this way and then I will type the code to solve it in this way and jono is the Navigator which it means it's actually his job to solve it um when things get tricky we have to look stuff up you know the Navigator will often go and do some Googling reading manuals or whatever
47:55while the driver keeps you know doing the slightly more menial part of typing syntactically create code or getting the AI to help so we're going to be demonstrating that as well um so um anyway let's read this together so um we have some puzzle input and which is called a calibration document and unfortunately a very young elf has messed up the calibration document to show off their art skills and so they can't read the
48:24document so the uh calibration document contains lines of text and originally it contained a particular Cali calibration value that the elves need to recover um so you'll see like there's actually quite a lot of text here which can get overwhelming right but I kind of picked out the bit that actually contains the puzzle to solve on each line the calibration value can be found by combining the first
48:51digit and the last digit in that order to form a two-digit number now this is great like AOC is really good at doing something that you must always do yourself which is they always give you a small example right as well as the full data set so the full data set
49:18is very very long right so we don't start there right and in this this technique we're going to be showing you it's this it's a very like specific technique that I want you to try to use all the time there's a very specific way of going about this right we're not even going to do all four the technique is to pick one right we're going to do one okay so I'm not yet at the point where I need jonno to
49:46tell me how to do things so I'm still driving right so I need this data so I clicked on copy okay and then I can just uh paste it and I need to put that somewhere I need to give it a name right I need to give the input a name which I'm sure you all know this but I'm going to go really from scratch right which is like um you know what's a variable a variable is a name that we give to some data so
50:16we don't have to type the whole damn thing in every time so why don't we call this this a sample input I'll just call sample okay and um I need to copy and paste this into sample input okay so I'm going to intentionally mess it up
50:37here okay and I'm going to change to code right in fact I'll say default code default code decides whether or not by default you the code one is selected I actually suggest you always turn that on um I thought it would be on by default so that might be a bug so I would leave it on because we want to mainly be writing code and then I'll click submit and like uh oh that didn't work so this is where we can talk to the
51:06model and the model can see everything above where you're typing now right and you no notice you can insert things above or below anywhere in the dialogue right so you're not just sticking stuff at the bottom um but at the moment we are at the bottom so I can say oh dear um how do I fix this right so you don't necessarily need to know a lot about syntax and stuff that you know that should be stuff that computers can
51:34do for you so then I can press command enter or click on the submit button and uh Claude son has I think about that um and it tells me like oh when a string so bunch of characters when you've got multiple lines you actually need triple quotes and that makes sense right because like normally in Python the end of a line is the end of a command right so my command was
52:02like samp equals quote 1 a b C2 so well that's that's an unterminated string little so you never finished your string so that's great I want this code so let's grab it so I just click add message with code okay and you can see I've now got a new message which I can submit right and if I want to just double check what the result looks like I can just write samp at the end and it'll print it and there's and you can see that python
52:30uses back sln um if you don't print it so we've got our sample so that's like stage one give it a name okay um and then um jonno I don't really love that it's in lines do you think there's a better format for this yeah we could split this out into a list um but maybe well yeah we can do that and then we can think about solving it ourselves and then solving it in code
53:00um but yeah good idea to split it into a list first into a into a list okay so you know probably a lot of you know what a list is but just in case you don't you know a list is something um that uh you know basically contains um a few values right so here's a list right and um I'm got to edit this now to give it a name my
53:28list and again we can write it afterwards to print it out and lists are nice because once we have this in a list we'll be able to grab the nth value of it by indexing so by typing my list one for example um so um we could ask the uh AI how to turn samp into a list but jonno is pretty good at programming python so jonno do
53:55you know how to turn this into a list yes I believe python has a built-in called split so if you typed in Sample and then Dot and started typing split you'll see there that's a helpful hint that you're on the right track there's a split lines even let's use that shall we uh give it a go yeah okay and so to call the function you have to do that okay MH um and again
54:24you know I I of the parts of this is to look at your data at every step so like most of the times you write some a message a code message it should output something this is a huge mistake I find even from very experienced developers is that they don't look at their data at every single point right John are you are you happy with this list uh yep that looks exactly like what we want compare
54:52to the input one more step that I wanted to do which is um um which is the process which is now we have to pick uh one of those that we're going to solve um so I think the first one's a bit too easy like it's a bit of a special case that the one is at the start and the two it's at the end the last one's a bit weird there's only one number so if it's okay with you jonno I'm going to pick yeah index one here so I always call it X right and that way you you'll see why
55:20but by by giving things consistent names it's going to make life much easier so I'm going to pick it and then as soon as I do it of course I need to make sure it output something okay so I think jonno that's as far as I can go without having some Navigator assistance because now we actually need to solve the problem I I believe that the answer we should be getting for this is 38 um so I think that's what I want you to help me get
55:50right and so maybe like talk me through how did you get that answer what what was your like actual internal thoughts or process for getting that oh I mean I just looked for the numbers jonno like I knew we needed the first and the last so I just started going through and it's like uh okay got it three uh got it eight three eight cool okay so then at this stage that's suggesting that there's a few ways we could go probably the best is to first
56:18pick out all the numbers right keep them in order and then do exactly what you did go for the first one go for the last one um but I mean I didn't even pick out the numbers I just I just went through left right until I found a number then I went through right to left until I found cool a number that's what I did but I'm not the Navigator so no so that that I mean suggests a path we can follow right I can see that that's going to get us somewhere useful um okay so let's go
56:47through the characters one by one um so in this case it's just a string it's not a list um but I know that you you can go through four character in string right in a for Loop so let's do that and let's start by just printing out the
57:07character yeah cool and just to notice here that as we add each variable it appears here and you can click on these so if I'm like s where the hell did that come from you just click on it and it'll find where it was defined okay and say oh I remember now in lines oh yeah yeah yeah okay I got it I got it and then like what the hell's like okay okay got it so all right cool cool okay so now we've got when we're in that
57:37Loop exactly um so how do we test for that I know there should be something it seems like that's a common operator um but maybe we can just ask the I how would I check if a character is a number okay and something I find helps a lot with talking to an AI is to actually talk right so I quite uh I think the currently the best thing on Mac at least is um is whisper flow right and one thing that's really helpful is to connect it up to a
58:07keyboard shortcut that's really convenient to access on your keyboard um so on the external keyboard I'm using uh control command uh Control Alt shift happens to be convenient so I just hold it down and I'll talk to the AI and that's just a little bit smoother experience to me often than typing I can get it done faster a little bit less mental overhead so I think just to confirm jonno I want to basically uh know uh how to recognize when um one of those
58:36characters is actually a digit right right okay so I simply think I want to Loop through each of these characters and then identify the first digit how do I actually tell if a character represents a digit in Python and you see it oh I don't know why it didn't show me the first part but that's fine the questions all I wanted so uh it's all good um that's a bit of a limitation I found
59:05with a lot of these AI voice recognition things is that they try to clean up what you say to various degrees and sometimes they clean it up too much sometimes too little um in this case actually the question is asked is fine so I'll just go with it it's also going to work because it's not just getting that question right even the saying in Python I feel like that's kind of a habit where if you're starting a brand new chat GPT session you say how do I tell whether something is a digit it doesn't know is
59:33this in JavaScript in Python by looking at it whereas here it's in a notebook it sees the task definition at the top it sees your experiments bit by bit um I bet you could even say something much more obtuse and it would be probably able to in it oh you probably want to use something like this and in this case it's given us yeah the is digigit method which is exactly what we want great and I'm just going to have a quick uh diversion here because people are asking in the chat how the hell we made this
1:00:00solit thing so um uh yeah so we um built a uh as a lot of you know a um uh framework called Fast HTML um earlier this year and one of our goals to fast HTML was to make it like well we made it so that it would be easier for us to build stuff um and uh um the platform Solve It Was Written in fast HTML um and
1:00:28um the data is stored in another thing we built called Fast light and um yeah it's all written from scratch it's not using Jupiter or anything like that obviously the language model is not written from scratch that's uh we're using um clawed Sonet which we love um for that um and the kind of um uh the system that's going on under the hord is basically one that's um a lot of it has
1:00:55developed from me teaching um my daughter and my co-founder's son math over the last few months um using kind of a combination of me plus Ai and finding what things work and what things don't so we're kind of combining a whole bunch of different answer AI uh projects together um including the teach Eric and Jeremy's kids math project and the fast L project and the fast HL project and um
1:01:22and um most of or yeah a lot of um solver was written in in AI magic actually probably most of it um um so yeah it's you know fun to see all this come together and actually show people outside our little company for the first time this amalgamation of all these things um um yeah and it's important to note like that um what's being sent actually
1:01:51I'm just going to have a quick diversion here because it's really important to have this mental model of what's going on um what is going on um is it's not uh sending like the state of the Python interpreter to Claude it's it's sending the state of like what's on your screen to Claude right so um I could say like import random right um and again as jonno mentioned like the the auto
1:02:20complete is based on what's actually in your python interpreter so I run that and then I say equals random Dot and I can see what's actually in there right so I'll say random okay and I print it out and then we can uh ask um uh can you tell me what uh a is
1:02:50now okay cool and then there's a nice little button here which is very similar to one you we've already seen which is I click this on an input to get a copy of a message so if I run this again I'm now going to get um actually I'll didn't quite want it there let me delete that because I want to put it right at the bottom well actually that's fine so now if I say here what is a now
1:03:19so I double click this to rerun that prompt and it should say 0848 there you go 848 but now if I copy this and I say add above right and I ask it here right then it's not going to see under anything underneath it just sees what's above
1:03:46it okay so this is like an important part of the mental model of what's going on is is that you know you're constructing a dialogue not just by sticking stuff at the bottom but by thinking about where you put things and you can add headings and notes and so forth so you know it's quite helpful to kind of add things like um um uh first random as a note for example because in
1:04:16your vs here it actually also shows headings right so um if I'm off the bottom of the screen and I can click there it jumps to headings as well so yeah try to keep things nicely organized and take advantage of this understanding of the mental model so anyway we'll go back to lesson one um and it's important to know that now that we're back in lesson one our python interpreter there's only one python interpreter for your instance so
1:04:45it's all reset you'll see there's no number after this so to get back to where we were we'll click run all and and they've all been run okay cool and so then as a driver there there's one one point worth calling out here is like okay we've got our next step right and we want to go through our our string for ow character and this time we'll print if that is a digital not but rather than going back
1:05:14and having one code block that we're repeatedly editing and building up to till we get the full solution what I'm going to ask jery to do is make a copy of that for Loop and then we'll have our version so if I said um add a copy it'll be put it immediately underneath but actually want to put it at the bottom so I just manually paste it okay cool so now I guess we could um print o. is digit just to check that the AI hasn't hallucinated this function you
1:05:43know make sure that it actually does do what we want and see what type of thing it returns so should I run that yeah okay command enter nice cool so now we've got true where we we want um okay and so then now we'd like to pull out the character well let's see we wanted to keep track of the first one and the last one right um so the first one is easy mhm because as soon as we come to a place where o is
1:06:13digit equals true then we can set the first to be whatever that number happens to be um sure I you want me to do that now so I could say first equals so you could call it zero but zero is a digit so there's a kind of a nice Special Value in Python which is like zero is the absence of a number right and empty string is the absence of a string but the absence of anything at all even a type has a special thing
1:06:42called none right so that's a good thing to start with so we'll say first equals none um and then I'll copy and paste it in here and I can say first oh I should say if this digit
1:07:06first equals o am I done um jno not quite um and maybe we should explain to people why okay go ah um and so when I am writing code like this and you'll see Jeremy as well one of the reasons we don't hit control enter right away is there's this process that goes on in your brain which is what would happen if this code ran right like if I was to mentally simulate this code and
1:07:35it's very easy because we can see the false false false true false false false true we can see the previous output there for if it's digital or not I'm just going to run it see oh you can see yeah like it's this is again why you always make sure every message if possible ends in an output and say oh that's that's actually wrong so again I would print out X here it shouldn't be eight right it should it should be a three yeah um and so you could you could
1:08:04catch this if you were experienced by saying ah I'm not stopping once I find the first one I'm keeping on going through and so every time I find another digit I'm going to overwrite first um and so you could catch it that way trying to simulate this code in your head or you could do what exactly what Jeremy did is run it look at the output compare to what's expected and then if you find some disconnect and you can't see it it's a good chance to go and say okay
1:08:33what's gone wrong here um and then answering that could be exploring the code or it could be asking the AI which is going to be hopefully quite a helpful um
1:08:48teacher H that's quite nice I'm going to run this so I'll say add message with code and this helps help me not have to necessarily do it in my head as much but yeah okay so what you're saying Jon o is what I should have done is to stop because actually it kept going no worries so I'll copy
1:09:14this [Music] and what do I do jonno how do I stop once I found it so there's there's one thing could do which is to write break which is going to stop the for Loop okay um but Jeremy it also occurs to me like one thing we could do we we accidentally got the last character there right oh so so this is like a point where okay we already have our plan for finding the
1:09:41last character so we could potentially ignore this diversion but it's also like oh I accidentally solved the second part so maybe we could have a check that says oh if the first is none then I can set first to whatever the the character is but if the first already exists then we could stop or we could say's sa that as I'm just going to paste this working one and I changed this to last
1:10:09yeah how about that yeah there we go so now we've got the first and the last fantastic okay great uh so now I could just say um great I think I've solved the problem now can you save me some typing by putting both the first and the last sections into a single function for
1:10:40me okay and of course I wouldn't just run it right I would need to always output something
1:10:55nice cool all right um I'm seeing some steps we might still need to do right we've got the three and the eight but we want the number 38 um actually I just want to come back to that jonno which is like I often get lost so just I'm just going to say remind me again what the problem told us that we're meant to do with this yeah I always you've C it in your head um but I think it's nice otherwise we could just
1:11:24scroll up of of course and MH we have um so this is quite nice to kind of keep track of it I think yeah go ahead Johnny so we have to combine them to make a two-digit number so I wouldn't mind modifying this to create the two-digit number is that same reason we should probably experiment a little bit first right yeah okay so we could say first comma last is equal to get digits if we
1:11:51wanted to reuse that piece and then we could combine them yeah that's great let's do it manually like that so there's that okay so what jonno just did there is since we got two things back we can put them into two different variables right first and last so just to be clear that's first that's last and so okay so now we're manually going to try to turn that into the number
1:12:1838 right and so um we we first want to add the strings together right we don't want 3 + 8 which is 11 we want the character three and then the character 8 so f plus L should give us that nice and of course if you didn't know that already you can ask the you know AI how do you concatenate strings um and then we'd ask or then we'd go okay let's go int and Open brackets f plus L see I have no idea how to do that
1:12:47obviously how do I convert this string into the actual integer 38 nice I mean obviously jonno told me but I don't trust him okay great nice so what we've done here is instead of editing that function we've added a line that we've tested right like this line here int f plus L this is this is a very
1:13:16like specific small example and if you're a good programmer you're like why do you have to do this but this general idea we're not just adding a bunch of new new code and hoping for the best it's like oh I want to make this change let me test this change in isolation and then we can go and put it into our existing function also J or I just mentioned something I always do and like everybody at answer AI now does this as well I think but almost nobody I see out in the rest of the world does this as
1:13:44soon as a AI tells me about any feature of any library or any programming language or anything that I didn't know before I always check it and learn about it it's like okay oh I didn't know about int what the hell is that so you could say help int right
1:14:04and it's like well that here we go int of X convert a number into an integer okay that's kind of nice um you can collapse that there's a bit more information than we needed uh or you can just say int question mark right you get a slightly shorter version which is nice um you know or of course uh python hint
1:14:34function um you know learn more about it from help or better still I love reading the actual documentation in okay and you can see it's got examples and they often show you like kind of surprising ones like oh int wow this I didn't know that it also takes a second thing which is the base so I could do like hex a decimal so I often find people ask me like Jeremy how do you know so much about python like oh I
1:15:04read the docs and people are often incredulous like you you actually read the python docs like yes I have read the docs for every python function I've ever used and every python module I've ever used um I'm incredulous when people to be like how can you not do that you know so this is a great way for me of like at the end of this process I'm going to know more about python than I did
1:15:31before and and if I asked you to modify it and I said oh actually these integers are base 64 or something if you had just accepted the ai's code and and had it write the whole function you might not know how to how to modify that right you wouldn't even know that there was different bases supported and so it's it's not just like oh I'd like to learn this for learning sake it makes you more useful as a coder and also it's like if I was working with Jeremy often I'll say oh it would be nice if we could
1:16:00do that and he'll say well we can like wait you how do you know this is a brand new library or very weird obscure function we've been doing web stuff with which none of us are very familiar with and yet it's like oh I know there's an HTTP code for that why it's like when Claude wrote this or when whatever the model behind the AI magic is wrote some piece of code um interrogating it looking at all those pieces until you're satisfied means that you've got this uh Frontier or this this patch of knowledge that's going to be useful if you need to
1:16:29modify that code great um okay so um this is so little I would be inclined personally just to to modify our function to add those steps if that's okay with you so yeah you know I could edit it here but you know I actually kind of prefer to stick everything you know B more like this so uh just it's just
1:16:57int first plus last is that all right mhm and let's see if that does what we hope okay there we go um cool Next Step yeah so we now need to so I don't think I need your help for this uh Jon I'm just going to Loop through and run it is that all you're thinking yeah yeah sounds good and like
1:17:25this exploration like you don't need to write really long variable names or whatever like for me I just like to have totally default ways of doing things so like whatever I'm currently working on is always called X whatever thing in the loop I'm currently in is always called o like I just I don't have to think you know so um you know this is this is uh all part of what we call exploratory programming which is something I've been developing for quite a few years now anybody who's used NBD will be familiar with it um and we've got quite a few
1:17:55um videos that describe this um so you can kind of see like the stuff that we're teaching you in solver is all like you know it's years of bits of research all coming together right but exploratory tutorial exploratory programming is something you might want to kind of look into some of these videos and stuff haml Hussein has a really good one as well which we'll link to somewhere um okay so I'm just going to print
1:18:24get digits sorry I've got a treat uh which is rare but fun is that I spotted in mistake when when pairing um and so that's one of the benefits even if you just got someone watching over your shoulder it's not like it's going to take us much time but I could have said hey Jeremy I think you mean lines instead of
1:18:47X um so this one I will just edit it yeah and jonno you are really good actually at noticing things I suspect you kept quiet on that one just to show me up I was rubbing my hands in the background yeah when you're pairing the Navigator just because they're the Navigator they're not typing they're meant to be doing most of the work right so yeah I just add these up right yeah I
1:19:15think the final thing just said the sum of those numbers so okay how would I do that um I believe there's a sum function okay but uh I know your style and it's like how do we cram this onto one line no no not here it's not I mean here I would here I would do it the dumb way to start where let's say result equals z particularly because like we've already halfway there right like I think for this okay you can do it the fancy way in a moment but first of all let's do it the non-fancy
1:19:44way because I think we can just say res plus equals that's just short for res equals res plus mhm okay does that look all right uh yep and print it out nice um and um part one see again like you need to make sure when you're doing something that you have a sample input that you have a sample output for each thing and you have some way of checking them all together right so Advent of code does
1:20:13this for you and this is one of these things where when you jump outside of Advent of code you need to have the rigor to do all of those things yourself so this is working so um you know again probably what I would do here is I would just say like Okay add a copy of the message def solve 1 a x sorry uh Sol one
1:20:41a it's for isn't it I guess we called it yeah for my x's uh in fact let's just call exactly the same thing for lines right colon um and so it's useful to know that if you you select a couple of lines and press um command or control right square bracket it indents them okay um and then we could return Oopsy
1:21:08Daisy return R so like because we've all like you can see why I never needed debugger right because nothing's ever mysterious or unknown I always know exactly what's going on you know um and obviously we're working on a extremely simple problem here but at answer AI we often work on problems even harder than Adent of code 1A and the harder it gets the more you have to use
1:21:37this dead simple rigorous approach you know every single time um okay there we go jonno did you want to do a more fancy way I I know you're Fancy no I think I think this is actually good maybe we could run it on the full input so now using the no worries now Audrey created that little gist for us um which is that in the
1:22:07fact yeah top link very top not bad okay so um John I already showed how to do these steps
1:22:26uh and this step and I've done them already I think let me just double check yes I do have an AOC session so I should be able to paste
1:22:45this that looks good okay so [Music] um you know what I would be inclined to do at this point jonno is to see how I created lines because we need lines right and I would copy that and then I would go down to solve 1
1:23:08a and I would paste it here and it's now not called samp it's called imp does that seem reasonable mhm okay uh we probably don't want all the lines so uh you can index into lines with like us to get a single line like so or you can get a few lines um by um oh there's my keyboard sto working so
1:23:36we can get like the first three lines and you're back to samp there ah thanks this is why you need a good Navigator see in M okay what do I do now jonno uh I think we can just call 1 a lines again cuz lines is now the full
1:24:01thing and then we're expecting a much bigger value than 142 good to think about that promising okay um and I actually already solved this so if you type it in now yours will be different because everybody has their own input right so you can't just type in 55130 and I suggest um um that you know everybody try to go
1:24:29through this same process you know even if you're a super handy developer you don't have to use the AI or whatever but just this practice this like samp samp. spit lines x equals samp 1 do it on X create a function and you can see by the time we'd got it working on one thing doing it on all the things was basically instant and it basically worked first time perfectly and this is
1:24:58my experience of like programming is this is how it programming normally works for me is that I am normally in a flow State I am normally continuously improving I'm normally finding that when I apply my function to my input that it works first time and it's not because I'm clever you know it's because I check my data at every point I'm very Hands-On
1:25:27um uh and it's to me this is a really nice way of programming and um it it it works very well with AI you know because you know small little steps and from time to time there'll be little insights of like oh there's a you know like the other day for example more than the other day a little while ago we were like uh our data structure
1:25:54for solve it isn't ideal we're like and specifically it's because we wanted to add the buttons to create uh a new message above or below a previous message rather than putting them at the bottom so previously we had just a SQL light table with all the messages with an auto incrementing ID we just add something it goes to the bottom no worries I say oh how the hell do you insert something between messages you can't insert a key between keys and then
1:26:24my brain was like well you can Jeremy if a key was a float rather than an INT I was like no keys can't be floats I like well maybe they can and so you know in AI magic I asked like uh you know again it's it's got all my context so it's like hey what if we made this ID a float and I could insert things between them and there's quite a few little techniques we teach you along the way but one of the things I love to do when I come up with an idea that seems
1:26:52interesting is I ask like is this a thing so I basically I said is this a thing is this a known thing or is this really weird and much to my surprise AI magic said oh it's a thing it's got it you know uh you know no problem here's how you do it and then I like okay does the thing have a name this is a really critical step it's like yes it has a name it's called fractional indexing now at this point I stopped talking to CLA and I started talking to Google and I googled fractional indexing I found a
1:27:22fractional indexing library for python it has a way better approach that actually uses like base 65 encoded digits you know or characters instead of floats and my life was great and like and now I learned about this amazing new algorithm and I had a you know a ppie library for it and that made me very happy you know so um yeah I think we're done and we kind
1:27:51of plan to be 60 to 90 minutes so we're pretty much dead on time 0 on the dot yeah um what do you think Jon anything you wanted to um add before we wrap up uh guess we have to tell people about maybe their homework for this week or for the next three days right so what should people be doing before the next lesson what are we going to do in the next lesson um and then maybe it's something to leave for next lesson but it'll be good to say like what do we do with this artifact this big conversation that we've got if
1:28:19it wasn't just I only care about that final answer um but I think that's something we can tackle down the road yeah and for now for people who want to quickly look you know click on settings click on export and you can export a python file with a subset of those and create a module um but yeah I think if you can if everybody can try to make sure they've done uh one B so the second half so repeat what you just saw and then do it for the second half um try and take advantage of these techniques try and
1:28:48take advantage of the platform try to do it in a way which is different to how you've previously used computers this is not cursor it's not vs code it's not Vim you know um you know bear with us give it a try practice um and uh you know time permitting you could try um uh problem number two as well but don't feel like there's no there's no hurry you know uh if there's no such thing as being behind you know if we start
1:29:18describing problems that you haven't got to yet that's fine you're probably a slightly newer coder than some people in which case your job will be to replicate what you've seen without having jonno and I doing it in front of you and that'll be a good enough Challenge and then maybe you can try 20 you know this year's uh Advent of code problem one instead of last year's problem two for instance how does that sound sounds
1:29:46good okay thanks everybody uh we'll see you in three three days time Thursday Friday no 4 days time four days time and lots of activity in the Discord in the meantime yes and we know it's Thanksgiving so it's fine if you're not around it's fine if you miss the next class all the recordings are available as soon as I hit stop thanks to YouTube live so um all good J that was a lot of
1:30:14fun I enjoyed it thank you very much bye