├── .github
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── ISSUE_TEMPLATE
│ └── feature_request.md
└── PULL_REQUEST_TEMPLATE.md
├── Javascript
├── Random-Quote-Generator.md
└── ReactJS
│ ├── Calculator.md
│ └── ToDoApp.md
├── LICENSE
├── Laravel
└── my-first-badges
│ ├── .editorconfig
│ ├── .env.example
│ ├── .gitattributes
│ ├── .gitignore
│ ├── README.md
│ ├── app
│ ├── Console
│ │ └── Kernel.php
│ ├── Exceptions
│ │ └── Handler.php
│ ├── Http
│ │ ├── Controllers
│ │ │ └── Controller.php
│ │ ├── Kernel.php
│ │ └── Middleware
│ │ │ ├── Authenticate.php
│ │ │ ├── EncryptCookies.php
│ │ │ ├── PreventRequestsDuringMaintenance.php
│ │ │ ├── RedirectIfAuthenticated.php
│ │ │ ├── TrimStrings.php
│ │ │ ├── TrustHosts.php
│ │ │ ├── TrustProxies.php
│ │ │ ├── ValidateSignature.php
│ │ │ └── VerifyCsrfToken.php
│ ├── Models
│ │ └── User.php
│ └── Providers
│ │ ├── AppServiceProvider.php
│ │ ├── AuthServiceProvider.php
│ │ ├── BroadcastServiceProvider.php
│ │ ├── EventServiceProvider.php
│ │ └── RouteServiceProvider.php
│ ├── artisan
│ ├── bootstrap
│ ├── app.php
│ └── cache
│ │ └── .gitignore
│ ├── composer.json
│ ├── composer.lock
│ ├── config
│ ├── app.php
│ ├── auth.php
│ ├── broadcasting.php
│ ├── cache.php
│ ├── cors.php
│ ├── database.php
│ ├── filesystems.php
│ ├── hashing.php
│ ├── logging.php
│ ├── mail.php
│ ├── queue.php
│ ├── sanctum.php
│ ├── services.php
│ ├── session.php
│ └── view.php
│ ├── database
│ ├── .gitignore
│ ├── factories
│ │ └── UserFactory.php
│ ├── migrations
│ │ ├── 2014_10_12_000000_create_users_table.php
│ │ ├── 2014_10_12_100000_create_password_reset_tokens_table.php
│ │ ├── 2019_08_19_000000_create_failed_jobs_table.php
│ │ └── 2019_12_14_000001_create_personal_access_tokens_table.php
│ └── seeders
│ │ └── DatabaseSeeder.php
│ ├── package.json
│ ├── phpunit.xml
│ ├── public
│ ├── .htaccess
│ ├── favicon.ico
│ ├── index.php
│ └── robots.txt
│ ├── resources
│ ├── css
│ │ └── app.css
│ ├── js
│ │ ├── app.js
│ │ └── bootstrap.js
│ └── views
│ │ └── welcome.blade.php
│ ├── routes
│ ├── api.php
│ ├── channels.php
│ ├── console.php
│ └── web.php
│ ├── storage
│ ├── app
│ │ ├── .gitignore
│ │ └── public
│ │ │ └── .gitignore
│ ├── framework
│ │ ├── .gitignore
│ │ ├── cache
│ │ │ ├── .gitignore
│ │ │ └── data
│ │ │ │ └── .gitignore
│ │ ├── sessions
│ │ │ └── .gitignore
│ │ ├── testing
│ │ │ └── .gitignore
│ │ └── views
│ │ │ └── .gitignore
│ └── logs
│ │ └── .gitignore
│ ├── tests
│ ├── CreatesApplication.php
│ ├── Feature
│ │ └── ExampleTest.php
│ ├── TestCase.php
│ └── Unit
│ │ └── ExampleTest.php
│ └── vite.config.js
├── Python
├── Countdown-Timer.md
├── Number-Guessing-Game.md
├── Password-Generator.md
├── Rock-Paper-Scissors.md
├── encrypt.md
└── subsequence-algorithm.md
└── README.md
/.github/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | We, as contributors and maintainers, pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6 |
7 | ## Our Standards
8 |
9 | Examples of behavior that contributes to creating a positive environment include:
10 |
11 | - Being respectful of differing viewpoints and experiences
12 | - Giving and gracefully accepting constructive feedback
13 | - Focusing on what is best for the community
14 | - Showing empathy towards other community members
15 |
16 | Examples of unacceptable behavior by participants include:
17 |
18 | - The use of sexualized language or imagery and unwelcome sexual attention or advances
19 | - Trolling, insulting/derogatory comments, and personal or political attacks
20 | - Public or private harassment
21 | - Publishing others' private information, such as a physical or email address, without explicit permission
22 | - Other conduct that could reasonably be considered inappropriate in a professional setting
23 |
24 | ## Responsibilities of Contributors
25 |
26 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
27 |
28 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
29 |
30 | ## Scope
31 |
32 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project email address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
33 |
34 | ## Enforcement
35 |
36 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at chreachanchhunneng@gmail.com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
37 |
38 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
39 |
40 | ## Attribution
41 |
42 | This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
43 |
44 | For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq
45 |
46 |
--------------------------------------------------------------------------------
/.github/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to Programming Starters Project
2 |
3 | 🎉 Thank you for considering contributing to the Programming Starters Project! 🚀
4 |
5 | We welcome your contributions to make this repository a valuable resource for learners. Whether you want to add new projects, improve documentation, or fix issues, your efforts are appreciated.
6 |
7 | ## How to Contribute
8 |
9 | 1. Fork the repository.
10 | 2. Create a new branch for your contribution: `git checkout -b feature/your-feature-name`.
11 | 3. Make your changes and commit them: `git commit -m 'Add your feature'`.
12 | 4. Push to the branch: `git push origin feature/your-feature-name`.
13 | 5. Open a pull request with a clear title and description.
14 |
15 | ## Guidelines
16 |
17 | - Ensure your code follows best practices.
18 | - Be respectful and inclusive in your interactions.
19 | - If you're adding a new project, provide clear instructions and examples.
20 | - Test your changes before submitting a pull request.
21 |
22 | ## Code of Conduct
23 |
24 | By participating, you agree to abide by our [Code of Conduct](CODE_OF_CONDUCT.md).
25 |
26 | ## Need Help?
27 |
28 | If you have questions or need assistance, feel free to open an issue or reach out to chreachanchhunneng@gmail.com.
29 |
30 | Thank you for contributing! 🌟
31 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature Request
3 | about: Suggest an idea or improvement for the project
4 | title: "[FEATURE REQUEST] - Your Feature Title Here"
5 | labels: enhancement
6 | assignees: ''
7 | ---
8 |
9 | ## Feature Request
10 |
11 |
12 |
13 | ## Problem Statement
14 |
15 |
16 |
17 | ## Proposed Solution
18 |
19 |
20 |
21 | ## Alternatives Considered
22 |
23 |
24 |
25 | ## Additional Context
26 |
27 |
28 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | # Pull Request
2 |
3 | ## Description
4 |
5 |
6 |
7 | ## Changes Made
8 |
9 |
10 |
11 | ## Related Issues
12 |
13 |
14 |
15 | ## Checklist
16 |
17 | - [ ] I have tested these changes locally.
18 | - [ ] I have added appropriate comments in the code, particularly in complex sections.
19 | - [ ] I have updated the documentation if needed.
20 | - [ ] My code follows the project's coding style guidelines.
21 | - [ ] I have added/modified tests to cover the changes.
22 |
23 | ## Screenshots (if applicable)
24 |
25 |
26 |
27 | ## Additional Context
28 |
29 |
30 |
--------------------------------------------------------------------------------
/Javascript/Random-Quote-Generator.md:
--------------------------------------------------------------------------------
1 | # Random Quote Generator in JavaScript
2 |
3 | Welcome to the Random Quote Generator project for JavaScript! 🚀
4 |
5 | In this project, we'll create a simple web page that displays random quotes. Let's get started!
6 |
7 | ## Project Overview
8 |
9 | ### Objective
10 |
11 | Create a JavaScript script that fetches and displays random quotes from an API.
12 |
13 | ### Features
14 |
15 | - Fetch random quotes from a public API.
16 | - Display the quotes dynamically on a web page.
17 | - Allow users to refresh the page to get a new random quote.
18 |
19 | ## Project Structure
20 |
21 | Create a new HTML file named `index.html` and a JavaScript file named `random_quote_generator.js`.
22 |
23 | ## Instructions
24 |
25 | 1. **Set Up HTML Structure:**
26 | - Create an HTML file with a basic structure, including an area to display the random quote.
27 |
28 | 2. **Fetch Quotes from API:**
29 | - Use JavaScript to fetch random quotes from a public API (e.g., [Quotable API](https://api.quotable.io/random)).
30 |
31 | 3. **Display Quotes Dynamically:**
32 | - Update the HTML content dynamically to display the fetched quotes.
33 |
34 | 4. **Handle Page Refresh:**
35 | - Allow users to refresh the page to get a new random quote.
36 |
37 | 5. **Run the Script:**
38 | - Open the HTML file in a web browser to see the random quotes in action.
39 |
40 | ## Example Code
41 |
42 | ### HTML (index.html)
43 |
44 | ```html
45 |
46 |
47 |
102 |
103 |
104 |
105 |
106 | ```
107 |
108 | ### JavaScript (random_quote_generator.js)
109 |
110 | ```js
111 | // Function to fetch a random quote from the Quotable API
112 | async function getRandomQuote() {
113 | const response = await fetch('https://api.quotable.io/random');
114 | const data = await response.json();
115 |
116 | // Update HTML content with the fetched quote
117 | document.getElementById('quote-text').innerText = data.content;
118 | document.getElementById('quote-author').innerText = `- ${data.author}`;
119 | }
120 |
121 | // Initial call to get a random quote when the page loads
122 | getRandomQuote();
123 | ```
124 |
125 | Feel free to customize the random quote generator, add features, or modify the structure as you see fit. Contributors can use this document as a guide to implementing the random quote generator in JavaScript.
126 |
--------------------------------------------------------------------------------
/Javascript/ReactJS/Calculator.md:
--------------------------------------------------------------------------------
1 | # Calculator App in ReactJS
2 |
3 | Welcome to the Calculator App project for ReactJS! ⚛️
4 |
5 | In this project, we'll create a simple calculator web application using ReactJS. Let's get started!
6 |
7 | ## Project Overview
8 |
9 | ### Objective
10 |
11 | Create a ReactJS application that functions as a calculator.
12 |
13 | ### Features
14 |
15 | - Display a calculator interface with numeric buttons and basic operations.
16 | - Perform addition, subtraction, multiplication, and division operations.
17 | - Display the result dynamically on the calculator screen.
18 |
19 | ## Project Structure
20 |
21 | Create a new ReactJS project using your preferred setup (e.g., Create React App) and organize the components accordingly.
22 |
23 | ## Instructions
24 |
25 | 1. **Set Up React App:**
26 | - Create a new ReactJS app using a tool like Create React App.
27 | - Set up the project structure and create necessary components.
28 |
29 | 2. **Calculator Interface:**
30 | - Design a calculator interface with numeric buttons (0-9) and basic operation buttons (+, -, *, /).
31 |
32 | 3. **State Management:**
33 | - Manage the state of the calculator to keep track of the input and display the result.
34 |
35 | 4. **Implement Operations:**
36 | - Implement functions to perform addition, subtraction, multiplication, and division based on user input.
37 |
38 | 5. **Display Result:**
39 | - Dynamically display the input and result on the calculator screen.
40 |
41 | 6. **Run the App:**
42 | - Start the development server and open the app in a web browser.
43 |
44 | ## Example Code
45 |
46 | ### Calculator Component (Calculator.js)
47 |
48 | ```jsx
49 | import React, { useState } from 'react';
50 |
51 | const Calculator = () => {
52 | const [input, setInput] = useState('');
53 | const [result, setResult] = useState('');
54 |
55 | const handleButtonClick = (value) => {
56 | setInput((prevInput) => prevInput + value);
57 | };
58 |
59 | const handleClear = () => {
60 | setInput('');
61 | setResult('');
62 | };
63 |
64 | const handleCalculate = () => {
65 | try {
66 | setResult(eval(input).toString());
67 | } catch (error) {
68 | setResult('Error');
69 | }
70 | };
71 |
72 | return (
73 |
74 |
75 |
76 |
77 |
78 |
79 | {/* Include buttons for 0-9 and other operations */}
80 |
81 |
82 |
83 |
84 | );
85 | };
86 |
87 | export default Calculator;
88 | ```
89 |
90 | Remember to customize the calculator app, add features, or modify the structure as you see fit. Contributors can use this document as a guide to implementing the calculator app in ReactJS.
91 |
--------------------------------------------------------------------------------
/Javascript/ReactJS/ToDoApp.md:
--------------------------------------------------------------------------------
1 | # Todo App in ReactJS
2 |
3 | Welcome to the Todo App project for ReactJS! ⚛️
4 |
5 | In this project, we'll create a todo list web application using ReactJS. Let's get started!
6 |
7 | ## Project Overview
8 |
9 | ### Objective
10 |
11 | Create a ReactJS application that functions as a todo list.
12 |
13 | ### Features
14 |
15 | - Add new todo items.
16 | - Mark items as completed.
17 | - Delete todo items.
18 | - Filter items by all, active, and completed.
19 |
20 | ## Project Structure
21 |
22 | Create a new ReactJS project using your preferred setup (e.g., Create React App) and organize the components accordingly.
23 |
24 | ## Instructions
25 |
26 | 1. **Set Up React App:**
27 | - Create a new ReactJS app using a tool like Create React App.
28 | - Set up the project structure and create necessary components.
29 |
30 | 2. **Todo Interface:**
31 | - Design an interface with an input field for adding new todo items and a list to display the todos.
32 |
33 | 3. **State Management:**
34 | - Manage the state of the todos to keep track of the list of items, their completion status, and current filter.
35 |
36 | 4. **Add Todo Item:**
37 | - Implement functionality to add new items to the todo list.
38 |
39 | 5. **Mark as Completed:**
40 | - Implement functionality to mark items as completed.
41 |
42 | 6. **Delete Todo Item:**
43 | - Implement functionality to delete items from the todo list.
44 |
45 | 7. **Filter Items:**
46 | - Implement functionality to filter items by all, active, and completed.
47 |
48 | 8. **Run the App:**
49 | - Start the development server and open the app in a web browser.
50 |
51 | ## Example Code
52 |
53 | ### Calculator Component (Calculator.js)
54 |
55 | ```jsx
56 | import React, { useState } from 'react';
57 |
58 | const TodoApp = () => {
59 | const [todos, setTodos] = useState([]);
60 | const [newTodo, setNewTodo] = useState('');
61 | const [filter, setFilter] = useState('all');
62 |
63 | const handleAddTodo = () => {
64 | if (newTodo.trim() !== '') {
65 | setTodos([...todos, { text: newTodo, completed: false }]);
66 | setNewTodo('');
67 | }
68 | };
69 |
70 | const handleToggleComplete = (index) => {
71 | const updatedTodos = todos.map((todo, i) =>
72 | i === index ? { ...todo, completed: !todo.completed } : todo
73 | );
74 | setTodos(updatedTodos);
75 | };
76 |
77 | const handleDeleteTodo = (index) => {
78 | const updatedTodos = todos.filter((_, i) => i !== index);
79 | setTodos(updatedTodos);
80 | };
81 |
82 | const handleFilterChange = (newFilter) => {
83 | setFilter(newFilter);
84 | };
85 |
86 | const filteredTodos = todos.filter((todo) => {
87 | if (filter === 'all') return true;
88 | if (filter === 'active') return !todo.completed;
89 | if (filter === 'completed') return todo.completed;
90 | return true;
91 | });
92 |
93 | return (
94 |
95 |
Todo App
96 | setNewTodo(e.target.value)}
100 | placeholder="Add a new todo"
101 | />
102 |
103 |
114 | Laravel's robust library of first-party tools and libraries, such as Forge, Vapor, Nova, and Envoyer help you take your projects to the next level. Pair them with powerful open source libraries like Cashier, Dusk, Echo, Horizon, Sanctum, Telescope, and more.
115 |
139 |
140 |
141 |
--------------------------------------------------------------------------------
/Laravel/my-first-badges/routes/api.php:
--------------------------------------------------------------------------------
1 | get('/user', function (Request $request) {
18 | return $request->user();
19 | });
20 |
--------------------------------------------------------------------------------
/Laravel/my-first-badges/routes/channels.php:
--------------------------------------------------------------------------------
1 | id === (int) $id;
18 | });
19 |
--------------------------------------------------------------------------------
/Laravel/my-first-badges/routes/console.php:
--------------------------------------------------------------------------------
1 | comment(Inspiring::quote());
19 | })->purpose('Display an inspiring quote');
20 |
--------------------------------------------------------------------------------
/Laravel/my-first-badges/routes/web.php:
--------------------------------------------------------------------------------
1 | make(Kernel::class)->bootstrap();
18 |
19 | return $app;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Laravel/my-first-badges/tests/Feature/ExampleTest.php:
--------------------------------------------------------------------------------
1 | get('/');
16 |
17 | $response->assertStatus(200);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Laravel/my-first-badges/tests/TestCase.php:
--------------------------------------------------------------------------------
1 | assertTrue(true);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Laravel/my-first-badges/vite.config.js:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite';
2 | import laravel from 'laravel-vite-plugin';
3 |
4 | export default defineConfig({
5 | plugins: [
6 | laravel({
7 | input: ['resources/css/app.css', 'resources/js/app.js'],
8 | refresh: true,
9 | }),
10 | ],
11 | });
12 |
--------------------------------------------------------------------------------
/Python/Countdown-Timer.md:
--------------------------------------------------------------------------------
1 | # Countdown Timer in Python
2 |
3 | Welcome to the Countdown Timer project for Python! ⏲️
4 |
5 | In this project, we'll create a simple countdown timer using Python. This project is great for learning about time manipulation and creating a practical application. Let's get started!
6 |
7 | ## Project Overview
8 |
9 | ### Objective
10 |
11 | Create a Python script that functions as a countdown timer.
12 |
13 | ### Features
14 |
15 | - Allow the user to set the duration of the countdown.
16 | - Display the countdown in seconds.
17 | - Notify the user when the countdown reaches zero.
18 |
19 | ## Project Structure
20 |
21 | Create a new Python script named `countdown_timer.py`.
22 |
23 | ## Instructions
24 |
25 | 1. **Get User Input:**
26 | - Prompt the user to enter the duration of the countdown in seconds.
27 |
28 | 2. **Countdown Display:**
29 | - Display the countdown in seconds, updating every second.
30 |
31 | 3. **Notification:**
32 | - Notify the user when the countdown reaches zero. You can use a sound alert or a simple console message.
33 |
34 | 4. **Run the Script:**
35 | - Execute the script and observe the countdown.
36 |
37 | ## Example Code
38 |
39 | ```python
40 | import time
41 | import winsound # Windows only, for sound notification
42 |
43 | def countdown_timer(duration):
44 | print(f"Countdown started for {duration} seconds.")
45 |
46 | for remaining_time in range(duration, 0, -1):
47 | print(f"Time remaining: {remaining_time} seconds")
48 | time.sleep(1)
49 |
50 | print("Countdown reached zero! Time's up!")
51 |
52 | # Sound notification (Windows only)
53 | winsound.Beep(1000, 1000)
54 |
55 | # Get user input for the duration of the countdown
56 | duration_input = int(input("Enter the duration of the countdown in seconds: "))
57 |
58 | # Run the countdown timer
59 | countdown_timer(duration_input)
60 | ```
61 |
62 | Feel free to customize the countdown timer, add features, or modify the structure as you see fit. Contributors can use this document as a guide to implementing the countdown timer in Python.
63 |
--------------------------------------------------------------------------------
/Python/Number-Guessing-Game.md:
--------------------------------------------------------------------------------
1 | # Number Guessing Game in Python
2 |
3 | Welcome to the Number Guessing Game project for Python! 🐍
4 |
5 | In this project, we'll create a simple number guessing game where the computer randomly selects a number, and the player tries to guess it. Let's get started!
6 |
7 | ## Project Overview
8 |
9 | ### Objective
10 |
11 | Create a Python script that implements a number guessing game.
12 |
13 | ### Features
14 |
15 | - The computer generates a random number.
16 | - The player tries to guess the number.
17 | - Provide feedback on whether the guess is too high, too low, or correct.
18 | - Track the number of attempts.
19 |
20 | ## Project Structure
21 |
22 | Create a new Python script named `number_guessing_game.py`.
23 |
24 | ## Instructions
25 |
26 | 1. **Generate a Random Number:**
27 | - Use the `random` module to generate a random number between a predefined range.
28 |
29 | 2. **Get Player Input:**
30 | - Prompt the player to enter a guess.
31 |
32 | 3. **Compare and Provide Feedback:**
33 | - Compare the player's guess with the randomly generated number.
34 | - If the guess is correct, print a congratulatory message.
35 | - If the guess is too high or too low, provide feedback.
36 |
37 | 4. **Track Attempts:**
38 | - Keep track of the number of attempts made by the player.
39 |
40 | 5. **Play Again (Optional):**
41 | - After the game ends, ask the player if they want to play again.
42 |
43 | ## Example Code
44 |
45 | ```python
46 | import random
47 |
48 | def number_guessing_game():
49 | # Generate a random number between 1 and 100
50 | target_number = random.randint(1, 100)
51 |
52 | attempts = 0
53 |
54 | while True:
55 | # Get player input
56 | guess = int(input("Enter your guess: "))
57 |
58 | # Increment attempts
59 | attempts += 1
60 |
61 | # Compare and provide feedback
62 | if guess == target_number:
63 | print(f"Congratulations! You guessed the correct number in {attempts} attempts.")
64 | break
65 | elif guess < target_number:
66 | print("Too low! Try again.")
67 | else:
68 | print("Too high! Try again.")
69 |
70 | # Run the game
71 | number_guessing_game()
72 | ```
73 |
74 | Feel free to enhance the game, add features, or modify the structure as you see fit. Contributors can use this document as a guide to implementing the number guessing game in Python.
75 |
--------------------------------------------------------------------------------
/Python/Password-Generator.md:
--------------------------------------------------------------------------------
1 | # Password Generator in Python
2 |
3 | Welcome to the Password Generator project for Python! 🐍
4 |
5 | In this project, we'll create a simple password generator that generates random passwords based on user specifications. Let's get started!
6 |
7 | ## Project Overview
8 |
9 | ### Objective
10 |
11 | Create a Python script that generates random passwords.
12 |
13 | ### Features
14 |
15 | - Allow the user to specify the length of the password.
16 | - Include options for including uppercase letters, lowercase letters, numbers, and special characters.
17 | - Generate a random password based on user specifications.
18 |
19 | ## Project Structure
20 |
21 | Create a new Python script named `password_generator.py`.
22 |
23 | ## Instructions
24 |
25 | 1. **Get User Input:**
26 | - Prompt the user to enter the desired length of the password.
27 |
28 | 2. **Options for Password Complexity:**
29 | - Allow the user to choose whether to include uppercase letters, lowercase letters, numbers, and special characters in the password.
30 |
31 | 3. **Generate Password:**
32 | - Generate a random password based on the user's specifications.
33 | - Ensure the password meets the desired length and includes the selected character types.
34 |
35 | 4. **Display Password:**
36 | - Print the generated password to the console.
37 |
38 | 5. **Run the Script:**
39 | - Run the script to generate passwords interactively.
40 |
41 | ## Example Code
42 |
43 | ```python
44 | import random
45 | import string
46 |
47 | def generate_password():
48 | # Get user input for password length
49 | length = int(input("Enter the desired password length: "))
50 |
51 | # Define character sets based on user input
52 | lowercase_letters = string.ascii_lowercase
53 | uppercase_letters = string.ascii_uppercase
54 | digits = string.digits
55 | special_characters = string.punctuation
56 |
57 | # Combine character sets based on user choices
58 | character_set = ""
59 | character_set += lowercase_letters if input("Include lowercase letters? (y/n): ").lower() == 'y' else ''
60 | character_set += uppercase_letters if input("Include uppercase letters? (y/n): ").lower() == 'y' else ''
61 | character_set += digits if input("Include numbers? (y/n): ").lower() == 'y' else ''
62 | character_set += special_characters if input("Include special characters? (y/n): ").lower() == 'y' else ''
63 |
64 | # Generate password
65 | password = ''.join(random.choice(character_set) for _ in range(length))
66 |
67 | # Display the generated password
68 | print(f"Generated Password: {password}")
69 |
70 | # Run the password generator
71 | generate_password()
72 | ```
73 |
74 | Feel free to enhance the password generator, add features, or modify the structure as you see fit. Contributors can use this document as a guide to implementing the password generator in Python.
75 |
--------------------------------------------------------------------------------
/Python/Rock-Paper-Scissors.md:
--------------------------------------------------------------------------------
1 | # Rock, Paper, Scissors Game in Python
2 |
3 | Welcome to the Rock, Paper, Scissors Game project for Python! ✊🏻✋🏻✌🏻
4 |
5 | In this project, we'll create a simple rock-paper-scissors game using Python. This classic game is great for practicing conditional statements and user input handling. Let's get started!
6 |
7 | ## Project Overview
8 |
9 | ### Objective
10 |
11 | Create a Python script that allows a user to play the rock-paper-scissors game against the computer.
12 |
13 | ### Features
14 |
15 | - Accept user input for their choice (rock, paper, or scissors).
16 | - Generate a random choice for the computer.
17 | - Determine the winner based on the game rules.
18 |
19 | ## Project Structure
20 |
21 | Create a new Python script named `rock_paper_scissors.py`.
22 |
23 | ## Instructions
24 |
25 | 1. **User Input:**
26 | - Prompt the user to enter their choice (rock, paper, or scissors).
27 |
28 | 2. **Computer's Choice:**
29 | - Generate a random choice for the computer (rock, paper, or scissors).
30 |
31 | 3. **Game Logic:**
32 | - Implement the game logic to determine the winner.
33 | - Rock beats scissors, scissors beats paper, and paper beats rock.
34 |
35 | 4. **Display Result:**
36 | - Print the user's choice, the computer's choice, and the result of the game.
37 |
38 | 5. **Run the Script:**
39 | - Execute the script and play the game against the computer.
40 |
41 | ## Example Code
42 |
43 | ```python
44 | import random
45 |
46 | def rock_paper_scissors(user_choice):
47 | choices = ['rock', 'paper', 'scissors']
48 | computer_choice = random.choice(choices)
49 |
50 | print(f"Your choice: {user_choice}")
51 | print(f"Computer's choice: {computer_choice}")
52 |
53 | if user_choice == computer_choice:
54 | print("It's a tie!")
55 | elif (
56 | (user_choice == 'rock' and computer_choice == 'scissors') or
57 | (user_choice == 'scissors' and computer_choice == 'paper') or
58 | (user_choice == 'paper' and computer_choice == 'rock')
59 | ):
60 | print("You win!")
61 | else:
62 | print("You lose!")
63 |
64 | # Get user input for their choice
65 | user_input = input("Enter your choice (rock, paper, or scissors): ").lower()
66 |
67 | # Run the rock-paper-scissors game
68 | rock_paper_scissors(user_input)
69 | ```
70 |
71 | Feel free to customize the rock-paper-scissors game, add features, or modify the structure as you see fit. Contributors can use this document as a guide to implementing the rock-paper-scissors game in Python.
72 |
--------------------------------------------------------------------------------
/Python/encrypt.md:
--------------------------------------------------------------------------------
1 | # encrypt files & data with python
2 | in this project we gonna make a simple encrypt file with python
3 |
4 | ## project overview
5 |
6 | ### install depencies
7 |
8 | pip3 install cryptography
9 |
10 | ### start write a code
11 |
12 | from cryptography.fernet import Fernet
13 |
14 | def write_key():
15 | """
16 | Generates a key and save it into a file
17 | """
18 | key = Fernet.generate_key()
19 | with open("key.key", "wb") as key_file:
20 | key_file.write(key)
21 |
22 | def load_key():
23 | """
24 | Loads the key from the current directory named `key.key`
25 | """
26 | return open("key.key", "rb").read()
27 |
28 | def encrypt(filename, key):
29 | """
30 | Given a filename (str) and key (bytes), it encrypts the file and write it
31 | """
32 | f = Fernet(key)
33 | with open(filename, "rb") as file:
34 | # read all file data
35 | file_data = file.read()
36 | # encrypt data
37 | encrypted_data = f.encrypt(file_data)
38 | # write the encrypted file
39 | with open(filename, "wb") as file:
40 | file.write(encrypted_data)
41 |
42 | def decrypt(filename, key):
43 | """
44 | Given a filename (str) and key (bytes), it decrypts the file and write it
45 | """
46 | f = Fernet(key)
47 | with open(filename, "rb") as file:
48 | # read the encrypted data
49 | encrypted_data = file.read()
50 | # decrypt data
51 | decrypted_data = f.decrypt(encrypted_data)
52 | # write the original file
53 | with open(filename, "wb") as file:
54 | file.write(decrypted_data)
55 |
56 |
57 | if __name__ == "__main__":
58 | import argparse
59 | parser = argparse.ArgumentParser(description="Simple File Encryptor Script")
60 | parser.add_argument("file", help="File to encrypt/decrypt")
61 | parser.add_argument("-g", "--generate-key", dest="generate_key", action="store_true",
62 | help="Whether to generate a new key or use existing")
63 | parser.add_argument("-e", "--encrypt", action="store_true",
64 | help="Whether to encrypt the file, only -e or -d can be specified.")
65 | parser.add_argument("-d", "--decrypt", action="store_true",
66 | help="Whether to decrypt the file, only -e or -d can be specified.")
67 |
68 | args = parser.parse_args()
69 | file = args.file
70 | generate_key = args.generate_key
71 |
72 | if generate_key:
73 | write_key()
74 | # load the key
75 | key = load_key()
76 |
77 | encrypt_ = args.encrypt
78 | decrypt_ = args.decrypt
79 |
80 | if encrypt_ and decrypt_:
81 | raise TypeError("Please specify whether you want to encrypt the file or decrypt it.")
82 | elif encrypt_:
83 | encrypt(file, key)
84 | elif decrypt_:
85 | decrypt(file, key)
86 | else:
87 | raise TypeError("Please specify whether you want to encrypt the file or decrypt it.")
88 |
89 | ### how to test our code
90 | $ python crypt_password.py data.csv --encrypt --salt-size 16
91 |
--------------------------------------------------------------------------------
/Python/subsequence-algorithm.md:
--------------------------------------------------------------------------------
1 |
2 | # Subsequence algorithm
3 |
4 | Here is a detailed explanation of the algorithms for subsequences:
5 |
6 | A subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements. The problem of finding the longest common subsequence (LCS) between two sequences is a classic problem in computer science and dynamic programming.
7 |
8 | Longest Common Subsequence (LCS) Algorithm:
9 | The LCS algorithm finds the longest subsequence that is present in given sequences (arrays, strings, etc.).
10 | It uses dynamic programming to build a matrix where each cell `c[i][j]` represents the length of the longest common subsequence between the first i elements of one sequence and the first j elements of another.
11 | The algorithm iterates through the sequences and fills the matrix based on whether the elements at positions i and j are equal or not.
12 | By comparing the lengths of subsequences that include or exclude elements at positions i and j, it efficiently calculates the length of the longest common subsequence.
13 | The LCS algorithm has a time complexity of O(m*n) where m and n are the lengths of the input sequences.
14 | In the code I have provided, I have implemented a version of the longest common subsequence (LCS) algorithm in Python to find the LCS length between two sequences a and b.
15 |
16 | ```
17 | def longest_common_subsequence(a, b):
18 | m = len(a) # Length of sequence a
19 | n = len(b) # Length of sequence b
20 | c = [[0] * (n + 1) for _ in range(m + 1)] # Create a matrix to store the lengths of longest common subsequences
21 |
22 | for i in range(1, m + 1):
23 | for j in range(1, n + 1):
24 | if a[i-1] == b[j-1]: # If the elements at positions i and j in sequences a and b are equal
25 | c[i][j] = c[i-1][j-1] + 1 # Increment the length of the common subsequence by 1
26 | else:
27 | c[i][j] = max(c[i-1][j], c[i][j-1]) # Take the maximum of the lengths of two sequences without the current elements
28 |
29 | return c # Return the matrix containing the lengths of longest common subsequences
30 |
31 | a = [1, 2, 3, 4, 5]
32 | b = [5, 4, 6, 8, 10]
33 |
34 | result = longest_common_subsequence(a, b) # Calculate the longest common subsequence between a and b
35 | for row in result:
36 | print(a) # Print sequence a
37 | print(row) # Print each row of the matrix containing the lengths of longest common subsequences
38 | ```
39 |
40 | This code defines a function longest_common_subsequence that calculates the lengths of the longest common subsequences between two sequences a and b. It uses dynamic programming to fill a matrix c where `c[i][j]` stores the length of the longest common subsequence between the first i elements of a and the first j elements of b.
41 |
42 | After defining the function, it calculates the longest common subsequence between a = [1, 2, 3, 4, 5] and b = [5, 4, 6, 8, 10], and then prints each row of the matrix c which represents the lengths of the longest common subsequences.
43 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Programming Starters Project
2 |
3 | 🚀 Welcome to the Programming Starters Project! This repository contains a curated collection of beginner-friendly projects in various programming languages and frameworks. Explore, learn, and code your way through hands-on projects to build your skills.
4 |
5 | ## How to Use
6 |
7 | 1. Explore language folders to find projects.
8 | 2. Each project is documented in Markdown files, providing step-by-step instructions and examples.
9 | 3. Choose a project, dive in, and start coding!
10 |
11 | ## Contributing
12 |
13 | We welcome contributions! If you have a project idea or want to improve existing projects, please check out our [Contributing Guidelines](.github/CONTRIBUTING.md). Your contributions help make learning to code more accessible.
14 |
15 | ⭐ If you find this project helpful, consider giving it a star! ⭐ It's a simple way to show your support.
16 |
17 | ## License
18 |
19 | This repository is open-sourced under the [MIT License](LICENSE). Feel free to use, modify, and share the content with others.
20 |
21 | Happy coding! 🚀✨
22 |
23 | ---
24 |
25 | ## Contributors
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------