0:00and we should be live hey people see me and I had YouTube open in the background so I heard myself so that was embarrassing that t okay and let's delete that picture of me
0:30because I don't want to see myself all right oh dear okay and get my notes so I can see what we're talking about
0:47jonno all right um before 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 about to um there will be a 2 gigabyte quota a 2 gigabyte quter on your on your discs on your volumes uh
1:15anybody with more than 2 gigabytes uh your data is going to get deleted like all of it um so get it down beneath 2 gig before 2 days from now passes please and then after that there'll be a quer so that won't happen again you'll you'll find out you don't want to get too close to that 2 gig quer though cuz if SQL light tries to um write stuff uh into your you know into your volume and can't
1:45God knows what's going to happen so don't use lots of dis space uh you won't do 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
2:01um 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 so please try not to like run something that takes up lots of CPU and stuff like that 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
2:30during 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 um as best as you can um and then the third thing is
2:52um 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 your if you're on a Mac um so okay so that's that then another quick admin thing that I wanted to mention is I know a lot of folks haven't used Discord very much so I wanted to
3:20give you a quick guided tour of how to use Discord effectively so I'm going to share my screen um so Jon are you see my screen okay yep okay so um basically the key thing I think to making Discord work well is to like mute the stuff you don't
3:47want 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 unread um and so this is how you can
4:16basically 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 you will be looping through um when you
4:44press 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 the stuff you 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
5:14done 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 gray out um and so I've muted the geography 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] um and then the other thing I wanted to mention is uh sometimes you'll come
5:41across 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 as far as I know I think this is new functionality 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 called
6:09um 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 them and then another really important one to know about is to go back to where
6:38you 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 contained but I think that's um yeah that covers all the important bits to know and we'll keep the key
7:07information and 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 all messages and that way you'll get notified of every announcement um that's a good good idea just to scroll back and look at the ones that are already there and the most recent
7:35one 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 take an eye keep an eye out on the fact um in general I'd say though like like [Music] um sorry I'm just trying to find
8:06my how do I stop sharing normally there's a little thing that they pop up where you can say stop sharing but I guess it's not happening today oh that's crazy show meeting window there we go
8:31oh was I not sharing that whole time you were sharing okay oh where did did it stop sharing then when I it's still sharing as far as I still sharing I see there we go stop ah got it all right this is all things keep changing in Zoom okay good
8:56um okay all right so I think that's our Logistics unless I missed anything jonno should we start Theon 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 um answer Ai and this
9:25is Jon o um fast AI is now part of answer AI so we're also from Fast AI uh answer 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
9:54fast ai's New Era um which is going to be super different 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
10:23of the fast AI series when it was quite a polished product the first half um yeah that might have set some expectations 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're 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
10:52we move into a different way of of doing this educational thing so yeah I'm pretty excited about that um 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 are the people most
11:20likely to not be too shy about doing so so you might get the impression it's all AI researchers and professors and whatever but actually a lot of the people in the course 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
11:49and 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 whatever 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
12:19together as Jon o mentioned this is a you know the whole thing is a bit of an experiment so um we're we're excited 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
12:47running and you'll see that there's a number of upcoming events quite of those few of those are office hours so office hours is when a um a member of the answer I 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
13:15always welcome to jump into any voice Channel but if there isn't office hours going on then please leave the office hours voice channel for office hours and if 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 Sol platform or anything else there's also study groups um study groups are
13:44different to office hours in that again they'll be generally speaking in I think we guess we'll create a study groups um voice Channel there won't necessarily be any answer AI 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
14:11together and then finally there are tutors um so there's a thread um in admin called tutors in Discord where if you um are happy to pay somebody to help you can get one-on-one tutoring 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
14:40on 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 maybe what the solvit platform is and how do use Z 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
15:07screen 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.
15:20fast.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 solit um lessons and things but also importantly the Sol 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
15:50you a little tour um you can create dialogues or or loading 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 Sol 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
16:18here 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
16:46italics this is just uh text that's rendered nicely and when I sub just mention um uh I did just check this uh 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 in 720p so we'll see um so apologies for the low resolution
17:14folks I'm not quite sure how that happened 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 the 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
17:42or prompts to the AI and that's going to come back and respond um and so these three ways of adding messages this is how we'll interact there's shortcuts for them so control J K and L to toggle through or you could just oh control shift yeah you're right sh 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
18:11you see the result and it all goes away so for example we'll get more into 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 in other 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 these the sort of Dynamic Auto Complete that some of you may know from something like
18:40IPython shells or Jupiter whereas if I um 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 autocomplete is 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
19:09shared 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 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
19:38you 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 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
20:07clicking thing is it is quite helpful to double click on a word to select it and 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 those changes but definitely um at 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'll definitely be able to edit it either way the question is so right now you can edit it either by
20:36clicking 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 solit interface um you can export your dialogues as IPython notebooks or as python files you you can set up some additional context for the language model assistant behind the scenes um there's some settings for if
21:05you'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 contr 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
21:34a 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
22:04AI 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 more needle them or try every way we can to get them to actually do what we want and
22:33then 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 kind 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
23:02approach which 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
23:27iterative way um so certainly uh you don't have to use solv it to use dialog engineering uh dialog 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
23:55um we're going to be doing that VI ire um specific examples of problem solving um and most of the specific examples of problem solving we'll be covering our ones um from something called Advent of code so maybe jonno you might want to explain what that is and why are we using it sure thing so um Advent of code has
24:21been around a fair while and many of you might even be familiar with 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
24:50and what these look like are unusually wellp specified programming problems right 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 so just to check we're we're currently looking at a Google doc on your screen and the YouTube chat that's definitely incorrect sorry I must have shared the wrong screen um all right let's let's try that
25:19one more time back up and start again shall 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
25:48choose those although the 2024 ones will start 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
26:16problem there's some sample data and some 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 valid ated 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
26:44trying to demonstrate as many as possible you know additional cases where we've used the same approaches but the Advent of code are very nice as a grounding block that are definitely 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
27:13of code a lot or you're a very experienced programmer in general you may want to um keep an eye on how we're doing them but you might also find out okay then the first few lessons are some something that you can skip through quite quickly if you're completely new to programm 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
27:42and I will aim for here which is 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 you know a university qualification in computer science who'll kind of say like oh this is a classic
28:11example of the algorithm on page 78 of the Dragon book and you know I use that with this well-known linkage structure and it's like it it can make you think like oh the the way to solve these problems is to learn a thousand 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
28:39the course of of lists and dictionaries there's never going to be a case where we'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
29:08by combining your coding prowess that you'll develop and Ai and one of the things 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 is 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
29:38and more complicated and admired in technical debt so this is really trying to do the opposite of that and we're you know we'll show ways of you know of how these basic techniques apply to all kinds of stuff well out outside Advent of code problems you know particularly coming into next year you know things like screen scraping machine learning
30:06evaluations uh you know all kinds of interesting projects um like that but maybe jonno I might kind of jump into also talking about the problem solving process as well as the coding um so one of the things you'll see in the announcements Shad is I've got a link to a little summary of uh a book called How to solve it by a
30:32mathematician named um George POA um so um George POA um died a few decades ago um but a very famous mathematician and you'll have 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
31:00its kind um and interestingly you know as we were developing our own understanding and in fact I've been kind of building this approach to solving problems for uh I'm 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 paa's book like wow there's a lot of overlap here so there's there's a lot of
31:28inspiration from polio um and so it's worth at least looking you know from time to time at the problem solving framework 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
31:57help 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 this 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 jonno is fond of and I think is great is saying like
32:26well okay what would this point one step before the solution look like and it's like oh well okay that would just be this 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 I won't go through
32:54all of them but we will be over over the course um and you know there are some useful heuristic strategies that paa talks about as well and again we'll be we'll be covering these in the course 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
33:19um is is not you know a a a math approach and so it's actually useful to um I'm going to remind myself how to stop 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
33:48you 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 of 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 first time um but
34:16doing 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 where 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
34:43um 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 and try to use an approach somewhat like what we're displaying um but feel free to to Jump Ahead in Discord there is a
35:07um 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 Advent 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
35:35them 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 1 a um from Advent of code um and then yeah jonno do you want to talk a bit about what what happens after
36:03that 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 and 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 we won't just be doing Advent of code we've got bits of showand tell will'll potentially be surfacing uh examples from the Discord
36:30if 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 demo or a walkr or a a live like solving some problem with this 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
36:59problems and starting to do the practice that's so critical um so I can start showing us how to get set up on the Adent of code data itself and like I just mention like before we do I just want to mention some of the other platforms that that we'll show so solvit the platform that we're showing here is um a kind of a a simplified cutdown education focused version of an of an in-house tool we've been developing this year called AI magic um
37:28it and so I've been using it for quite a few months 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 cursor sometimes um you know the there we'll be showing when and how to use these other tools as well but
37:57I 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 to evangelize it um uh we'll be showing a range of tools and it' be interesting
38:26for folks to experiment think in the Discord with Claude 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 cursor um um and see how the experience goes anyway sorry jonno to interrupt 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
38:55dive into the actro 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 inertia before it starts feeling really good so anyway that's just another like note from someone else who's started trying to put these
39:24disciplines into practice it was quite difficult and and this course I think we'll 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 while 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 cines of code out and like it's not necessarily healthy and we're definitely not going to give that dopamine hit
39:52right yeah yeah it's 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 mentioned is our internal tool um so there's there isn't the external version of that is solver and so the folks in
40:21this course are going to see the very first time the thing that we've been using in 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 about how messy it is and so solv it like you know gradually we're bringing bits of this into into a tool that's
40:50actually 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
41:09well cool okay I think that's a lot of a lot of good intro shall we uh should we get to Advent of code marous 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
41:39Jon I see like a little example there right which we 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 say save or copy and and put somewhere um so to to work around that there's a a lovely Library called uh Advent of code data this is already installed so you
42:07don't have to worry about that um but it does require Adent 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 we'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
42:37Tab 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
43:06session ID and so this is a Syntax for Linux for setting um an environmental variable it'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 have this Secrets pane
43:34here and so very carefully copying and pasting AOC session in my um solv it settings AOC session and I'm going to paste in that secret and save I would suggest actually pasting in the name as well because 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 but yeah uh for now please copy and paste both parts so it's not wrong good good point yeah make sure
44:03that 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 um just going to put this in a variable here
44:28okay 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 solv 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
44:56so 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 going just go back to
45:26the 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 solvent 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
45:55giant 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've 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 ephemeral it'll be there forever you can pip install 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
46:22messages um they can be code note or prompt messages and then code and prompt messages can have responses code response is whatever is the result of evaluating that expression uh or anything you printed or any graphs you created so forth and a prompt the responses um whatever the AI said
46:43um 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 if you wish um
47:12and um we're going to go to Advent of code and basically the it's called a a dialogue for a 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
47:38copy 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
48:062023 um and then I'm going to paste and this is actually marked down 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 see the
48:35note 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 day 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 to do 1B and day two before next time it's fine if you don't but by having a go at it yourself it's
49:03going to be you know you'll learn more right um but this one 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 jonno 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
49:31way we do pair programming is we 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 a 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
50:00reading manuals or whatever while 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 Cali document to show off their art skills and so they
50:30can't read the document 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
50:58digit 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
51:25is very very long right so we don't start there right and in this technique we're going to be showing you it's just 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 Jon to tell me
51:53how to do things so I'm still Dr 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
52:22we don't have to type the whole damn thing in every time so why don't we call 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
52:43here 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 as uh oh that didn't work so this
53:11is where we can talk to the model 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 uh 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
53:41do for you so then I can press command enter or click on the submit button and uh Claude Sonet has a think about that um and it tells me like oh when a string so bu 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 like samp equals quote
54:101 a b C2 so oh 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 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 uses back sln um if you don't
54:39print 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 um but yeah good good idea to split it into
55:08a 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 going to edit this now to give it a name my list and again we can write it
55:37afterwards 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 S into a list but jonno is pretty good at programming python so jonno do you know how to turn this into a list yes I believe python has a built-in called
56:07split 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 fun you have to do that okay M um and again you know I I one of the parts of this is to look at your data at every step so
56:36like 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 joh are you are you happy with this list uh yep that looks exactly like what we want can go compare to 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
57:06one 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 but 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
57:36output 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 right and so maybe like talk me through how did you get that answer what was your like actual internal thoughts or
58:05process for getting that 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 was 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 pick 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
58:34didn't even pick out the numbers I just I just went through left right until I found a number and then I went through right to left until I found 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 through 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 can go
59:03through for character in string right in a for Loop so let's do that and let's start by just printing out the character 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 let's like oh I remember now and
59:31lines 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 Loop one 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
1:00:00with 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 keyboard 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
1:00:29experience 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 characters 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
1:00:56represents 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 with 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
1:01:25go 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 this 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
1:01:54in it oh you probably want to use something like this and in this case it's given us yeah the is digit 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 suit 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
1:02:24so that it would be easier for us to build stuff um and uh um the platform solv It Was Written In Fast HTML um and um the data is stored in another thing we built called Fast light and um yeah it's all written from scratch that'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
1:02:52for that um and the kind of um uh the the system that's going on under this hord is basically one that's um a lot of it has developed 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
1:03:20together um including the teach Eric and Jeremy's kids math project and the fast Lo project in the fast HDL project and um and 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
1:03:49things um um yeah and it's important to note like that um what's being sent actually I'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
1:04:16to Claude right so um I could say like import random right um and again as jonno mentioned like the the auto complete is based on what's actually in your python interpreter so I run that and then I say a equals random Dot and I can see what's actually in there right so I'll say random okay and I'll print it out and
1:04:43then we can uh ask um uh can you tell me what uh a is now okay cool and then there's a nice little button here which is very similar to one you've already seen which is I click this on an input to get a copy of a message so if I run this
1:05:10again I'm now going to get um actually I didn't quite want it there let me delete that because I want to put it right at the bottom oh actually that's fine so now if I say here what is a now so I'll double click this to rerun that prompt and it should say
1:05:32848 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:05:53it 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 first random as a note for example because in
1:06:23your vase 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:06:52it'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 they 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 digit or not but rather than going back
1:07:20and 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 revised version so if I said um add a copy it'll be put it immediately underneath but I 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 digigit just to check that the AI hasn't hallucinated this function
1:07:50you know make sure 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 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:08:19digit equals true then we can set the first to be whatever that number happens to be um sure do 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:08:48called 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:09:12first equals o am I done um jonno not quite um and maybe we should explain to people why okay 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:09:42it'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 digit or not I'm just going to run see oh 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 be a three yeah um and so you
1:10:10could you could catch 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:10:39what'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 teacher
1:10:55hm that's quite nice I'm going to run this so I'll say add message with code and this helps me not have to necessarily do it in my head as much but yeah okay so what you're saying jonno is what I should have done is to stop because actually it kept going no worries so I'll copy this and
1:11:26what do I do Jon how do I stop once I found it so there's there's one thing we could do which is to 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 last character so we could potentially ignore this diversion but it's also like oh I accidentally solved the second part
1:11:56so 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 um or we could say that as I'm just going to paste this working one and I changed this to last yeah how about that yeah there we go so now we got the first and the last fantastic okay great uh so now I could
1:12:25just say [Music] 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:12:46me okay and of course I wouldn't just run it right I would need to always output something something nice 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 going to come back
1:13:15to that jonno which is like I often get lost so just I 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 got it in your head um but I think it's nice otherwise we could just scroll up of course and we have um so this is quite nice to kind of keep track of it I think yeah go ahead so we have to combine them to make a two-digit
1:13:44number so I wouldn't mind modifying this to create the two-digit number this 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 wanted 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
1:14:12them 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 38 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 eight so f plus L should give us that nice and of course if you didn't know that already
1:14:40you 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 Open brackets f plus L see if I have no idea how to do that obviously cool how do I convert this string into the actual integer
1:15:0638 nice I mean obviously jonno told me but I don't trust him okay right 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 like 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
1:15:36new 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 n AI now does this as well I think but almost nobody I see out in the rest of the world does this as soon 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
1:16:05like okay oh I didn't know about int what the hell is that so you could say help in right and 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
1:16:35mark right to get a slightly shorter version which is nice um you know or of course uh python int function 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
1:17:02kind of surprising ones like oh int wow there 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 read 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 to be like
1:17:31how 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 before 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
1:18:01so 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 do 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
1:18:28magic 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 modify that code great um okay so um this is so little I would be inclined personally just to to modify our function to M add those steps if that's
1:18:56okay with you so yeah you know I could edit it here but you know I actually kind of prefer to stick everything you know bit more like this so uh just it's just int first plus last is that all right MH and let's see if that does what we hope okay there we go um cool next step I guess
1:19:25yeah yeah so we so I don't think I need your help for this Jon I'm just going to Loop through and run it is that what you're thinking yeah yeah sounds good and like this 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
1:19:54this 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 um 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 years of bits of research all coming together right but exploratory tutorial exploratory programming is something you might want
1:20:23to kind of look into to some of these videos and stuff haml husin has a really good one as well which we'll link to somewhere um okay so I'm just going to print get digits sorry I've got a treat uh which is rare but fun is that I spotted a 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
1:20:52take us much time but I could have said hey Jeremy I I think you mean lines instead of X 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
1:21:22so M yeah I just add these up right yeah I think 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 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 me here I would here I would do it the dumb way to start with i' say result all equals zero particularly because like we've already halfway there right like I think for
1:21:50this okay you can do it the fancy way in a moment but first of all let's do it the non fancy way CU I think we can just say res plus equals that's just short for res equals res plus MH 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
1:22:20have a sample output for each thing and you have some way of checking them all together right so so Advent of code does this 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
1:22:46message def solve one a x sorry uh solve 1 a oh it's for all of them it 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 select a couple of lines and press um command or control right square bracket it indents them okay um and then we
1:23:15could return Oopsy Daisy return r so like because we've all like you can see why I never needed ebug 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
1:23:431A and the harder it gets the more you have to use this 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 um maybe we could run it on the full input now using the no worries now Audrey created that
1:24:11little gist for us um which is that in the fact yeah top link very top not bad okay so um John I already showed how to do these
1:24:37steps uh 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:24:57this 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:25:19a and I would paste it here and it's now not called samp it's called imp does it 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 where's my keyboard sto
1:25:50working let's press cancel try that again oh my keyboard St working that's weird okay I'll use my other keyboard um so we 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
1:26:19imp okay what do I do now jonno uh I think we can just call solve one a lines again cuz lines is now the full thing 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
1:26:48in 55 130 and I suggest um um that you know everybody try to go through 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:27:151 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 my 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 am normally finding and when I apply my
1:27:44function 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 um uh and it's to me this is a really nice way of programming and um it it in it works very well with AI you know because you know small little steps and from time to time there'll be little
1:28:14insights 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 for 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
1:28:43something 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 and then my 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
1:29:12so 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 interesting 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 a 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 was like okay does the thing have a name this is a
1:29:41really critical step it's like yes it has a name it's called fractional indexing now at this point I stopped talking to Claude and I started talking to Google and I googled fractional indexing I found a fractional indexing library for the python it has a way better approach that actually uses like base 65 encoded digits you know characters instead of floats and my life was great and like and now I learned about this amazing new algorithm and I
1:30:09had a you know a pie library for it and that made me very happy you know so um yeah I think we're done and we kind of plann to be 60 to 90 minutes so we're pretty pretty much dead on time 90 on the dot yeah um what do you think jonno 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
1:30:38lesson 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 it 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
1:31:04module um but yeah I think if you can if everybody can try to make sure they've done uh 1B 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 take advantage of the platform try to do it in a way which is different to how you've previously used used computers this is not cursor it's not vs code it's not Vim you know um you know bear with us and
1:31:31give 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 describing problems that you haven't got to yet that's fine you're probably a slightly newer codus and 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 that'll
1:32:01be 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 good okay thanks everybody uh we'll see you in three days time Thursday Friday no four days time four days time and lots of activity in the Discord in the meantime
1:32:31yes 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 fun I enjoyed it thank you very much bye and stop the streaming somehow um