diff --git a/Introduction to Computer Science/.vscode/launch.json b/Introduction to Computer Science/.vscode/launch.json index 977627f..03cd2cf 100644 --- a/Introduction to Computer Science/.vscode/launch.json +++ b/Introduction to Computer Science/.vscode/launch.json @@ -11,7 +11,7 @@ "request": "launch", "module": "flask", "env": { - "FLASK_APP": "app.py", + "FLASK_APP": "application.py", "FLASK_ENV": "development" }, "args": ["run"], diff --git a/Introduction to Computer Science/Website/Homepage/homepage.zip b/Introduction to Computer Science/Website/Homepage/homepage.zip new file mode 100644 index 0000000000000000000000000000000000000000..2ba649daf6376f5221fc6cc9b70546a8ccdd78a1 GIT binary patch literal 675 zcmWIWW@h1H0DZ(k4%!<-B<3>o>ksRfDYsrsQIoD9rn`}RlgnR6(*w1S&~k>x8R z0|Sc)0|Nud2oTM|z_G^H_t^2Ym+KiA7)%%$7=)3H$jnPgt;GviX|ILz3PfJTe}!vRMS6De+3A#sBdFCgP^#SFwaMg|6khDK)w21HaN z#}g|9Gbo<08VqqKrneymgIw6qXwQgbFmfQUGBASz0mEQcHjqYU24)6EMh1o+kn + + + + + + My Webpage + + +
+
+
+
+ +
+
+ Robin Rottstädt +
+
+ + +
+
+ +
+

+ Pellentesque habitant morbi tristique senectus et netus et malesuada + fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, + ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam + egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend + leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum + erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean + fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, + sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar + facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor + neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat + volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis + luctus, metus +

+
+ + diff --git a/Introduction to Computer Science/Website/Homepage/homepage/online.html b/Introduction to Computer Science/Website/Homepage/homepage/online.html new file mode 100644 index 0000000..390e680 --- /dev/null +++ b/Introduction to Computer Science/Website/Homepage/homepage/online.html @@ -0,0 +1,51 @@ + + + + + + + + Uber mich + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Week 0Scratch
Week 1C
Week 2Arrays
Week 3Algortihms
Week 4Memory
Week 5Data sctructures
Week 6Python
Week 7SQL
+
+ + diff --git a/Introduction to Computer Science/Website/Homepage/homepage/styles.css b/Introduction to Computer Science/Website/Homepage/homepage/styles.css new file mode 100644 index 0000000..345a72d --- /dev/null +++ b/Introduction to Computer Science/Website/Homepage/homepage/styles.css @@ -0,0 +1,61 @@ +#headerElements { + width: 800px; + font-size: 20pt; + margin: auto; + text-align: center; +} + +#name { + font-size: 20pt; + width: fit-content; + margin-right: 20px; + margin-left: 40px; + text-align: left; +} + +#nameAndPhoto { + align-items: center; + grid-template-columns: auto auto; +} + +.middle { + align-content: center; + margin: auto; + width: 800px; +} + +.middle2 { + align-content: center; + margin: auto; + font-size: larger; + margin-top: 20%; + width: 800px; +} + +#photo { + border-radius: 100%; + + float: right; +} + +header { + height: auto; + position: relative; + padding-top: 100px; + left: 0; + margin: auto; + width: 100%; + min-width: 980px; +} + +body { + font-size: larger; + font-family: Verdana, Geneva, Tahoma, sans-serif; + background-color: #ffefd25e; + width: 100%; + align-items: center; +} + +* { + box-sizing: border-box; +} diff --git a/Introduction to Computer Science/Website/Homepage/homepage/uber.html b/Introduction to Computer Science/Website/Homepage/homepage/uber.html new file mode 100644 index 0000000..d69b28a --- /dev/null +++ b/Introduction to Computer Science/Website/Homepage/homepage/uber.html @@ -0,0 +1,28 @@ + + + + + + + + Uber mich + + +
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames + ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, + tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. + Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit + amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum + sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget + tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim + ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent + dapibus, neque id cursus faucibus, tortor neque egestas augue, eu + vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt + quis, accumsan porttitor, facilisis luctus, metus +
+ + diff --git a/Introduction to Computer Science/Website/Homepage/homepage/vor.html b/Introduction to Computer Science/Website/Homepage/homepage/vor.html new file mode 100644 index 0000000..d69b28a --- /dev/null +++ b/Introduction to Computer Science/Website/Homepage/homepage/vor.html @@ -0,0 +1,28 @@ + + + + + + + + Uber mich + + +
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames + ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, + tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. + Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit + amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum + sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget + tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim + ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent + dapibus, neque id cursus faucibus, tortor neque egestas augue, eu + vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt + quis, accumsan porttitor, facilisis luctus, metus +
+ + diff --git a/Introduction to Computer Science/Website/finance/application.py b/Introduction to Computer Science/Website/finance/application.py new file mode 100644 index 0000000..7305821 --- /dev/null +++ b/Introduction to Computer Science/Website/finance/application.py @@ -0,0 +1,146 @@ +import os + +from cs50 import SQL +from flask import Flask, flash, jsonify, redirect, render_template, request, session +from flask_session import Session +from tempfile import mkdtemp +from werkzeug.exceptions import default_exceptions, HTTPException, InternalServerError +from werkzeug.security import check_password_hash, generate_password_hash + +from helpers import apology, login_required, lookup, usd + +# Configure application +app = Flask(__name__) + +# Ensure templates are auto-reloaded +app.config["TEMPLATES_AUTO_RELOAD"] = True + +# Ensure responses aren't cached + + +@app.after_request +def after_request(response): + response.headers["Cache-Control"] = "no-cache, no-store, must-revalidate" + response.headers["Expires"] = 0 + response.headers["Pragma"] = "no-cache" + return response + + +# Custom filter +app.jinja_env.filters["usd"] = usd + +# Configure session to use filesystem (instead of signed cookies) +app.config["SESSION_FILE_DIR"] = mkdtemp() +app.config["SESSION_PERMANENT"] = False +app.config["SESSION_TYPE"] = "filesystem" +Session(app) + +# Configure CS50 Library to use SQLite database +db = SQL("sqlite:///finance.db") + +""" +# Make sure API key is set +if not os.environ.get("API_KEY"): + raise RuntimeError("API_KEY not set") +""" + + +@app.route("/") +@login_required +def index(): + """Show portfolio of stocks""" + return apology("TODO") + + +@app.route("/buy", methods=["GET", "POST"]) +@login_required +def buy(): + """Buy shares of stock""" + return apology("TODO") + + +@app.route("/history") +@login_required +def history(): + """Show history of transactions""" + return apology("TODO") + + +@app.route("/login", methods=["GET", "POST"]) +def login(): + """Log user in""" + + # Forget any user_id + session.clear() + + # User reached route via POST (as by submitting a form via POST) + if request.method == "POST": + + # Ensure username was submitted + if not request.form.get("username"): + return apology("must provide username", 403) + + # Ensure password was submitted + elif not request.form.get("password"): + return apology("must provide password", 403) + + # Query database for username + rows = db.execute("SELECT * FROM users WHERE username = :username", + username=request.form.get("username")) + + # Ensure username exists and password is correct + if len(rows) != 1 or not check_password_hash(rows[0]["hash"], request.form.get("password")): + return apology("invalid username and/or password", 403) + + # Remember which user has logged in + session["user_id"] = rows[0]["id"] + + # Redirect user to home page + return redirect("/") + + # User reached route via GET (as by clicking a link or via redirect) + else: + return render_template("login.html") + + +@app.route("/logout") +def logout(): + """Log user out""" + + # Forget any user_id + session.clear() + + # Redirect user to login form + return redirect("/") + + +@app.route("/quote", methods=["GET", "POST"]) +@login_required +def quote(): + """Get stock quote.""" + return apology("TODO") + + +@app.route("/register", methods=["GET", "POST"]) +def register(): + """Register user""" + return apology("TODO") + + +@app.route("/sell", methods=["GET", "POST"]) +@login_required +def sell(): + """Sell shares of stock""" + return apology("TODO") + + +def errorhandler(e): + """Handle error""" + if not isinstance(e, HTTPException): + e = InternalServerError() + return apology(e.name, e.code) + + +# Listen for errors +for code in default_exceptions: + app.errorhandler(code)(errorhandler) diff --git a/Introduction to Computer Science/Website/finance/finance.db b/Introduction to Computer Science/Website/finance/finance.db new file mode 100644 index 0000000000000000000000000000000000000000..46ea1bc50c526110811371a1bfe48c93dd7ed55a GIT binary patch literal 4096 zcmWFz^vNtqRY=P(%1ta$FlJz3U}R))P*7lCU|?ckU|?ZD0CYYhLJB8~i9z=n6E6b; z12fYi24+{L&rFMOsvVUW4FN16;Lpq^E-TJhnVFZ8T2We@T9lWVn+l?fS)7Ah9Yb6d zLj61gLtPa-{ajol6x2adASLPw{(cHdAYQSOf(DoY5?0a-U}6*3)@F<>NleN~EiTN- zEJ=+oPAx1=%}Yk-GDB?$adh%=RX|g#0WwafIJHo-(Sng(TwI*7$scSc*iJCPgrXnp zv|@Dy4fV_vbp=nq5Lb8CAccS+PhZENNCj`#NCn5x5PwfU=O9;KSHBPiKmQN~zfd0^ z9b`|1xJIDJWF!`6s4Jk0CWA%&LVaC>Je}bNDY&@0IfnX#C>RW14ADR1A_(w1A_oaoB<-vKqT-v_g~-p z^q(2dOQ+q4TT=fwX<5@>5Zn9o-x(k|T*mmG`OoEh`u|LyGyng&Z`uDpc46uNOHXh9 zzxd?(|ByL(|3P9PIp4GYXM)rsn*-weocVvq_sswQAndYq`hVBSiT?}NwEe&Q^w$5> zrM3S-VjwvX_Bjhy%LOw7WG_e@gzdLH`ES%#{6BO~{{LGqAN;T1GU>nXjEw)r?Ir*1 zw>|}%4^jtm2S`82PhfYQ`TyT(=d1s$eg*$EOB4P(PKf)z^V;G6NA8^c?>RLEEC!MT zsR8K+=>h5WKKp+Lh!4V2#k2l1xTgJ=O;7xRSOdS%cLcO<)n&d!`%SY zdmW?~g!QH#{BO48(tpS8FaCQ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g57zGwa)_dWCf8zp8_qSxp2|L?@;2emWRIye9KIQ$itKj7k^Hj?qY({Mg9=HpWX z3OntId%)>Qd*WWa=DO~C|DP|e=|784-hY?9@A0aI+j$yy_=Eh-8`}uB87^}kHn-2X0n-+|l6Yyrjp#q*}(wI7uJd~oDHko_?1ed70jz3GSlvj>&_XY$Mf zn-7yiryX~^{4Y~JAM8%~nk9tnpM$IXfthQ*^vZv>fFiJYd~wbHtybT}YNq$eKmTPb z7lPF>d*%FBYFho@^XPZ1YGG!B+LN9q{`2{s{r>|dhE9XRkvp>Xzs>r4|3PUH6u#(c zKzzeFC%|@t%6m{>0hAU&btgy;2L_kFpgO?k?Ekqq)PVa&Z2m?6)!H|L`!7tM*;xH# zwdNMse(~HX{}t+%{|AKuu5uS-7pP4OvKxd!ZCp^D2ogufpz>BIwHs_UPjvl%lZEH7 z+7HqP>ZgMGgP?o>iVHmD#b1z}AiH7M=j{JZkQvyp{pQF289g$=aez%8Sqzl+gi^b3 zx)G$-=k)(Bn7uIC^4Nb)eC;ogJ}O~QyBejB2Xlk(vHu#l+MiUh8`7=@bRlSDM!rd literal 0 HcmV?d00001 diff --git a/Introduction to Computer Science/Website/finance/static/styles.css b/Introduction to Computer Science/Website/finance/static/styles.css new file mode 100644 index 0000000..67e42e8 --- /dev/null +++ b/Introduction to Computer Science/Website/finance/static/styles.css @@ -0,0 +1,47 @@ +nav .navbar-brand +{ + /* size for brand */ + font-size: xx-large; +} + +/* colors for brand */ +nav .navbar-brand .blue +{ + color: #537fbe; +} +nav .navbar-brand .red +{ + color: #ea433b; +} +nav .navbar-brand .yellow +{ + color: #f5b82e; +} +nav .navbar-brand .green +{ + color: #2e944b; +} + +main .form-control +{ + /* center form controls */ + display: inline-block; + + /* override Bootstrap's 100% width for form controls */ + width: auto; +} + +main +{ + /* scroll horizontally as needed */ + overflow-x: auto; + + /* center contents */ + text-align: center; +} + +main img +{ + /* constrain images on small screens */ + max-width: 100%; +} diff --git a/Introduction to Computer Science/Website/finance/templates/apology.html b/Introduction to Computer Science/Website/finance/templates/apology.html new file mode 100644 index 0000000..6003a56 --- /dev/null +++ b/Introduction to Computer Science/Website/finance/templates/apology.html @@ -0,0 +1,9 @@ +{% extends "layout.html" %} + +{% block title %} + Apology +{% endblock %} + +{% block main %} + {{ top }} +{% endblock %} diff --git a/Introduction to Computer Science/Website/finance/templates/layout.html b/Introduction to Computer Science/Website/finance/templates/layout.html new file mode 100644 index 0000000..4bd64b2 --- /dev/null +++ b/Introduction to Computer Science/Website/finance/templates/layout.html @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + C$50 Finance: {% block title %}{% endblock %} + + + + + + + + {% if get_flashed_messages() %} +
+ +
+ {% endif %} + +
+ {% block main %}{% endblock %} +
+ + + + + + diff --git a/Introduction to Computer Science/Website/finance/templates/login.html b/Introduction to Computer Science/Website/finance/templates/login.html new file mode 100644 index 0000000..0a2404b --- /dev/null +++ b/Introduction to Computer Science/Website/finance/templates/login.html @@ -0,0 +1,17 @@ +{% extends "layout.html" %} + +{% block title %} + Log In +{% endblock %} + +{% block main %} +
+
+ +
+
+ +
+ +
+{% endblock %} diff --git a/Introduction to Computer Science/workspace.code-workspace b/Introduction to Computer Science/workspace.code-workspace index 04b40b3..57817df 100644 --- a/Introduction to Computer Science/workspace.code-workspace +++ b/Introduction to Computer Science/workspace.code-workspace @@ -7,9 +7,15 @@ "settings": { "sqltools.connections": [ { - "database": "${workspaceFolder:Introduction to Computer Science}/Website/Flask/register/lecture.db", + "database": "${workspaceFolder:Introduction to Computer Science}/Website/CS50 register/finance.db", "driver": "SQLite", - "name": "lectures", + "name": "finante", + "previewLimit": 50 + }, + { + "database": "${workspaceFolder:Introduction to Computer Science}/Website/CS50 register/lecture.db", + "driver": "SQLite", + "name": "lec", "previewLimit": 50 } ],