Difference between revisions of "BITL-CS2"

From DiLab
Jump to: navigation, search
(Assignments)
(OOP)
 
(48 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{TocRight}}
__NOTOC__
=Introduction to Computer Science II=
Introduction to Computer Science, part 2.


The goal of the course is to learn about software development using object oriented programming, functional programming, and relevant data structures and algorithms. The course is using Scala programming language.
__NOTOC__
<big>
'''Shortcuts:'''
[[#Calendar | Calendar]] |
[[#Assignments | Assignments]] |
[[#Resources | Resources]] |
</big>
[[#{{CURRENTDAY}}.{{CURRENTMONTH}}.{{CURRENTYEAR}} | Today (if there is a class)]]


This page is used as a supplemental resource for the course.
=Introduction=


= Development tools =
What is Computer Science?
== Integrated development environment ==
* From [https://en.wikipedia.org/wiki/Computer_science Wikipedia]:
This course suggests using IntelliJ IDEA for development in Scala.
:: Computer Science is the study of processes that interact with data and that can be represented as data in the form of programs. It enables the use of algorithms to manipulate, store, and communicate digital information.
* [https://www.jetbrains.com/idea/ IntelliJ IDEA] integrated development environment
** [https://www.jetbrains.com/idea/download/ IntelliJ IDEA download link], community edition.


== Git and GitHub version control system and project repository ==
* A video version [https://www.youtube.com/watch?v=DIbtX0GqIA8 from Udacity]
The students will use Git and GitHup as software code repositories. The assignments are submitted via GitHub Education.
[https://git-scm.com/ GIT] version control system
[https://github.com/ GitHub]


[https://rogerdudler.github.io/git-guide/ A simpleguide for getting started with git] - no deep *hit
=Administrative information=
Course Syllabus tba
<!-- [https://www.dropbox.com/s/aqbvmka49h9xowp/Syllabus.pdf?raw=1 is available here] -->


== Build systems, Maven ==
Communication:
* [https://www.baeldung.com/ant-maven-gradle Comparison of And, Maven, and Gradle] build systems.
* via slack: workspace name: bitl-cs2-2019
* via email: use instructor's email address for personal communication
* office hours: by appt.


== Scala ==
=Calendar=
== Introduction to Scala ==
* [https://www.scala-lang.org/ Scala programming language]
* [https://www.geeksforgeeks.org/scala-programming-language/ About Scala] at Geeks for Geeks.
:: ''"Scala is a general-purpose, high-level, multi-paradigm programming language. It is a pure object-oriented programming anguage which also provides support to the functional programming approach. Scala programs can convert to bytecodes and can un on the JVM (Java Virtual Machine)..."''


* [https://docs.scala-lang.org/tour/packages-and-imports.html Packages and imports]
{| border=1 cellspacing=0 cellpadding=4
|-
! Date
! Topic
! Assignments, tests, deliverables
|-
|
==== 06.01.20 ====
|
'''Course Introduction'''


== Data types ==
* [https://docs.scala-lang.org/tutorials/FAQ/collections.html Data types in Scala]
* [https://en.wikipedia.org/wiki/Double-precision_floating-point_format About Double precision data types] in general


== OOP ==
Introduction to the course. [https://www.dropbox.com/s/gix0cxm82b1fgxj/Syllabus_CS2_2020-1.pdf?raw=1 Syllabus].
* [https://stackify.com/oops-concepts-in-java/ OOP Concepts in Java] - at Stackify
* [https://www.baeldung.com/scala/oop-intro OOP intro in Scala] - at Baeldung
Polymorphism
* [https://www.baeldung.com/scala/polymorphism Polymorphism in Scala] - at Baeldung
* [https://www.geeksforgeeks.org/scala-polymorphism/ Polymorphism in Scala] - at Geeksforgeeks
* [https://www.geeksforgeeks.org/polymorphism-in-python/ Polymorphism in Python] - at Geeksforgeeks


== MVC ==
|
* [https://www.youtube.com/watch?v=o_TH-Y78tt4&t=1667s The Principles of Clean Architecture by Uncle Bob Martin]

|-
|
==== 08.01.20 ====
|
'''IDE Setup. Scala Introduction'''
* [https://www.dropbox.com/s/mgo4xacl5gfheol/L01_Scala_intro_1.pdf?raw=1 Slides]

'''Objective''': Setup your IDE (IntelliJ) for Scala and Python development on your laptop and write a simple Scala program.

'''Reading/Reference''':
* [https://docs.scala-lang.org/tour/basics.html Scala Basics] - Except for classes, cases classes, and traits, for now.
* [http://www.tutorialspoint.com/scala/scala_if_else.htm Scala Conditionals]
* [https://www.tutorialspoint.com/scala/scala_data_types.htm Scala: Basic Types] - We'll primarily use Int, Double, Char, String, Boolean, and Unit

|

|-
|
==== 10.01.20 ====
|
'''Scala Types and Reading Files'''
* [https://www.dropbox.com/s/i1x8qeldz4skb9f/L02_Scala_intro_2.pdf?raw=1 Slides]

'''Objective''': Write a program that can read the lines of a file in a strongly typed language (Scala) and store values in a data structure

'''Reading/Reference''':
* [https://www.tutorialspoint.com/scala/scala_strings.htm Scala: String]
* [https://www.scala-lang.org/api/current/scala/collection/StringOps.html#split(separator:Char):Array%5BString%5D Scala: String.split] - And many other String methods you may find useful
* [https://www.tutorialspoint.com/scala/scala_for_loop.htm Scala: For loop]
* [http://otfried.org/scala/reading_files.html Scala: Reading Files]
* [https://www.tutorialspoint.com/scala/scala_arrays.htm Scala: Array] - A sequential data structure
* [https://www.tutorialspoint.com/scala/scala_lists.htm Scala: List] - A sequential data structure. You can use either Array or List as you prefer in most cases. We will explore the differences later in the course
* [https://www.tutorialspoint.com/scala/scala_maps.htm Scala: Map] - A key-value store

|

|-
|
==== 13.01.20 ====
|
'''Unit Testing'''
* [https://www.dropbox.com/s/7zeact2v8k9a1y7/L03_Unit_testing.pdf?raw=1 Slides]

'''Objective''': Test your own code without needing AutoLab

'''Reading/Reference''':
* [https://maven.apache.org/ Maven Homepage] - For reference only
* [https://www.dropbox.com/s/8z0k2pjjq8nij9c/pom.xml?dl=1 Example pom.xml] - You can copy this into your projects and expand it when needed
* [http://www.scalatest.org/ Scalatest Homepage] - For reference only
* [http://www.scalatest.org/getting_started_with_fun_suite Scalatest FunSuite Example] - A practical unit testing example""

|
* [https://docs.google.com/document/d/1SSlynEeirnk10dXY4-cGDysqfS673y8qNHBe8e2KpZE/edit?usp=sharing '''Lab Activity 1''']

|-
|
==== 15.01.20 ====
|
'''Practice Unit Testing'''


|

|-
|
==== 17.01.20 ====
|
'''Classes and Objects'''
* [https://www.dropbox.com/s/wzljvj7tisf97gu/L04_Classes.pdf?raw=1 Slides]

'''Objective''': Define and use classes

'''Reading/Reference''':
* [https://en.wikipedia.org/wiki/Class_(computer_programming) Wikipedia: Class] - Overview and reference (More detail than we'll cover in lecture)
* [https://docs.scala-lang.org/tour/classes.html Scala: Class] - Application of Classes using Scala syntax
* [https://www.w3schools.com/python/python_classes.asp Python: Class] - Application of Classes using Python syntax
* [https://www.scala-lang.org/api/2.12.9/ Scala API] - Reference for all Scala packages/classes/objects""

|

|-
|
==== 20.01.20 ====
|
'''Model of Execution 1'''
* [https://www.dropbox.com/s/4ktq1dldxyt1j7v/L05_Execution_1.pdf?raw=1 Slides]

'''Objective''': Describe how the program stack and heap store values in your program

'''Reading/Reference''':
* [https://medium.com/@nickteixeira/stack-vs-heap-whats-the-difference-and-why-should-i-care-5abc78da1a88 Program Stack and Heap]
* [https://www.jetbrains.com/help/idea/run-debug-and-test-scala.html#debug_scala_code Debugging in IntelliJ]""

|
* [https://docs.google.com/document/d/1ZV0MK5Gud959EAQVAUNWxAy7X09fQso0LA0o8oCAtnw/edit?usp=sharing '''Lab Activity 2''']

|-
|
==== 22.01.20 ====
|
'''Model of Execution 2'''
* [https://www.dropbox.com/s/hgiwb9r170usv34/L06_Execution_2.pdf?raw=1 Slides]

'''Objective''': Use a debugger to see the state of your program during execution

'''Reading/Reference''':
* [https://medium.com/basecs/a-deeper-inspection-into-compilation-and-interpretation-d98952ebc842 Compilers vs. Interpreters] - Scala/Java/C++ are compiled while Python/JavaScript are interpreted. What does this mean?
* [https://www.jetbrains.com/help/idea/run-debug-and-test-scala.html#debug_scala_code Debugging in IntelliJ]""

|

|-
|
==== 24.01.20 ====
|
'''Physics Engine Quiz'''


|
* '''HW1: Physics Engine'''

|-
|
==== 27.01.20 ====
|
'''Inheritance'''
* [https://www.dropbox.com/s/tc0hdxyhn2e78ej/L07_Inheritance.pdf?raw=1 Slides]

'''Objective''': You will be able to write abstract classes and concreted classes that inherent an abstract class

'''Reading/Reference''':
* [https://www.geeksforgeeks.org/inheritance-in-scala/ Inheritance in Scala]
* [https://www.digitalocean.com/community/tutorials/understanding-class-inheritance-in-python-3 Inheritance in Python]""

|
* '''Lab Activity 3'''

|-
|
==== 29.01.20 ====
|
'''Level 1 Quiz'''


|
* '''Level 1 Quiz'''

|-
|
==== 31.01.20 ====
|
'''Polymorphism and JSON'''
* [https://www.dropbox.com/s/zimg0h83faqu6uy/L08_Polymorphism.pdf?raw=1 Slides]

'''Objective''': You will study polymorphism and apply it to use JSON in a strongly typed language

'''Reading/Reference''':
* [https://beginnersbook.com/2013/03/oops-in-java-encapsulation-inheritance-polymorphism-abstraction/ OOP Overview]
* [https://overiq.com/python-101/inheritance-and-polymorphism-in-python/ Polymorphism in Python]
* [https://dev.to/jmcclell/inheritance-vs-generics-vs-typeclasses-in-scala-20op Polymorphism in Scala] - Just the Subtype Polymorphism (Inheritance) section
* [https://www.playframework.com/documentation/2.7.x/ScalaJson Play JSON library documentation]
* [https://mvnrepository.com/artifact/com.typesafe.play/play-json_2.12/2.7.1 Play JSON Maven artifact]
* [https://github.com/scalaj/scalaj-http scalaj-http library4]""

|

|-
|
==== 03.02.20 ====
|
'''Design Pattern: State Pattern 1'''

'''Objective''': You will gain experience with the state design pattern to dynamically change the behavior of an object

'''Reading/Reference''':
* [https://en.wikipedia.org/wiki/State_pattern State Pattern on Wikipedia]

|
* '''Project Demo 1'''

|-
|
==== 05.02.20 ====
|
'''Design Pattern: State Pattern 2'''

'''Objective''': Gain more familiarity with the state design pattern by reviewing the Jumper code

|

|-
|
==== 07.02.20 ====
|
'''Design Pattern: State Pattern 3'''

'''Objective''': Gain more familiarity with the state design pattern

|

|-
|
==== 10.02.20 ====
|
'''GUI'''

'''Objective''': Build desktop GUIs

'''Reading/Reference''':
* [http://www.scalafx.org/ ScalaFX Homepage] - Adapter for JavaFX in Scala
* [https://openjfx.io/index.html JavaFX Homepage]
* [http://sjgpsoft.blogspot.com/2016/02/scalafx-button-positioning-with-hbox.html#more ScalaFX Button Example]
* [https://www.tutorialspoint.com/javafx/javafx_2d_shapes.htm JavaFX 2D Shapes]
* [https://www.youtube.com/watch?v=63Utq7Ht-w0&index=1&list=PLLMXbkbDbVt__x5VUQHbI8g25Phxi2yBy ScalaFX Videos] - Playlist by Mark Lewis
* [https://www.tutorialspoint.com/javafx/javafx_3d_shapes.htm JavaFX 3D Shapes] - Optional, but helpful if you're making a 3D app for your project

|
* '''Lab Activity 4'''

|-
|
==== 12.02.20 ====
|
'''Design Architecture: MVC'''

'''Objective''': Become familiar with the MVC architecture pattern and its benefits

'''Reading/Reference''':
* [https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller MVC on Wikipedia]
* [https://www.codecademy.com/articles/mvc MVC Analogies]

|

|-
|
==== 14.02.20 ====
|
'''Calculator Quiz'''


|
* '''HW2: Calculator'''

|-
|
==== 17.02.20 ====
|
'''Actors Introduction'''

'''Objective''': Write programs with multiple pieces of code executing at the same time

'''Reading/Reference''':
* [https://mvnrepository.com/artifact/com.typesafe.akka/akka-actor_2.12/2.5.22 Akka Library]
* [https://doc.akka.io/docs/akka/2.5.22/actors.html?language=scala Akka Actors]
* [https://docs.scala-lang.org/tour/case-classes.html Case Classes]
* [https://en.wikipedia.org/wiki/Actor_model Actors Model (Wikipedia)]

|
* '''Lab Activity 5'''

|-
|
==== 19.02.20 ====
|
'''Level 2 Quiz'''


|
* '''Level 2 Quiz'''

|-
|
==== 21.02.20 ====
|
'''Testing Actors and Database Connections'''

'''Objective''': Write unit tests for actors and connect to a MySQL server

'''Reading/Reference''':
* [https://doc.akka.io/docs/akka/current/testing.html?language=scala Testing Actors]
* [https://dev.mysql.com/downloads/mysql/ MySQL download page]
* [https://alvinalexander.com/scala/scala-jdbc-connection-mysql-sql-select-example Connecting to MySQL]
* [https://www.w3schools.com/sql/default.asp SQL Tutorial] -
** [https://www.w3schools.com/sql/sql_create_table.asp Create Table]
** [https://www.w3schools.com/sql/sql_insert.asp Insert Into]
** [https://www.w3schools.com/sql/sql_select.asp Select]
** [https://www.w3schools.com/sql/sql_where.asp Where]
** [https://www.w3schools.com/sql/sql_update.asp Update]

|

|-
|
==== 24.02.20 ====
|
'''Web Sockets 1'''

'''Objective''': Enable 2-way communication between the browser and web server

'''Reading/Reference''':
* [https://github.com/mrniko/netty-socketio Scala socket.io Server]
* [https://en.wikipedia.org/wiki/WebSocket Web Sockets (Wikipedia)]

|
* '''Project Demo 2'''

|-
|
==== 26.02.20 ====
|
'''Web Sockets 2'''

'''Objective''': Connect a Scala front end to a web socket server

'''Reading/Reference''':
* [https://github.com/socketio/socket.io-client-java Socket IO Library - Scala]
* [https://socket.io/docs/client-api/ socket.io Client Docs]

|

|-
|
==== 28.02.20 ====
|
'''Actors Application with Web Sockets'''


|

|-
|
==== 02.03.20 ====
|
'''MMO Architecture 1'''

'''Objective''': See an example using the MMO architecture form this class

|
* '''Lab Activity 6'''

|-
|
==== 04.03.20 ====
|
'''MMO Architecture 2'''

'''Objective''': Explore the MMO architecture applied to the course project

|

|-
|
==== 06.03.20 ====
|
'''Clicker Quiz'''


|
* '''HW3: Clicker'''

|-
|
==== 09.03.20 ====
|
'''Custom Sorting with First-Order Functions'''

'''Objective''': Explore custom sorting in scala and gain experience with function and type parameters

'''Reading/Reference''':
* [https://alvinalexander.com/scala/how-sort-scala-sequences-seq-list-array-buffer-vector-ordering-ordered Custom Sorting - Scala]
* [https://en.wikipedia.org/wiki/Selection_sort Selection Sort on Wikipedia]
* [https://docs.scala-lang.org/tour/polymorphic-methods.html Type Parameters - Scala]

|
* '''Lab Activity 7'''

|-
|
==== 11.03.20 ====
|
'''Level 3 Quiz'''


|
* '''Level 3 Quiz'''

|-
|
==== 13.03.20 ====
|
'''Merge Sort and Recursion'''

'''Objective''': Gain an understanding of recursion combined with first-order functions and type parameters

'''Reading/Reference''':
* [https://www.tutorialspoint.com/data_structures_algorithms/merge_sort_algorithm.htm Merge Sort Algorithm]
* [https://javascript.info/recursion Recursion - Also discussed Linked-List, which is the next lecture]
* [https://www.scala-exercises.org/scala_tutorial/tail_recursion Tail Recursion]
* [https://docs.scala-lang.org/tour/higher-order-functions.html Higher-Order Functions - Scala]

|

|-
|
==== 16.03.20 ====
|
'''Linked List'''

'''Objective''': Understand the structure of a linked list

'''Reading/Reference''':
* [https://www.tutorialspoint.com/data_structures_algorithms/linked_list_algorithms.htm Linked List]
* [https://www.interviewbit.com/tutorial/arrays-vs-linked-lists/ Array v. Linked List]

|
* '''Lab Activity 8'''

|-
|
==== 18.03.20 ====
|
'''Linked List Algorithms'''

'''Objective''': Explore how various operations are performed on a linked list

'''Reading/Reference''':
* [https://www.tutorialspoint.com/data_structures_algorithms/linked_list_algorithms.htm Algorithm Examples]
* [https://www.codementor.io/codementorteam/a-comprehensive-guide-to-implementation-of-singly-linked-list-using-c_plus_plus-ondlm5azr Linked List and Operations] - Code is in C++

|

|-
|
==== 20.03.20 ====
|
'''Stack and Queue'''

'''Objective''': Use a linked list to implement the functionality of a stack and queue

'''Reading/Reference''':
* [https://www.tutorialspoint.com/data_structures_algorithms/stack_algorithm.htm Stack]
* [https://www.tutorialspoint.com/data_structures_algorithms/dsa_queue.htm Queue]

|

|-
|
==== 23.03.20 ====
|
'''Binary Tree and Traversals'''

'''Objective''': Gain familiarity with the structure of binary trees and how to traverse existing trees

'''Reading/Reference''':
* [https://www.tutorialspoint.com/data_structures_algorithms/tree_data_structure.htm Trees]
* [https://en.wikipedia.org/wiki/Tree_traversal Tree Traversals (Wikipedia)]
* [https://en.wikipedia.org/wiki/Binary_expression_tree Expression Trees (Wikipedia)]
* [https://www.101computing.net/binary-expression-trees/ Expression Tree Examples]
* [https://www.hackerrank.com/contests/data-structure-tasks-binary-tree-union-find/challenges/binary-expression-tree Hacker Rank Question]

|
* '''Lab Activity 9'''

|-
|
==== 25.03.20 ====
|
'''Binary Search Tree'''

'''Objective''': Explore an application of binary trees by using them for searching and sorting

'''Reading/Reference''':
* [https://www.tutorialspoint.com/data_structures_algorithms/binary_search_tree.htm BST]

|

|-
|
==== 27.03.20 ====
|
'''Genetic Algorithm Quiz'''


|
* '''HW4: Genetic Algorithm'''

|-
|
==== 30.03.20 ====
|
'''Graph Representations and Breath-First Search'''

'''Objective''': Learn how to represent a graph in code and work with that representation

'''Reading/Reference''':
* [https://www.tutorialspoint.com/data_structures_algorithms/graph_data_structure.htm Graph Overview]
* [https://en.wikipedia.org/wiki/Adjacency_list Adjacency List]
* [https://www.tutorialspoint.com/data_structures_algorithms/breadth_first_traversal.htm BFS Overview]

|
* '''Project Demo 3'''

|-
|
==== 01.04.20 ====
|
'''Level 4 Quiz'''


|
* '''Level 4 Quiz'''

|-
|
==== 03.04.20 ====
|
'''Pathfinding with Breath-First Search'''

'''Objective''': Find the shortest path between two nodes using BFS

|

|-
|
==== 06.04.20 ====
|
'''Review and Examples'''


|
* '''Project Demo 3 (alt)'''

|-
|
==== 08.04.20 ====
|
'''MMO Quiz'''


|
* '''HW5: MMO'''

|-
|
==== 10.04.20 ====
|
'''Holiday'''


|

|-
|
==== 13.04.20 ====
|
'''Holiday'''


|

|-
|
==== 15.04.20 ====
|
'''Consultation week'''


|

|-
|
==== 17.04.20 ====
|
'''Consultation week'''


|
* '''HWb: Bonus Homework'''

|-
|
==== 20.04.20 ====
|
'''(Exam week)'''


|

|-
|
==== 22.04.20 ====
|
'''Exam week - Final Exam'''


|
* '''Final Exam'''

|-
|
==== 24.04.20 ====
|
'''(Exam week)'''


|

|-
|
|}

=Assignments=
Assignment due dates are in the calendar.

Assignments are announced by the course Slack channel.

=Resources=

===GitHub===
* [https://idratherbewriting.com/learnapidoc/pubapis_github_desktop_client.html Tutorial about GitHub Desktop]

===Scala===
* [https://docs.scala-lang.org/tour/basics.html Scala Basics] - (Except for classes, cases classes, and traits which will be covered later in the semester)
* [http://www.tutorialspoint.com/scala/scala_if_else.htm Scala Conditionals]
* [https://www.tutorialspoint.com/scala/scala_data_types.htm Scala: Basic Types] - We'll primarily use Int, Double, Char, String, Boolean, and Unit

===IDE===
* [https://docs.scala-lang.org/getting-started-intellij-track/getting-started-with-scala-in-intellij.html Get started with Scala in IntelliJ]

===Algorithms===
* [https://www.youtube.com/watch?v=tPtvKYinUzc Visualisations of different sorting algorithms]

===Misc===
* [https://app.sli.do/event/wkqtbios/live/questions Slido for Q&A sessions]

Latest revision as of 08:59, 30 January 2023

Introduction to Computer Science, part 2.

The goal of the course is to learn about software development using object oriented programming, functional programming, and relevant data structures and algorithms. The course is using Scala programming language.

This page is used as a supplemental resource for the course.

Development tools

Integrated development environment

This course suggests using IntelliJ IDEA for development in Scala.

Git and GitHub version control system and project repository

The students will use Git and GitHup as software code repositories. The assignments are submitted via GitHub Education. GIT version control system GitHub

A simpleguide for getting started with git - no deep *hit

Build systems, Maven

Scala

Introduction to Scala

"Scala is a general-purpose, high-level, multi-paradigm programming language. It is a pure object-oriented programming anguage which also provides support to the functional programming approach. Scala programs can convert to bytecodes and can un on the JVM (Java Virtual Machine)..."

Data types

OOP

Polymorphism

MVC