<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>CS360 - labs</title><link href="https://lums-cs360-web.github.io/lums-cs360/" rel="alternate"/><link href="https://lums-cs360-web.github.io/lums-cs360/feeds/labs.atom.xml" rel="self"/><id>https://lums-cs360-web.github.io/lums-cs360/</id><updated>2024-08-26T00:00:00+05:00</updated><subtitle>Copyright @ CMPUT301 - University of Alberta</subtitle><entry><title>Lab 5 Instructions</title><link href="https://lums-cs360-web.github.io/lums-cs360/labs/lab5_instruct.html" rel="alternate"/><published>2024-08-26T00:00:00+05:00</published><updated>2024-08-26T00:00:00+05:00</updated><author><name>LUMS</name></author><id>tag:lums-cs360-web.github.io,2024-08-26:/lums-cs360/labs/lab5_instruct.html</id><summary type="html">&lt;p&gt;Dr. Suleman Shahid and Dr. Abdul Ali Bangash, Department of Computing Science, LUMS (2026).
Dr. Hazel Campbell, Department of Computing Science, University of Alberta (2019, 2023, 2024).
Dr. Abram Hindle, Department of Computing Science, University of Alberta (2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023).
Alexander Wong, 2019 …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Dr. Suleman Shahid and Dr. Abdul Ali Bangash, Department of Computing Science, LUMS (2026).
Dr. Hazel Campbell, Department of Computing Science, University of Alberta (2019, 2023, 2024).
Dr. Abram Hindle, Department of Computing Science, University of Alberta (2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023).
Alexander Wong, 2019.
status: published
summary: Lab 5 Instructions
[TOC]&lt;/p&gt;
&lt;h3 id="lab-5-instructions"&gt;Lab 5 Instructions&lt;/h3&gt;
&lt;p&gt;Read &lt;a href="https://lums-cs360-web.github.io/lums-cs360/labs/slides/Firestore.pdf"&gt;Firestore 🔥.pdf&lt;/a&gt; for introduction of Firestore
Follow instructions on &lt;a href="https://lums-cs360-web.github.io/lums-cs360/labs/slides/Lab5.pdf"&gt;Lab 5 Firestore Integration Instructions.pdf&lt;/a&gt; along with the TA.
Complete Lab Exercise.&lt;/p&gt;
&lt;p&gt;Download Starter Code &lt;a href="https://github.com/cmput301-f25/Lab05"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="lab-5-participation-exercise"&gt;Lab 5 Participation Exercise&lt;/h3&gt;
&lt;p&gt;Proper completion of this exercise is considered as part of course participation.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this exercise it is your task to add the ability to delete Cities and integrate this functionality with the Firestore database, allowing for the persistence of deletions.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;After applying the changes in the lab demo &lt;a href="https://lums-cs360-web.github.io/lums-cs360/labs/slides/Lab5FIntegNew.pdf"&gt;(LINK TO INSTRUCTIONS)&lt;/a&gt;, add the ability to delete cities from the ListView and apply these same deletions to your instance of the Firestore database. If you have implemented this functionality correctly, restarting your app should not have an impact on what cities are displayed in your ListView after any addition or deletion actions.&lt;/p&gt;
&lt;h4 id="note-the-design-of-the-deletion-functionality-is-up-to-you-however-we-have-uploaded-a-few-mockups-to-give-you-some-ideas"&gt;&lt;strong&gt;Note: the design of the deletion functionality is up to you, however, we have uploaded a few mockups to give you some ideas.&lt;/strong&gt;&lt;/h4&gt;
&lt;p&gt;&lt;img alt="Screen1" src="https://lums-cs360-web.github.io/lums-cs360/labs/lab5_img1.png" style="margin: 20px;" width="300"&gt;
&lt;img alt="Screen2" src="https://lums-cs360-web.github.io/lums-cs360/labs/lab5_img2.png" style="margin: 20px;" width="300"&gt;
&lt;img alt="Screen3" src="https://lums-cs360-web.github.io/lums-cs360/labs/lab5_img3.png" style="margin: 20px;" width="300"&gt;&lt;/p&gt;
&lt;h3 id="submission"&gt;Submission&lt;/h3&gt;
&lt;p&gt;LMS&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Due Date&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Tuesday 5PM&lt;/p&gt;</content><category term="labs"/><category term="labs"/><category term="policy"/><category term="grading"/></entry><entry><title>Lab 6 Instructions</title><link href="https://lums-cs360-web.github.io/lums-cs360/labs/lab6_instruct.html" rel="alternate"/><published>2024-08-26T00:00:00+05:00</published><updated>2024-08-26T00:00:00+05:00</updated><author><name>LUMS</name></author><id>tag:lums-cs360-web.github.io,2024-08-26:/lums-cs360/labs/lab6_instruct.html</id><summary type="html">&lt;p&gt;Dr. Suleman Shahid and Dr. Abdul Ali Bangash, Department of Computing Science, LUMS (2026).
Dr. Hazel Campbell, Department of Computing Science, University of Alberta (2019, 2023, 2024).
Dr. Abram Hindle, Department of Computing Science, University of Alberta (2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023).
Alexander Wong, 2019 …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Dr. Suleman Shahid and Dr. Abdul Ali Bangash, Department of Computing Science, LUMS (2026).
Dr. Hazel Campbell, Department of Computing Science, University of Alberta (2019, 2023, 2024).
Dr. Abram Hindle, Department of Computing Science, University of Alberta (2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023).
Alexander Wong, 2019.
status: published
summary: Lab 6 Instructions
[TOC]&lt;/p&gt;
&lt;h3 id="lab-6-instructions"&gt;Lab 6 Instructions&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Follow the slides on &lt;a href="https://lums-cs360-web.github.io/lums-cs360/labs/slides/Javadoc.pdf"&gt;Javadoc&lt;/a&gt; and &lt;a href="https://lums-cs360-web.github.io/lums-cs360/labs/slides/JUnit.pdf"&gt;JUnit&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Follow instructions on this &lt;a href="https://lums-cs360-web.github.io/lums-cs360/labs/slides/Lab_6_Instructions_F24_updated.pdf"&gt;link&lt;/a&gt; along with the TA.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Complete Lab Exercise.  &lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id="some-known-issues"&gt;Some known issues:&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;"test events were not received" --&amp;gt; Solution: &lt;a href="https://stackoverflow.com/a/73009440/1496554"&gt;link&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;"Error creating JavaDoc" --&amp;gt; Solution: &lt;a href="https://stackoverflow.com/a/73102343/1496554"&gt;link&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id="lab-6-participation-exercise"&gt;Lab 6 Participation Exercise&lt;/h3&gt;
&lt;p&gt;Proper completion of this exercise is considered as part of course participation.&lt;/p&gt;
&lt;p&gt;In this exercise your task is to &lt;strong&gt;implement and test&lt;/strong&gt; the following methods in the CityList class &lt;strong&gt;AND create Javadocs&lt;/strong&gt; for the main source files (not tests):&lt;/p&gt;
&lt;p&gt;1) Implement and test these methods:
    - hasCity(City city)
        - When given a city, return whether or not it belongs in the list&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;    &lt;span class="k"&gt;-&lt;/span&gt; Test to see whether your method is correct (Read https://www.infoworld.com/article/3305792/comparing-java-objects-with-equals-and-hashcode.html) delete(City city)

    &lt;span class="k"&gt;-&lt;/span&gt; Check if a city is present in the list. If it does then remove it from the list, if not then **throw an exception**

    &lt;span class="k"&gt;-&lt;/span&gt; Test to see if your method actually removes it from the list

    &lt;span class="k"&gt;-&lt;/span&gt; Test to see if the exception is actually thrown (Read more here https://howtodoinjava.com/junit5/expected-exception-example/) countCities()

    &lt;span class="k"&gt;-&lt;/span&gt; Return how many cities are in the list

    &lt;span class="k"&gt;-&lt;/span&gt;  Test to see whether your method is correct
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;2) Add Javadocs to all methods in CityList class and City class &lt;strong&gt;AND&lt;/strong&gt; generate the javadocs to &lt;project-name&gt;/app/javadocs&lt;/p&gt;
&lt;h3 id="submission"&gt;Submission&lt;/h3&gt;
&lt;p&gt;LMS&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Due Date&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Tuesday 5PM&lt;/p&gt;</content><category term="labs"/><category term="labs"/><category term="policy"/><category term="grading"/></entry><entry><title>Lab 7 Instructions</title><link href="https://lums-cs360-web.github.io/lums-cs360/labs/lab7_instruct.html" rel="alternate"/><published>2024-08-26T00:00:00+05:00</published><updated>2024-08-26T00:00:00+05:00</updated><author><name>LUMS</name></author><id>tag:lums-cs360-web.github.io,2024-08-26:/lums-cs360/labs/lab7_instruct.html</id><summary type="html">&lt;p&gt;Dr. Suleman Shahid and Dr. Abdul Ali Bangash, Department of Computing Science, LUMS (2026).
Dr. Hazel Campbell, Department of Computing Science, University of Alberta (2019, 2023, 2024).
Dr. Abram Hindle, Department of Computing Science, University of Alberta (2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023).
Alexander Wong, 2019 …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Dr. Suleman Shahid and Dr. Abdul Ali Bangash, Department of Computing Science, LUMS (2026).
Dr. Hazel Campbell, Department of Computing Science, University of Alberta (2019, 2023, 2024).
Dr. Abram Hindle, Department of Computing Science, University of Alberta (2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023).
Alexander Wong, 2019.
status: published
summary: Lab 7 Instructions
[TOC]&lt;/p&gt;
&lt;h3 id="lab-7-instructions"&gt;Lab 7 Instructions&lt;/h3&gt;
&lt;h4 id="lab-topicdemo"&gt;Lab Topic/Demo&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://lums-cs360-web.github.io/lums-cs360/labs/slides/Lab7.pdf"&gt;Lab7 Instructions-Android UI Testing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/natewu/cmput301-lab7-starter"&gt;Lab 7 Starter Code&lt;/a&gt; (clone this repo)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://lums-cs360-web.github.io/lums-cs360/labs/slides/Lab_7_starter_code.zip"&gt;Lab 7 Starter Code Download&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="lab-7-participation-exercise"&gt;Lab 7 Participation Exercise&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;# Implement and test activity:&lt;/strong&gt;
ShowActivity (create by yourself to have the following property)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;- By clicking on the city list, the UI should change to another activity which is &amp;quot;ShowActivity&amp;quot;

- The activity shows the city name you have clicked on

- Create a back button which goes back to MainActivity
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;# Test: (create 3 test cases/functions to test the 3 following functionalities)&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;- Check whether the activity correctly switched

- Test whether the city name is consistent

- Test the &amp;quot;back&amp;quot; button
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id="submission"&gt;Submission&lt;/h3&gt;
&lt;p&gt;LMS&lt;/p&gt;
&lt;p&gt;&lt;img alt="Screen1" src="https://lums-cs360-web.github.io/lums-cs360/labs/lab7_img1.png" style="margin: 20px;" width="300"&gt;
&lt;img alt="Screen2" src="https://lums-cs360-web.github.io/lums-cs360/labs/lab7_img2.png" style="margin: 20px;" width="300"&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Due Date&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Tuesday 5PM&lt;/p&gt;</content><category term="labs"/><category term="labs"/><category term="policy"/><category term="grading"/></entry><entry><title>Lab 8 Participation Exercise</title><link href="https://lums-cs360-web.github.io/lums-cs360/labs/lab8_part.html" rel="alternate"/><published>2024-08-26T00:00:00+05:00</published><updated>2024-08-26T00:00:00+05:00</updated><author><name>LUMS</name></author><id>tag:lums-cs360-web.github.io,2024-08-26:/lums-cs360/labs/lab8_part.html</id><summary type="html">&lt;p&gt;Dr. Suleman Shahid and Dr. Abdul Ali Bangash, Department of Computing Science, LUMS (2026).
Dr. Hazel Campbell, Department of Computing Science, University of Alberta (2019, 2023, 2024).
Dr. Abram Hindle, Department of Computing Science, University of Alberta (2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023).
Alexander Wong, 2019 …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Dr. Suleman Shahid and Dr. Abdul Ali Bangash, Department of Computing Science, LUMS (2026).
Dr. Hazel Campbell, Department of Computing Science, University of Alberta (2019, 2023, 2024).
Dr. Abram Hindle, Department of Computing Science, University of Alberta (2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023).
Alexander Wong, 2019.
status: published
summary: Lab 8 Participation Exercise&lt;/p&gt;
&lt;div class="toc"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#lab-8-instructions"&gt;Lab 8 Instructions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#lab-8-slides"&gt;Lab 8 Slides&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#updated-slides"&gt;Updated Slides&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#original-slides"&gt;Original Slides&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#lab-8-instructions_1"&gt;Lab 8 Instructions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#lab-8-participation-exercise"&gt;Lab 8 Participation Exercise&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#submission"&gt;Submission&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h3 id="lab-8-instructions"&gt;Lab 8 Instructions&lt;/h3&gt;
&lt;p&gt;In this lab, we will learn about test driven development (TDD) and continuous integration (CI). These are both solutions for solving some common software engineering problems using unit testing. We will go through the slides (updated version) posted below, and go through a live demo in class based on the instructions below to show you how to use TDD and CI.&lt;/p&gt;
&lt;h3 id="lab-8-slides"&gt;Lab 8 Slides&lt;/h3&gt;
&lt;h4 id="updated-slides"&gt;Updated Slides&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;These slides are based on the original slides posted below, but have a couple more diagrams and a more concise format. If you want to read more about the topic, check out the original slides.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://lums-cs360-web.github.io/lums-cs360/labs/slides/Lab8.pdf"&gt;Lab 8 Updated Slides&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id="original-slides"&gt;Original Slides&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://lums-cs360-web.github.io/lums-cs360/labs/slides/Lab8_Slides.pdf"&gt;Lab 8 Slides&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="lab-8-instructions_1"&gt;Lab 8 Instructions&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://lums-cs360-web.github.io/lums-cs360/labs/slides/Lab8_Instructions.pdf"&gt;Lab 8 Instructions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="lab-8-participation-exercise"&gt;Lab 8 Participation Exercise&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Lab Exercise&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;• Implement has city, delete city, and count cities (same as lab 6), however, this time using TDD.&lt;/p&gt;
&lt;p&gt;• Create each functionality one at a time, creating (and pushing) a test to create a failing build, before adding functionality to make it pass.&lt;/p&gt;
&lt;p&gt;• e.g., create hasCity test, push for failing build, write functionality for hasCity to make passing build. Repeat for delete city and count cities.&lt;/p&gt;
&lt;h3 id="submission"&gt;Submission&lt;/h3&gt;
&lt;p&gt;LMS&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Due Date&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Tuesday 5PM&lt;/p&gt;</content><category term="labs"/><category term="labs"/><category term="policy"/><category term="grading"/></entry><entry><title>Lab 1</title><link href="https://lums-cs360-web.github.io/lums-cs360/labs/lab1.html" rel="alternate"/><published>2024-08-19T00:00:00+05:00</published><updated>2024-08-19T00:00:00+05:00</updated><author><name>LUMS</name></author><id>tag:lums-cs360-web.github.io,2024-08-19:/lums-cs360/labs/lab1.html</id><summary type="html">&lt;p&gt;Dr. Suleman Shahid and Dr. Abdul Ali Bangash, Department of Computing Science, LUMS (2026).
Dr. Hazel Campbell, Department of Computing Science, University of Alberta (2019, 2023, 2024).
Dr. Abram Hindle, Department of Computing Science, University of Alberta (2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023).
Alexander Wong, 2019 …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Dr. Suleman Shahid and Dr. Abdul Ali Bangash, Department of Computing Science, LUMS (2026).
Dr. Hazel Campbell, Department of Computing Science, University of Alberta (2019, 2023, 2024).
Dr. Abram Hindle, Department of Computing Science, University of Alberta (2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023).
Alexander Wong, 2019.
status: published
summary: Lab 1 -- Java, OOP, Android Studio&lt;/p&gt;
&lt;hr&gt;
&lt;div class="toc"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#lab-1-slides"&gt;Lab 1 Slides&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#instructions"&gt;Instructions&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#walkthrough"&gt;Walkthrough&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#lab1-participation-exercise-requirements"&gt;Lab1 Participation Exercise Requirements&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#submission"&gt;Submission&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h3 id="lab-1-slides"&gt;Lab 1 Slides&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://lums-cs360-web.github.io/lums-cs360/labs/slides/Lab1.pdf"&gt;Lab 1 Slides&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="instructions"&gt;Instructions&lt;/h3&gt;
&lt;p&gt;Download and install Android Studio from the official Android website&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.android.com/studio"&gt;https://developer.android.com/studio&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Check for specific installation guide unique to your Operating System&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.android.com/studio/install"&gt;https://developer.android.com/studio/install&lt;/a&gt;&lt;/p&gt;
&lt;h4 id="walkthrough"&gt;Walkthrough&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a new LonelyTwitter project (File &amp;gt; New &amp;gt; New Project &amp;gt; Select "Empty Views Activity"). Make sure that the project language is &lt;strong&gt;Java&lt;/strong&gt;, not Kotlin!&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create Tweet Class (Click &amp;gt; New &amp;gt; Java Class)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;Make attributes (Date date &amp;amp; String message) (use alt+enter (windows) or Option-Enter (Mac) to include/import any packages)&lt;ul&gt;
&lt;li&gt;Note: Access modifiers&lt;ul&gt;
&lt;li&gt;private= class only&lt;/li&gt;
&lt;li&gt;No modifier = within package&lt;/li&gt;
&lt;li&gt;protected = within package and through inheritance&lt;/li&gt;
&lt;li&gt;public = everyone!&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Create two Constructors (one with the only Message and the other with Date+Message as arguments) and use Date = new Date() (current date and time) for the first constructor (the Default value for date).&lt;/li&gt;
&lt;li&gt;Note: Java Object Class (everything extends it, calls its constructor and it has built-in methods like toString())&lt;/li&gt;
&lt;li&gt;Note: the this keyword (message = message doesn't do anything!)&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Make a regular tweet in MainActivity (pass in an empty string)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Getters and setters&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Inheritance&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Make ImportantTweet child class (extends Tweet)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;call super in both of ImportantTweet's constructors&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Now have access to the parent's methods and attributes. except constructors! (try and make an important Tweet)&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="n"&gt;ImportantTweet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="kd"&gt;super&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;Super calls the parent's constructor (there is a hidden call to Object's constructor)&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Change the Tweet to an ImportantTweet in MainActivity&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Abstract Stuff&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Make Tweet Class Abstract&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;public abstract class Tweet { ... }&lt;ul&gt;
&lt;li&gt;Note: Abstract classes cannot be instantiated.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;public abstract Boolean isImportant();&lt;ul&gt;
&lt;li&gt;This is an abstract method, it has no implementation and must be overridden by child classes (to add functionality).&lt;/li&gt;
&lt;li&gt;Note: Abstract methods cannot be called using any objects.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;What if they need to behave differently? @Override isImportant() to create a compile-time check&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You need to override the method in the child class as it is an abstract method in the parent class that has no implementation.&lt;/li&gt;
&lt;li&gt;Overriding the method allows the child class to have its own implementation of the method.&lt;ul&gt;
&lt;li&gt;ex. the Normal Tweet is not important, so it returns false. The ImportantTweet is important, so it returns true.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;The methods in the child classes need to be overridden to behave differently.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Make a NormalTweet class, could have many types of tweets&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;call super in both of  NormalTweet's constructors&lt;/li&gt;
&lt;li&gt;isImportant method should return Boolean.FALSE&lt;/li&gt;
&lt;li&gt;What if we want to use both in our list? (Implicit upcasting)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;ArrayList&lt;Tweet&gt; tweetList = new ArrayList&lt;Tweet&gt;();
tweetList.add(normalTweet);&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Abstract method and base class so all the classes have the isImportant() method&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;An interface can also be used to force the use of some methods&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="kd"&gt;public&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;interface&lt;/span&gt; &lt;span class="nc"&gt;Tweetable&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;     &lt;/span&gt;&lt;span class="kd"&gt;public&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;getMessage&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="w"&gt;     &lt;/span&gt;&lt;span class="kd"&gt;public&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Date&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;getDate&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;Make Tweet implement Tweetable&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="lab1-participation-exercise-requirements"&gt;Lab1 Participation Exercise Requirements&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Add three new model classes to LonelyTwitter: the first should be an abstract base class which represents the current mood. The second and third should be non-abstract classes which represent different moods (Ex: happy, sad, etc.) and inherit from the abstract class.&lt;/li&gt;
&lt;li&gt;Each mood should have a date and getters and setters to access the date.&lt;/li&gt;
&lt;li&gt;A constructor which sets the date to a default and a constructor which takes a date as an argument should be provided. &lt;/li&gt;
&lt;li&gt;Encapsulation should be followed.&lt;/li&gt;
&lt;li&gt;Each mood should have a method which returns a string representing that mood.&lt;/li&gt;
&lt;li&gt;Your new code should have examples of classes, methods, attributes, access modifiers, encapsulation, constructors, inheritance and abstract base classes.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id="submission"&gt;Submission&lt;/h3&gt;
&lt;p&gt;LMS&lt;/p&gt;
&lt;p&gt;Note: Running the project is not necessary.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Due date:&lt;/strong&gt; Check the &lt;a href="https://lums-cs360-web.github.io/lums-cs360/#schedule"&gt;schedule&lt;/a&gt;. (Usually Tuesday 5PM)&lt;/li&gt;
&lt;/ul&gt;</content><category term="labs"/><category term="labs"/><category term="policy"/><category term="grading"/></entry><entry><title>Lab 2 Instructions</title><link href="https://lums-cs360-web.github.io/lums-cs360/labs/lab2_instructions.html" rel="alternate"/><published>2024-01-06T00:00:00+05:00</published><updated>2024-01-06T00:00:00+05:00</updated><author><name>LUMS</name></author><id>tag:lums-cs360-web.github.io,2024-01-06:/lums-cs360/labs/lab2_instructions.html</id><summary type="html">&lt;p&gt;Dr. Suleman Shahid and Dr. Abdul Ali Bangash, Department of Computing Science, LUMS (2026).
Dr. Hazel Campbell, Department of Computing Science, University of Alberta (2019, 2023, 2024).
Dr. Abram Hindle, Department of Computing Science, University of Alberta (2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023).
Alexander Wong, 2019 …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Dr. Suleman Shahid and Dr. Abdul Ali Bangash, Department of Computing Science, LUMS (2026).
Dr. Hazel Campbell, Department of Computing Science, University of Alberta (2019, 2023, 2024).
Dr. Abram Hindle, Department of Computing Science, University of Alberta (2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023).
Alexander Wong, 2019.
status: published
summary: Lab 2 Instructions&lt;/p&gt;
&lt;hr&gt;
&lt;div class="toc"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#lab-2-instructions"&gt;Lab 2 Instructions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#lab-2-participation-exercise"&gt;Lab 2 Participation Exercise&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#submission"&gt;Submission&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h3 id="lab-2-instructions"&gt;Lab 2 Instructions&lt;/h3&gt;
&lt;p&gt;In Lab 2, we'll be doing the following: &lt;/p&gt;
&lt;p&gt;Quick review of &lt;a href="https://lums-cs360-web.github.io/lums-cs360/labs/slides/Lab2_OOP.pdf"&gt;OOP principles&lt;/a&gt;
Android Basics (&lt;a href="https://lums-cs360-web.github.io/lums-cs360/labs/slides/Lab2.pdf"&gt;Lab 2 Android Basics PDF under Lab 2&lt;/a&gt;)
Displaying a list of items using ListView/ListAdapter (&lt;a href="https://lums-cs360-web.github.io/lums-cs360/labs/slides/CMPUT_301_LAB_2_INSTRUCTIONS.pdf"&gt;Lab 2 ListView Demo Example - Instructions PDF under Lab 2&lt;/a&gt;)
Lab Exercise - adding and removing items from ListAdapter (see the Lab 2 Participation Exercise below for more details.)&lt;/p&gt;
&lt;h3 id="lab-2-participation-exercise"&gt;Lab 2 Participation Exercise&lt;/h3&gt;
&lt;p&gt;Task: Modify/Expand ListyCity to allow for the addition of new cities as well as the deletion of existing ones in the ListView. The specifics of the design of this functionality are up to you.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;If you could not attend the labs or do not have the code for ListyCity, follow the instructions in Lab 2 ListView Example - Instructions.&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;Hints:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;You may want to use the OnClickListener methods discussed in the lab.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Ideally you should consider treating the cities as objects, however, in this exercise it may not be necessary.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Here are some screenshots from an example application that demonstrate the required functionality. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Your app does not need to look exactly like this demo！！！&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Press "ADD CITY" then type the name and press "CONFIRM". This adds a new city name to the listview  &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Tap a city name to select it  then press "DELETE CITY" to remove the city from the listview.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img alt="Screen1" src="https://lums-cs360-web.github.io/lums-cs360/labs/img1_lab2_main.jpeg" style="margin: 20px;" width="300"&gt;
&lt;img alt="Screen2" src="https://lums-cs360-web.github.io/lums-cs360/labs/img2_lab2.png" style="margin: 20px;" width="300"&gt;
&lt;img alt="Screen3" src="https://lums-cs360-web.github.io/lums-cs360/labs/img3_lab2.png" style="margin: 20px;" width="300"&gt;
&lt;img alt="Screen4" src="https://lums-cs360-web.github.io/lums-cs360/labs/img4_lab2.jpeg" style="margin: 20px;" width="300"&gt;&lt;/p&gt;
&lt;h3 id="submission"&gt;Submission&lt;/h3&gt;
&lt;p&gt;LMS&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note: Proper completion of this exercise is considered as part of course participation.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Due Date&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Tuesday 5PM&lt;/p&gt;</content><category term="labs"/><category term="labs"/><category term="policy"/><category term="grading"/></entry><entry><title>Lab 3 Instructions</title><link href="https://lums-cs360-web.github.io/lums-cs360/labs/lab3_inst.html" rel="alternate"/><published>2024-01-06T00:00:00+05:00</published><updated>2024-01-06T00:00:00+05:00</updated><author><name>LUMS</name></author><id>tag:lums-cs360-web.github.io,2024-01-06:/lums-cs360/labs/lab3_inst.html</id><summary type="html">&lt;p&gt;Dr. Suleman Shahid and Dr. Abdul Ali Bangash, Department of Computing Science, LUMS (2026).
Dr. Hazel Campbell, Department of Computing Science, University of Alberta (2019, 2023, 2024).
Dr. Abram Hindle, Department of Computing Science, University of Alberta (2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023).
Alexander Wong, 2019 …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Dr. Suleman Shahid and Dr. Abdul Ali Bangash, Department of Computing Science, LUMS (2026).
Dr. Hazel Campbell, Department of Computing Science, University of Alberta (2019, 2023, 2024).
Dr. Abram Hindle, Department of Computing Science, University of Alberta (2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023).
Alexander Wong, 2019.
status: published
summary: Lab 3 Instructions&lt;/p&gt;
&lt;div class="toc"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#lab-3-instructions-what-well-do-in-lab"&gt;Lab 3 Instructions - What we'll do in lab!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#lab-3-participation-exercise"&gt;Lab 3 Participation Exercise&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#submission"&gt;Submission&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h3 id="lab-3-instructions-what-well-do-in-lab"&gt;Lab 3 Instructions - What we'll do in lab!&lt;/h3&gt;
&lt;p&gt;In Lab 3, together we'll go through the following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Going through Lab 3 Slides PDF  (&lt;a href="https://lums-cs360-web.github.io/lums-cs360/labs/slides/Lab3.pdf"&gt;customize ArrayAdapter and Fragments&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Supporting a ListView with items that have multiple views using a custom ArrayAdapter and Using a Fragment to add new cities to ListyCity (&lt;a href="https://lums-cs360-web.github.io/lums-cs360/labs/slides/Lab_3_Instructions_Winter_2023.pdf"&gt;customize ArrayAdapter and Fragments code &amp;amp; walkthrough&lt;/a&gt;)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Download the Starter code &lt;a href="https://lums-cs360-web.github.io/lums-cs360/labs/slides/ListyCityLab3.zip"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Read about Java code conventions (see the &lt;a href="https://lums-cs360-web.github.io/lums-cs360/labs/slides/Code_Conventions_Schoepp.pdf"&gt;Code Conventions (Schoepp) PDF&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Editing existing cities in ListyCity (see the Lab 3 Participation Exercise below for more details)&lt;/p&gt;
&lt;h3 id="lab-3-participation-exercise"&gt;Lab 3 Participation Exercise&lt;/h3&gt;
&lt;p&gt;Note: Proper completion of this exercise is considered as part of course participation.&lt;/p&gt;
&lt;p&gt;Task: Add functionality to ListyCity to allow editing an existing city. The specifics of the design of this functionality are up to you.&lt;/p&gt;
&lt;p&gt;If you could not attend the labs or do not have the code for the updated Lab 3 ListyCity, follow Lab 3 Instructions for ListyCity CustomList and then ListyCity Fragment. You can also download the "Lab 3 Demo" code from eClass.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Your app does not need to look exactly like the screenshots. All that is required is the ability to edit an existing city. You can implement it and make it look like however you want.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="Screen1" src="https://lums-cs360-web.github.io/lums-cs360/labs/img1_lab3.png" style="margin: 20px;" width="300"&gt;
&lt;img alt="Screen2" src="https://lums-cs360-web.github.io/lums-cs360/labs/img2_lab3.png" style="margin: 20px;" width="300"&gt;
&lt;img alt="Screen3" src="https://lums-cs360-web.github.io/lums-cs360/labs/img3_lab3.png" style="margin: 20px;" width="300"&gt;
&lt;img alt="Screen4" src="https://lums-cs360-web.github.io/lums-cs360/labs/img4_lab3.png" style="margin: 20px;" width="300"&gt;&lt;/p&gt;
&lt;p&gt;Hints:
1. &lt;strong&gt;Add setters&lt;/strong&gt; to your City class so that you can modify its name and province.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;You may need to &lt;strong&gt;pass the City object that is clicked in the Activity into the Fragment.&lt;/strong&gt; One way to do this is to &lt;strong&gt;make a constructor for the Fragment that takes in a City,&lt;/strong&gt; and &lt;strong&gt;store the City in the Fragment as an instance variable.&lt;/strong&gt; If you do this, make sure to also add an empty constructor to the Fragment so you can use it when adding a new City.
Another way you can send a City object from the Activity to the Fragment is by adding a &lt;strong&gt;"newInstance" method in the Fragment,&lt;/strong&gt; and use this method to create a new Fragment when editing a City. In this method, you &lt;strong&gt;take in a City and store it in the Fragment's Bundle object&lt;/strong&gt; (if you do this, &lt;strong&gt;make sure that your City class implements the "Serializable" interface, so that it can be saved into the Bundle&lt;/strong&gt;). Later on in your onCreateDialog method, you can &lt;strong&gt;access the Bundle using getArguments() and retrieve the City object there.&lt;/strong&gt; Note that storing data in a Bundle is similar to storing data in an Intent using key-value pairs. (This is the preferred way to do it in Android, because you usually should not have custom constructors for your Fragments. See here for more info).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Example of a newInstance method in AddCityFragment (Hint #3) &lt;/p&gt;
&lt;p&gt;&lt;img alt="Screen5" src="https://lums-cs360-web.github.io/lums-cs360/labs/img5_lab3.png" style="margin: 20px;" width="300"&gt;&lt;/p&gt;
&lt;h3 id="submission"&gt;Submission&lt;/h3&gt;
&lt;p&gt;LMS&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Due Date&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Tuesday 5PM&lt;/p&gt;</content><category term="labs"/><category term="labs"/><category term="policy"/><category term="grading"/></entry><entry><title>Lab 4 Participation Exercise</title><link href="https://lums-cs360-web.github.io/lums-cs360/labs/lab4_part.html" rel="alternate"/><published>2024-01-06T00:00:00+05:00</published><updated>2024-01-06T00:00:00+05:00</updated><author><name>LUMS</name></author><id>tag:lums-cs360-web.github.io,2024-01-06:/lums-cs360/labs/lab4_part.html</id><summary type="html">&lt;p&gt;Dr. Suleman Shahid and Dr. Abdul Ali Bangash, Department of Computing Science, LUMS (2026).
Dr. Hazel Campbell, Department of Computing Science, University of Alberta (2019, 2023, 2024).
Dr. Abram Hindle, Department of Computing Science, University of Alberta (2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023).
Alexander Wong, 2019 …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Dr. Suleman Shahid and Dr. Abdul Ali Bangash, Department of Computing Science, LUMS (2026).
Dr. Hazel Campbell, Department of Computing Science, University of Alberta (2019, 2023, 2024).
Dr. Abram Hindle, Department of Computing Science, University of Alberta (2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023).
Alexander Wong, 2019.
status: published
summary: Lab 4 Participation Exercise&lt;/p&gt;
&lt;div class="toc"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#lab-4-slides"&gt;Lab 4 Slides&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#extra-information"&gt;Extra Information&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#command-line-authentication-to-github"&gt;Command Line Authentication to GitHub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#sensitive-information-and-git"&gt;Sensitive Information and Git&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#what-is-sensitive-information"&gt;What is Sensitive Information&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#lab-4-participation-exercise"&gt;Lab 4 Participation Exercise&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h3 id="lab-4-slides"&gt;Lab 4 Slides&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://lums-cs360-web.github.io/lums-cs360/labs/slides/Lab4.pdf"&gt;Lab 4 Slides&lt;/a&gt;&lt;/p&gt;
&lt;h4 id="extra-information"&gt;Extra Information&lt;/h4&gt;
&lt;h5 id="command-line-authentication-to-github"&gt;Command Line Authentication to GitHub&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;In the slides, authentication with GitHub is done using a token you generate with our account.&lt;/li&gt;
&lt;li&gt;GitHub has a command line tool which makes this process easier, and will generate and manage the token for you.&lt;/li&gt;
&lt;li&gt;GitHub has documentation about how to do this &lt;a href="https://docs.github.com/en/get-started/getting-started-with-git/caching-your-github-credentials-in-git"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;The summary of these steps is to first install the GitHub CLI, which will depend on what operating system you are using. The instructions for installation is &lt;a href="https://github.com/cli/cli#installation"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Then, with the CLI tool installed, run the command &lt;code&gt;gh auth login&lt;/code&gt;. The terminal will guide you through what you need to do. Please make sure to select that you want a &lt;strong&gt;GitHub.com&lt;/strong&gt; account and want to use &lt;strong&gt;SSH&lt;/strong&gt; as your protocol.&lt;/li&gt;
&lt;li&gt;The documentation for the authentication command is located &lt;a href="https://cli.github.com/manual/gh_auth_login"&gt;here&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id="sensitive-information-and-git"&gt;Sensitive Information and Git&lt;/h4&gt;
&lt;h5 id="what-is-sensitive-information"&gt;What is Sensitive Information&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;Git is a version control system which tracks all files, past and current, that you commit to it.&lt;/li&gt;
&lt;li&gt;This means that even if you remove a file or part of a file from your repository, it is still tracked and accessible in the history of your repository.&lt;/li&gt;
&lt;li&gt;As such, if you commit sensitive data, it is very difficult, if not impossible, to remove it.&lt;/li&gt;
&lt;li&gt;Sensitive data includes anything such as ID numbers (like your student ID number), API keys, passwords, etc.&lt;/li&gt;
&lt;li&gt;GitHub as some excellent documentation about best practices for avoiding this, located &lt;a href="https://docs.github.com/en/code-security/getting-started/best-practices-for-preventing-data-leaks-in-your-organization"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;There is also information about removing sensitive information from your repository, but this should only be used in an emergency as it can have severe consequences if not done properly.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="lab-4-participation-exercise"&gt;Lab 4 Participation Exercise&lt;/h3&gt;
&lt;p&gt;This task is for teams. &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;As a team:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create an Organization in GitHub and then create a repository (repo name: Team name) under this organization. &lt;/li&gt;
&lt;li&gt;Add your members as collaborators so the whole team will be able to commit to their branches.&lt;/li&gt;
&lt;li&gt;Create a new Android Studio project (1 project per team) with the same name as the repo name (Team name).&lt;/li&gt;
&lt;li&gt;Your android project folder is your local repository and write all the commands within this repo/directory.&lt;/li&gt;
&lt;li&gt;Use 'git init', 'git add', 'git commit', and 'git push' to push your code to the remote&lt;/li&gt;
&lt;li&gt;Use 'git remote add origin' to add the URL of your remote repo to this local repo.&lt;/li&gt;
&lt;li&gt;The repository should include .gitignore to not include Android Studio settings files (.idea) and the project build folder.&lt;/li&gt;
&lt;li&gt;Create an abstract class Shape (java file) with x and y  integer fields (as a team).&lt;/li&gt;
&lt;li&gt;Commit the change and push it to GitHub.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;As a member, on your local machine:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;(Do not fork) Clone the repository and create a branch with your name (do not use RollNum).&lt;/li&gt;
&lt;li&gt;Create a model class (ex. circle, rectangle, star, etc) (new java file) that extends Shape in your own branch.&lt;/li&gt;
&lt;li&gt;Commit the change and push the branch to GitHub.&lt;/li&gt;
&lt;li&gt;Create a pull request to main in Github.&lt;/li&gt;
&lt;li&gt;Ask another member to merge it.&lt;/li&gt;
&lt;li&gt;Edit the Shape class by adding a color string field. (String color = "blue";) (local your-own branch)&lt;/li&gt;
&lt;li&gt;Commit the change. (Don't push it)&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;As a team:&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Edit the Shape class in the main branch &lt;strong&gt;on GitHub&lt;/strong&gt; by adding a &lt;strong&gt;color&lt;/strong&gt; string field. (String color = "$PUT_YOUR_CHOICE_OF_COLOR";)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;Commit the change in GitHub.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;As a member, on your local machine:&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Pull the main branch from GitHub. You should have a conflict. (&lt;strong&gt;Origin/main -&amp;gt; local your-own&lt;/strong&gt;)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;Resolve the conflict.&lt;/li&gt;
&lt;li&gt;Commit the change.&lt;/li&gt;
&lt;li&gt;Push the branch to GitHub.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Please submit:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Your RollNum&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Link to your branch in the repository at LMS&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Due Date&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Tuesday 5PM&lt;/p&gt;</content><category term="labs"/><category term="labs"/><category term="policy"/><category term="grading"/></entry><entry><title>Lab 4 Participation Exercise Past Notes</title><link href="https://lums-cs360-web.github.io/lums-cs360/labs/past_notes.html" rel="alternate"/><published>2024-01-06T00:00:00+05:00</published><updated>2024-01-06T00:00:00+05:00</updated><author><name>LUMS</name></author><id>tag:lums-cs360-web.github.io,2024-01-06:/lums-cs360/labs/past_notes.html</id><summary type="html">&lt;p&gt;Dr. Suleman Shahid and Dr. Abdul Ali Bangash, Department of Computing Science, LUMS (2026).
Dr. Hazel Campbell, Department of Computing Science, University of Alberta (2019, 2023, 2024).
Dr. Abram Hindle, Department of Computing Science, University of Alberta (2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023).
Alexander Wong, 2019 …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Dr. Suleman Shahid and Dr. Abdul Ali Bangash, Department of Computing Science, LUMS (2026).
Dr. Hazel Campbell, Department of Computing Science, University of Alberta (2019, 2023, 2024).
Dr. Abram Hindle, Department of Computing Science, University of Alberta (2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023).
Alexander Wong, 2019.
status: published
summary: Lab 4 Participation Exercise&lt;/p&gt;
&lt;div class="toc"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#past-lab-git-notes-romansky"&gt;PAST Lab Git Notes (Romansky)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h3 id="past-lab-git-notes-romansky"&gt;PAST Lab Git Notes (Romansky)&lt;/h3&gt;
&lt;p&gt;Preliminaries: Git has two modes it runs in. You can run it as a client which
is what most uses will be. Or, you can run it as a server service. Github
runs git as a service. As a client, you can connect your computer to the
service. The computer offering git as a service is after referred to as a
remote, or remote computer.
You should setup a Github account for this course.
Your Github account should be professional. Please be safe for work!
Your git repositories in this class should all use a FOSS license!
You can read about .gitignore files if you want git to ignore files matching
regular expressions like backup files that end in a ~.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;cmd:&lt;span class="w"&gt; &lt;/span&gt;git&lt;span class="w"&gt; &lt;/span&gt;config&lt;span class="w"&gt; &lt;/span&gt;--global&lt;span class="w"&gt; &lt;/span&gt;user.name&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;yourUserName&amp;quot;&lt;/span&gt;
cmd:&lt;span class="w"&gt; &lt;/span&gt;git&lt;span class="w"&gt; &lt;/span&gt;config&lt;span class="w"&gt; &lt;/span&gt;--global&lt;span class="w"&gt; &lt;/span&gt;user.email&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;your@email.com&amp;quot;&lt;/span&gt;
cmd:&lt;span class="w"&gt; &lt;/span&gt;git&lt;span class="w"&gt; &lt;/span&gt;config&lt;span class="w"&gt; &lt;/span&gt;--global&lt;span class="w"&gt; &lt;/span&gt;core.editor&lt;span class="w"&gt; &lt;/span&gt;nano
cmd:&lt;span class="w"&gt; &lt;/span&gt;git&lt;span class="w"&gt; &lt;/span&gt;config&lt;span class="w"&gt; &lt;/span&gt;--list
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;description: these commands setup your workstation git configurations which
will be associated with each of the file changes you make through git. So, you
should set them before you do anything.&lt;/p&gt;
&lt;p&gt;cmd: git clone &lt;repository address&gt;
description: allows a developer to make a copy of a git repository from a remote
location to the developers local work station.
example: git clone https://github.com/bpython/bpython.git
result: makes a copy of the bpython repo on your computer!&lt;/p&gt;
&lt;p&gt;cmd: git branch &lt;branch-name&gt;
description: create a new code branch. The new branch will contain a copy
of the current branches code.
example: git branch bug444
result: creates a branch named bug444&lt;/p&gt;
&lt;p&gt;cmd: git branch -a
description: shows all current branches associated with the current working
repo. This will list branches that exist on the local work station and the
remote repositories associated with the repo.&lt;/p&gt;
&lt;p&gt;cmd: git push -u origin &lt;branch&gt;
description: this will push a local branch to a given remote git service.
You have to run this command when you make a new local branch that you would
also like to track on the remote server.&lt;/p&gt;
&lt;p&gt;cmd: git add &lt;file&gt;
cmd: git rm &lt;file&gt;
description: add or remove a file from gits file tracking system&lt;/p&gt;
&lt;p&gt;cmd: git status
description: print the current changes that git can track or is not tracking&lt;/p&gt;
&lt;p&gt;cmd: git checkout &lt;branch_name&gt;
cmd: git checkout --branch &lt;branch_name&gt;
description: git checkout lets you change which branch you are working in. The
latter usage changes your current branch and creates a new branch with the
given name.&lt;/p&gt;
&lt;p&gt;cmd: git merge &lt;branch_name&gt;
description: git merge will take a given branch name and merge it into your
current working branch. This is useful if you would like to grab features from
another branch of code.&lt;/p&gt;
&lt;p&gt;cmd: git pull
cmd: git push
description: fetch the latest commits from origin, or push your latest changes
to origin&lt;/p&gt;
&lt;p&gt;Other commands, git remote, git rebase, and git fetch&lt;/p&gt;
&lt;p&gt;Last modified: Tuesday, 3 September 2019, 11:58 PM&lt;/p&gt;</content><category term="labs"/><category term="labs"/><category term="policy"/><category term="grading"/></entry></feed>