Snippets Collections
/* General Styles */
body {
    margin: 0;
}

html {
    scroll-behavior: smooth;
}

/* Carousel */
#carousel-container {
    width: 100%;
    overflow-x: hidden;
    background-color: rgba(255, 255, 255, 0);
    z-index: 920;
}

#carousel {
    white-space: nowrap;
    animation: scroll 40s linear infinite;
    margin-bottom: 20px;
    z-index: 921;
}

#carousel img {
    max-width: 100%;
    height: auto;
    display: inline-block;
    margin-right: -5px;
}

/* Home Services */
.home-services {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    background-color: #515151;
    text-align: center;
    padding: 0;
}

.home-services a h2 {
    font-size: 15px;
    color: #ffffff;
    background-color: #515151;
    transition: color .5s ease, background-color .5s ease;
    padding: 20px 30px;
    border-radius: 200px;
    margin: 10px;
    border: 0;
}

.home-services a h2:hover {
    color: #ffffff;
    background-color: #4A1621;
}

/* Home Content */
.home-content {
    line-height: 25px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.home-item {
    display: flex;
    justify-content: space-between;
    background-color: #000000;
    align-items: center;
    transition: background-color 1s ease;
    border-radius: 200px;
    margin: 20px;
    cursor: pointer;
}

.home-item:hover {
    background-color: #515151;
}

.home-text {
    margin: 0 4vw 0 4vw;
    font-size: 16px;
}

.home-img img {
    width: 20vw;
    height: 100%;
}

.home-item ul {
    font-family: nunito;
    text-indent: 10px;
    color: white;
    line-height: 2vw;
    display: none;
}

.arrow img {
    width: 4vw;
    margin: 0 10vw;
    transform: translateX(0);
    transition: 2s ease;
}

.home-item:hover .arrow img {
    transform: translateX(30px);
}

.home-content h1,
.home-content h2 {
    color: white;
    white-space: nowrap;
}

/* Hero */
.hero-image img {
    width: 100%;
    height: auto;
    display: block;
    z-index: 2;
    opacity: .4;
    transition: opacity 1s ease-in-out;
}

/* Hero Mobile */
@media (max-width: 900px) {
    .home-title h1 {
        display: none;
    }

    .hero-buttons {
        display: flex;
        justify-content: center;
        flex-direction: column;
        align-items: center;
        width: 100%;
        margin: 10px 0;
    }

    .hero-image {
        position: relative;
        width: 100%;
        height: auto;
    }

    .hero-image img {
        width: 100%;
        height: 500px;
        display: block;
        object-fit: cover;
    }

    .hero-content {
        position: absolute;
        display: flex;
        flex-direction: column;
        top: 20vh;
        left: 50%;
        transform: translate(-50%, -50%);
        text-align: center;
        color: #fff;
        z-index: 1;
        width: 100%;
        justify-content: center;
    }

    .hero-content button {
        border-radius: 200px;
        border: none;
        padding: 15px;
        font-family: Montserrat;
        cursor: pointer;
        margin: 5px;
        background-color: #fff;
        transition: .5s ease;
        width: 60vw;
        font-size: 15px;
        line-height: 14px;
        align-items: center;
        display: flex;
        justify-content: center;
    }

    .hero-content button:hover {
        background-color: black;
        color: white;
    }
}
<body>
    <div class="hero-image slider">
        <img id="heroBackground" src="https://dannyholmanmedia.com/wp-content/uploads/2023/11/Home-Background-scaled.jpg" alt="Hero Image">
    </div>

    <div class="hero-content">
        <div class="home-title">
            <h1>Danny Holman Media</h1>
        </div>

        <div class="hero-menu">
            <div class="hero-buttons">
                <a href="#web">
                    <button>Web Design & Development</button>
                </a>
                <a href="https://dannyholmanmedia.com/portfolio/">
                    <h2>View Portfolio >>></h2>
                </a>
            </div>

            <div class="hero-buttons">
                <a href="https://dannyholmanmedia.com/photo-portfolio/">
                    <button>Landscape & Travel Photography</button>
                </a>
                <a href="https://dannyholmanmedia.com/order-prints/">
                    <h2>Order Prints >>></h2>
                </a>
            </div>
        </div>
    </div>

    <div id="carousel-container">
        <div id="carousel">
            <img src="https://dannyholmanmedia.com/wp-content/uploads/2023/11/DGH_Carousel.png" alt="Digital Media Service Icon">
        </div>
    </div>

    <div class="home-services" id="web">
        <a href="https://dannyholmanmedia.com/ux-portfolio/">
            <h2>UX / UI Design</h2>
        </a>
        <a href="https://dannyholmanmedia.com/webdev-portfolio/">
            <h2>Web Development</h2>
        </a>
        <a href="https://dannyholmanmedia.com/media-portfolio/#media">
            <h2>Media</h2>
        </a>
        <a href="https://dannyholmanmedia.com/photo-portfolio/">
            <h2>Photography</h2>
        </a>
    </div>

    <div class="home-content">
        <a href="https://dannyholmanmedia.com/ux-portfolio">
            <div class="home-item">
                <div class="home-text">
                    <h1>UX / UI Design</h1>
                    <h2>Concept to Design</h2>
                    <ul>
                        <li>• Case Studies</li>
                        <li>• Design Approach</li>
                        <li>• User Research</li>
                        <li>• Information Architecture</li>
                    </ul>
                </div>
                <div class="arrow">
                    <img src="https://dannyholmanmedia.com/wp-content/uploads/2023/11/Home-Icons-1.png" alt="image">
                </div>
                <div class="home-img">
                    <img src="https://dannyholmanmedia.com/wp-content/uploads/2023/11/1.png" alt="Description of the image">
                </div>
            </div>
        </a>

        <a href="https://dannyholmanmedia.com/webdev-portfolio">
            <div class="home-item">
                <div class="home-text">
                    <h1>Web Development</h1>
                    <h2>Design to Function</h2>
                    <ul>
                        <li>• HTML</li>
                        <li>• CSS</li>
                        <li>• JavaScript</li>
                        <li>• PHP</li>
                    </ul>
                </div>
                <div class="arrow">
                    <img src="https://dannyholmanmedia.com/wp-content/uploads/2023/11/Home-Icons-1.png" alt="image">
                </div>
                <div class="home-img">
                    <img src="https://dannyholmanmedia.com/wp-content/uploads/2023/11/2.png" alt="Description of the image">
                </div>
            </div>
        </a>

        <a href="https://dannyholmanmedia.com/media-portfolio">
            <div class="home-item">
                <div class="home-text">
                    <h1>Media</h1>
                    <h2>Digital Assets</h2>
                    <ul>
                        <li>• Video Production</li>
                        <li>• Graphic Design</li>
                        <li>• Document Design</li>
                        <li>• Data Visualization</li>
                    </ul>
                </div>
                <div class="arrow">
                    <img src="https://dannyholmanmedia.com/wp-content/uploads/2023/11/Home-Icons-1.png" alt="image">
                </div>
                <div class="home-img">
                    <img src="https://dannyholmanmedia.com/wp-content/uploads/2023/11/3.png" alt="Description of the image">
                </div>
            </div>
        </a>

        <a href="https://dannyholmanmedia.com/photo-portfolio/">
            <div class="home-item">
                <div class="home-text">
                    <h1>Photography</h1>
                    <h2>Landscape & Travel</h2>
                </div>
                <div class="arrow">
                    <img src="https://dannyholmanmedia.com/wp-content/uploads/2023/11/Home-Icons-1.png" alt="image">
                </div>
                <div class="home-img">
                    <img src="https://dannyholmanmedia.com/wp-content/uploads/2023/11/home-photo.png" alt="Description of the image">
                </div>
            </div>
        </a>
    </div>
</body>
#Transistors
>by dhruv mahajan

This article is written by Dhruv Mahajan about transistors, there are two types of transistors which make up the fascinating world of electronics 
*Current controlled 
 *this includes PNP and NPN
*Voltage controlled
 *this includes JFET and MOSFET

now, i will be talking about the PNP transistor this comprises of 2 junctions which are made of 
#Transistors
>by dhruv mahajan

This article is written by Dhruv Mahajan about transistors, there are two types of transistors which make up the fascinating world of electronics 
*Current controlled 
 *this includes PNP and NPN
*Voltage controlled
 *this includes JFET and MOSFET

now, i will be talking about the PNP transistor this comprises of 2 junctions which are made of 
<script src="https://unpkg.com/p5.js-svg@1.3.1"></script>
     #include <iostream> 
#include<iomanip>
#include<ctime>
#include<cstdlib>
using namespace std; 

 // Function prototype 
string create();
void hangman(int lives);
void decision(int length,int cont);

int main(){

string rand_word;
char guess;
int lives=7,cont=0;
rand_word=create();
int length = rand_word.length();
char random[length] ;
char dashes[length];

for(int i=0;i<length;i++){
random[i]=rand_word[i];                           //just checking remove output afterwards;
                
                          }


while(lives!=0){
 cout<<"guess a charcater: "<<endl;
    cin>>guess;
    bool a=true; 

   for(int i=0;i<length;i++){
  dashes[i]='_';                                  //CONTINUE FROM HERE;
   
                                     }
    
   for(int i=0;i<length;i++){
    
     if(guess==random[i]){
     cont++;
     hangman(lives);                          //do check prototype and insert lives in argument in case of an error; 
       
   /*  dashes[i]=guess;                          //instances          CONTINUE FROM HERE
     cout<<dashes[i]<<endl;  */
     a = false;                        
            }
                        }
   for(int i=0;i<length;i++){        
    if (a==true && guess!=random[i]) {
     lives-- ;      
     hangman(lives);          }
                        }
                    }
    cout<<"\n\n";
    
  decision(length,cont);
                                  
                                  
                                       
                    
                     
return 0;       
                            }


string create(){
 int size = 100 ;
    string arr[size]={"Accordion", "Bumblebee", "Chandelier", "Dandelion", "Ephemeral", "Fandango", "Gargoyle", "Hologram", "Iridescent", "Juxtapose", "Kaleidoscope", "Labyrinth", "Mellifluous", "Nebula", "Opulent", "Palindrome", "Quasar", "Rambunctious", "Sasquatch", "Tranquil", "Umbrella", "Vivacious", "Whimsical", "Xanadu", "Yodel", "Zenith", "Alabaster", "Buccaneer", "Capricious", "Dyslexia", "Ebullient", "Flibbertigibbet", "Gastronomy", "Halcyon", "Ineffable", "Jubilant", "Kowtow", "Lugubrious", "Misanthrope", "Nefarious", "Obfuscate", "Peregrinate", "Quintessential", "Rococo", "Serendipity", "Tintinnabulation", "Ubiquitous", "Vorfreude", "Wherewithal", "Xerox", "Yonder", "Zephyr", "Apotheosis", "Bibliopole", "Cacophony", "Dulcimer", "Ephemeral", "Furtive", "Gossamer", "Hapax", "Ineffable", "Juxtapose", "Kaleidoscopic", "Lilliputian", "Munificent", "Nebulous", "Obfuscate", "Peregrinate", "Quixotic", "Reticent", "Serendipity", "Tumultuous", "Umbra", "Voracious", "Whimsical", "Xenial", "Yesteryear", "Zephyr", "Aplomb", "Bibliopole", "Cacophony", "Dulcet", "Ephemeral", "Furtive", "Gossamer", "Hapax", "Ineffable", "Juxtapose", "Kaleidoscopic", "Lilliputian", "Munificent", "Nebulous", "Obfuscate", "Peregrinate", "Quixotic", "Reticent", "Serendipity", "Tumultuous", "Umbra", "Voracious"};

    srand(time(0));
    return arr[rand()%100]; 
    
    
                            }
                            
                            
void hangman(int lives){

     if(lives == 7){
     
     cout<<"   +----+\n"<<
           "   |    |\n"<<
           "        |\n"<<
           "        |\n"<<
           "        |\n"<<
           "        |\n"<<
           "-----------\n";       
                              }
    else if(lives == 6 ){                          
      cout<<"   +----+\n"<<
           "    |    |\n"<<
           "    o    |\n"<<
           "         |\n"<<
           "         |\n"<<
           "         |\n"<<
           " -----------\n";                          
                                   }
                                   
    else if(lives == 5 ){                          
      cout<<"   +----+\n"<<
           "    |    |\n"<<
           "    o    |\n"<<
           "    |    |\n"<<
           "         |\n"<<
           "         |\n"<<
           " -----------\n";                          
                                   }  
     else if(lives == 4 ){                          
      cout<<"   +----+\n"<<
           "    |    |\n"<<
           "    o    |\n"<<
           "   /|    |\n"<<
           "         |\n"<<
           "         |\n"<<
           " -----------\n";                          
                                   }
                                      
                                      
      else if(lives == 3 ){                          
      cout<<"   +----+\n"<<
           "    |    |\n"<<
           "    o    |\n"<<
           "   /|\\   |\n"<<
           "         |\n"<<
           "         |\n"<<
           " -----------\n";                          
                                   }     
                                   
                                       
      else if(lives == 2 ){                          
      cout<<"   +----+\n"<<
           "    |    |\n"<<
           "    o    |\n"<<
           "   /|\\   |\n"<<
           "   /     |\n"<<
           "         |\n"<<
           " -----------\n";                          
                                   } 
                                        
      else if(lives == 1 ){                          
      cout<<"   +----+\n"<<
           "    |    |\n"<<
           "    o    |\n"<<
           "   /|\\   |\n"<<
           "   / \\   |\n"<<
           "         |\n"<<
           " -----------\n";                          
                                   }                            
                                   
                                                                                                                        
                                        }
     
                                                               
  void decision(int length,int cont){
  
                  if(cont == length){
                    cout<<"you have won: "<<endl;
                                                                }   
                  else{cout<<"loser: "<<endl;}     
                                               
                                                      }                                 
                            
                            
import React, { useState, useEffect } from "react";

const ExampleComponent = () => {
  const [input, setInput] = useState("");

  useEffect(() => {
    // This effect will be re-executed on every render
  }, []);

  return (
    <div>
      <input
        type="text"
        value={input}
        onChange={(e) => setInput(e.target.value)}
      />
    </div>
  );
};
#include <Servo.h> 

Servo servo; // servo object representing the MG 996R servo

void setup() {
  servo.attach(3); // servo is wired to Arduino on digital pin 3
}

void loop() {
  servo.write(0); // move MG996R's shaft to angle 0°
  delay(1000); // wait for one second
  servo.write(45); // move MG996R's shaft to angle 45°
  delay(1000); // wait for one second 
  servo.write(90); // move MG996R's shaft to angle 90°
  delay(1000); // wait for one second
  servo.write(135); // move MG996R's shaft to angle 135°
  delay(1000); // wait for one second
  servo.write(180); // move MG996R's shaft to angle 180°
  delay(1000); // wait for one second
}
import re
s = "string. With. Punctuation?"
s = re.sub(r'[^\w\s]','',s)
# \w matches any word character (equivalent to [a-zA-Z0-9_])
# \s matches any whitespace character (equivalent to [\r\n\t\f\v ])
const props = defineProps<{
  msg: string
  initialNumber: number
}>()

const numberMultiplied = computed(() => {
  return multiplication(props.initialNumber)
})

<div>{{ numberMultiplied }}</div>

//INTO THE IMPORT OF THE COMPONENT

<HelloWorld msg="You did it!" initial-number="5" />
*{
  padding: 0;
  margin: 0;
  text-decoration: none;
  list-style: none;
  box-sizing: border-box;
}
body{
  font-family: montserrat;
}
nav{
  background: #9600ff;
  height: 80px;
  width: 100%;
}
label.logo{
  color: white;
  font-size: 35px;
  line-height: 80px;
  padding: 0 100px;
  font-weight: bold;
}
nav ul{
  float: right;
  margin-right: 20px;
}
nav ul li{
  display: inline-block;
  line-height: 80px;
  margin: 0 5px;
}
nav ul li a{
  color: white;
  font-size: 17px;
  padding: 7px 13px;
  border-radius: 3px;
  text-transform: uppercase;
}
a.active,a:hover{
  background: #1b9bff;
  transition: .5s;
}
.checkbtn{
  font-size: 30px;
  color: white;
  float: right;
  line-height: 80px;
  margin-right: 40px;
  cursor: pointer;
  display: none;
}
#check{
  display: none;
}
@media (max-width: 952px){
  label.logo{
    font-size: 30px;
    padding-left: 50px;
  }
  nav ul li a{
    font-size: 16px;
  }
}
@media (max-width: 858px){
  .checkbtn{
    display: block;
  }
  ul{
    position: fixed;
    width: 100%;
    height: 100vh;
    background: #20124d;
    top: 80px;
    left: -100%;
    text-align: center;
    transition: all .5s;
  }
  nav ul li{
    display: block;
    margin: 50px 0;
    line-height: 30px;
  }
  nav ul li a{
    font-size: 20px;
  }
  a:hover,a.active{
    background: none;
    color: #fff100;
  }
  #check:checked ~ ul{
    left: 0;
  }
}
section{
  background: url(bg.jpg) no-repeat;
  background-size: cover;
  height: calc(100vh - 80px);
}
<!DOCTYPE html>
<!-- Created By TopArchives - www.toparchives.us -->
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title>Responsive Navbar | TopArchives</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"/>
  </head>
  <body>
    <nav>
      <input type="checkbox" id="check">
      <label for="check" class="checkbtn">
        <i class="fas fa-bars"></i>
      </label>
      <label class="logo">TopArchives</label>
      <ul>
        <li><a class="active" href="#">Home</a></li>
        <li><a href="#">About</a></li>
        <li><a href="#">Services</a></li>
        <li><a href="#">Contact</a></li>
        <li><a href="#">Feedback</a></li>
      </ul>
    </nav>
    <section></section>
  </body>
</html>
<!-- DON'T REMOVE CREDITS -->
pipeline {
    agent any
    tools {
        jdk 'jdk11'
        maven 'maven3'
    }
    stages {
        stage('Git Checkout') {
            steps {
               git 'https://github.com/jaiswaladi2468/BoardgameListingWebApp.git'
            }
        }
         stage('Compile') {
            steps {
               sh "mvn compile"
            }
        }
         stage('Test') {
            steps {
               sh "mvn test"
            }
        }
        stage('Package') {
            steps {
               sh "mvn package"
            }
        }
        stage('Install') {
            steps {
               sh "mvn install"
            }
        }
    }
}
/* // display menu
DisplayMenu();
//select your choice
int choice;
Select( choice); //
test your choice
switch( choice )
{ case 1: PracticeAdd(); break; case
2:
PracticeSub(); break;
}
//terminate program
system(“pause”); return 0
}   */

#include <iostream>
using namespace std;
void sum(float x,float y);
void menu(int choice);


int main(){
int choice;
menu(choice);







return 0;
                   }
void sum(float x,float y){
float result;
char opt = y,n; 
                 do{
                 cout<<"enter two numbers to be added: "<<endl;
                 cin>>x>>y;
                 cout<<x<<" + "<<y<<" = ";
                 cin>>result;
                 if(result == x+y){
                 cout<<"correct"<<endl;}
                 else cout<<"wrong"<<endl;
                 cout<<"do you want to perform test again:\npress 'y' for yes or 'n' for no "<<endl;
                 cin>>opt;           }
                 while(opt==y);
                     }                   
               
void menu(int choice){
        float x,y;
       cout<<"press 1 for addition:\npress 2 for  subtraction: "<<endl; 
        cin>>choice;
        if(choice==1){
        cout<<sum(x,y)<<endl;   }
       
             
             }
import processing.svg.*;

void setup(){
  size(900, 900);
  background(245);
  
  beginRecord(SVG, "processing_test.svg");
  
  for(int i=0;i<100;i++)
  {
   line(random(width), random(height), random(width), random(height)); 
  }
   
   endRecord();
  

}

void draw(){
 

}
let stocks = {

  PancakeIngredients: ["flour", "eggs 🥚", "sugar", "milk🥛", "butter"],
  
  liquid: ["water 🥛", "coffee ☕", "wine🍷"],

  holder: ["frying pan 🍳"],

  toppings: ["sauce 🥫"],

};


function time(ms) {

  return new Promise((resolve, reject) => {

    if (is_pancake_shop_open) {
      setTimeout(resolve, ms);

    } else {

      reject(console.log("Shop is closed"));

    }
  });
}

 async function kitchen() {
  try {
    await time(2000);
    console.log(`${stocks.liquid[1]} was selected by the customer`);
    
    await time(2000);
    console.log(`add ${stocks.PancakeIngredients[0]} and stir to make the pancake`)
    
    await time(2000);
    console.log("careful so it doesn't get burnt on fire")
    
    await time(2000);
    console.log(`add some ${stocks.toppings[0]} to give it some unique taste`)
    
    await time(2000);
  } 
  catch (error) {
    console.log("customer left", error);
  } finally {
    console.log("Day ended, shop closed");
  }
}


kitchen();




let stocks = {
 PancakeIngredients: ["flour", "eggs 🥚", "sugar", "milk🥛", "butter"],  
liquid: ["water 🥛", "coffee ☕", "wine🍷"],
  holder: ["frying pan 🍳"],
toppings: ["sauce 🥫"],
};


let orderPancake = (time, work) => {   return new Promise((resolve, reject) => {
    if (is_pancake_shop_open) {
      setTimeout(() => {
        resolve(work());
      }, time);
    } else {
      reject(console.log("pancake shop closed"));
    }
}); };


orderPancake(2000, () =>
  console.log(
    `cool! pancake shop is open, let's add some ${stocks.toppings[0]} to give it some unique taste`
  )
);
let stocks = {

  PancakeIngredients: ["flour", "eggs 🥚", "sugar", "milk🥛", "butter"],
  
  liquid: ["water 🥛", "coffee ☕", "wine🍷"],

  holder: ["frying pan 🍳"],

  toppings: ["sauce 🥫"],

};


// Function to place an order
var order = (pancakes_name, call_production) => {
  setTimeout(() => {
    console.log(
      `Order placed, ${stocks.PancakeIngredients[pancakes_name]} was selected first amongst the list of ${stocks.PancakeIngredients.length} ingredients`
    );
    call_production();
  }, 2000);
};


// Function for the production process

var production = () => {
  setTimeout(() => {
    console.log("Production has started");
  }, 1000);

  setTimeout(() => {
    console.log("The ingredients has been added to the order, lets bake");
    setTimeout(() => {
      console.log(`add ${stocks.liquid[0]} and stir`);
      setTimeout(() => {
        console.log(`place your ${stocks.holder[0]} on the heater`);
        setTimeout(() => {
          console.log("careful so it doesn't get burnt on fire");
          setTimeout(() => {
            console.log(
              `add some ${stocks.toppings[0]} to give it some unique taste`
            );
            setTimeout(() => {
              console.log("serve pancakes");
            }, 1000);
          }, 1000);
        }, 1000);
      }, 1000);
    }, 1000);
  }, 1000);
};

 order(1, production);
console.log("I")

setTimeout(() => {

    console.log("love 💕");

}, 2000);

console.log("Pancakes");

console.log("Task 1");

console.log("Task 2");

console.log("Task 3");


export default function Page() {

  async function create(formData: FormData) {
    'use server';
    const id = await createItem(formData);
  }

  return (
    <form action={create}>
      <input type="text" name="name" />
      <button type="submit">Submit</button>
    </form>
  );
}
contract MyContract {
    address public beneficiary;

    constructor(address _beneficiary) {
        beneficiary = _beneficiary;
    }
}
contract AddressExample {
    // Standard Ethereum address to store a user's address
    address public userEthereum;

    // Payable Ethereum address to store a recipient's address for Ether transactions
    address payable public recipientEthereumAddress;

    // Function to set the standard Ethereum address
    function setUserEthereumAddress(address _userEthereumAddress) public {
        userEthereum = _userEthereumAddress;
    }

    // Function to set the payable Ethereum address
    function setRecipientAddress(address payable _recipientEthereumAddress) public {
        recipientEthereumAddress = _recipientEthereumAddress;
    }
}
Zinuo Han https://twitter.com/ele7enxxh of OPPO Amber Security Lab: SVE-2023-1439, SVE-2023-1437, SVE-2023-1434, SVE-2023-1363
Christopher Wade: SVE-2023-1396
Aapo Oksman: SVE-2023-1365
hsia.angsh: SVE-2023-1031
Oversecured (oversecured.com): SVE-2023-0987, SVE-2023-0611
Daniel Komaromy of TASZK Security Labs: SVE-2023-0541, SVE-2023-0539, SVE-2023-0538, SVE-2023-0537
[type.googleapis.com/google.rpc.LocalizedMessage]
locale: "en-US"
message: "Object is not found"

[type.googleapis.com/google.rpc.RequestInfo]
request_id: "4fe1aadcc06e4439a2b4fe6b2948a8a3"

#include <iostream>

struct Vrijeme {
    int sati;
    int minute;
    int sekunde;
};

Vrijeme unosPodataka() {
    Vrijeme v;
    std::cout << "Unesi vrijeme (h min s): ";
    std::cin >> v.sati >> v.minute >> v.sekunde;
    return v;
}

int preracunavanjeVremena(Vrijeme v1, Vrijeme v2) {
    int v1Sekunde = v1.sati * 3600 + v1.minute * 60 + v1.sekunde;
    int v2Sekunde = v2.sati * 3600 + v2.minute * 60 + v2.sekunde;
    return abs(v2Sekunde - v1Sekunde);
}

void ispisRezultata(int sekunde) {
    int minute = sekunde / 60;
    sekunde %= 60;
    std::cout << "Proteklo je " << minute << " minuta i " << sekunde << " sekundi.\n";
}

int main() {
    Vrijeme v1 = unosPodataka();
    Vrijeme v2 = unosPodataka();
    int sekunde = preracunavanjeVremena(v1, v2);
    ispisRezultata(sekunde);
    return 0;
}
ncks -C -v ta temp1.nc out.nc
const {
    array_totalUnsecuredDebt,
    array_credit_score,
    array_number_of_collections,
    array_number_of_delinquencies,
    fname,
    lname,
    zip_code,
    address_street,
    'email-address': email,
    'phone-number': mobile,
    'loan-amount-slider': loanAmountSlider,
    partner // Assuming you have a field named 'partner' in Feathery
} = feathery.getFieldValues();

// Combined First and Second Button Conditions
if (
    array_totalUnsecuredDebt >= 14000 &&
    array_credit_score >= 520 &&
    array_number_of_collections <= 6 &&
    array_number_of_delinquencies <= 6 &&
    array_totalUnsecuredDebt !== null &&
    array_credit_score !== null &&
    array_number_of_collections !== null
) {
    console.log("Redirecting to Webflow thank-you page");
    const thankYouURL = `https://www.credit1finance.com/survey-bot?fname=${fname}&lname=${lname}&email=${email}&phone=${mobile}&partner=${partner}`;
    location.href = thankYouURL;
}

// Third Button Conditions - Redirect only if partner is 'NW'
else if (
    partner === 'NW' // Check if partner is 'NW'
) {
    console.log("Redirecting to StrikeDM link for NW partner");
    const refValue = `websitelead--${fname}--394917--${fname}--436574--${lname}--354744--${email}--46793--${phone}--142022--${partner}`;
    location.href = `https://app.strikedm.com/webchat/?p=1318036&ref=${refValue}`;
}

// Final Redirection for all other cases
else {
    console.log("Redirecting to default thank-you page");
    location.href = "https://www.credit1finance.com/thank-you-np";
}
// Assuming these values are already retrieved from Feathery
const {
    array_credit_score,
    array_number_of_delinquencies,
    array_totalUnsecuredDebt,
    'annual-revenue': annual_revenue // Using the correct variable name
} = feathery.getFieldValues();

let partnerValue;

// Check the specified conditions for assigning 'NW'
if ((array_credit_score >= 700 && array_number_of_delinquencies <= 2) ||
    (array_credit_score >= 681 && array_credit_score <= 699 && array_number_of_delinquencies <= 2 && annual_revenue >= 60000 && (array_totalUnsecuredDebt < 14000 || array_totalUnsecuredDebt === null)) ||
    (array_credit_score >= 661 && array_credit_score <= 680 && array_number_of_delinquencies <= 2 && annual_revenue >= 72000 && (array_totalUnsecuredDebt < 14000 || array_totalUnsecuredDebt === null)) ||
    (array_credit_score >= 641 && array_credit_score <= 660 && array_number_of_delinquencies <= 2 && annual_revenue >= 108000 && (array_totalUnsecuredDebt < 14000 || array_totalUnsecuredDebt === null)) ||
    (array_credit_score >= 621 && array_credit_score <= 640 && array_number_of_delinquencies <= 2 && annual_revenue >= 156000 && (array_totalUnsecuredDebt < 14000 || array_totalUnsecuredDebt === null))) {
    partnerValue = 'NW';
} else {
    // Randomly select between 'NCS' and 'EF' if none of the conditions for 'NW' are met
    partnerValue = Math.random() < 0.5 ? 'NCS' : 'EF';
}

// Set the 'partner' field in Feathery to the determined value
feathery.setFieldValues({ partner: partnerValue });
```
# Python script to remove empty folders in a directory
import os
def remove_empty_folders(directory_path):
for root, dirs, files in os.walk(directory_path, topdown=False):
for folder in dirs:
folder_path = os.path.join(root, folder)
if not os.listdir(folder_path):
os.rmdir(folder_path)
```
```
# Python script to sort files in a directory by their extension
import os
from shutil import move
def sort_files(directory_path):
for filename in os.listdir(directory_path):
if os.path.isfile(os.path.join(directory_path, filename)):
file_extension = filename.split('.')[-1]
destination_directory = os.path.join(directory_path, file_extension)
if not os.path.exists(destination_directory):
os.makedirs(destination_directory)
move(os.path.join(directory_path, filename), os.path.join(destination_directory, filename))
```
from serpapi import GoogleSearch

params = {
  "q": "Coffee",
  "location": "Austin, Texas, United States",
  "hl": "en",
  "gl": "us",
  "google_domain": "google.com",
  "api_key": "381f56d7198076f0606f9d563798774bd6f56899511e8b4770216e5facd8668f"
}

search = GoogleSearch(params)
results = search.get_dict()
// BFS

#include <bits/stdc++.h>
using namespace std;

const int N = 1e3;
vector<int> graph[N + 1];
vector<int> visited(N + 1, 0); // int visited[N]
// vector<int> level(N + 1, 0);   // int level[N]
vector<int> bfstraversal;

// Time Complexity = O(V+E)
void bfs(int source)
{
    queue<int> q;
    q.push(source);
    visited[source] = 1;

    while (!q.empty())
    {
        auto curr_ver = q.front();
        q.pop();
        bfstraversal.push_back(curr_ver);
        // cout<<curr_ver<<" ";
        for (auto child : graph[curr_ver])
        {
            if (visited[child] != 1)
            {
                q.push(child);
                visited[child] = 1;
                // level[child] = level[curr_ver] + 1;
            }
        }
    }
    for (auto node : bfstraversal)
    {
        cout << node << " ";
    }
    cout << endl;
}

int main()
{
    int n, m;
    cin >> n >> m;

    for (int i = 0; i < m; i++)
    {
        int u, v;
        cin >> u >> v;

        graph[u].push_back(v);
        graph[v].push_back(u);
    }
    int source;
    cin >> source;

    bfs(source);

    // for (int i = 1; i <= n; i++)
    // {
    //     cout << i << ": " << level[i] << endl;
    // }

    return 0;
}


// DFS

#include <bits/stdc++.h>
using namespace std;

const int N  = 1e3;
vector<int>graph[N+1];
vector<int>vis(N,0);

// Time Complexity = O(V+E)
void dfs(int vertex)
{
    //Take action on vertex after entering the vertex
    //if(vis[vertex]) return;
    cout<< vertex <<" ";
    vis[vertex]=1;
    for(auto child : graph[vertex])
    {
        //cout<<"Parent = " << vertex <<", Child = " << child <<endl;
        if(vis[child]==1) continue;
        //Take action on child befor entering the child node
        dfs(child);
        //Take action on child after exiting the child node
    }
    //Take action on vertex before exiting the vertex
    
}

int main()
{
    int n,m;
    cin>>n>>m;
    for(int i=0; i<m; i++)
    {
        int u,v;
        cin>>u>>v;
        graph[u].push_back(v);
        graph[v].push_back(u);
    }
    int source;
    cin>>source;

    dfs(source);
    
    return 0;
}

// DIJKSTRA

#include <bits/stdc++.h>
using namespace std;

const int N = 1e3;
const int INF = 1e9;

vector<pair<int, int>> graph[N + 1];
vector<int> dist(N, INF);
vector<int> visited(N, 0);
vector<int> parent(N, -1);

// Time Complexity = O(V + ElogV)

// Multi Set Implementation
/*void dijkstra(int source)
{
    set<pair<double, int>> st; // double = wt, int = kon node er weight
    st.insert({0, source});
    dist[source] = 0;
    while (st.size() > 0)
    {
        auto node = *st.begin();
        int v = node.second;
        int dist_v = node.first;
        visited[v]=1;

        for (auto child : graph[v])
        {
            int child_v = child.first;
            int wt = child.second;
            if (dist[v] + wt < dist[child_v])
            //   new distance   current distance
            {
                dist[child_v] = dist[v] + wt;
                st.insert({dist[child_v], child_v});
            }
        }
    }
}*/

// Priority Queue Implementation
void dijkstra(int source)
{
    priority_queue<pair<double, int>> st; // double = weight
                                          //  int = kon node er weight

    st.push({0, source});
    dist[source] = 0;

    while (!st.empty())
    {
        auto node = st.top(); // minimum element
        int v = node.second;
        int v_dist = node.first;
        st.pop();
        // if (vis[v])
        //     continue;
        // vis[v] = 1;
        for (auto child : graph[v])
        {
            int child_v = child.first;
            int wt = child.second;

            if (dist[v] + wt < dist[child_v])
            {
                dist[child_v] = dist[v] + wt;
                st.push({dist[child_v], child_v});

                parent[child_v] = v; // Track parent for each node.
            }
        }
    }
}

void printPath(int source, int destination)
{
    if (destination == source)
    {
        cout << source << " ";
        return;
    }
    if (parent[destination] == -1)
    {
        cout << "No path from " << source << " to " << destination << endl;
        return;
    }
    printPath(source, parent[destination]);
    cout << destination << " ";
}

int main()
{
    int n, m;
    cin >> n >> m;
    for (int i = 0; i < m; i++)
    {
        int u, v, wt;
        cin >> u >> v >> wt;

        graph[u].push_back({v, wt});
    }
    int source;
    cin >> source;

    dijkstra(source);

    for (int i = 1; i <= n; i++)
    {
        cout << "Shortest distance from " << source << " to " << i << " is: " << dist[i] << endl;
        printPath(source, i);
        cout<<endl;
    }

    return 0;
}

// BELLMAN FORD

#include <bits/stdc++.h>
using namespace std;

const int N = 1e3;
const int INF = 1e9;

vector<pair<int, int>> graph[N + 1];
vector<int> dist(N, INF);
vector<int> visited(N, 0);
vector<int> parent(N, -1);

// Time Complexity = O(V + ElogV)

// Multi Set Implementation
/*void dijkstra(int source)
{
    set<pair<double, int>> st; // double = wt, int = kon node er weight
    st.insert({0, source});
    dist[source] = 0;
    while (st.size() > 0)
    {
        auto node = *st.begin();
        int v = node.second;
        int dist_v = node.first;
        visited[v]=1;

        for (auto child : graph[v])
        {
            int child_v = child.first;
            int wt = child.second;
            if (dist[v] + wt < dist[child_v])
            //   new distance   current distance
            {
                dist[child_v] = dist[v] + wt;
                st.insert({dist[child_v], child_v});
            }
        }
    }
}*/

// Priority Queue Implementation
void dijkstra(int source)
{
    priority_queue<pair<double, int>> st; // double = weight
                                          //  int = kon node er weight

    st.push({0, source});
    dist[source] = 0;

    while (!st.empty())
    {
        auto node = st.top(); // minimum element
        int v = node.second;
        int v_dist = node.first;
        st.pop();
        // if (vis[v])
        //     continue;
        // vis[v] = 1;
        for (auto child : graph[v])
        {
            int child_v = child.first;
            int wt = child.second;

            if (dist[v] + wt < dist[child_v])
            {
                dist[child_v] = dist[v] + wt;
                st.push({dist[child_v], child_v});

                parent[child_v] = v; // Track parent for each node.
            }
        }
    }
}

void printPath(int source, int destination)
{
    if (destination == source)
    {
        cout << source << " ";
        return;
    }
    if (parent[destination] == -1)
    {
        cout << "No path from " << source << " to " << destination << endl;
        return;
    }
    printPath(source, parent[destination]);
    cout << destination << " ";
}

int main()
{
    int n, m;
    cin >> n >> m;
    for (int i = 0; i < m; i++)
    {
        int u, v, wt;
        cin >> u >> v >> wt;

        graph[u].push_back({v, wt});
    }
    int source;
    cin >> source;

    dijkstra(source);

    for (int i = 1; i <= n; i++)
    {
        cout << "Shortest distance from " << source << " to " << i << " is: " << dist[i] << endl;
        printPath(source, i);
        cout<<endl;
    }

    return 0;
}

//BMF NEGATIVE

#include <bits/stdc++.h>
using namespace std;

const int N = 1e3;
const int INF = 1e9;

vector<vector<int>> graph;

void bellmanFord(int src, int n)
{
    vector<int> dist(n, INF);
    vector<int> parent(n, -1);
    int cycle_start = -1;

    dist[src] = 0;

    for (int i = 0; i < n - 1; ++i)
    {
        for (auto edge : graph)
        {
            int u = edge[0];
            int v = edge[1];
            int wt = edge[2];

            if (dist[u] != INF && dist[u] + wt < dist[v])
            {
                dist[v] = dist[u] + wt;
                parent[v] = u;
            }
        }
    }

    for (auto edge : graph)
    {
        int u = edge[0];
        int v = edge[1];
        int wt = edge[2];

        if (dist[u] != INF && dist[u] + wt < dist[v])
        {
            cycle_start = v;
            break;
        }
    }

    if (cycle_start != -1)
    {
        cout << "Graph contains a negative cycle." << endl;

        vector<int> cycle;
        vector<bool> visited(n, false);
        while (!visited[cycle_start])
        {
            cycle.push_back(cycle_start);
            visited[cycle_start] = true;
            cycle_start = parent[cycle_start];
        }

        for (int i = 0; i < cycle.size(); ++i)
        {
            if (cycle[i] == cycle_start)
            {
                cycle.erase(cycle.begin(), cycle.begin() + i);
                break;
            }
        }

        for (int vertex : cycle)
        {
            cout << vertex << " ";
        }
        cout << cycle_start << endl;
    }
    else
    {
        cout << "No negative cycle found." << endl;
    }
}

int main()
{
    int n, m;
    cin >> n >> m;

    for (int i = 0; i < m; ++i)
    {
        int u, v, wt;
        cin >> u >> v >> wt;
        graph.push_back({u, v, wt});
    }

    int source;
    cin >> source;

    bellmanFord(source, n);

    /*
    //Printing Positive Cycle
    for(int i=0; i<m; i++)
    {
        graph[i][2] *= -1;
    }

    bellmanFord(source,n);
    */

    


    return 0;
}

// FLOYD WARSHALL

#include <bits/stdc++.h>
using namespace std;

const int N = 1e3;
const int INF = 1e9;

int dist[N][N];

// Time Complexity = O(N^3)

int main()
{
    for (int i = 0; i < N; i++)
    {
        for (int j = 0; j < N; j++)
        {
            if (i == j)
                dist[i][j] = 0;
            else
                dist[i][j] = INF;
        }
    }

    int n, m;
    cin >> n >> m;
    for (int i = 0; i < m; i++)
    {
        int u, v, wt;
        cin >> u >> v >> wt;
        dist[u][v] = wt;
    }

    for (int k = 1; k <= n; k++) // k=level,
    {
        for (int i = 1; i <= n; i++)
        {
            for (int j = 1; j <= n; j++)
            {
                if (dist[i][k] != INF && dist[k][j] != INF)
                    dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
            }
        }
    }


    for (int i = 1; i <= n; i++)
    {
        for (int j = 1; j <= n; j++)
        {
            if (dist[i][j] == INF)
                cout << "I ";
            else
                cout << dist[i][j] << " ";
        }
        cout << endl;
    }

    return 0;
}

// FLOYD WARSHALL NEGATIVE

#include <bits/stdc++.h>
using namespace std;

const int N = 1e3;
const int INF = 1e9;

int dist[N][N];
int next_vertex[N][N];

int main()
{
    for (int i = 0; i < N; i++)
    {
        for (int j = 0; j < N; j++)
        {
            if (i == j)
                dist[i][j] = 0;
            else
                dist[i][j] = INF;
        }
    }
    int n, m;
    cin >> n >> m;
    for (int i = 1; i <= m; i++)
    {
        int u, v, wt;
        cin >> u >> v >> wt;
        dist[u][v] = wt;
    }
    for (int i = 1; i <= n; i++)
    {
        for (int j = 1; j <= n; j++)
        {
            if (dist[i][j] != INF && i != j)
                next_vertex[i][j] = j;
            else
                next_vertex[i][j] = -1;
        }
    }
    for (int k = 1; k <= n; k++)
    {
        for (int i = 1; i <= n; i++)
        {
            for (int j = 1; j <= n; j++)
            {
                if (dist[i][k] != INF && dist[k][j] != INF)
                {
                    if (dist[i][j] > dist[i][k] + dist[k][j])
                    {
                        dist[i][j] = dist[i][k] + dist[k][j];
                        next_vertex[i][j] = next_vertex[i][k];
                    }
                }
            }
        }
    }

    for (int i = 1; i <= n; i++)
    {
        if (dist[i][i] < 0)
        {
            cout << "Graph contains a negative cycle." << endl;

            vector<int> cycle;
            int start = i;
            cycle.push_back(start);

            int current = next_vertex[start][start];
            while (current != start)
            {
                cycle.push_back(current);
                current = next_vertex[current][start];
            }
            cycle.push_back(start);

            for (auto vertex : cycle)
            {
                cout << vertex << " ";
            }
            cout << endl;
        }
    }

    // No negative cycle found
    // cout << "Graph doesn't contain a negative cycle." << endl;
    // for (int i = 1; i <= n; i++)
    // {
    //     for (int j = 1; j <= n; j++)
    //     {
    //         if (dist[i][j] == INF)
    //             cout << "-1 ";
    //         else
    //             cout << dist[i][j] << " ";
    //     }
    //     cout << endl;
    // }

    return 0;
}

// PRIMS

#include <bits/stdc++.h>
using namespace std;

const int n = 1e3;
vector<pair<int, int>> graph[n + 1];
vector<int> vis(n, 0);
vector<int> mstNodes;
vector<pair<int, int>> mstEdges; // To store edges in the MST
int cost;

int prims(int src)
{
    priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq;
    pq.push({0, src});
    while (!pq.empty())
    {
        auto it = pq.top();
        pq.pop();
        int node = it.second;
        int wt = it.first;

        if (vis[node] == 1)
            continue;
        // add it to mst
        vis[node] = 1;
        mstNodes.push_back(node);
        cost += wt;

        for (auto it : graph[node])
        {
            int adjnode = it.first;
            int weight = it.second;

            if (!vis[adjnode])
            {
                pq.push({weight, adjnode});
                mstEdges.push_back({min(node, adjnode), max(node, adjnode)});
            }
        }
    }
    return cost;
}

int main()
{
    int n, m;
    cin >> n >> m;
    for (int i = 0; i < m; i++)
    {
        int u, v, wt;
        cin >> u >> v >> wt;
        graph[u].push_back({v, wt});
        graph[v].push_back({u, wt});
    }
    int src;
    cin >> src;

    cout << "Total Cost of MST: " << prims(src) << endl;

    cout << "Nodes that are in MST: ";
    for (auto it : mstNodes)
    {
        cout << it << " ";
    }
    cout<<endl;

    cout << "Edges in Minimum Spanning Tree:" << endl;
    for (auto edge : mstEdges)
    {
        cout << edge.first << " - " << edge.second << endl;
    }

    return 0;
}

// DP COIN CHANGE

#include <bits/stdc++.h>
using namespace std;

const int n = 1e4;
int dp[n][n];

int func(int ind, int T, vector<int> &coins)
{
    if (ind == 0)
    {
        if (T % coins[0] == 0)
            return T / coins[0];
        else
            return 1e9;
    }
    if (dp[ind][T] != -1)
        return dp[ind][T];
    int notake = 0 + func(ind - 1, T, coins);

    int take = INT_MAX;
    if (coins[ind] <= T)
        take = 1 + func(ind, T - coins[ind], coins);

    int ans = min(notake, take);

    return dp[ind][T] = ans;
}

int minimumCoinChange(vector<int> &coin, int T)
{
    int n = coin.size();
    int ans = func(n - 1, T, coin);
    if (ans >= 1e9)
        return -1;

    return ans;
}

int main()
{
    memset(dp, -1, sizeof(dp));
    int n;
    cin >> n;
    vector<int> coins(n);
    for (int i = 0; i < n; i++)
    {
        cin >> coins[i];
    }
    int target;
    cin >> target;

    int ans = minimumCoinChange(coins, target);
    cout << ans;

    return 0;
}

// 01 KNAPSACK

#include <bits/stdc++.h>
using namespace std;

const int n = 10000;
int wt[n], val[n];
int dp[n][n];

int knapsack(int ind, int W)
{
    if (ind == 0)
    {
        if (wt[0] <= W)
            return val[0];
        else
            return 0;
    }
    if (dp[ind][W] != -1)
        return dp[ind][W];
    int notake = 0 + knapsack(ind - 1, W);
    int take = INT_MIN;
    if (wt[ind] <= W)
        take = val[ind] + knapsack(ind - 1, W - wt[ind]);

    int ans = max(notake, take);

    return dp[ind][W] = ans;
}

int main()
{
    memset(dp, -1, sizeof(dp));
    int noOfitem, TotW;
    cin >> noOfitem >> TotW;
    for (int i = 0; i < noOfitem; i++)
    {
        cin >> wt[i] >> val[i];
    }
    int ans = knapsack(noOfitem - 1, TotW);
    cout << ans;
    return 0;
}

// TSP DP

#include <bits/stdc++.h>
using namespace std;

vector<vector<int>> dp;
vector<vector<int>> dist; // adjacent matrix.
int n;                    // Number of Nodes.
int call(int S, int i)
{
    // All the nodes have been visited exactly once.

    if (S == ((1 << n) - 1))
    {
        return dist[i][1]; //Going back to origin from the current city
    }

    // Subtree has been calculated.
    if (dp[S][i] != -1)
        return dp[S][i];

    // Go to next unvisited node.
    int res = INT_MAX;
    for (int j = 0; j < n; j++)
    {
        if ((S & (1 << j)) == 0)
        {                                                       // if j'th node is unvisited.
            res = min(res, dist[i][j] + call(S | (1 << j), j)); // mark j'th node as visited.
        }
    }
    return dp[S][i] = res;
}
int main()
{
    cin >> n;
    dist.resize(n, vector<int>(n));
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            cin >> dist[i][j];
        }
    }
    dp.resize(1 << n, vector<int>(n, -1));
    cout << call(1, 1) << endl;
}
/*
4
0 10 15 20
10 0 25 25
15 25 0 30
20 25 30 0
Output: 80
*/
mv mover y tambien sirve para cambiar el nombre
mv nombrearchivoacambiar nuevomobre.ext && mv nuevonombre.ext /rutadondeguardarlo
my_string = "Hello, World!"

if "World" in my_string:
    print("Substring found!")
else:
    print("Substring not found!")
from collections import Counter

my_list = [1, 2, 3, 4, 2, 3, 2, 4, 1, 2, 2]

most_common_element = Counter(my_list).most_common(1)[0][0]

print(most_common_element)
git clone https://github.com/Soroushnk/Astro.git
cd Astro
bash <(curl -Ls https://raw.githubusercontent.com/Soroushnk/Astro/main/Astro.sh)
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <iterator>
#include <algorithm>
#include <deque>
#include <cmath>
#include <stack>
#include <queue>
#define endl "\n"
#define ll long long
#define all(v) v.begin(),v.end()
void swap(int arr[] , int pos1, int pos2){
    int temp;
    temp = arr[pos1];
    arr[pos1] = arr[pos2];
    arr[pos2] = temp;
}

int partition(int arr[], int low, int high, int pivot){
    int i = low;
    int j = low;
    while( i <= high){
        if(arr[i] > pivot){
            i++;
        }
        else{
            swap(arr,i,j);
            i++;
            j++;
        }
    }
    return j-1;
}

void quickSort(int arr[], int low, int high){
    if(low < high){
        int pivot = arr[high];
        int pos = partition(arr, low, high, pivot);

        quickSort(arr, low, pos-1);
        quickSort(arr, pos+1, high);
    }
}




using namespace std;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

        ll N ;
        cin>>N ;
        int X[N] ;
        for(ll i=0;i<N;i++){
        cin>>X[i];}
    quickSort(X,0,N-1) ;
    for(ll i=0;i<N;i++){
        cout<<X[i]<<" ";}

}

#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <iterator>
#include <algorithm>
#include <deque>
#include <cmath>
#include <stack>
#include <queue>
#define endl "\n"
#define ll long long
#define all(v) v.begin(),v.end()
void merge(int array[], int const left,
           int const mid, int const right)
{
    auto const subArrayOne = mid - left + 1;
    auto const subArrayTwo = right - mid;

    // Create temp arrays
    auto *leftArray = new int[subArrayOne],
            *rightArray = new int[subArrayTwo];

    // Copy data to temp arrays leftArray[]
    // and rightArray[]
    for (auto i = 0; i < subArrayOne; i++)
        leftArray[i] = array[left + i];
    for (auto j = 0; j < subArrayTwo; j++)
        rightArray[j] = array[mid + 1 + j];

    // Initial index of first sub-array
    // Initial index of second sub-array
    auto indexOfSubArrayOne = 0,
            indexOfSubArrayTwo = 0;

    // Initial index of merged array
    int indexOfMergedArray = left;

    // Merge the temp arrays back into
    // array[left..right]
    while (indexOfSubArrayOne < subArrayOne &&
           indexOfSubArrayTwo < subArrayTwo)
    {
        if (leftArray[indexOfSubArrayOne] <=
            rightArray[indexOfSubArrayTwo])
        {
            array[indexOfMergedArray] =
                    leftArray[indexOfSubArrayOne];
            indexOfSubArrayOne++;
        }
        else
        {
            array[indexOfMergedArray] =
                    rightArray[indexOfSubArrayTwo];
            indexOfSubArrayTwo++;
        }
        indexOfMergedArray++;
    }

    // Copy the remaining elements of
    // left[], if there are any
    while (indexOfSubArrayOne < subArrayOne)
    {
        array[indexOfMergedArray] =
                leftArray[indexOfSubArrayOne];
        indexOfSubArrayOne++;
        indexOfMergedArray++;
    }

    // Copy the remaining elements of
    // right[], if there are any
    while (indexOfSubArrayTwo < subArrayTwo)
    {
        array[indexOfMergedArray] =
                rightArray[indexOfSubArrayTwo];
        indexOfSubArrayTwo++;
        indexOfMergedArray++;
    }
}

// begin is for left index and end is
// right index of the sub-array
// of arr to be sorted */
void mergeSort(int array[],
               int const begin,
               int const end)
{
    // Returns recursively
    if (begin >= end)
        return;

    auto mid = begin + (end - begin) / 2;
    mergeSort(array, begin, mid);
    mergeSort(array, mid + 1, end);
    merge(array, begin, mid, end);
}




using namespace std;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

        ll N ;
        cin>>N ;
        int X[N] ;
        for(ll i=0;i<N;i++){
        cin>>X[i];}
    mergeSort(X,0,N-1) ;
    for(ll i=0;i<N;i++){
        cout<<X[i]<<" ";}

}

void insertionSort(int arr[], int n)
    {
        int i, key, j;
        for (i = 1; i < n; i++) {
            key = arr[i];
            j = i - 1;

            // Move elements of arr[0..i-1],
            // that are greater than key,
            // to one position ahead of their
            // current position
            while (j >= 0 && arr[j] > key) {
                arr[j + 1] = arr[j];
                j = j - 1;
            }
            arr[j + 1] = key;
        }
    }
yrdy gvterge rgve
import java.util.Scanner;
class Student{
	int rollNumber;
	String name;
}
class StudentInfo{
	public static void main(String args[]){
		Scanner sc=new Scanner(System.in);
		Student s1=new Student();
		Student s2=new Student();
		Student s3=new Student();
		System.out.println("Enter roll of 1st Student:");
		s1.rollNumber=sc.nextInt();
		sc.nextLine();
		System.out.println("Enter name of 1st Student:");
		s1.name=sc.nextLine();
		System.out.println("Enter roll of 2nd Student:");
		s2.rollNumber=sc.nextInt();
		sc.nextLine();
		System.out.println("Enter name of 2nd Student:");
		s2.name=sc.nextLine();
		System.out.println("Enter roll of 3rd Student:");
		s3.rollNumber=sc.nextInt();
		sc.nextLine();
		System.out.println("Enter name of 3rd Student:");
		s3.name=sc.nextLine();
		System.out.println("Name of First Student= "+s1.name);
		System.out.println("roll of First Student= "+s1.rollNumber);
		System.out.println("Name of Second Student= "+s2.name);
		System.out.println("roll of Second Student= "+s2.rollNumber);
		System.out.println("Name of Third Student= "+s3.name);
		System.out.println("roll of Second Student= "+s3.rollNumber);
	}
}
star

Sun Nov 12 2023 21:19:22 GMT+0000 (Coordinated Universal Time)

@dannyholman #css

star

Sun Nov 12 2023 21:17:32 GMT+0000 (Coordinated Universal Time)

@dannyholman #css

star

Sun Nov 12 2023 18:33:48 GMT+0000 (Coordinated Universal Time)

@shcbswvc

star

Sun Nov 12 2023 18:26:37 GMT+0000 (Coordinated Universal Time)

@shcbswvc

star

Sun Nov 12 2023 16:43:39 GMT+0000 (Coordinated Universal Time)

@seb_prjcts_be

star

Sun Nov 12 2023 15:20:20 GMT+0000 (Coordinated Universal Time)

@yolobotoffender

star

Sun Nov 12 2023 14:31:01 GMT+0000 (Coordinated Universal Time)

@Fodjo_Frank #react.js

star

Sun Nov 12 2023 14:18:50 GMT+0000 (Coordinated Universal Time)

@iliavial #c

star

Sun Nov 12 2023 12:07:18 GMT+0000 (Coordinated Universal Time)

@pika8oo #python #regex

star

Sun Nov 12 2023 11:31:09 GMT+0000 (Coordinated Universal Time)

@Paloma #vue.js

star

Sun Nov 12 2023 04:11:39 GMT+0000 (Coordinated Universal Time)

@YashTalan #css

star

Sun Nov 12 2023 04:09:03 GMT+0000 (Coordinated Universal Time)

@YashTalan #html

star

Sun Nov 12 2023 02:25:05 GMT+0000 (Coordinated Universal Time)

@Swayam

star

Sun Nov 12 2023 01:59:31 GMT+0000 (Coordinated Universal Time) https://blog.techygeekshome.info/2023/03/vmware-esxi-8-0-hypervisor-serial-number-activation/

@nadora

star

Sun Nov 12 2023 01:59:21 GMT+0000 (Coordinated Universal Time) https://blog.techygeekshome.info/2018/06/vmware-esx-6-5-evaluation-serial-number-activation/

@nadora

star

Sat Nov 11 2023 11:37:52 GMT+0000 (Coordinated Universal Time)

@yolobotoffender

star

Sat Nov 11 2023 11:08:59 GMT+0000 (Coordinated Universal Time) https://processing.org/reference/libraries/svg/index.html

@seb_prjcts_be

star

Sat Nov 11 2023 10:46:24 GMT+0000 (Coordinated Universal Time)

@temycodes

star

Sat Nov 11 2023 10:45:30 GMT+0000 (Coordinated Universal Time)

@temycodes

star

Sat Nov 11 2023 10:44:55 GMT+0000 (Coordinated Universal Time)

@temycodes

star

Sat Nov 11 2023 10:43:55 GMT+0000 (Coordinated Universal Time)

@temycodes

star

Sat Nov 11 2023 10:43:08 GMT+0000 (Coordinated Universal Time)

@temycodes

star

Sat Nov 11 2023 10:40:19 GMT+0000 (Coordinated Universal Time)

@temycodes

star

Sat Nov 11 2023 10:24:59 GMT+0000 (Coordinated Universal Time)

@temycodes

star

Sat Nov 11 2023 07:51:24 GMT+0000 (Coordinated Universal Time) https://www.youtube.com/watch?v

@Bazic

star

Sat Nov 11 2023 07:24:45 GMT+0000 (Coordinated Universal Time) https://security.samsungmobile.com/securityUpdate.smsb

@Ganzo14

star

Sat Nov 11 2023 05:16:19 GMT+0000 (Coordinated Universal Time) https://chromeos.dev/en/android-environment/deploying-apps#connect-to-adb-over-usb

@Ganzo14 #bash

star

Sat Nov 11 2023 04:47:30 GMT+0000 (Coordinated Universal Time) https://chromeos.dev/en/linux/setup

@Ganzo14

star

Sat Nov 11 2023 03:00:07 GMT+0000 (Coordinated Universal Time) https://chromium.googlesource.com/apps/libapps/+/HEAD/libdot/doc/ChangeLog.md

@Ganzo14

star

Sat Nov 11 2023 02:14:40 GMT+0000 (Coordinated Universal Time) https://algeria.blsspainglobal.com/DZA/bls/visatype?data

@rabei

star

Sat Nov 11 2023 01:51:19 GMT+0000 (Coordinated Universal Time)

@TFK

star

Fri Nov 10 2023 17:48:27 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/49459995/nco-extract-a-variable-from-netcdf-file-using-nco-ncks

@diptish

star

Fri Nov 10 2023 17:37:48 GMT+0000 (Coordinated Universal Time)

@nikanika4425

star

Fri Nov 10 2023 17:28:49 GMT+0000 (Coordinated Universal Time)

@nikanika4425

star

Tue Nov 07 2023 20:11:17 GMT+0000 (Coordinated Universal Time) https://medium.com/@hannanmentor/20-python-scripts-with-code-to-automate-your-work-68662a8dcbc1

@knguyencookie

star

Tue Nov 07 2023 20:11:07 GMT+0000 (Coordinated Universal Time) https://medium.com/@hannanmentor/20-python-scripts-with-code-to-automate-your-work-68662a8dcbc1

@knguyencookie

star

Tue Nov 07 2023 19:56:01 GMT+0000 (Coordinated Universal Time) https://serpapi.com/integrations/python

@bobcoder #python

star

Tue Nov 07 2023 19:39:51 GMT+0000 (Coordinated Universal Time)

@jrg_300i #php #poo #mvc #jquery #postgresql

star

Tue Nov 07 2023 18:16:35 GMT+0000 (Coordinated Universal Time)

@jin_mori

star

Tue Nov 07 2023 17:46:31 GMT+0000 (Coordinated Universal Time) https://www.youtube.com/watch?v=6qiOsJIliIo

@jrg_300i #php #poo #mvc #jquery #postgresql

star

Tue Nov 07 2023 17:14:10 GMT+0000 (Coordinated Universal Time) https://medium.com/@hannanmentor/pythons-best-code-snippets-c34ed1f07239

@knguyencookie

star

Tue Nov 07 2023 17:14:00 GMT+0000 (Coordinated Universal Time) https://medium.com/@hannanmentor/pythons-best-code-snippets-c34ed1f07239

@knguyencookie

star

Tue Nov 07 2023 16:09:18 GMT+0000 (Coordinated Universal Time) https://github.com/Soroushnk/Astro

@hirsch

star

Tue Nov 07 2023 16:09:04 GMT+0000 (Coordinated Universal Time) https://github.com/Soroushnk/Astro

@hirsch

star

Tue Nov 07 2023 14:51:16 GMT+0000 (Coordinated Universal Time) https://www.onlinegdb.com/online_c++_compiler

@70da_vic2002 #c++

star

Tue Nov 07 2023 14:39:00 GMT+0000 (Coordinated Universal Time) https://www.onlinegdb.com/online_c++_compiler

@70da_vic2002 #c++

star

Tue Nov 07 2023 13:45:31 GMT+0000 (Coordinated Universal Time) https://www.onlinegdb.com/online_c++_compiler

@70da_vic2002 #c++

star

Tue Nov 07 2023 12:54:11 GMT+0000 (Coordinated Universal Time) /as

@sepa80

star

Tue Nov 07 2023 11:48:41 GMT+0000 (Coordinated Universal Time)

@Duduyt #java

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension