Skip to content

Gyyzzz branch #409

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
27 changes: 27 additions & 0 deletions Data Structures and Algorithms/queues.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
class Queue:
def __init__(self):
self.queue = []

def enqueue(self, item):
self.queue.append(item)

def dequeue(self):
if not self.is_empty():
return self.queue.pop(0)
return "Queue is empty"

def is_empty(self):
return len(self.queue) == 0

def peek(self):
return self.queue[0] if not self.is_empty() else None

def size(self):
return len(self.queue)

# Example Usage
q = Queue()
q.enqueue(10)
q.enqueue(20)
print(q.dequeue()) # Output: 10
print(q.peek()) # Output: 20
3 changes: 3 additions & 0 deletions FLASK PROJECTS/Anniversary time/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Anniversary Timing

Simple timing page implemented using flask
17 changes: 17 additions & 0 deletions FLASK PROJECTS/Anniversary time/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from flask import Flask, render_template
from datetime import datetime

app = Flask(__name__)

# 在此定义纪念日日期
anniversary_date = datetime(2024, 6, 16)

@app.route('/')
def index():
current_date = datetime.now()
delta = current_date - anniversary_date
days_passed = delta.days
return render_template('index.html', days_passed=days_passed, anniversary_date=anniversary_date.strftime("%Y-%m-%d %H:%M:%S"))

if __name__ == '__main__':
app.run(debug=False)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions FLASK PROJECTS/Anniversary time/static/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
body {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
background: url('background.jpg') no-repeat center center fixed;
background-size: cover;
color: white;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}

.container {
text-align: center;
background-color: rgba(0, 0, 0, 0.5);
padding: 20px;
border-radius: 10px;
}

h1 {
font-size: 3em;
}

.time {
font-size: 2em;
margin-top: 20px;
}

.time span {
font-weight: bold;
}
39 changes: 39 additions & 0 deletions FLASK PROJECTS/Anniversary time/templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Anniversary</title>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
<script>
function updateTimer() {
const anniversaryDate = new Date("{{ anniversary_date }}");
const currentDate = new Date();
const timeDiff = currentDate - anniversaryDate;

const days = Math.floor(timeDiff / (1000 * 60 * 60 * 24));
const hours = Math.floor((timeDiff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = Math.floor((timeDiff % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((timeDiff % (1000 * 60)) / 1000);

document.getElementById("days").innerText = days;
document.getElementById("hours").innerText = hours;
document.getElementById("minutes").innerText = minutes;
document.getElementById("seconds").innerText = seconds;
}

setInterval(updateTimer, 1000);
</script>
</head>
<body onload="updateTimer()">
<div class="container">
<h1>It has passed the xx anniversary</h1>
<div class="time">
<span id="days">0</span> 天
<span id="hours">0</span> 小时
<span id="minutes">0</span> 分钟
<span id="seconds">0</span> 秒
</div>
</div>
</body>
</html>
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,16 @@ guide [HERE](https://github.com/larymak/Python-project-Scripts/blob/main/CONTRIB
| 64 | [Umbrella Reminder](https://github.com/larymak/Python-project-Scripts/tree/main/TIME%20SCRIPTS/Umbrella%20Reminder) | [Edula Vinay Kumar Reddy](https://github.com/vinayedula) |
| 65 | [Image to PDF](https://github.com/larymak/Python-project-Scripts/tree/main/IMAGES%20%26%20PHOTO%20SCRIPTS/Image%20to%20PDF) | [Vedant Chainani](https://github.com/Envoy-VC) |
| 66 | [KeyLogger](https://github.com/larymak/Python-project-Scripts/tree/main/OTHERS/KeyLogger) | [Akhil](https://github.com/akhil-chagarlamudi) |
| 67 | [PDF Text Extractor](https://github.com/SamAddy/Python-project-Scripts/tree/main/PYTHON%20APPS/PDF-Text-Extractor) | [Samuel Addison](https://github.com/SamAddy)
| 68 | [Analyze docx file](https://github.com/larymak/Python-project-Scripts/tree/main/AUTOMATION/analyzing%20and%20writing%20.docx%20file) | [Kashaan Mahmood](https://github.com/Kashaan-M)
| 69 | [Bitcoin Price](https://github.com/larymak/Python-project-Scripts/tree/main/WEB%20SCRAPING/Bitcoin%20Price) | [Olu-Olagbuji Delight](https://github.com/Dheelyte)
| 70 | [Password Generator](https://github.com/larymak/Python-project-Scripts/tree/main/GUI/Password%20Generator) | [LpCodes](https://github.com/LpCodes)
| 71 | [HTML to Excel](https://github.com/larymak/Python-project-Scripts/tree/main/CONVERSION%20SCRIPTS/HTML%20to%20Excel) | [LpCodes](https://github.com/LpCodes)
| 67 | [PDF Text Extractor](https://github.com/SamAddy/Python-project-Scripts/tree/main/PYTHON%20APPS/PDF-Text-Extractor) | [Samuel Addison](https://github.com/SamAddy)|
| 68 | [Analyze docx file](https://github.com/larymak/Python-project-Scripts/tree/main/AUTOMATION/analyzing%20and%20writing%20.docx%20file) | [Kashaan Mahmood](https://github.com/Kashaan-M)|
| 69 | [Bitcoin Price](https://github.com/larymak/Python-project-Scripts/tree/main/WEB%20SCRAPING/Bitcoin%20Price) | [Olu-Olagbuji Delight](https://github.com/Dheelyte) |
| 70 | [Password Generator](https://github.com/larymak/Python-project-Scripts/tree/main/GUI/Password%20Generator) | [LpCodes](https://github.com/LpCodes) |
| 71 | [HTML to Excel](https://github.com/larymak/Python-project-Scripts/tree/main/CONVERSION%20SCRIPTS/HTML%20to%20Excel) | [LpCodes](https://github.com/LpCodes) |
| 72 | [Star pattern](https://github.com/larymak/Python-project-Scripts/tree/main/OTHERS/Star%20pattern) | [LpCodes](https://github.com/LpCodes) |
| 73 | [Logging Helper](https://github.com/larymak/Python-project-Scripts/tree/main/OTHERS/add-multiprocessing-logger) | [Jerry W.](https://github.com/Jerry0420) |
| 74 | [Notepad](https://github.com/larymak/Python-project-Scripts/tree/main/PYTHON%20APPS/Notepad) | [Annarhysa Albert](https://github.com/Annarhysa) |
| 75 | [Quadratic Equation Solver](https://github.com/larymak/Python-project-Scripts/tree/main/GUI/Quadratic-Equation-Solver) | [Akinfenwa Ezekiel](https://github.com/Ezek-iel) |
| 76 | [Internet Connectivity Monitor](https://github.com/larymak/Python-project-Scripts/tree/main/AUTOMATION/InternetConnectivityMonitor) | [Prince Khunt](https://github.com/princekhunt) |
| 76 | [E-commerce](https://github.com/larymak/Python-project-Scripts/tree/main/FLASK%20PROJECTS/E-commerce) | [Eter Nada](https://github.com/tarenjk24) |
| 77 | [E-commerce](https://github.com/larymak/Python-project-Scripts/tree/main/FLASK%20PROJECTS/E-commerce) | [Eter Nada](https://github.com/tarenjk24) |
| 78 | [Anniversary time](https://github.com/larymak/Python-project-Scripts/tree/main/FLASK%20PROJECTS/Anniversary%20time) | [gyyzzz](https://github.com/gyyzzz) |