├── projects ├── Python │ ├── my_python_script.py │ ├── Random_integer.py │ ├── fizzbuzz.py │ ├── data_analysis.py │ ├── matrix_multiplication.py │ ├── url_shortener.py │ ├── Random Password Generator.py │ ├── to_do_list.py │ ├── to_do_list_2.py │ ├── tic-tac-toe.py │ ├── Disk Usage Analyzer.py │ ├── calculator.py │ └── Machine_Learning │ │ └── LogisticRegression │ │ └── LogisticRegression_ML.ipynb ├── C# │ └── CashierApp │ │ ├── SI_Kasir_Toko │ │ ├── DBContext.cs │ │ ├── Resources │ │ │ ├── LoginForm.jpg │ │ │ ├── RegisterForm.jpg │ │ │ ├── DasboardAdmin.jpg │ │ │ ├── GetStartedImage.jpg │ │ │ └── Super Market Logo.png │ │ ├── packages.config │ │ ├── App.config │ │ ├── GetStartedForm.cs │ │ ├── GlobalVariable.cs │ │ ├── Properties │ │ │ ├── Settings.settings │ │ │ ├── AssemblyInfo.cs │ │ │ ├── Settings.Designer.cs │ │ │ └── Resources.Designer.cs │ │ ├── Program.cs │ │ ├── KasirDashboardForm.cs │ │ ├── AdminDashboardForm.cs │ │ ├── DBContext.dbml.layout │ │ ├── RegisterForm.cs │ │ ├── LoginForm.cs │ │ ├── DBContext.dbml │ │ ├── FormBarang.resx │ │ ├── LoginForm.resx │ │ ├── FormPetugas.resx │ │ ├── FormRiwayat.resx │ │ ├── FormTransaksi.resx │ │ ├── RegisterForm.resx │ │ ├── StockBarangForm.resx │ │ ├── AdminDashboardForm.resx │ │ ├── KasirDashboardForm.resx │ │ └── SupplierForm.resx │ │ ├── SI_Kasir_Toko.sln │ │ └── README.md ├── Bash │ └── jrun.sh ├── C++ │ ├── dp_intro.cpp │ ├── insertion.cpp │ ├── quickSort.cpp │ └── countSort.cpp ├── Java │ ├── FoodCwDB │ │ ├── .classpath │ │ ├── .settings │ │ │ └── org.eclipse.jdt.core.prefs │ │ ├── .project │ │ └── src │ │ │ ├── wDB.java │ │ │ └── FoodC.java │ ├── Calculator.java │ └── ToDoListApp.java └── WebProject │ ├── calculator │ ├── calculator.html │ └── calculator.js │ └── reelreview │ ├── index.html │ ├── script.js │ └── style.css ├── JavaScript └── MERN Project │ └── React-NewsPulse-App │ ├── src │ ├── App.css │ ├── index.css │ ├── Components │ │ ├── loading.gif │ │ ├── Spinner.jsx │ │ ├── NewsItem.jsx │ │ ├── News.jsx │ │ ├── NavBar.jsx │ │ └── News(RLifeCycle).txt │ ├── main.jsx │ └── App.jsx │ ├── vite.config.js │ ├── .gitignore │ ├── .eslintrc.cjs │ ├── package.json │ ├── index.html │ ├── public │ └── vite.svg │ ├── README.md │ └── SampleOutput.json ├── Go └── FuzzerBuzzer │ ├── config │ └── config.yaml │ ├── go.mod │ ├── go.sum │ ├── tests │ └── fuzzer_test.go │ ├── app │ └── app.go │ ├── internal │ ├── http │ │ ├── errors.go │ │ └── client.go │ ├── fuzz_logic │ │ └── fuzz.go │ └── generator │ │ └── input_gen.go │ ├── cmd │ └── fuzzer.go │ ├── pkg │ └── helpers.go │ └── README.md ├── img └── DO-HFest-EmailBanner-600px-1-@3x.png ├── C++ ├── inline_largest3.cpp ├── mergesort.cpp ├── printSpiral.cpp └── asteroidCollision.cpp ├── Project List └── ProjectList.md ├── Python ├── alarm clock.py ├── prime number generator.py └── sudoku-solver-backtracking.py ├── CONTRIBUTION_GUIDELINES.md └── CODE_OF_CONDUCT.md /projects/Python/my_python_script.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko/DBContext.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /JavaScript/MERN Project/React-NewsPulse-App/src/App.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /JavaScript/MERN Project/React-NewsPulse-App/src/index.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Go/FuzzerBuzzer/config/config.yaml: -------------------------------------------------------------------------------- 1 | target_url: "http://localhost:8080/test" 2 | seed: 12345 3 | -------------------------------------------------------------------------------- /img/DO-HFest-EmailBanner-600px-1-@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackelite01/hacktoberfest-2024/HEAD/img/DO-HFest-EmailBanner-600px-1-@3x.png -------------------------------------------------------------------------------- /Go/FuzzerBuzzer/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/Ayushi40804/Hacktoberfest2024/FuzzerBuzzer 2 | 3 | 4 | go 1.23.2 5 | 6 | require gopkg.in/yaml.v2 v2.4.0 7 | -------------------------------------------------------------------------------- /projects/Python/Random_integer.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | random_number = random.randint(1, 100) # Generates a random integer between 1 and 100 4 | print(random_number) 5 | -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko/Resources/LoginForm.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackelite01/hacktoberfest-2024/HEAD/projects/C#/CashierApp/SI_Kasir_Toko/Resources/LoginForm.jpg -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko/Resources/RegisterForm.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackelite01/hacktoberfest-2024/HEAD/projects/C#/CashierApp/SI_Kasir_Toko/Resources/RegisterForm.jpg -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko/Resources/DasboardAdmin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackelite01/hacktoberfest-2024/HEAD/projects/C#/CashierApp/SI_Kasir_Toko/Resources/DasboardAdmin.jpg -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko/Resources/GetStartedImage.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackelite01/hacktoberfest-2024/HEAD/projects/C#/CashierApp/SI_Kasir_Toko/Resources/GetStartedImage.jpg -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko/Resources/Super Market Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackelite01/hacktoberfest-2024/HEAD/projects/C#/CashierApp/SI_Kasir_Toko/Resources/Super Market Logo.png -------------------------------------------------------------------------------- /JavaScript/MERN Project/React-NewsPulse-App/src/Components/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackelite01/hacktoberfest-2024/HEAD/JavaScript/MERN Project/React-NewsPulse-App/src/Components/loading.gif -------------------------------------------------------------------------------- /JavaScript/MERN Project/React-NewsPulse-App/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import react from '@vitejs/plugin-react' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [react()], 7 | }) 8 | -------------------------------------------------------------------------------- /JavaScript/MERN Project/React-NewsPulse-App/src/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom/client' 3 | import App from './App.jsx' 4 | import './index.css' 5 | 6 | ReactDOM.createRoot(document.getElementById('root')).render( 7 | 8 | 9 | , 10 | ) 11 | -------------------------------------------------------------------------------- /projects/Python/fizzbuzz.py: -------------------------------------------------------------------------------- 1 | def fizzbuzz(n): 2 | for i in range(1, n + 1): 3 | if i % 3 == 0 and i % 5 == 0: 4 | print("FizzBuzz") 5 | elif i % 3 == 0: 6 | print("Fizz") 7 | elif i % 5 == 0: 8 | print("Buzz") 9 | else: 10 | print(i) 11 | 12 | 13 | fizzbuzz(100) 14 | -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /projects/Bash/jrun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ $# -lt 1 ]; then 4 | echo "Usage: $0 .java [args...]" 5 | exit 1 6 | fi 7 | 8 | filename=$(basename -- "$1") 9 | classname="${filename%.*}" 10 | 11 | javac "$1" 12 | if [ $? -ne 0 ]; then 13 | echo "Compilation failed" 14 | exit 1 15 | fi 16 | 17 | shift 18 | 19 | java "$classname" "$@" 20 | -------------------------------------------------------------------------------- /Go/FuzzerBuzzer/go.sum: -------------------------------------------------------------------------------- 1 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= 2 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 3 | gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= 4 | gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= 5 | -------------------------------------------------------------------------------- /JavaScript/MERN Project/React-NewsPulse-App/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /JavaScript/MERN Project/React-NewsPulse-App/src/Components/Spinner.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import loading from "./loading.gif"; 3 | 4 | const Spinner = () => { 5 | return ( 6 |
7 | loading 13 |
14 | ); 15 | }; 16 | 17 | export default Spinner; 18 | -------------------------------------------------------------------------------- /projects/C++/dp_intro.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | int fibonacci(int n, vector& dp) { 7 | if(n<=1) return n; 8 | 9 | if(dp[n]) return dp[n]; 10 | 11 | return dp[n] = fibonacci(n-1, dp)+fibonacci(n-2, dp); 12 | } 13 | 14 | 15 | int main() { 16 | int n; 17 | cin >> n; 18 | vector dp(n+1, 0); 19 | 20 | cout << fibonacci(n, dp) << endl; 21 | return 0; 22 | } -------------------------------------------------------------------------------- /projects/Python/data_analysis.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | import matplotlib.pyplot as plt 3 | 4 | 5 | data = pd.read_csv('data.csv') 6 | 7 | print("Data Preview:") 8 | print(data.head()) 9 | 10 | print("\nSummary Statistics:") 11 | print(data.describe()) 12 | 13 | plt.figure(figsize=(10, 5)) 14 | plt.hist(data['age'], bins=20, color='blue', edgecolor='black') 15 | plt.title('Age Distribution') 16 | plt.xlabel('Age') 17 | plt.ylabel('Frequency') 18 | plt.show() 19 | -------------------------------------------------------------------------------- /projects/Java/FoodCwDB/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /C++/inline_largest3.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | inline int max(int a,int b,int c) 4 | { 5 | if (a>b&&a>c) 6 | { 7 | return a; 8 | } 9 | else if (b>b&&b>c) 10 | { 11 | return b; 12 | } 13 | else 14 | { 15 | return c; 16 | } 17 | } 18 | int main() 19 | { 20 | system("CLS"); 21 | int a,b,c,d; 22 | cout<<"Enter Three Numbers:"; 23 | cin>>a>>b>>c; 24 | d=max(a,b,c); 25 | cout<<"Maximum is: "< 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /JavaScript/MERN Project/React-NewsPulse-App/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { browser: true, es2020: true }, 4 | extends: [ 5 | 'eslint:recommended', 6 | 'plugin:react/recommended', 7 | 'plugin:react/jsx-runtime', 8 | 'plugin:react-hooks/recommended', 9 | ], 10 | ignorePatterns: ['dist', '.eslintrc.cjs'], 11 | parserOptions: { ecmaVersion: 'latest', sourceType: 'module' }, 12 | settings: { react: { version: '18.2' } }, 13 | plugins: ['react-refresh'], 14 | rules: { 15 | 'react-refresh/only-export-components': [ 16 | 'warn', 17 | { allowConstantExport: true }, 18 | ], 19 | }, 20 | } 21 | -------------------------------------------------------------------------------- /Go/FuzzerBuzzer/tests/fuzzer_test.go: -------------------------------------------------------------------------------- 1 | package tests 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/Ayushi40804/Hacktoberfest2024/FuzzerBuzzer/internal/fuzz_logic" 7 | "github.com/Ayushi40804/Hacktoberfest2024/FuzzerBuzzer/internal/generator" 8 | ) 9 | 10 | func TestFuzzer_Start(t *testing.T) { 11 | // Create an InputGenerator instance 12 | ig := generator.NewInputGenerator(12345) // Using a fixed seed for reproducibility 13 | 14 | // Create a Fuzzer instance 15 | f := fuzz_logic.NewFuzzer("http://localhost:8080/test", ig) 16 | 17 | // Call the Start method to test it 18 | f.Start() 19 | 20 | // Here you can add more assertions to verify the expected behavior 21 | } 22 | -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko/GetStartedForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace SI_Kasir_Toko 12 | { 13 | using static GlobalVariable; 14 | public partial class Form1 : Form 15 | { 16 | public Form1() 17 | { 18 | InitializeComponent(); 19 | } 20 | private void btnLogin_Click(object sender, EventArgs e) 21 | { 22 | loginForm.Show(); 23 | this.Hide(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /projects/Java/FoodCwDB/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Sun Mar 31 12:49:21 IST 2024 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 6 | org.eclipse.jdt.core.compiler.compliance=1.6 7 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 8 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 9 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 10 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 11 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 12 | org.eclipse.jdt.core.compiler.source=1.6 13 | -------------------------------------------------------------------------------- /Go/FuzzerBuzzer/app/app.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | func main() { 9 | http.HandleFunc("/test", testHandler) 10 | fmt.Println("Server starting on :8080") 11 | if err := http.ListenAndServe(":8080", nil); err != nil { 12 | fmt.Println("Server error:", err) 13 | } 14 | } 15 | 16 | func testHandler(w http.ResponseWriter, r *http.Request) { 17 | r.ParseForm() 18 | input := r.FormValue("input") 19 | 20 | // Simple response based on input 21 | if input == "" { 22 | http.Error(w, "No input provided", http.StatusBadRequest) 23 | return 24 | } 25 | 26 | response := fmt.Sprintf("Received input: %s", input) 27 | w.Write([]byte(response)) 28 | } 29 | -------------------------------------------------------------------------------- /projects/Python/matrix_multiplication.py: -------------------------------------------------------------------------------- 1 | def matrix_multiplication(A, B): 2 | result = [[0 for _ in range(len(B[0]))] for _ in range(len(A))] 3 | 4 | for i in range(len(A)): 5 | for j in range(len(B[0])): 6 | for k in range(len(B)): 7 | result[i][j] += A[i][k] * B[k][j] 8 | 9 | return result 10 | 11 | A = [[1, 2, 3], 12 | [4, 5, 6], 13 | [7, 8, 9]] 14 | 15 | B = [[9, 8, 7], 16 | [6, 5, 4], 17 | [3, 2, 1]] 18 | 19 | result = matrix_multiplication(A, B) 20 | 21 | print("Matrix A:") 22 | for row in A: 23 | print(row) 24 | print("\nMatrix B:") 25 | for row in B: 26 | print(row) 27 | print("\nResult of A * B:") 28 | for row in result: 29 | print(row) 30 | -------------------------------------------------------------------------------- /projects/Python/url_shortener.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | def shorten_url(long_url): 4 | api_url = "https://api.tinyurl.com/create" 5 | params = { 6 | "url": long_url 7 | } 8 | 9 | response = requests.post(api_url, json=params) 10 | 11 | if response.status_code == 200: 12 | return response.json().get("tinyurl") 13 | else: 14 | return None 15 | 16 | def main(): 17 | print("Welcome to the URL Shortener!") 18 | long_url = input("Enter the URL you want to shorten: ") 19 | 20 | short_url = shorten_url(long_url) 21 | 22 | if short_url: 23 | print(f"Shortened URL: {short_url}") 24 | else: 25 | print("Error: Unable to shorten the URL.") 26 | 27 | if __name__ == "__main__": 28 | main() 29 | -------------------------------------------------------------------------------- /projects/Java/FoodCwDB/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | FoodCwDB 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | 17 | 18 | 19 | 1717659245758 20 | 21 | 30 22 | 23 | org.eclipse.core.resources.regexFilterMatcher 24 | node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /projects/C++/insertion.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include 4 | using namespace std; 5 | 6 | 7 | void insertionSort(int arr[], int n) 8 | { 9 | int i, key, j; 10 | for (i = 1; i < n; i++) { 11 | key = arr[i]; 12 | j = i - 1; 13 | 14 | while (j >= 0 && arr[j] > key) { 15 | arr[j + 1] = arr[j]; 16 | j = j - 1; 17 | } 18 | arr[j + 1] = key; 19 | } 20 | } 21 | 22 | 23 | void printArray(int arr[], int n) 24 | { 25 | int i; 26 | for (i = 0; i < n; i++) 27 | cout << arr[i] << " "; 28 | cout << endl; 29 | } 30 | 31 | int main() 32 | { 33 | int n; 34 | cin>>n; 35 | int arr[n]; 36 | for(int i=0; i>arr[i]; 38 | } 39 | 40 | cout<<"original array is:- "< 2 | 3 | 4 | 5 | 6 | Calculator 7 | 8 | 9 |

Simple Calculator

10 | 11 | 12 |

13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |

21 | 22 |
23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /JavaScript/MERN Project/React-NewsPulse-App/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "newspaperapp", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", 10 | "preview": "vite preview" 11 | }, 12 | "dependencies": { 13 | "react": "^18.2.0", 14 | "react-dom": "^18.2.0", 15 | "react-infinite-scroll-component": "^6.1.0", 16 | "react-router-dom": "^6.14.2", 17 | "react-top-loading-bar": "^2.3.1" 18 | }, 19 | "devDependencies": { 20 | "@types/react": "^18.2.15", 21 | "@types/react-dom": "^18.2.7", 22 | "@vitejs/plugin-react": "^4.0.3", 23 | "eslint": "^8.45.0", 24 | "eslint-plugin-react": "^7.32.2", 25 | "eslint-plugin-react-hooks": "^4.6.0", 26 | "eslint-plugin-react-refresh": "^0.4.3", 27 | "vite": "^4.4.5" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Project List/ProjectList.md: -------------------------------------------------------------------------------- 1 | 1. [Github Readme Generator](https://github.com/hackelite01/github-readme-maker) 2 | 2. [Github Readme Cyber Quotes](https://github.com/hackelite01/github-readme-cyber-quotes) 3 | 3. [ShieldSurf](https://github.com/hackelite01/ShieldSurf) 4 | 4. [HoneyPot](https://github.com/hackelite01/HoneyPot) 5 | 5. [Bypass403](https://github.com/hackelite01/Bypass403) 6 | 6. [CryptX](https://github.com/hackelite01/CryptX) 7 | 7. [CyberSecurity Resources](https://github.com/hackelite01/CyberSecurity-Resources) 8 | 8. [ElecTrip](https://github.com/hackelite01/ElecTrip) 9 | 9. [XssProbe](https://github.com/hackelite01/XSSProbe) 10 | 10. [ApiHub](https://github.com/hackelite01/ApiHub) 11 | 11. [SnapCode](https://github.com/hackelite01/SnapCode) 12 | 12. [Weather Point](https://github.com/hackelite01/WeatherPoint) 13 | 13. [SirCashier](https://github.com/AlfatTaufik/SI_Kasir_Toko) 14 | 14. [ReelReview](https://github.com/codelikeagirl29) 15 | -------------------------------------------------------------------------------- /projects/C++/quickSort.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | int partition(int arr[], int start, int end){ 4 | int pivot = arr[end]; 5 | int i = start - 1; 6 | for(int j = start; j>n; 33 | int arr[n]; 34 | for(int i=0; i>arr[i]; 36 | } 37 | cout<<"original array :- "; 38 | printArray(arr,n); 39 | quickSort(arr,0,n-1); 40 | cout<<"sorted array :- "; 41 | printArray(arr,n); 42 | 43 | } -------------------------------------------------------------------------------- /Go/FuzzerBuzzer/internal/http/errors.go: -------------------------------------------------------------------------------- 1 | package http 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | // HTTPError represents an error that occurred during an HTTP request 9 | type HTTPError struct { 10 | StatusCode int 11 | Message string 12 | } 13 | 14 | // Error implements the error interface for HTTPError 15 | func (e *HTTPError) Error() string { 16 | return fmt.Sprintf("HTTP %d: %s", e.StatusCode, e.Message) 17 | } 18 | 19 | // NewHTTPError creates a new instance of HTTPError 20 | func NewHTTPError(statusCode int, message string) *HTTPError { 21 | return &HTTPError{ 22 | StatusCode: statusCode, 23 | Message: message, 24 | } 25 | } 26 | 27 | // CheckResponse checks the HTTP response and returns an error if the status code indicates failure 28 | func CheckResponse(resp *http.Response) error { 29 | if resp.StatusCode < 200 || resp.StatusCode >= 300 { 30 | return NewHTTPError(resp.StatusCode, http.StatusText(resp.StatusCode)) 31 | } 32 | return nil 33 | } 34 | -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko/GlobalVariable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SI_Kasir_Toko 8 | { 9 | internal class GlobalVariable 10 | { 11 | public static string fullName { get; set; } 12 | public static bool role { get; set; } 13 | 14 | public static DBContextDataContext Db = new DBContextDataContext(); 15 | public static Form1 getStarted; 16 | public static LoginForm loginForm; 17 | public static SupplierForm supplierForm; 18 | public static RegisterForm registerForm; 19 | public static AdminDashboardForm dashboardAdmin; 20 | public static KasirDashboardForm dashboardKasir; 21 | public static FormBarang formBarang; 22 | public static FormPetugas formPetugas; 23 | public static FormRiwayat formRiwayat; 24 | public static FormTransaksi formTransaksi; 25 | public static StockBarangForm stockBarang; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | <?xml version="1.0" encoding="utf-16"?> 7 | <SerializableConnectionString xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 8 | <ConnectionString>Data Source=.\SQLEXPRESS;Initial Catalog=SI_KASIR_PBO;Integrated Security=True;TrustServerCertificate=True</ConnectionString> 9 | <ProviderName>System.Data.SqlClient</ProviderName> 10 | </SerializableConnectionString> 11 | Data Source=.\SQLEXPRESS;Initial Catalog=SI_KASIR_PBO;Integrated Security=True;TrustServerCertificate=True 12 | 13 | 14 | -------------------------------------------------------------------------------- /Go/FuzzerBuzzer/internal/fuzz_logic/fuzz.go: -------------------------------------------------------------------------------- 1 | package fuzz_logic 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | 7 | "github.com/Ayushi40804/Hacktoberfest2024/FuzzerBuzzer/internal/generator" 8 | ) 9 | 10 | // Fuzzer struct represents the fuzzer with necessary fields 11 | type Fuzzer struct { 12 | TargetURL string 13 | Generator *generator.InputGenerator 14 | } 15 | 16 | // NewFuzzer creates a new Fuzzer instance 17 | func NewFuzzer(targetURL string, generator *generator.InputGenerator) *Fuzzer { 18 | return &Fuzzer{ 19 | TargetURL: targetURL, 20 | Generator: generator, 21 | } 22 | } 23 | 24 | // Start method to begin fuzzing process 25 | func (f *Fuzzer) Start() { 26 | // Generate random input 27 | randomInput := f.Generator.GenerateRandomString(10) 28 | fmt.Println("Generated input:", randomInput) 29 | 30 | // Send a POST request 31 | resp, err := http.Post(f.TargetURL+"?input="+randomInput, "application/json", nil) 32 | if err != nil { 33 | fmt.Println("Error sending request:", err) 34 | return 35 | } 36 | defer resp.Body.Close() 37 | 38 | fmt.Println("Response Status:", resp.Status) 39 | } 40 | -------------------------------------------------------------------------------- /Go/FuzzerBuzzer/cmd/fuzzer.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | "os" 6 | 7 | "github.com/Ayushi40804/Hacktoberfest2024/FuzzerBuzzer/internal/fuzz_logic" 8 | "github.com/Ayushi40804/Hacktoberfest2024/FuzzerBuzzer/internal/generator" 9 | "gopkg.in/yaml.v2" 10 | ) 11 | 12 | type Config struct { 13 | TargetURL string `yaml:"target_url"` 14 | Seed int64 `yaml:"seed"` 15 | } 16 | 17 | func main() { 18 | // Load the configuration 19 | config, err := loadConfig("config/config.yaml") 20 | if err != nil { 21 | log.Fatalf("Error reading config file: %v", err) 22 | } 23 | 24 | // Create an InputGenerator 25 | inputGen := generator.NewInputGenerator(config.Seed) 26 | 27 | // Create a Fuzzer 28 | fuzzer := fuzz_logic.NewFuzzer(config.TargetURL, inputGen) 29 | 30 | // Start the fuzzing process 31 | fuzzer.Start() 32 | } 33 | 34 | // loadConfig loads the configuration from a YAML file 35 | func loadConfig(path string) (Config, error) { 36 | var config Config 37 | data, err := os.ReadFile(path) 38 | if err != nil { 39 | return config, err 40 | } 41 | err = yaml.Unmarshal(data, &config) 42 | return config, err 43 | } 44 | -------------------------------------------------------------------------------- /Python/alarm clock.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | import time 3 | import pygame 4 | 5 | def set_alarm(alarm_time): 6 | print(f"Alarm set for {alarm_time}") 7 | 8 | while True: 9 | # Get the current time 10 | current_time = datetime.datetime.now().strftime("%H:%M:%S") 11 | print(f"Current Time: {current_time}", end="\r") 12 | 13 | # Check if the current time matches the alarm time 14 | if current_time == alarm_time: 15 | print("\nWake up! It's time!") 16 | 17 | # Initialize pygame mixer and play the alarm sound 18 | pygame.mixer.init() 19 | pygame.mixer.music.load('alarm_sound.mp3') # Make sure your alarm sound is in the same directory 20 | pygame.mixer.music.play() 21 | 22 | # Wait for the music to finish 23 | while pygame.mixer.music.get_busy(): 24 | time.sleep(1) 25 | 26 | break 27 | 28 | # Wait for 1 second before checking the time again 29 | time.sleep(1) 30 | 31 | if __name__ == "__main__": 32 | # User input for the alarm time (HH:MM:SS format) 33 | alarm_time = input("Enter the alarm time (HH:MM:SS): ") 34 | set_alarm(alarm_time) 35 | -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace SI_Kasir_Toko 8 | { 9 | using static GlobalVariable; 10 | internal static class Program 11 | { 12 | /// 13 | /// The main entry point for the application. 14 | /// 15 | [STAThread] 16 | static void Main() 17 | { 18 | Application.EnableVisualStyles(); 19 | Application.SetCompatibleTextRenderingDefault(false); 20 | getStarted = new Form1(); 21 | loginForm = new LoginForm(); 22 | registerForm = new RegisterForm(); 23 | dashboardAdmin = new AdminDashboardForm(); 24 | dashboardKasir = new KasirDashboardForm(); 25 | formBarang = new FormBarang(); 26 | formPetugas = new FormPetugas(); 27 | supplierForm = new SupplierForm(); 28 | formRiwayat = new FormRiwayat(); 29 | formTransaksi = new FormTransaksi(); 30 | stockBarang = new StockBarangForm(); 31 | Application.Run(new Form1()); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Go/FuzzerBuzzer/internal/http/client.go: -------------------------------------------------------------------------------- 1 | package http 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | "net/http" 7 | ) 8 | 9 | // Client struct that wraps the http.Client and any custom configurations 10 | type Client struct { 11 | HTTPClient *http.Client 12 | Headers map[string]string 13 | } 14 | 15 | // NewClient creates a new HTTP client with custom headers 16 | 17 | func NewClient(headers map[string]string) *http.Client { 18 | 19 | client := &http.Client{} 20 | 21 | // You can add custom headers handling logic here if needed 22 | 23 | return client 24 | 25 | } 26 | 27 | // Post sends a POST request to the specified URL with the provided data 28 | func (c *Client) Post(url string, contentType string, body io.Reader) (*http.Response, error) { 29 | // Create a new request 30 | req, err := http.NewRequest("POST", url, body) 31 | if err != nil { 32 | return nil, fmt.Errorf("failed to create request: %w", err) 33 | } 34 | 35 | // Add custom headers to the request 36 | for key, value := range c.Headers { 37 | req.Header.Set(key, value) 38 | } 39 | 40 | // Send the request 41 | resp, err := c.HTTPClient.Do(req) 42 | if err != nil { 43 | return nil, fmt.Errorf("failed to send request: %w", err) 44 | } 45 | 46 | return resp, nil 47 | } 48 | -------------------------------------------------------------------------------- /Python/prime number generator.py: -------------------------------------------------------------------------------- 1 | import json 2 | import os 3 | 4 | def is_prime(n): 5 | if n <= 1: 6 | return False 7 | for i in range(2, int(n ** 0.5) + 1): 8 | if n % i == 0: 9 | return False 10 | return True 11 | 12 | def generate_primes(start, limit, existing_primes): 13 | primes = existing_primes 14 | count = max(existing_primes.values(), default=0) + 1 15 | for num in range(start, limit + 1): 16 | if is_prime(num) and num not in primes: 17 | primes[num] = count 18 | count += 1 19 | return primes 20 | 21 | def load_existing_primes(filename): 22 | if os.path.exists(filename): 23 | with open(filename, 'r') as json_file: 24 | return json.load(json_file) 25 | return {} 26 | 27 | prime_limit = int(input("Enter prime limit: ")) 28 | json_file_name = 'primes.json' 29 | 30 | prime_dict = load_existing_primes(json_file_name) 31 | 32 | if prime_dict: 33 | start_from = max(map(int, prime_dict.keys())) + 1 34 | else: 35 | start_from = 2 36 | 37 | prime_dict = generate_primes(start_from, prime_limit, prime_dict) 38 | 39 | with open(json_file_name, 'w') as json_file: 40 | json.dump(prime_dict, json_file, indent=4) 41 | 42 | print(f"Prime numbers up to {prime_limit} have been saved to '{json_file_name}'") 43 | 44 | -------------------------------------------------------------------------------- /projects/Java/Calculator.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public class Calculator { 4 | public static void main(String[] args) { 5 | Scanner scanner = new Scanner(System.in); 6 | 7 | System.out.println("Enter first number:"); 8 | double num1 = scanner.nextDouble(); 9 | 10 | System.out.println("Enter an operator (+, -, *, /):"); 11 | char operator = scanner.next().charAt(0); 12 | 13 | System.out.println("Enter second number:"); 14 | double num2 = scanner.nextDouble(); 15 | 16 | double result = 0; 17 | switch (operator) { 18 | case '+': 19 | result = num1 + num2; 20 | break; 21 | case '-': 22 | result = num1 - num2; 23 | break; 24 | case '*': 25 | result = num1 * num2; 26 | break; 27 | case '/': 28 | if (num2 != 0) 29 | result = num1 / num2; 30 | else 31 | System.out.println("Cannot divide by zero"); 32 | break; 33 | default: 34 | System.out.println("Invalid operator"); 35 | return; 36 | } 37 | System.out.printf("The result is: %.2f", result); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Go/FuzzerBuzzer/pkg/helpers.go: -------------------------------------------------------------------------------- 1 | package pkg 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "os" 7 | ) 8 | 9 | // ReadFile reads a file and returns its content as a byte slice 10 | func ReadFile(filePath string) ([]byte, error) { 11 | data, err := os.ReadFile(filePath) 12 | if err != nil { 13 | return nil, fmt.Errorf("failed to read file %s: %w", filePath, err) 14 | } 15 | return data, nil 16 | } 17 | 18 | // WriteFile writes data to a file 19 | func WriteFile(filePath string, data []byte) error { 20 | err := os.WriteFile(filePath, data, 0644) 21 | if err != nil { 22 | return fmt.Errorf("failed to write file %s: %w", filePath, err) 23 | } 24 | return nil 25 | } 26 | 27 | // JSONPrettyPrint takes a JSON string and returns it in a pretty format 28 | func JSONPrettyPrint(data []byte) (string, error) { 29 | var prettyJSON map[string]interface{} 30 | err := json.Unmarshal(data, &prettyJSON) 31 | if err != nil { 32 | return "", fmt.Errorf("failed to unmarshal JSON: %w", err) 33 | } 34 | 35 | pretty, err := json.MarshalIndent(prettyJSON, "", " ") 36 | if err != nil { 37 | return "", fmt.Errorf("failed to marshal JSON: %w", err) 38 | } 39 | 40 | return string(pretty), nil 41 | } 42 | 43 | // FileExists checks if a file exists at the given path 44 | func FileExists(filePath string) bool { 45 | _, err := os.Stat(filePath) 46 | return !os.IsNotExist(err) 47 | } 48 | -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko/KasirDashboardForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace SI_Kasir_Toko 12 | { 13 | using static GlobalVariable; 14 | public partial class KasirDashboardForm : Form 15 | { 16 | public KasirDashboardForm() 17 | { 18 | InitializeComponent(); 19 | txtFullname.Text = fullName; 20 | } 21 | 22 | private void btnLogout_Click(object sender, EventArgs e) 23 | { 24 | loginForm.Show(); 25 | this.Hide(); 26 | } 27 | 28 | private void btnRiwayat_Click(object sender, EventArgs e) 29 | { 30 | formTransaksi.Show(); 31 | this.Hide(); 32 | } 33 | 34 | private void btnBarang_Click(object sender, EventArgs e) 35 | { 36 | stockBarang.Show(); 37 | this.Hide(); 38 | } 39 | 40 | private void btnPetugas_Click(object sender, EventArgs e) 41 | { 42 | formRiwayat.Show(); 43 | this.Hide(); 44 | } 45 | 46 | private void KasirDashboardForm_Load(object sender, EventArgs e) 47 | { 48 | txtFullname.Text = fullName.ToString(); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /projects/C++/countSort.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int getMax(int a[], int n) { 5 | int max = a[0]; 6 | for(int i = 1; i max) 8 | max = a[i]; 9 | } 10 | return max; 11 | } 12 | 13 | void countSort(int a[], int n) 14 | { 15 | int output[n]; 16 | int max = getMax(a, n); 17 | int count[max+1]; 18 | 19 | 20 | for (int i = 0; i <= max; i++) 21 | { 22 | count[i] = 0; 23 | } 24 | 25 | for (int i = 0; i < n; i++) 26 | { 27 | count[a[i]]++; 28 | } 29 | 30 | for(int i = 1; i<=max; i++) 31 | count[i] += count[i-1]; 32 | 33 | 34 | for (int i = n - 1; i >= 0; i--) { 35 | output[count[a[i]] 36 | - 1] = a[i]; 37 | count[a[i]]--; 38 | } 39 | 40 | for(int i = 0; i>n; 56 | int a[n]; 57 | for(int i=0; i>a[i]; 59 | } 60 | cout<<"Before sorting array elements are - \n"; 61 | printArr(a, n); 62 | countSort(a, n); 63 | cout<<"\nAfter sorting array elements are - \n"; 64 | printArr(a, n); 65 | return 0; 66 | 67 | } 68 | -------------------------------------------------------------------------------- /JavaScript/MERN Project/React-NewsPulse-App/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 10 | 11 | 17 | 18 | 19 | NewsPulse - Stay informed with your daily dose of news all for free! 20 | 21 | 22 | 23 |
24 | 25 | 26 | 31 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /projects/Python/Random Password Generator.py: -------------------------------------------------------------------------------- 1 | # import modules 2 | import string 3 | import random 4 | string1 = list(string.ascii_lowercase) 5 | string2 = list(string.ascii_uppercase) 6 | string3 = list(string.digits) 7 | string4 = list(string.punctuation) 8 | 9 | user_input = input("How many characters do you want in your password? ") 10 | 11 | 12 | # check this input is it number? is it more than 8? 13 | while True: 14 | try: 15 | characters_number = int(user_input) 16 | if characters_number < 8: 17 | print("Your number should be at least 8.") 18 | user_input = input("Please, Enter your number again: ") 19 | else: 20 | break 21 | except: 22 | print("Please, Enter numbers only.") 23 | user_input = input("How many characters do you want in your password? ") 24 | 25 | # shuffle all lists 26 | random.shuffle(string1) 27 | random.shuffle(string2) 28 | random.shuffle(string3) 29 | random.shuffle(string4) 30 | 31 | # calculate 30% & 20% of number of characters 32 | part1 = round(characters_number * (30/100)) 33 | part2 = round(characters_number * (20/100)) 34 | 35 | 36 | # generation of the password (60% letters and 40% digits & punctuations) 37 | result = [] 38 | for x in range(part1): 39 | result.append(string1[x]) 40 | result.append(string2[x]) 41 | for x in range(part2): 42 | result.append(string3[x]) 43 | result.append(string4[x]) 44 | 45 | 46 | # shuffle result 47 | random.shuffle(result) 48 | # join result 49 | password = "".join(result) 50 | print("Strong Password: ", password) 51 | -------------------------------------------------------------------------------- /JavaScript/MERN Project/React-NewsPulse-App/public/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko/AdminDashboardForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace SI_Kasir_Toko 12 | { 13 | using static GlobalVariable; 14 | public partial class AdminDashboardForm : Form 15 | { 16 | public AdminDashboardForm() 17 | { 18 | InitializeComponent(); 19 | } 20 | 21 | private void btnPetugas_Click(object sender, EventArgs e) 22 | { 23 | formPetugas.Show(); 24 | this.Hide(); 25 | } 26 | 27 | private void btnLogout_Click(object sender, EventArgs e) 28 | { 29 | loginForm.Show(); 30 | this.Hide(); 31 | } 32 | 33 | private void btnRiwayat_Click(object sender, EventArgs e) 34 | { 35 | formRiwayat.Show(); 36 | this.Hide(); 37 | } 38 | 39 | private void btnBarang_Click(object sender, EventArgs e) 40 | { 41 | formBarang.Show(); 42 | this.Hide(); 43 | } 44 | 45 | private void AdminDashboardForm_Load(object sender, EventArgs e) 46 | { 47 | txtFullname.Text = fullName; 48 | } 49 | 50 | private void btnSupplier_Click(object sender, EventArgs e) 51 | { 52 | supplierForm.Show(); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Go/FuzzerBuzzer/internal/generator/input_gen.go: -------------------------------------------------------------------------------- 1 | package generator 2 | 3 | import ( 4 | "encoding/json" 5 | "math/rand" 6 | ) 7 | 8 | // InputGenerator struct for generating various types of input 9 | type InputGenerator struct { 10 | Seed int64 11 | } 12 | 13 | // NewInputGenerator creates a new InputGenerator with a specified seed 14 | func NewInputGenerator(seed int64) *InputGenerator { 15 | rand.Seed(seed) // Seed the random number generator 16 | return &InputGenerator{Seed: seed} 17 | } 18 | 19 | // GenerateRandomString generates a random string of a specified length 20 | func (ig *InputGenerator) GenerateRandomString(length int) string { 21 | letters := []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") 22 | result := make([]rune, length) 23 | for i := range result { 24 | result[i] = letters[rand.Intn(len(letters))] 25 | } 26 | return string(result) 27 | } 28 | 29 | // GenerateRandomJSON generates random JSON input 30 | func (ig *InputGenerator) GenerateRandomJSON() string { 31 | type RandomData struct { 32 | Name string `json:"name"` 33 | Email string `json:"email"` 34 | Age int `json:"age"` 35 | } 36 | 37 | data := RandomData{ 38 | Name: ig.GenerateRandomString(10), 39 | Email: ig.GenerateRandomString(5) + "@example.com", 40 | Age: rand.Intn(100), 41 | } 42 | 43 | // Convert to JSON 44 | jsonData, err := json.Marshal(data) 45 | if err != nil { 46 | return "{}" // Return empty JSON on error 47 | } 48 | return string(jsonData) 49 | } 50 | -------------------------------------------------------------------------------- /projects/WebProject/reelreview/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Movie Reviews 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 |

Reel Review

21 | 25 |
26 |
27 | 28 |
29 | 30 | 31 | 32 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SI_Kasir_Toko")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SI_Kasir_Toko")] 13 | [assembly: AssemblyCopyright("Copyright © 2024")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("b3de261f-6eee-45aa-85f6-39eeb5f4f4f9")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /JavaScript/MERN Project/React-NewsPulse-App/src/Components/NewsItem.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | const NewsItem = (props) => { 4 | let { title, description, imageUrl, newsUrl, author, date, source } = props; 5 | return ( 6 |
7 |
8 |
16 | {source} 17 |
18 | ... 27 |
28 |
{title}
29 |

{description}

30 |

31 | 32 | By {!author ? "Unknown" : author} on{" "} 33 | {new Date(date).toGMTString()} 34 | 35 |

36 | 37 | 43 | Read More 44 | 45 |
46 |
47 |
48 | ); 49 | }; 50 | 51 | export default NewsItem; 52 | -------------------------------------------------------------------------------- /projects/Python/to_do_list.py: -------------------------------------------------------------------------------- 1 | def display_tasks(): 2 | with open("tasks.txt", "r") as f: 3 | tasks = f.readlines() 4 | if not tasks: 5 | print("No tasks in the to-do list.") 6 | else: 7 | print("To-Do List:") 8 | for i, task in enumerate(tasks): 9 | print(f"{i + 1}. {task.strip()}") 10 | 11 | def add_task(task): 12 | with open("tasks.txt", "a") as f: 13 | f.write(task + "\n") 14 | print("Task added successfully!") 15 | 16 | def remove_task(task_number): 17 | with open("tasks.txt", "r") as f: 18 | tasks = f.readlines() 19 | if task_number > len(tasks) or task_number < 1: 20 | print("Invalid task number!") 21 | else: 22 | del tasks[task_number - 1] 23 | with open("tasks.txt", "w") as f: 24 | f.writelines(tasks) 25 | print("Task removed successfully!") 26 | 27 | def main(): 28 | while True: 29 | print("\n1. View Tasks") 30 | print("2. Add Task") 31 | print("3. Remove Task") 32 | print("4. Quit") 33 | 34 | choice = input("Enter your choice: ") 35 | 36 | if choice == "1": 37 | display_tasks() 38 | elif choice == "2": 39 | task = input("Enter the task: ") 40 | add_task(task) 41 | elif choice == "3": 42 | task_number = int(input("Enter task number to remove: ")) 43 | remove_task(task_number) 44 | elif choice == "4": 45 | break 46 | else: 47 | print("Invalid choice!") 48 | 49 | if __name__ == "__main__": 50 | main() 51 | -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.8.34511.84 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SI_Kasir_Toko", "SI_Kasir_Toko\SI_Kasir_Toko.csproj", "{B3DE261F-6EEE-45AA-85F6-39EEB5F4F4F9}" 7 | EndProject 8 | Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "SirCashierSetupTwo", "SirCashierSetupTwo\SirCashierSetupTwo.vdproj", "{F36F0951-4A73-4F79-A0CC-F5DEC4F7AE1E}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {B3DE261F-6EEE-45AA-85F6-39EEB5F4F4F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {B3DE261F-6EEE-45AA-85F6-39EEB5F4F4F9}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {B3DE261F-6EEE-45AA-85F6-39EEB5F4F4F9}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {B3DE261F-6EEE-45AA-85F6-39EEB5F4F4F9}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {F36F0951-4A73-4F79-A0CC-F5DEC4F7AE1E}.Debug|Any CPU.ActiveCfg = Release 21 | {F36F0951-4A73-4F79-A0CC-F5DEC4F7AE1E}.Debug|Any CPU.Build.0 = Release 22 | {F36F0951-4A73-4F79-A0CC-F5DEC4F7AE1E}.Release|Any CPU.ActiveCfg = Release 23 | EndGlobalSection 24 | GlobalSection(SolutionProperties) = preSolution 25 | HideSolutionNode = FALSE 26 | EndGlobalSection 27 | GlobalSection(ExtensibilityGlobals) = postSolution 28 | SolutionGuid = {B72FAB4F-681F-4EB4-A1A0-C5F1ECFF6D33} 29 | EndGlobalSection 30 | EndGlobal 31 | -------------------------------------------------------------------------------- /projects/Python/to_do_list_2.py: -------------------------------------------------------------------------------- 1 | class ToDoList: 2 | def __init__(self): 3 | self.tasks = [] 4 | 5 | def add_task(self, task): 6 | self.tasks.append(task) 7 | print(f'Task added: "{task}"') 8 | 9 | def view_tasks(self): 10 | if not self.tasks: 11 | print("No tasks in the list.") 12 | else: 13 | print("To-Do List:") 14 | for index, task in enumerate(self.tasks, start=1): 15 | print(f"{index}. {task}") 16 | 17 | def remove_task(self, task_number): 18 | try: 19 | removed_task = self.tasks.pop(task_number - 1) 20 | print(f'Task removed: "{removed_task}"') 21 | except IndexError: 22 | print("Invalid task number.") 23 | 24 | def main(): 25 | todo_list = ToDoList() 26 | 27 | while True: 28 | print("\nOptions:") 29 | print("1. Add Task") 30 | print("2. View Tasks") 31 | print("3. Remove Task") 32 | print("4. Exit") 33 | 34 | choice = input("Choose an option (1-4): ") 35 | 36 | if choice == '1': 37 | task = input("Enter the task: ") 38 | todo_list.add_task(task) 39 | elif choice == '2': 40 | todo_list.view_tasks() 41 | elif choice == '3': 42 | task_number = int(input("Enter the task number to remove: ")) 43 | todo_list.remove_task(task_number) 44 | elif choice == '4': 45 | print("Exiting the to-do list application.") 46 | break 47 | else: 48 | print("Invalid option. Please choose again.") 49 | 50 | if __name__ == "__main__": 51 | main() -------------------------------------------------------------------------------- /projects/WebProject/calculator/calculator.js: -------------------------------------------------------------------------------- 1 | // Function to display result 2 | function displayResult(result) { 3 | document.getElementById('result').innerText = "Result: " + result; 4 | } 5 | 6 | // Addition 7 | function add() { 8 | const num1 = parseFloat(document.getElementById('num1').value); 9 | const num2 = parseFloat(document.getElementById('num2').value); 10 | displayResult(num1 + num2); 11 | } 12 | 13 | // Subtraction 14 | function subtract() { 15 | const num1 = parseFloat(document.getElementById('num1').value); 16 | const num2 = parseFloat(document.getElementById('num2').value); 17 | displayResult(num1 - num2); 18 | } 19 | 20 | // Multiplication 21 | function multiply() { 22 | const num1 = parseFloat(document.getElementById('num1').value); 23 | const num2 = parseFloat(document.getElementById('num2').value); 24 | displayResult(num1 * num2); 25 | } 26 | 27 | // Division 28 | function divide() { 29 | const num1 = parseFloat(document.getElementById('num1').value); 30 | const num2 = parseFloat(document.getElementById('num2').value); 31 | if (num2 === 0) { 32 | displayResult("Cannot divide by zero!"); 33 | } else { 34 | displayResult(num1 / num2); 35 | } 36 | } 37 | 38 | // Exponentiation (num1 ^ num2) 39 | function exponent() { 40 | const num1 = parseFloat(document.getElementById('num1').value); 41 | const num2 = parseFloat(document.getElementById('num2').value); 42 | displayResult(Math.pow(num1, num2)); 43 | } 44 | 45 | // Factorial 46 | function factorial() { 47 | const num1 = parseInt(document.getElementById('num1').value); 48 | if (num1 < 0) { 49 | displayResult("Factorial not defined for negative numbers!"); 50 | return; 51 | } 52 | let fact = 1; 53 | for (let i = 1; i <= num1; i++) { 54 | fact *= i; 55 | } 56 | displayResult(fact); 57 | } 58 | -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SI_Kasir_Toko.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.8.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.ApplicationScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)] 29 | [global::System.Configuration.DefaultSettingValueAttribute("Data Source=.\\SQLEXPRESS;Initial Catalog=SI_KASIR_PBO;Integrated Security=True;Tr" + 30 | "ustServerCertificate=True")] 31 | public string SI_KASIR_PBOConnectionString { 32 | get { 33 | return ((string)(this["SI_KASIR_PBOConnectionString"])); 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Python/sudoku-solver-backtracking.py: -------------------------------------------------------------------------------- 1 | # Sudoku Solver using Backtracking 2 | def print_board(board): 3 | for row in board: 4 | print(" ".join(str(cell) for cell in row)) 5 | 6 | def find_empty(board): 7 | for i in range(9): 8 | for j in range(9): 9 | if board[i][j] == 0: 10 | return (i, j) # row, col 11 | return None 12 | 13 | def is_valid(board, num, pos): 14 | row, col = pos 15 | 16 | # Check the row 17 | if any(board[row][i] == num for i in range(9)): 18 | return False 19 | 20 | # Check the column 21 | if any(board[i][col] == num for i in range(9)): 22 | return False 23 | 24 | # Check the 3x3 box 25 | box_x = col // 3 26 | box_y = row // 3 27 | for i in range(box_y * 3, box_y * 3 + 3): 28 | for j in range(box_x * 3, box_x * 3 + 3): 29 | if board[i][j] == num: 30 | return False 31 | 32 | return True 33 | 34 | def solve(board): 35 | empty = find_empty(board) 36 | if not empty: 37 | return True # Puzzle solved 38 | row, col = empty 39 | 40 | for num in range(1, 10): 41 | if is_valid(board, num, (row, col)): 42 | board[row][col] = num 43 | 44 | if solve(board): 45 | return True 46 | 47 | board[row][col] = 0 # Backtrack 48 | 49 | return False 50 | 51 | # Example Sudoku board (0 represents empty spaces) 52 | sudoku_board = [ 53 | [5, 3, 0, 0, 7, 0, 0, 0, 0], 54 | [6, 0, 0, 1, 9, 5, 0, 0, 0], 55 | [0, 9, 8, 0, 0, 0, 0, 6, 0], 56 | [8, 0, 0, 0, 6, 0, 0, 0, 3], 57 | [4, 0, 0, 8, 0, 3, 0, 0, 1], 58 | [7, 0, 0, 0, 2, 0, 0, 0, 6], 59 | [0, 6, 0, 0, 0, 0, 2, 8, 0], 60 | [0, 0, 0, 4, 1, 9, 0, 0, 5], 61 | [0, 0, 0, 0, 8, 0, 0, 7, 9] 62 | ] 63 | 64 | print("Original Sudoku Board:") 65 | print_board(sudoku_board) 66 | solve(sudoku_board) 67 | print("\nSolved Sudoku Board:") 68 | print_board(sudoku_board) 69 | -------------------------------------------------------------------------------- /projects/Python/tic-tac-toe.py: -------------------------------------------------------------------------------- 1 | # Function to print the Tic Tac Toe board 2 | def print_board(board): 3 | print("\n") 4 | for row in board: 5 | print("|".join(row)) 6 | print("-" * 5) 7 | print("\n") 8 | 9 | # Function to check if a player has won 10 | def check_win(board, player): 11 | # Check rows, columns and diagonals for a win 12 | for i in range(3): 13 | if all([spot == player for spot in board[i]]) or all([board[j][i] == player for j in range(3)]): 14 | return True 15 | if board[0][0] == board[1][1] == board[2][2] == player or board[0][2] == board[1][1] == board[2][0] == player: 16 | return True 17 | return False 18 | 19 | # Function to check if the board is full (draw) 20 | def check_draw(board): 21 | return all([spot != " " for row in board for spot in row]) 22 | 23 | # Function to play Tic Tac Toe 24 | def play_tic_tac_toe(): 25 | # Initialize the game board 26 | board = [[" " for _ in range(3)] for _ in range(3)] 27 | current_player = "X" 28 | 29 | while True: 30 | print_board(board) 31 | print(f"Player {current_player}'s turn. Enter your move (row and column number from 1-3): ") 32 | 33 | # Get user input for row and column 34 | try: 35 | row, col = map(int, input("Enter row and column: ").split()) 36 | if board[row-1][col-1] != " ": 37 | print("This spot is already taken. Try again.") 38 | continue 39 | except (ValueError, IndexError): 40 | print("Invalid input. Please enter row and column as two numbers between 1 and 3.") 41 | continue 42 | 43 | # Place the player's move 44 | board[row-1][col-1] = current_player 45 | 46 | # Check for a win or draw 47 | if check_win(board, current_player): 48 | print_board(board) 49 | print(f"Player {current_player} wins!") 50 | break 51 | elif check_draw(board): 52 | print_board(board) 53 | print("It's a draw!") 54 | break 55 | 56 | # Switch players 57 | current_player = "O" if current_player == "X" else "X" 58 | 59 | # Run the game 60 | play_tic_tac_toe() 61 | -------------------------------------------------------------------------------- /C++/mergesort.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | // Function to merge two subarrays 5 | void merge(int arr[], int left, int mid, int right) { 6 | int n1 = mid - left + 1; 7 | int n2 = right - mid; 8 | 9 | // Create temporary arrays 10 | int L[n1], R[n2]; 11 | 12 | // Copy data to temporary arrays L[] and R[] 13 | for (int i = 0; i < n1; i++) 14 | L[i] = arr[left + i]; 15 | for (int j = 0; j < n2; j++) 16 | R[j] = arr[mid + 1 + j]; 17 | 18 | // Merge the temporary arrays back into arr[left..right] 19 | int i = 0; // Initial index of first subarray 20 | int j = 0; // Initial index of second subarray 21 | int k = left; // Initial index of merged subarray 22 | 23 | while (i < n1 && j < n2) { 24 | if (L[i] <= R[j]) { 25 | arr[k] = L[i]; 26 | i++; 27 | } else { 28 | arr[k] = R[j]; 29 | j++; 30 | } 31 | k++; 32 | } 33 | 34 | // Copy the remaining elements of L[], if any 35 | while (i < n1) { 36 | arr[k] = L[i]; 37 | i++; 38 | k++; 39 | } 40 | 41 | // Copy the remaining elements of R[], if any 42 | while (j < n2) { 43 | arr[k] = R[j]; 44 | j++; 45 | k++; 46 | } 47 | } 48 | 49 | // Function to implement merge sort 50 | void mergeSort(int arr[], int left, int right) { 51 | if (left < right) { 52 | int mid = left + (right - left) / 2; 53 | 54 | // Recursively sort first and second halves 55 | mergeSort(arr, left, mid); 56 | mergeSort(arr, mid + 1, right); 57 | 58 | // Merge the sorted halves 59 | merge(arr, left, mid, right); 60 | } 61 | } 62 | 63 | // Function to print the array 64 | void printArray(int arr[], int size) { 65 | for (int i = 0; i < size; i++) 66 | cout << arr[i] << " "; 67 | cout << endl; 68 | } 69 | 70 | int main() { 71 | int arr[] = {12, 11, 13, 5, 6, 7}; 72 | int arr_size = sizeof(arr) / sizeof(arr[0]); 73 | 74 | cout << "Given array: \n"; 75 | printArray(arr, arr_size); 76 | 77 | mergeSort(arr, 0, arr_size - 1); 78 | 79 | cout << "\nSorted array: \n"; 80 | printArray(arr, arr_size); 81 | return 0; 82 | } 83 | -------------------------------------------------------------------------------- /projects/Python/Disk Usage Analyzer.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | class DiskUsageAnalyzer: 4 | def __init__(self): 5 | # Initialize an empty dictionary to store file sizes 6 | self.file_sizes = {} 7 | 8 | def analyze_directory(self, directory): 9 | """ 10 | Analyze the disk usage of a given directory. 11 | :param directory: The directory to analyze. 12 | """ 13 | # Walk through the directory, including subdirectories 14 | for dirpath, _, filenames in os.walk(directory): 15 | for filename in filenames: 16 | # Construct the full file path 17 | filepath = os.path.join(dirpath, filename) 18 | try: 19 | # Get the file size and store it in the dictionary 20 | file_size = os.path.getsize(filepath) 21 | self.file_sizes[filepath] = file_size 22 | except FileNotFoundError: 23 | # Handle the case where the file is not found 24 | print(f"File not found: {filepath}") 25 | except PermissionError: 26 | # Handle permission errors 27 | print(f"Permission denied: {filepath}") 28 | 29 | def get_largest_files(self, n=5): 30 | """ 31 | Return the top N largest files in the analyzed directory. 32 | :param n: The number of largest files to return. 33 | :return: A list of tuples containing file paths and their sizes. 34 | """ 35 | # Sort files by size in descending order and return the top N 36 | return sorted(self.file_sizes.items(), key=lambda x: -x[1])[:n] 37 | 38 | # Test Cases 39 | if __name__ == "__main__": 40 | # Create an instance of DiskUsageAnalyzer 41 | analyzer = DiskUsageAnalyzer() 42 | 43 | # Provide a directory to analyze, for example, 'test_folder' 44 | analyzer.analyze_directory("test_folder") 45 | 46 | # Display the top 5 largest files 47 | largest_files = analyzer.get_largest_files(5) 48 | print("Top 5 Largest Files:") 49 | for filepath, size in largest_files: 50 | # Convert size from bytes to MB for easier reading 51 | print(f"{filepath}: {size / (1024 * 1024):.2f} MB") 52 | -------------------------------------------------------------------------------- /projects/C#/CashierApp/README.md: -------------------------------------------------------------------------------- 1 | # SI Kasir Toko 2 | 3 | SI Kasir Toko is a simple cashier application built using Windows Forms, designed to help users manage sales transactions in a store. The application includes features for calculating total purchases, storing item data, and other essential cashier operations. 4 | 5 | ## Main Features 6 | - Add and manage a list of items 7 | - Calculate total transaction 8 | - Payment processing and nominal payment validation 9 | - Print receipt 10 | 11 | ## System Requirements 12 | 13 | Before running the application, ensure your system meets the following requirements: 14 | - **Windows OS** (Windows 7 or later) 15 | - **.NET Framework 4.7.2** or higher 16 | - **Visual Studio** (optional for code editing) 17 | 18 | ## How to Run the Application 19 | 20 | ### 1. Clone the Repository 21 | 22 | First, clone this repository to your local machine. Open a terminal or command prompt and run the following command: 23 | 24 | ```bash 25 | git clone https://github.com/AlfatTaufik/SI_Kasir_Toko.git 26 | ``` 27 | 28 | ### 2. Open the Project 29 | 30 | - Open the solution file (`.sln`) using **Visual Studio**. 31 | - Make sure all the necessary dependencies are installed. 32 | 33 | ### 3. Build the Solution 34 | 35 | - In Visual Studio, go to **Build** > **Build Solution** or press `Ctrl + Shift + B` to compile the project. 36 | - This will generate the executable file for the application. 37 | 38 | ### 4. Run the Application 39 | 40 | - After building, navigate to the `bin/Debug` or `bin/Release` folder, where you will find the executable file. 41 | - Double-click the `.exe` file to launch the cashier application. 42 | 43 | ## Usage 44 | 45 | Once the application is running, you can perform the following actions: 46 | 1. **Add Items**: Add new items to the product list by providing the item name, price, and quantity. 47 | 2. **Transaction Processing**: Select items for purchase, and the application will automatically calculate the total. 48 | 3. **Payment**: Input the payment amount, and the system will calculate the change or prompt if the amount is insufficient. 49 | 4. **Print Receipt**: After completing the payment, print the receipt to record the transaction. 50 | 51 | ## License 52 | 53 | This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details. 54 | 55 | --- -------------------------------------------------------------------------------- /projects/Python/calculator.py: -------------------------------------------------------------------------------- 1 | # Python program to create a simple calculator 2 | 3 | def add(x, y): 4 | return x + y 5 | 6 | def subtract(x, y): 7 | return x - y 8 | 9 | def multiply(x, y): 10 | return x * y 11 | 12 | def divide(x, y): 13 | if y == 0: 14 | return "Division by zero is not allowed" 15 | return x / y 16 | 17 | def power(x, y): # Calculate x^y 18 | return x ** y 19 | 20 | def factorial(x): # Calculate factorial of a number 21 | if x == 1 or x == 0: 22 | return 1 23 | else: 24 | return x * factorial(x - 1) 25 | 26 | def remainder(x, y): # Calculate remainder 27 | return x % y 28 | 29 | def minimum(x, y): # Calculate minimum 30 | return min(x, y) 31 | 32 | def maximum(x, y): # Calculate maximum 33 | return max(x, y) 34 | 35 | 36 | print("Select operation:") 37 | print("1. Add") 38 | print("2. Subtract") 39 | print("3. Multiply") 40 | print("4. Divide") 41 | print("5. Power") 42 | print("6. Factorial") 43 | print("7. Remainder") 44 | print("8. Minimum") 45 | print("9. Maximum") 46 | 47 | while True: 48 | choice = input("Enter choice(1/2/3/4/5/6/7/8/9): ") 49 | 50 | if choice in ('1', '2', '3', '4', '5', '7', '8', '9'): 51 | num1 = float(input("Enter first number: ")) 52 | num2 = float(input("Enter second number: ")) 53 | 54 | if choice == '1': 55 | print(f"The result is: {add(num1, num2)}") 56 | 57 | elif choice == '2': 58 | print(f"The result is: {subtract(num1, num2)}") 59 | 60 | elif choice == '3': 61 | print(f"The result is: {multiply(num1, num2)}") 62 | 63 | elif choice == '4': 64 | print(f"The result is: {divide(num1, num2)}") 65 | 66 | elif choice == '5': 67 | print(f"The result is: {power(num1, num2)}") 68 | 69 | elif choice == '7': 70 | print(f"The result is: {remainder(num1, num2)}") 71 | 72 | elif choice == '8': 73 | print(f"The minimum value is: {minimum(num1, num2)}") 74 | 75 | elif choice == '9': 76 | print(f"The maximum value is: {maximum(num1, num2)}") 77 | 78 | elif choice == '6': 79 | num = int(input("Enter a number for factorial: ")) 80 | print(f"The factorial is: {factorial(num)}") 81 | 82 | else: 83 | print("Invalid input") 84 | -------------------------------------------------------------------------------- /C++/printSpiral.cpp: -------------------------------------------------------------------------------- 1 | // Problem statement 2 | // For a given two-dimensional integer array/list of size (N x M), print it in a spiral form. That is, you need to print in the order followed for every iteration: 3 | 4 | // a. First row(left to right) 5 | // b. Last column(top to bottom) 6 | // c. Last row(right to left) 7 | // d. First column(bottom to top) 8 | // Mind that every element will be printed only once. 9 | 10 | // Refer to the Image: 11 | // Spiral path of a matrix 12 | 13 | // Detailed explanation ( Input/output format, Notes, Images ) 14 | // Constraints : 15 | // 1 <= t <= 10^2 16 | // 0 <= N <= 10^3 17 | // 0 <= M <= 10^3 18 | // Time Limit: 1sec 19 | // Sample Input 1: 20 | // 1 21 | // 4 4 22 | // 1 2 3 4 23 | // 5 6 7 8 24 | // 9 10 11 12 25 | // 13 14 15 16 26 | // Sample Output 1: 27 | // 1 2 3 4 8 12 16 15 14 13 9 5 6 7 11 10 28 | // Sample Input 2: 29 | // 2 30 | // 3 3 31 | // 1 2 3 32 | // 4 5 6 33 | // 7 8 9 34 | // 3 1 35 | // 10 36 | // 20 37 | // 30 38 | // Sample Output 2: 39 | // 1 2 3 6 9 8 7 4 5 40 | // 10 20 30 41 | 42 | // Java 43 | // public class Solution { 44 | // public static void spiralPrint(int mat[][]){ 45 | // int nRows = mat.length; 46 | // if (nRows == 0) { 47 | // return; 48 | // } 49 | // int mCols = mat[0].length; 50 | // int i, rowStart=0, colStart = 0; 51 | // int numElements = nRows * mCols; 52 | // int count = 0; 53 | // while(count < numElements) 54 | // { 55 | // for(i = colStart;i < numElements && i < mCols; i++) 56 | // { 57 | // System.out.print(mat[rowStart][i] + " "); 58 | // count++; 59 | // } 60 | // rowStart++; 61 | // for(i = rowStart; count < numElements && i < nRows; ++i) { 62 | // System.out.print(mat[i][mCols - 1] + " "); 63 | // count++; 64 | // } 65 | // mCols--; 66 | // for(i = mCols - 1; count < numElements && i >= colStart; --i) { 67 | // System.out.print(mat[nRows - 1][i] + " "); 68 | // count++; 69 | // } 70 | // nRows--; 71 | // for(i = nRows - 1; count < numElements && i >= rowStart; --i) { 72 | // System.out.print(mat[i][colStart] + " "); 73 | // count++; 74 | // } 75 | // colStart++; 76 | // } 77 | // } 78 | // } -------------------------------------------------------------------------------- /C++/asteroidCollision.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | Problem Statement : 3 | Given an array of integers asteroids, where each integer represents an asteroid in a row, determine the state of the asteroids after all collisions. In this array, the absolute value represents the size of the asteroid, and the sign represents its direction (positive meaning right and negative meaning left). All asteroids move at the same speed. 4 | When two asteroids meet, the smaller one will explode. If they are the same size, both will explode. Asteroids moving in the same direction will never meet. 5 | Example 1 6 | Input: asteroids = [2, -2] 7 | Output: [] 8 | Explanation: The asteroid with size 2 and the one with size -2 collide, exploding each other. 9 | Example 2 10 | Input: asteroids = [10, 20, -10] 11 | Output: [10, 20] 12 | Explanation: The asteroid with size 20 and the one with size -10 collide, resulting in the remaining asteroid with size 20. The asteroids with sizes 10 and 20 never collide. 13 | Example 3 14 | Input: asteroids = [10, 2, -5] 15 | Output: 16 | [10] 17 | **/ 18 | 19 | // Solution 20 | #include 21 | using namespace std; 22 | class Solution 23 | { 24 | public: 25 | vector asteroidCollision(vector &asteroids) 26 | { 27 | vector st; 28 | for (int i = 0; i < asteroids.size(); i++) 29 | { 30 | if (asteroids[i] > 0) 31 | st.push_back(asteroids[i]); 32 | else 33 | { 34 | while (!st.empty() && st.back() > 0 && st.back() < abs(asteroids[i])) 35 | st.pop_back(); 36 | if (!st.empty() && st.back() == abs(asteroids[i])) 37 | st.pop_back(); 38 | else if (st.empty() || st.back() < 0) 39 | st.push_back(asteroids[i]); 40 | } 41 | } 42 | return st; 43 | } 44 | }; 45 | 46 | //Approach 47 | //1. We will use vector like a stack to solve this problem. 48 | //2. We will iterate through the array and check if the asteroid is positive or negative. 49 | //3. If the asteroid is positive we will push it into the stack. 50 | //4. If previous condition is false then we will use a while loop to check if the stack is not empty and the last element of the stack is positive and the last element of the stack is less than the absolute value of the current asteroid. 51 | //5. If the above condition is true then we will pop the last element of the stack. 52 | //6. If the last element of the stack is equal to the absolute value of the current asteroid then we will pop the last element of the stack. 53 | //7. Otherwise, If the stack is empty or the last element of the stack is negative then we will push the current asteroid into the stack. 54 | //8. Finally, we will return the stack. 55 | //9. This is the optimal approach with O(n) time complexity. 56 | -------------------------------------------------------------------------------- /JavaScript/MERN Project/React-NewsPulse-App/README.md: -------------------------------------------------------------------------------- 1 | 2 | NewsPulse is a React-based web application that fetches and displays the latest news articles from various categories using the NewsAPI. 3 | Using the NewsAPI, the web application NewsPulse retrieves and presents the most recent news items from a variety of categories. Users can browse news stories in a variety of categories, including technology, business, entertainment, general, health, and sports. 4 | 5 | ## Features - Look through news items from many categories. 6 | 7 | - Unlimited scrolling for quick loading of articles. 8 | 9 | - Responsive design provides the best user experience across a range of platforms. 10 | 11 | - A loading progress indicator to monitor the status of API requests. 12 | 13 | - More reading To read the complete story on the website of the source, click on news stories. 14 | 15 | 16 | ## Technologies Used In NewsPulse React Application : 17 | 18 | -React JS: React is a JavaScript library that is used for building user interfaces. 19 | 20 | 'react-router-dom' is a routing library for React applications. 21 | 22 | -'react-infinite-scroll-component': A component for implementing endless scrolling. 23 | 24 | - Typechecking library for props validation called "PropTypes." 25 | 26 | - NewsAPI: An external API for retrieving the most recent news items. 27 | 28 | 29 | ## Available Categories used : 30 | 31 | - Home: General news articles./Daily News Articles 32 | - Business: News related to business and finance. 33 | - Entertainment: Entertainment news and celebrity updates. 34 | - Health: Health and medical news. 35 | - Science: Scientific discoveries and advancements. 36 | - Sports: Sports-related news and updates. 37 | - Technology: Technological innovations and updates/Tech News 38 | 39 | 40 | ## Contribution Guidelines : 41 | 42 | We encourage contributions, from everyone! If you come across any problems or have ideas for enhancements please don't hesitate to raise an issue or send us a request. We appreciate your input. Are open, to collaboration. 43 | 44 | 45 | 46 | 47 | 48 | # React + Vite 49 | 50 | This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. 51 | 52 | Currently, two official plugins are available: 53 | 54 | - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh 55 | - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh 56 | 57 | - ## Credits 58 | 59 | - React: [https://reactjs.org/](https://reactjs.org/) 60 | - `react-router-dom`: [https://reactrouter.com/web/guides/quick-start](https://reactrouter.com/web/guides/quick-start) 61 | - `react-infinite-scroll-component`: [https://www.npmjs.com/package/react-infinite-scroll-component](https://www.npmjs.com/package/react-infinite-scroll-component) 62 | - NewsAPI: [https://newsapi.org/](https://newsapi.org/) 63 | -------------------------------------------------------------------------------- /Go/FuzzerBuzzer/README.md: -------------------------------------------------------------------------------- 1 | # FuzzerBuzzer 2 | 3 | FuzzerBuzzer is a fuzzing tool designed to test web applications by sending random inputs to specified endpoints. This tool can help identify vulnerabilities and unexpected behavior in applications. 4 | 5 | ## Table of Contents 6 | 7 | - [Features](#features) 8 | - [Installation](#installation) 9 | - [Usage](#usage) 10 | - [Configuration](#configuration) 11 | - [Testing](#testing) 12 | - [Code Structure](#code-structure) 13 | 14 | ## Features 15 | 16 | - Generate random strings and JSON data as input. 17 | - Send fuzzed inputs to specified HTTP endpoints. 18 | - Simple configuration via YAML file. 19 | 20 | ## Installation 21 | 22 | To set up FuzzerBuzzer, follow these steps: 23 | 24 | 1. Clone the repository: 25 | ```bash 26 | git clone https://github.com/Ayushi40804/Hacktoberfest2024.git 27 | cd Hacktoberfest2024/FuzzerBuzzer 28 | 2. Ensure you have Go installed on your machine. If not, download and install it from https://golang.org. 29 | 30 | 3. Install necessary dependencies: 31 | 32 | ```bash 33 | go mod tidy 34 | ``` 35 | ## Usage 36 | 1. Start your target web application on http://localhost:8080/test. You can do to app directory and run app.go file. 37 | 38 | ```bash 39 | go run app.go 40 | ``` 41 | 42 | 2. Configure the fuzzer by editing the config/config.yaml file: 43 | 44 | ```yaml 45 | target_url: "http://localhost:8080/test" 46 | seed: 12345 47 | ``` 48 | 3. Run the fuzzer: 49 | 50 | ```bash 51 | go run cmd/fuzzer.go 52 | ``` 53 | ## Configuration 54 | The configuration file config/config.yaml should include the following fields: 55 | 56 | - target_url: The URL to which the fuzzing requests will be sent. 57 | - seed: An integer seed value for random number generation to ensure reproducibility. 58 | 59 | Example configuration: 60 | 61 | ```yaml 62 | target_url: "http://localhost:8080/test" 63 | seed:12345 64 | ``` 65 | 66 | ## Testing 67 | To run tests for the FuzzerBuzzer: 68 | 69 | 1. Navigate to the tests directory: 70 | 71 | ```bash 72 | cd tests 73 | ``` 74 | 2. Execute the tests: 75 | 76 | ```bash 77 | go test -v 78 | ``` 79 | ## Code Structure 80 | The project follows a modular structure: 81 | 82 | ```bash 83 | FuzzerBuzzer/ 84 | ├── cmd/ 85 | │ └── fuzzer.go # Main entry point for the fuzzer 86 | ├── config/ 87 | │ └── config.yaml # Configuration file 88 | ├── internal/ 89 | │ ├── fuzz_logic/ 90 | │ │ └── fuzz.go # Fuzzing logic and HTTP requests 91 | │ └── generator/ 92 | │ └── input_gen.go # Input generation logic 93 | ├── pkg/ 94 | │ └── helpers.go # Utility functions (if any) 95 | ├── tests/ 96 | │ └── fuzzer_test.go # Test cases for the fuzzer 97 | ├── go.mod # Go module definition 98 | └── README.md # Project documentation -------------------------------------------------------------------------------- /projects/Java/ToDoListApp.java: -------------------------------------------------------------------------------- 1 | import java.util.ArrayList; 2 | import java.util.Scanner; 3 | 4 | public class ToDoListApp { 5 | 6 | private static ArrayList toDoList = new ArrayList<>(); 7 | 8 | public static void main(String[] args) { 9 | Scanner sc = new Scanner(System.in); 10 | boolean running = true; 11 | 12 | System.out.println("\n TO-DO LIST"); 13 | 14 | while (running) { 15 | 16 | System.out.println("----------------------------------------------------------------"); 17 | System.out.println("1. Add Task"); 18 | System.out.println("2. View Tasks"); 19 | System.out.println("3. Remove Task"); 20 | System.out.println("4. Exit"); 21 | System.out.println("----------------------------------------------------------------"); 22 | System.out.print("Enter your choice: "); 23 | int choice = sc.nextInt(); 24 | sc.nextLine(); 25 | 26 | switch (choice) { 27 | case 1: 28 | System.out.print("Enter the task to add: "); 29 | String task = sc.nextLine(); 30 | toDoList.add(task); 31 | System.out.println("Task added successfully."); 32 | break; 33 | 34 | case 2: 35 | viewTasks(); 36 | break; 37 | 38 | case 3: 39 | System.out.print("\nEnter the task number to remove: "); 40 | int taskNumber = sc.nextInt(); 41 | try { 42 | removeTask(taskNumber); 43 | } catch (Exception e) { 44 | System.out.println("Invalid task number."); 45 | } 46 | break; 47 | 48 | case 4: 49 | running = false; 50 | System.out.println("\nExited the To-Do List App.\n"); 51 | break; 52 | 53 | default: 54 | System.out.println("\nInvalid choice. Please try again."); 55 | } 56 | } 57 | sc.close(); 58 | } 59 | 60 | private static void viewTasks() { 61 | if (toDoList.isEmpty()) { 62 | System.out.println("Your To-Do List is empty."); 63 | } else { 64 | System.out.println("\nYour To-Do List:"); 65 | for (int i = 0; i < toDoList.size(); i++) { 66 | System.out.println((i + 1) + ". " + toDoList.get(i)); 67 | } 68 | } 69 | } 70 | 71 | private static void removeTask(int taskNumber) { 72 | if (taskNumber <= 0 || taskNumber > toDoList.size()) { 73 | System.out.println("Invalid task number."); 74 | } else { 75 | String removedTask = toDoList.remove(taskNumber - 1); 76 | System.out.println("Task '" + removedTask + "' removed successfully."); 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko/DBContext.dbml.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko/RegisterForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Windows.Forms; 4 | 5 | namespace SI_Kasir_Toko 6 | { 7 | using static GlobalVariable; 8 | public partial class RegisterForm : Form 9 | { 10 | public RegisterForm() 11 | { 12 | InitializeComponent(); 13 | } 14 | 15 | 16 | private void linkLogin_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 17 | { 18 | loginForm.Show(); 19 | this.Hide(); 20 | } 21 | 22 | private void btnCancel_Click(object sender, EventArgs e) 23 | { 24 | getStarted.Show(); 25 | this.Hide(); 26 | } 27 | 28 | private void btnRegister_Click(object sender, EventArgs e) 29 | { 30 | if (isInputValid()) 31 | { 32 | Employee newEmployee = new Employee 33 | { 34 | Username = fieldUsername.Text, 35 | Fullname = fieldFullname.Text, 36 | Password = fieldPassword.Text, 37 | Email = fieldEmail.Text, 38 | Alamat = fieldAlamat.Text, 39 | MasukAt = DateTime.Now, 40 | Role = true 41 | }; 42 | 43 | Db.Employees.InsertOnSubmit(newEmployee); 44 | Db.SubmitChanges(); 45 | 46 | MessageBox.Show("Berhasil menambahkan data, silakan login untuk menikmati fitur kami"); 47 | loginForm.Show(); 48 | this.Hide(); 49 | } 50 | } 51 | private bool isInputValid() 52 | { 53 | var usernameExist = Db.Employees.FirstOrDefault(i => i.Username == fieldUsername.Text); 54 | if (usernameExist != null) 55 | { 56 | MessageBox.Show("Username Sudah digunakan, Coba yang lain", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop); 57 | return false; 58 | } 59 | if (string.IsNullOrWhiteSpace(fieldUsername.Text)) 60 | { 61 | MessageBox.Show("Username tidak boleh kosong dan hanya satu kata", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop); 62 | return false; 63 | } 64 | if (string.IsNullOrEmpty(fieldFullname.Text)) 65 | { 66 | MessageBox.Show("Fullname tidak boleh kosong!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop); 67 | return false; 68 | } 69 | if (string.IsNullOrEmpty(fieldPassword.Text)) 70 | { 71 | MessageBox.Show("Password tidak boleh kosong!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop); 72 | return false; 73 | } 74 | if (string.IsNullOrEmpty(fieldEmail.Text)) 75 | { 76 | MessageBox.Show("Email tidak boleh kosong!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop); 77 | return false; 78 | } 79 | if (string.IsNullOrEmpty(fieldAlamat.Text)) 80 | { 81 | MessageBox.Show("Alamat tidak boleh kosong!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop); 82 | return false; 83 | } 84 | return true; 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko/LoginForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Windows.Forms; 4 | 5 | namespace SI_Kasir_Toko 6 | { 7 | using static GlobalVariable; 8 | public partial class LoginForm : Form 9 | { 10 | public LoginForm() 11 | { 12 | InitializeComponent(); 13 | var id = Db.Employees.FirstOrDefault(e => e.Role); 14 | //role = id.ID; 15 | } 16 | 17 | private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 18 | { 19 | registerForm.Show(); 20 | this.Hide(); 21 | } 22 | 23 | private void linkRegister_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 24 | { 25 | registerForm.Show(); 26 | this.Hide(); 27 | } 28 | 29 | private void checkBoxPw_CheckedChanged(object sender, EventArgs e) 30 | { 31 | fieldPassword.PasswordChar = checkBoxPw.Checked ? '\0' : '*'; 32 | } 33 | 34 | private void btnCancel_Click(object sender, EventArgs e) 35 | { 36 | getStarted.Show(); 37 | this.Hide(); 38 | } 39 | 40 | private void btnLogin_Click(object sender, EventArgs e) 41 | { 42 | var usernameNow = fieldUsername.Text; 43 | var passwordNow = fieldPassword.Text; 44 | var usernameLogin = Db.Employees.FirstOrDefault(i => i.Username == usernameNow && i.Password == passwordNow); 45 | if (isInputValid()) 46 | { 47 | if (usernameLogin != null) 48 | { 49 | fullName = usernameLogin.Username.ToString(); 50 | if (usernameLogin.Role == false) 51 | { 52 | dashboardAdmin.Show(); 53 | this.Hide(); 54 | MessageBox.Show($"Login Berhasil, selamat datang Admin {usernameNow}", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); 55 | role = usernameLogin.Role; 56 | } 57 | else 58 | { 59 | dashboardKasir.Show(); 60 | this.Hide(); 61 | MessageBox.Show($"Login Berhasil, selamat datang Kasir {usernameNow}", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); 62 | role = usernameLogin.Role; 63 | } 64 | } 65 | else 66 | { 67 | MessageBox.Show("Data Admin Maupun Kasir tidak ditemukan, Silakan Coba lagi", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop); 68 | } 69 | } 70 | } 71 | 72 | private bool isInputValid() 73 | { 74 | if (string.IsNullOrEmpty(fieldUsername.Text)) 75 | { 76 | MessageBox.Show("Username tidak boleh kosong!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop); 77 | return false; 78 | } 79 | if (string.IsNullOrEmpty(fieldPassword.Text)) 80 | { 81 | MessageBox.Show("Password tidak boleh kosong!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop); 82 | return false; 83 | } 84 | return true; 85 | } 86 | } 87 | } -------------------------------------------------------------------------------- /JavaScript/MERN Project/React-NewsPulse-App/SampleOutput.json: -------------------------------------------------------------------------------- 1 | { 2 | "status": "ok", 3 | "totalResults": 3, 4 | "articles": [ 5 | 6 | { 7 | "source": {"id": "news24", "name": "News24"}, 8 | "author": "Sibusiso Mjikeliso", 9 | "title": "Cricket SA wants to 'get to the bottom' of Nkwe resignation concerns, says CEO | Sport", 10 | "description": "Acting Cricket South Africa CEO Pholetsi Moseki says the board is concerned about the issues former Proteas assistant coach Enoch Nkwe raised in his resignation.", 11 | "url": "httpspublishedAt://www.news24.com/sport/Cricket/Proteas/cricket-sa-wants-to-get-to-the-bottom-of-nkwe-resignation-concerns-says-ceo-20210826", 12 | "urlToImage": "https://cdn.24.co.za/files/Cms/General/d/10743/97d776dc91734e98906c0e1b7f3b1afa.jpg", 13 | "publishedAt": "2021-08-26T11:40:16+00:00", 14 | "content": "
  • Cricket South Africa has committed to \"getting to the bottom\" of Enoch Nkwe's sudden resignation as Proteas assistant coach.
  • Nkwe voiced concerns with the current culture and working… [+3497 chars]" 15 | }, 16 | { 17 | "source": { "id": "al-jazeera-english", "name": "Al Jazeera English" }, 18 | "author": "Al Jazeera", 19 | "title": "India women’s cricket captain slammed for ‘deplorable’ behaviour", 20 | "description": "Harmanpreet Kaur is being criticised after she smashed the stumps and took a verbal swipe at umpires in Bangladesh.", 21 | "url": "http://www.aljazeera.com/news/2023/7/25/india-womens-cricket-captain-slammed-for-deplorable-behaviour", 22 | "urlToImage": "https://www.aljazeera.com/wp-content/uploads/2023/07/GettyImages-1245671609-1690273527.jpg?resize=1920%2C1440", 23 | "publishedAt": "2023-07-25T08:46:19Z", 24 | "content": "India womens cricket captain Harmanpreet Kaur is being criticised for being a bad example after she smashed the stumps and took a verbal swipe at umpires in a match against Bangladesh.\r\nMedia reports… [+2175 chars]" 25 | }, 26 | { 27 | "source": { "id": "espn-cric-info", "name": "ESPN Cric Info" }, 28 | "author": null, 29 | "title": "PCB hands Umar Akmal three-year ban from all cricket | ESPNcricinfo.com", 30 | "description": "Penalty after the batsman pleaded guilty to not reporting corrupt approaches | ESPNcricinfo.com", 31 | "url": "http://www.espncricinfo.com/story/_/id/29103103/pcb-hands-umar-akmal-three-year-ban-all-cricket", 32 | "urlToImage": "https://a4.espncdn.com/combiner/i?img=%2Fi%2Fcricket%2Fcricinfo%2F1099495_800x450.jpg", 33 | "publishedAt": "2020-04-27T11:41:47Z", 34 | "content": "Umar Akmal's troubled cricket career has hit its biggest roadblock yet, with the PCB handing him a ban from all representative cricket for three years after he pleaded guilty of failing to report det… [+1506 chars]" 35 | }, 36 | { 37 | "source": { "id": "espn-cric-info", "name": "ESPN Cric Info" }, 38 | "author": null, 39 | "title": "What we learned from watching the 1992 World Cup final in full again | ESPNcricinfo.com", 40 | "description": "Wides, lbw calls, swing - plenty of things were different in white-ball cricket back then | ESPNcricinfo.com", 41 | "url": "http://www.espncricinfo.com/story/_/id/28970907/learned-watching-1992-world-cup-final-full-again", 42 | "urlToImage": "https://a4.espncdn.com/combiner/i?img=%2Fi%2Fcricket%2Fcricinfo%2F1219926_1296x729.jpg", 43 | "publishedAt": "2020-03-30T15:26:05Z", 44 | "content": "Last week, we at ESPNcricinfo did something we have been thinking of doing for eight years now: pretend-live ball-by-ball commentary for a classic cricket match. We knew the result, yes, but we tried… [+6823 chars]" 45 | } 46 | ] 47 | } 48 | -------------------------------------------------------------------------------- /projects/WebProject/reelreview/script.js: -------------------------------------------------------------------------------- 1 | const apiKey = "c34d1e2c877bf6bc6dad87e5f9b087d5"; 2 | const baseUrl = "https://api.themoviedb.org/3"; 3 | 4 | // Elements 5 | const searchInput = document.getElementById("searchMovie"); 6 | const movieList = document.getElementById("movie-list"); 7 | const modal = document.getElementById("review-modal"); 8 | const closeModal = document.querySelector(".close"); 9 | const submitReviewButton = document.getElementById("submit-review"); 10 | const reviewText = document.getElementById("review-text"); 11 | const movieTitle = document.getElementById("movie-title"); 12 | 13 | let currentMovieId = null; // To track which movie is being reviewed 14 | 15 | // Open review modal 16 | function openReviewModal(movieId, title) { 17 | modal.style.display = "flex"; 18 | currentMovieId = movieId; 19 | movieTitle.textContent = title; 20 | reviewText.value = getReview(movieId) || ""; // Load saved review if it exists 21 | } 22 | 23 | // Close review modal 24 | closeModal.onclick = function () { 25 | modal.style.display = "none"; 26 | }; 27 | 28 | // Close modal when clicking outside 29 | window.onclick = function (event) { 30 | if (event.target === modal) { 31 | modal.style.display = "none"; 32 | } 33 | }; 34 | 35 | // Search for a movie when the user types 36 | searchInput.addEventListener("input", () => { 37 | const query = searchInput.value; 38 | if (query) { 39 | searchMovies(query); 40 | } 41 | }); 42 | 43 | // Fetch movies from TMDB API 44 | async function searchMovies(query) { 45 | const url = `${baseUrl}/search/movie?api_key=${apiKey}&query=${encodeURIComponent( 46 | query 47 | )}`; 48 | const response = await fetch(url); 49 | const data = await response.json(); 50 | displayMovies(data.results); 51 | } 52 | 53 | // Display movies on the page 54 | function displayMovies(movies) { 55 | movieList.innerHTML = ""; 56 | if (movies.length === 0) { 57 | movieList.innerHTML = "

    No movies found

    "; 58 | return; 59 | } 60 | 61 | movies.forEach((movie) => { 62 | const movieDiv = document.createElement("div"); 63 | movieDiv.classList.add("movie"); 64 | 65 | const moviePoster = movie.poster_path 66 | ? `${movie.title}` 67 | : '
    No Image
    '; 68 | 69 | const userReview = getReview(movie.id); 70 | 71 | movieDiv.innerHTML = ` 72 | ${moviePoster} 73 |

    ${movie.title}

    74 |

    Rating: ${movie.vote_average}

    75 |

    ${movie.release_date}

    76 |

    Your Review: ${ 77 | userReview || "No review added yet" 78 | }

    79 | 82 | `; 83 | 84 | movieList.appendChild(movieDiv); 85 | }); 86 | } 87 | 88 | // Add review button handler 89 | submitReviewButton.onclick = function () { 90 | const review = reviewText.value.trim(); 91 | if (currentMovieId && review) { 92 | saveReview(currentMovieId, review); 93 | modal.style.display = "none"; 94 | searchMovies(searchInput.value); // Refresh movie list with new review 95 | } 96 | }; 97 | 98 | // Save review to localStorage 99 | function saveReview(movieId, review) { 100 | const reviews = JSON.parse(localStorage.getItem("movieReviews")) || {}; 101 | reviews[movieId] = review; 102 | localStorage.setItem("movieReviews", JSON.stringify(reviews)); 103 | } 104 | 105 | // Get review from localStorage 106 | function getReview(movieId) { 107 | const reviews = JSON.parse(localStorage.getItem("movieReviews")) || {}; 108 | return reviews[movieId]; 109 | } 110 | -------------------------------------------------------------------------------- /JavaScript/MERN Project/React-NewsPulse-App/src/Components/News.jsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useState } from "react"; 2 | import NewsItem from "./NewsItem"; 3 | import Spinner from "./Spinner"; 4 | import PropTypes from "prop-types"; 5 | import InfiniteScroll from "react-infinite-scroll-component"; 6 | 7 | const News = (props) => { 8 | const [articles, setArticles] = useState([]); 9 | const [loading, setLoading] = useState(true); 10 | const [page, setPage] = useState(1); 11 | const [totalResults, setTotalResults] = useState(0); 12 | 13 | const capitalizeFirstLetter = (string) => { 14 | return string.charAt(0).toUpperCase() + string.slice(1); 15 | }; 16 | const updateNews = async () => { 17 | props.setProgress(10); 18 | const url = `https://newsapi.org/v2/top-headlines?country=${props.country}&category=${props.category}&apiKey=${props.apikey}&page=${page}&pageSize=${props.pageSize}`; 19 | setLoading(true); 20 | let data = await fetch(url); 21 | props.setProgress(35); 22 | let parseData = await data.json(); 23 | props.setProgress(67); 24 | 25 | setArticles(parseData.articles); 26 | setTotalResults(parseData.totalResults); 27 | setLoading(false); 28 | 29 | props.setProgress(100); 30 | }; 31 | useEffect(() => { 32 | document.title = `${capitalizeFirstLetter(props.category)} - NewsPulse`; 33 | updateNews(); 34 | }, []); 35 | 36 | const fetchMoreData = async () => { 37 | const url = `https://newsapi.org/v2/top-headlines?country=${ 38 | props.country 39 | }&category=${props.category}&apiKey=${props.apikey}&page=${ 40 | page + 1 41 | }&pageSize=${props.pageSize}`; 42 | setPage(page + 1); 43 | let data = await fetch(url); 44 | let parseData = await data.json(); 45 | setArticles(articles.concat(parseData.articles)); 46 | setTotalResults(parseData.totalResults); 47 | }; 48 | if (!Array.isArray(articles)) { 49 | return null; 50 | } 51 | return ( 52 | <> 53 |

    57 | NewsPulse - Top From {capitalizeFirstLetter(props.category)} Headlines 58 |

    59 | {loading && } 60 | 61 | } 66 | > 67 |
    68 |
    69 | {articles.map((element) => { 70 | const title = element.title ? element.title.slice(0, 55) : ""; 71 | const description = element.description 72 | ? element.description.slice(0, 139) 73 | : ""; 74 | const imageUrl = element.urlToImage; 75 | const newsUrl = element.url; 76 | 77 | return ( 78 |
    79 | 88 |
    89 | ); 90 | })} 91 |
    92 |
    93 |
    94 | 95 | ); 96 | }; 97 | 98 | News.defaultProps = { 99 | country: "us", 100 | pageSize: 8, 101 | category: "general", 102 | }; 103 | News.propsTypes = { 104 | country: PropTypes.string, 105 | pageSize: PropTypes.number, 106 | category: PropTypes.string, 107 | }; 108 | 109 | export default News; 110 | 111 | -------------------------------------------------------------------------------- /JavaScript/MERN Project/React-NewsPulse-App/src/App.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | import "./App.css"; 3 | import NavBar from "./Components/NavBar"; 4 | import News from "./Components/News"; 5 | import { BrowserRouter as Router, Routes, Route } from "react-router-dom"; 6 | import LoadingBar from "react-top-loading-bar"; 7 | 8 | const App = () => { 9 | const [progress, setProgress] = useState(0); 10 | const pageSize = 7; 11 | const apikey = "Entern Your News API Key Here and then easily fetch latest news and tech trends"; 12 | 13 | return ( 14 |
    15 | 16 | n 17 | 18 | 19 | 20 | 32 | } 33 | /> 34 | 46 | } 47 | /> 48 | 60 | } 61 | /> 62 | 74 | } 75 | /> 76 | 88 | } 89 | /> 90 | 102 | } 103 | /> 104 | 116 | } 117 | /> 118 | 130 | } 131 | /> 132 | 133 | 134 |
    135 | ); 136 | }; 137 | export default App; 138 | -------------------------------------------------------------------------------- /projects/Python/Machine_Learning/LogisticRegression/LogisticRegression_ML.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": { 7 | "vscode": { 8 | "languageId": "plaintext" 9 | } 10 | }, 11 | "outputs": [], 12 | "source": [ 13 | "import pandas as pd\n", 14 | "import warnings" 15 | ] 16 | }, 17 | { 18 | "cell_type": "code", 19 | "execution_count": null, 20 | "metadata": { 21 | "vscode": { 22 | "languageId": "plaintext" 23 | } 24 | }, 25 | "outputs": [], 26 | "source": [ 27 | "cuisines_df = pd.read_csv('Machine_Learning/cuisines.csv')\n", 28 | "cuisines_df.head()" 29 | ] 30 | }, 31 | { 32 | "cell_type": "code", 33 | "execution_count": null, 34 | "metadata": { 35 | "vscode": { 36 | "languageId": "plaintext" 37 | } 38 | }, 39 | "outputs": [], 40 | "source": [ 41 | "from sklearn.linear_model import LogisticRegression\n", 42 | "from sklearn.model_selection import train_test_split, cross_val_score\n", 43 | "from sklearn.metrics import accuracy_score,precision_score,confusion_matrix,classification_report,precision_recall_curve\n", 44 | "from sklearn.svm import SVC\n", 45 | "import numpy as np" 46 | ] 47 | }, 48 | { 49 | "cell_type": "code", 50 | "execution_count": null, 51 | "metadata": { 52 | "vscode": { 53 | "languageId": "plaintext" 54 | } 55 | }, 56 | "outputs": [], 57 | "source": [ 58 | "cuisines_label_df = cuisines_df['cuisine']\n", 59 | "cuisines_label_df.head()" 60 | ] 61 | }, 62 | { 63 | "cell_type": "code", 64 | "execution_count": null, 65 | "metadata": { 66 | "vscode": { 67 | "languageId": "plaintext" 68 | } 69 | }, 70 | "outputs": [], 71 | "source": [ 72 | "cuisine_feature_df = cuisines_df.drop(['Unnamed: 0', 'cuisine'], axis=1)\n", 73 | "cuisine_feature_df.head()" 74 | ] 75 | }, 76 | { 77 | "cell_type": "code", 78 | "execution_count": null, 79 | "metadata": { 80 | "vscode": { 81 | "languageId": "plaintext" 82 | } 83 | }, 84 | "outputs": [], 85 | "source": [ 86 | "x_train, x_test, y_train, y_test = train_test_split(cuisine_feature_df, cuisines_label_df, test_size=0.3)" 87 | ] 88 | }, 89 | { 90 | "cell_type": "code", 91 | "execution_count": null, 92 | "metadata": { 93 | "vscode": { 94 | "languageId": "plaintext" 95 | } 96 | }, 97 | "outputs": [], 98 | "source": [ 99 | "LR = LogisticRegression(multi_class='ovr', solver='liblinear')\n", 100 | "model = LR.fit(x_train, np.ravel(y_train))\n", 101 | "\n", 102 | "accuracy = model.score(x_test, y_test)\n", 103 | "print(\"accuracy: \", format(accuracy))\n", 104 | "update_acc = accuracy*100\n", 105 | "print(\"accuracy_percentage: \", round(update_acc,2),\"%\")" 106 | ] 107 | }, 108 | { 109 | "cell_type": "code", 110 | "execution_count": null, 111 | "metadata": { 112 | "vscode": { 113 | "languageId": "plaintext" 114 | } 115 | }, 116 | "outputs": [], 117 | "source": [ 118 | "print(f'cuisine : {y_test.iloc[50]}')\n", 119 | "print(f'ingredients: {x_test.iloc[50][x_test.iloc[50]!=0].keys()}')" 120 | ] 121 | }, 122 | { 123 | "cell_type": "code", 124 | "execution_count": null, 125 | "metadata": { 126 | "vscode": { 127 | "languageId": "plaintext" 128 | } 129 | }, 130 | "outputs": [], 131 | "source": [ 132 | "test= x_test.iloc[50].values.reshape(-1, 1).T\n", 133 | "proba = model.predict_proba(test)\n", 134 | "classes = model.classes_\n", 135 | "resultdf = pd.DataFrame(data=proba, columns=classes)\n", 136 | "\n", 137 | "topPrediction = resultdf.T.sort_values(by=[0], ascending = [False])\n", 138 | "print(topPrediction.head())\n", 139 | "warnings.filterwarnings('ignore')" 140 | ] 141 | }, 142 | { 143 | "cell_type": "code", 144 | "execution_count": null, 145 | "metadata": { 146 | "vscode": { 147 | "languageId": "plaintext" 148 | } 149 | }, 150 | "outputs": [], 151 | "source": [ 152 | "y_pred = model.predict(x_test)\n", 153 | "print(classification_report(y_test,y_pred))" 154 | ] 155 | } 156 | ], 157 | "metadata": { 158 | "language_info": { 159 | "name": "python" 160 | } 161 | }, 162 | "nbformat": 4, 163 | "nbformat_minor": 2 164 | } 165 | -------------------------------------------------------------------------------- /projects/Java/FoodCwDB/src/wDB.java: -------------------------------------------------------------------------------- 1 | import org.apache.pdfbox.pdmodel.PDDocument; 2 | import org.apache.pdfbox.pdmodel.PDPage; 3 | import org.apache.pdfbox.pdmodel.PDPageContentStream; 4 | import org.apache.pdfbox.pdmodel.font.PDType1Font; 5 | 6 | import java.io.File; 7 | import java.io.IOException; 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | public class wDB { 12 | // Ensure this path is accessible 13 | private static final String FilePath = "D:\\b.pdf"; 14 | PDDocument invc; 15 | Integer total = 0; 16 | String CustName; 17 | String CustPh; 18 | List MenuItemNames = new ArrayList(); 19 | List MenuItemPrices = new ArrayList(); 20 | List MenuItemQuantities = new ArrayList(); 21 | 22 | public wDB() throws IOException { 23 | invc = new PDDocument(); 24 | invc.addPage(new PDPage()); 25 | } 26 | 27 | public void setCustomerInfo(String name, String phone) { 28 | this.CustName = name; 29 | this.CustPh = phone; 30 | } 31 | 32 | public void addMenuItem(String itemName, int price, int quantity) { 33 | MenuItemNames.add(itemName); 34 | MenuItemPrices.add(price); 35 | MenuItemQuantities.add(quantity); 36 | total += price * quantity; 37 | } 38 | 39 | public void writeInvoice() throws IOException { 40 | // Delete the file if it already exists to prevent access issues 41 | File file = new File(FilePath); 42 | if (file.exists()) { 43 | file.delete(); 44 | } 45 | 46 | PDPageContentStream cs = new PDPageContentStream(invc, invc.getPage(0)); 47 | 48 | // Invoice Title 49 | cs.beginText(); 50 | cs.setFont(PDType1Font.HELVETICA_BOLD, 20); 51 | cs.newLineAtOffset(100, 750); 52 | cs.showText("Food Corner Invoice"); 53 | cs.endText(); 54 | 55 | // Customer Details 56 | cs.beginText(); 57 | cs.setFont(PDType1Font.HELVETICA, 12); 58 | cs.newLineAtOffset(100, 720); 59 | cs.showText("Customer Name: " + CustName); 60 | cs.newLineAtOffset(0, -15); 61 | cs.showText("Phone Number: " + CustPh); 62 | cs.endText(); 63 | 64 | // Table Headers 65 | cs.beginText(); 66 | cs.setFont(PDType1Font.HELVETICA_BOLD, 12); 67 | cs.newLineAtOffset(100, 690); 68 | cs.showText("Menu Item"); 69 | cs.newLineAtOffset(150, 0); 70 | cs.showText("Price"); 71 | cs.newLineAtOffset(100, 0); 72 | cs.showText("Quantity"); 73 | cs.newLineAtOffset(100, 0); 74 | cs.showText("Total"); 75 | cs.endText(); 76 | 77 | // Menu Items 78 | int lineOffset = 675; 79 | for (int i = 0; i < MenuItemNames.size(); i++) { 80 | cs.beginText(); 81 | cs.setFont(PDType1Font.HELVETICA, 12); 82 | cs.newLineAtOffset(100, lineOffset - (i * 15)); 83 | cs.showText(MenuItemNames.get(i)); 84 | cs.endText(); 85 | 86 | cs.beginText(); 87 | cs.setFont(PDType1Font.HELVETICA, 12); 88 | cs.newLineAtOffset(250, lineOffset - (i * 15)); 89 | cs.showText(MenuItemPrices.get(i).toString()); 90 | cs.endText(); 91 | 92 | cs.beginText(); 93 | cs.setFont(PDType1Font.HELVETICA, 12); 94 | cs.newLineAtOffset(350, lineOffset - (i * 15)); 95 | cs.showText(MenuItemQuantities.get(i).toString()); 96 | cs.endText(); 97 | 98 | cs.beginText(); 99 | cs.setFont(PDType1Font.HELVETICA, 12); 100 | cs.newLineAtOffset(450, lineOffset - (i * 15)); 101 | cs.showText(String.valueOf(MenuItemPrices.get(i) * MenuItemQuantities.get(i))); 102 | cs.endText(); 103 | } 104 | 105 | // Total Amount 106 | cs.beginText(); 107 | cs.setFont(PDType1Font.HELVETICA_BOLD, 12); 108 | cs.newLineAtOffset(350, lineOffset - (MenuItemNames.size() * 15) - 20); 109 | cs.showText("Grand Total: " + total); 110 | cs.endText(); 111 | 112 | // Close the content stream and save the file 113 | cs.close(); 114 | invc.save(FilePath); 115 | invc.close(); 116 | 117 | // Print a success message to the console 118 | System.out.println("Invoice saved successfully to " + FilePath); 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /JavaScript/MERN Project/React-NewsPulse-App/src/Components/NavBar.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Link } from "react-router-dom"; 3 | 4 | const NavBar = () => { 5 | return ( 6 |
    7 | 119 |
    120 | ); 121 | }; 122 | 123 | export default NavBar; 124 | -------------------------------------------------------------------------------- /projects/WebProject/reelreview/style.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | html, 8 | body { 9 | width: 100%; 10 | height: 100%; 11 | } 12 | 13 | body { 14 | font-family: Arial, sans-serif; 15 | font-size: 16px; 16 | background-color: #c6d7ff; 17 | background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%239caaca' fill-opacity='0.2'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); 18 | display: flex; 19 | flex-direction: column; 20 | align-items: center; 21 | height: 100%; 22 | margin: 0; 23 | } 24 | 25 | header { 26 | width: 100%; 27 | padding: 20px; 28 | text-align: center; 29 | } 30 | 31 | h1 { 32 | font-family: "New Amsterdam", sans-serif; 33 | font-size: 3rem; 34 | padding-bottom: 10px; 35 | text-shadow: 2px 2px 1px rgba(0, 145, 194, 1); 36 | } 37 | 38 | h3 { 39 | margin: 10px; 40 | background: #62CFF4; 41 | background: linear-gradient(to right, #62CFF4 0%, #2C67F2 100%); 42 | -webkit-background-clip: text; 43 | -webkit-text-fill-color: transparent; 44 | } 45 | 46 | p { 47 | color: #7f9fea; 48 | padding: 5px; 49 | } 50 | 51 | p span { 52 | color: slateblue; 53 | font-size: 1.1rem; 54 | } 55 | 56 | header input { 57 | padding: 10px; 58 | width: 60%; 59 | border: none; 60 | border-radius: 5px; 61 | font-size: 1.2em; 62 | } 63 | 64 | #movie-list { 65 | display: flex; 66 | flex-wrap: wrap; 67 | justify-content: center; 68 | margin-top: 20px; 69 | } 70 | 71 | .movie { 72 | background-color: #1c1c1c; 73 | margin: 15px; 74 | padding: 15px; 75 | border-radius: 10px; 76 | width: 220px; 77 | text-align: center; 78 | } 79 | 80 | .movie img { 81 | border-radius: 10px; 82 | width: 100%; 83 | } 84 | 85 | /* .input { 86 | font-size: 16px; 87 | padding: 5px 10px; 88 | width: 100%; 89 | padding-left: 35px; 90 | outline: none; 91 | background: #FFFFFF; 92 | color: #000000; 93 | border: 1px solid #C4D1EB; 94 | border-radius: 5px; 95 | box-shadow: 3px 3px 2px 0px #E2E2E2; 96 | transition: .3s ease; 97 | } 98 | 99 | .input:focus { 100 | background: #DDDDDD; 101 | border: 1px solid #5A7EC7; 102 | border-radius: 10px; 103 | } */ 104 | 105 | .input::placeholder { 106 | color: #DDDDDD; 107 | } 108 | 109 | .search-box { 110 | display: inline-block; 111 | position: relative; 112 | filter: drop-shadow(0 1px #0091c2); 113 | } 114 | 115 | .search-box:after { 116 | content: ""; 117 | background: white; 118 | width: 4px; 119 | height: 20px; 120 | position: absolute; 121 | top: 21px; 122 | right: -9px; 123 | transform: rotate(135deg); 124 | } 125 | 126 | .search-box>input { 127 | color: white; 128 | font-size: 16px; 129 | background: transparent; 130 | width: 25px; 131 | height: 25px; 132 | padding: 10px; 133 | border: solid 3px white; 134 | outline: none; 135 | border-radius: 35px; 136 | transition: width 0.5s; 137 | } 138 | 139 | .search-box>input::placeholder { 140 | color: #efefef; 141 | opacity: 0; 142 | transition: opacity 150ms ease-out; 143 | } 144 | 145 | .search-box>input:focus::placeholder { 146 | opacity: 1; 147 | } 148 | 149 | .search-box>input:focus, 150 | .search-box>input:not(:placeholder-shown) { 151 | width: 250px; 152 | } 153 | 154 | .modal { 155 | display: none; 156 | position: fixed; 157 | z-index: 1; 158 | left: 0; 159 | top: 0; 160 | width: 100%; 161 | height: 100%; 162 | background-color: rgba(0, 0, 0, 0.6); 163 | justify-content: center; 164 | align-items: center; 165 | } 166 | 167 | .modal-content { 168 | background-color: #1c1c1c; 169 | padding: 20px; 170 | border-radius: 10px; 171 | width: 50%; 172 | max-width: 500px; 173 | color: #ffffff; 174 | text-align: center; 175 | } 176 | 177 | textarea { 178 | width: 100%; 179 | padding: 10px; 180 | border-radius: 5px; 181 | border: none; 182 | margin-top: 10px; 183 | } 184 | 185 | button { 186 | margin-top: 10px; 187 | padding: 10px 20px; 188 | background-color: #e50914; 189 | color: white; 190 | border: none; 191 | border-radius: 5px; 192 | cursor: pointer; 193 | } 194 | 195 | .close { 196 | color: white; 197 | float: right; 198 | font-size: 28px; 199 | font-weight: bold; 200 | cursor: pointer; 201 | } 202 | 203 | .close:hover { 204 | color: #999; 205 | } -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko/DBContext.dbml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
    13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
    25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 |
    35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 |
    50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 |
    58 |
    -------------------------------------------------------------------------------- /CONTRIBUTION_GUIDELINES.md: -------------------------------------------------------------------------------- 1 | # 📜 Contribution Guidelines 2 | 3 | We are excited to have you contribute during Hacktoberfest 2024. To ensure a smooth and enjoyable experience for everyone, please follow these guidelines: 4 | 5 | ## Table of Contents 6 | 1. [Code of Conduct](#code-of-conduct) 7 | 2. [General Guidelines](#general-guidelines) 8 | 3. [Directory Structure](#directory-structure) 9 | 4. [How Can I Contribute?](#how-can-i-contribute) 10 | - [Reporting Bugs](#reporting-bugs) 11 | - [Suggesting Features](#suggesting-features) 12 | - [Pull Requests](#submitting-a-pull-request) 13 | 5. [Development Workflow](#development-workflow) 14 | 6. [Community Guidelines](#community-guidelines) 15 | 16 | ## Code of Conduct 17 | 18 | Please read and follow our [Code of Conduct](./CODE_OF_CONDUCT.md). Respectful and inclusive behavior is expected from all contributors and maintainers. 19 | 20 | --- 21 | 22 | ## 💡 General Guidelines 23 | 24 | - **Valid Contributions Only**: All contributions should be meaningful and in line with the repository's purpose. Pull Requests (PRs) that do not add value—such as adding empty files, updating minor typos, or making insignificant changes—will not be accepted. 25 | - **Maintain Code Quality**: Ensure that your code is clean, well-documented, and follows the best practices of the programming language you are using. Poorly written code or submissions with errors will be marked as invalid. 26 | - **Be Respectful and Kind**: We welcome contributors of all experience levels. Please be considerate and supportive of each other. Respect the work of your fellow contributors, and engage in constructive discussions. 27 | 28 | ## 📁 Directory Structure 29 | 30 | We have a structured directory system to keep the repository organized: 31 | 32 | - Each programming language has its own folder inside `projects`, such as `Java`, `Kotlin`, `React Native`, `Python`, `Javascript` etc. 33 | - If you are contributing a project or code in a new language not already present, feel free to create a new directory for it. Use the language name as the folder name, such as `Go` or `C#`. 34 | - Keep your projects and contributions within the relevant folder. For example, if you are contributing a Python project, place it in the `Python` folder. 35 | 36 | This structure helps maintain order and ensures that future contributors can easily find and collaborate on projects. 37 | 38 | ## How Can I Contribute? 39 | 40 | ### 🐞 Reporting Bugs 41 | 42 | If you find a bug, please help us by submitting an issue: 43 | 44 | 1. **Search for existing issues** – to make sure the bug hasn't already been reported. 45 | 2. **Create a new issue** – if no similar issue exists, open a new issue and provide: 46 | - A clear, descriptive title. 47 | - Steps to reproduce the bug. 48 | - Your environment (browser, operating system, etc.). 49 | - Any relevant screenshots or error messages. 50 | 51 | ### Suggesting Features 52 | 53 | We welcome suggestions for improvements! To submit a feature request: 54 | 55 | 1. **Check for existing feature requests** – to avoid duplicates. 56 | 2. **Open a new issue** – if your idea is new. Please provide: 57 | - A clear explanation of the feature. 58 | - Why it would be useful. 59 | - Any examples or use cases. 60 | 61 | ## 📝 Submitting a Pull Request (PR) 62 | 63 | - **Create a Fork**: Fork this repository to your GitHub account to start working on your changes. 64 | - **Create a New Branch**: Create a new branch for your contribution (e.g., `hacktoberfest-`). 65 | - **Make Changes**: Make your changes in your branch. Ensure your changes are complete and functional before submission. 66 | - **Add Project to the `Project List/ProjectList.md`** - add your name and a link to the Github project you added 67 | - **Commit Your Changes**: Add a descriptive commit message (e.g., `Added a new Python script for data analysis`). 68 | - **Push Your Branch**: Push your branch to your forked repository on GitHub. 69 | - **Create a PR**: Submit a pull request to this repository. Include a brief description of what you’ve changed or added. 70 | 71 | Our team will review your PR and provide feedback. If everything looks good, your contribution will be merged into the main project! 72 | 73 | -- 74 | 75 | ## 💻 Development Workflow 76 | 77 | 1. **Fork and clone** the repo: 78 | ```bash 79 | git clone https://github.com/hackelite01/hacktoberfest2024.git 80 | cd hacktoberfest2024 81 | ``` 82 | 2. **Create a new branch** for your feature/bugfix: 83 | ```bash 84 | git checkout -b feature-branch 85 | ``` 86 | 3. **Make your changes**, ensuring your code adheres to the project’s coding standards. 87 | 4. **Push** your branch and create a pull request. 88 | 89 | -- 90 | 91 | ## 🤝 Community Guidelines 92 | 93 | - **Respect Community Members**: Treat others as you would like to be treated. We encourage open discussions, but please keep them civil and productive. 94 | - **Follow the Code of Conduct**: Our [Code of Conduct](CODE_OF_CONDUCT.md) outlines the 95 | -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SI_Kasir_Toko.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SI_Kasir_Toko.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Drawing.Bitmap. 65 | /// 66 | internal static System.Drawing.Bitmap DasboardAdmin { 67 | get { 68 | object obj = ResourceManager.GetObject("DasboardAdmin", resourceCulture); 69 | return ((System.Drawing.Bitmap)(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Drawing.Bitmap. 75 | /// 76 | internal static System.Drawing.Bitmap GetStartedImage { 77 | get { 78 | object obj = ResourceManager.GetObject("GetStartedImage", resourceCulture); 79 | return ((System.Drawing.Bitmap)(obj)); 80 | } 81 | } 82 | 83 | /// 84 | /// Looks up a localized resource of type System.Drawing.Bitmap. 85 | /// 86 | internal static System.Drawing.Bitmap LoginForm { 87 | get { 88 | object obj = ResourceManager.GetObject("LoginForm", resourceCulture); 89 | return ((System.Drawing.Bitmap)(obj)); 90 | } 91 | } 92 | 93 | /// 94 | /// Looks up a localized resource of type System.Drawing.Bitmap. 95 | /// 96 | internal static System.Drawing.Bitmap RegisterForm { 97 | get { 98 | object obj = ResourceManager.GetObject("RegisterForm", resourceCulture); 99 | return ((System.Drawing.Bitmap)(obj)); 100 | } 101 | } 102 | 103 | /// 104 | /// Looks up a localized resource of type System.Drawing.Bitmap. 105 | /// 106 | internal static System.Drawing.Bitmap Super_Market_Logo { 107 | get { 108 | object obj = ResourceManager.GetObject("Super Market Logo", resourceCulture); 109 | return ((System.Drawing.Bitmap)(obj)); 110 | } 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community includes: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | a representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | . 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 120 | 121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 122 | enforcement ladder](https://github.com/mozilla/diversity). 123 | 124 | [homepage]: https://www.contributor-covenant.org 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | https://www.contributor-covenant.org/faq. Translations are available at 128 | https://www.contributor-covenant.org/translations. 129 | -------------------------------------------------------------------------------- /JavaScript/MERN Project/React-NewsPulse-App/src/Components/News(RLifeCycle).txt: -------------------------------------------------------------------------------- 1 | 2 | // state is used when you change it again and again and you want the variable changing on the screen 3 | // without reloading the page.. 4 | // You cannot change the props If ever you need to set state by passing props you can set state 5 | // after that ypu can change the state you cannot change the props directly 6 | // Props are read only that we have seen 7 | 8 | // we use Fetch APIS to bring data from server we can hit using Fetch api 9 | // and api key 10 | 11 | // (cODE Refactoring) 12 | 13 | // sync updateNews() { 14 | 15 | // const url = `https://newsapi.org/v2/top-headlines?country=${this.props.country}&category=${this.props.category}&apiKey=1fec51274da84f6281dd103f1d2f000f&page=${this.state.page}&pageSize=${this.props.pageSize}`; 16 | // this.setState({ loading: true }); 17 | // let data = await fetch(url); 18 | // let parseData = await data.json(); 19 | // // It always be return Promise.. 20 | // console.log(parseData); 21 | // this.setState({ 22 | // articles: parseData.articles, 23 | // totalResults: parseData.totalResults, 24 | // loading:false}); 25 | // } 26 | 27 | // async componentDidMount() { 28 | // this.updateNews(); 29 | // let url = `https://newsapi.org/v2/top-headlines?country=${this.props.country}&category=${this.props.category}&apiKey=1fec51274da84f6281dd103f1d2f000f&page=1&pageSize=${this.props.pageSize}`; 30 | // this.setState({ loading: true }); 31 | // let data = await fetch(url); 32 | // let parseData = await data.json(); 33 | // // It always be return Promise.. 34 | // console.log(parseData); 35 | // this.setState({ 36 | // articles: parseData.articles, 37 | // totalResults: parseData.totalResults, 38 | // loading:false}); 39 | // Actually this is promises . the data i got if i want to convert into text 40 | // or into json 41 | //} 42 | 43 | // then we will check the next pae exist or not : total number of articles divide 44 | // by math.ceil(pageSize).. math.ceil of 4.6 is 5 , and 5.8 is 6 . math.ceil return 45 | // largest integer which comes after that number 46 | 47 | // PreviousClick = async () => { 48 | // console.log("Previous"); 49 | // let url = `https://newsapi.org/v2/top-headlines?country=${this.props.country}&category=${this.props.category}&apiKey=1fec51274da84f6281dd103f1d2f000f&page=${ 50 | // this.state.page - 1 51 | // }&pageSize=${this.props.pageSize}`; 52 | // this.setState({ loading: true }); 53 | // let data = await fetch(url); 54 | // let parseData = await data.json(); 55 | // // It always be return Promise.. 56 | // console.log(parseData); 57 | // this.setState({ 58 | // page: this.state.page - 1, 59 | // articles: parseData.articles, 60 | // loading: false, 61 | // }); 62 | // this.setState({page: this.state.page -1}); 63 | // this.updateNews(); 64 | 65 | // }; 66 | 67 | // All data send using props.. 68 | // There is an information in news components which we want to change according to us 69 | // for example one information which we want to chnange is how many news items are being displayed in one page may be one page 2 news items shows as per my choice. 70 | 71 | // 72 | 73 | // NextClick = async () => { 74 | // console.log("Next"); 75 | // this is how much total number of pages 76 | // if ( 77 | // !( 78 | // this.state.page + 1 > 79 | // Math.ceil(this.state.totalResults / this.props.pageSize) 80 | // ) 81 | // ) { 82 | // let url = `https://newsapi.org/v2/top-headlines?country=${this.props.country}&category=${this.props.category}&apiKey=1fec51274da84f6281dd103f1d2f000f&page=${ 83 | // this.state.page + 1 84 | // }&pageSize=${this.props.pageSize}`; 85 | // this.setState({ loading: true }); 86 | // let data = await fetch(url); 87 | // let parseData = await data.json(); 88 | // // It always be return Promise.. 89 | // this.setState({ 90 | // page: this.state.page + 1, 91 | // articles: parseData.articles, 92 | // loading: false, 93 | // }); 94 | // } 95 | // this.setState({page: this.state.page +1}) 96 | // this.updateNews(); 97 | // }; 98 | // It is the lifecycle method . It will be run after rendering all components 99 | 100 | // React js Components lifecycle : 101 | 102 | // The series of events that happen from the mounting of a react components 103 | // to its Unmounting . 104 | // Mounting -- Birth of your components 105 | // jab apka components aya ha Existence par... 106 | 107 | // Update -- Growth of our components 108 | // Unmount -- Death of your components . 109 | // mount -- Birth of your components. 110 | 111 | // In render method you cannot modify the state of the components .. 112 | // Render Methods (Jis ka andar ham jsx dakhta han jis ka andar ham saray kary saray 113 | // rendering karty han...) 114 | // rendering pure means particular input ka lei same hi output da.. 115 | // in class method we use render method must... 116 | // ham render method ka andar state ko modify nahi kar sakty.. 117 | 118 | // componentdidmount method .. aik bar hamara render method jo run ho gaya us ka 119 | // baad hamra componentdidmount method run ho ga . eg : data fetch to APIS , 120 | // ALSO set state and also used aysnc method .. ya method tabhi use karty han jab hamy fetching karni party ha data ki 121 | // (component mount ho chuka ha ab run ho raha ha ) 122 | 123 | // componentdidupdate means component updated 124 | // componentdidupdate method used a (ham na kisi bhi state ko change kia components 125 | // ka andar koe bhi change ki , state change kia ya phir us ko new props mil gaye 126 | // jasey bhi apka component update howa then componentdidupdate method run 127 | // componentdidupdate method is updating the DOM in response to props or state changes ) 128 | 129 | 130 | // componentwillunmount method .. when our component is destroyed then run it 131 | // cleansup / any resources destroyed .. 132 | // Four Most common react life cycle Methods 133 | // 1. render() 134 | // 2. componentDidMount() 135 | // 3. componentDidUpdate() 136 | // 4. componentWillUnmount() -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko/FormBarang.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko/LoginForm.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko/FormPetugas.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko/FormRiwayat.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko/FormTransaksi.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko/RegisterForm.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko/StockBarangForm.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko/AdminDashboardForm.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko/KasirDashboardForm.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /projects/C#/CashierApp/SI_Kasir_Toko/SupplierForm.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | -------------------------------------------------------------------------------- /projects/Java/FoodCwDB/src/FoodC.java: -------------------------------------------------------------------------------- 1 | import javax.swing.*; 2 | 3 | import java.awt.*; 4 | import java.awt.event.ActionEvent; 5 | import java.awt.event.ActionListener; 6 | 7 | public class FoodC implements ActionListener { 8 | JFrame f1; 9 | JTextField tfPaneerQty, tfPulavQty, tfChickenQty, tfMuttonQty, tfFishQty; 10 | JCheckBox cbPaneer, cbPulav, cbChicken, cbMutton, cbFish; 11 | JLabel lTitle, lMenu, lCostLabel, lQtyLabel; 12 | JLabel lPaneerPrice, lPulavPrice, lChickenPrice, lMuttonPrice, lFishPrice; 13 | JButton bOrder, bCancel; 14 | JProgressBar br; 15 | 16 | public FoodC() { 17 | f1 = new JFrame("Food Corner"); 18 | f1.setSize(600, 500); 19 | f1.setLayout(null); 20 | 21 | br=new JProgressBar(); 22 | br.setOrientation(0); 23 | br.setBounds(100, 20, 400, 60); 24 | br.setBackground(Color.yellow); 25 | br.setFont(new Font("Arial",Font.BOLD,50)); 26 | br.setForeground(Color.orange); 27 | br.setIndeterminate(true); 28 | br.setString("FOOD CORNER"); 29 | br.setStringPainted (true); 30 | f1.add(br); 31 | 32 | lMenu = new JLabel("MENU"); 33 | lMenu.setBounds(60, 70, 100, 50); 34 | lMenu.setFont(new Font("Arial", Font.BOLD, 15)); 35 | f1.add(lMenu); 36 | 37 | cbPaneer = new JCheckBox("Paneer"); 38 | cbPaneer.setBounds(50, 110, 100, 50); 39 | f1.add(cbPaneer); 40 | 41 | cbPulav = new JCheckBox("Pulav"); 42 | cbPulav.setBounds(50, 150, 100, 50); 43 | f1.add(cbPulav); 44 | 45 | cbChicken = new JCheckBox("Chicken"); 46 | cbChicken.setBounds(50, 190, 100, 50); 47 | f1.add(cbChicken); 48 | 49 | cbMutton = new JCheckBox("Mutton"); 50 | cbMutton.setBounds(50, 230, 100, 50); 51 | f1.add(cbMutton); 52 | 53 | cbFish = new JCheckBox("Fish"); 54 | cbFish.setBounds(50, 270, 100, 50); 55 | f1.add(cbFish); 56 | 57 | lCostLabel = new JLabel("COST"); 58 | lCostLabel.setBounds(240, 70, 100, 50); 59 | lCostLabel.setFont(new Font("Arial", Font.BOLD, 15)); 60 | f1.add(lCostLabel); 61 | 62 | lPaneerPrice = new JLabel("180/-"); 63 | lPaneerPrice.setBounds(250, 110, 100, 50); 64 | f1.add(lPaneerPrice); 65 | 66 | lPulavPrice = new JLabel("120/-"); 67 | lPulavPrice.setBounds(250, 150, 100, 50); 68 | f1.add(lPulavPrice); 69 | 70 | lChickenPrice = new JLabel("150/-"); 71 | lChickenPrice.setBounds(250, 190, 100, 50); 72 | f1.add(lChickenPrice); 73 | 74 | lMuttonPrice = new JLabel("380/-"); 75 | lMuttonPrice.setBounds(250, 230, 100, 50); 76 | f1.add(lMuttonPrice); 77 | 78 | lFishPrice = new JLabel("180/-"); 79 | lFishPrice.setBounds(250, 270, 100, 50); 80 | f1.add(lFishPrice); 81 | 82 | tfPaneerQty = new JTextField("0"); 83 | tfPaneerQty.setBounds(400, 120, 60, 30); 84 | f1.add(tfPaneerQty); 85 | 86 | lQtyLabel = new JLabel("QTY"); 87 | lQtyLabel.setBounds(410, 70, 100, 50); 88 | lQtyLabel.setFont(new Font("Arial", Font.BOLD, 15)); 89 | f1.add(lQtyLabel); 90 | 91 | tfPulavQty = new JTextField("0"); 92 | tfPulavQty.setBounds(400, 160, 60, 30); 93 | f1.add(tfPulavQty); 94 | 95 | tfChickenQty = new JTextField("0"); 96 | tfChickenQty.setBounds(400, 200, 60, 30); 97 | f1.add(tfChickenQty); 98 | 99 | tfMuttonQty = new JTextField("0"); 100 | tfMuttonQty.setBounds(400, 240, 60, 30); 101 | f1.add(tfMuttonQty); 102 | 103 | tfFishQty = new JTextField("0"); 104 | tfFishQty.setBounds(400, 280, 60, 30); 105 | f1.add(tfFishQty); 106 | 107 | bOrder = new JButton("Order"); 108 | bOrder.setBounds(200, 400, 100, 30); 109 | f1.add(bOrder); 110 | 111 | bCancel = new JButton("Cancel"); 112 | bCancel.setBounds(320, 400, 100, 30); 113 | f1.add(bCancel); 114 | 115 | bOrder.addActionListener(this); 116 | bCancel.addActionListener(this); 117 | 118 | f1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 119 | f1.setVisible(true); 120 | } 121 | 122 | @Override 123 | public void actionPerformed(ActionEvent e) { 124 | if (e.getSource() == bOrder) { 125 | try { 126 | generatePDFBill(); 127 | JOptionPane.showMessageDialog(f1, "Invoice Generated Successfully!", "Success", JOptionPane.INFORMATION_MESSAGE); 128 | } catch (Exception ex) { 129 | ex.printStackTrace(); 130 | JOptionPane.showMessageDialog(f1, "Failed to generate the invoice.", "Error", JOptionPane.ERROR_MESSAGE); 131 | } 132 | } else if (e.getSource() == bCancel) { 133 | resetFieldsAndCheckBoxes(); 134 | } 135 | } 136 | 137 | private void generatePDFBill() throws Exception { 138 | wDB billing = new wDB(); 139 | billing.setCustomerInfo("Customer Name", "1234567890"); 140 | 141 | if (cbPaneer.isSelected()) { 142 | int qty = Integer.parseInt(tfPaneerQty.getText()); 143 | billing.addMenuItem("Paneer", 180, qty); 144 | } 145 | if (cbPulav.isSelected()) { 146 | int qty = Integer.parseInt(tfPulavQty.getText()); 147 | billing.addMenuItem("Pulav", 120, qty); 148 | } 149 | if (cbChicken.isSelected()) { 150 | int qty = Integer.parseInt(tfChickenQty.getText()); 151 | billing.addMenuItem("Chicken", 150, qty); 152 | } 153 | if (cbMutton.isSelected()) { 154 | int qty = Integer.parseInt(tfMuttonQty.getText()); 155 | billing.addMenuItem("Mutton", 200, qty); 156 | } 157 | if (cbFish.isSelected()) { 158 | int qty = Integer.parseInt(tfFishQty.getText()); 159 | billing.addMenuItem("Fish", 180, qty); 160 | } 161 | 162 | billing.writeInvoice(); 163 | } 164 | 165 | private void resetFieldsAndCheckBoxes() { 166 | JCheckBox[] checkBoxes = {cbPaneer, cbPulav, cbChicken, cbMutton, cbFish}; 167 | JTextField[] fields = {tfPaneerQty, tfPulavQty, tfChickenQty, tfMuttonQty, tfFishQty}; 168 | 169 | for (JTextField field : fields) { 170 | field.setText("0"); 171 | } 172 | for (JCheckBox checkBox : checkBoxes) { 173 | checkBox.setSelected(false); 174 | } 175 | } 176 | 177 | public static void main(String[] args) { 178 | SwingUtilities.invokeLater(new Runnable() { 179 | public void run() { 180 | new FoodC(); 181 | } 182 | }); 183 | 184 | }} 185 | --------------------------------------------------------------------------------