1 00:00:00,070 --> 00:00:01,660 The following content is provided 2 00:00:01,660 --> 00:00:03,800 under a Creative Commons license. 3 00:00:03,800 --> 00:00:06,540 Your support will help MIT OpenCourseWare continue 4 00:00:06,540 --> 00:00:10,140 to offer high quality educational resources for free. 5 00:00:10,140 --> 00:00:12,690 To make a donation, or to view additional materials 6 00:00:12,690 --> 00:00:16,590 from hundreds of MIT courses, visit MIT OpenCourseWare 7 00:00:16,590 --> 00:00:28,462 at ocw.mit.edu 8 00:00:28,462 --> 00:00:29,920 MAXWELL MANN: I'm going to tell you 9 00:00:29,920 --> 00:00:33,545 why I think that organization of your code is the bee's knees. 10 00:00:33,545 --> 00:00:35,820 It's the coolest thing ever. 11 00:00:35,820 --> 00:00:38,600 If you organize your code well, then you 12 00:00:38,600 --> 00:00:42,450 can end up having not a horrible player. 13 00:00:47,080 --> 00:00:50,040 I think lecture three robot release is kind of long. 14 00:00:50,040 --> 00:00:52,710 I released some code, and it's long. 15 00:00:52,710 --> 00:00:53,910 Look at all that stuff. 16 00:00:53,910 --> 00:00:56,460 It's especially large when you want have 16 point font so 17 00:00:56,460 --> 00:00:59,710 that everybody can see from back at the end. 18 00:00:59,710 --> 00:01:02,250 But it's just too much, so here I'm 19 00:01:02,250 --> 00:01:05,874 going to propose that you organize your code into, as you 20 00:01:05,874 --> 00:01:08,770 can see here on the left, many separate files. 21 00:01:08,770 --> 00:01:12,110 So this is-- I think it's [? Hitav's ?] code. 22 00:01:12,110 --> 00:01:15,290 He's one of the devs this year, and you 23 00:01:15,290 --> 00:01:17,840 can see here his robot player. 24 00:01:17,840 --> 00:01:22,210 He's got the package name, and he imports some things, 25 00:01:22,210 --> 00:01:27,710 and right after that, he defines these new types, like base 26 00:01:27,710 --> 00:01:31,450 player, headquarters player, soldier player, 27 00:01:31,450 --> 00:01:32,420 and encampment player. 28 00:01:32,420 --> 00:01:34,790 And each of these things is part of base player. 29 00:01:34,790 --> 00:01:38,450 You can see here base player is this public, abstract class 30 00:01:38,450 --> 00:01:40,860 that he defines here. 31 00:01:40,860 --> 00:01:44,710 And it has certain things he wants to use later. 32 00:01:44,710 --> 00:01:47,810 And then later when he has other players, 33 00:01:47,810 --> 00:01:50,410 like an encampment player, he can just 34 00:01:50,410 --> 00:01:54,345 say, OK, I am going to call this public class encampment 35 00:01:54,345 --> 00:01:56,260 player extends base player. 36 00:01:56,260 --> 00:02:00,370 And now, this guy has access to all of this guy's method. 37 00:02:00,370 --> 00:02:03,040 And it's also located in his own convenient place. 38 00:02:03,040 --> 00:02:04,990 So I'm going to post some example that 39 00:02:04,990 --> 00:02:08,047 shows how to get your code separated in a convenient way 40 00:02:08,047 --> 00:02:09,380 if you haven't done that before. 41 00:02:11,910 --> 00:02:13,790 So you've got your code separated, 42 00:02:13,790 --> 00:02:15,457 and you want to make life easy. 43 00:02:15,457 --> 00:02:17,040 You don't want to code in a way that's 44 00:02:17,040 --> 00:02:20,450 going to make it hard for you to make changes and make updates. 45 00:02:20,450 --> 00:02:23,570 Steven Arcangeli, who won Battlecode 46 00:02:23,570 --> 00:02:26,925 two or three years ago, has posted on his blog 47 00:02:26,925 --> 00:02:30,670 a description of coding best practices that 48 00:02:30,670 --> 00:02:33,850 enabled him to really do well in Battlecode. 49 00:02:33,850 --> 00:02:36,020 He did things like make sure that things 50 00:02:36,020 --> 00:02:40,080 are in separate files, that they have subpackages. 51 00:02:40,080 --> 00:02:42,340 And that he worked on this framework code 52 00:02:42,340 --> 00:02:43,070 most of the time. 53 00:02:43,070 --> 00:02:46,110 He wasn't trying to just mash out a strategy. 54 00:02:46,110 --> 00:02:49,660 He was building systems that he could reuse and use 55 00:02:49,660 --> 00:02:50,910 multiple times. 56 00:02:50,910 --> 00:02:53,040 He also made a rapid iteration system 57 00:02:53,040 --> 00:02:56,090 so he could test his code against other ways of running 58 00:02:56,090 --> 00:02:56,890 the same code. 59 00:02:56,890 --> 00:03:00,130 And today, Aaron is here with me to set up 60 00:03:00,130 --> 00:03:02,720 a system for trading code between us 61 00:03:02,720 --> 00:03:04,780 so we can work more efficiently. 62 00:03:04,780 --> 00:03:11,330 So according to Stephen, he was doing strategy only 63 00:03:11,330 --> 00:03:14,090 in the last week of the competition. 64 00:03:14,090 --> 00:03:16,730 The rest of the time, he was basically just writing 65 00:03:16,730 --> 00:03:19,199 navigation code, or something very basic, 66 00:03:19,199 --> 00:03:21,240 and then he would sort of figure out the strategy 67 00:03:21,240 --> 00:03:23,730 after watching the tournaments, like the sprint tournament 68 00:03:23,730 --> 00:03:24,855 and the seeding tournament. 69 00:03:27,191 --> 00:03:28,940 AARON EPSTEIN: OK, just steal the strategy 70 00:03:28,940 --> 00:03:30,231 instead of writing it yourself. 71 00:03:30,231 --> 00:03:30,900 Awesome. 72 00:03:30,900 --> 00:03:33,240 MAXWELL MANN: Yeah, I guess that's one way to do it. 73 00:03:33,240 --> 00:03:36,020 So I'm going to go ahead and switch on over to Aaron, 74 00:03:36,020 --> 00:03:38,680 and he's going to show how he would set things up 75 00:03:38,680 --> 00:03:41,080 to start sending me files in the most efficient way. 76 00:03:44,770 --> 00:03:47,700 AARON EPSTEIN: Hello, I'm Aaron, the less effective lecturer, 77 00:03:47,700 --> 00:03:52,520 and I'm going to tell you that the most efficient way to share 78 00:03:52,520 --> 00:03:55,660 files between me and Max is Git. 79 00:03:55,660 --> 00:03:56,930 Spoiler alert, it's Git. 80 00:04:00,570 --> 00:04:05,220 So I have my directory, it's called user test, 81 00:04:05,220 --> 00:04:08,830 but it's a Battlecode installation, the same as you 82 00:04:08,830 --> 00:04:09,330 guys have. 83 00:04:12,320 --> 00:04:15,280 I have some stuff in here that I want to share with Max, 84 00:04:15,280 --> 00:04:19,500 particularly something in the team's directory. 85 00:04:19,500 --> 00:04:22,650 This awesome player-- awesomer player-- and I 86 00:04:22,650 --> 00:04:24,490 want Max to have it. 87 00:04:24,490 --> 00:04:27,610 So how do I get it to him? 88 00:04:27,610 --> 00:04:31,330 So first, I made a Bitbucket account. 89 00:04:31,330 --> 00:04:34,110 It's free, it's similar to GitHub, 90 00:04:34,110 --> 00:04:36,800 except the problem with GitHub is if you want a private repo, 91 00:04:36,800 --> 00:04:38,180 you'd have to pay for it. 92 00:04:38,180 --> 00:04:40,192 So you'd probably abusing a public repo, 93 00:04:40,192 --> 00:04:42,400 which means anybody who can guess your user name just 94 00:04:42,400 --> 00:04:44,245 has access to all your robots, which 95 00:04:44,245 --> 00:04:46,980 makes it even easier for them to your code and strategies. 96 00:04:46,980 --> 00:04:48,150 It's kind of silly. 97 00:04:48,150 --> 00:04:53,470 Bitbucket gives you a private repo with up to five users. 98 00:04:53,470 --> 00:04:57,170 We only give you four users, so a Bitbucket's perfect. 99 00:04:57,170 --> 00:05:00,230 So you make your Bitbucket account. 100 00:05:00,230 --> 00:05:05,460 And then I want to make a repo for Max and I to share code. 101 00:05:05,460 --> 00:05:10,170 So I'm going to call it Battlecode example. 102 00:05:10,170 --> 00:05:12,650 I want it to be private so that other teams can't 103 00:05:12,650 --> 00:05:13,337 steal our stuff. 104 00:05:13,337 --> 00:05:14,920 It's going to be Git, because that's I 105 00:05:14,920 --> 00:05:16,050 all that I know how to use. 106 00:05:16,050 --> 00:05:18,927 It's going to be Java. 107 00:05:18,927 --> 00:05:19,510 Now create it. 108 00:05:23,484 --> 00:05:25,150 MAXWELL MANN: So this repository, Aaron, 109 00:05:25,150 --> 00:05:28,342 is going to be on the internet, and so we'll really 110 00:05:28,342 --> 00:05:29,800 be able to access it from anywhere. 111 00:05:29,800 --> 00:05:32,900 It's sort of its own backup system, isn't it? 112 00:05:32,900 --> 00:05:34,570 AARON EPSTEIN: Yep. 113 00:05:34,570 --> 00:05:36,670 It's backup, it's version intelligent, 114 00:05:36,670 --> 00:05:38,620 cross platform, et cetera. 115 00:05:38,620 --> 00:05:39,799 It's perfect. 116 00:05:39,799 --> 00:05:40,590 MAXWELL MANN: Yeah. 117 00:05:40,590 --> 00:05:42,720 Yesterday or the day before, my computer 118 00:05:42,720 --> 00:05:45,330 gave me a bunch of Blue Screens of Death. 119 00:05:45,330 --> 00:05:48,742 I think one of my memory sectors is failing or something. 120 00:05:48,742 --> 00:05:50,950 But I wasn't that nervous, because we have everything 121 00:05:50,950 --> 00:05:53,010 stored online. 122 00:05:53,010 --> 00:05:53,510 True story. 123 00:05:58,232 --> 00:05:59,190 AARON EPSTEIN: Alright. 124 00:05:59,190 --> 00:06:03,380 So Bitbucket goes ahead and gives me the instructions. 125 00:06:03,380 --> 00:06:07,651 So I'm basically just going to follow these instructions. 126 00:06:07,651 --> 00:06:09,900 I've already made the directory and I'm already in it, 127 00:06:09,900 --> 00:06:11,025 so I don't need to do this. 128 00:06:13,910 --> 00:06:18,360 So right now the installation's not a Git repo. 129 00:06:18,360 --> 00:06:20,210 So I'm going to go ahead and make it one. 130 00:06:20,210 --> 00:06:24,190 Get in it, now it's empty. 131 00:06:24,190 --> 00:06:27,420 And then it tells me to add this thing as remote. 132 00:06:27,420 --> 00:06:28,350 I'll do that later. 133 00:06:28,350 --> 00:06:31,230 OK, so right now it's an empty Git repository. 134 00:06:31,230 --> 00:06:33,880 It's not very useful, because it's empty. 135 00:06:33,880 --> 00:06:38,325 If I use Git status, it tells me that it's basically empty. 136 00:06:46,094 --> 00:06:48,260 Yeah, it tells me that there's all these things that 137 00:06:48,260 --> 00:06:50,520 are untracked. 138 00:06:50,520 --> 00:06:52,380 It's not tracking anything. 139 00:06:52,380 --> 00:06:53,634 And there's nothing in it. 140 00:06:53,634 --> 00:06:56,175 AUDIENCE: What does it mean when they're tracked or untracked 141 00:06:56,175 --> 00:06:57,670 By Git? 142 00:06:57,670 --> 00:06:59,880 AARON EPSTEIN: So it said when I initialized it here 143 00:06:59,880 --> 00:07:01,450 that it was empty. 144 00:07:01,450 --> 00:07:03,802 So even though there's a bunch of things in this folder, 145 00:07:03,802 --> 00:07:05,760 Git doesn't really know or care about them yet, 146 00:07:05,760 --> 00:07:07,290 because I haven't told them where they are, 147 00:07:07,290 --> 00:07:08,460 or what it should pay attention to 148 00:07:08,460 --> 00:07:10,085 and what it shouldn't pay attention to, 149 00:07:10,085 --> 00:07:11,180 so it's just empty. 150 00:07:11,180 --> 00:07:13,310 That's why it's labeled "everything untracked", 151 00:07:13,310 --> 00:07:15,850 because they're not yet tracked. 152 00:07:15,850 --> 00:07:18,710 So let me make some of these things tracked. 153 00:07:18,710 --> 00:07:20,840 And by some, I mean only the awesomer player, 154 00:07:20,840 --> 00:07:22,770 because that's the only thing I want to give Max right now. 155 00:07:22,770 --> 00:07:25,190 So I'm going to do Git add, because I want to add it 156 00:07:25,190 --> 00:07:26,864 to the list of things that's tracked. 157 00:07:26,864 --> 00:07:28,280 And go team/awesomer player/robot. 158 00:07:33,480 --> 00:07:34,060 OK, cool. 159 00:07:34,060 --> 00:07:35,070 Now it's added. 160 00:07:35,070 --> 00:07:39,560 So now if I look at the status, I have one new file. 161 00:07:39,560 --> 00:07:41,780 I didn't make it, so it's not new with respect 162 00:07:41,780 --> 00:07:43,613 to the hard drive, but it's new with respect 163 00:07:43,613 --> 00:07:46,180 to Git, because Git didn't know about it before. 164 00:07:46,180 --> 00:07:48,140 And then these are still on track. 165 00:07:48,140 --> 00:07:52,410 So now to share it with Max, I have to commit this change. 166 00:07:52,410 --> 00:07:54,770 Right now, it's just been added, but it's 167 00:07:54,770 --> 00:07:57,730 sort of floating around in space. 168 00:07:57,730 --> 00:08:01,490 So "commit" really solidifies it into a block of changes 169 00:08:01,490 --> 00:08:03,130 that I can give to max. 170 00:08:03,130 --> 00:08:07,500 So "initial commit", just because that's 171 00:08:07,500 --> 00:08:10,700 the best practices name for the first commit. 172 00:08:10,700 --> 00:08:13,410 MAXWELL MANN: You see here he's put a message with it, 173 00:08:13,410 --> 00:08:15,240 so that when we look at the commit logs, 174 00:08:15,240 --> 00:08:17,260 we'll be able to see his descriptions of what 175 00:08:17,260 --> 00:08:21,470 went on for all the changes, all the way back to the beginning. 176 00:08:21,470 --> 00:08:24,150 And we'll have all these things posted 177 00:08:24,150 --> 00:08:27,730 in the handy-dandy guide-- gosh, I said it again-- 178 00:08:27,730 --> 00:08:30,440 so you don't have to worry about memorizing it. 179 00:08:30,440 --> 00:08:33,750 Right now you just want to get the overview of how we're 180 00:08:33,750 --> 00:08:37,885 doing it, and how many millions of times more awesome 181 00:08:37,885 --> 00:08:42,350 it is to do it this way, than to email to one another. 182 00:08:42,350 --> 00:08:45,210 AARON EPSTEIN: I should mention hyphen a means "all", 183 00:08:45,210 --> 00:08:49,500 like for everything, and m means give a message 184 00:08:49,500 --> 00:08:51,740 here with strings rather than having 185 00:08:51,740 --> 00:08:54,620 to type it into an editor. 186 00:08:54,620 --> 00:08:56,649 On Windows, if you leave out the m switch, 187 00:08:56,649 --> 00:08:58,690 you get notepad, which is not that big of a deal, 188 00:08:58,690 --> 00:08:59,980 because it's just notepad. 189 00:08:59,980 --> 00:09:01,813 Just type it in and hit Save, and it's okay, 190 00:09:01,813 --> 00:09:03,840 and you remember to use the m switch next time. 191 00:09:03,840 --> 00:09:07,760 But on Linux, if you forget the m switch, most likely 192 00:09:07,760 --> 00:09:11,750 it'll give you Vim, which is so complicated and arcane that it 193 00:09:11,750 --> 00:09:15,460 took me many times before I even knew how to close it. 194 00:09:15,460 --> 00:09:19,370 MAXWELL MANN: It's like escape:wq or something. 195 00:09:19,370 --> 00:09:20,390 It's absolutely crazy. 196 00:09:20,390 --> 00:09:23,820 AARON EPSTEIN: I think I've gathered that colon q quits it, 197 00:09:23,820 --> 00:09:24,917 and colon w saves. 198 00:09:24,917 --> 00:09:26,500 MAXWELL MANN: I think you have to push 199 00:09:26,500 --> 00:09:28,140 s to start typing again. 200 00:09:28,140 --> 00:09:30,154 It doesn't even let you put commands in. 201 00:09:30,154 --> 00:09:31,570 AARON EPSTEIN: You want to say out 202 00:09:31,570 --> 00:09:33,914 of Vim if you're not initiated. 203 00:09:33,914 --> 00:09:34,789 AUDIENCE: [INAUDIBLE] 204 00:09:39,190 --> 00:09:40,660 AARON EPSTEIN: OK. 205 00:09:40,660 --> 00:09:41,590 Got it. 206 00:09:41,590 --> 00:09:43,940 Well I just the m switch so I can stay out of Vim, 207 00:09:43,940 --> 00:09:46,930 because it's only for the initiated. 208 00:09:46,930 --> 00:09:48,860 MAXWELL MANN: I see one question. 209 00:09:48,860 --> 00:09:51,070 AUDIENCE: So do you guys recommend only 210 00:09:51,070 --> 00:09:52,980 sharing specific files at a time, 211 00:09:52,980 --> 00:09:54,560 instead of the entire project? 212 00:09:54,560 --> 00:09:57,845 AARON EPSTEIN: Yes, and I will discuss 213 00:09:57,845 --> 00:10:02,470 that eventually, but for now the only things you want to share 214 00:10:02,470 --> 00:10:04,950 are things that you wrote yourself and are changing 215 00:10:04,950 --> 00:10:06,270 yourself. 216 00:10:06,270 --> 00:10:08,870 But I will discuss more of that in the future. 217 00:10:08,870 --> 00:10:11,970 So right now I just want to share that one specific file. 218 00:10:16,750 --> 00:10:18,090 So now it's committed. 219 00:10:18,090 --> 00:10:21,700 I need to get onto here, so I do this thing 220 00:10:21,700 --> 00:10:23,800 that it tells me to do. 221 00:10:23,800 --> 00:10:25,810 Basically I'm going to add as a remote, 222 00:10:25,810 --> 00:10:27,050 like a thing that's not here. 223 00:10:27,050 --> 00:10:29,810 It's a remote, it's somewhere else, so the server. 224 00:10:29,810 --> 00:10:32,810 I'm going to add one called "origin", because origin 225 00:10:32,810 --> 00:10:35,930 is the canonical name for this sort of thing, 226 00:10:35,930 --> 00:10:37,310 and then I follow the URL. 227 00:10:43,469 --> 00:10:45,510 MAXWELL MANN: You can't copy and paste into that? 228 00:10:45,510 --> 00:10:46,414 AARON EPSTEIN: No. 229 00:10:46,414 --> 00:10:47,580 MAXWELL MANN: Oh, you can't? 230 00:10:47,580 --> 00:10:48,430 AARON EPSTEIN: No. 231 00:10:48,430 --> 00:10:49,900 MAXWELL MANN: Oh, mine's better. 232 00:10:49,900 --> 00:10:55,090 Right now, he's using MinGW shell to type these commands. 233 00:10:55,090 --> 00:10:57,140 If you just put it in Windows command prompt, 234 00:10:57,140 --> 00:10:59,640 I don't think it would work. 235 00:10:59,640 --> 00:11:03,700 I'm going to use to Git Bash, which you can get-- 236 00:11:03,700 --> 00:11:06,530 AARON EPSTEIN: No, you're using Git Shell, 237 00:11:06,530 --> 00:11:08,400 which opens Windows PowerShell. 238 00:11:08,400 --> 00:11:10,592 MAXWELL MANN: And you can get that online just 239 00:11:10,592 --> 00:11:11,550 by Google searching it. 240 00:11:30,435 --> 00:11:32,060 AARON EPSTEIN: Cool, well there you go. 241 00:11:32,060 --> 00:11:35,730 That's how you remove remotes. 242 00:11:35,730 --> 00:11:36,872 Two birds, one stone. 243 00:11:36,872 --> 00:11:38,330 MAXWELL MANN: That's pretty useful. 244 00:11:38,330 --> 00:11:40,008 We did that on purpose. 245 00:11:40,008 --> 00:11:41,490 That guy's a plant. 246 00:11:44,454 --> 00:11:46,430 I'll pay you after lecture. 247 00:11:46,430 --> 00:11:50,386 AARON EPSTEIN: So to check what I have, I do the hyphen v. You 248 00:11:50,386 --> 00:11:53,220 might be familiar with a verbose, hyphen v. 249 00:11:53,220 --> 00:11:55,770 So I have this, it looks spelled correctly. 250 00:11:55,770 --> 00:11:57,390 Cool. 251 00:11:57,390 --> 00:12:01,240 Now I push to it, like take my changes and push them, 252 00:12:01,240 --> 00:12:04,845 to "origin", which is the name I've given to this URL. 253 00:12:08,170 --> 00:12:11,920 "Master" is the master branch. 254 00:12:11,920 --> 00:12:13,640 It's going to ask me for my password, 255 00:12:13,640 --> 00:12:16,280 because I haven't configured SSH correctly, 256 00:12:16,280 --> 00:12:18,530 but Bitbucket has instructions for setting this 257 00:12:18,530 --> 00:12:20,820 up so that your computers recognize each other. 258 00:12:20,820 --> 00:12:22,903 You don't need to type in the password every time. 259 00:12:22,903 --> 00:12:24,560 I just haven't done it yet. 260 00:12:24,560 --> 00:12:29,540 OK, now it looks like I successfully 261 00:12:29,540 --> 00:12:31,610 wrote things to the server. 262 00:12:31,610 --> 00:12:33,890 So Max should be able to get them. 263 00:12:33,890 --> 00:12:39,580 Oh, no, he shouldn't be able to, because my repo is private, 264 00:12:39,580 --> 00:12:41,710 and nobody's allowed to access it but me. 265 00:12:41,710 --> 00:12:42,960 Let me change that. 266 00:12:42,960 --> 00:12:49,885 Settings, access management. 267 00:12:49,885 --> 00:12:53,180 MAXWELL MANN: So I'm M4X Mann. 268 00:12:53,180 --> 00:12:55,500 AARON EPSTEIN: And I want to give him read and write, 269 00:12:55,500 --> 00:12:57,125 but I don't trust him to administer it. 270 00:13:00,492 --> 00:13:02,180 MAXWELL MANN: It's a good idea. 271 00:13:02,180 --> 00:13:04,780 I have a certain tendency of screwing up 272 00:13:04,780 --> 00:13:10,120 certain administration jobs, this one not included. 273 00:13:10,120 --> 00:13:12,450 So I'm going to go ahead and switch on over to Me. 274 00:13:12,450 --> 00:13:15,650 Now I'm me. 275 00:13:15,650 --> 00:13:18,810 I wasn't before, but I am now. 276 00:13:18,810 --> 00:13:20,000 Let's make some space here. 277 00:13:20,000 --> 00:13:22,890 On the left, this is where I have 278 00:13:22,890 --> 00:13:25,250 Battlecode installed, on the desktop. 279 00:13:25,250 --> 00:13:29,410 And I guess what I want to do is I want to make this existing 280 00:13:29,410 --> 00:13:35,500 Battlecode directory the main directory for the root 281 00:13:35,500 --> 00:13:40,160 for my Github version of the thing that he has. 282 00:13:40,160 --> 00:13:41,730 Yeah, that's the technical term. 283 00:13:41,730 --> 00:13:46,110 So I'm going to go into it. 284 00:13:46,110 --> 00:13:48,100 So now I'm in this directory. 285 00:13:48,100 --> 00:13:51,980 And what I'm going to do is I'm going to initialize GIt 286 00:13:51,980 --> 00:13:54,620 so that now it knows that I'm interested in using 287 00:13:54,620 --> 00:13:57,300 Git in this folder. 288 00:13:57,300 --> 00:14:04,290 And now that I'm in it, I will do Git remote add. 289 00:14:04,290 --> 00:14:10,060 And I'll go onto this website, I'm 290 00:14:10,060 --> 00:14:12,450 just going to hit refresh here. 291 00:14:12,450 --> 00:14:14,147 Is this it, "Battlecode-example"? 292 00:14:14,147 --> 00:14:14,980 AARON EPSTEIN: Yeah. 293 00:14:14,980 --> 00:14:16,170 MAXWELL MANN: OK, so you named it the same thing 294 00:14:16,170 --> 00:14:17,450 as you named the previous one? 295 00:14:17,450 --> 00:14:17,970 AARON EPSTEIN: Yep. 296 00:14:17,970 --> 00:14:18,910 MAXWELL MANN: OK. 297 00:14:18,910 --> 00:14:19,770 So I'm in here. 298 00:14:19,770 --> 00:14:21,560 And I can just right click and hit Paste 299 00:14:21,560 --> 00:14:24,470 because I have PowerShell. 300 00:14:24,470 --> 00:14:26,780 So now I've now I've added it. 301 00:14:26,780 --> 00:14:29,780 And so I'll then follow that up with a "git pull" . 302 00:14:32,720 --> 00:14:41,690 And that's going to give me-- oh, it says it's not my-- 303 00:14:41,690 --> 00:14:43,000 I need a name? 304 00:14:43,000 --> 00:14:44,850 AARON EPSTEIN: Yeah. 305 00:14:44,850 --> 00:14:46,900 You didn't name it. 306 00:14:46,900 --> 00:14:51,107 Yeah, you just did Git remote add, and you just put the URL. 307 00:14:51,107 --> 00:14:52,690 MAXWELL MANN: OK, I'll name it origin. 308 00:14:52,690 --> 00:14:53,670 AARON EPSTEIN: No, the other way around. 309 00:14:53,670 --> 00:14:55,030 MAXWELL MANN: OK. 310 00:14:55,030 --> 00:14:57,410 So I'll name it-- what do I name it? 311 00:14:57,410 --> 00:14:59,140 AARON EPSTEIN: Origin, and then the URL. 312 00:14:59,140 --> 00:15:01,495 MAXWELL MANN: Add origin, and then and then the URL. 313 00:15:01,495 --> 00:15:03,120 We'll have this all written down so you 314 00:15:03,120 --> 00:15:05,400 have the instructions in front of you when you do it. 315 00:15:05,400 --> 00:15:07,316 AARON EPSTEIN: Now you should be able to pull. 316 00:15:07,316 --> 00:15:09,420 MAXWELL MANN: OK so now I can Git pull. 317 00:15:09,420 --> 00:15:13,660 And this should get me the stuff he wanted to give me. 318 00:15:13,660 --> 00:15:15,225 Now it may end up being a problem-- 319 00:15:15,225 --> 00:15:17,100 AARON EPSTEIN: No, you've got to specifically 320 00:15:17,100 --> 00:15:19,100 from origin master. 321 00:15:19,100 --> 00:15:21,190 MAXWELL MANN: Ah, git pull, origin master. 322 00:15:25,600 --> 00:15:26,510 Yeah. 323 00:15:26,510 --> 00:15:28,864 For those of you who know Git already, 324 00:15:28,864 --> 00:15:31,280 I think it may be giving you trouble because I may already 325 00:15:31,280 --> 00:15:33,260 have awesomer player. 326 00:15:33,260 --> 00:15:38,010 so we're going to pretend that I don't have it. 327 00:15:38,010 --> 00:15:40,220 Yeah, so let's go let's go back to Eclipse. 328 00:15:40,220 --> 00:15:42,400 Oh, it's black. 329 00:15:42,400 --> 00:15:45,440 What is that? 330 00:15:45,440 --> 00:15:48,810 I think Eclipse. is very unhappy. 331 00:15:48,810 --> 00:15:51,789 Have you ever had this? 332 00:15:51,789 --> 00:15:52,830 OK, where's the package-- 333 00:15:56,646 --> 00:15:58,020 AARON EPSTEIN: There are Windows, 334 00:15:58,020 --> 00:16:00,179 so we should probably just restart both computers. 335 00:16:00,179 --> 00:16:01,720 MAXWELL MANN: Restart both computers? 336 00:16:01,720 --> 00:16:04,220 AARON EPSTEIN: Yeah, and every Windows computer in the room. 337 00:16:04,220 --> 00:16:05,265 MAXWELL MANN: Oh, right. 338 00:16:05,265 --> 00:16:06,890 Now let's see, which is the button that 339 00:16:06,890 --> 00:16:08,480 gets me the package? 340 00:16:08,480 --> 00:16:10,440 Package inspector window? 341 00:16:10,440 --> 00:16:11,440 Open perspective? 342 00:16:11,440 --> 00:16:14,770 Show view, OK. 343 00:16:14,770 --> 00:16:15,980 I've got. 344 00:16:15,980 --> 00:16:17,790 Hey look, it's not dead. 345 00:16:17,790 --> 00:16:20,980 So let's refresh it and now it's updating. 346 00:16:20,980 --> 00:16:23,150 You see it hasn't got awesomer player there, 347 00:16:23,150 --> 00:16:25,835 so that when I do this. 348 00:16:28,740 --> 00:16:30,870 Yeah, that wrapped around. 349 00:16:30,870 --> 00:16:34,470 But now I've done this, if I push that F5, 350 00:16:34,470 --> 00:16:35,760 is that going to-- No? 351 00:16:35,760 --> 00:16:37,100 Did it not work? 352 00:16:37,100 --> 00:16:39,630 It says here, already up to date. 353 00:16:42,057 --> 00:16:42,890 I think we broke it. 354 00:16:46,460 --> 00:16:48,010 What are we gonna do, Aaron? 355 00:16:48,010 --> 00:16:50,555 AARON EPSTEIN: I don't know. 356 00:16:50,555 --> 00:16:51,680 I don't know what happened. 357 00:16:55,180 --> 00:16:56,536 So you don't have awesomer? 358 00:16:56,536 --> 00:16:57,410 Do you have awesomer? 359 00:16:57,410 --> 00:16:58,784 MAXWELL MANN: I may have awesomer 360 00:16:58,784 --> 00:17:00,190 without knowing I have awesomer. 361 00:17:00,190 --> 00:17:02,805 I'm that awesome. 362 00:17:02,805 --> 00:17:05,339 Nope, there's nothing in there. 363 00:17:05,339 --> 00:17:07,819 Should we kill everything and start over? 364 00:17:07,819 --> 00:17:09,030 AARON EPSTEIN: Yep. 365 00:17:09,030 --> 00:17:11,560 MAXWELL MANN: Right. 366 00:17:11,560 --> 00:17:12,554 Doing it the right way. 367 00:17:12,554 --> 00:17:13,470 You saw it here first. 368 00:17:18,900 --> 00:17:20,810 AARON EPSTEIN: OK, so Bitbucket tells me-- 369 00:17:20,810 --> 00:17:22,839 MAXWELL MANN: OK, I've got an idea. 370 00:17:22,839 --> 00:17:24,960 Make a new package and send that one. 371 00:17:29,950 --> 00:17:30,660 Something else. 372 00:17:30,660 --> 00:17:32,400 Something different. 373 00:17:32,400 --> 00:17:36,860 OK, let's go back to Aaron's computer. 374 00:17:36,860 --> 00:17:39,027 So you made a a super thing? 375 00:17:39,027 --> 00:17:40,610 AARON EPSTEIN: A super awesome player. 376 00:17:40,610 --> 00:17:42,510 MAXWELL MANN: A super awesome player. 377 00:17:42,510 --> 00:17:45,390 Oh my goodness. 378 00:17:45,390 --> 00:17:49,300 So now you're pushing that onto the master, 379 00:17:49,300 --> 00:17:52,941 and then once that's done, I'm going to go back to me, right? 380 00:17:52,941 --> 00:17:53,440 OK. 381 00:17:58,140 --> 00:18:02,350 SO I'm going back to my Battlecode folder. 382 00:18:02,350 --> 00:18:02,850 OK. 383 00:18:02,850 --> 00:18:05,060 And now it's already got Git in it. 384 00:18:05,060 --> 00:18:06,220 I'm already good to go. 385 00:18:06,220 --> 00:18:09,850 I've set up the remote by doing Git, remote, add, 386 00:18:09,850 --> 00:18:12,826 origin and then the HTTPS URL that 387 00:18:12,826 --> 00:18:14,450 was available on the Bitbucket website. 388 00:18:14,450 --> 00:18:15,870 AARON EPSTEIN: Well, why don't you Git status. 389 00:18:15,870 --> 00:18:16,589 Just to check. 390 00:18:16,589 --> 00:18:17,880 MAXWELL MANN: I like that idea. 391 00:18:17,880 --> 00:18:20,230 OK, so I deleted a thing. 392 00:18:20,230 --> 00:18:24,122 Maybe if I just push the fact that I deleted that thing. 393 00:18:24,122 --> 00:18:26,080 AARON EPSTEIN: Yeah, maybe that was a bad idea. 394 00:18:26,080 --> 00:18:27,621 MAXWELL MANN: Well in any case, we're 395 00:18:27,621 --> 00:18:30,080 going to see what happens. 396 00:18:30,080 --> 00:18:32,640 Maybe if I add, so that it's tracking the thing that 397 00:18:32,640 --> 00:18:36,520 isn't there, then that'll improve matters. 398 00:18:39,280 --> 00:18:41,235 AARON EPSTEIN: Let me just make the reaper. 399 00:18:41,235 --> 00:18:43,401 Oh no, but then you'd have to type in the URL again. 400 00:18:43,401 --> 00:18:46,890 MAXWELL MANN: Yeah, I could just paste, but let's do Git pull. 401 00:18:46,890 --> 00:18:51,650 And let's see if it works, shall we? 402 00:18:51,650 --> 00:18:53,979 AARON EPSTEIN: Nothing to lose. 403 00:18:53,979 --> 00:18:55,270 MAXWELL MANN: Only our dignity. 404 00:18:55,270 --> 00:18:56,940 AARON EPSTEIN: I'm going to pull from the origin master 405 00:18:56,940 --> 00:18:57,481 specifically. 406 00:18:57,481 --> 00:19:00,890 MAXWELL MANN: Well, what happens if I just do it as it is? 407 00:19:00,890 --> 00:19:01,860 It's no good? 408 00:19:01,860 --> 00:19:02,700 AARON EPSTEIN: You've got to configure it 409 00:19:02,700 --> 00:19:03,410 before you do that. 410 00:19:03,410 --> 00:19:05,118 MAXWELL MANN: It said, unpacking objects. 411 00:19:05,118 --> 00:19:06,770 I think it did things. 412 00:19:06,770 --> 00:19:09,240 AARON EPSTEIN: Well it unpacked a bunch of objects, 413 00:19:09,240 --> 00:19:11,190 but it didn't know where to put them, I think. 414 00:19:11,190 --> 00:19:12,060 MAXWELL MANN: It didn't know where to put them. 415 00:19:12,060 --> 00:19:13,351 Well, I put them somewhere now. 416 00:19:13,351 --> 00:19:15,300 It says, one file changed. 417 00:19:15,300 --> 00:19:15,800 It's fussy? 418 00:19:15,800 --> 00:19:16,990 I'm fussy. 419 00:19:16,990 --> 00:19:20,000 We work together. 420 00:19:20,000 --> 00:19:20,500 OK. 421 00:19:20,500 --> 00:19:21,950 Now the thing is there. 422 00:19:21,950 --> 00:19:24,950 And if we wait 10 minutes, Eclipse will start. 423 00:19:24,950 --> 00:19:27,687 But while I'm doing that, you could 424 00:19:27,687 --> 00:19:28,770 talk about the next thing. 425 00:19:34,060 --> 00:19:35,490 Yay, there it is. 426 00:19:35,490 --> 00:19:37,100 Super awesome. 427 00:19:37,100 --> 00:19:38,240 Yeah, that's pretty cool. 428 00:19:38,240 --> 00:19:38,920 AARON EPSTEIN: You should watch it. 429 00:19:38,920 --> 00:19:39,160 It's super good. 430 00:19:39,160 --> 00:19:40,780 MAXWELL MANN: I should to watch it? 431 00:19:40,780 --> 00:19:42,130 Is it the same as the other one? 432 00:19:42,130 --> 00:19:43,190 AARON EPSTEIN: No, it's mine. 433 00:19:43,190 --> 00:19:43,840 It's my special one. 434 00:19:43,840 --> 00:19:45,180 MAXWELL MANN: Oh, it's your special one? 435 00:19:45,180 --> 00:19:47,160 Oh my goodness, you guys are in for real treat. 436 00:19:47,160 --> 00:19:51,690 Aaron is a coding beast, I gotta tell you. 437 00:19:51,690 --> 00:19:54,820 This is the representation of his might and his capability, 438 00:19:54,820 --> 00:19:56,250 right here. 439 00:19:56,250 --> 00:19:58,725 Super awesome is the red fellow and there he 440 00:19:58,725 --> 00:20:02,903 is, going, capturing things, defusing mines. 441 00:20:02,903 --> 00:20:07,974 [LAUGHTER] 442 00:20:07,974 --> 00:20:09,390 AARON EPSTEIN: Oh, it didn't work. 443 00:20:09,390 --> 00:20:10,819 Oh well. 444 00:20:10,819 --> 00:20:11,944 MAXWELL MANN: Sorry, Aaron. 445 00:20:11,944 --> 00:20:13,322 Next time. 446 00:20:13,322 --> 00:20:14,863 AARON EPSTEIN: It's just a small map. 447 00:20:20,070 --> 00:20:24,605 So you could rush, strategy, rush OP, et cetera. 448 00:20:24,605 --> 00:20:25,980 MAXWELL MANN: I'll tell you what, 449 00:20:25,980 --> 00:20:27,860 we'll change the game specs. 450 00:20:27,860 --> 00:20:29,220 We'll change the game engine. 451 00:20:29,220 --> 00:20:31,215 AARON EPSTEIN: I've already done it. 452 00:20:31,215 --> 00:20:32,090 MAXWELL MANN: Oh, OK. 453 00:20:32,090 --> 00:20:33,750 That makes sense. 454 00:20:33,750 --> 00:20:36,500 I just didn't get the latest version. 455 00:20:36,500 --> 00:20:38,300 The "Aaron wins all matches" version. 456 00:20:38,300 --> 00:20:40,430 AARON EPSTEIN: Yep. 457 00:20:40,430 --> 00:20:43,059 OK, anyway-- What? 458 00:20:43,059 --> 00:20:45,350 AUDIENCE: Why don't you change your team name to Aaron? 459 00:20:48,620 --> 00:20:49,690 AARON EPSTEIN: From what? 460 00:20:49,690 --> 00:20:50,830 What do you mean? 461 00:20:50,830 --> 00:20:53,754 Sorry, I don't understand. 462 00:20:53,754 --> 00:20:54,670 MAXWELL MANN: It's OK. 463 00:20:54,670 --> 00:20:57,671 It's got to do with corruption. 464 00:20:57,671 --> 00:20:58,670 I'll teach you sometime. 465 00:20:58,670 --> 00:20:59,970 AARON EPSTEIN: OK. 466 00:20:59,970 --> 00:21:01,950 Yeah, I don't know anything about, of course. 467 00:21:07,860 --> 00:21:10,580 So I did Git status, which is always a good thing to do. 468 00:21:10,580 --> 00:21:14,380 Between every command that you execute, 469 00:21:14,380 --> 00:21:17,170 that you ask Git to do, before you should do a status, 470 00:21:17,170 --> 00:21:18,640 and after you should do a status. 471 00:21:18,640 --> 00:21:21,895 Which means that since I wanted to execute status to show you, 472 00:21:21,895 --> 00:21:24,320 I should have done Git status three times. 473 00:21:24,320 --> 00:21:26,310 One before the Git status, one to execute 474 00:21:26,310 --> 00:21:28,520 the Git status, and one after. 475 00:21:28,520 --> 00:21:30,830 Just so that you get a really good feeling 476 00:21:30,830 --> 00:21:33,149 for what the status is. 477 00:21:33,149 --> 00:21:35,190 And you should actually read it a bunch of times. 478 00:21:35,190 --> 00:21:37,040 So Git status, that's the command I type. 479 00:21:37,040 --> 00:21:39,590 On branch master, master's a branch. 480 00:21:39,590 --> 00:21:40,090 Got it. 481 00:21:40,090 --> 00:21:41,881 MAXWELL MANN: We'll do branches in the lab. 482 00:21:41,881 --> 00:21:42,860 AARON EPSTEIN: Yeah. 483 00:21:42,860 --> 00:21:44,080 Untracked files. 484 00:21:44,080 --> 00:21:46,280 OK, that's a lot of untracked files. 485 00:21:46,280 --> 00:21:48,640 Nothing added to commit, but untracked files present. 486 00:21:48,640 --> 00:21:51,360 OK, nothing added to commit, means I haven't done anything. 487 00:21:51,360 --> 00:21:52,600 But there's untracked files. 488 00:21:52,600 --> 00:21:53,100 That's bad. 489 00:21:56,070 --> 00:21:58,320 When I tell you status is really important, I mean it. 490 00:21:58,320 --> 00:22:01,110 But if all this red stuff comes up every time you type status, 491 00:22:01,110 --> 00:22:03,510 you're going to start not paying attention to it. 492 00:22:03,510 --> 00:22:05,340 So an important thing to do is to tell 493 00:22:05,340 --> 00:22:08,600 Git to ignore these things that I never want to add. 494 00:22:08,600 --> 00:22:11,270 So I just want them to be ignored. 495 00:22:11,270 --> 00:22:18,960 So what I do is I open up my favorite text editor eMags, 496 00:22:18,960 --> 00:22:25,870 and I go to directory, and I make 497 00:22:25,870 --> 00:22:28,330 a file called dot Git ignore. 498 00:22:31,360 --> 00:22:33,540 And I no longer exist. 499 00:22:33,540 --> 00:22:34,040 OK. 500 00:22:40,520 --> 00:22:42,729 Oh man, eMags is too clever sometimes. 501 00:22:42,729 --> 00:22:45,145 MAXWELL MANN: Because he made this file before the lecture 502 00:22:45,145 --> 00:22:47,211 in preparation, and then deleted it. 503 00:22:47,211 --> 00:22:48,710 But eMags was like, are you sure you 504 00:22:48,710 --> 00:22:51,050 didn't want to not have the things you deleted 505 00:22:51,050 --> 00:22:53,570 and then looked for later in a different place? 506 00:22:53,570 --> 00:22:54,660 And then he said, yes. 507 00:22:54,660 --> 00:22:55,080 AARON EPSTEIN: Now it's empty. 508 00:22:55,080 --> 00:22:55,810 OK, cool. 509 00:22:55,810 --> 00:22:57,850 So I have this empty file, and to make it 510 00:22:57,850 --> 00:23:00,650 ignore this dot installation information, which I'm never 511 00:23:00,650 --> 00:23:02,450 going to add to the repo, I just type 512 00:23:02,450 --> 00:23:06,090 in dot installation information. 513 00:23:06,090 --> 00:23:07,640 And then to make it ignore everything 514 00:23:07,640 --> 00:23:08,830 in the doc folder, because I'm never 515 00:23:08,830 --> 00:23:10,996 going to have to share that with Max, because he has 516 00:23:10,996 --> 00:23:12,820 from the installer, do doc slash star, 517 00:23:12,820 --> 00:23:16,180 and then version dot text, et cetera. 518 00:23:16,180 --> 00:23:20,380 Or I get this handy-dandy one that I've already written, 519 00:23:20,380 --> 00:23:21,880 and just copy all of it. 520 00:23:29,560 --> 00:23:30,060 Yeah. 521 00:23:30,060 --> 00:23:36,500 So now that I've made the dot Git ignore and saved it, 522 00:23:36,500 --> 00:23:39,210 now the only untracked things are the other teams. 523 00:23:39,210 --> 00:23:43,330 So I could specifically add those. 524 00:23:43,330 --> 00:23:50,230 Teams slash example, teams slash macro player, 525 00:23:50,230 --> 00:23:54,630 team slash suicide player. 526 00:23:54,630 --> 00:23:57,090 MAXWELL MANN: Yet another one of his classics. 527 00:23:57,090 --> 00:24:00,680 AARON EPSTEIN: Yeah, right. 528 00:24:00,680 --> 00:24:03,840 Save that, Git status. 529 00:24:07,010 --> 00:24:09,960 The thing with the squiggly is just another eMags Folder. 530 00:24:09,960 --> 00:24:12,085 I'll just ignore everything that ends in squiggles. 531 00:24:14,637 --> 00:24:16,470 Cool, so now the only thing that's untracked 532 00:24:16,470 --> 00:24:18,750 is a dot Git ignore. 533 00:24:18,750 --> 00:24:22,120 So I'll just add the dot Git ignore. 534 00:24:22,120 --> 00:24:24,370 Because I do want to share that with Max so he doesn't 535 00:24:24,370 --> 00:24:26,495 to go through all that trouble I just went through. 536 00:24:26,495 --> 00:24:30,420 Now if I do status I get this really nice-- oh, no. 537 00:24:30,420 --> 00:24:33,930 Now to commit the fact that I've added the Git ignore. 538 00:24:33,930 --> 00:24:35,160 I do the AM switch again. 539 00:24:35,160 --> 00:24:37,470 A for everything in the index. 540 00:24:37,470 --> 00:24:40,860 And m for not bringing up VIM and pulling my hair out. 541 00:24:48,440 --> 00:24:51,820 Make a nice commit message so Max knows what this file's for. 542 00:24:56,120 --> 00:25:03,025 OK, now if I do status I get this really clean status. 543 00:25:03,025 --> 00:25:06,170 It even says that my working directory's clean, nothing 544 00:25:06,170 --> 00:25:06,960 to commit. 545 00:25:06,960 --> 00:25:08,090 Perfect. 546 00:25:08,090 --> 00:25:11,870 So I'll push that to Max and he can get it, if he wants. 547 00:25:15,380 --> 00:25:18,300 Type my password again, 123ABCD. 548 00:25:23,320 --> 00:25:27,355 MAXWELL MANN: So I noticed that we untracked a bunch of things 549 00:25:27,355 --> 00:25:28,980 because we didn't want to include them. 550 00:25:28,980 --> 00:25:31,590 But I was saying before this that it might be convenient 551 00:25:31,590 --> 00:25:35,130 for us to just share the whole of everything. 552 00:25:35,130 --> 00:25:36,960 Why wouldn't we do that? 553 00:25:36,960 --> 00:25:40,070 AARON EPSTEIN: OK, there's a lot of reasons not to do it. 554 00:25:40,070 --> 00:25:43,640 A couple things you don't want in your Git repo. 555 00:25:43,640 --> 00:25:46,050 Anything that's platform specific, 556 00:25:46,050 --> 00:25:48,120 probably you don't want in your Git repo. 557 00:25:48,120 --> 00:25:51,050 So right now I'm using Windows and Max is using Windows, 558 00:25:51,050 --> 00:25:53,910 but Steven doesn't use Windows. 559 00:25:53,910 --> 00:25:56,560 So anything that's on our team-- if I 560 00:25:56,560 --> 00:26:00,374 have a path that is something like C 561 00:26:00,374 --> 00:26:04,410 backslash users, that's going to look like nonsense once Stephen 562 00:26:04,410 --> 00:26:05,190 checks it out. 563 00:26:05,190 --> 00:26:09,080 So anything platform specific doesn't go in the repo. 564 00:26:09,080 --> 00:26:10,770 Another thing you don't want in the repo 565 00:26:10,770 --> 00:26:14,250 is stuff that we distribute. 566 00:26:14,250 --> 00:26:16,064 By we, I mean we as Battlecode people, 567 00:26:16,064 --> 00:26:17,480 not we as in this false Battlecode 568 00:26:17,480 --> 00:26:18,860 team that has the repo. 569 00:26:18,860 --> 00:26:21,370 So we as Battlecode people release an installer 570 00:26:21,370 --> 00:26:23,820 that gives you things like example [? flux ?] player, 571 00:26:23,820 --> 00:26:27,130 and documents, and stuff like that. 572 00:26:27,130 --> 00:26:30,580 You don't want those in the repo because, let's say 573 00:26:30,580 --> 00:26:32,640 I add example [? flux ?] player to the repo. 574 00:26:32,640 --> 00:26:35,690 I check it in-- now, this is I as in this guy-- 575 00:26:35,690 --> 00:26:37,550 I check in example [? flux ?] player. 576 00:26:37,550 --> 00:26:40,550 Max is working on really complex navigation code. 577 00:26:40,550 --> 00:26:43,557 I have version 1.3, and Max has version 1.0. 578 00:26:43,557 --> 00:26:45,890 An example [? flux ?] player, the one I just checked in, 579 00:26:45,890 --> 00:26:48,000 makes a 1.3 specific function call 580 00:26:48,000 --> 00:26:49,940 that breaks if you use it in 1.0. 581 00:26:49,940 --> 00:26:52,010 So I check it in, I upload it. 582 00:26:52,010 --> 00:26:55,320 Max downloads my code expecting to get some more navigation 583 00:26:55,320 --> 00:26:56,450 stuff that he really needs. 584 00:26:56,450 --> 00:26:58,741 But he also gets this new version of example [? flux ?] 585 00:26:58,741 --> 00:27:02,130 player that makes a 1.3 specific function call, 586 00:27:02,130 --> 00:27:04,810 and now his code won't compile at all. 587 00:27:04,810 --> 00:27:06,810 And now he has to interrupt the workflow 588 00:27:06,810 --> 00:27:09,820 that he was really deep into navigation, 589 00:27:09,820 --> 00:27:12,730 and isolate where is this red X coming from, 590 00:27:12,730 --> 00:27:15,550 and find out that it's because it was in a different version. 591 00:27:15,550 --> 00:27:17,860 Then he has to go download it from Battlecode.org, 592 00:27:17,860 --> 00:27:21,287 and then install it again, and then update, and then 593 00:27:21,287 --> 00:27:23,370 find that the update doesn't work on his computer. 594 00:27:23,370 --> 00:27:24,530 Then he has to fix that. 595 00:27:24,530 --> 00:27:26,520 All of this, and then in the process, forgetting everything 596 00:27:26,520 --> 00:27:27,490 he knew about navigation. 597 00:27:27,490 --> 00:27:29,365 So when he gets back to, he's already forgot. 598 00:27:29,365 --> 00:27:30,340 It's just a pain. 599 00:27:30,340 --> 00:27:33,270 So anything that we update, just get it from the installer. 600 00:27:33,270 --> 00:27:35,070 Don't put in the repo. 601 00:27:35,070 --> 00:27:37,160 There's no need. 602 00:27:37,160 --> 00:27:42,040 Anything binary, don't put that in the repo, 603 00:27:42,040 --> 00:27:43,650 because it's inefficient. 604 00:27:43,650 --> 00:27:47,650 Git has really good algorithms for compressing and storing 605 00:27:47,650 --> 00:27:49,770 only meaningful things about text, 606 00:27:49,770 --> 00:27:52,670 so if there's a huge one megabyte text file 607 00:27:52,670 --> 00:27:55,780 and I change one line, Git stores one line. 608 00:27:55,780 --> 00:27:58,350 None of those algorithms that it has applied to binaries. 609 00:27:58,350 --> 00:28:02,730 So if I upload a binary, and I change one line in a binary-- 610 00:28:02,730 --> 00:28:05,840 a binary meaning a zip archive or a picture. 611 00:28:05,840 --> 00:28:08,110 If I change one pixel in the image, 612 00:28:08,110 --> 00:28:10,000 Git just has to store both copies 613 00:28:10,000 --> 00:28:12,160 of the image, which is inefficient. 614 00:28:12,160 --> 00:28:14,820 So if you store our whole installer, 615 00:28:14,820 --> 00:28:16,040 it's like 30 megabytes. 616 00:28:16,040 --> 00:28:18,560 Every time we update, you'll add another 30 megabytes. 617 00:28:18,560 --> 00:28:22,180 So instead of this 500 kilobyte repo that Max and I have right 618 00:28:22,180 --> 00:28:25,210 now, if you kept going like 30 megabytes per installer, 619 00:28:25,210 --> 00:28:26,790 you'd end up with 500 megabytes. 620 00:28:26,790 --> 00:28:27,750 Bad. 621 00:28:27,750 --> 00:28:28,810 Not good. 622 00:28:28,810 --> 00:28:31,050 And then, anything that's personal, 623 00:28:31,050 --> 00:28:34,310 like project settings you don't need them. 624 00:28:34,310 --> 00:28:36,480 So what do you put in the repo? 625 00:28:36,480 --> 00:28:38,340 Text documents that you've created, 626 00:28:38,340 --> 00:28:42,990 like source code, or new maps that you want, or a script. 627 00:28:42,990 --> 00:28:45,540 Or all the incredible documentation 628 00:28:45,540 --> 00:28:48,250 that you're going to have for your players, all 629 00:28:48,250 --> 00:28:51,920 of that, that can go in the repo. 630 00:28:51,920 --> 00:28:52,421 Cool. 631 00:28:52,421 --> 00:28:53,795 MAXWELL MANN: In some past years, 632 00:28:53,795 --> 00:28:55,520 we've offered another one of these side 633 00:28:55,520 --> 00:28:58,080 prizes for best documented code. 634 00:28:58,080 --> 00:29:00,300 Are we going to be doing that this year, Stephen? 635 00:29:00,300 --> 00:29:02,810 Think a best documented code side prize this year? 636 00:29:02,810 --> 00:29:03,654 AUDIENCE: Probably 637 00:29:03,654 --> 00:29:04,920 MAXWELL MANN: Probably. 638 00:29:04,920 --> 00:29:06,080 Something to keep in mind. 639 00:29:06,080 --> 00:29:09,180 Keep those forward slashes on your left ring 640 00:29:09,180 --> 00:29:12,070 finger, which is to say, ready. 641 00:29:15,230 --> 00:29:17,090 Do you hit it with your pinky finger? 642 00:29:17,090 --> 00:29:19,550 AARON EPSTEIN: Mine is on the left bracket, 643 00:29:19,550 --> 00:29:20,620 because I use Dvorak. 644 00:29:20,620 --> 00:29:21,470 MAXWELL MANN: Right. 645 00:29:21,470 --> 00:29:22,899 But it's still the same finger. 646 00:29:22,899 --> 00:29:24,315 AARON EPSTEIN: No, it's the pinky. 647 00:29:24,315 --> 00:29:26,799 How do you go all the way over there with the ring finger? 648 00:29:26,799 --> 00:29:28,340 MAXWELL MANN: I think I was mistaken. 649 00:29:28,340 --> 00:29:30,506 AARON EPSTEIN: I think-- yes, it is the same finger. 650 00:29:30,506 --> 00:29:32,960 Yeah, pinky. 651 00:29:32,960 --> 00:29:35,360 Pinky active coding. 652 00:29:35,360 --> 00:29:36,110 Cool. 653 00:29:36,110 --> 00:29:40,570 So then we just showed you an example where I made a repo 654 00:29:40,570 --> 00:29:42,710 and put some files in it and push to server. 655 00:29:42,710 --> 00:29:45,560 Max made his own repo, pulled some stuff. 656 00:29:45,560 --> 00:29:46,310 He got it. 657 00:29:46,310 --> 00:29:47,400 He could do the same thing, where 658 00:29:47,400 --> 00:29:49,441 he can add files and push it, and I can get them. 659 00:29:49,441 --> 00:29:50,540 And that's great. 660 00:29:50,540 --> 00:29:54,120 But now we have to show you what happens if Max and I both try 661 00:29:54,120 --> 00:29:58,780 and change one thing, the same thing. 662 00:29:58,780 --> 00:30:00,290 Then we get a conflict. 663 00:30:00,290 --> 00:30:03,100 It's really scary, and the reason why-- 664 00:30:03,100 --> 00:30:05,570 or, it's a reason that some people give up on Git. 665 00:30:05,570 --> 00:30:07,790 But we're going to navigate it. 666 00:30:07,790 --> 00:30:09,600 It's going to be OK. 667 00:30:09,600 --> 00:30:11,132 MAXWELL MANN: OK, let's do this. 668 00:30:13,644 --> 00:30:16,060 AARON EPSTEIN: OK, so let's go to my super awesome player. 669 00:30:20,780 --> 00:30:24,760 I have this number capturing channel here. 670 00:30:24,760 --> 00:30:26,469 I think it's not big enough. 671 00:30:26,469 --> 00:30:28,010 So I think you should make it bigger. 672 00:30:28,010 --> 00:30:29,870 MAXWELL MANN: Well, I think it's not well commented enough. 673 00:30:29,870 --> 00:30:32,060 AARON EPSTEIN: OK, I'll make it bigger, 674 00:30:32,060 --> 00:30:33,214 but you try and explain it. 675 00:30:33,214 --> 00:30:35,380 Which is silly because you don't know what it's for. 676 00:30:35,380 --> 00:30:37,796 But I'll make it bigger, because I think that's important. 677 00:30:41,070 --> 00:30:43,511 It's a radio channel, so in case you didn't get it, 678 00:30:43,511 --> 00:30:45,510 making it bigger's not going to change anything. 679 00:30:45,510 --> 00:30:47,400 But anyway, I'll pretend. 680 00:30:47,400 --> 00:30:49,210 MAXWELL MANN: Okay, I've saved my changes. 681 00:30:49,210 --> 00:30:51,210 AARON EPSTEIN: OK so I did a status, because I'm 682 00:30:51,210 --> 00:30:52,260 about to execute commit. 683 00:30:52,260 --> 00:30:53,580 So first I did a status. 684 00:30:53,580 --> 00:30:57,400 Yeah, you're getting the hang of this? 685 00:30:57,400 --> 00:30:59,455 Now I'm going to do a commit, because modified, 686 00:30:59,455 --> 00:31:00,330 that's what I wanted. 687 00:31:00,330 --> 00:31:02,950 I wanted this player modified. 688 00:31:02,950 --> 00:31:03,700 Do a nice commit. 689 00:31:10,480 --> 00:31:10,980 OK. 690 00:31:10,980 --> 00:31:12,840 I would use an exclamation mark here, 691 00:31:12,840 --> 00:31:15,690 but no exclamation marks in Git commit messages 692 00:31:15,690 --> 00:31:17,900 because bash handles them correctly. 693 00:31:17,900 --> 00:31:20,099 So they can't have exclamation marks in them. 694 00:31:20,099 --> 00:31:22,390 MAXWELL MANN: Alright, I've pushed my excellent change. 695 00:31:22,390 --> 00:31:26,150 I hope you learned something from it. 696 00:31:26,150 --> 00:31:28,570 If I may say so, it's a wonderful comment. 697 00:31:28,570 --> 00:31:34,550 I think that you really couldn't expect much better. 698 00:31:34,550 --> 00:31:37,250 AARON EPSTEIN: Alright, I'm also pushing my change, but wait. 699 00:31:37,250 --> 00:31:38,050 It didn't work. 700 00:31:38,050 --> 00:31:39,020 Why? 701 00:31:39,020 --> 00:31:41,497 Updates were rejected because the tip of the branch 702 00:31:41,497 --> 00:31:45,310 is behind remote counterpart pull. 703 00:31:45,310 --> 00:31:48,760 OK, I think what that means is that because Max pushed 704 00:31:48,760 --> 00:31:52,246 and I tried to push to the same place, 705 00:31:52,246 --> 00:31:53,920 Git doesn't like that because then it 706 00:31:53,920 --> 00:31:55,795 wouldn't know which is mostly recent version. 707 00:31:55,795 --> 00:31:57,739 So it tells to resolve it by pull. 708 00:31:57,739 --> 00:31:59,530 A lot of commands, when they give an error, 709 00:31:59,530 --> 00:32:01,730 will tell you what command to fix it with. 710 00:32:01,730 --> 00:32:03,680 So because I'm about to do a pull, 711 00:32:03,680 --> 00:32:06,520 first I'm going to do a status. 712 00:32:06,520 --> 00:32:08,744 OK, that's cool. 713 00:32:08,744 --> 00:32:09,660 And I'm going to pull. 714 00:32:12,191 --> 00:32:12,690 123ABCDE. 715 00:32:19,270 --> 00:32:20,480 Oh no. 716 00:32:20,480 --> 00:32:21,730 Conflict. 717 00:32:21,730 --> 00:32:23,030 Look at that, all caps. 718 00:32:23,030 --> 00:32:24,620 Automatic merge failed, fix conflicts 719 00:32:24,620 --> 00:32:27,770 and commit the result. 720 00:32:27,770 --> 00:32:32,204 So team super awesome robot player dot java had a conflict. 721 00:32:32,204 --> 00:32:34,120 MAXWELL MANN: So Aaron, I guess it's up to you 722 00:32:34,120 --> 00:32:35,380 now to fix that conflict. 723 00:32:35,380 --> 00:32:36,910 AARON EPSTEIN: Yeah, it is. 724 00:32:36,910 --> 00:32:39,474 So I go to robot player dot Java. 725 00:32:39,474 --> 00:32:41,890 MAXWELL MANN: Oh man, why don't you do window preferences, 726 00:32:41,890 --> 00:32:43,730 and change your size to something non-zero. 727 00:32:45,966 --> 00:32:47,340 AARON EPSTEIN: Aw man, but I'm so 728 00:32:47,340 --> 00:32:50,315 excited about fixing the conflict. 729 00:32:50,315 --> 00:32:51,940 I just want to fix the conflict though. 730 00:32:51,940 --> 00:32:52,900 Is this going to fix the conflict? 731 00:32:52,900 --> 00:32:54,070 MAXWELL MANN: Appearance. 732 00:32:54,070 --> 00:32:56,445 Some conflicts have been going on for thousands of years, 733 00:32:56,445 --> 00:32:58,550 I think it can wait. 734 00:32:58,550 --> 00:33:01,330 Yeah, then you go to Java. 735 00:33:01,330 --> 00:33:04,900 And it's only like another 16 Windows. 736 00:33:04,900 --> 00:33:06,517 Text editor font. 737 00:33:06,517 --> 00:33:07,850 AARON EPSTEIN: This is terrible. 738 00:33:07,850 --> 00:33:08,771 MAXWELL MANN: I know. 739 00:33:08,771 --> 00:33:10,020 I have to do it every lecture. 740 00:33:10,020 --> 00:33:11,556 16 is a good number. 741 00:33:11,556 --> 00:33:13,930 Let's make it bigger, because you have better resolution. 742 00:33:13,930 --> 00:33:16,465 His computer's a beast. 743 00:33:16,465 --> 00:33:18,280 It's a pretty darn nice computer. 744 00:33:18,280 --> 00:33:20,190 AARON EPSTEIN: OK cool. 745 00:33:20,190 --> 00:33:22,602 Alright, I've got tons of red. 746 00:33:22,602 --> 00:33:24,030 It didn't work. 747 00:33:24,030 --> 00:33:29,820 OK, so the conflict markers are as obvious as they can be. 748 00:33:29,820 --> 00:33:32,350 Really big, loud, not part of any programming language. 749 00:33:32,350 --> 00:33:34,280 Obviously errors that you want to clean up. 750 00:33:34,280 --> 00:33:35,710 Nice x's. 751 00:33:35,710 --> 00:33:40,800 So what this is, head is the head of my current stuff, 752 00:33:40,800 --> 00:33:42,670 so that's going to be my copy. 753 00:33:42,670 --> 00:33:45,900 And then this really long number here 754 00:33:45,900 --> 00:33:50,070 is the hash name of Max's commit. 755 00:33:50,070 --> 00:33:52,290 So this is Max's thing. 756 00:33:52,290 --> 00:33:55,220 Max made a comment, and I changed the number. 757 00:33:55,220 --> 00:33:59,200 And so even though I know that all of my changes 758 00:33:59,200 --> 00:34:01,760 are going to be superior to anything that Max wrote, 759 00:34:01,760 --> 00:34:03,350 Git doesn't know that. 760 00:34:03,350 --> 00:34:08,400 So since it's conflicted, it asked me to fix it. 761 00:34:08,400 --> 00:34:15,239 In this case, I'll take what Max wrote and add it to mine. 762 00:34:15,239 --> 00:34:17,350 And then delete it. 763 00:34:17,350 --> 00:34:21,050 Not the other way around, by the way. 764 00:34:21,050 --> 00:34:23,050 MAXWELL MANN: Everybody's got to have standards. 765 00:34:23,050 --> 00:34:23,969 AARON EPSTEIN: Yeah. 766 00:34:23,969 --> 00:34:26,719 Oh, I didn't delete that. 767 00:34:26,719 --> 00:34:29,630 Cool, so now it compiles. 768 00:34:29,630 --> 00:34:32,110 Probably still doesn't beat the stupid [? rush ?] 769 00:34:32,110 --> 00:34:34,870 player OP stuff. 770 00:34:34,870 --> 00:34:38,949 [INAUDIBLE] It compiles, and now I 771 00:34:38,949 --> 00:34:40,500 have to tell Git about the success. 772 00:34:43,139 --> 00:34:48,045 So I do a commit, but before I do the commit-- yeah? 773 00:34:48,045 --> 00:34:48,670 Getting it yet? 774 00:34:51,290 --> 00:34:53,020 Oh, it deleted awesomer player. 775 00:34:53,020 --> 00:34:55,210 That's what Max did on his computer. 776 00:34:55,210 --> 00:34:58,540 And we both modified robot player dot java. 777 00:34:58,540 --> 00:35:01,040 Pointing with my mouse, remember. 778 00:35:03,800 --> 00:35:05,650 That's cool, but I fixed it. 779 00:35:05,650 --> 00:35:11,260 So, "merge a success. 780 00:35:11,260 --> 00:35:13,330 Cake imminent." 781 00:35:13,330 --> 00:35:14,490 Is that the right spelling? 782 00:35:14,490 --> 00:35:15,531 MAXWELL MANN: It's close. 783 00:35:18,360 --> 00:35:19,670 AARON EPSTEIN: OK. 784 00:35:19,670 --> 00:35:20,790 And then I push that. 785 00:35:20,790 --> 00:35:22,206 MAXWELL MANN: I'm going to get it. 786 00:35:24,850 --> 00:35:26,940 Git pull origin master. 787 00:35:26,940 --> 00:35:29,550 I'm ready to push this button. 788 00:35:29,550 --> 00:35:36,141 And-- yeah. 789 00:35:36,141 --> 00:35:36,640 Cool, 790 00:35:36,640 --> 00:35:38,680 AARON EPSTEIN: So that's a conflict resolution, 791 00:35:38,680 --> 00:35:41,580 which happens more than is pleasant, 792 00:35:41,580 --> 00:35:46,364 but is not too hard to deal with once you know you're doing. 793 00:35:46,364 --> 00:35:48,780 MAXWELL MANN: If we had edited different lines of the same 794 00:35:48,780 --> 00:35:52,060 file, there'd be no conflict because Github is so smart 795 00:35:52,060 --> 00:35:54,832 about which lines were changed and which weren't. 796 00:35:54,832 --> 00:35:56,790 It would just go ahead and it would merge those 797 00:35:56,790 --> 00:35:58,560 automatically. 798 00:35:58,560 --> 00:36:01,330 AARON EPSTEIN: Alright, so before Max takes my changes 799 00:36:01,330 --> 00:36:03,470 and starts messing around with them, 800 00:36:03,470 --> 00:36:06,800 I'm going to just mention, but not thoroughly explain, 801 00:36:06,800 --> 00:36:10,190 a bunch of super useful Git commands. 802 00:36:10,190 --> 00:36:12,790 If this wasn't enough, then if you go look up these commands 803 00:36:12,790 --> 00:36:14,720 and what they're for, then you'll 804 00:36:14,720 --> 00:36:19,299 be convinced that Git is essential. 805 00:36:19,299 --> 00:36:19,840 Git checkout. 806 00:36:24,115 --> 00:36:24,615 Git log. 807 00:36:24,615 --> 00:36:26,025 Let me do this. 808 00:36:26,025 --> 00:36:28,400 If I show you the log, which is something I forgot to do, 809 00:36:28,400 --> 00:36:30,790 if you do a status before and after each command, 810 00:36:30,790 --> 00:36:33,290 after you're done with the second status, do a log. 811 00:36:33,290 --> 00:36:35,561 And log tells you what's happened. 812 00:36:35,561 --> 00:36:36,560 Pointing with the mouse. 813 00:36:36,560 --> 00:36:38,510 OK, right? 814 00:36:38,510 --> 00:36:41,100 This is the whole history of what happened. 815 00:36:41,100 --> 00:36:47,430 So Git checkout lets you take any of these points in time 816 00:36:47,430 --> 00:36:50,330 and set your repository, like you're 817 00:36:50,330 --> 00:36:53,100 working copy, the copy on disk, to what was here. 818 00:36:53,100 --> 00:36:55,410 So if I want to go to what happened before the bigger 819 00:36:55,410 --> 00:36:59,850 numbers commit, I could check this out, and do Git checkout. 820 00:36:59,850 --> 00:37:01,190 Git branch. 821 00:37:01,190 --> 00:37:03,960 Branches lets you have parallel workflows. 822 00:37:03,960 --> 00:37:06,006 It's really smooth. 823 00:37:06,006 --> 00:37:07,380 I have this document that I found 824 00:37:07,380 --> 00:37:09,300 online that describes a really good, really 825 00:37:09,300 --> 00:37:11,870 useful way of using branches. 826 00:37:11,870 --> 00:37:13,020 I'll discuss in the lab. 827 00:37:16,230 --> 00:37:18,930 Git reset hard. 828 00:37:18,930 --> 00:37:21,560 So, commit is like a way of saying, 829 00:37:21,560 --> 00:37:22,580 these changes are great. 830 00:37:22,580 --> 00:37:23,163 They're solid. 831 00:37:23,163 --> 00:37:26,310 I like them, keep them. 832 00:37:26,310 --> 00:37:28,000 Anything you haven't yet commited 833 00:37:28,000 --> 00:37:30,260 can be obliterated by reset hard. 834 00:37:30,260 --> 00:37:35,140 So you accidentally RMRF one of your players. 835 00:37:35,140 --> 00:37:38,380 Or you make some change that actually causes a divide 836 00:37:38,380 --> 00:37:39,870 by zero, and you have no idea how, 837 00:37:39,870 --> 00:37:42,120 and you've spent half an hour looking for. 838 00:37:42,120 --> 00:37:45,010 You've just given up and you just want it gone. 839 00:37:45,010 --> 00:37:48,870 Git reset hard just obliterates anything that's not committed. 840 00:37:48,870 --> 00:37:51,590 Stash does the same thing, but puts it somewhere. 841 00:37:51,590 --> 00:37:54,900 And then you can take it back off with stash pop. 842 00:37:54,900 --> 00:37:59,790 Git k summons a GUI visualizer of the entire history. 843 00:37:59,790 --> 00:38:01,820 I'll just go ahead and summon it. 844 00:38:01,820 --> 00:38:06,200 There's our history, there's some diffs, what was changed. 845 00:38:06,200 --> 00:38:08,240 This was the merge, how it looks. 846 00:38:08,240 --> 00:38:11,450 Great for visualizing stuff if you're not, 847 00:38:11,450 --> 00:38:13,535 or even if you are good at reading the terminal. 848 00:38:16,590 --> 00:38:17,440 Other commands. 849 00:38:17,440 --> 00:38:20,290 Diff shows you the difference between two commits. 850 00:38:20,290 --> 00:38:22,844 Like if I added comment to message channel, what? 851 00:38:22,844 --> 00:38:23,760 I don't remember that. 852 00:38:23,760 --> 00:38:24,810 What comment was it? 853 00:38:24,810 --> 00:38:30,170 I could do Git diff between 31d and the thing before it. 854 00:38:34,750 --> 00:38:37,700 Oh, 31d was ambiguous? 855 00:38:37,700 --> 00:38:40,420 One six. 856 00:38:40,420 --> 00:38:42,680 490 was ambiguous. 857 00:38:42,680 --> 00:38:44,940 MAXWELL MANN: Make it E36. 858 00:38:44,940 --> 00:38:46,950 AARON EPSTEIN: Cool. 859 00:38:46,950 --> 00:38:49,706 Oh, that's where I deleted awesome player. 860 00:38:49,706 --> 00:38:51,580 It looks like you added awesome player, which 861 00:38:51,580 --> 00:38:55,010 means I probably specified in the wrong order. 862 00:38:55,010 --> 00:38:56,380 Yeah, so that's a comment. 863 00:38:56,380 --> 00:38:56,930 Cool. 864 00:38:56,930 --> 00:38:59,330 That's diff. 865 00:38:59,330 --> 00:39:02,800 Revert makes the inverse of a commit, 866 00:39:02,800 --> 00:39:05,130 if you want to get rid of one. 867 00:39:05,130 --> 00:39:09,600 Bisect lets you do a binary search through your history 868 00:39:09,600 --> 00:39:10,830 to find a bug. 869 00:39:10,830 --> 00:39:14,870 If you find out that something-- you find out 870 00:39:14,870 --> 00:39:19,190 some cache you wrote three weeks ago doesn't work anymore. 871 00:39:19,190 --> 00:39:21,480 It worked when you wrote, but it doesn't work anymore, 872 00:39:21,480 --> 00:39:22,979 but you haven't worked on it at all. 873 00:39:22,979 --> 00:39:25,835 So it's clearly something caused by something else. 874 00:39:25,835 --> 00:39:28,460 It doesn't work this commit, it doesn't work the commit before, 875 00:39:28,460 --> 00:39:31,850 so something you wrote somewhere in the last three weeks 876 00:39:31,850 --> 00:39:34,880 broke your cache system and you have no idea where it was. 877 00:39:34,880 --> 00:39:36,860 Git bisect lets you binary search through 878 00:39:36,860 --> 00:39:41,190 your commit history to pinpoint the location of the bug. 879 00:39:41,190 --> 00:39:44,340 Look it up, it's too complicated to be explained in 30 seconds. 880 00:39:44,340 --> 00:39:46,300 But it saved me a lot of time once, 881 00:39:46,300 --> 00:39:48,960 where I was looking a bug for like four hours. 882 00:39:48,960 --> 00:39:49,880 I gave up. 883 00:39:49,880 --> 00:39:53,170 Bisect let me find it in 30 minutes, 884 00:39:53,170 --> 00:39:56,684 and-- you know, programmer time. 885 00:39:56,684 --> 00:39:58,600 I hadn't used bisect, I really would have just 886 00:39:58,600 --> 00:40:00,450 had to rewrite sections of the engine. 887 00:40:00,450 --> 00:40:02,116 There was no way I was going to find it. 888 00:40:02,116 --> 00:40:04,190 It was something really dumb. 889 00:40:04,190 --> 00:40:07,940 Blame does what it sounds like. 890 00:40:07,940 --> 00:40:19,110 So if I do get blame on-- it tells 891 00:40:19,110 --> 00:40:21,870 me who was responsible for every line. 892 00:40:21,870 --> 00:40:25,130 And the evidence is clear. 893 00:40:25,130 --> 00:40:27,100 The only person I can claim blame 894 00:40:27,100 --> 00:40:31,450 for super awesome players loss is myself. 895 00:40:31,450 --> 00:40:34,230 There's nothing here except me. 896 00:40:34,230 --> 00:40:36,180 It's all me. 897 00:40:36,180 --> 00:40:39,670 If Mad had changed some line, like this one or whatever, 898 00:40:39,670 --> 00:40:42,050 if it wasn't checking this encampment thing right, 899 00:40:42,050 --> 00:40:43,625 and it would have said Max man. 900 00:40:43,625 --> 00:40:45,000 And I could have tracked it down. 901 00:40:45,000 --> 00:40:47,950 But no, it looks like this file is all me. 902 00:40:47,950 --> 00:40:50,130 It's the only person I can blame for my defeat. 903 00:40:50,130 --> 00:40:51,130 But anyway, blame. 904 00:40:51,130 --> 00:40:52,740 Blame people. 905 00:40:52,740 --> 00:40:53,390 It's great. 906 00:40:53,390 --> 00:40:55,181 MAXWELL MANN: That's a pretty good summary. 907 00:40:55,181 --> 00:40:58,742 It seems like you've talked about quite a lot of functions. 908 00:40:58,742 --> 00:41:00,450 AARON EPSTEIN: No praising, only blaming. 909 00:41:00,450 --> 00:41:03,074 I actually think there is a less negative version of blame that 910 00:41:03,074 --> 00:41:05,840 does the same thing, but use blame. 911 00:41:05,840 --> 00:41:06,390 OK. 912 00:41:06,390 --> 00:41:09,220 MAXWELL MANN: So you've covered what you need to cover. 913 00:41:09,220 --> 00:41:10,720 We've shown you examples and things. 914 00:41:10,720 --> 00:41:12,450 We've given you summaries. 915 00:41:12,450 --> 00:41:14,260 I'm sure your mouths are watering already. 916 00:41:14,260 --> 00:41:16,680 I want to give a little bit of a demo, 917 00:41:16,680 --> 00:41:18,840 because the sprint tournament is coming up so soon. 918 00:41:18,840 --> 00:41:21,120 The sprint tournament submission deadline is Monday. 919 00:41:21,120 --> 00:41:22,890 So this is how you would submit. 920 00:41:22,890 --> 00:41:25,290 So if you haven't submitted already, 921 00:41:25,290 --> 00:41:27,730 you right click on the robot you want to submit. 922 00:41:27,730 --> 00:41:29,610 And you go to export. 923 00:41:29,610 --> 00:41:33,290 And I think the instructions for this online. 924 00:41:33,290 --> 00:41:35,360 Yeah, we're going to switch to my computer. 925 00:41:35,360 --> 00:41:37,920 My goodness, that makes a lot of sense. 926 00:41:37,920 --> 00:41:41,620 So here we are, I'm going to right click on the robot player 927 00:41:41,620 --> 00:41:43,390 that I want to submit. 928 00:41:43,390 --> 00:41:44,280 This is the package. 929 00:41:44,280 --> 00:41:47,860 I export, archive file. 930 00:41:47,860 --> 00:41:50,530 And I have to name it my team. 931 00:41:50,530 --> 00:41:53,840 So I need to actually change the package name to team, 932 00:41:53,840 --> 00:41:56,270 and then my team number in three digits. 933 00:41:56,270 --> 00:41:57,830 Otherwise it doesn't work. 934 00:41:57,830 --> 00:42:00,120 And then I'll just export it to an archive file. 935 00:42:00,120 --> 00:42:03,370 This would export to the desktop. 936 00:42:03,370 --> 00:42:06,770 And then later I can go on to battle code, 937 00:42:06,770 --> 00:42:09,740 and I can say, alright, upload my player. 938 00:42:09,740 --> 00:42:13,070 And I'll be able to choose the JAR file from the desktop 939 00:42:13,070 --> 00:42:14,360 where I've got it. 940 00:42:14,360 --> 00:42:16,800 And I can give it my own name and then I can submit it, 941 00:42:16,800 --> 00:42:20,330 and it'll tell me whether it was compiled and worked 942 00:42:20,330 --> 00:42:21,380 successfully. 943 00:42:21,380 --> 00:42:23,870 So that's a complete introduction, 944 00:42:23,870 --> 00:42:27,486 an entirely complete explanation of Git. 945 00:42:27,486 --> 00:42:29,860 Everything you ever needed to know, except for the things 946 00:42:29,860 --> 00:42:31,439 we're going to go over in lab. 947 00:42:31,439 --> 00:42:32,480 Aaron's shaking his head. 948 00:42:32,480 --> 00:42:35,850 There's a lot to learn, and it only makes your life easier. 949 00:42:35,850 --> 00:42:38,140 It only helps. 950 00:42:38,140 --> 00:42:40,720 Except when it doesn't. 951 00:42:40,720 --> 00:42:44,390 So with that, the next lecture is going to be on swarm, 952 00:42:44,390 --> 00:42:46,860 and I'll also cover some topics in debugging. 953 00:42:46,860 --> 00:42:49,000 So you're going to watch robots dancing around 954 00:42:49,000 --> 00:42:52,340 in very mellifluous-- is that the right word? 955 00:42:52,340 --> 00:42:55,080 In any case, they're going to dance in fancy ways. 956 00:42:55,080 --> 00:42:56,230 Fancy pants dance. 957 00:42:56,230 --> 00:42:57,734 And that'll take care of it. 958 00:42:57,734 --> 00:42:59,400 So thank you for coming to this lecture. 959 00:42:59,400 --> 00:43:02,810 I hope you enjoy the Thai food, and I'll see you tomorrow.