From e57487f108c44cbb196a2324ca22d8617e387fad Mon Sep 17 00:00:00 2001 From: Jonathan Calver Date: Sun, 17 Sep 2023 12:47:41 -0400 Subject: [PATCH 1/7] Alice's version of the recipe added --- recipe.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/recipe.md b/recipe.md index a8b51a4d..c43eefce 100644 --- a/recipe.md +++ b/recipe.md @@ -4,9 +4,16 @@ - 2 cups all-purpose flour - 1 3/4 cups granulated sugar - 3/4 cup unsweetened cocoa powder +- 1 cup chocolate chips +- 1 tsp vanilla extract - ... ## Instructions: 1. Preheat the oven to 350°F (175°C). -2. In a large bowl, whisk together the flour, sugar, and cocoa powder. -3. ... \ No newline at end of file +2. In a large bowl, whisk together the flour, sugar, cocoa powder, chocolate chips, and vanilla extract. +3. ... + +## Additional Directions by Alice: +4. In a separate bowl, beat the eggs and add them to the mixture. Stir until well combined. +5. Gradually add the milk and vegetable oil to the mixture, continuing to stir. +6. Pour the batter into a greased and floured 9x13-inch baking pan. From 3179fc58c1b169843f6b4b2be7d31241068a1ca4 Mon Sep 17 00:00:00 2001 From: yoohamj Date: Mon, 18 Sep 2023 19:34:41 -0400 Subject: [PATCH 2/7] TASK1 TODO --- .idea/.gitignore | 3 +++ .idea/misc.xml | 6 ++++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ Lab2.iml | 22 ++++++++++++++++++++++ src/DataTypes.java | 4 ++-- 6 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 Lab2.iml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..26d33521 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..a818314f --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..dd47d373 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..35eb1ddf --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Lab2.iml b/Lab2.iml new file mode 100644 index 00000000..03a7b649 --- /dev/null +++ b/Lab2.iml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/DataTypes.java b/src/DataTypes.java index 4f807c1f..3f61a2a3 100644 --- a/src/DataTypes.java +++ b/src/DataTypes.java @@ -4,9 +4,9 @@ public class DataTypes { // TODO TASK 1: fix this code so that it passes the test in DataTypesTest.java public static long sum(List numbers) { - int s = 0; + long s = 0; // below is a "foreach" loop which iterates through numbers - for (int x : numbers) { + for (long x : numbers) { s += x; } return s; From d0cfd7ee32ded4f2bea476c1378bd576aa409d00 Mon Sep 17 00:00:00 2001 From: yoohamj Date: Mon, 18 Sep 2023 19:56:03 -0400 Subject: [PATCH 3/7] idea --- .../shelved.patch | 172 ++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 .idea/shelf/Uncommitted_changes_before_Checkout_at_2023-09-18,_7_50_p_m__[Changes]/shelved.patch diff --git a/.idea/shelf/Uncommitted_changes_before_Checkout_at_2023-09-18,_7_50_p_m__[Changes]/shelved.patch b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2023-09-18,_7_50_p_m__[Changes]/shelved.patch new file mode 100644 index 00000000..eb87887d --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2023-09-18,_7_50_p_m__[Changes]/shelved.patch @@ -0,0 +1,172 @@ +Index: README.md +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+># Lab 2: Branching and Merging\n\nThe main topic of this first lab activity is branching and merging in git.\n\n## Resources and Acknowledgements\n\nhttps://www.atlassian.com/git/tutorials/using-branches contains an excellent, detailed\nwalkthrough of the steps we will be going through in the lab. We encourage you to use\nit as a reference as needed. The short video (about 4 minutes) is well worth a quick view\nin the link above.\n\nThe first coding part in this activity is (very loosely) based on a common problem encountered in\nproblems posted on https://projecteuler.net/archives which is another interesting source of challenging\nprogramming problems. You might also recognize that the multiples of 3 and 5 problem from\nlast week came from there. If you are looking for challenges, definitely check it out.\n\nThe partial cake recipes are courtesy ChatGPT.\n\n# TASK 0: Fork this repo\n\nNote: If you are in lab, your TA will share a different URL for you to fork from https://github.com/XinyiXL/Lab2, so that you\ncan make pull requests to that repo during the Task 3 activity during the lab.\n\nDuring lab, you should not fork directly from https://github.com/CSC207-2023F-UofT/Lab2.\nIf you miss the lab and work on this after, you should use this URL though.\n\n- [ ] Make a fork of this repo and clone a local copy (as you did in Lab 1).\n - Important: make sure to uncheck the option to only fork the main branch, as the repo\n contains some branches you will use in this lab.\n\n# TASK 1: Your first branch\n\n- [ ] Create and checkout a new branch called `task_1` using either IntelliJ or the Terminal:\n - IntelliJ: `Git -> New branch...`\n - Terminal: `git checkout -b task_1`\n - After, you can check `git status` or the Log tab of the Git tool window in IntelliJ to see\n that you are now on the `task_1` branch.\n- [ ] Open the TODO tool window (`View -> Tool Windows -> TODO`) and click on the TASK 1 TODO listed.\n- [ ] Complete the TASK 1 TODO and commit your changes to this file (checking off the\ncompleted items so far) and `DataTypes.java` (remove the word TODO and your bug fix).\n - talk to those around you or your TA, then see the hints at the bottom of the readme if you get stuck.\n- [ ] Now, we'll merge the `task_1` branch back into `main`. When merging,\nyou need to be currently on the branch you are trying to merge into, so we'll first checkout the main\nbranch:\n - IntelliJ: `Git -> branches... -> main -> Checkout`\n - Terminal: `git checkout main`\nNote: everything we've done has been local to our repository and have not pushed anything yet.\n- [ ] We are back on `main`, so we can now do the merge and complete our work!\n - IntelliJ: `Git -> Merge... -> task_1 -> Merge`\n - Terminal: `git merge task_1`\n\nYou should now see the changes you had made are also in the `main` branch.\n\n- [ ] Now, we'll want to clean up since we are done with our `task_1` branch.\n - IntelliJ: `Git -> branches... -> task_1 -> Delete`\n - Terminal: `git branch -d task_1`\n\n- [ ] Last step, we'll push our changes to the remote repository to share our work! (As we did in Lab 1.)\n - we suggest you check off this last item, commit that change (just right on main is fine;\n no need to branch for this little step), then push your code. Check GitHub to ensure you can\n see your changes.\n\nAnd that's it for Task 1! You might be wondering about how we are supposed to get someone else\nto review and approve our changes before we commit and push our changes to the main branch of\nour remote repository, since everything we just did was local. We'll explore how to do precisely\nthat by pushing our branch to our remote repository and making a pull request shortly, but first,\nwe'll talk about merge conflicts and how to resolve them.\n\nTip: In the Git tool window, you can open the `Console` tab to see the underlying git commands it\nis performing when you ask IntelliJ to perform various git operations for you.\n\n# TASK 2: Let's bake a cake!\n\nAlice and Bob are planning to bake a cake, but can't agree on which recipe to use. They had\nstarted working on the recipe in `recipe.md` together, and then each filled in the details of\nwhat they felt would make the most delicious cake!\nYou'll notice that your repository already has two branches called `alice` and `bob`.\n\n- [ ] Checkout the `alice` branch.\n- [ ] Attempt to merge the `bob` branch into the `alice` branch using either IntelliJ or the Terminal.\n - You will be prompted to resolve a merge conflict. To do this, you will need to pick and choose which\n parts of each recipe to keep.\n - Read what either `git` or `IntelliJ` tells you in order to complete the merge process.\n - If you do the merge through the Terminal, you will need to edit `recipe.md` to remove all of the\n merge conflict symbols which `git` has added to your file. Once done, you will need to `git add` the\n `recipe.md` file and `git commit` to finish the merge.\n- [ ] Once the merge is complete, delete the `bob` branch.\n\n- [ ] Finally, checkout the `main` branch and merge the `alice` branch in (as we did previously).\n\nNow, you are almost ready to share your recipe with the remote! \n\n# TASK 3\n\n- [ ] Checkout a new branch called `task_3`.\n- [ ] Commit any changes that you want to `recipe.md` to improve the recipe.\n- [ ] While still on the `task_3` branch, push your code to your remote repository on GitHub.\n- [ ] Go to GitHub and you will see an option to make a pull request to the original repo. Make\n a pull request and see that it shows up in the original repository that you forked.\n\nSince others will also be making pull requests, we won't *actually* accept any of them for now, but\nyou'll get lots of practice with pull requests in the next task and throughout the rest of the course!\n\nWe're now ready to dive into a collaborative coding challenge.\n\nProceed to the second lab activity!\n\n## Hints and Tips\n\n### TASK 1 TODO: Hints\n- Hint 1: you only have to change one line of code\n- Hint 2: unlike Python, an int has a maximum value that it can store (see Integer.MAX_VALUE).\nalso see https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html\n\n### TASK 2 (and possibly other places): Note about Unsaved local changes\n\nIf you have any local changes which you haven't committed, git will refuse to do certain operations\nwhich would result in the loss of your changes. It will advise you on what you should do in order to\nproceed. If you have any changes you want to keep, you will typically want to commit those changes.\n\nNote: you can use `git status` or `Git -> commit...` to see the status of your files to check which\nones have changes not yet committed.\n\n### TASK 3 Additional Note\n\nWhen making a pull request, there may potentially be merge conflicts to resolve, as we had seen in the\nprevious task. GitHub as additional information about how its interface helps facilitate resolving such\nconflicts:\n\nhttps://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-on-github +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/README.md b/README.md +--- a/README.md (revision ce9d1be77ac2a20e993be73f9372d9b328ed9767) ++++ b/README.md (date 1695080272466) +@@ -24,38 +24,38 @@ + During lab, you should not fork directly from https://github.com/CSC207-2023F-UofT/Lab2. + If you miss the lab and work on this after, you should use this URL though. + +-- [ ] Make a fork of this repo and clone a local copy (as you did in Lab 1). ++- [X] Make a fork of this repo and clone a local copy (as you did in Lab 1). + - Important: make sure to uncheck the option to only fork the main branch, as the repo + contains some branches you will use in this lab. + + # TASK 1: Your first branch + +-- [ ] Create and checkout a new branch called `task_1` using either IntelliJ or the Terminal: ++- [X] Create and checkout a new branch called `task_1` using either IntelliJ or the Terminal: + - IntelliJ: `Git -> New branch...` + - Terminal: `git checkout -b task_1` + - After, you can check `git status` or the Log tab of the Git tool window in IntelliJ to see + that you are now on the `task_1` branch. +-- [ ] Open the TODO tool window (`View -> Tool Windows -> TODO`) and click on the TASK 1 TODO listed. +-- [ ] Complete the TASK 1 TODO and commit your changes to this file (checking off the ++- [X] Open the TODO tool window (`View -> Tool Windows -> TODO`) and click on the TASK 1 TODO listed. ++- [X] Complete the TASK 1 TODO and commit your changes to this file (checking off the + completed items so far) and `DataTypes.java` (remove the word TODO and your bug fix). + - talk to those around you or your TA, then see the hints at the bottom of the readme if you get stuck. +-- [ ] Now, we'll merge the `task_1` branch back into `main`. When merging, ++- [X] Now, we'll merge the `task_1` branch back into `main`. When merging, + you need to be currently on the branch you are trying to merge into, so we'll first checkout the main + branch: + - IntelliJ: `Git -> branches... -> main -> Checkout` + - Terminal: `git checkout main` + Note: everything we've done has been local to our repository and have not pushed anything yet. +-- [ ] We are back on `main`, so we can now do the merge and complete our work! ++- [X] We are back on `main`, so we can now do the merge and complete our work! + - IntelliJ: `Git -> Merge... -> task_1 -> Merge` + - Terminal: `git merge task_1` + + You should now see the changes you had made are also in the `main` branch. + +-- [ ] Now, we'll want to clean up since we are done with our `task_1` branch. ++- [X] Now, we'll want to clean up since we are done with our `task_1` branch. + - IntelliJ: `Git -> branches... -> task_1 -> Delete` + - Terminal: `git branch -d task_1` + +-- [ ] Last step, we'll push our changes to the remote repository to share our work! (As we did in Lab 1.) ++- [X] Last step, we'll push our changes to the remote repository to share our work! (As we did in Lab 1.) + - we suggest you check off this last item, commit that change (just right on main is fine; + no need to branch for this little step), then push your code. Check GitHub to ensure you can + see your changes. +Index: .idea/misc.xml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/.idea/misc.xml b/.idea/misc.xml +new file mode 100644 +--- /dev/null (date 1695080441245) ++++ b/.idea/misc.xml (date 1695080441245) +@@ -0,0 +1,6 @@ ++ ++ ++ ++ ++ ++ +\ No newline at end of file +Index: .idea/workspace.xml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/.idea/workspace.xml b/.idea/workspace.xml +new file mode 100644 +--- /dev/null (date 1695080996533) ++++ b/.idea/workspace.xml (date 1695080996533) +@@ -0,0 +1,87 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ { ++ "associatedIndex": 3 ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ 1695079130427 ++ ++ ++ ++ ++ ++ ++ +\ No newline at end of file From 605c3d46b498e20eba975024dc4dc3f22bd5c76f Mon Sep 17 00:00:00 2001 From: yoohamj Date: Mon, 18 Sep 2023 20:06:15 -0400 Subject: [PATCH 4/7] Update1 --- .idea/misc.xml | 6 ++ ...out_at_2023-09-18__7_50_p_m___Changes_.xml | 4 ++ .idea/vcs.xml | 6 ++ .idea/workspace.xml | 65 +++++++++++++++++++ 4 files changed, 81 insertions(+) create mode 100644 .idea/misc.xml create mode 100644 .idea/shelf/Uncommitted_changes_before_Checkout_at_2023-09-18__7_50_p_m___Changes_.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..639900d1 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/shelf/Uncommitted_changes_before_Checkout_at_2023-09-18__7_50_p_m___Changes_.xml b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2023-09-18__7_50_p_m___Changes_.xml new file mode 100644 index 00000000..bbf2d307 --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2023-09-18__7_50_p_m___Changes_.xml @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..35eb1ddf --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 00000000..e76833b0 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1695081382000 + + + + \ No newline at end of file From b2467cf1cadc7419d53c13523daad74d04810f79 Mon Sep 17 00:00:00 2001 From: yoohamj Date: Mon, 18 Sep 2023 20:12:12 -0400 Subject: [PATCH 5/7] readme --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4b438d6c..b41c412e 100644 --- a/README.md +++ b/README.md @@ -24,28 +24,28 @@ can make pull requests to that repo during the Task 3 activity during the lab. During lab, you should not fork directly from https://github.com/CSC207-2023F-UofT/Lab2. If you miss the lab and work on this after, you should use this URL though. -- [ ] Make a fork of this repo and clone a local copy (as you did in Lab 1). +- [X] Make a fork of this repo and clone a local copy (as you did in Lab 1). - Important: make sure to uncheck the option to only fork the main branch, as the repo contains some branches you will use in this lab. # TASK 1: Your first branch -- [ ] Create and checkout a new branch called `task_1` using either IntelliJ or the Terminal: +- [X] Create and checkout a new branch called `task_1` using either IntelliJ or the Terminal: - IntelliJ: `Git -> New branch...` - Terminal: `git checkout -b task_1` - After, you can check `git status` or the Log tab of the Git tool window in IntelliJ to see that you are now on the `task_1` branch. -- [ ] Open the TODO tool window (`View -> Tool Windows -> TODO`) and click on the TASK 1 TODO listed. -- [ ] Complete the TASK 1 TODO and commit your changes to this file (checking off the +- [X] Open the TODO tool window (`View -> Tool Windows -> TODO`) and click on the TASK 1 TODO listed. +- [X] Complete the TASK 1 TODO and commit your changes to this file (checking off the completed items so far) and `DataTypes.java` (remove the word TODO and your bug fix). - talk to those around you or your TA, then see the hints at the bottom of the readme if you get stuck. -- [ ] Now, we'll merge the `task_1` branch back into `main`. When merging, +- [X] Now, we'll merge the `task_1` branch back into `main`. When merging, you need to be currently on the branch you are trying to merge into, so we'll first checkout the main branch: - IntelliJ: `Git -> branches... -> main -> Checkout` - Terminal: `git checkout main` Note: everything we've done has been local to our repository and have not pushed anything yet. -- [ ] We are back on `main`, so we can now do the merge and complete our work! +- [X] We are back on `main`, so we can now do the merge and complete our work! - IntelliJ: `Git -> Merge... -> task_1 -> Merge` - Terminal: `git merge task_1` From d96d3ddf68b0f0a211c3b27cce7f80bf0ab633de Mon Sep 17 00:00:00 2001 From: yoohamj Date: Mon, 18 Sep 2023 20:14:14 -0400 Subject: [PATCH 6/7] part1 --- .idea/workspace.xml | 51 +++++++++++++++++++++++---------------------- README.md | 4 ++-- 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index e76833b0..f2afcdf6 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,12 +4,17 @@