diff --git a/.gitignore b/.gitignore index 906662f..69ddb89 100644 --- a/.gitignore +++ b/.gitignore @@ -403,3 +403,5 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +.idea/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..ee29aa0 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,34 @@ +variables: + CI_PROJECT_DIR: "." + CI_REGISTRY_IMAGE: hub.ducoterra.net/ducoterra/java-docs-2020 + DEPLOY: javadocs2020 + +stages: + - build + - deploy + +build: + only: + variables: + - $CI_COMMIT_TAG + stage: build + image: + name: gcr.io/kaniko-project/executor:debug + entrypoint: [""] + script: + - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG + +deploy: + stage: deploy + only: + variables: + - $CI_COMMIT_TAG + image: + name: debian:10 + entrypoint: [""] + script: + - apt -qq update >> /dev/null && apt -qq install -y curl gettext >> /dev/null + - curl -o /usr/bin/kubectl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl + - chmod +x /usr/bin/kubectl + - curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash + - helm upgrade --install $DEPLOY ./helm --set image=$CI_REGISTRY_IMAGE --set tag=$CI_COMMIT_TAG diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7bbc99d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM python:3.9.0 as BUILD +COPY requirements.txt . +RUN pip install -r requirements.txt +COPY mkdocs.yml . +COPY docs docs +RUN mkdocs build + +FROM nginx:latest +COPY --from=BUILD /site/ /usr/share/nginx/html/ diff --git a/README.md b/README.md index fba4bd4..4a8501c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,10 @@ -# java-2020-class +# Docs +```bash +ffmpeg -i in.mov -filter:v "setpts=0.5*PTS" out.gif +``` + +```bash +git config --global pager.branch false +git config --global pager.tag false +``` diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..4f09b3b --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,8 @@ +version: '3' + +services: + docs: + image: hub.ducoterra.net/ducoterra/java-docs-2020:latest + build: . + ports: + - 8080:80 \ No newline at end of file diff --git a/docs/day0.md b/docs/day0.md new file mode 100644 index 0000000..e904aa6 --- /dev/null +++ b/docs/day0.md @@ -0,0 +1,162 @@ +# Day 0 + +When you start programming half the battle is getting your bearings. Suddenly it matters where you put your files. You need to know where you home directory is, you need to understand file permissions, you need to understand what a file actually *is*. Trying to program without first learning about *the thing you are programming* will cause headache. + +Fortunately we can do some things to make your life easier. We can install an **Integrated Development Environment (IDE):** a program that lets you visualize your files and folders and quickly switch between them. We can install a **version control system (VCS)** that will let you "snapshot" your code and save it to the cloud so you never lose it. We can organize our project to be repeatable, and more importantly, un-loseable. + +## I have a Windows PC + +(or skip to [I have a Mac](#i-have-a-mac)) + +### Install Git (windows) + +Git is a version control program, but you can think of it as your best friend in the cold, dark world of data loss. Git will make sure you don't lose progress. It lets you save your code at various stages and revert to previous saves if you need to. Like mentioned above, it takes a "snapshot" of your code at that point in time. + +1. Head to + +2. Click Download + + ![git_download](img/day0/git_download_windows.png) + +3. Run through the default install process + + +### Install Java (windows) + +1. Head to + +2. Under the **Developer Tools** section, check the **JDK (AdoptOpenJDK) x64 8** option and then **Get Your Ninite** + + ![download_for_windows](img/day0/ninite_download_for_windows.png) + +3. Once the file has finished downloading, click on the installer to Run through the install process. + + ![java_windows_install](img/day0/ninite_install_for_windows.png) + + + +### Add Java to path (windows) + +1. Open the File Explorer, and navigate to `C:\Program Files\AdoptOpenJDK\jdk-8.x.xxx\bin` + +2. Copy the path to your clipboard + + ![java_windows_path](img/day0/java_windows_path.png) + +3. Now click the Windows Start Button + +4. Start typing **environment** + +5. Click on **Enter the System Environment variables** + + ![widnows_edit_env_vars](img/day0/windows_env_var.png) + +6. Click on **Environment Variables..** + +7. Under the *System Variables* section, find and click the **Path** entry and then click **Edit** + + ![windows_sys_env_var_path](img/day0/windows_path_edit.png) + +8. Click **New** and paste in the path copied in Step 1 and click **OK** + + ![windows_path_edit](img/day0/windows_path_edit2.png) + +9. Reboot your computer + + +### Install BlueJ (windows) + +Your most important tool as a programmer is a proper editor. It should offer you a wide selection of tools but get out of your way when you don't need it +. While there are manny advanced editors and IDEs out in the wild, its always good to start with the basics, to get a proper grasp and understanding of the + language. + +1. Head to + +2. Click on the download link + + ![BlueJ_download](img/day0/bluej_download.png) + +3. Run through the installer, select default options + + ![bluej_install](img/day0/windows_bluej_install.gif) + +4. Open BlueJ + + ![bluej_open](img/day0/bluej_open.png) + + +### Create a "Projects" folder (windows) + +I keep all my projects in a folder called "Projects" in my home directory. On Windows this is at `C:\Users\\Projects`. Create this folder now. Bookmark it, put it in your favorites, don't lose it. + +1. In BlueJ, go to the **Project** menu and click on **New Project** + +2. For the Name, enter `java_game`, for the Location, select the `Projects` folder you created in the step above. + + ![ctrl_ko](img/day0/windows_create_bluej_project2.gif) + + +## I have a Mac + +### Install Git (mac) + +Git is a version control program, but you can think of it as your best friend in the cold, dark world of data loss. Git will make sure you don't lose progress. It lets you save your code at various stages and revert to previous saves if you need to. + +1. Head to + +2. Click Download + + ![git_download](img/day0/git_download_mac.png) + +3. Run through the default install process + +### Install Python (mac) + +1. Head to + +2. Select **OpenJDK 8 (LTS)** for version, and **HotSpot** for JVM and click the **Latest Release** download button + + ![download_java_mac](img/day0/mac_install_java.png) + +3. Follow the standard install process + + ![java_install_for_mac](img/day0/mac_bluej_install2.gif) + +### Install BlueJ (mac) + +Your most important tool as a programmer is a proper editor. It should offer you a wide selection of tools but get out of your way when you don't need it +. While there are manny advanced editors and IDEs out in the wild, its always good to start with the basics, to get a proper grasp and understanding of the + language. + + +Your most important tool as a programmer is a proper editor. It should offer you a wide selection of tools but get out of your way when you don't need it +. While there are manny advanced editors and IDEs out in the wild, its always good to start with the basics, to get a proper grasp and understanding of the + language. + +1. Head to + +2. Click on the download link + + ![BlueJ_download](img/day0/bluej_download_mac.png) + +3. Click on the BlueJ mac zip that was downloaded to automatically unzip the file + +4. In the BlueJ folder that was just created, drag `BlueJ.app` to your `Applications` folder + + ![BlueJ_Drag](img/day0/mac_bluej_drag.gif) + +5. Open BlueJ + + ![bluej_open](img/day0/bluej_open_mac.png) + +### Create a "Projects" folder (mac) + +I keep all my projects in a folder called "Projects" in my home directory. On Windows this is at `/Users//Projects`. Create this folder now. Bookmark it, put it in your favorites, don't lose it. + +1. In BlueJ, go to the **Project** menu and click on **New Project** + + ![bluej_project_new_mac](img/day0/bluej_project_new_mac.png) + +2. For the Name, enter `java_game`, for the Location, select the `Projects` folder you created in the step above. + + ![bluej_choose_project](img/day0/bluej_choose_project2.gif) \ No newline at end of file diff --git a/docs/day1.md b/docs/day1.md new file mode 100644 index 0000000..367823d --- /dev/null +++ b/docs/day1.md @@ -0,0 +1,258 @@ +# Day 1 + +Before we can dive into our web project we have to cover some Python basics. Let's talk about writing a python program. + +## The Interactive Python Prompt + +1. Make sure you have a (venv) to the left of your terminal cursor. Type `python` and press enter. + + **NOTE**: This is not a terminal! You cannot run your django server from here. Before you can do things in the terminal you must exit by typing `exit()`! + + ![python_prompt](img/day1/python_prompt.gif) + +2. Type `1+1` and press enter. You should see `2` returned. As long as you see the `>>>` to the left of your cursor you can type any python code you want and press enter to execute it. + +3. Type `x=1` and press enter. Nothing should return. + +4. Type `x` and press enter. You should see `1` return. We've give `x` the value of `1` + +5. Type `x+1` and press enter. You should see `2` returned just like `1+1` above. + +6. Type `x=3` and press enter. Nothing should return. + +7. Type `x` and press enter. You should see `3` return. Variables in Python can be reassigned to anything else. + +8. Type `x="hello"` and press enter. Nothing should return. + +9. Type `x` and press enter. You should see `hello` printed to the screen. Variables in python do not have a "type" - they can be integers, strings, floats, etc and can switch between them at will. + +10. Type `my_name = ""` and press enter. Nothing should return + +11. Type `my_name` and press enter. You should see your name printed to your terminal. `my_name` is a much better variable name than `x`. It describes the thing it stores. Please use variable names that are descriptive. + +12. Type `my_coordinates = (1,2)` and press enter. Nothing should return. + +13. Type `my_coordinates` and press enter. `(1,2)` should return. This is called a `tuple`. It's useful for storing multiple points of data. + +14. Type `address = (123, "lane ave", "Columbus", "OH", 43212)` and press enter. Nothing should return + +15. Type `address` and press enter. You should see the address print to the terminal. Tuples can hold multiple types of data - 123 is a number and "lane ave" is a string. + +16. Type `len(address)` and press enter. You should see `5` printed to the terminal. There are 5 "things" in the tuple: + + (1) `123` + + (2) `"lane ave"` + + (3) `**"Columbus"` + + (4) `"OH"` + + (5) `43212` + +17. Type `address[0]` and press enter. You should see `123` printed to the terminal. You just accessed the first item in the tuple. Tuples and other collections start at 0 and count up. + +18. Type `address[1]` and press enter. You should see `"lane ave"` print to the terminal. You just accessed the second item in the tuple + +19. Type `vocabulary = {"apple": "the usually round, red or yellow, edible fruit of a small tree, Malus sylvestris, of the rose family.", "banana": "a tropical plant of the genus Musa, certain species of which are cultivated for their nutritious fruit."}` and press enter. Nothing should return. + +20. Type `vocabulary` and press enter. {"apple": ...} should print to the terminal. This is called a dictionary. + +21. Type `vocabulary["apple"]` and press enter. `'the usually round, red or yellow, edible fruit of a small tree, Malus sylvestris, of the rose family.'` should print to the terminal. You just access the definition of apple. Much like tuples can be accessed with `address[0]` or `address[1]`, dictionary values can be accessed by supplying the keyword, or key for short. + +22. Type `exit()` and press enter. You should no longer see `>>>` to the left of the cursor. + +## A Python Program + +1. Create a new file called `my_program.py` by clicking the "add file" icon in the top left of VSCode. + + ![add_file](img/day1/add_file.png) + + ![name_file](img/day1/name_file.png) + + ![open_file](img/day1/open_file.png) + +2. In this file type `print('hello, world!')` and save with ++ctrl++ + S + + ![type_hw](img/day1/type_hw.png) + +3. In the terminal type `python my_program.py` and press enter. You should see `hello, world!` printed to the terminal. + + ![run_hw](img/day1/run_hw.gif) + +4. Congratulations! You ran your first python file. Just like the python command prompt above, running `python ` on a file with python code in it will execute that python code. Now we can run multiple lines of python at once! + +5. Below `print('hello, world!')` type `print('goodbye!)` + + ![print_goodbye](img/day1/print_goodbye.png) + +6. Below `print('goodbye')` type + + ```python + x = 1 + y = 2 + print(x + y) + my_name = "" + print(my_name) + ``` + + ![type_more_code](img/day1/type_more_code.png) + +7. Save the file with ++ctrl++ + S. In your terminal type `python myprogram.py` and press enter. You should see + + ```bash + hello, world! + goodbye! + 3 + Reese + ``` + + printed to the terminal + +8. This is out of order. We want to print "goodbye" last. Let's fix that with functions. + +9. Above `print('hello, world!')` type `def print_hello():` + + ![def_ph](img/day1/def_ph.png) + +10. Indent `print('hello, world!')` by pressing ++tab++ + + ![indent_hw](img/day1/indent_hw.png) + +11. Give 'goodbye' the same treatment. This time type `def print_goodbye():` + + ![print_gb](img/day1/print_gb.png) + +12. Finally add `def middle_stuff():` above the remaining cod + + ![middle_stuff](img/day1/middle_stuff.png) + +13. Save the file with ++ctrl++ + S. Now type `python my_program.py` in the terminal and press enter. Nothing will return. + + ![functions_in_order](img/day1/functions_in_order.png) + +14. We've given our snippets of code "names" by adding a "def" above them. These are called functions. We can call them in any order we want. Let's call them in the correct order by using their names. Add the following to the bottom of my_program.py + + ```python + print_hello() + middle_stuff() + print_goodbye() + ``` + +15. Type `python my_program.py` in the terminal and press enter. Now everything prints in order! + + ![in_order](img/day1/in_order.png) + +## A Django Project + +Now that we can write some basic python we can begin our django project. Let's start by creating a view. + +1. Close out of my_program.py + +2. In the terminal type `django-admin startapp mysite` + + ![startapp](img/day1/startapp.gif) + +3. Expand the `config` folder by clicking on it + + ![config](img/day1/config.png) + +4. Click on `settings.py` to open it + +5. Scroll down to line 33 and add `mysite` above `'django.contrib.admin'` + + ![add_mysite](img/day1/add_mysite.png) + +6. Save with ++ctrl++ + S + +7. Click on `urls.py` to open it + + ![urls](img/day1/urlspy.png) + +8. On line 17 add `, include` after `from django.urls import path` + + ![include](img/day1/include.png) + +9. Add `path('', include('mysite.urls')),` above `path('admin/', admin.site.urls),` + + ![mysiteurls](img/day1/mysiteurls.png) + +10. Expand the newly created `mysite` folder by clicking on it + + ![mysite](img/day1/mysite.png) + +11. Right click on `mysite` and click "New Folder". Name it `templates` + + ![templates](img/day1/templates.gif) + +12. Right click on `templates` and click "New Folder". Name it `mysite` + + ![mysitetemplate](img/day1/mysitetemplates.gif) + +13. Right click on the `mysite` folder inside `templates` and click "New File". Name it `index.html` + + ![index](img/day1/index.gif) + +14. Open `index.html` by clicking on it + +15. Add the following to index.html + + ```html + + + + {{ data }} + + + + ``` + + ![indexdata](img/day1/indexdata.png) + +16. Save with ++ctrl++ + S + +17. Open `views.py` by clicking on it + +18. In views.py under line 3 add the following: + + ```python + def index(request): + return render( + request, + "mysite/index.html", + {"data": "hello"} + ) + ``` + + ![defindex](img/day1/defindex.png) + +19. Save with ++ctrl++ + S + +20. Right click on `mysite` and click "New File". Name it `urls.py` + + ![createurls](img/day1/createurls.gif) + +21. Add the following to urls.py: + + ```python + from django.urls import path + from . import views + + urlpatterns = [ + path('', views.index), + ] + ``` + + ![indexpath](img/day1/indexpath.png) + +22. Save with ++ctrl++ + S + +23. In the terminal type `python manage.py runserver` + + ![runserver](img/day1/runserver.gif) + +24. In your browser navigate to + + ![hello](img/day1/hello.gif) + +You've now passed python data to a browser! We'll explore what this really means in Day 2. diff --git a/docs/img/day0/bluej_choose_project.gif b/docs/img/day0/bluej_choose_project.gif new file mode 100644 index 0000000..34d0f3a Binary files /dev/null and b/docs/img/day0/bluej_choose_project.gif differ diff --git a/docs/img/day0/bluej_choose_project2.gif b/docs/img/day0/bluej_choose_project2.gif new file mode 100644 index 0000000..7eee3ce Binary files /dev/null and b/docs/img/day0/bluej_choose_project2.gif differ diff --git a/docs/img/day0/bluej_download.png b/docs/img/day0/bluej_download.png new file mode 100644 index 0000000..7adf469 Binary files /dev/null and b/docs/img/day0/bluej_download.png differ diff --git a/docs/img/day0/bluej_download_mac.png b/docs/img/day0/bluej_download_mac.png new file mode 100644 index 0000000..948d403 Binary files /dev/null and b/docs/img/day0/bluej_download_mac.png differ diff --git a/docs/img/day0/bluej_open.png b/docs/img/day0/bluej_open.png new file mode 100644 index 0000000..ad35cd9 Binary files /dev/null and b/docs/img/day0/bluej_open.png differ diff --git a/docs/img/day0/bluej_open_mac.png b/docs/img/day0/bluej_open_mac.png new file mode 100644 index 0000000..c1463cc Binary files /dev/null and b/docs/img/day0/bluej_open_mac.png differ diff --git a/docs/img/day0/bluej_project_new_mac.png b/docs/img/day0/bluej_project_new_mac.png new file mode 100644 index 0000000..23b08ba Binary files /dev/null and b/docs/img/day0/bluej_project_new_mac.png differ diff --git a/docs/img/day0/close_extension.png b/docs/img/day0/close_extension.png new file mode 100755 index 0000000..7468053 Binary files /dev/null and b/docs/img/day0/close_extension.png differ diff --git a/docs/img/day0/close_welcome.gif b/docs/img/day0/close_welcome.gif new file mode 100644 index 0000000..2c23370 Binary files /dev/null and b/docs/img/day0/close_welcome.gif differ diff --git a/docs/img/day0/close_welcome.png b/docs/img/day0/close_welcome.png new file mode 100755 index 0000000..966ed52 Binary files /dev/null and b/docs/img/day0/close_welcome.png differ diff --git a/docs/img/day0/code_download.png b/docs/img/day0/code_download.png new file mode 100644 index 0000000..1ed3475 Binary files /dev/null and b/docs/img/day0/code_download.png differ diff --git a/docs/img/day0/ctrl_ko_windows.gif b/docs/img/day0/ctrl_ko_windows.gif new file mode 100644 index 0000000..5e35fcd Binary files /dev/null and b/docs/img/day0/ctrl_ko_windows.gif differ diff --git a/docs/img/day0/ctrl_o_mac.gif b/docs/img/day0/ctrl_o_mac.gif new file mode 100644 index 0000000..08189a6 Binary files /dev/null and b/docs/img/day0/ctrl_o_mac.gif differ diff --git a/docs/img/day0/download_for_mac.png b/docs/img/day0/download_for_mac.png new file mode 100644 index 0000000..d5158f6 Binary files /dev/null and b/docs/img/day0/download_for_mac.png differ diff --git a/docs/img/day0/download_for_windows.png b/docs/img/day0/download_for_windows.png new file mode 100755 index 0000000..0530ac6 Binary files /dev/null and b/docs/img/day0/download_for_windows.png differ diff --git a/docs/img/day0/extension.png b/docs/img/day0/extension.png new file mode 100755 index 0000000..cf2df61 Binary files /dev/null and b/docs/img/day0/extension.png differ diff --git a/docs/img/day0/git_download_mac.png b/docs/img/day0/git_download_mac.png new file mode 100644 index 0000000..94db777 Binary files /dev/null and b/docs/img/day0/git_download_mac.png differ diff --git a/docs/img/day0/git_download_windows.png b/docs/img/day0/git_download_windows.png new file mode 100644 index 0000000..61919a2 Binary files /dev/null and b/docs/img/day0/git_download_windows.png differ diff --git a/docs/img/day0/git_link.png b/docs/img/day0/git_link.png new file mode 100644 index 0000000..6aa96e8 Binary files /dev/null and b/docs/img/day0/git_link.png differ diff --git a/docs/img/day0/google_git.png b/docs/img/day0/google_git.png new file mode 100644 index 0000000..13fcc90 Binary files /dev/null and b/docs/img/day0/google_git.png differ diff --git a/docs/img/day0/install_for_mac.gif b/docs/img/day0/install_for_mac.gif new file mode 100644 index 0000000..12dd700 Binary files /dev/null and b/docs/img/day0/install_for_mac.gif differ diff --git a/docs/img/day0/install_for_windows.gif b/docs/img/day0/install_for_windows.gif new file mode 100644 index 0000000..90f214f Binary files /dev/null and b/docs/img/day0/install_for_windows.gif differ diff --git a/docs/img/day0/install_python.png b/docs/img/day0/install_python.png new file mode 100755 index 0000000..f2add36 Binary files /dev/null and b/docs/img/day0/install_python.png differ diff --git a/docs/img/day0/install_success.png b/docs/img/day0/install_success.png new file mode 100755 index 0000000..c3ba2da Binary files /dev/null and b/docs/img/day0/install_success.png differ diff --git a/docs/img/day0/java_windows_path.png b/docs/img/day0/java_windows_path.png new file mode 100644 index 0000000..f5a57a4 Binary files /dev/null and b/docs/img/day0/java_windows_path.png differ diff --git a/docs/img/day0/kill_terminal.png b/docs/img/day0/kill_terminal.png new file mode 100755 index 0000000..0462e74 Binary files /dev/null and b/docs/img/day0/kill_terminal.png differ diff --git a/docs/img/day0/localhost8000.gif b/docs/img/day0/localhost8000.gif new file mode 100644 index 0000000..1e13594 Binary files /dev/null and b/docs/img/day0/localhost8000.gif differ diff --git a/docs/img/day0/mac_bluej_drag.gif b/docs/img/day0/mac_bluej_drag.gif new file mode 100644 index 0000000..e685ca2 Binary files /dev/null and b/docs/img/day0/mac_bluej_drag.gif differ diff --git a/docs/img/day0/mac_bluej_install.gif b/docs/img/day0/mac_bluej_install.gif new file mode 100644 index 0000000..9d512e9 Binary files /dev/null and b/docs/img/day0/mac_bluej_install.gif differ diff --git a/docs/img/day0/mac_bluej_install2.gif b/docs/img/day0/mac_bluej_install2.gif new file mode 100644 index 0000000..6b8ed88 Binary files /dev/null and b/docs/img/day0/mac_bluej_install2.gif differ diff --git a/docs/img/day0/mac_install_java.png b/docs/img/day0/mac_install_java.png new file mode 100644 index 0000000..80194c3 Binary files /dev/null and b/docs/img/day0/mac_install_java.png differ diff --git a/docs/img/day0/ninite_download_for_windows.png b/docs/img/day0/ninite_download_for_windows.png new file mode 100644 index 0000000..255cf0f Binary files /dev/null and b/docs/img/day0/ninite_download_for_windows.png differ diff --git a/docs/img/day0/ninite_install_for_windows.png b/docs/img/day0/ninite_install_for_windows.png new file mode 100644 index 0000000..e707a83 Binary files /dev/null and b/docs/img/day0/ninite_install_for_windows.png differ diff --git a/docs/img/day0/open_manage.gif b/docs/img/day0/open_manage.gif new file mode 100644 index 0000000..f01bbb4 Binary files /dev/null and b/docs/img/day0/open_manage.gif differ diff --git a/docs/img/day0/open_terminal.gif b/docs/img/day0/open_terminal.gif new file mode 100644 index 0000000..e06b9b6 Binary files /dev/null and b/docs/img/day0/open_terminal.gif differ diff --git a/docs/img/day0/open_terminal_windows.gif b/docs/img/day0/open_terminal_windows.gif new file mode 100644 index 0000000..4227fb5 Binary files /dev/null and b/docs/img/day0/open_terminal_windows.gif differ diff --git a/docs/img/day0/pip_django.gif b/docs/img/day0/pip_django.gif new file mode 100644 index 0000000..1a8f7db Binary files /dev/null and b/docs/img/day0/pip_django.gif differ diff --git a/docs/img/day0/python_version.gif b/docs/img/day0/python_version.gif new file mode 100644 index 0000000..3e9b059 Binary files /dev/null and b/docs/img/day0/python_version.gif differ diff --git a/docs/img/day0/python_version_windows.gif b/docs/img/day0/python_version_windows.gif new file mode 100644 index 0000000..545363b Binary files /dev/null and b/docs/img/day0/python_version_windows.gif differ diff --git a/docs/img/day0/runserver.gif b/docs/img/day0/runserver.gif new file mode 100644 index 0000000..beb7598 Binary files /dev/null and b/docs/img/day0/runserver.gif differ diff --git a/docs/img/day0/search_python.png b/docs/img/day0/search_python.png new file mode 100755 index 0000000..3ff6449 Binary files /dev/null and b/docs/img/day0/search_python.png differ diff --git a/docs/img/day0/select_cmd_prompt.png b/docs/img/day0/select_cmd_prompt.png new file mode 100755 index 0000000..7039c3e Binary files /dev/null and b/docs/img/day0/select_cmd_prompt.png differ diff --git a/docs/img/day0/select_default_shell_windows.png b/docs/img/day0/select_default_shell_windows.png new file mode 100755 index 0000000..dddf1a4 Binary files /dev/null and b/docs/img/day0/select_default_shell_windows.png differ diff --git a/docs/img/day0/select_docs.png b/docs/img/day0/select_docs.png new file mode 100755 index 0000000..102ee60 Binary files /dev/null and b/docs/img/day0/select_docs.png differ diff --git a/docs/img/day0/source_venv_mac.gif b/docs/img/day0/source_venv_mac.gif new file mode 100644 index 0000000..7250d25 Binary files /dev/null and b/docs/img/day0/source_venv_mac.gif differ diff --git a/docs/img/day0/source_venv_windows.gif b/docs/img/day0/source_venv_windows.gif new file mode 100644 index 0000000..b263c40 Binary files /dev/null and b/docs/img/day0/source_venv_windows.gif differ diff --git a/docs/img/day0/startproject.gif b/docs/img/day0/startproject.gif new file mode 100644 index 0000000..18999e6 Binary files /dev/null and b/docs/img/day0/startproject.gif differ diff --git a/docs/img/day0/venv_mac.gif b/docs/img/day0/venv_mac.gif new file mode 100644 index 0000000..4691579 Binary files /dev/null and b/docs/img/day0/venv_mac.gif differ diff --git a/docs/img/day0/venv_windows.gif b/docs/img/day0/venv_windows.gif new file mode 100644 index 0000000..40aa068 Binary files /dev/null and b/docs/img/day0/venv_windows.gif differ diff --git a/docs/img/day0/vscode_open.png b/docs/img/day0/vscode_open.png new file mode 100644 index 0000000..bb392df Binary files /dev/null and b/docs/img/day0/vscode_open.png differ diff --git a/docs/img/day0/vscode_uncheck.gif b/docs/img/day0/vscode_uncheck.gif new file mode 100644 index 0000000..ae50e33 Binary files /dev/null and b/docs/img/day0/vscode_uncheck.gif differ diff --git a/docs/img/day0/windows_bluej_install.gif b/docs/img/day0/windows_bluej_install.gif new file mode 100644 index 0000000..6013f79 Binary files /dev/null and b/docs/img/day0/windows_bluej_install.gif differ diff --git a/docs/img/day0/windows_create_bluej_project.gif b/docs/img/day0/windows_create_bluej_project.gif new file mode 100644 index 0000000..1248b79 Binary files /dev/null and b/docs/img/day0/windows_create_bluej_project.gif differ diff --git a/docs/img/day0/windows_create_bluej_project2.gif b/docs/img/day0/windows_create_bluej_project2.gif new file mode 100644 index 0000000..2483fdf Binary files /dev/null and b/docs/img/day0/windows_create_bluej_project2.gif differ diff --git a/docs/img/day0/windows_env_var.png b/docs/img/day0/windows_env_var.png new file mode 100644 index 0000000..690b19d Binary files /dev/null and b/docs/img/day0/windows_env_var.png differ diff --git a/docs/img/day0/windows_path_edit.png b/docs/img/day0/windows_path_edit.png new file mode 100644 index 0000000..6878e27 Binary files /dev/null and b/docs/img/day0/windows_path_edit.png differ diff --git a/docs/img/day0/windows_path_edit2.png b/docs/img/day0/windows_path_edit2.png new file mode 100644 index 0000000..a38e308 Binary files /dev/null and b/docs/img/day0/windows_path_edit2.png differ diff --git a/docs/img/day0/windows_system_env_vars.png b/docs/img/day0/windows_system_env_vars.png new file mode 100644 index 0000000..645498e Binary files /dev/null and b/docs/img/day0/windows_system_env_vars.png differ diff --git a/docs/img/day1/add_file.png b/docs/img/day1/add_file.png new file mode 100644 index 0000000..7830d81 Binary files /dev/null and b/docs/img/day1/add_file.png differ diff --git a/docs/img/day1/add_mysite.png b/docs/img/day1/add_mysite.png new file mode 100644 index 0000000..b471c3d Binary files /dev/null and b/docs/img/day1/add_mysite.png differ diff --git a/docs/img/day1/config.png b/docs/img/day1/config.png new file mode 100644 index 0000000..2a80b74 Binary files /dev/null and b/docs/img/day1/config.png differ diff --git a/docs/img/day1/createurls.gif b/docs/img/day1/createurls.gif new file mode 100644 index 0000000..cbfb008 Binary files /dev/null and b/docs/img/day1/createurls.gif differ diff --git a/docs/img/day1/def_ph.png b/docs/img/day1/def_ph.png new file mode 100644 index 0000000..de2c175 Binary files /dev/null and b/docs/img/day1/def_ph.png differ diff --git a/docs/img/day1/defindex.png b/docs/img/day1/defindex.png new file mode 100644 index 0000000..1de28af Binary files /dev/null and b/docs/img/day1/defindex.png differ diff --git a/docs/img/day1/functions_in_order.png b/docs/img/day1/functions_in_order.png new file mode 100644 index 0000000..ae24656 Binary files /dev/null and b/docs/img/day1/functions_in_order.png differ diff --git a/docs/img/day1/hello.gif b/docs/img/day1/hello.gif new file mode 100644 index 0000000..642e22c Binary files /dev/null and b/docs/img/day1/hello.gif differ diff --git a/docs/img/day1/in_order.png b/docs/img/day1/in_order.png new file mode 100644 index 0000000..56259bf Binary files /dev/null and b/docs/img/day1/in_order.png differ diff --git a/docs/img/day1/include.png b/docs/img/day1/include.png new file mode 100644 index 0000000..9b27036 Binary files /dev/null and b/docs/img/day1/include.png differ diff --git a/docs/img/day1/indent_hw.png b/docs/img/day1/indent_hw.png new file mode 100644 index 0000000..77c95a9 Binary files /dev/null and b/docs/img/day1/indent_hw.png differ diff --git a/docs/img/day1/index.gif b/docs/img/day1/index.gif new file mode 100644 index 0000000..becb0de Binary files /dev/null and b/docs/img/day1/index.gif differ diff --git a/docs/img/day1/indexdata.png b/docs/img/day1/indexdata.png new file mode 100644 index 0000000..d673557 Binary files /dev/null and b/docs/img/day1/indexdata.png differ diff --git a/docs/img/day1/indexpath.png b/docs/img/day1/indexpath.png new file mode 100644 index 0000000..ad6c5bd Binary files /dev/null and b/docs/img/day1/indexpath.png differ diff --git a/docs/img/day1/middle_stuff.png b/docs/img/day1/middle_stuff.png new file mode 100644 index 0000000..fd69c15 Binary files /dev/null and b/docs/img/day1/middle_stuff.png differ diff --git a/docs/img/day1/mysite.png b/docs/img/day1/mysite.png new file mode 100644 index 0000000..83eebd9 Binary files /dev/null and b/docs/img/day1/mysite.png differ diff --git a/docs/img/day1/mysitetemplates.gif b/docs/img/day1/mysitetemplates.gif new file mode 100644 index 0000000..9c20b63 Binary files /dev/null and b/docs/img/day1/mysitetemplates.gif differ diff --git a/docs/img/day1/mysiteurls.png b/docs/img/day1/mysiteurls.png new file mode 100644 index 0000000..005439b Binary files /dev/null and b/docs/img/day1/mysiteurls.png differ diff --git a/docs/img/day1/name_file.png b/docs/img/day1/name_file.png new file mode 100644 index 0000000..bb79522 Binary files /dev/null and b/docs/img/day1/name_file.png differ diff --git a/docs/img/day1/open_file.png b/docs/img/day1/open_file.png new file mode 100644 index 0000000..4f46907 Binary files /dev/null and b/docs/img/day1/open_file.png differ diff --git a/docs/img/day1/print_gb.png b/docs/img/day1/print_gb.png new file mode 100644 index 0000000..ba06ea6 Binary files /dev/null and b/docs/img/day1/print_gb.png differ diff --git a/docs/img/day1/print_goodbye.png b/docs/img/day1/print_goodbye.png new file mode 100644 index 0000000..3db9bfd Binary files /dev/null and b/docs/img/day1/print_goodbye.png differ diff --git a/docs/img/day1/python_prompt.gif b/docs/img/day1/python_prompt.gif new file mode 100644 index 0000000..866f942 Binary files /dev/null and b/docs/img/day1/python_prompt.gif differ diff --git a/docs/img/day1/run_hw.gif b/docs/img/day1/run_hw.gif new file mode 100644 index 0000000..3ebdbd1 Binary files /dev/null and b/docs/img/day1/run_hw.gif differ diff --git a/docs/img/day1/runserver.gif b/docs/img/day1/runserver.gif new file mode 100644 index 0000000..2272972 Binary files /dev/null and b/docs/img/day1/runserver.gif differ diff --git a/docs/img/day1/startapp.gif b/docs/img/day1/startapp.gif new file mode 100644 index 0000000..cfdfeec Binary files /dev/null and b/docs/img/day1/startapp.gif differ diff --git a/docs/img/day1/templates.gif b/docs/img/day1/templates.gif new file mode 100644 index 0000000..5f296a4 Binary files /dev/null and b/docs/img/day1/templates.gif differ diff --git a/docs/img/day1/type_hw.png b/docs/img/day1/type_hw.png new file mode 100644 index 0000000..8e3bc2d Binary files /dev/null and b/docs/img/day1/type_hw.png differ diff --git a/docs/img/day1/type_more_code.png b/docs/img/day1/type_more_code.png new file mode 100644 index 0000000..f7ba910 Binary files /dev/null and b/docs/img/day1/type_more_code.png differ diff --git a/docs/img/day1/urlspy.png b/docs/img/day1/urlspy.png new file mode 100644 index 0000000..9d03d51 Binary files /dev/null and b/docs/img/day1/urlspy.png differ diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..e061808 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,16 @@ +# Welcome to Project Oriented Java 2020 + +## Days + +### [Day 0](day0.md): Installation requirements + +- Install Git +- Install Java +- Install BlueJ +- Create a projects folder + +### [Day 1](day1.md): Java basics + +- Java in the command-line +- A Java Program +- The Java Compiler diff --git a/helm/.helmignore b/helm/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/helm/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/helm/Chart.yaml b/helm/Chart.yaml new file mode 100644 index 0000000..cf7bc40 --- /dev/null +++ b/helm/Chart.yaml @@ -0,0 +1,23 @@ +apiVersion: v2 +name: helm +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +appVersion: 1.16.0 diff --git a/helm/templates/deploy.yaml b/helm/templates/deploy.yaml new file mode 100644 index 0000000..543fe60 --- /dev/null +++ b/helm/templates/deploy.yaml @@ -0,0 +1,26 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }} +spec: + replicas: 1 + selector: + matchLabels: + app: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ .Release.Name }} + spec: + containers: + - image: {{ required "A valid .Values.image entry required!" .Values.image }}:{{ required "A valid .Values.tag entry required!" .Values.tag }} + name: {{ .Release.Name }} + ports: + - containerPort: 80 + resources: + limits: + memory: "500Mi" + cpu: "250m" + requests: + memory: "1Mi" + cpu: "100m" diff --git a/helm/templates/ingress.yaml b/helm/templates/ingress.yaml new file mode 100644 index 0000000..7853e92 --- /dev/null +++ b/helm/templates/ingress.yaml @@ -0,0 +1,78 @@ +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: {{ .Release.Name }}-internal-tls + annotations: + kubernetes.io/ingress.class: traefik-internal +spec: + entryPoints: + - websecure + tls: + certResolver: myresolver + domains: + - main: "*.ducoterra.net" + routes: + - match: Host(`{{ .Release.Name }}.ducoterra.net`) + kind: Rule + services: + - name: {{ .Release.Name }} + port: {{ .Values.port }} + +--- + +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: {{ .Release.Name }}-internal-web + annotations: + kubernetes.io/ingress.class: traefik-internal +spec: + entryPoints: + - web + routes: + - match: Host(`{{ .Release.Name }}.ducoterra.net`) + kind: Rule + services: + - name: {{ .Release.Name }} + port: {{ .Values.port }} + middlewares: + - name: httpsredirect + +--- +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: {{ .Release.Name }}-external-tls + annotations: + kubernetes.io/ingress.class: traefik-external +spec: + entryPoints: + - websecure + tls: + certResolver: myresolver + routes: + - match: Host(`{{ .Release.Name }}.ducoterra.net`) + kind: Rule + services: + - name: {{ .Release.Name }} + port: {{ .Values.port }} + +--- + +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: {{ .Release.Name }}-external-web + annotations: + kubernetes.io/ingress.class: traefik-external +spec: + entryPoints: + - web + routes: + - match: Host(`{{ .Release.Name }}.ducoterra.net`) + kind: Rule + services: + - name: {{ .Release.Name }} + port: {{ .Values.port }} + middlewares: + - name: httpsredirect diff --git a/helm/templates/service.yaml b/helm/templates/service.yaml new file mode 100644 index 0000000..a259263 --- /dev/null +++ b/helm/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: {{ .Release.Name }} + name: {{ .Release.Name }} +spec: + ports: + - port: {{ .Values.port }} + protocol: TCP + name: {{ .Release.Name }}-web + targetPort: {{ .Values.port }} + selector: + app: {{ .Release.Name }} # This selects the pod(s) that match the selector + type: ClusterIP diff --git a/helm/values.yaml b/helm/values.yaml new file mode 100644 index 0000000..ced7b68 --- /dev/null +++ b/helm/values.yaml @@ -0,0 +1 @@ +port: 80 \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..df18129 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,12 @@ +site_name: Java Class 2020 +nav: + - Home: index.md + - Day 0: day0.md + - Day 1: day1.md +theme: + name: material +markdown_extensions: + - pymdownx.keys + - pymdownx.superfences + - pymdownx.highlight: + linenums_style: pymdownx.inline \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e758630 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,19 @@ +click==7.1.2 +future==0.18.2 +Jinja2==2.11.2 +joblib==0.17.0 +livereload==2.6.3 +lunr==0.5.8 +Markdown==3.3.3 +MarkupSafe==1.1.1 +mkdocs==1.1.2 +mkdocs-material==6.1.0 +mkdocs-material-extensions==1.0.1 +nltk==3.5 +Pygments==2.7.2 +pymdown-extensions==8.0.1 +PyYAML==5.3.1 +regex==2020.10.23 +six==1.15.0 +tornado==6.0.4 +tqdm==4.51.0