Eric Wastl — Advent of Code: Behind the Scenes | Øredev 2019

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

I got mentioned! (Indirectly)

👍︎︎ 7 👤︎︎ u/Starwort 📅︎︎ Nov 24 2019 🗫︎ replies

Really interesting to see the work and consideration that goes into all of it :) I'm really happy that the people behind AoC take things like puzzle readability, accessibility to non-coders, etc. seriously, especially because they could have chosen to not do so without much consequences. The care and prioritization of quality is really inspiring :)

👍︎︎ 4 👤︎︎ u/mstksg 📅︎︎ Nov 24 2019 🗫︎ replies

Just as information for those who watched Eric's other recent talk: this is pretty much the same talk, so you're not missing out on anything additional by not watching this one. The only difference is that he gave this one on his birthday.

👍︎︎ 3 👤︎︎ u/sim642 📅︎︎ Nov 27 2019 🗫︎ replies
Captions
hi my name is Eric hostel I'm the creator of advent of code why don't we begin here before we get started a quick show of hands how many people have actually heard of advent of code before we like actually oh good ok that's that's important that's a probably a prerequisite for parts of this talk how many people have solved at least one puzzle though all right still like the same number of hands how many people have completed an entire year how many people have completed all of the years one there's only a couple hundred people in the world that have completed all of the years well done all right well yeah so my name is Eric hostel and this is advent of code behind the scenes who let this guy in stage anyway so I used to make large-scale web applications for ISPs but now I work on infrastructure for an auction system both of these companies are in Buffalo where I live these are my day jobs on the side I also run programming challenges like advent of code I also make tools for games these are EVE Online League of Legends minecraft and world of warcraft in that order I also make fun of programming languages if you've ever been to these websites this is also me just being snarky instead of teaching people stuff I also make lots lots of other random things but we're not here to talk about those weird to talk about atom to code so what's Advent of code let's rewind a little here's a question what if you are here sorry let me zoom in a little bit there sorry what if you are here at this tiny cafe in Salem Massachusetts hanging out because you're there with some friends that like Halloween and they wanted to come and see the place where Halloween is celebrate whatever and all you have is a pen a few napkins a few weeks until Christmas a random memory of advent calendars and a passion for programming puzzles and helping people learn to become better programmers the answer i've been of code which is a combination of advent calendars and programming puzzles so advent calendars yeah so you depending on how you celebrate Christmas or whether you celebrate Christmas you may have seen these an advent calendar is typically a little like cardboard box or sometimes something you can hang stuff on or whatever that every day for the season of Advent which varies by how you define it but an advent of code we use the first 25 days you basically countdown until Christmas opening up a little door and getting out a little chocolate or a toy or you know whatever a programming puzzle may be very traditional gift into advent calendars this one is mine when I was growing up you take out the little ornaments you just hang them on the trees and really get anything but it's usable it's nice right at Advan of code they look like this where every line is a door that you can click on and you can open it up and get a puzzler sometimes they look like this or sometimes they look like this so where's the programming puzzles in here well they're down here every day one of these lines lights up and you can click on it and when you do you get a puzzle and the puzzle has some kind of goofy story about Santa and elves and rescuing Christmas and all of these things that go on and eventually you get down to the part where it actually explains to you what you're programming today and in this one this is the the first one of last year it says add up all the numbers in the file okay well that's that's alright that's fine what's where's the file okay there it is get your input the puzzle and puts the same for part 1 in part 2 spoilers and then you finally get the answer and you add them all up when you put them in this box and hit submit and you get a gold star and then you move on to part 2 which takes the same input but makes you do something different with it and hopefully something that forces you to rethink how you approach the problem or maybe it was something that tried to verify that you were on the right track for solving the puzzle or something I'm getting into how I design that stuff in a second but part 2 of this one was you have to keep going through the list adding up the numbers over and over and over because there's pluses and minuses and it asks what number do you reach like what what total vut do you reach twice in a row or not twice in a row twice at all ever and it takes about 100 loops and you go through and you finally get a second value and once you fill in that one you get two stars and then the calendar starts to do something and as you answer more puzzles the calendar fills up more and more until eventually you have a full calendar and there's a coffee mug floating in space for reasons that are spoilers and you'll have to solve the puzzle to find out so it's 2015 and you just built a bunch of programming puzzles where should we host this thing programming puzzles probably won't be that popular let's do some some capacity planning many of you probably have your engineers have to do some capacity planning at your table of some sort have to figure out how big the server should be the ho stuff right programming puzzles won't probably probably won't be that popular but I have a few friends that might like it ok and I've released silly programming things like this before so I have a rough idea you know they might have a few friends that like it 50 people 50 people seems like a pretty safe guess friends and friends of friends and it's programming puzzles and you know it's kind of a niche thing mmm but I learned at work that we should have good margins on our estimates 70 wide margin right all right good so a small personal web server will cover it just fine will be no issues I've got a server that's running someplace that will be able to handle the traffic point that point the domain name at it hosted there it'll be easy so it's November 30th 2015 now it's almost December 1st it's time to publish start publicize the site to the world and tell everybody to go to it and do whatever there is nobody's heard of this thing before so I release my secret project and it gets 27 retweets which is perfect that's within margins good okay so capacity planning is fine 27 retweets is fine so here's a graph of the number of users that have signed up starting when I announced it and open the site up until midnight before the first puzzle unlocks so there are 70 users there's 81 users looks like we're well with an estimate that seems completely completely reasonable nothing bad will happen foreshadowing uh then the puzzle unlocked and the graph does this if you're if you're not a technical career path you you may not know the technical term for this shape of a graph which is hope no no no no no 12 hours later there's my estimate and the graph is just gone it's just left let me zoom out a little bit that's where it what it did this is a bad shape for your graph to have that's my estimate that's 4,000 people so okay I mean capacity planning right we should consider how how this is going so far take a step back we estimated 70 people we have 4,000 12 hours into the event it's a 25 day long event that's not great we're off by five thousand six hundred percent the small server is very sad that's also the technical term for that so you're bad at traffic estimation now what so you've got this project that you didn't expect to be popular this parts interactive by the way you have this project that you were expecting to be popular and or that you weren't expecting popular and it's just like small server running you know can't keep up with this traffic the the CPU levels are high the memory usage is high the disk the disk i/o is high like this is not going to keep up with this kind of growth curve now what what do you do scaling scaling what it's one server I don't have I don't have time to like build out a infrastructure somewhere what do you do caching maybe except that every user has different content different website different internet did anybody say turn off the minecraft server because that got way more capacity turns out that was the problem at least part of the problem because then the numbers kept growing and we had to do not I - which is don't create a new process to handle every single request no hang on what why why what is that so CGI is kind of an old way to run things but it's an easy way to prototype build stuff the way CGI works is you have a process a typical UNIX POSIX process typical processes have some kind of input environment variables and standard in and that sort of stuff they produce some kind of an output a standard output standard error they in in CGI they are mapped to the headers in the request body coming in and the HTTP response and the logs going out pretty simple easy to build stuff easy to produce stuff sometimes I might also talk to database files API calls things like that but in general when you're running a process in CGI you have these kinds of inputs and outputs and the problem is that while this is simple this happens for every request you get which for 70 users is no problem but for 4000 users is very very very bad when you get rid of that overhead by switching to emergency switch fast cgi panic mode that was a horrifying day it was much much better fast cgi basically just mimics cgi but doesn't actually restart the process it just sort keeps feeding at new inputs and it barely handled it but it did work so 24 hours sense unlock the graph continues to look like this that's my estimate there's 9,000 people so hold on a second where did all these people come from like what's going on does anybody see the flaw in my reasoning you may notice that this part of highlighted is recursive so this happened because social media is a weird place and all of a sudden everyone's friends friends friends friends were talking about it to their friends who were talking about it to their friends this Scrolls for a while 48 hours after unlock there's my estimate that's 15,000 people let's fast forward a little bit that's what the curve looked like at the end of year one that's 52,000 people by the by the end of the first year at which point people were using the site significantly less and we did the actually correct capacity planning thing which was to just move to AWS completely which has been serving us very well because if more people who go to the site I could just click buy more servers until it stops breaking like a real business right today we have 250,000 people and it's still growing which is fine because I can click buy more service a couple more times so why do people do Advan of code what's going on a lot of people do them as practice problems either because they want to get better at a language that they've already been using or there's some new language that they want to learn because it sounds fun or because their job is hiring them to do some new project that has rate something like that but to basically holding their skills on some kind of a language or or on problem solving or on like algorithm design or data structures or in general right that sort of stuff but a lot of people also do it for interview preparation there are a lot of companies that ask questions like advent of code puzzles in their interviews and people will use advent of code for interview prep for that I'll talk more on that in in a bit actually there are some companies that do it a sort of a company corporate training sort of event thing where during December they'll take a Friday and and anybody that wants to go into a conference room and work together on these puzzles together like Friday afternoon instead of doing their normal job because that company is good and thinks that learning is fun which it is some people do it as a speed contest I don't recommend this but there is a leader board that tells you if you were fast you weren't don't try it's not a good idea the people that get on the leader board are competitive programmers that do this year-round and just like this is just all they do all the time they know all of the tricks they they take all of the shortcuts they do not build good like good maintainable code like they're hacking together the first thing that'll work they they already have an implementation of highly optimized a-star using a priority heap on they're like like ready open enough in a window like you're not gonna go faster than that it's not it's not a good idea it's not fun I don't I don't recommend but a lot of people enjoy doing that more power to them and also challenging their friends so if you've gone to the subreddit which is a very encouraging group it's kind of neat I'll talk more about the community in a bit a lot of people there will say hey this puzzle was neat but I can think of a way to make it significantly harder can anybody solve my much much harder version and some people can and it's super fun and some people are like what do you what and then they read the solutions of what that's fun too and then hopefully somebody comes along and explains and everybody learned something new that day so who are all these people that are doing advent of code everybody primarily english-speaking countries obviously but like I get traffic from most countries like significant traffic here's the United States New York is where I live Buffalo and I'm blaming California because when the puzzles unlock at midnight in New York it's only 9 p.m. in California which means that they can actually still be awake to do them here's Europe where you guys have to wake up at 5 a.m. and 6 a.m. and I'm only a little sorry some people use it as part of their morning routine though this is somebody literally doing Advan of code while in the shower getting ready for work and I get a lot of comments about this both positive and negative I get some people saying you know waking up at 5:00 a.m. every day it's not easy there's there's no way that I can get up at that time I just get up in my normal time and then I do it during my lunch or whatever you know and then there's a whole other group of people that are say that that's say something like I have never been able to wake up early as reliably as I can December 1st of 2015 look great that's cool there are a bunch of people actually even in in Europe who stream the moment it comes out at 5:00 or 6:00 a.m. like still in their pajamas like like well done like half awake like barely have their coffee they're like what is this problem oh it's alright I hang on let me just drink 17 coffees and I'll do it like right on stream like cool who are all these people they're their programmers their programmers of every type here's a bunch of languages of all different disciplines and styles if you if you look just on github for these you can see 23,000 repositories of any language you can imagine including some repositories that have 25 different languages in them which is alarming and a little weird but super cool right let go for it here's somebody that solved a bunch of them one year using an FPGA an FPGA is a circuit that you can tell to be any circuit you want and so it's basically solving it in like configurable hardware I don't know exactly how it works but it's super super cool and they solved a bunch of them by building a circuit and then configuring their fpga to be that circuit and then it would solve the puzzle and it's really neat you get companies that do it most big companies have at least a small group somewhere that's doing it there's london facebook posting all of their visualization on the on the the glass overlooking the stairs just the people could see all their cool stuff here's a University I think in Poland that everyday would translate the puzzles so that during that day their students could read in their native language and then solve them and then they would all post their solutions on this on this Bank column in their Student Union so that people could see all the stuff that they were working on and work together on things that supernatant non-programmers do it a lot here's somebody doing I think this is day 1 of 2016 in a graph paper which was working out pretty well for this person until they discovered that one of the liked turn left right go this far turn left right go this far distances was like 600 and so they're getting out some more graph papers they can't go out the rest they eventually got the right answer though this is that actually they just took them longer than the person here on the couch who already is finished but you know here's a guy on reddit who is also a friend of mine actually who does every year in Excel he finishes about half of them which is astounding because he's using Excel not visual basic mind you literally just cells and equations and like that's it and he solves them and this is incredible if you ever see him posting his solutions just open up the spreadsheet count the number of seconds it takes for Excel to actually load the spreadsheet and then try to figure out what he's doing because it's madness also on this note actually I was just talking to a group where there's a company where they're trying to get their managers to get more into thinking about puzzle solving and they're gonna use advent of code to do it but most of the program oast of the managers aren't programmers so they're gonna tell they're telling you managers like hey just use Excel you can do it that way and and there's a couple programmers that are gonna be doing in Excel with them to try to show them like look if we can do it in Excel so can you here's here's somebody using Google sheets also if you don't want to pay Microsoft you can pay Google instead did solve puzzles that way so here's this is a 20-18 de 6 or 7 i think it's the one we have to have the parts for the sleigh and you have to figure out what order to assemble the parts in in order to figure out how to build the sleigh right and you're supposed to write a program that figures out that it's a directed graph and tries to find a topological sort and does one there's all these fancy words for the things you have to do but you basically have to figure out what order to do the parts in right this and just took all of the data from the puzzle plugged it into a Gantt chart system and asked what the answer was and that worked completely fine that's great here's somebody that solved one of them in Minecraft that the stone blocks here are that are the data from the puzzle and it's actually going through and reading the data and doing the calculations in - it's not a good idea but you can do it so let's talk about let's talk about puzzle design a little bit so I build a lot of puzzles when when I'm ready for this year which I am almost I will have designed 250 puzzles which is a lot of puzzles and there are some things that I need to do as part of the advent of code format when I'm making a puzzle but there are some things that I've taken away from it and just used as good ideas in general when designing a puzzle or anything that's even puzzle shaped a lot of corporate trainings or even just like complicated documentation with examples of like how to use a feature in some library or maintaining or something like that all how kind of this similar format of like here's how to explain like how this thing works how to use it here's some examples of how it functions here's places it might go wrong and explaining that sort of stuff has to happen regardless of whether you're doing a corporate training or at an open source library or making a puzzle on the internet for a button for 50 of your friends right so some of the things are avoiding ambiguity which which sounds obvious but it's a little bit more difficult especially because I've got users from all around the world many of whom English's in their first language so looking out for things like confusing sentence structure or multiple interpretations of a sentence it's really easy especially in English because English is awful to build a sentence that just like doesn't make any sense so that could be like read in two different ways or you can't tell what word is supposed to relate and paying attention to that because I know what the puzzles supposed to say but you don't and so when I read the sentence I always read it the right way because I wrote it but if you read it you might read it a different way which is why you need to have other people test the puzzle that's really important or to read the sentence that you wrote because you have assumptions that they don't or just multiple interpretations of what you've written if something could mean like if a word could mean two different things but you don't realize it because you're only thinking about the one definite avoiding expectations about site information this is a good one also for interview problems if you design interview problems expectations of outside information can make it very very hard for somebody to solve your problem if you assume that the user has taken a data structures course and understands what a hash is or understands what a what what a red-black tree is or understands what a priority heap is or whatever right or if they take in they may not have taken any CS course at all depending on the material a lot of people that do advent of code aren't programmers they want to be programmers and so they're saying all right I'm gonna learn this language my friend gave me in this IDE my friend installed and I'm gonna start typing things into this box until I get the answer according to this website that's a common use case and it's not a you know it's not a common group of users but they do exist and making sure that they that they're also covered is important because it's an important thing into helping people learn a program right so they may not have taken a CS course at all they may not know what a conditional is they may not know what it means to loop over something they meant on may not know what an index is right and so trying to either use those words and define them on the spot or use a different word that means the same thing like maybe instead of index you say position or something like that or at the very least linking to an article someplace that explains it be if you think the number of users that might not know it is very low or something right but avoiding the expectations of outside information or another one that's really tricky the user might not have the same domain knowledge as you so if you're asking about slay building and you actually use words that are part of like the industry of building slaves which I am not so I didn't but like you could imagine like if all you know attach this thing to this thing in this slot whatever like you can't that none of those words mean anything to anybody unless you're in that industry so if you're in an industry that does some particular thing like you're building cars or something and your interview questions assume the listener understands what some random word and for a car part is that they definitely don't but you forget that because you're in the industry already it's really easy to build a problem that literally no one can answer but you because you use terminology that doesn't exist it's also really common in the space industry everything in the space industry is exactly three-letter acronym long every single term for anything it's extremely confusing avoid requiring the user to make assumptions so I I used to repeat myself a lot less than early puzzles because this wasn't really obvious to me yet but as I built more and more puzzles it occurred to me that for every sentence there is a user that skipped only that sentence just because they were skimming or glossing over or whatever they there jumped down a line for whatever reason and they didn't realize that that sentence was important so something is critical try to either state it more than once in a different way or or imply that it's true someplace else in the documents that they say wait I don't remember I don't remember reading this let me go back and find it or like but entire thing together so that they can't have like one bit of information that they that they missed and don't realize they missed and also having other people actually look at and test the puzzle they I have a team of beta testers they're excellent they read through the puzzle they tell me I'm dumb all the time and then I go and fix the problems until they stop telling me I'm dumb and then everybody online you know still finds problems with it but at least we've caught most of the big ones right but having other people look at it so that the assumptions that I'm making aren't intrinsic to the puzzle and and all of the information that you need to solve it is still in there is it turns out really important so how do you make an advent of code puzzles so once you've done all of that the the properties of an advent of code puzzle includes some additional constraints one of them is there has to be an exact exactly one correct answer for every input the way the white website works is you get an input file and there are lots and lots of input files but every single one of them has exactly one correct answer and all of the answers are different and none of the answers are too close to each other because that might mean that an off by one error means that you're getting somebody else's answer and that's not good like so there's all of these constraints around that it has to work in any language or at least any reasonable language so anything but PHP and you are just getting an answer from this user you're not running their code which means that you can't you you can't measure the performance of their code because I don't want to host the infrastructure to do that I want to put up with the security risks of doing that right there are some websites that will run your Rattler so I'm told I try to avoid other puzzle sites just in case but I'm told that there are sites that you you give them your code instead of your answer and they run your code and then if it was too slow they tell you it was too slow and can't really do that so instead I have to design puzzles where if you do it with an algorithm that's too slow it would take three years to solve on any computer and if you do it with the algorithm that I intended for at least for optimization problems right if you do what the algorithm that was intended you get it in about five seconds or less if you're using a compiled language and that way I can still do like timing type stuff and it's just if you don't do it the way that was intended if it's a problem that's looking for you to it you just never get the answer and it doesn't matter lots of inputs I talked about that two parts per puzzle so originally excuse me originally I had two parts per puzzle because I thought it would just be an easy way for me to add on like a little fun extra at the end of all of the main puzzles all of the part ones were gonna be like the main puzzles and then all the part twos we're gonna be like oh yeah what if you did this aw that was cool okay I just basically doubled my content almost for free and I never went that way at all what it ended up being was as I started to build puzzles that were even a little complicated it was convenient to be able to use part one to just make sure that the user was on the right track so instead of having part one be the puzzle part two is the puzzle in part one just says like did you read the input correctly like did you get all the numbers in there currently do you copy and paste it right or whatever you're doing maybe you have to like run a checksum over the values or maybe you have to start implementing part of what you're going to need in part two are you on the right track because doing a jump to a finished puzzle all in one go means that you're not really sure where your bug is if you do have a bug and you either have to read through the instructions completely again and try to find where you misunderstood or mismatch something or just you know you have a typo someplace and it could be anywhere whereas if it's if it's a checkpoint you know that the first half is right and you don't have to debug that part hopefully again and then you just only have to check you know half of your remaining code so there's that but the other thing that I'll try to do is for puzzles where it makes sense and the first question isn't that much of a jump ask that question and then for part two swipe the requirements out from under you and you either built it in a way that was planning for me to do that or you didn't and spend another two hours reworking your code which is is a good way to simulate what really happens in the real world we're a group of Engineers all of a sudden get information from their product manager that says you know hey the the user really wants button to be configurable and what color it is and you're like oh we didn't account for that hang on a second we had a built in configuration system Naoto or whatever you know also variety variety is really important for a lot of reasons a lot of people have different backgrounds a lot of people have different interests a lot of people have different skill levels in different areas so making sure that every puzzle is different or at least that know that there aren't a bunch of puzzles in the row that are all like the same like a day after day after day after day right like keeping things interesting is important to make sure that people don't burn out or that they get stuck a bunch of times in a row hopefully and you can't you can't control it for everybody because everybody has different sets of skills but setting it up so that it stays interesting or at least teaches everybody something different every day is is really really important and also difficulty calibration sometimes if there's an early puzzle that seems hard or it seems weird sometimes it's just a simpler version of a puzzle that I'm gonna do later and I want to make sure that everybody's done the simpler version first that they have some of the prerequisites that I'm about to assume they have later on when they need that stuff examples of that in the past were like some of the path finding problems in I think 2016 where there were some earlier puzzles are just you know just find the shortest path from here to here okay like toss toss breadth-first search and you're done and then the later problems are like alright find some path finding but you can't use breadth-first search anymore because of some constraints in the problem whatever you're like okay well now what do you know and you figure it out like that but just introducing concepts whether it's a weekday versus a weekend people tend to have more time to do puzzles on the weekends like on front Friday night and Saturday night into the weekend so making the more involved problems not necessarily harder but just the ones that have more stuff to figure out and giving them given aiming to put those on weekends where it's possible but it isn't always variety for a difficulty we talked about that a little bit but it's still really important because everybody is good at different things you might be really good at regular expressions but you really might hate you know string comparison I don't know and making sure that all the puzzles require some different set of skills helps with difficulty because it prevents burnout progression throughout the month yea they gradually get harder they build on each other or whatever so scaling that and making that goes well but also having random puzzles that aren't in that difficulty maybe you have an early hard puzzle to prevent people that are really waiting for some some juicier puzzles may prevent them from having to wait until the end of the month like okay here's a more interesting one but it's still one that's acceptable to intermediate beginner programmers if they want to work at it a little and maybe there's an easier puzzle late in the month because you know you've been working at hard puzzles day after day after day oh it's a it's an easy one this took me you know 20 minutes I'm going to go back to you know preparing for Christmas or whatever you're doing and also thinking about interpreted versus compiled languages I talked about this a little bit with like timing calibration but the goal is that it regardless of the language you're using if you if you come up with the solution that I was hoping you would come up with it should take up most 15 seconds to run on pretty old hardware like accessible to anybody regardless of the computer they have you don't need a state-of-the-art Mac or whatever to solve the problem efficiently but for the problems where it's an optimization problem and I actually am expecting you to implement you know optimized a star on some subset of the state space and you have to figure out how to prune that correctly and all of these things it's important to design the puzzle in a way where even if they're using a compiled language and the speed-up they get from that it's not enough to have a less optimal solution to get them to get the answer in an reasonable amount of time like it still needs to be a large enough gap that the amount that you save from having a compiled language is not enough to get you the answer soon enough and that takes a while to build to but yeah there's a lot of things that go into that so how do you actually make one of these the the first step is inspiration I get inspiration from a lot of places I get inspiration from just like random problems that I'm working on at work or random things that I'm that I'm building off to the side or side projects that I'm working on or an open source project that had to build a function that just does kind of an interesting thing or just random things I see in the real world like oh that's a neat you know giant mobile structure or that's a cool sculpture or there's a bunch of tiles that are laid out in anyway you know random stuff like that but take inspiration for something try to figure out how you could make a question around it make a problem around it and then research it make sure that it's not just like something everybody has in a standard library make sure that it's actually something that's interesting enough that people will care to work on it try to see what like house how studied it's been already if it has been maybe tweak it a little bit to at least get it out of a is like it wasn't at one time the online encyclopedia of integer sequences where the one of the answers was just in there designing the puzzle so figuring out like okay now that we are pretty sure it's good let's actually construct like a prototype or try to build something out that just you know wait until it feels like it's a decent puzzle build a script that generates inputs literally just run it and it spits out here's an input file it might take you know a couple hours to do but like here's a good input file solve it just like you'll have to because I need to get the answers the same as you generate a whole bunch of inputs using that process generate and solve all the puzzles and then write a story around it and the story usually happens last usually the like the variable names for example in the input generator and the solvers are not the same nouns that the story use is the the the variable names in my stuff because I haven't really even thought about the puzzle yet because I'm gonna change it a hundred times before I actually write a story about it so the the the scripts are all like you know grid and XY and whatever just like generic terms when I actually get out to like the the real story about it it's like okay so what what what could I do that would make a maze that the elves have to have to explore like well it could be the the first floor of a building without a weird security system and okay now instead of it being a grid it's it's like hallways and conference rooms in a building and those are the nouns we use it in whatever right or every once in a while because puzzles aren't the right difficulty the beta testers get to it and it turns out it's way too hard or way too easy sometimes I have to move it earlier or later in the month and all of a sudden I have to rewrite all the pros because none of it makes sense in the story anymore and you go back and do it so well it seems like this is the flow it's not the flow is more like that just you get there eventually but you go round and round and round and figure it out it's it's a bunch of stuff so let's talk about oh if that's clapping am i late you know okay so let's talk about what what time is it six minutes alright so here's a couple example puzzles I'll speed it up there's a couple example problems this one is how many square inches of fabric are within two or more claims and it gives you a list of like here all the claims here's the coordinates of these things and you can draw a thing like this and then it says you know which one doesn't laughs with anything else it's there there it is or you have ones that are like here's a history of all of the times a guard woke up and fall asleep and went on shift find the guard that has the most minutes of sleep and all of all guards which one is frequently asleep on the same minute some people like to do data analysis and so they'll build like giant diagrams and graphs and things like this but other people really enjoy just building animations of the puzzle where every once in a while the guard you know falls asleep for a second and then wakes back up and falls asleep again because whatever great this is a puzzle I really like where it just lists out all of the places where there are walls and it's trying to design a water reservoir where there are walls and the water will come in and flow down and some people like to solve it by actually animating out the solution which is super super cool I love this where you can kind of see like how the algorithm that they wrote behaves in different situations and how it fills in different parts and that sort of thing here's one that tries to define a maze by giving you a regular expression that matches the solution to the maze and it's designed in such a way where if you try to actually run this as a regular expression it will never finish and the goal is to try to trick somebody into building a very simple regular expression like parser because it's just letters and groups so it's not that bad but if you try to just like hand listening random strings until you give it the answer it will never ever ever finish but if you try to like step through it and see what the steps are and backtrack when something needs to be backtracked you instead get this visualization which actually steps through the regex and figures out what the maze is shaped like which is super cool or here's one that asks what are all of the squares or what squares are closest to which points and you have to try to find the the the region of something I forget and then it says all right now take all out all of the square or all of the regions that are infinite and you have to say well how do i how do I know whether it's infinite like how do I measure that how do I detect it what's the situation here's a cool one that's a cellular automata that ends up generating these really cool spirals just by random I was screwing around with parameters for for cellular automata and I eventually found one where the random initial conditions typically produced just these cool random okay that has to be a puzzle now that's required here's one where it gives you a bunch of points and their initial positions and velocities and it says where do they collide if you just run the simulation for a while and so here's somebody that used a new plot to just run all the points and to keep track of where they are and all of a sudden they all fly in and a bunch of them collide and then a bunch of the rest of them just spew off to infinity a lot of people like to use the time it takes to solve a puzzle as a metric for how hard it is but I don't really like that because like I said before the people that are doing it right at midnight are are all competitive programmers that do this all the time and so the time that it takes for a competitive programming to do it is not gonna be the same amount of time as the time it takes you to do it the competitive programmers are used to fancy data structures fancy algorithms skimming the problems a whole bunch whereas most programmers aren't focusing on that stuff they're thinking like how do I build a solution that can handle problems of this category how could I build some code that maybe I could maintain or maybe just how can I stumble through rust until the borrow checker stops yelling at me but you know regardless of what it is your time isn't gonna match these exactly but this does show that people roughly spend about you know less than an hour at least the the speed programmers solving all the puzzles which is good and the ones that are up there I'm sorry for it's it's hard to calibrate difficulty it's very difficult so let's talk about some growing pains no wait let's talk about some learning experiences they're the same thing how do you prioritize tasks I'm great at this this is my strategy all right thing happens you handle the thing go to one easy every one thing at a time everything is top priority how do you prioritize tasks if you have 250,000 users from all around the world of all different backgrounds okay let's see how that worked thing happens great handle ooh thing but while you're handling the things several other things happened and when you try to handle those things more things happen and then you never sleep this is bad so you actually have to take and take a second to think about what's going on actually stop to prioritize things which I'm not used to but it's really important obviously it's okay to ask for help a lot of people struggle with like being able to say out loud like I am having problems and need help with the thing that I'm struggling with but that's an okay thing to say and you should say it all the time because it's acceptable and fine and you need help and it's okay right better document that users can ask you fewer questions because they already have the answers from somebody that somewhere that it's written down have an incredibly supportive community that helps itself so the subreddit is full of people who I don't know why but are all extremely supportive and if you come to them with an aunt with a question like hey this is the code I wrote for this problem it's getting the wrong answer this is my input this is what I'm getting what's going on and they never never do they say oh you're dumb you have a typo here they'll say things like try it with this input what I like what does your program do or like step through the logic of your program when you give it one of these or have you thought about what happens in this situation just like try to ease people through it which is incredible and really great and everybody's teaching each other and I'm really thankful for it also automating tasks and providing tools both self-service and just for me so if a user needs me to to do some action to their account manually going to the production database and typing in the query that does that it's not a good strategy surprisingly you should instead build tools and have things just automatically occur whenever possible because that's one less thing that you have to think about when things happen you have to handle the thing and more things happen as per steps one through five also accessibility accessibility is pretty important but accessibility becomes more important when you have a quarter million users looking at your site following the so the accessibility groups guidelines for things is really really important carefully testing it making sure that users of all different backgrounds and all different accessibility levels use your site and give you feedback and taking that a feedback very seriously is really really important too it's just it's a critical thing to think about a denial of service tax attacks is fascinating first of all why would you do s a programming puzzle website it I don't know but we get them fascinating fortunately AWS will let you just say don't allow requests from any of these IP ranges and I'll just block like whole IP ranges for awhile until they stop because there's no other I can't cope with it otherwise it's in a way so I'll go through some frequently asked questions quick yeah okay I'm being told the very speed up so why do they unlock at midnight or why don't you make them a lock at a different time every day because I have a job in a family and that's when I can be awake i watch the servers i make sure nothing's wrong how long does it take to make 25 puzzles about four months of all of my free time like literally while I was here I was sitting in my hotel room building puzzles like the past few months I've just been like I can go to work I come home I build puzzles like that just it takes forever can I send you puzzle ideas please don't send me puzzle ideas I have so many puzzle ideas already I have a giant document with hundreds of puzzle ideas if it's if it looks like your email has a puzzle idea in it I will reply back I did not read your email it looks like a puzzle idea if I'm if I made a mistake please let me know but I don't want to deal with copyright issues I don't know where you got the stuff from I don't I can't confirm that you didn't like grab it from some other website you know I just I don't want to deal with attribution like it's it's okay I have lots of puzzle ideas that's not something I'm struggling with I don't it's it please don't send me them why is this start rejecting my answer probably because you were one of the people that skipped a sentence that was important today or because you have some kind of a weird bug in any case ask on the subreddit or ask your friends or something people are typically very helpful does the site lock after getting a wrong answer or occasionally why do I have to wait an hour to submit my next guess the site does lock after a wrong answer it locks for 60 seconds if it thinks you're spamming guess is it will make you wait longer because don't spam guesses at the website please if you see somebody on the subreddit or on Twitter saying like I can't believe if I have to wait an hour between guesses from it they just submitted 100 guesses got them all wrong and they're complaining now that they can't submit more that's what that is how do some people solve the puzzle so quickly or are people cheating no they're just very very fast they do this basically all the time the way that they do it is they open the input they look at what they it that what the input looks like because it the inputs all that matters ultimately they guess that what the puzzle is they read the last line of the prose to see if their guess was right and if it wasn't they've confirmed by just looking back up a little bit then before reading anything they build a solution and then as they're building it they go back through the prose like as they're reading it somehow I don't know and then they figure people post videos of themselves doing this like live at midnight and that's really what they do and it's nuts they're not cheating they're really solving if that fast is today your birthday yes today is my birthday thank you so much for asking I'm gonna end with some quick stories that I just really like because they're ridiculous um so here's one that I like as the non-participating mother of a fourteen-year-old that got up at 4:50 a.m. I'm both massively impressed that people do this and somewhat baffled that nothing else has this effect I've been reading here so I can make sense of the conversation later in the day so this is the mother of a 14 year old where during the day the 14 year old just wants to talk about this programming puzzle that they've been working on and the mothers like what words are you using and then has to go to the subreddit to figure out what they're even talking about so they can actually have a conversation with their 14 year old during December or here's somebody that says that they help them get a new job or I get some that say like this help my significant other like we went through these and help them with interviewing or whatever there's a bunch of these like this which is so cool or my son and daughter are becoming more interested in coding because of your site which is fantastic or I got a message once that said something like I haven't had a good relationship with my daughter but after she started seeing the do Advan of code she's been asking me to do it with her and and I've really rebuilt that relationship with Lincoln's just completely ridiculous here's a college course that used advant of code as a midterm and as the final in conclusion engineering organization should solve puzzles for fun in fact everyone should solve puzzles for fun thank you [Applause] [Music]
Info
Channel: Øredev Conference
Views: 8,946
Rating: undefined out of 5
Keywords: software, conference, developer, SW developer, Øredev, oredev, öredev, malmö, sweden, øredev, 2019, Øredev 2019, malmömässan, 15 anniversary, eric wastl, advent of code, advent calendar, puzzels
Id: bS9882S0ZHs
Channel Id: undefined
Length: 43min 32sec (2612 seconds)
Published: Thu Nov 21 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.