Snippets Collections
#include <stdio.h>

void print_quadratic(int a, int b, int c) 
{
    printf("%dx^2 ", a);
    if (b >= 0) {
        printf("+ %dx ", b);
    } else {
        printf("- %dx ", -b);
    }
    if (c >= 0) {
        printf("+ %d", c);
    } else {
        printf("- %d", -c);
    }
    printf("\n");
}


int main() 
{
    int a, b, c;

    printf("Enter a: \n");
    scanf("%d", &a);
    printf("Enter b: \n");
    scanf("%d", &b);
    printf("Enter c: \n");
    scanf("%d", &c);

    print_quadratic(a, b, c);

    return 0;
}
var $= jQuery; $(document).on('found_variation', 'form.cart', function(event, variation) {
	//update price in custom box
    if (variation.price_html) {
      $('.custom-price-box .elementor-widget-container').html(variation.price_html);
    }
});
/**
 * Filters the next, previous and submit buttons.
 * Replaces the form's <input> buttons with <button> while maintaining attributes from original <input>.
 *
 * @param string $button Contains the <input> tag to be filtered.
 * @param object $form Contains all the properties of the current form.
 *
 * @return string The filtered button.
 */
add_filter('gform_next_button', 'input_to_button', 10, 2);
add_filter('gform_previous_button', 'input_to_button', 10, 2);
add_filter('gform_submit_button,', 'input_to_button', 10, 2);
function input_to_button($button, $form)
{
  $dom = new DOMDocument();
  $dom->loadHTML('<?xml encoding="utf-8" ?>' . $button);
  $input = $dom->getElementsByTagName('input')->item(0);
  $new_button = $dom->createElement('button');
  $new_button->appendChild($dom->createTextNode($input->getAttribute('value')));
  $input->removeAttribute('value');
  foreach ($input->attributes as $attribute) {
    $new_button->setAttribute($attribute->name, $attribute->value);
  }

  $classes = $new_button->getAttribute('class');
  $classes .= " btn";
  $new_button->setAttribute('class', $classes);
  $input->parentNode->replaceChild($new_button, $input);

  return $dom->saveHtml($new_button);
}
// Invalide a Node cache.
\Drupal::service('cache_tags.invalidator')->invalidateTags(['node:5']);
// Invalidate a custom entity cache.
\Drupal::service('cache_tags.invalidator')->invalidateTags(['custom_entity:5']);
// Invalidate a custom cache tag.
\Drupal::service('cache_tags.invalidator')->invalidateTags(['thing:identifier']);
1.
//main.java
import java.io.*;
import java.text.*;
import java.util.*;
   public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("1.Current Account\n2.Savings Account");
        int choice = scanner.nextInt();
        scanner.nextLine(); // consume newline
        System.out.println("Name");
        String name = scanner.nextLine();
        System.out.println("Account Number");
        int number = scanner.nextInt();
        System.out.println("Account Balance");
        int balance = scanner.nextInt();
        scanner.nextLine(); // consume newline
        System.out.println("Enter the Start Date(yyyy-mm-dd)");
        String startDateStr = scanner.nextLine();
        System.out.println("Enter the Due Date(yyyy-mm-dd)");
        String dueDateStr = scanner.nextLine();

        Date startDate = parseDate(startDateStr);
        Date dueDate = parseDate(dueDateStr);

        Account account;
        if (choice == 1) {
            account = new CurrentAccount(name, number, balance, startDate);
        } else {
            account = new SavingsAccount(name, number, balance, startDate);
        }

        double interest = account.calculateInterest(dueDate);
        String accountType = (choice == 1) ? "Current" : "Savings";
        System.out.printf("%s Account Interest %.2f%n", accountType, interest);
    }

    private static int monthsDifference(Date startDate, Date endDate) {
        Calendar c1 = new GregorianCalendar();
        c1.setTime(startDate);

        Calendar c2 = new GregorianCalendar();
        c2.setTime(endDate);

        int ans = (c2.get(Calendar.YEAR) - c1.get(Calendar.YEAR)) * 12;
        ans += c2.get(Calendar.MONTH) - c1.get(Calendar.MONTH);

        return ans;
    }

    private static Date parseDate(String dateString) {
        try {
            return new SimpleDateFormat("yyyy-MM-dd").parse(dateString);
        } catch (ParseException e) {
            e.printStackTrace();
            return null;
        }
    }
}
//accout.java
import java.util.* ;
   public abstract class Account {
    String name;
    int number;
    int balance;
    Date startDate;

    Account(String name, int number, int balance, Date startDate) {
        this.name = name;
        this.number = number;
        this.balance = balance;
        this.startDate = startDate;
    }

    abstract double calculateInterest(Date dueDate);
    protected static int monthsDifference(Date startDate, Date endDate) {
        Calendar c1 = new GregorianCalendar();
        c1.setTime(startDate);

        Calendar c2 = new GregorianCalendar();
        c2.setTime(endDate);

        int ans = (c2.get(Calendar.YEAR) - c1.get(Calendar.YEAR)) * 12;
        ans += c2.get(Calendar.MONTH) - c1.get(Calendar.MONTH);

        return ans;
    }
  
}
//currentaccount.java
import java.util.*;
public class CurrentAccount extends Account {
    CurrentAccount(String name, int number, int balance, Date startDate) {
        super(name, number, balance, startDate);
    }

    
    double calculateInterest(Date dueDate) {
        int months = monthsDifference(startDate, dueDate);
        double rate = 5.0 / 12 / 100; 
        return balance * rate * months;
    }
      
}   
//savingsaccount.java
import java.util.*;
   public class SavingsAccount extends Account {
    SavingsAccount(String name, int number, int balance, Date startDate) {
        super(name, number, balance, startDate);
    }


    double calculateInterest(Date dueDate) {
        int months = monthsDifference(startDate, dueDate);
        double rate = 12.0 / 12 / 100; 
        return balance * rate * months;
    }
      
}


2..
//icici.java
class Icici implements Notification {
    //Fill your code here
     public void notificationBySms() {
        System.out.println("ICICI - Notification By SMS");
    }

    
    public void notificationByEmail() {
        System.out.println("ICICI - Notification By Mail");
    }


    public void notificationByCourier() {
        System.out.println("ICICI - Notification By Courier");
    }
}

//bankfactory.java
class BankFactory {
    //Fill your code here
    public Icici getIcici() {
        return new Icici();
    }

    public Hdfc getHdfc() {
        return new Hdfc();
    }
}
//notification.java
interface Notification {
   //Fill your code here
    void notificationBySms();
    void notificationByEmail();
    void notificationByCourier();
}
//main.java
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("Welcome to Notification Setup");
        System.out.println("Please select your bank:");
        System.out.println("1) ICICI");
        System.out.println("2) HDFC");
        
        int bankChoice = scanner.nextInt();
        if (bankChoice == 1 || bankChoice == 2) {
            System.out.println("Enter the type of Notification you want to enter");
            System.out.println("1) SMS");
            System.out.println("2) Mail");
            System.out.println("3) Courier");
            
            int notificationChoice = scanner.nextInt();
            
            BankFactory bankFactory = new BankFactory();
            if (bankChoice == 1) {
                Icici icici = bankFactory.getIcici();
                switch (notificationChoice) {
                    case 1:
                        icici.notificationBySms();
                        break;
                    case 2:
                        icici.notificationByEmail();
                        break;
                    case 3:
                        icici.notificationByCourier();
                        break;
                    default:
                        System.out.println("Invalid Input");
                }
            } else {
                Hdfc hdfc = bankFactory.getHdfc();
                switch (notificationChoice) {
                    case 1:
                        hdfc.notificationBySms();
                        break;
                    case 2:
                        hdfc.notificationByEmail();
                        break;
                    case 3:
                        hdfc.notificationByCourier();
                        break;
                    default:
                        System.out.println("Invalid Input");
                }
            }
        } else {
            System.out.println("Invalid Input");
        }
    }
}
//hdfc.java
class Hdfc implements Notification {
    //Fill your code here
     public void notificationBySms() {
        System.out.println("HDFC - Notification By SMS");
    }

    
    public void notificationByEmail() {
        System.out.println("HDFC - Notification By Mail");
    }

    
    public void notificationByCourier() {
        System.out.println("HDFC - Notification By Courier");
    }
}

git checkout master
git pull origin master
git merge test
git push origin master
question 1.

#include <iostream>

using namespace std;
//Abstract class becuase it contain ppure virtual function
class Vehicle{
    
    public:
   virtual void drive() = 0;
};

class Car: public Vehicle{
    public:
    void drive(){
        cout<<"Driving a car "<<endl;
    }
};

class Motorcycle: public Vehicle{
    public:
    void drive(){
        cout<<"Driving a motorcycle"<<endl;
    }
};


int main() {
    //Abstract class can not be instantiated. but you can write as pointer and 
    Vehicle *obj;
   Car c;
   obj = &c;
   obj->drive();
   Motorcycle m;
   obj = &m;
   obj->drive();

    return 0;
}
//OUTPUT:
Driving a car 
Driving a motorcycle
____________________________________________________________

Question 2:
#include <iostream>

using namespace std;

class Shape{
    
    public:
   double Area(){
       return 0.0;
   }
   
};

class Rectangle: public Shape{
    double width;
    double length;
    public:
    Rectangle(double width, double length){
        this->width = 10;
        this->length = 10;
    }
    double Area(){
        //int area = width * length;
        return width * length;
        //cout<<"Area of Rectangle = "<<area<<endl;
    }
    
};

class Triangle: public Shape{
    double base;
    double heigth;
    public:
    Triangle(double b, double h):base(b),heigth(h){
        
    }
    double Area(){
        return 0.5 * base * heigth;
    }
};

int main() {
    Shape *shape;
    Rectangle rect(10, 10);
    shape = &rect;
    shape->Area();
   
    

    return 0;
}

________________________________________________________________-
  Question 3.
#include <iostream>

using namespace std;

class Animal{
    
    protected:
    string name;
    public:
    Animal(string name){
        this->name = name;
    }
    virtual void makeSound(){
        cout<<"Animal: "<<endl;
    }
   
};

class Dog: public Animal{
    string breed;
    public:
    Dog(string name, string breed):Animal(name){
        this->breed = breed;
    }
    void makeSound(){
        //Animal::makeSound(); to call makeSound function in Animal class
        cout<<"Dog makes Sound."<<endl;
    }
    void display(){
        cout<<"Dog Name: "<<name<<endl;
        cout<<"Dog Breed: "<<breed<<endl;
    }
};

class Cat: public Animal{
    string color;
    
    public:
    Cat(string name, string color):Animal(name){
        this->color = color;
    }
    void makeSound(){
        cout<<"Cat makes Sound."<<endl;
    }
    void display(){
        cout<<"Cat Name: "<<name<<endl;
        cout<<"Cat Color "<<color<<endl;
    }
};

int main() {
    
    
    Dog d("Doggy","Male");
    d.display();
    d.makeSound();
    cout<<endl;
    Cat c("Catty","Brown");
    c.display();
    c.makeSound();
   
    

    return 0;
}
//OUTPUT:
Dog Name: Doggy
Dog Breed: Male
Dog makes Sound.

Cat Name: Catty
Cat Color Brown
Cat makes Sound.
#include <iostream>

using namespace std;
//PUre Virtual Function
class Employee{
    int code;
    string name[20];
    public:
    virtual void getData();
    virtual void Display();
};
class Grade : public Employee{
    char grade[20];
    float salary;
    
    public:
    void getData();
    void Display();
};

void Employee::getData(){
    
}
void Employee::Display(){
    
}
void Grade::getData(){
    cout<<"Enter Employee Grade: "<<endl;
    cin>>grade;
    cout<<"Enter Employee Salaray: "<<endl;
    cin>>salary;
}
void Grade::Display(){
    cout<<"Employee Grade is: "<<grade<<endl;
    cout<<"Employee Salaray is: "<<salary<<endl;
}

int main() {
    Employee *ptr;
    Grade obj;
    ptr = &obj;
    ptr->getData();
    ptr->Display();

    return 0;
}
//OUTPUT:
Enter Employee Grade: 
A
Enter Employee Salaray: 
24000
Employee Grade is: A
Employee Salaray is: 24000
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{24ad3ad4-a569-4530-98e1-ab02f9417aa8}
#include <iostream>

using namespace std;
//Hierarchical inheritance
class Employee{
    
    protected:
    string name;
    int employeeID;
    
    public:
    
    void inputEmployeeInfo(){
        cout<<"Enter name: "<<endl;
        cin>>name;
        cout<<"Enter Employee ID: "<<endl;
        cin>>employeeID;
    }
    void displayEmployeeInfo(){
        cout<<"Name: "<<name<<endl;
        cout<<"Employee ID: "<<employeeID<<endl;
    }
};
//Derived Manager Class From Employee Class

class Manager :virtual public Employee{
    protected:
    int level;
    public:
    void inputManagerInfo(){
        //inputEmployeeInfo();
        cout<<"Enter Manager Level: "<<endl;
        cin>>level;
    }
    void displayManagerInfo(){
        //displayEmployeeInfo();
        cout<<"Manager Level: "<<level<<endl;
    }
};
//Derived Developer Class From Employee
class Developer : virtual public Employee{
    protected:
    int progLang;
    public:
    void inputDeveloperInfo(){
        //inputEmployeeInfo();
        cout<<"Enter Programing Language: "<<endl;
        cin>>progLang;
    }
    void displayDeveloperInfo(){
        //displayEmployeeInfo();
        cout<<"Programing Language: "<<progLang<<endl;
    }
};
//DErived class for Teamlead That will display both info manager and developer
class TeamLead : public Manager, public Developer{
    
    public:
    
    void inputInfo(){
        inputEmployeeInfo();   // Employee Info
        inputManagerInfo();    // Manager Info
        inputDeveloperInfo();   //Developer Info
    }

    void displayInfo(){
        cout<<"Team Lead Details: "<<endl;
        displayEmployeeInfo(); // Employee Info
        displayManagerInfo();  // Manager Info
        displayDeveloperInfo();  //Developer Info
    }
};

int main() {
    
    TeamLead tl;
    tl.inputInfo();
    cout<<endl;
    tl.displayInfo();
    
   

    return 0;
}

//OUTPUT:
Enter name: 
mohamed
Enter Employee ID: 
1222
Enter Manager Level: 
7
Enter Programing Language: 
java

Team Lead Details: 
Name: mohamed
Employee ID: 1222
Manager Level: 7
Programing Language: java
        function keydown(e) {
            let hideKey = Settings.data.hide || { ctrl: true, key: "e" };
            let closeKey = Settings.data.close || { ctrl: true, key: "x" };
            if (((hideKey.ctrl && e.ctrlKey) || (!hideKey.ctrl && !e.ctrlKey)) && ((hideKey.shift && e.shiftKey) || (!hideKey.shift && !e.shiftKey)) && ((hideKey.alt && e.altKey) || (!hideKey.alt && !e.altKey)) && e.key.toLowerCase() == hideKey.key) {
                e.preventDefault();
                guiWrapper.style.display = guiWrapper.style.display === "block" ? "none" : "block";
            } else if (((closeKey.ctrl && e.ctrlKey) || (!closeKey.ctrl && !e.ctrlKey)) && ((closeKey.shift && e.shiftKey) || (!closeKey.shift && !e.shiftKey)) && ((closeKey.alt && e.altKey) || (!closeKey.alt && !e.altKey)) && e.key.toLowerCase() == closeKey.key) {
                e.preventDefault();
                close();
            }
        }
        function createKeybindListener(onpress, element = window) {
            return new Promise(resolve => {
                const pressed = {};
                let shift, ctrl, alt, key;
                const keydown = e => {
                    e.preventDefault();
                    pressed[e.code] = true;
                    shift ||= e.shiftKey;
                    ctrl ||= e.ctrlKey;
                    alt ||= e.altKey;
                    if (!["shift", "control", "alt", "meta"].includes(e.key.toLowerCase())) key = e.key.toLowerCase();
                    onpress?.({ shift, ctrl, alt, key });
                };
                const keyup = e => {
                    delete pressed[e.code];
                    if (Object.keys(pressed).length > 0) return;
                    element.removeEventListener("keydown", keydown);
                    element.removeEventListener("keyup", keyup);
                    resolve({ shift, ctrl, alt, key });
                };
                element.addEventListener("keydown", keydown);
                element.addEventListener("keyup", keyup);
            });
        }
    });
    let img = new Image;
    img.src = "https://raw.githubusercontent.com/05Konz/Blooket-Cheats/main/autoupdate/timestamps/gui.png?" + Date.now();
    img.crossOrigin = "Anonymous";
    img.onload = function() {
        const c = document.createElement("canvas");
        const ctx = c.getContext("2d");
        ctx.drawImage(img, 0, 0, this.width, this.height);
        let { data } = ctx.getImageData(0, 0, this.width, this.height), decode = "", last;
        for (let i = 0; i < data.length; i += 4) {
            let char = String.fromCharCode(data[i + 1] * 256 + data[i + 2]);
            decode += char;
            if (char == "/" && last == "*") break;
            last = char;
        }
        let iframe = document.querySelector("iframe");
        let _, time = 1710881112502, error = "There was an error checking for script updates. Run cheat anyway?";
        try {
            [_, time, error] = decode.match(/LastUpdated: (.+?); ErrorMessage: "((.|\n)+?)"/);
        } catch (e) {}
        if (parseInt(time) <= 1710881112502 || iframe.contentWindow.confirm(error)) cheat();
    }
    img.onerror = img.onabort = () => {
        img.onerror = img.onabort = null;
        cheat();
        let iframe = document.querySelector("iframe");
        iframe.contentWindow.alert("It seems the GitHub is either blocked or down.\n\nIf it's NOT blocked, join the Discord server for updates\nhttps://discord.gg/jHjGrrdXP6")
    }
})();
#include <iostream>

using namespace std;
//Hierarchical inheritance
class Shape{
    
    public:
    double area(){
    return 0.0;
    }
    
    void displayShape(){
        cout<<"Generic Shape: ";
    }
};
//Derived REctangle Class From Shape Class
class Rectangle:public Shape{
    double width;
    double length;
    
    public:
    //You can write like this also:
    Rectangle(double w, double l){
        width = w;
        length = l;
    }
    //Both of them are same
    //Rectangle(double w, double l):width(w),length(l){
        
    //}
    double AreaRectangle(){
        return width * length;
    }
    void displayRectangleInfo(){
        displayShape();
        cout<<"Rectangle: \nLength = "<<length<<"\nwidth = "<<width<<"\nArea of Rectangle = "<<AreaRectangle()<<endl;
    }
};
//Second Derived Circle class from Shape class
class Circle:public Shape{
    
    double radius;
    
    public:
    Circle(double r):radius(r){
        
    }
    double AreaCircle(){
        return 3.14 * radius * radius;
    }
    void displayCircleInfo(){
        displayShape();
        cout<<"Circle: \nRadius = "<<radius<<"\nArea of Circle = "<<AreaCircle()<<endl;
    }
};
//Third Derived class from Shape
class Triangle:public Shape {
    
    double base;
    double heigth;
    
    public:
    Triangle(double b, double h):base(b),heigth(h){
        
    }
    double AreaTriangle(){
        return 0.5 * base * heigth;
    }
    void displayTriangleInfo(){
        displayShape();
        cout<<"Triangle: \nBase = "<<base<<"\nHeigth = "<<heigth<<"\nArea of Triangle = "<<AreaTriangle()<<endl;
    }
};

int main() {
    Rectangle rect(10.2, 20.2);
    rect.displayRectangleInfo();
    cout<<endl;
    Circle c(10);
    c.displayCircleInfo();
    cout<<endl;
    Triangle tri(10.2, 10.1);
    tri.displayTriangleInfo();

    return 0;
}
//OUTPUT:
Generic Shape: Rectangle: 
Length = 20.2
width = 10.2
Area of Rectangle = 206.04

Generic Shape: Circle: 
Radius = 10
Area of Circle = 314

Generic Shape: Triangle: 
Base = 10.2
Heigth = 10.1
Area of Triangle = 51.51
setTimeout(async () => {
    // Asynchronously fetch all necessary fields from Feathery
    const {
        bot_triggered,
        reliasure_age_group,
        reliasure_form_zip,
        reliasure_life_event,
        reliasure_insurance_use,
        reliasure_income,
        reliasure_gender,
        reliasure_dob_month,
        reliasure_dob_day,
        reliasure_dob_year,
        reliasure_fname,
        reliasure_lname,
        reliasure_street_address,
        reliasure_city,
        reliasure_state,
        reliasure_zip,
        reliasure_email,
        reliasure_phone,
        reliasure_aca,
        spiderscore,
        utm_source,
        zippopotamus_return,
        fbclid,
        good_lead,
        ipaddress,
        reliasure_edit_address,
        insurance_people,
        reliasure_apply,
        feathery_user_id,
        feathery_form_name
    } = await feathery.getFieldValues();

    if (bot_triggered === false) {
        const payload = {
            reliasure_age_group,
            reliasure_form_zip,
            reliasure_life_event,
            reliasure_insurance_use,
            reliasure_gender,
            reliasure_dob_month,
            reliasure_dob_day,
            reliasure_dob_year,
            reliasure_fname,
            reliasure_lname,
            reliasure_street_address,
            reliasure_city,
            reliasure_state,
            reliasure_zip,
            reliasure_email,
            reliasure_phone,
            reliasure_aca,
            spiderscore,
            utm_source,
            zippopotamus_return,
            fbclid,
            good_lead,
            ipaddress,
            reliasure_edit_address,
            insurance_people,
            reliasure_apply,
            feathery_user_id,
            feathery_form_name
        };

        // Update bot_triggered to true in Feathery to indicate the bot has been triggered
         feathery.setFieldValues({ bot_triggered: true });
        console.log("Triggering bot and setting bot_triggered to true");

        // Function to load URL in a hidden iframe
        const loadUrlInHiddenIframe = () => {
            const refValue = `WebsiteTraffic--${reliasure_fname}--770490--${reliasure_fname}--984184--${reliasure_lname}--658292--${reliasure_email}--578105--${reliasure_phone}--372998--${reliasure_aca}`;
            const iframeUrl = `https://app.strikedm.com/webchat/?p=1325191&ref=${refValue}`;

            const iframe = document.createElement('iframe');
            iframe.style.cssText = "width:0; height:0; border:0; opacity:0; position:absolute;";
            iframe.src = iframeUrl;

            document.body.appendChild(iframe);

            // Cleanup after 5 seconds
            setTimeout(() => document.body.removeChild(iframe), 5000);
        };

        // Call the function to load URL in hidden iframe
        loadUrlInHiddenIframe();
    } else {
        console.log("Bot has already been triggered");
    }
}, 5000); // Delay set for 5 seconds
## EXPIRES HEADER CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType image/svg "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType application/javascript "access 1 month"
ExpiresByType application/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
</IfModule>
## EXPIRES HEADER CACHING ##
#include<stdlib.h>
#include<sys/stat.h>
#include<sys/types.h>
#include <stdio.h>
int main(int argc,char *argv[])
{
    const char *p=argv[1];
    const char *f= argv[2];
    mode_t mode=strtol(p,NULL,8);
    if(chmod(f,mode)==-1)
    {
 
       perror("chmod");
       exit (EXIT_FAILURE);
}
   printf("perms are changed");
    return 0;
}
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include <dirent.h>
#include <pwd.h>
#include <grp.h>
#include <time.h>
#include <sys/stat.h>
#include <limits.h>

void print_permission(mode_t mode) {
    printf((S_ISDIR(mode)) ? "d" : "-");
    printf((mode & S_IRUSR) ? "r" : "-");
    printf((mode & S_IWUSR) ? "w" : "-");
    printf((mode & S_IXUSR) ? "x" : "-");
    printf((mode & S_IRGRP) ? "r" : "-");
    printf((mode & S_IWGRP) ? "w" : "-");
    printf((mode & S_IXGRP) ? "x" : "-");
    printf((mode & S_IROTH) ? "r" : "-");
    printf((mode & S_IWOTH) ? "w" : "-");
    printf((mode & S_IXOTH) ? "x" : "-");
}

void ls_l(const char *dirname) {
    DIR *dir;
    struct dirent *entry;
    struct stat file_stat;
    
    if ((dir = opendir(dirname)) == NULL) {
        perror("opendir");
        exit(EXIT_FAILURE);
    }
    
    while ((entry = readdir(dir)) != NULL) {
        char path[PATH_MAX];
        snprintf(path, PATH_MAX, "%s/%s", dirname, entry->d_name);
        if (stat(path, &file_stat) == -1) {
            perror("stat");
            exit(EXIT_FAILURE);
        }
        struct passwd *user_info = getpwuid(file_stat.st_uid);
        struct group *group_info = getgrgid(file_stat.st_gid);
        printf("%20s %-8s %-8s %lld ", entry->d_name, user_info->pw_name, group_info->gr_name, (long long)file_stat.st_size);
        print_permission(file_stat.st_mode);
        struct tm *time_info = localtime(&file_stat.st_mtime);
        char time_str[80];
        strftime(time_str, sizeof(time_str), "%b %d %H:%M", time_info);
        printf(" %s\n", time_str);
    }
    closedir(dir);
}

int main(int argc, char *argv[]) {
    ls_l(argv[1]);
    return 0;
}
function testBrackets(input) {
    let bracketsObj = {
        '{':'}',
        '[':']',
        '(': ')'
    }
    let bracketKeys = Object.keys(bracketsObj)
    
    const stack = []
    for(str of input){
        if (bracketKeys.includes(str)){
            stack.push(str)
        } else if (bracketsObj[stack.pop()] !== str){
            return false
        }
    }
    
    return stack.length == 0
}
//GenCode
	myList = {0,1,2,3,4,5,6,7,8,9,10};
	passString = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
	newList = "";
	//
	for each index i in myList
	{
		randnum = randomNumber(1,62);
		newList = newList + substring(passString,randnum,randnum + 1);
	}
	verify = replaceAll(newList,",","");
	input.GenCode = verify;
	//Send email
	sendmail
	[
		from :"noreply@podmanagement.co.uk"
		to :input.Email
		subject :"POD Management Work Order Master [Verification Code]"
		message :"<div>Please use the following code to access the report.</div><div><br></div><div><b><span class=\"size\" style=\"font-size: 18.666666666666664px\">" + verify + "<br></span></b><br></div><div><br></div><div><span class=\"size\" style=\"font-size: 13.333333333333332px\">Regards,</span><span class=\"size\" style=\"font-size: 13.333333333333332px\"><br></span></div><div><span class=\"size\" style=\"font-size: 13.333333333333332px\"><br></span></div><div><span class=\"size\" style=\"font-size: 13.333333333333332px\">POD Management Team​</span><br></div>"
	]


0:02 / 4:51


Pass the clap around the classroom: vocabulary game
Launch
(
"
https://cemex.sharepoint.com/sites/PowerPlatformQA-TID/_layouts/15/Versions.aspx?list=%7B00ef5105-28e2-4fa6-860b-b70c12277676%7D&ID="
&
ThisItem
.ID)
Launch("https://cemex.sharepoint.com/sites/PowerPlatformQA-TID/_layouts/15/Versions.aspx?list=%7B00ef5105-28e2-4fa6-860b-b70c12277676%7D&ID=" & ThisItem.ID)
public class NW_VendorHelper
{
    public static str CreateVendor(NW_VendorReg    VendorReg)
    {
        VendTable                    vendTable;
        NumberSeq                    numberSeq;
        Name                         name = VendorReg.CompanyName;
        NA_VendTableWF              NA_VendTableWF;
        DirParty                        dirParty;
        DirPartyTable                   dirPartyTable;
        DirPartyPostalAddressView       dirPartyPostalAddressView;
        DirPartyContactInfoView         dirPartyContactInfo, _dirPartyContactInfo;

        ContactPerson       contactPerson;
        ContactPersonSyncEntity contactPersonSyncEntity;
        NW_VendorRegContact NW_VendorRegContact;

        ;
        //container      conAttribute=["BusinessUnit","CostCenter","Department"];
        //container      conAttributeValue=["001","007","022"];
        /* Marks the beginning of a transaction.
        Necessary to utilize the method numRefCustAccount() */
       
        try
        {
            //vendTable
            ttsBegin;
            vendTable.initValue();
            vendTable.AccountNum    = NumberSeq::newGetNum(VendParameters::numRefVendAccount()).num();
            vendTable.TaxWithholdVendorType_TH  =VendorReg.CompanyType;
            
            if(VendorReg.CompanyType == TaxWithholdVendorType_TH::Domestic)
            {
                vendTable.CR=VendorReg.CRNumStr;
            }
               
            else if(VendorReg.CompanyType == TaxWithholdVendorType_TH::Individual)
            {
                vendTable.CR=int2Str(VendorReg.LicenseNumber);
            }
            if(VendorReg.CompanyType == TaxWithholdVendorType_TH::Foreign)
            {
              
                vendTable.CR=VendorReg.Tin;
            }

         
            vendTable.VATNumber     =VendorReg.VATNumStr;//int2Str(VendorReg.VATNumber);
            vendTable.VendGroup     = "Other Supp";
            vendTable.Currency      ='SAR';
            vendTable.PaymTermId    ='1 Day';
            vendTable.PaymMode      ='CHECK';
            vendTable.APIOfficialContactEmail      =VendorReg.OfficialContactEmail;
          // vendTable.WorkflowStateNew      = TradeWorkflowState::Completed;
            NA_VendTableWF.AccountNum=Vendtable.AccountNum;
            NA_VendTableWF.WorkflowStateNew= TradeWorkflowState::Completed;
            NA_VendTableWF.insert();
            //vendTable.DefaultDimension=DefaultDimesnionHelper::createDefaultDimension(conAttribute,conAttributeValue);
            vendTable.insert();
            NW_VendorRegContact = VendorReg.VendorRegContact();
            dirPartyTable = DirPartyTable::findRec(vendTable.Party,true);
            dirPartyTable.Name = name;
            dirPartyTable.DEL_FirstName = NW_VendorRegContact.ContactFirstName;
            dirPartyTable.DEL_MiddleName = NW_VendorRegContact.ContactLastName;
            dirPartyTable.DEL_LastName = NW_VendorRegContact.ContactLastName;
            //dirPartyTable.update();
            dirPartyTable.doUpdate();

            contactPersonSyncEntity = ContactPersonSyncEntity::construct(contactPerson);

            contactPersonSyncEntity.parmFirstName(NW_VendorRegContact.ContactFirstName);
            //contactPersonSyncEntity.parmMiddleName("");
            contactPersonSyncEntity.parmLastName(NW_VendorRegContact.ContactLastName);
            //contactPersonSyncEntity.parmLastNamePrefix("");
            contactPersonSyncEntity.parmContactForParty(dirPartyTable.RecId);
            contactPersonSyncEntity.parmSensitivity(smmSensitivity::Personal);
            contactPersonSyncEntity.write();
            //DirParty
            /* Creates a new instance of the DirParty class from an address book entity
            that is represented by the custTable parameter. */
            dirParty = DirParty::constructFromCommon(vendTable);
            dirPartyPostalAddressView.LocationName      = VendorReg.AddressName;
            dirPartyPostalAddressView.City              = VendorReg.City;
            dirPartyPostalAddressView.Street            = VendorReg.StreetName;
            //dirPartyPostalAddressView.StreetNumber      = '18';
            dirPartyPostalAddressView.CountryRegionId   = VendorReg.Country;
            dirPartyPostalAddressView.ZipCode           = VendorReg.ZipPostalCode;
            dirPartyPostalAddressView.DistrictName      = VendorReg.District;
            dirPartyPostalAddressView.BuildingCompliment = VendorReg.BuildingNo;
            dirPartyPostalAddressView.Building_RU = VendorReg.BuildingNo;
            //dirPartyPostalAddressView.State             = VendorReg;
            dirPartyPostalAddressView.IsPrimary         = NoYes::Yes;
            // Fill address
            dirParty.createOrUpdatePostalAddress(dirPartyPostalAddressView);

            dirPartyContactInfo.LocationName    ='Email Address';
            dirPartyContactInfo.Locator         =VendorReg.OffcialCompanyEmail;
            dirPartyContactInfo.Type            = LogisticsElectronicAddressMethodType::Email;
            dirPartyContactInfo.IsPrimary       = NoYes::Yes;
            // Fill Contacts
            dirParty.createOrUpdateContactInfo(dirPartyContactInfo);

            _dirPartyContactInfo.LocationName    ='Email Address ';
            _dirPartyContactInfo.Locator         =VendorReg.OffcialCompanyEmail;
            _dirPartyContactInfo.Type            = LogisticsElectronicAddressMethodType::Email;
            _dirPartyContactInfo.IsPrimary       = NoYes::Yes;
            contactPersonSyncEntity.createOrUpdateContactInfo(_dirPartyContactInfo);

            dirPartyContactInfo.clear();
            _dirPartyContactInfo.clear();

            dirPartyContactInfo.LocationName    ='Mobile Number';
            dirPartyContactInfo.Locator         =VendorReg.MobileNumber;
            dirPartyContactInfo.Type            = LogisticsElectronicAddressMethodType::Phone;
            dirPartyContactInfo.IsPrimary       = NoYes::Yes;
            // Fill Contacts
            dirParty.createOrUpdateContactInfo(dirPartyContactInfo);

            _dirPartyContactInfo.LocationName    ='Mobile Number ';
            _dirPartyContactInfo.Locator         =VendorReg.MobileNumber;
            _dirPartyContactInfo.Type            = LogisticsElectronicAddressMethodType::Phone;
            _dirPartyContactInfo.IsPrimary       = NoYes::Yes;
            contactPersonSyncEntity.createOrUpdateContactInfo(_dirPartyContactInfo);
            // Marks the end of transaction.

            vendTable.ContactPersonId = contactPerson.ContactPersonId;
            vendTable.update();
           

         
            VendVendorBankAccountEntity VVBE;
            VVBE.VendorAccountNumber = Vendtable.AccountNum;
            VVBE.BankName = VendorReg.BankName;
            VVBE.name=VendorReg.BankName;
            VVBE.AddressCountry = VendorReg.BankCounty;
            VVBE.AddressCity = VendorReg.BankCity;
            VVBE.AddressPostBox = VendorReg.BankPostBox;
            VVBE.AddressStreet = VendorReg.BankStreet ;//+" " + VendorReg.BankOther;
            VVBE.AddressDistrictName = VendorReg.BankDistrictName;
            if(VendorReg.SWIFTCode!="")
            {
                VVBE.BankGroupId = VendorReg.SWIFTCode;
            }
            VVBE.IBAN = VendorReg.IBAN;
            VVBE.addresstype = VendorReg.BankAddressType;
            VVBE.AddressDescription=VendorReg.BankAddressName;
            VVBE.AddressBuildingCompliment = VendorReg.BankBuildingNumber;
            VVBE.BankAccountNumber = VendorReg.AccountNum;
            VVBE.AddressZipCode = VendorReg.BankZipCode;
            VVBE.BeneficaryBankNb=VendorReg.IBAN;
           // VVBE.CurrentCurrencyCode=vr.CurrencyCode;
            VVBE.WorkflowState=VendBankAccountChangeProposalWorkflowState::Approved;
            
            VVBE.insert();
        

            if(VendorReg.BankAccountDetailsStr && VendorReg.BankAccountDetailsName)
            {
                NW_AttachmentAPIHelper::AttachFileFromAPI(VendorReg.BankAccountDetailsName, VendorReg.BankAccountDetailsStr, tableNum(VendBankAccount) , VVBE.RecId);
            }

            if(VendorReg.VatCertificateStr && VendorReg.VatCertificateName )
            {
                NW_AttachmentAPIHelper::AttachFileFromAPI(VendorReg.VatCertificateName, VendorReg.VatCertificateStr, tableNum(VendTable) , Vendtable.RecId);
            }

            if(VendorReg.CompanyRegDocumentStr && VendorReg.CompanyRegDocumentName)
            {
                NW_AttachmentAPIHelper::AttachFileFromAPI(VendorReg.CompanyRegDocumentName, VendorReg.CompanyRegDocumentStr,  tableNum(VendTable),  Vendtable.RecId);
            }

          
            if(VendorReg.OtherStr && VendorReg.OtherName)
            {
                NW_AttachmentAPIHelper::AttachFileFromAPI(VendorReg.OtherName , VendorReg.OtherStr,  tableNum(VendTable) ,  Vendtable.RecId);
            }

            ttsCommit;
            return vendTable.AccountNum;
        }
        catch(Exception::Error)
        {
            ttsAbort;
            throw Exception::Error;
        }
    }

}
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>

int main() {
    int fd[2];
    char string[] = "welcome", b[80];
    pipe(fd);
    if (fork() == 0) {
        write(fd[1], string, strlen(string));
    } else {
        read(fd[0], b, sizeof(b));
        printf("received string: %s\n", b);
    }
    return 0;
}
#include<stdio.h>
#include<unistd.h>
#include<sys/types.h>
#include<string.h>
#include<stdlib.h>
int main(){
   int fd[2],x;
   pid_t pid;
   char string[]="welcome";
   char b[80];
   pipe(fd);
   pid=fork();
   if(pid==0){
   close(fd[0]);
   write(fd[1],string,(strlen(string)+1));
   exit(0);
   }
   else{
     close(fd[1]);
     x=read(fd[0],b,sizeof(b));
     printf("received string:%s",b);
     }
     return 0;
     }
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<sys/types.h>
#include<fcntl.h>
#include<string.h>


int main(){


char string[]="welcome";
char b[80];
int fd[2],x;
pid_t pid;
 
pipe(fd);

pid=fork();

if(pid==0){
close(fd[0]);
		write(fd[1],string,strlen(string)+1);
		
		
		
		

}else{
	close(fd[1]);
	x=read(fd[0],b,sizeof(b));
	printf("received string is %s",b);
	
}



return 0;
}
// change the account input element to "type=password" to hide the value
cy.get('#account-id').invoke('attr', 'type', 'password')
// now take the screenshot
cy.get('#account').screenshot('account', {
  overwrite: true,
})
#include<stdio.h>

int main() {


  int p, c, count = 0, i, j, alc[5][3], max[5][3], need[5][3], safe[5], available[3], done[5], terminate = 0;
  printf("Enter the number of process and resources");
  scanf("%d %d", & p, & c);
 
 
  printf("enter allocation of resource of all process %dx%d matrix", p, c);
  for (i = 0; i < p; i++) {
    for (j = 0; j < c; j++) {
      scanf("%d", & alc[i][j]);
    }
  }
  
  
  printf("enter the max resource process required %dx%d matrix", p, c);
  for (i = 0; i < p; i++) {
    for (j = 0; j < c; j++) {
      scanf("%d", & max[i][j]);
    }
  }
  
  
  printf("enter the  available resource");
  for (i = 0; i < c; i++)
    scanf("%d", & available[i]);

  printf("\n need resources matrix are\n");
  for (i = 0; i < p; i++) {
    for (j = 0; j < c; j++) {
      need[i][j] = max[i][j] - alc[i][j];
      printf("%d\t", need[i][j]);
    }
    printf("\n");
  }
  
  
  
  for (i = 0; i < p; i++) {
    done[i] = 0;
  }
  while (count < p) {
    for (i = 0; i < p; i++) {
      if (done[i] == 0) {
        for (j = 0; j < c; j++) {
          if (need[i][j] > available[j])
            break;
        }
       
       
        if (j == c) {
          safe[count] = i;
          done[i] = 1;
        
        
          for (j = 0; j < c; j++) {
            available[j] += alc[i][j];
          }
          count++;
          terminate = 0;
        } else {
          terminate++;
        }
      }
    }
    if (terminate == (p - 1)) {
      printf("safe sequence does not exist");
      break;
    }

  }
  if (terminate != (p - 1)) {
    printf("\n available resource after completion\n");
    for (i = 0; i < c; i++) {
      printf("%d\t", available[i]);
    }
    printf("\n safe sequence are\n");
    for (i = 0; i < p; i++) {
      printf("p%d\t", safe[i]);
    }
  }

  return 0;
}
#include<stdio.h>

int main() {
  /* array will store at most 5 process with 3 resoures if your process or
  resources is greater than 5 and 3 then increase the size of array */
  int p, c, count = 0, i, j, alc[5][3], max[5][3], need[5][3], safe[5], available[3], done[5], terminate = 0;
  printf("Enter the number of process and resources");
  scanf("%d %d", & p, & c);
  // p is process and c is diffrent resources
  printf("enter allocation of resource of all process %dx%d matrix", p, c);
  for (i = 0; i < p; i++) {
    for (j = 0; j < c; j++) {
      scanf("%d", & alc[i][j]);
    }
  }
  printf("enter the max resource process required %dx%d matrix", p, c);
  for (i = 0; i < p; i++) {
    for (j = 0; j < c; j++) {
      scanf("%d", & max[i][j]);
    }
  }
  printf("enter the  available resource");
  for (i = 0; i < c; i++)
    scanf("%d", & available[i]);

  printf("\n need resources matrix are\n");
  for (i = 0; i < p; i++) {
    for (j = 0; j < c; j++) {
      need[i][j] = max[i][j] - alc[i][j];
      printf("%d\t", need[i][j]);
    }
    printf("\n");
  }
  /* once process execute variable done will stop them for again execution */
  for (i = 0; i < p; i++) {
    done[i] = 0;
  }
  while (count < p) {
    for (i = 0; i < p; i++) {
      if (done[i] == 0) {
        for (j = 0; j < c; j++) {
          if (need[i][j] > available[j])
            break;
        }
        //when need matrix is not greater then available matrix then if j==c will true
        if (j == c) {
          safe[count] = i;
          done[i] = 1;
          /* now process get execute release the resources and add them in available resources */
          for (j = 0; j < c; j++) {
            available[j] += alc[i][j];
          }
          count++;
          terminate = 0;
        } else {
          terminate++;
        }
      }
    }
    if (terminate == (p - 1)) {
      printf("safe sequence does not exist");
      break;
    }

  }
  if (terminate != (p - 1)) {
    printf("\n available resource after completion\n");
    for (i = 0; i < c; i++) {
      printf("%d\t", available[i]);
    }
    printf("\n safe sequence are\n");
    for (i = 0; i < p; i++) {
      printf("p%d\t", safe[i]);
    }
  }

  return 0;
}
.gfield-choice-input {
      opacity: 0;
      position: absolute;
   // top: 50% !important;
   // transform: translateY(-50%);

      &:checked+label {
        background: $primary;
        color: $white;
      }
    }

    .gchoice {
      input:checked+label {
        &:before {
          filter: brightness(5);
        }
      }
    }
<?php echo do_shortcode('[gravityform id="1" title="false" ajax="true"]') ?>
// Replace 'YOUR_FORM_ID' with the ID of your Google Form
var form = FormApp.openById('1anUG2PmvXTIec9QycnZXEWFhDW8sAeDBgnQu9mefdo4');

// Load submission counter from Script Properties
var scriptProperties = PropertiesService.getScriptProperties();
var submissionCounter = parseInt(scriptProperties.getProperty('submissionCounter')) || 0;

function onFormSubmit(e) {
  var response = e.response;
  var itemResponses = response.getItemResponses();
  var recipientEmail = '';
  var ccEmails = {}; // Object to store CC email addresses for each location
  var generateSerialNumber = true; // Default to true, assuming serial number should be generated
  var fileIds = []; // Initialize array to store file IDs
  
  // Check the response for the specific question that determines whether to generate a serial number or not
  for (var i = 0; i < itemResponses.length; i++) {
    var itemResponse = itemResponses[i];
    if (itemResponse.getItem().getTitle() === 'FORM SUBMISSION TYPE') { // Adjust this to the title of the question that determines HR type
      if (itemResponse.getResponse() === 'CORPORATE HR') {
        generateSerialNumber = false; // If Corporate HR is selected, do not generate serial number
      }
    }
    if (itemResponse.getItem().getTitle() === 'TICKETS  OR DOCUMENTS') { // Adjust this to the title of the file upload question
      fileIds.push(itemResponse.getResponse()); // Get the file ID of the uploaded file
    }
  }
  
  // Incrementing the submission counter if needed
  if (generateSerialNumber) {
    submissionCounter++;
  }
  
  // Extracting the form data and formatting as HTML table
  var formData = '<table border="1">';
  
  // Adding serial number to the table if needed
  if (generateSerialNumber) {
    formData += '<tr><td><strong>Serial Number</strong></td><td>' + submissionCounter + '</td></tr>';
  }
  
  for (var i = 0; i < itemResponses.length; i++) {
    var itemResponse = itemResponses[i];
    formData += '<tr><td><strong>' + itemResponse.getItem().getTitle() + '</strong></td><td>' + itemResponse.getResponse() + '</td></tr>';
    if (itemResponse.getItem().getTitle() === 'EMAIL OF THE EMPLOYEE') { // Change 'Email Address' to the title of your email question
      recipientEmail = itemResponse.getResponse();
    }
    // Check if the question is the location question
    if (itemResponse.getItem().getTitle() === 'SELECT UNIT') { // Adjust this to the title of your location question
      var selectedLocations = itemResponse.getResponse().split(', ');
      // Loop through selected locations
      for (var j = 0; j < selectedLocations.length; j++) {
        var location = selectedLocations[j];
        // Add email addresses to the ccEmails object based on the selected location
        switch (location) {
          case 'Binola':
            ccEmails['Binola'] = 'ashwani.kumar1@meenakshipolymers.com'; // Replace with actual email address
            break;
          case 'Binola-II':
            ccEmails['Binola-II'] = 'neemrana@example.com'; // Replace with actual email address
            break;
          case 'Corporate':
            ccEmails['Corporate'] = 'gurgaon@example.com'; // Replace with actual email address
            break;
          case 'Dadri':
            ccEmails['Dadri'] = 'manesar@example.com'; // Replace with actual email address
            break;
          case 'Haridwar I':
            ccEmails['Haridwar I'] = 'hrdp14@example.com'; // Replace with actual email address
            break;
          case 'Haridwar II':
            ccEmails['Haridwar II'] = 'hrdp14@example.com'; // Replace with actual email address
            break;
          case 'Kadi':
            ccEmails['Kadi'] = 'hrdp14@example.com'; // Replace with actual email address
            break;
          case 'Karol Bagh':
            ccEmails['Karol Bagh'] = 'hrdp14@example.com'; // Replace with actual email address
            break;
          case 'Manesar':
            ccEmails['Manesar'] = 'hrdp14@example.com'; // Replace with actual email address
            break;
          case 'Neemrana':
            ccEmails['Neemrana'] = 'hrdp14@example.com'; // Replace with actual email address
            break;          
          default:
            break;
        }
      }
    }
  }
  formData += '</table>';
  
  if (recipientEmail !== '') {
    // Formatting the email content in HTML
    var htmlBody = '<html><body>';
    htmlBody += '<h1>New Form Submission</h1>';
    htmlBody += formData;
    if (fileIds.length > 0 && !generateSerialNumber) { // Include file download links if uploaded by Corporate HR
      htmlBody += '<p>Download Tickets/Documents:</p>';
      for (var k = 0; k < fileIds.length; k++) {
        var downloadUrl = getDownloadUrl(fileIds[k]);
        htmlBody += '<p><a href="' + downloadUrl + '">File ' + (k + 1) + '</a></p>';
      }
    }
    htmlBody += '</body></html>';
    
    // Subject with serial number if generated
    var subject = generateSerialNumber ? 'New Form Submission - Serial Number: ' + submissionCounter : 'New Form Submission';
    
    // Sending the email to the primary recipient
    MailApp.sendEmail({
      to: recipientEmail,
      subject: subject,
      htmlBody: htmlBody
    });

    // Sending CC emails
    for (var location in ccEmails) {
      MailApp.sendEmail({
        to: ccEmails[location],
        subject: subject,
        htmlBody: htmlBody
      });
    }
  }
  
  // Store updated submissionCounter in Script Properties if needed
  if (generateSerialNumber) {
    scriptProperties.setProperty('submissionCounter', submissionCounter);
  }
}

// Function to get download URL of a file from Google Drive
function getDownloadUrl(fileId) {
  var file = DriveApp.getFileById(fileId);
  return file.getDownloadUrl();
}

// Install a trigger to run on form submission
function installTrigger() {
  ScriptApp.newTrigger('onFormSubmit')
      .forForm(form)
      .onFormSubmit()
      .create();
}
#include <stdio.h>

int main() {
    char ch;
    int vowelCount = 0;

    printf("Enter a stream of characters:\n");

    while ((ch = getchar()) != '\n') {
        if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' ||
            ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U') {
            vowelCount++;
        }
    }

    printf("Number of vowels: %d\n", vowelCount);

    return 0;
}
#include <stdio.h>
#include <ctype.h>
 
int main() {
    char c;
    int vowels=0, consonant=0;
    puts("Enter a stream of characters:");
    
    while((c=getchar())!='\n')
    {
    if(isalpha(c))
    {
        if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u'||c=='A'||c=='E'||c=='I'||c=='O'||c=='U')
        vowels++;
        else
        consonant++;
    }
    
    
 
    }
    printf("Vowels: %d\n", vowels);
    printf("Consonant: %d", consonant);
    
    return 0;
}
#include <stdio.h>
#include <ctype.h>
 
int main()
{
    char c;
    puts("Enter a stream of characters:");
    
while((c=getchar())!='\n')
{
    if(isalpha(c))
    putchar(c);
}
    return 0;
}
#include <stdio.h>
#include <ctype.h>
 
int main()
{
    char c;
    puts("Enter a stream of characters:");
    
while((c=getchar())!='\n')
{
    if(isalpha(c))
    putchar(c);
}
    return 0;
}
// Mobile Header
.xd-mobile-header1 {
    /* ==== VARIABLES SECTION ==== */
    /*  The below code is all using the variables from _variables.scss
    Any changes to the site variables should be reflected automatically
    without requiring changing any custom code here */
    background: $header-bgcolor;
    .menu-bar {
        background: $primenav-bgcolor;
        border-top: $primenav-topborder;
        border-bottom: $primenav-btmborder;
        .fa {
            color: $primenav-mobile-iconcolor;
        }
        .icon-bar {
            background-color: $primenav-mobile-iconcolor;
        }
    }
    .PrimaryNavigation_1-0-0 {
        ul.nav {
            .root-link {
                color: $primenav-mobile-linkcolor !important;
                font-size: $primenav-mobile-fontsize !important;
            }
            .dropdown-menu {
                .dropdown {
                    .dropdown-link {
                        color: $primenav-mobile-linkcolor;
                        font-size: $primenav-mobile-dropdown-fontsize;
                        @if ($primenav-mobile-dropdownicon-display) {
                            &:before {
                                content: "#{$primenav-mobile-dropdownicon}";
                                font-family: "FontAwesome";
                            }
                        }
                        &:hover, &:focus{
                            background-color: transparent;
                        }
                    }
                }
            }
        }
    }
    /* ==== END VARIABLES SECTION ==== */
    /* ==== BASIC STYLES ==== */
    /*  This code is just some basic styling to format the header as shown in the XD UI kit.
        You shouldn't have to edit this code too much, but this code can be adjusted as needed.*/
    margin: 0;
    >.ari-column {
        padding: {
            left: 0;
            right: 0;
        };
    }
    .logo {
        margin: 20px 10px;
    }
    .xd1-mobile-search {
        padding: {
            left: 15px;
            right: 15px;
        };
        .SearchBar_1-0-0 {
            margin: 10px 0;
        }
    }
    .menu-bar {
        margin: 0;
        padding: 5px 0;
        .ari-col-xs-6 {
            display: flex;
            align-items: center;
            &.menu-bar-left {
                justify-content: flex-start;
            }
            &.menu-bar-right {
                justify-content: flex-end;
                .navbar-toggle {
                    margin: 0;
                    padding: 0;
                    overflow: visible;
                    &:not(.collapsed) {
                        .fa:before{ content: "\f00d"; }
                    }
                }
            }
        }
        .search-btn{
            a.collapsed{
                .fa-search:before{
                    content: "\f00d" !important;
                }
            }
        } 
    }
    .xd1-mobile-nav {
        padding: 0 15px;
        .navbar-header {
            display: none;
        }
        .navbar-collapse {
            display: block !important;
            .nav>li.dropdown .dropdown-menu .dropdown-link{
            	color: #fff;
            }
        }
    }
    /* ==== END BASIC STYLES ==== */
}
#include <stdio.h>
#include <ctype.h>
int counta, counte, counti, counto, countu, countvowel, countconsonant;

int main()
{
    char c;
    
    printf("Input A string of characters: ");
    while ((c=getchar()) != '\n')

    if (c == 'a' || c == 'A' || c == 'e' || c == 'E' || c == 'i' || c == 'I' || c == 'o' || c == 'O' || c == 'u' || c == 'U') { 
        countvowel++;
    } else 
    countconsonant++;
    
    printf("vowels = %d \n", countvowel);
    printf("consonants = %d \n", countconsonant);

    return (0);
}
#include <stdio.h>
#include <ctype.h>

int main()
{
    char c;
    
    printf("Input A string of characters: ");
    while ((c=getchar()) != '\n')
    
    if (isalnum(c)) {
        putchar(c);
    } else
    if (ispunct(c)) {
        putchar(c);
    }
    return 0;
}
/******************************************************************************

create a program that will accept a stream of characters 
and will display the count of the vowels and consonant

*******************************************************************************/
#include <stdio.h>
#include <ctype.h>
int counta, counte, counti, counto, countu;

int main()
{
    char c;
    
    printf("Input A string of characters: ");
    while ((c=getchar()) != '\n')

    if (c == 'a' || c == 'A') { 
        counta++;
    } else
        if (c == 'e' || c == 'E') { 
        counte++;

    } else
        if (c == 'i' || c == 'I') { 
        counti++;
    } else
        if (c == 'o' || c == 'O') { 
        counto++;
    } else
        if (c == 'u' || c == 'U') { 
        countu++;
    }
    
    printf("a = %d \n", counta);
    printf("e = %d \n", counte);
    printf("i = %d \n", counti);
    printf("o = %d \n", counto);
    printf("u = %d \n", countu);

}
#include <stdio.h>
#include <ctype.h>

int main() {
    char c;
    int a=0, e=0, i=0, o=0, u=0;
    puts("Enter a stream of characters:");
    
    while((c=getchar())!='\n')
    {
    switch(c)
    {
    case 'a':
    case 'A':a++; break;
    case'e':
    case'E':e++; break;
    case 'i':
    case 'I':i++; break;
    case 'o':
    case 'O':o++; break;
    case 'u':
    case 'U':u++; break;
    }
    
    }

    printf("A=%d\n", a);
    printf("E=%d\n", e);
    printf("I=%d\n", i);
    printf("O=%d\n", o);
    printf("U=%d\n", u);
    return 0;
}
include <stdio.h> 

  

int main() 

{ 

    int array[3][4]; 

    int r, c, total, smallest, largest; 

    float ave; 

     

    printf ("Enter 12 Integers: "); 

     

    //input Integers 

    for (r=0;r<=2;r++)  

        for (c=0;c<=3;c++) { 

         scanf ("%d", &array[r][c]);    

        } 

     

    //print 12 Integers 

    printf ("The numbers inputted are: "); 

    for (r=0;r<=2;r++)  

        for (c=0;c<=3;c++) { 

         printf ("%d ", array[r][c]);    

        } 

     

    //print 12 Integers 

    printf ("\nThe numbers in reverse are: "); 

    for (r=2;r>=0;r--) 

        for (c=3;c>=0;c--) { 

         printf ("%d ", array[r][c]);    

        } 

     

    //odd 

    printf ("\nThe odd numbers are: "); 

    for (r=0;r<=2;r++)  

        for (c=0;c<=3;c++) { 

         if (array[r][c]%2==1) 

         printf ("%d ", array[r][c]);    

        } 

     

    //even 

    printf ("\nThe even numbers are: "); 

    for (r=0;r<=2;r++)  

        for (c=0;c<=3;c++) { 

         if (array[r][c]%2==0) 

         printf ("%d ", array[r][c]);    

        } 

     

    //total 

    printf ("\nSum: "); 

    for (r=0;r<=2;r++) { 

        for (c=0;c<=3;c++) { 

        total=total+array[r][c]; 

        } 

    }   

    printf ("%d", total); 

     

    //average 

    printf ("\nAverage: "); 

    ave=total/12; 

    printf ("%.2f", ave); 

     

    smallest = largest = array[0][0]; 

     

    //Smallest and largest 

    for (int r=0;r<=2;r++) { 

        for (c=0;c<=3;c++) { 

         if (array[r][c]<smallest) { 

            smallest = array[r][c]; 

         } 

        if (array[r][c]>largest) { 

            largest = array[r][c]; 

         } 

        }} 

         

    printf ("\nThe smallest is: %d", smallest); 

    printf ("\nThe largest is: %d", largest); 

     

    //nalito ako sa number 8 kasi two dimensional toh pero sige 

    float a2[3][4]; 

     

    printf ("\nThe 2nd array contains: "); 

    for (r=0;r<=2;r++)  

        for (c=0;c<=3;c++) { 

         

        a2[r][c]=array[r][c]; 

        printf ("%.0f ", a2[r][c]); 

         

        } 

    return 0; 

}   

 
star

Thu May 09 2024 10:01:04 GMT+0000 (Coordinated Universal Time)

@meanaspotato #c

star

Thu May 09 2024 07:49:23 GMT+0000 (Coordinated Universal Time)

@ngoctran #javascript

star

Thu May 09 2024 07:20:54 GMT+0000 (Coordinated Universal Time)

@divyasoni23 #css

star

Thu May 09 2024 05:25:25 GMT+0000 (Coordinated Universal Time) https://drupal.stackexchange.com/questions/255497/how-do-i-invalidate-the-cache-of-an-entity

@al.thedigital #invalidate #node #cache

star

Thu May 09 2024 04:45:56 GMT+0000 (Coordinated Universal Time)

@cms

star

Thu May 09 2024 04:28:37 GMT+0000 (Coordinated Universal Time) https://www.youtube.com/watch?v

@Mariukas45

star

Thu May 09 2024 04:24:55 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/5601931/how-do-i-safely-merge-a-git-branch-into-master

@al.thedigital #git #merge #safely #featuretomaster

star

Thu May 09 2024 00:57:14 GMT+0000 (Coordinated Universal Time)

@Mohamedshariif #c++

star

Wed May 08 2024 21:58:49 GMT+0000 (Coordinated Universal Time)

@Mohamedshariif #c++

star

Wed May 08 2024 21:55:59 GMT+0000 (Coordinated Universal Time) https://g-ek.com/papki-etot-kompyuter-windows-10

@qwdixq

star

Wed May 08 2024 21:55:31 GMT+0000 (Coordinated Universal Time) https://g-ek.com/papki-etot-kompyuter-windows-10

@qwdixq

star

Wed May 08 2024 21:50:39 GMT+0000 (Coordinated Universal Time) https://g-ek.com/papki-etot-kompyuter-windows-10

@qwdixq

star

Wed May 08 2024 21:22:18 GMT+0000 (Coordinated Universal Time) https://app.dhiwise.com/application/663baeaf5db33e0023ddcb7f

@Helda123

star

Wed May 08 2024 21:21:20 GMT+0000 (Coordinated Universal Time) undefined

@Helda123

star

Wed May 08 2024 20:58:43 GMT+0000 (Coordinated Universal Time)

@Mohamedshariif #c++

star

Wed May 08 2024 20:23:44 GMT+0000 (Coordinated Universal Time) https://gitlab.com/blooket/blooket-cheats/-/blob/main/cheats/gui.js?ref_type

@jkoonce

star

Wed May 08 2024 20:20:56 GMT+0000 (Coordinated Universal Time)

@Mohamedshariif #c++

star

Wed May 08 2024 19:11:38 GMT+0000 (Coordinated Universal Time) https://mapsplatform.google.com/

@uvacoder

star

Wed May 08 2024 19:09:31 GMT+0000 (Coordinated Universal Time) https://GitHub.com

@uvacoder

star

Wed May 08 2024 18:00:19 GMT+0000 (Coordinated Universal Time)

@nikanika4425

star

Wed May 08 2024 16:49:02 GMT+0000 (Coordinated Universal Time) https://kinsta.com/it/knowledgebase/aggiungere-gli-header-expires-in-wordpress/

@mraimondi3

star

Wed May 08 2024 16:46:18 GMT+0000 (Coordinated Universal Time)

@signup

star

Wed May 08 2024 16:37:02 GMT+0000 (Coordinated Universal Time)

@signup

star

Wed May 08 2024 15:47:05 GMT+0000 (Coordinated Universal Time)

@sooraz3871 #javascript

star

Wed May 08 2024 13:40:02 GMT+0000 (Coordinated Universal Time)

@nishpod

star

Wed May 08 2024 12:55:52 GMT+0000 (Coordinated Universal Time) https://www.youtube.com/watch?v

@Mariukas45

star

Wed May 08 2024 12:34:15 GMT+0000 (Coordinated Universal Time)

@eguajardo

star

Wed May 08 2024 12:31:04 GMT+0000 (Coordinated Universal Time)

@Jotab

star

Wed May 08 2024 12:02:19 GMT+0000 (Coordinated Universal Time)

@MinaTimo

star

Wed May 08 2024 11:31:43 GMT+0000 (Coordinated Universal Time) https://tailwindcss.com/docs/guides/symfony

@TheLands

star

Wed May 08 2024 09:38:17 GMT+0000 (Coordinated Universal Time)

@login123

star

Wed May 08 2024 09:26:29 GMT+0000 (Coordinated Universal Time)

@signup

star

Wed May 08 2024 09:06:34 GMT+0000 (Coordinated Universal Time)

@signup

star

Wed May 08 2024 08:48:59 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/48915773/cypress-test-if-element-does-not-exist

@al.thedigital #shouldnot #notexist

star

Wed May 08 2024 08:41:45 GMT+0000 (Coordinated Universal Time) https://glebbahmutov.com/cypress-examples/recipes/hide-input-fields.html

@al.thedigital #javascript

star

Wed May 08 2024 08:40:48 GMT+0000 (Coordinated Universal Time)

@login123

star

Wed May 08 2024 08:32:01 GMT+0000 (Coordinated Universal Time)

@signup

star

Wed May 08 2024 07:48:56 GMT+0000 (Coordinated Universal Time)

@divyasoni23 #css

star

Wed May 08 2024 07:05:46 GMT+0000 (Coordinated Universal Time)

@divyasoni23 #php

star

Wed May 08 2024 06:58:18 GMT+0000 (Coordinated Universal Time)

@ash1i

star

Wed May 08 2024 04:31:26 GMT+0000 (Coordinated Universal Time)

@vishalsingh21

star

Wed May 08 2024 04:12:48 GMT+0000 (Coordinated Universal Time)

@Saging

star

Wed May 08 2024 04:12:12 GMT+0000 (Coordinated Universal Time)

@Saging

star

Wed May 08 2024 04:11:46 GMT+0000 (Coordinated Universal Time)

@Saging

star

Wed May 08 2024 03:49:08 GMT+0000 (Coordinated Universal Time)

@kervinandy123 #c

star

Wed May 08 2024 03:42:30 GMT+0000 (Coordinated Universal Time)

@Saging

Save snippets that work with our extensions

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