Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bv #191

Open
wants to merge 60 commits into
base: master
Choose a base branch
from
Open

bv #191

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
44454e4
Update streamlit_app.py
maxrcode-source Feb 13, 2024
45b751e
New
maxrcode-source Feb 13, 2024
1bfff4c
COOL
maxrcode-source Feb 13, 2024
7645a5b
Commit
maxrcode-source Feb 13, 2024
3fde948
Commit
maxrcode-source Feb 13, 2024
501c6ca
Commit
maxrcode-source Feb 13, 2024
7228ccb
Commit
maxrcode-source Feb 13, 2024
03a36d0
Change Title
maxrcode-source Feb 14, 2024
091cd51
Update
maxrcode-source Feb 14, 2024
89e21d9
Update
maxrcode-source Feb 14, 2024
9f68b8b
Test
maxrcode-source Feb 14, 2024
fd24e3e
Update README.md
maxrcode-source Feb 14, 2024
3255804
Update README.md
maxrcode-source Feb 14, 2024
5e52acc
Update README.md
maxrcode-source Feb 14, 2024
0bf4061
Update README.md
maxrcode-source Feb 14, 2024
1a1a441
Update README.md
maxrcode-source Feb 14, 2024
5fd3a6b
Update README.md
maxrcode-source Feb 14, 2024
1f7224b
Update streamlit_app.py
maxrcode-source Apr 4, 2024
b454d61
NEW UPDATE!!!!
maxrcode-source Apr 4, 2024
6b7002b
New
maxrcode-source Apr 4, 2024
ad5e90c
new
maxrcode-source Apr 4, 2024
969338f
1
maxrcode-source Apr 4, 2024
a6af5e5
1
maxrcode-source Apr 4, 2024
cfea44e
1
maxrcode-source Apr 4, 2024
4a834dc
1
maxrcode-source Apr 4, 2024
a166396
Update streamlit_app.py
maxrcode-source Apr 5, 2024
53d7e6c
Update streamlit_app.py
maxrcode-source Apr 5, 2024
e30d303
Update streamlit_app.py
maxrcode-source Apr 5, 2024
fd7788f
Update streamlit_app.py
maxrcode-source Apr 5, 2024
45b6ed8
Incorporated NCCP program as another page.
maxrcode-source Apr 5, 2024
75f88ab
First Page: NCPP
maxrcode-source Apr 12, 2024
b316c23
new
maxrcode-source Apr 12, 2024
c2ab3f0
NEW
maxrcode-source Apr 12, 2024
8c4f008
fix
maxrcode-source Apr 12, 2024
8198068
Delete shslogo.png
maxrcode-source Apr 15, 2024
f3437b3
Delete requirements.txt
maxrcode-source Apr 15, 2024
ed0482e
Delete replit.nix
maxrcode-source Apr 15, 2024
2ca83c3
Delete ncpp.py
maxrcode-source Apr 15, 2024
4850c2d
Delete home.py
maxrcode-source Apr 15, 2024
37b1dbc
Delete README.md
maxrcode-source Apr 15, 2024
4917641
Delete .replit
maxrcode-source Apr 15, 2024
047640d
Delete .breakpoints
maxrcode-source Apr 15, 2024
76204be
Delete .devcontainer directory
maxrcode-source Apr 15, 2024
70e77a7
Add files via upload
maxrcode-source Apr 15, 2024
567eafe
Add files via upload
maxrcode-source Apr 15, 2024
8f81f4f
Delete streamlit_app.py
maxrcode-source Apr 15, 2024
0cd244b
Delete shslogo.png
maxrcode-source Apr 15, 2024
c8965a4
Delete requirements.txt
maxrcode-source Apr 15, 2024
28290bf
Delete replit.nix
maxrcode-source Apr 15, 2024
8e6da03
Delete pages
maxrcode-source Apr 15, 2024
4d988df
Delete devcontainer.json
maxrcode-source Apr 15, 2024
deb7104
Delete README.md
maxrcode-source Apr 15, 2024
7c8d3ff
Added Dev Container Folder
maxrcode-source Apr 16, 2024
90c4f5f
Add files via upload
maxrcode-source Apr 16, 2024
517a747
Delete home.py
maxrcode-source Apr 16, 2024
c1344d8
Add files via upload
maxrcode-source Apr 16, 2024
681b523
Add files via upload
maxrcode-source Apr 16, 2024
47de7fd
Rename breakpoints (1).txt to .breakpoints
maxrcode-source Apr 16, 2024
0e741d3
Rename replit.txt to .replit
maxrcode-source Apr 16, 2024
a060d05
NEW UPDATE!!!!!
maxrcode-source Apr 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .breakpoints
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"files": {
"streamlit_app.py": [
{
"id": "ee89d22e-c5da-4850-bef3-9f1e8fefb11b",
"line": 13,
"version": 893,
"index": 411
}
]
}
}
14 changes: 6 additions & 8 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
{
"name": "Python 3",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye",
"customizations": {
"name": "Python 3",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye",
"customizations": {
"codespaces": {
"openFiles": [
"README.md",
Expand All @@ -19,7 +17,7 @@
]
}
},
"updateContentCommand": "[ -f packages.txt ] && sudo apt update && sudo apt upgrade && sudo xargs apt install -y <packages.txt; pip3 install --user -r requirements.txt",
"updateContentCommand": "[ -f packages.txt ] && sudo apt update && sudo apt upgrade -y && sudo xargs apt install -y <packages.txt; [ -f requirements.txt ] && pip3 install --user -r requirements.txt; pip3 install --user streamlit; echo '✅ Packages installed and Requirements met'",
"postAttachCommand": {
"server": "streamlit run streamlit_app.py --server.enableCORS false --server.enableXsrfProtection false"
},
Expand All @@ -32,4 +30,4 @@
"forwardPorts": [
8501
]
}
}
14 changes: 14 additions & 0 deletions .replit
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
entrypoint = "main.py"
modules = ["python-3.10:v18-20230807-322e88b"]

hidden = [".pythonlibs"]

[nix]
channel = "stable-23_05"

[unitTest]
language = "python3"

[deployment]
run = ["python3", "main.py"]
deploymentTarget = "cloudrun"
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Welcome to Streamlit!
# Welcome to my website; **The SHS Computer Science Site.**

Edit `/streamlit_app.py` to customize this app to your heart's desire. :heart:

If you have any questions, checkout our [documentation](https://docs.streamlit.io) and [community
forums](https://discuss.streamlit.io).
This website is NOT affilated with SUSD in any way, and is actually student made for the Computer Science Program to help educate other students. :suspect:
140 changes: 140 additions & 0 deletions pages/ncpp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
import altair as alt
import numpy as np
import pandas as pd
import streamlit as st
import smtplib

"""
Number Conversion Practice
"""
import random


st.write("Welcome to the NUMBER CONVERSION PRACTICE PROGRAM.")
st.write("To get started, input what you like to practice below.")
st.write()


numbersystem = ["binary", "hexadecimal", "decimal", "octal"]

selecting = True

while selecting:
first = st.text_input("What Number System you'd like to convert? ", key=1)

second = st.text_input("What would you like to convert it to? ", key=2)

if first == "binary" or first == "hexadecimal" or first == "decimal" or first == "octal" or second == "binary" or second == "hexadecimal" or second == "decimal" or second == "octal":
st.write()
st.write()
st.write()
st.write("Okay, let's practice converting", first, "to", second + ".")
st.write("Press 'Run' above if you want to reset the program and pick another number conversion")
running = True
break

else:
st.write("Not a valid st.text_input. Try again.")
continue

a = []




while running:
for i in range(999):
a.append(i)
random.shuffle(a)
number = a[0]



if first == "binary":
number = (str(bin(number))[2:])
st.write("Convert", number, "to", second + ".")
st.write()
st.write()
response = int(st.text_input("Answer: "),key=3)



if second == "octal":
answer = (str(oct(a[0]))[1:])
if second == "hexadecimal":
answer = (str(hex(a[0]))[2:])
if second == "decimal":
answer = a[0]
if second == "binary":
answer = (str(bin(a[0]))[2:])



if first == "decimal":
number = str(number)
st.write("Convert", number, "to", second + ".")
st.write()
st.write()
response = int(st.text_input("Answer: "),key=4)



if second == "octal":
answer = (str(oct(a[0]))[1:])
if second == "hexadecimal":
answer = (str(hex(a[0]))[2:])
if second == "decimal":
answer = a[0]
if second == "binary":
answer = (str(bin(a[0]))[2:])



if first == "hexadecimal":
number = (str(hex(number))[2:])
st.write("Convert", number, "to", second + ".")
st.write()
st.write()
response = int(st.text_input("Answer: "),key=5)



if second == "octal":
answer = (str(oct(a[0]))[1:])
if second == "hexadecimal":
answer = (str(hex(a[0]))[2:])
if second == "decimal":
answer = a[0]
if second == "binary":
answer = (str(bin(a[0]))[2:])



if first == "octal":
number = (str(oct(number))[1:])
st.write("Convert", number, "to", second + ".")
st.write()
st.write()
response = int(st.text_input("Answer: "),key=6)



if second == "octal":
answer = (str(oct(a[0]))[1:])
if second == "hexadecimal":
answer = (str(hex(a[0]))[2:])
if second == "decimal":
answer = a[0]
if second == "binary":
answer = (str(bin(a[0]))[2:])



if response == int(answer):
st.write("Correct!")
st.write()
st.write()
else:
st.write("Wrong!")
st.write()
st.write()
80 changes: 80 additions & 0 deletions pages/tsastudyguiderandom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import altair as alt
import numpy as np
import pandas as pd
import streamlit as st
import smtplib

"""
TSA Study Guide
"""
import random

def split_file_by_bracket(file_path):

with open(file_path, 'r') as file:

file_contents = file.read()

result_list = file_contents.split('[')

result_list = [item.strip() for item in result_list if item.strip()]

return result_list

def split_file_by_bracket2(file_path):

with open(file_path, 'r') as file:

file_contents = file.read()

answer_list = file_contents.split('@')

answer_list = [item.strip() for item in answer_list if item.strip()]

return answer_list


file_path = 'studyguide.txt'
result = split_file_by_bracket(file_path)
answer = split_file_by_bracket2(file_path)

counter = 0

score = 0

order = []

for i in range(135):
order.append(i)

random.shuffle(order)
st.text(order)

for i in range(len(result)):

st.text(str(result[order[i]])[3:len(result[order[i]])])
answer[i] = str(answer[order[i]])[len(answer[order[i]])-1:len(answer[order[i]])]

#st.text(answer[i])

user = st.text_input("Your Answer: ")


if user == answer[i]:
st.text("Correct!")
score += 1
else:
st.text("Wrong!")

st.text()
st.text()
st.text()

counter += 1
if counter == 135:
st.text()
st.text()
st.text()
st.text()
st.text("You reached the end of this Practice Test, your score was: " + str(score) + " out of 135 questions correct.")
break
5 changes: 5 additions & 0 deletions replit.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{pkgs}: {
deps = [
pkgs.glibcLocales
];
}
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
altair
pandas
streamlit
numpy
Binary file added shslogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 21 additions & 35 deletions streamlit_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,25 @@
import numpy as np
import pandas as pd
import streamlit as st
import smtplib

"""
# Welcome to Streamlit!

Edit `/streamlit_app.py` to customize this app to your heart's desire :heart:.
If you have any questions, checkout our [documentation](https://docs.streamlit.io) and [community
forums](https://discuss.streamlit.io).

In the meantime, below is an example of what you can do with just a few lines of code:
"""

num_points = st.slider("Number of points in spiral", 1, 10000, 1100)
num_turns = st.slider("Number of turns in spiral", 1, 300, 31)

indices = np.linspace(0, 1, num_points)
theta = 2 * np.pi * num_turns * indices
radius = indices

x = radius * np.cos(theta)
y = radius * np.sin(theta)

df = pd.DataFrame({
"x": x,
"y": y,
"idx": indices,
"rand": np.random.randn(num_points),
})

st.altair_chart(alt.Chart(df, height=700, width=700)
.mark_point(filled=True)
.encode(
x=alt.X("x", axis=None),
y=alt.Y("y", axis=None),
color=alt.Color("idx", legend=None, scale=alt.Scale()),
size=alt.Size("rand", legend=None, scale=alt.Scale(range=[1, 150])),
))

st.title('SHS Computer Science Site')
st.write('This brand new site, coded in Python with hosting/library provided by _Streamlit.io_, is for all things Computer Science within Sahuarita High School, this website will provide resources for things such as the CS TSA Test.')
#st.image('shslogo.png', caption='Sahuarita High School Mustang', width=600)

st.divider()

st.header("Here is all of the available practice tests located below.")

with st.expander("Full TSA Practice Test", expanded=False):
st.page_link("pages/ncpp.py", label="NUMBER CONVERSION PRACTICE PROGRAM", icon="1️⃣")




st.header("And here, is all of the available resources located below.")

st.divider()

st.write("This site is currently under construction, so please be patient with the site. Due to the limitations of the platform of the previous site, I have decided that it would be best to start fresh. I will be adding more features to the site as time goes on. Thank you.")
Loading