diff --git a/Code/chadL/Javascript/lab1/app.js b/Code/chadL/Javascript/lab1/app.js new file mode 100644 index 00000000..0a60355e --- /dev/null +++ b/Code/chadL/Javascript/lab1/app.js @@ -0,0 +1,28 @@ +let body = document.body +let unit = prompt('Enter a unit of measure: inches, feet, meters, yards, kilometers, miles') +let number = prompt('Enter number to be converted') +console.log(unit); +console.log(number); + +let values = {"feet": 0.3048, + "miles": 1609.34, + "meters": 1, + "kilometers": 1000, + "yards": 0.9144, + "inch:": 0.0254 +} + + +let unitValue = values[unit]; +let change = unitValue * number; +body.append(`Your input ${unit}, + conversion: ${change} meters.`); + + +document.body.style.backgroundColor = "tan"; + + +document.body.style.font = "italic bold 25px arial,serif"; + + +document.getElementById("border").style.borderTop = "thick solid #0000FF"; \ No newline at end of file diff --git a/Code/chadL/Javascript/lab1/index.html b/Code/chadL/Javascript/lab1/index.html new file mode 100644 index 00000000..3e6748c5 --- /dev/null +++ b/Code/chadL/Javascript/lab1/index.html @@ -0,0 +1,17 @@ + + + + + + + Document + + + +
+

Conversion Calculator

+
+ +

Please enter your unit of measure to convert.

+ + \ No newline at end of file diff --git a/Code/chadL/Python/Lab14.py b/Code/chadL/Python/Lab14.py new file mode 100644 index 00000000..4f4e2c88 --- /dev/null +++ b/Code/chadL/Python/Lab14.py @@ -0,0 +1,69 @@ +#1 +""" +import time +import requests +import re + +response = requests.get("https://icanhazdadjoke.com", headers={ + 'Accept': 'application/json' +}) + +response_dict = response.json() +joke = response_dict["joke"] + + +joke_list = re.split(pattern = r"[.,?!]", + string = joke) + +for i in joke_list: + if i == '': + del joke_list[-1] + +print(joke_list[0]) +time.sleep(3) +print(joke_list[1]) +""" + +#2 +import time +import requests +import re + +while True: + + search_term = input("What would you like to search for? Type 'done' to exit. ") + + if search_term == "done": + break + + response = requests.get(f"https://icanhazdadjoke.com/search?term=${search_term}", headers={ + 'Accept': 'application/json' + }) + + response_dict = response.json() + print(response_dict) + + """ + joke = response_dict["joke"] + + + joke_list = re.split(pattern = r"[.,?!]", + string = joke) + + for i in joke_list: + if i == '': + del joke_list[-1] + + print(joke_list[0]) + time.sleep(3) + print(joke_list[1]) + """ + +Where do rabbits go after they get married? On a bunny-moon. Where do rabbits go after they get married +PZDd', 'joke': 'When does a joke become a dad joke? When it becomes apparent.'}, +{'id': 'FBQ7wskbMmb', 'joke': "Want to hear a joke about construction? Nah, I'm still working on it."}, +{'id': 'rc2E6EdiNe', 'joke': "Want to hear my pizza joke? Never mind, it's too cheesy."}, +{'id': 'EYo4TCAdUf', 'joke': 'I tried to write a chemistry joke, but could never get a reaction.'}, +{'id': '8USSSfVn3ob', 'joke': "I've been trying to come up with a dad joke about momentum . . . but I just can't seem to get it going."}, +{'id': 'ozPmbFtWDlb', 'joke': "Some people say that comedians who tell one too many light many levels."} +], 'search_term': '$joke', 'status': 200, 'total_jokes': 12, 'total_pages': 1} \ No newline at end of file diff --git a/Code/chadL/Python/lab7.py b/Code/chadL/Python/lab7.py new file mode 100644 index 00000000..2e80331b --- /dev/null +++ b/Code/chadL/Python/lab7.py @@ -0,0 +1,47 @@ +#Lab 7: ROT Cipher + +hacker = input("What shall we encypt? ").lower() #ask user for words to encypt + +rot13_dict = { #dictinary of associated letters + "a": "n", + "b": "o", + "c": "p", + "d": "q", + "e": "r", + "f": "s", + "g": "t", + "h": "u", + "i": "v", + "j": "w", + "k": "x", + "l": "y", + "m": "z", + "n": "a", + "o": "b", + "p": "c", + "q": "d", + "r": "e", + "s": "f", + "t": "g", + "u": "h", + "v": "i", + "w": "j", + "x": "k", + "y": "l", + "z": "m", + " ": " " +} + +hacker = list(hacker) #turn input into list + + +def rot_13(hacker): #fucntion to turn input into list. + rot13_list = [] + for letter in hacker: #loop to add appended letter to list + cypher = rot13_dict[letter] + rot13_list.append(cypher) # add cypher to rot13 list + + final_answer = ''.join(rot13_list) # .join seperates everything except the letters. + print(f"Your encrypted code is: {final_answer}") + +rot_13(hacker) diff --git a/Code/chadL/Python/lab8.py b/Code/chadL/Python/lab8.py new file mode 100644 index 00000000..c00542c1 --- /dev/null +++ b/Code/chadL/Python/lab8.py @@ -0,0 +1,44 @@ +data = [1, 2 , 3, 4, 5, 6, 7, 6, 5, 4, 5, 6, 7, 8, 9, 8, 7, 6, 7, 8, 9] #peaks and valleys list + + +def peaks(data): + for index, number in enumerate(data): + if index == 0 or index == len(data) -1: #not running first index or last + continue + + elif number > data[index -1 ] and number > data[index + 1]: #checking if index before or after is less then number + print(index) + +def valleys(data): + for index, number in enumerate(data): + if index == 0 or index == len(data) -1: + continue + + elif number < data[index -1 ] and number < data[index + 1]: ##checking if index before or after is greater then number + print(index) + +def peaks_valleys(data): + for index, number in enumerate(data): + if index == 0 or index == len(data) -1: + continue + + elif number > data[index -1 ] and number > data[index + 1]: + print(index) + + elif number < data[index -1 ] and number < data[index + 1]: + print(index) + +peaks_valleys(data) + + +""" +Lab 8: Peaks and Valleys +Define the following functions: + +peaks - Returns the indices of peaks. A peak has a lower number on both the left and the right. + +valleys - Returns the indices of 'valleys'. A valley is a number with a higher number on both the left and the right. + +peaks_and_valleys - uses the above two functions to compile a single list of the peaks and valleys in order of appearance in the original data. +""" + diff --git a/Code/chadL/Python/lab9.py b/Code/chadL/Python/lab9.py new file mode 100644 index 00000000..617fb14b --- /dev/null +++ b/Code/chadL/Python/lab9.py @@ -0,0 +1,97 @@ +# compute ARI + +with open("text.txt") as file: + text = file.read() + +character_count = 0 +for character in text: + if character == " " or character == "," or character == ".": + continue + else: + character_count += 1 + +word_list = text.split(" ") +word_list = len(word_list) + +sentence_list = text.split(".") +sentence_list = len(sentence_list) + +formula = 4.71 * (character_count / word_list) + 0.5 * (word_list / sentence_list) - 21.43 +print(formula) + + +ari_scale = { + 1: {'ages': '5-6', 'grade_level': 'Kindergarten'}, + 2: {'ages': '6-7', 'grade_level': '1st Grade'}, + 3: {'ages': '7-8', 'grade_level': '2nd Grade'}, + 4: {'ages': '8-9', 'grade_level': '3rd Grade'}, + 5: {'ages': '9-10', 'grade_level': '4th Grade'}, + 6: {'ages': '10-11', 'grade_level': '5th Grade'}, + 7: {'ages': '11-12', 'grade_level': '6th Grade'}, + 8: {'ages': '12-13', 'grade_level': '7th Grade'}, + 9: {'ages': '13-14', 'grade_level': '8th Grade'}, + 10: {'ages': '14-15', 'grade_level': '9th Grade'}, + 11: {'ages': '15-16', 'grade_level': '10th Grade'}, + 12: {'ages': '16-17', 'grade_level': '11th Grade'}, + 13: {'ages': '17-18', 'grade_level': '12th Grade'}, + 14: {'ages': '18-22', 'grade_level': 'College'} +} + +#print(f'The ARI for "text.txt" is 12 This corresponds to a 11th Grade level of difficulty that is suitable for an average person {ari_scale[]} years old.') + + +''' + Score Ages Grade Level + 1 5-6 Kindergarten + 2 6-7 First Grade + 3 7-8 Second Grade + 4 8-9 Third Grade + 5 9-10 Fourth Grade + 6 10-11 Fifth Grade + 7 11-12 Sixth Grade + 8 12-13 Seventh Grade + 9 13-14 Eighth Grade + 10 14-15 Ninth Grade + 11 15-16 Tenth Grade + 12 16-17 Eleventh grade + 13 17-18 Twelfth grade + 14 18-22 College + + +Lab 9: Compute Automated Readability Index +Compute the ARI for a given body of text loaded in from a file. +The automated readability index (ARI) is a formula for computing the U.S. grade level for a given block of text. +The general formula to compute the ARI is as follows: + +ARI Formula + +The score is computed by multiplying the number of characters divided by the number of words by 4.71, +adding the number of words divided by the number of sentences multiplied by 0.5, and subtracting 21.43. +If the result is a decimal, always round up. +Scores greater than 14 should be presented as having the same age and grade level as scores of 14. + + ari_scale = { + 1: {'ages': '5-6', 'grade_level': 'Kindergarten'}, + 2: {'ages': '6-7', 'grade_level': '1st Grade'}, + 3: {'ages': '7-8', 'grade_level': '2nd Grade'}, + 4: {'ages': '8-9', 'grade_level': '3rd Grade'}, + 5: {'ages': '9-10', 'grade_level': '4th Grade'}, + 6: {'ages': '10-11', 'grade_level': '5th Grade'}, + 7: {'ages': '11-12', 'grade_level': '6th Grade'}, + 8: {'ages': '12-13', 'grade_level': '7th Grade'}, + 9: {'ages': '13-14', 'grade_level': '8th Grade'}, + 10: {'ages': '14-15', 'grade_level': '9th Grade'}, + 11: {'ages': '15-16', 'grade_level': '10th Grade'}, + 12: {'ages': '16-17', 'grade_level': '11th Grade'}, + 13: {'ages': '17-18', 'grade_level': '12th Grade'}, + 14: {'ages': '18-22', 'grade_level': 'College'} +} +the output should look like: +-------------------------------------------------------- + +The ARI for gettysburg-address.txt is 12 +This corresponds to a 11th Grade level of difficulty +that is suitable for an average person 16-17 years old. + +-------------------------------------------------------- +''' diff --git a/Code/chadL/django/manage.py b/Code/chadL/django/manage.py new file mode 100644 index 00000000..6be564d2 --- /dev/null +++ b/Code/chadL/django/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'todo_proj.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main() diff --git a/Code/chadL/django/redo/redo_app/manage.py b/Code/chadL/django/redo/redo_app/manage.py new file mode 100644 index 00000000..f88eaee8 --- /dev/null +++ b/Code/chadL/django/redo/redo_app/manage.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'redo_app.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main() diff --git a/Code/chadL/django/redo/redo_app/redid_proj/__init__.py b/Code/chadL/django/redo/redo_app/redid_proj/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Code/chadL/django/redo/redo_app/redid_proj/asgi.py b/Code/chadL/django/redo/redo_app/redid_proj/asgi.py new file mode 100644 index 00000000..3f19c680 --- /dev/null +++ b/Code/chadL/django/redo/redo_app/redid_proj/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for redo_app project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'redo_app.settings') + +application = get_asgi_application() diff --git a/Code/chadL/django/redo/redo_app/redid_proj/settings.py b/Code/chadL/django/redo/redo_app/redid_proj/settings.py new file mode 100644 index 00000000..0a52bac5 --- /dev/null +++ b/Code/chadL/django/redo/redo_app/redid_proj/settings.py @@ -0,0 +1,122 @@ +""" +Django settings for redo_app project. + +Generated by 'django-admin startproject' using Django 3.0.14. + +For more information on this file, see +https://docs.djangoproject.com/en/3.0/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/3.0/ref/settings/ +""" + +import os + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = '=-o)e-!f-@8_)&%h4c7^t4v6&9g6&b@22_nijoya^t_&2t9yrz' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'redo_app', + 'redid_proj', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'redo_app.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'redo_app.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/3.0/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + } +} + + +# Password validation +# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/3.0/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'America/Los_Angeles' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/3.0/howto/static-files/ + +STATIC_URL = '/static/' diff --git a/Code/chadL/django/redo/redo_app/redid_proj/urls.py b/Code/chadL/django/redo/redo_app/redid_proj/urls.py new file mode 100644 index 00000000..91720867 --- /dev/null +++ b/Code/chadL/django/redo/redo_app/redid_proj/urls.py @@ -0,0 +1,23 @@ +"""redo_app URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/3.0/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from xml.etree.ElementInclude import include +from django.contrib import admin +from django.urls import path, include + +urlpatterns = [ + path('admin/', admin.site.urls), + path(''/ include('redo_app.urls')) +] diff --git a/Code/chadL/django/redo/redo_app/redid_proj/wsgi.py b/Code/chadL/django/redo/redo_app/redid_proj/wsgi.py new file mode 100644 index 00000000..46fb7c1f --- /dev/null +++ b/Code/chadL/django/redo/redo_app/redid_proj/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for redo_app project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'redo_app.settings') + +application = get_wsgi_application() diff --git a/Code/chadL/django/redo/redo_app/redo_app/__init__.py b/Code/chadL/django/redo/redo_app/redo_app/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Code/chadL/django/redo/redo_app/redo_app/admin.py b/Code/chadL/django/redo/redo_app/redo_app/admin.py new file mode 100644 index 00000000..8c38f3f3 --- /dev/null +++ b/Code/chadL/django/redo/redo_app/redo_app/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/Code/chadL/django/redo/redo_app/redo_app/apps.py b/Code/chadL/django/redo/redo_app/redo_app/apps.py new file mode 100644 index 00000000..eb603e82 --- /dev/null +++ b/Code/chadL/django/redo/redo_app/redo_app/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class RedoAppConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'redo_app' diff --git a/Code/chadL/django/redo/redo_app/redo_app/migrations/__init__.py b/Code/chadL/django/redo/redo_app/redo_app/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Code/chadL/django/redo/redo_app/redo_app/models.py b/Code/chadL/django/redo/redo_app/redo_app/models.py new file mode 100644 index 00000000..71a83623 --- /dev/null +++ b/Code/chadL/django/redo/redo_app/redo_app/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/Code/chadL/django/redo/redo_app/redo_app/templates/redo_app/index.html b/Code/chadL/django/redo/redo_app/redo_app/templates/redo_app/index.html new file mode 100644 index 00000000..4dcd4a14 --- /dev/null +++ b/Code/chadL/django/redo/redo_app/redo_app/templates/redo_app/index.html @@ -0,0 +1,30 @@ + + + + + + + Encryptor + + +

Welcome to redo

+ + What shall we encrypt + +
+
+ {% csrf_token %} +
+ +
+
+ +
+ + + + + + + + \ No newline at end of file diff --git a/Code/chadL/django/redo/redo_app/redo_app/tests.py b/Code/chadL/django/redo/redo_app/redo_app/tests.py new file mode 100644 index 00000000..7ce503c2 --- /dev/null +++ b/Code/chadL/django/redo/redo_app/redo_app/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/Code/chadL/django/redo/redo_app/redo_app/urls.py b/Code/chadL/django/redo/redo_app/redo_app/urls.py new file mode 100644 index 00000000..6dc187ee --- /dev/null +++ b/Code/chadL/django/redo/redo_app/redo_app/urls.py @@ -0,0 +1,10 @@ + +from django import views +from django.urls import path, include +from .import views +urlpatterns = [ + + path(''/ views.index, nam='index') + + +] diff --git a/Code/chadL/django/redo/redo_app/redo_app/views.py b/Code/chadL/django/redo/redo_app/redo_app/views.py new file mode 100644 index 00000000..d65c84e9 --- /dev/null +++ b/Code/chadL/django/redo/redo_app/redo_app/views.py @@ -0,0 +1,9 @@ +from django.shortcuts import render +from django.http import HttpResponse + +# Create your views here. +def index(request): + return render(request, 'redo_app/index.html') + +def result(request): + choice = request.GET[''] \ No newline at end of file diff --git a/Code/chadL/django/todo/manage.py b/Code/chadL/django/todo/manage.py new file mode 100644 index 00000000..244b6144 --- /dev/null +++ b/Code/chadL/django/todo/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'todo.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main() diff --git a/Code/chadL/django/todo/todo/__init__.py b/Code/chadL/django/todo/todo/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Code/chadL/django/todo/todo/asgi.py b/Code/chadL/django/todo/todo/asgi.py new file mode 100644 index 00000000..54e3b5e2 --- /dev/null +++ b/Code/chadL/django/todo/todo/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for todo project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'todo.settings') + +application = get_asgi_application() diff --git a/Code/chadL/django/todo/todo/settings.py b/Code/chadL/django/todo/todo/settings.py new file mode 100644 index 00000000..a16d90a4 --- /dev/null +++ b/Code/chadL/django/todo/todo/settings.py @@ -0,0 +1,123 @@ +""" +Django settings for todo project. + +Generated by 'django-admin startproject' using Django 4.0.3. + +For more information on this file, see +https://docs.djangoproject.com/en/4.0/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/4.0/ref/settings/ +""" + +from pathlib import Path + +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = Path(__file__).resolve().parent.parent + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-xq88h)2^!f$f-36sllvyd(7w*_8j$lq9ln2onnr42kqnhd99=q' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'todo.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'todo.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/4.0/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/4.0/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/4.0/howto/static-files/ + +STATIC_URL = 'static/' + +# Default primary key field type +# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/Code/chadL/django/todo/todo/urls.py b/Code/chadL/django/todo/todo/urls.py new file mode 100644 index 00000000..cf8bb17c --- /dev/null +++ b/Code/chadL/django/todo/todo/urls.py @@ -0,0 +1,21 @@ +"""todo URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/4.0/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import path + +urlpatterns = [ + path('admin/', admin.site.urls), +] diff --git a/Code/chadL/django/todo/todo/wsgi.py b/Code/chadL/django/todo/todo/wsgi.py new file mode 100644 index 00000000..586f90bb --- /dev/null +++ b/Code/chadL/django/todo/todo/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for todo project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/4.0/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'todo.settings') + +application = get_wsgi_application() diff --git a/Code/chadL/django/todo_proj/__init__.py b/Code/chadL/django/todo_proj/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Code/chadL/django/todo_proj/asgi.py b/Code/chadL/django/todo_proj/asgi.py new file mode 100644 index 00000000..5a0fd4de --- /dev/null +++ b/Code/chadL/django/todo_proj/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for todo_proj project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'todo_proj.settings') + +application = get_asgi_application() diff --git a/Code/chadL/django/todo_proj/settings.py b/Code/chadL/django/todo_proj/settings.py new file mode 100644 index 00000000..e639ca3d --- /dev/null +++ b/Code/chadL/django/todo_proj/settings.py @@ -0,0 +1,123 @@ +""" +Django settings for todo_proj project. + +Generated by 'django-admin startproject' using Django 4.0.3. + +For more information on this file, see +https://docs.djangoproject.com/en/4.0/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/4.0/ref/settings/ +""" + +from pathlib import Path + +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = Path(__file__).resolve().parent.parent + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-i#f=dn0$o7f%4j##^c*=3&j(dlr5qghs17k@eqzesg+5aj$ov6' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'todo_proj.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'todo_proj.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/4.0/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/4.0/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/4.0/howto/static-files/ + +STATIC_URL = 'static/' + +# Default primary key field type +# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/Code/chadL/django/todo_proj/urls.py b/Code/chadL/django/todo_proj/urls.py new file mode 100644 index 00000000..74e1f6e9 --- /dev/null +++ b/Code/chadL/django/todo_proj/urls.py @@ -0,0 +1,21 @@ +"""todo_proj URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/4.0/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import path + +urlpatterns = [ + path('admin/', admin.site.urls), +] diff --git a/Code/chadL/django/todo_proj/wsgi.py b/Code/chadL/django/todo_proj/wsgi.py new file mode 100644 index 00000000..5f96a37b --- /dev/null +++ b/Code/chadL/django/todo_proj/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for todo_proj project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/4.0/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'todo_proj.settings') + +application = get_wsgi_application() diff --git a/Code/chadL/html_css/flaskdemo/app.py b/Code/chadL/html_css/flaskdemo/app.py new file mode 100644 index 00000000..10c70857 --- /dev/null +++ b/Code/chadL/html_css/flaskdemo/app.py @@ -0,0 +1,37 @@ +import re +from flask import Flask, render_template, request + +app = Flask(__name__) + + +@app.route('/') +def index(): + name = "chad" + return render_template('index.html') + +if __name__ == "__main__": + app.run() + +# $env:FLASK_APP = "app.py" +# $env:FLASK_ENV = "development" + + +@app.route('/about') +def about(): + return render_template('about.html') + +@app.route('/contact') +def contact(): + return render_template('contact.html') + +@app.route('/check-grade') +def check_grade(): + return render_template('check-grade.html') + + +@app.route('llama', methods=['post']) +def display_name(): + name = request.form['username'] + return render_template('contact.html', name=name) + + diff --git a/Code/chadL/html_css/flaskdemo/static/style.css b/Code/chadL/html_css/flaskdemo/static/style.css new file mode 100644 index 00000000..e69de29b diff --git a/Code/chadL/html_css/flaskdemo/templates/about.html b/Code/chadL/html_css/flaskdemo/templates/about.html new file mode 100644 index 00000000..1c16dd96 --- /dev/null +++ b/Code/chadL/html_css/flaskdemo/templates/about.html @@ -0,0 +1,12 @@ + + + + + + + About + + +

anyone there?

+ + \ No newline at end of file diff --git a/Code/chadL/html_css/flaskdemo/templates/check-grade.html b/Code/chadL/html_css/flaskdemo/templates/check-grade.html new file mode 100644 index 00000000..e5570ad0 --- /dev/null +++ b/Code/chadL/html_css/flaskdemo/templates/check-grade.html @@ -0,0 +1,18 @@ + + + + + + + Document + + +

Grade Checker

+ {% if grade >= 90 %} + +

You got an A

+ + + + + \ No newline at end of file diff --git a/Code/chadL/html_css/flaskdemo/templates/contact.html b/Code/chadL/html_css/flaskdemo/templates/contact.html new file mode 100644 index 00000000..a45b5e6b --- /dev/null +++ b/Code/chadL/html_css/flaskdemo/templates/contact.html @@ -0,0 +1,12 @@ + + + + + + + contact + + + + + \ No newline at end of file diff --git a/Code/chadL/html_css/flaskdemo/templates/index.html b/Code/chadL/html_css/flaskdemo/templates/index.html new file mode 100644 index 00000000..d85faa47 --- /dev/null +++ b/Code/chadL/html_css/flaskdemo/templates/index.html @@ -0,0 +1,24 @@ + + + + + + + Document + + + + + + about + contact + + +
+ + +
+ +

Hello {{ name}}

+ + \ No newline at end of file diff --git a/Code/chadL/html_css/lab1/lab1.html b/Code/chadL/html_css/lab1/lab1.html new file mode 100644 index 00000000..e23c946d --- /dev/null +++ b/Code/chadL/html_css/lab1/lab1.html @@ -0,0 +1,48 @@ + + + + + + + Document + + + + +

+ Taserface is the up and coming leader of a band of brigands, who will rule the galaxies with fear and respect. +

+Alien guy +
+ + Wiki_Button + + + +

+Tazerface has lived in space most of his life. +

+ + + + + + +

+ "You're the one what killed those men by leading them down the wrong path.
+ Because you're weak and stupid! It's time for the Ravagers to rise once again to glory with a new captain: Taserface!"
+ ―Taserface to Yondu Udonta +

+ + + + \ No newline at end of file diff --git a/Code/chadL/html_css/lab1/lab1pic.jpg b/Code/chadL/html_css/lab1/lab1pic.jpg new file mode 100644 index 00000000..dc9a03e0 Binary files /dev/null and b/Code/chadL/html_css/lab1/lab1pic.jpg differ diff --git a/Code/chadL/html_css/lab1/lab1style.css b/Code/chadL/html_css/lab1/lab1style.css new file mode 100644 index 00000000..1760bc95 --- /dev/null +++ b/Code/chadL/html_css/lab1/lab1style.css @@ -0,0 +1,20 @@ +.quote {font-family: fantasy; +font-style: italic; +font-size: 22px; +} + +body {text-align: center; +color: red; +font-size: 12; +} + +p {margin: 50px; +padding: auto; +font-family: monospace; + +} +html{ + background-image: url(https://getwallpapers.com/wallpaper/full/d/d/8/557330.jpg); +} +img {border-radius: 200px} + diff --git a/Code/chadL/html_css/lab2/lab2.html b/Code/chadL/html_css/lab2/lab2.html new file mode 100644 index 00000000..064688c7 --- /dev/null +++ b/Code/chadL/html_css/lab2/lab2.html @@ -0,0 +1,58 @@ + + + + + + + Blogboy + + + +
+

My Blog

+ +
+ + + + + + + +
+
+
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Quibusdam, necessitatibus minima! Quas, in eligendi. Incidunt, facere animi. Tempora, mollitia odio eos recusandae laudantium temporibus ullam minus nihil quidem excepturi sint.
+
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Molestiae suscipit qui expedita voluptas, tempore nobis doloremque aut officia odit natus debitis sequi eos id! Mollitia fuga asperiores laudantium eos veritatis!
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Perspiciatis at possimus beatae, sed amet omnis explicabo, recusandae, minus nisi doloribus commodi? Molestias rem commodi dignissimos neque asperiores suscipit temporibus cumque!
+
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Est nostrum quos alias eum harum natus molestiae modi, ipsum eligendi error aliquid vitae quod deleniti iure, culpa debitis laborum dolorem ullam?
+
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Est nostrum quos alias eum harum natus molestiae modi, ipsum eligendi error aliquid vitae quod deleniti iure, culpa debitis laborum dolorem ullam?
+ +
+
+ + + + + + + + + + + diff --git a/Code/chadL/html_css/lab2/lab2pic.jpg b/Code/chadL/html_css/lab2/lab2pic.jpg new file mode 100644 index 00000000..d89808a0 --- /dev/null +++ b/Code/chadL/html_css/lab2/lab2pic.jpg @@ -0,0 +1,3 @@ + +https://www.theparisreview.org/blog/wp-content/uploads/2018/08/caspar_david_friedrich_-_wanderer_above_the_sea_of_fog-1024x776.jpg + diff --git a/Code/chadL/html_css/lab2/lab2stylesheet.css b/Code/chadL/html_css/lab2/lab2stylesheet.css new file mode 100644 index 00000000..3c4868d0 --- /dev/null +++ b/Code/chadL/html_css/lab2/lab2stylesheet.css @@ -0,0 +1,91 @@ + +header { + display:flex ; + justify-content: space-evenly; + flex-direction: column; + align-items: center; + border: 3px solid rgb(36, 114, 97); +} + +.sidebar{ + position: fixed; + left: 0; + width: 200px; + height: 70%; + background: rgb(39, 39, 104) ; + color: rgb(210, 224, 224); + +} +.sidebar header{ + font-size: 22px; + color: white; + text-align: center; + line-height: 70px; + background-color: rgb(12, 105, 105); + user-select: none; + +} +.sidebar ul a{ + display: block; + height: 100%; + width: 100%; + line-height: 65px; + font-size: 20px; + color: white; + padding-left: 20px; + box-sizing: border-box; +} + +.topheader a { +justify-content: space-between; +color:blue; +font-size: 25px; +display: inline-block; + +} + +main{ + min-height: calc(100vh - 100px); + +} + +body{ + padding: 50px; + margin: 50; + min-height: calc(100vh -137px); + + +} +.grid { + display: flex; + flex-direction: unset ; + align-items: center; + flex-wrap: wrap; + justify-content: space-evenly; + border: 4px solid black; + width: 89%; + height: 500px; + float: right; + +} + +.grid div{ + background-color: rgb(201, 127, 31); + border: 2px solid red; + flex-direction: column; + font-size: 16; + text-align: center; + margin: 8px; + width: 300px; + grid-template-columns: 1fr 1fr; +} + +footer{ + background-color: rgb(35, 85, 35); + color: gold; + text-align: center; + position: relative; + bottom: 0; + width: 100%; + +} \ No newline at end of file diff --git a/Code/chadL/html_css/lab3.html/image.jpg b/Code/chadL/html_css/lab3.html/image.jpg new file mode 100644 index 00000000..006a0ff8 --- /dev/null +++ b/Code/chadL/html_css/lab3.html/image.jpg @@ -0,0 +1 @@ +https://magazine.jhsph.edu/sites/default/files/styles/feature_image_og_image/public/Gun-history-3200x1600.jpg?itok=RPdQzj75 \ No newline at end of file diff --git a/Code/chadL/html_css/lab3.html/lab3.html b/Code/chadL/html_css/lab3.html/lab3.html new file mode 100644 index 00000000..5e4f9f68 --- /dev/null +++ b/Code/chadL/html_css/lab3.html/lab3.html @@ -0,0 +1,172 @@ + + + + + + + Blackbeards Blasters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SBR of the weekDrako AK899$US
ShotGun of the weekMossburg 500$499
Long rifle deal of the weekMossen neguant$399
Ammo of the week5.56 AP rounds$45 a case
+ + + + + +
+ + +
+
+
+
+ + 50% off GUNS + + +
+
+

Best Guns in the whole damn country

+
+
+
+
+ +
+
+
+
+
+ + Accessories + + +
+
+

Best accessories in the whole world.

+
+
+
+
+
+
+
+
+
+ + Ammo + + +
+
+

Ammo up the wazhooo.

+
+
+
+
+ + +
contact us for pirate blasters 1-800-blackmarket
+ +
+
+
+
+ +
+
+ + We sell the best pirate guns on the seven sea's. + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/Code/chadL/html_css/lab4/lab4.html b/Code/chadL/html_css/lab4/lab4.html new file mode 100644 index 00000000..bffbcb26 --- /dev/null +++ b/Code/chadL/html_css/lab4/lab4.html @@ -0,0 +1,80 @@ + + + + + + + Responsive Design + + + +
+

Class Kiwi

+ +
+
+ +
+
+
+

Title 1

+

+ Lorem, ipsum dolor sit amet consectetur adipisicing elit. Nihil earum + rerum porro ducimus, rem dolorum, nisi qui possimus, assumenda + quisquam ipsum aliquam nostrum velit exercitationem harum similique. + Dolorem, nostrum sequi. +

+
+
+

Title 2

+

+ Architecto corrupti, veritatis ullam facilis odit nihil, deleniti + soluta accusantium, corporis iste dolore! A itaque deleniti + dignissimos cum, consequuntur natus aliquam nemo ex aut non obcaecati + ipsum perferendis reiciendis exercitationem. +

+
+
+

Title 3

+

+ Pariatur voluptas ratione illo asperiores ad, non fugiat. Harum, saepe + veniam. Facere provident reiciendis odit aliquam repudiandae eligendi. + Ipsa suscipit delectus deleniti officiis quod deserunt asperiores + blanditiis amet corrupti quaerat! +

+
+
+

Title 4

+

+ Culpa quisquam, eos sapiente, aliquid fuga dolorem repudiandae totam, + in molestias iste itaque ipsa! Quod adipisci possimus, natus sunt rem + voluptate odio obcaecati sit nihil suscipit nam harum. Nostrum, rerum. +

+
+
+

Title 5

+

+ Qui odio aspernatur vero voluptatum, similique minus blanditiis et + cupiditate autem quia atque expedita, ducimus sequi, non vel totam ab. + Libero cumque eos assumenda dolorem officia, expedita sint dolorum + itaque! +

+
+
+

Title 6

+

+ Deserunt perspiciatis excepturi ipsum consequatur aperiam quod veniam + distinctio doloribus. Velit, dignissimos sapiente error qui fugit, + ipsam ipsa cupiditate, illum eos expedita odio nesciunt omnis tenetur. + Officiis molestias aliquam quos! +

+
+
+ + + \ No newline at end of file diff --git a/Code/chadL/html_css/lab4/styles.css b/Code/chadL/html_css/lab4/styles.css new file mode 100644 index 00000000..45da76e4 --- /dev/null +++ b/Code/chadL/html_css/lab4/styles.css @@ -0,0 +1,101 @@ + + +body{ + font-size: 24p ; +display: flex; +flex-direction: column; +justify-content: center; +} + +body>*{ + border: 2px solid red; +} + +h1{ + text-align: center; +} + +.links{ + display: flex; + flex-direction: column; + +} + + +.links > a{ + border: 1px solid black; + background-color: deepskyblue; + margin: 1rem; + box-shadow: inset 0 0 8px 4px black; + padding: .25em 0; + text-align: center; + text-decoration: none; +} + +img{ + width: 100%; + margin-bottom: 1.5em; +} + +main{ + display: flex; + flex-direction: column; + align-items: center; + +} + + + +section{ + border: 1px solid black; + margin-bottom: 1em; + max-width: 54ch; +} +section h1{ + + text-decoration: overline; +} +section p { + text-align: center; +} + + +@media screen and (min-wdth: 768px){ + + .links{ + flex-direction: row; + justify-content: space-evenly; + } +.hero{ + display: flex; + justify-content: space-evenly; +} + + + img{ + width: 75%; +} + +@media screen and (min-width: 1440px){ + header{ + display: flex; + align-items: center; + justify-content: space-between; + } +.links{ + display: block; +} +img{ + max-width: 900px; +} +} +} + +main{ + flex-direction: row; + flex-wrap: wrap; + justify-content: center; +} + + + diff --git a/Code/chadL/html_css/lab5/index.html b/Code/chadL/html_css/lab5/index.html new file mode 100644 index 00000000..8db17111 --- /dev/null +++ b/Code/chadL/html_css/lab5/index.html @@ -0,0 +1,152 @@ + + + + + + + TACO LOCO MOCO + + + + + + +
+ + +

LOCO MOCO TACO

+ +
+ +
+taco + + + + + + +
+ + +
+ + +
+ +
+ +
+
+ +

Tortilla:

+ + +
+ + + +
+ + + +
+ + + +
+
+

Rice:

+ + +
+ + + +
+
+

Beans:

+ + +
+ + + +
+
+

Protien:

+ + +
+ + +
+ + +
+ + +
+ + +
+
+ +

Add-on:

+ + + + + + + + +
+
+ + +
+
+

Leave comments below

+ + +
+ + + + diff --git a/Code/chadL/html_css/lab5/stylesheet.css b/Code/chadL/html_css/lab5/stylesheet.css new file mode 100644 index 00000000..59dbe1a4 --- /dev/null +++ b/Code/chadL/html_css/lab5/stylesheet.css @@ -0,0 +1,57 @@ +body{ + padding: 20px 20px; +} + +header{ + justify-items: center; + border: 2px solid red; + text-align: left; + background-color: rgb(235, 176, 48); + padding: 20px 20px 20px 20px ; + +} + +header h1 { + font-family:monospace; + + color: rgb(51, 119, 96); + font-size: 130px; + font-weight: bold ; + padding: 5vh; + text-decoration: double; + text-shadow: 1px 1px 1px red, + 2px 2px 1px red; +} + + +/* When the checkbox is checked, add a blue background */ +.container input:checked ~ .checkmark { + background-color: #2196F3; + } + +img{ + max-width: 200px; + float: center; + +} + +.img1{ + display: flex; + justify-content: center; + align-items: center; + +} + + + + + + + + + + + + + + diff --git a/Code/chadL/html_css/lab6/app.py b/Code/chadL/html_css/lab6/app.py new file mode 100644 index 00000000..0b546c5e --- /dev/null +++ b/Code/chadL/html_css/lab6/app.py @@ -0,0 +1,62 @@ +from flask import Flask, render_template, Request + +app = Flask(__name__) + +@app.route('/') +def index(): + return render_template('index.html') + + +if __name__ == '__main__': + app.run() + +# $env:FLASK_APP = "app.py" +# $env:FLASK_ENV = "development" + +#Lab 7: ROT Cipher + +hacker = input("What shall we encypt? ").lower() #ask user for words to encypt + +rot13_dict = { #dictinary of associated letters + "a": "n", + "b": "o", + "c": "p", + "d": "q", + "e": "r", + "f": "s", + "g": "t", + "h": "u", + "i": "v", + "j": "w", + "k": "x", + "l": "y", + "m": "z", + "n": "a", + "o": "b", + "p": "c", + "q": "d", + "r": "e", + "s": "f", + "t": "g", + "u": "h", + "v": "i", + "w": "j", + "x": "k", + "y": "l", + "z": "m", + " ": " " +} + +hacker = list(hacker) #turn input into list + + +def rot_13(hacker): #fucntion to turn input into list. + rot13_list = [] + for letter in hacker: #loop to add appended letter to list + cypher = rot13_dict[letter] + rot13_list.append(cypher) # add cypher to rot13 list + + final_answer = ''.join(rot13_list) # .join seperates everything except the letters. + print(f"Your encrypted code is: {final_answer}") + +rot_13(hacker) \ No newline at end of file diff --git a/Code/chadL/html_css/lab6/static/styles.css b/Code/chadL/html_css/lab6/static/styles.css new file mode 100644 index 00000000..238b0289 --- /dev/null +++ b/Code/chadL/html_css/lab6/static/styles.css @@ -0,0 +1,18 @@ +.code{ + justify-content: center; + border: 3px solid red; + width: 100%; + display: inline-block; +} + +body{ + align-items: center; + border:3px solid blue; + background-size: cover; +} + +img{ + border:px solid purple; + background-size: cover; + float: right; +} \ No newline at end of file diff --git a/Code/chadL/html_css/lab6/templates/img.jpg b/Code/chadL/html_css/lab6/templates/img.jpg new file mode 100644 index 00000000..a91227a4 --- /dev/null +++ b/Code/chadL/html_css/lab6/templates/img.jpg @@ -0,0 +1,2 @@ +https://cdn.pixabay.com/photo/2020/07/02/04/31/matrix-5361690_960_720.png + diff --git a/Code/chadL/html_css/lab6/templates/index.html b/Code/chadL/html_css/lab6/templates/index.html new file mode 100644 index 00000000..49ce5e56 --- /dev/null +++ b/Code/chadL/html_css/lab6/templates/index.html @@ -0,0 +1,30 @@ + + + + + + + + Encryptor + + + + + + + + +
+
+ + + + +
+
+ ... + + + + + \ No newline at end of file diff --git a/Code/chadL/html_css/lab6v2/app.py b/Code/chadL/html_css/lab6v2/app.py new file mode 100644 index 00000000..0b546c5e --- /dev/null +++ b/Code/chadL/html_css/lab6v2/app.py @@ -0,0 +1,62 @@ +from flask import Flask, render_template, Request + +app = Flask(__name__) + +@app.route('/') +def index(): + return render_template('index.html') + + +if __name__ == '__main__': + app.run() + +# $env:FLASK_APP = "app.py" +# $env:FLASK_ENV = "development" + +#Lab 7: ROT Cipher + +hacker = input("What shall we encypt? ").lower() #ask user for words to encypt + +rot13_dict = { #dictinary of associated letters + "a": "n", + "b": "o", + "c": "p", + "d": "q", + "e": "r", + "f": "s", + "g": "t", + "h": "u", + "i": "v", + "j": "w", + "k": "x", + "l": "y", + "m": "z", + "n": "a", + "o": "b", + "p": "c", + "q": "d", + "r": "e", + "s": "f", + "t": "g", + "u": "h", + "v": "i", + "w": "j", + "x": "k", + "y": "l", + "z": "m", + " ": " " +} + +hacker = list(hacker) #turn input into list + + +def rot_13(hacker): #fucntion to turn input into list. + rot13_list = [] + for letter in hacker: #loop to add appended letter to list + cypher = rot13_dict[letter] + rot13_list.append(cypher) # add cypher to rot13 list + + final_answer = ''.join(rot13_list) # .join seperates everything except the letters. + print(f"Your encrypted code is: {final_answer}") + +rot_13(hacker) \ No newline at end of file diff --git a/Code/chadL/html_css/lab6v2/index.html b/Code/chadL/html_css/lab6v2/index.html new file mode 100644 index 00000000..7577ca7e --- /dev/null +++ b/Code/chadL/html_css/lab6v2/index.html @@ -0,0 +1,22 @@ + + + + + + + Document + + + + +
+
+ + + + + ... + + + + \ No newline at end of file diff --git a/Code/chadL/html_css/lab6v2/styles.css b/Code/chadL/html_css/lab6v2/styles.css new file mode 100644 index 00000000..add3a61f --- /dev/null +++ b/Code/chadL/html_css/lab6v2/styles.css @@ -0,0 +1,10 @@ +body{ + border: 2px solid blue; + align-items: center; + justify-content: center; + display: flex; +} + +img{ + background-image: cover; +} \ No newline at end of file diff --git a/Code/hello_app/__init__.py b/Code/hello_app/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Code/hello_app/admin.py b/Code/hello_app/admin.py new file mode 100644 index 00000000..8c38f3f3 --- /dev/null +++ b/Code/hello_app/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/Code/hello_app/apps.py b/Code/hello_app/apps.py new file mode 100644 index 00000000..37e3c0e4 --- /dev/null +++ b/Code/hello_app/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class HelloAppConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'hello_app' diff --git a/Code/hello_app/index.html b/Code/hello_app/index.html new file mode 100644 index 00000000..228d6781 --- /dev/null +++ b/Code/hello_app/index.html @@ -0,0 +1,12 @@ + + + + + + + Document + + +

{{hello}}

+ + \ No newline at end of file diff --git a/Code/hello_app/migrations/__init__.py b/Code/hello_app/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Code/hello_app/models.py b/Code/hello_app/models.py new file mode 100644 index 00000000..71a83623 --- /dev/null +++ b/Code/hello_app/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/Code/hello_app/templates b/Code/hello_app/templates new file mode 100644 index 00000000..e69de29b diff --git a/Code/hello_app/tests.py b/Code/hello_app/tests.py new file mode 100644 index 00000000..7ce503c2 --- /dev/null +++ b/Code/hello_app/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/Code/hello_app/urls.py b/Code/hello_app/urls.py new file mode 100644 index 00000000..f0ab5acc --- /dev/null +++ b/Code/hello_app/urls.py @@ -0,0 +1,11 @@ +from django.urls import path +from . import views + +urlpatterns = [ + path('hello', views.hello, name='hello') + + path('bruce', views.bruce, name='bruce') + + path('batman', views.batman, name='batman') + + ] diff --git a/Code/hello_app/views.py b/Code/hello_app/views.py new file mode 100644 index 00000000..c0c8d828 --- /dev/null +++ b/Code/hello_app/views.py @@ -0,0 +1,15 @@ +from django.shortcuts import render +from django.http import HttpResponse +# Create your views here. +def hello(request): + return HttpResponse('

Hello World ') + +def bruce(request): + return HttpResponse("hello Bruce") + +def batman(request): + return render(request, 'hello_app/index.html', {'name':name}) + + + + diff --git a/Code/kiwi_firstproj/__init__.py b/Code/kiwi_firstproj/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Code/kiwi_firstproj/asgi.py b/Code/kiwi_firstproj/asgi.py new file mode 100644 index 00000000..2fb9383b --- /dev/null +++ b/Code/kiwi_firstproj/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for kiwi_firstproj project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'kiwi_firstproj.settings') + +application = get_asgi_application() diff --git a/Code/kiwi_firstproj/settings.py b/Code/kiwi_firstproj/settings.py new file mode 100644 index 00000000..c6ba16d6 --- /dev/null +++ b/Code/kiwi_firstproj/settings.py @@ -0,0 +1,123 @@ +""" +Django settings for kiwi_firstproj project. + +Generated by 'django-admin startproject' using Django 4.0.3. + +For more information on this file, see +https://docs.djangoproject.com/en/4.0/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/4.0/ref/settings/ +""" + +from pathlib import Path + +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = Path(__file__).resolve().parent.parent + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-*6)thcvjb&jd1tmmwzg@n1djcvwwm(e)lqgie$d^wah0j29plb' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'kiwi_firstproj.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'kiwi_firstproj.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/4.0/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/4.0/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'America/New_York' + +USE_I18N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/4.0/howto/static-files/ + +STATIC_URL = 'static/' + +# Default primary key field type +# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/Code/kiwi_firstproj/urls.py b/Code/kiwi_firstproj/urls.py new file mode 100644 index 00000000..7ff274e1 --- /dev/null +++ b/Code/kiwi_firstproj/urls.py @@ -0,0 +1,22 @@ +"""kiwi_firstproj URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/4.0/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import path, include + +urlpatterns = [ + path('admin/', admin.site.urls), + path('hello/', include('hello_app.urls')) +] diff --git a/Code/kiwi_firstproj/wsgi.py b/Code/kiwi_firstproj/wsgi.py new file mode 100644 index 00000000..8e2b8698 --- /dev/null +++ b/Code/kiwi_firstproj/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for kiwi_firstproj project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/4.0/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'kiwi_firstproj.settings') + +application = get_wsgi_application() diff --git a/Code/manage.py b/Code/manage.py new file mode 100644 index 00000000..68d80c8a --- /dev/null +++ b/Code/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'kiwi_firstproj.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main()