Snippets Collections
.model small
.stack 100h
.data
   num1 db -128 ; The number to check
   positive db "The number is positive $"
   negative db "The number is negative $"
   zero db "The number is zero $"
.code
main:
   mov ax, @data
   mov ds, ax
   mov al, num1
   cmp al, 0
   jg greater
   jl lower
   je zeros

greater:
   mov ah, 09h
   lea dx, positive
   int 21h
   jmp end

lower:
   mov ah, 09h
   lea dx, negative
   int 21h 
   jmp end

zeros:
   mov ah, 09h
   lea dx, zero
   int 21h

end:
   mov ah, 4Ch
   int 21h
end main
title: "count no.of 1's"
.model small
.stack 100h
.data
   num1 db 05
   count db dup(0)
.code
   mov ax,@data
       mov ds,ax
       xor ax,ax
   mov al,num1
   mov cx,08
   mov bl,0 
   again: rol al,1
          jnc noadd
          inc bl
   noadd:loop again
         mov count,bl
mov ah,4ch
   int 21h
   end
   
title: "aaa"
.model small
.stack 100h
.data
   num1 db '9'
   num2 db '5'
   ascadj dw dup(0)
.code
   mov ax,@data
       mov ds,ax
       xor ax,ax
   mov al,num1
   add al,num2
   aaa
   mov ascadj,ax
   mov ah,4ch
       int 21h
end              
title: "daa"
.model small
.stack 100h
.data
   num1 dw 59h
   num2 dw 35h
   ascadj dw dup(0)
.code
   mov ax,@data
       mov ds,ax
       xor ax,ax
   mov ax,num1
   add ax,num2
   daa
   mov ascadj,ax
   mov ah,4ch
       int 21h
end         
title: "pack"
.model small
.stack 100h
.data
   num1 db 09h
   num2 db 05h
   pack db dup(0)
.code
   mov ax,@data
       mov ds,ax
       xor ax,ax
   mov al,num1
   mov bl,num2
   ror al,4
   or al,bl
   mov pack,al
   mov ah,4ch
       int 21h
end         
title:"aaa"
.model small
.stack 100h
.data
    num1 db '9'
    num2 db '5'
    ascadj dw dup(0)
.code
    mov ax,@data
    mov ds,ax
    xor ax,ax
    mov al,num1
    add al,num2
    aaa
    mov ascadj,ax
    mov ah,4ch
    int 21h
end
2------------------------------------------------------------------------------------
//BinarySearchTree.java
public class BinarySearchTree {
    public Node insertNode(Node root, int data) {
        if (root == null) {
            return new Node(data);
        }

        if (data < root.data) {
            root.left = insertNode(root.left, data);
        } else if (data > root.data) {
            root.right = insertNode(root.right, data);
        }

        return root;
    }

    public void display(Node root) {
        if (root != null) {
            display(root.left);
            System.out.print(root.data + " ");
            display(root.right);
        }
    }

    public int printAncestor(Node root, int element) {
        System.out.println("Ancestors of "+element+": ");
        return printAncestorHelper(root, element);
    }

    private int printAncestorHelper(Node root, int element) {
        if (root == null) {
            return 0;
        }

        if (root.data == element) {
            return 1;
        }

        if (printAncestorHelper(root.left, element) == 1 || printAncestorHelper(root.right, element) == 1) {
            System.out.print(root.data + " ");
            return 1;
        }

        return 0;
    }
}
// Main.java
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        BinarySearchTree bst = new BinarySearchTree();
        Node root = null;
        int choice;

        do {
            System.out.println("Binary Search Tree Implementation");
            System.out.println("1. Insert");
            System.out.println("2. Print ancestor");
            System.out.println("3. Display");
            System.out.println("4. Exit");
            System.out.println("Enter your choice: ");
            choice = scanner.nextInt();

            switch (choice) {
                case 1:
                    System.out.println("Enter the element to insert: ");
                    int elementToInsert = scanner.nextInt();
                    root = bst.insertNode(root, elementToInsert);
                    System.out.println("Element inserted successfully.");
                    break;
                case 2:
                    System.out.println("Enter the element to find its ancestor: ");
                    int elementToFindAncestor = scanner.nextInt();
                    bst.printAncestor(root, elementToFindAncestor);
                    System.out.println();
                    break;
                case 3:
                    if(root==null)
                        System.out.println("There are no elements in the BST. ");
                    else{
                        System.out.print("The elements are :");
                    bst.display(root);
                    }
                    break;
                case 4:
                    System.out.println("Exiting the program.");
                    break;
                default:
                    System.out.println("Invalid choice. Please try again.");
                    break;
            }
        } while (choice != 4);
    }
}

1-----------------------------------------------------------------------------------------------------------------------------------------------
public class BinaryTree {
 public void insert(TNode[] s, int num) {
        TNode newNode = new TNode(num);

        if (s[0] == null) {
            s[0] = newNode;
            return;
        }
        TNode root=s[0];
        while(root!=null){
            if(num > root.data){
                if(root.right==null){
                    root.right=newNode;
                    break;
                }
                root=root.right;
            }
            else{
                if(root.left==null){
                    root.left=newNode;
                    break;
                }
                root=root.left;
            }

        }
    }


    public void inorder(TNode s) {
        if (s != null) {
            inorder(s.left);
            System.out.print(s.data + " ");
            inorder(s.right);
        }
    }

    public int diameter(TNode tree) {
        if (tree == null) {
            return 0;
        }

        int leftHeight = height(tree.left);
        int rightHeight = height(tree.right);

        int leftDiameter = diameter(tree.left);
        int rightDiameter = diameter(tree.right);

        return max(leftHeight + rightHeight + 1, max(leftDiameter, rightDiameter));
    }

    public int height(TNode node) {
        if (node == null) {
            return 0;
        } else {
            int leftHeight = height(node.left);
            int rightHeight = height(node.right);

            return 1 + max(leftHeight, rightHeight);
        }
    }

    public int max(int a, int b) {
        return a > b ? a : b;
    }
}
class Client {
    private Integer clientId;
    private String clientName;
    private String phoneNumber;
    private String email;
    private String passport;
    private Country country;

    public Client() {
    }

    public Client(Integer clientId, String clientName, String phoneNumber, String email, String passport, Country country) {
        this.clientId = clientId;
        this.clientName = clientName;
        this.phoneNumber = phoneNumber;
        this.email = email;
        this.passport = passport;
        this.country = country;
    }

    // Getters and setters
    public Integer getClientId() {
        return clientId;
    }

    public void setClientId(Integer clientId) {
        this.clientId = clientId;
    }

    public String getClientName() {
        return clientName;
    }

    public void setClientName(String clientName) {
        this.clientName = clientName;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPassport() {
        return passport;
    }

    public void setPassport(String passport) {
        this.passport = passport;
    }

    public Country getCountry() {
        return country;
    }

    public void setCountry(Country country) {
        this.country = country;
    }

    @Override
    public String toString() {
        return String.format("%-25s %-25s %-25s %-25s %-25s %s", clientId, clientName, phoneNumber, email, passport, country);
    }
}

import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("Enter number of clients");
        int numClients = scanner.nextInt();
        scanner.nextLine(); // Consume newline
        Client[] clients = new Client[numClients];

        for (int i = 0; i < numClients; i++) {
            System.out.println("Enter client " + (i + 1) + " details:");
            System.out.println("Enter the client id");
            int clientId = scanner.nextInt();
            scanner.nextLine(); // Consume newline
            System.out.println("Enter the client name");
            String clientName = scanner.nextLine();
            System.out.println("Enter the phone number");
            String phoneNumber = scanner.nextLine();
            System.out.println("Enter the email id");
            String email = scanner.nextLine();
            System.out.println("Enter the passport number");
            String passport = scanner.nextLine();
            System.out.println("Enter the iata country code");
            String iataCountryCode = scanner.nextLine();
            System.out.println("Enter the country name");
            String countryName = scanner.nextLine();

            Country country = new Country(iataCountryCode, countryName);
            clients[i] = new Client(clientId, clientName, phoneNumber, email, passport, country);
        }

        ClientBO clientBO = new ClientBO();
        int choice;
        do {
            System.out.println("Menu:");
            System.out.println("1.View client details");
            System.out.println("2.Filter client with country");
            System.out.println("3.Exit");
            choice = scanner.nextInt();

            switch (choice) {
                case 1:
                    clientBO.viewDetails(clients);
                    break;
                case 2:
                    System.out.println("Enter country name");
                      scanner.nextLine();
                    String countryName = scanner.nextLine();
                    clientBO.printClientDetailsWithCountry(clients, countryName);
                    break;
                case 3:
                    break;
                default:
                    System.out.println("Invalid choice. Please enter again.");
            }
        } while (choice != 3);
    }
}

class Country {
    private String iataCountryCode;
    private String countryName;

    public Country() {
    }

    public Country(String iataCountryCode, String countryName) {
        this.iataCountryCode = iataCountryCode;
        this.countryName = countryName;
    }

    // Getters and setters
    public String getIataCountryCode() {
        return iataCountryCode;
    }

    public void setIataCountryCode(String iataCountryCode) {
        this.iataCountryCode = iataCountryCode;
    }

    public String getCountryName() {
        return countryName;
    }

    public void setCountryName(String countryName) {
        this.countryName = countryName;
    }

    @Override
    public String toString() {
        return String.format("%-25s %s\n", iataCountryCode, countryName);
    }
}

class ClientBO {
    public void viewDetails(Client[] clientList) {
        System.out.println("ClientId                  ClientName                PhoneNumber               Email                     Passport                  IATACountryCode           CountryName");
        for (Client client : clientList) {
            System.out.println(client);
        }
    }

    public void printClientDetailsWithCountry(Client[] clientList, String countryName) {
        System.out.println("ClientId                  ClientName                PhoneNumber               Email                     Passport                  IATACountryCode           CountryName");
        for (Client client : clientList) {
            if (client.getCountry().getCountryName().equalsIgnoreCase(countryName)) {
                System.out.println(client);
            }
        }
    }
}




//2-----------------------------------------------------------------------------------
// CountryBO.java
public class CountryBO {
    public Country createCountry(String data) {
        String[] parts = data.split(",");
        String iataCountryCode = parts[0];
        String countryName = parts[1];
        return new Country(iataCountryCode, countryName);
    }
}

// AirportBO.java
public class AirportBO {
    public Airport createAirport(String data, Country[] countryList) {
        String[] parts = data.split(",");
        String airportName = parts[0];
        String countryName = parts[1];
        Country country = null;
        for (Country c : countryList) {
            if (c.getCountryName().equals(countryName)) {
                country = c;
                break;
            }
        }
        return new Airport(airportName, country);
    }

    public String findCountryName(Airport[] airportList, String airportName) {
        for (Airport airport : airportList) {
            if (airport.getAirportName().equals(airportName)) {
                return airport.getCountry().getCountryName();
            }
        }
        return null;
    }

    public boolean findWhetherAirportsAreInSameCountry(Airport[] airportList, String airportName1, String airportName2) {
        String country1 = null;
        String country2 = null;
        for (Airport airport : airportList) {
            if (airport.getAirportName().equals(airportName1)) {
                country1 = airport.getCountry().getCountryName();
            }
            if (airport.getAirportName().equals(airportName2)) {
                country2 = airport.getCountry().getCountryName();
            }
        }
        return country1 != null && country2 != null && country1.equals(country2);
    }
}

// Airport.java
public class Airport {
    private String airportName;
    private Country country;

    public Airport() {
    }

    public Airport(String airportName, Country country) {
        this.airportName = airportName;
        this.country = country;
    }

    public String getAirportName() {
        return airportName;
    }

    public void setAirportName(String airportName) {
        this.airportName = airportName;
    }

    public Country getCountry() {
        return country;
    }

    public void setCountry(Country country) {
        this.country = country;
    }
}

// Main.java
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("Enter the country count");
        int countryCount = scanner.nextInt();
        scanner.nextLine(); // Consume newline
        Country[] countries = new Country[countryCount];

        CountryBO countryBO = new CountryBO();
        for (int i = 0; i < countryCount; i++) {
            System.out.println("Enter country " + (i + 1) + " details");
            String data = scanner.nextLine();
            countries[i] = countryBO.createCountry(data);
        }

        System.out.println("Enter the airport count");
        int airportCount = scanner.nextInt();
        scanner.nextLine(); // Consume newline
        Airport[] airports = new Airport[airportCount];

        AirportBO airportBO = new AirportBO();
        for (int i = 0; i < airportCount; i++) {
            System.out.println("Enter airport " + (i + 1) + " details");
            String data = scanner.nextLine();
            airports[i] = airportBO.createAirport(data, countries);
        }

        System.out.println("Enter the airport name for which you need to find the country name");
        String airportName = scanner.nextLine();
        String countryName = airportBO.findCountryName(airports, airportName);
        System.out.println(airportName + " belongs to " + countryName);

        System.out.println("Enter 2 airport names");
        String airportName1 = scanner.nextLine();
        String airportName2 = scanner.nextLine();
        boolean sameCountry = airportBO.findWhetherAirportsAreInSameCountry(airports, airportName1, airportName2);
        if (sameCountry) {
            System.out.println("The 2 airports are in the same Country");
        } else {
            System.out.println("The 2 airports are in the different Country");
        }
    }
}
// Country.java
public class Country {
    private String iataCountryCode;
    private String countryName;

    public Country() {
    }

    public Country(String iataCountryCode, String countryName) {
        this.iataCountryCode = iataCountryCode;
        this.countryName = countryName;
    }

    public String getIataCountryCode() {
        return iataCountryCode;
    }

    public void setIataCountryCode(String iataCountryCode) {
        this.iataCountryCode = iataCountryCode;
    }

    public String getCountryName() {
        return countryName;
    }

    public void setCountryName(String countryName) {
        this.countryName = countryName;
    }
}

import java.util.Scanner;

public class QuadraticProbing {

    public static int hashFunction(int key, int size) {
        return key % size;
    }

    public static void insert(int key, int[] hashTable, int size) {
        int index = hashFunction(key, size);
        if (hashTable[index] == -1) {
            hashTable[index] = key;
        } else {
            int i = 1;
            while (true) {
                int newIndex = (index + i * i) % size;
                if (hashTable[newIndex] == -1) {
                    hashTable[newIndex] = key;
                    break;
                }
                i++;
            }
        }
    }

    public static void display(int[] hashTable) {
        for (int i = 0; i < hashTable.length; i++) {
            if (hashTable[i] == -1) {
                System.out.println(" Element at position " + i + ": -1");
            } else {
                System.out.println(" Element at position " + i + ": " + hashTable[i]);
            }
        }
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("Enter the size of the hash table:");
        int size = scanner.nextInt();
        System.out.println("Enter the number of elements:");
        int n = scanner.nextInt();

        int[] hashTable = new int[size];
        for (int i = 0; i < size; i++) {
            hashTable[i] = -1;
        }

        System.out.println("Enter the Elements:");
        for (int i = 0; i < n; i++) {
            int key = scanner.nextInt();
            insert(key, hashTable, size);
        }

        System.out.println("\nThe elements in the array are:");
        display(hashTable);
    }
}
import java.io.*;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        ArrayList<CallLog> callLogs = new ArrayList<>();

        try (BufferedReader br = new BufferedReader(new FileReader("weeklycall.csv"))) {
            String line;
            while ((line = br.readLine()) != null) {
                String[] parts = line.split(",");
                if (parts.length == 4) {
                    String name = parts[0];
                    String dialledNumber = parts[1];
                    int duration = Integer.parseInt(parts[2]);
                    Date dialledDate = new SimpleDateFormat("yyyy-MM-dd").parse(parts[3]);
                        callLogs.add(new CallLog(name, dialledNumber, duration, dialledDate));

                }
            }
        } catch (IOException | ParseException e) {
            e.printStackTrace();
        }
        Collections.sort(callLogs);
        Collections.reverse(callLogs);
        System.out.println("Call-Logs");
        System.out.println("Caller  Name  Duration");

        for (CallLog log : callLogs) {
            System.out.println(log);
        }
    }
}

//CallLog.java
import java.util.Date;

public class CallLog implements Comparable<CallLog> {
    private String name;
    private String dialledNumber;
    private int duration;
    private Date dialledDate;

    public CallLog(String name,String d,int du,Date di){
        this.name=name;
        this.dialledNumber=d;
        this.duration=du;
        this.dialledDate=di;
    }
    @Override
    public int compareTo(CallLog other) {
        return this.name.compareTo(other.name);
    }

    @Override
    public String toString() {
        return name + "(+91-"+this.dialledNumber+") " + duration + " Seconds";
    }
}
//Hill.java
public class Hill {
   public int findPairCount(int[] arr) {
        int pairCount = 0;
        int n = arr.length;

        for (int i = 0; i < n - 1; i++) {
            for (int j = i + 1; j < n; j++) {
                if (canSeeEachOther(arr, i, j)) {
                    pairCount++;
                }
            }
        }
        return pairCount;
    }

    private boolean canSeeEachOther(int[] arr, int i, int j) {
        for (int k = i + 1; k < j; k++) {
            if (arr[k] >= arr[i] || arr[k] >= arr[j]) {
                return false;
            }
        }
        return true;
    }

}

//Main.java
import java.util.Scanner;
public class Main{
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Hill hill = new Hill();

        int n = scanner.nextInt();
        int[] heights = new int[n];

        for (int i = 0; i < n; i++) {
            heights[i] = scanner.nextInt();
        }

        int pairCount = hill.findPairCount(heights);
        System.out.println( pairCount);

    }
}

//2

import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;

class Main {
    static class Bug {
        int power;
        int position;

        Bug(int power, int position) {
            this.power = power;
            this.position = position;
        }
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int X = scanner.nextInt();
        Queue<Bug> queue = new LinkedList<>();

        for (int i = 1; i <= N; i++) {
            int power = scanner.nextInt();
            queue.add(new Bug(power, i));
        }


        int[] selectedPositions = findSelectedPositions(N, X, queue);
        

        for (int position : selectedPositions) {
            System.out.print(position + " ");
        }
    }

    static int[] findSelectedPositions(int N, int X, Queue<Bug> queue) {
        int[] selectedPositions = new int[X];

        for (int i = 0; i < X; i++) {
            int maxPower = -1;
            int maxIndex = -1;
            Queue<Bug> tempQueue = new LinkedList<>();


            for (int j = 0; j < X && !queue.isEmpty(); j++) {
                Bug bug = queue.poll();
                tempQueue.add(bug);
                if (bug.power > maxPower) {
                    maxPower = bug.power;
                    maxIndex = bug.position;
                }
            }

            selectedPositions[i] = maxIndex;


            while (!tempQueue.isEmpty()) {
                Bug bug = tempQueue.poll();
                 if (bug.position != maxIndex) {
                        if (bug.power > 0) {
                        bug.power--;
                    }
                    queue.add(bug);
                }
            }
        }

        return selectedPositions;
    }
}
//Hill.java
public class Hill {
   public int findPairCount(int[] arr) {
        int pairCount = 0;
        int n = arr.length;

        for (int i = 0; i < n - 1; i++) {
            for (int j = i + 1; j < n; j++) {
                if (canSeeEachOther(arr, i, j)) {
                    pairCount++;
                }
            }
        }
        return pairCount;
    }

    private boolean canSeeEachOther(int[] arr, int i, int j) {
        for (int k = i + 1; k < j; k++) {
            if (arr[k] >= arr[i] || arr[k] >= arr[j]) {
                return false;
            }
        }
        return true;
    }

}

//Main.java
import java.util.Scanner;
public class Main{
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Hill hill = new Hill();

        int n = scanner.nextInt();
        int[] heights = new int[n];

        for (int i = 0; i < n; i++) {
            heights[i] = scanner.nextInt();
        }

        int pairCount = hill.findPairCount(heights);
        System.out.println( pairCount);

    }
}

//2

import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;

class Main {
    static class Bug {
        int power;
        int position;

        Bug(int power, int position) {
            this.power = power;
            this.position = position;
        }
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int X = scanner.nextInt();
        Queue<Bug> queue = new LinkedList<>();

        for (int i = 1; i <= N; i++) {
            int power = scanner.nextInt();
            queue.add(new Bug(power, i));
        }


        int[] selectedPositions = findSelectedPositions(N, X, queue);
        

        for (int position : selectedPositions) {
            System.out.print(position + " ");
        }
    }

    static int[] findSelectedPositions(int N, int X, Queue<Bug> queue) {
        int[] selectedPositions = new int[X];

        for (int i = 0; i < X; i++) {
            int maxPower = -1;
            int maxIndex = -1;
            Queue<Bug> tempQueue = new LinkedList<>();


            for (int j = 0; j < X && !queue.isEmpty(); j++) {
                Bug bug = queue.poll();
                tempQueue.add(bug);
                if (bug.power > maxPower) {
                    maxPower = bug.power;
                    maxIndex = bug.position;
                }
            }

            selectedPositions[i] = maxIndex;


            while (!tempQueue.isEmpty()) {
                Bug bug = tempQueue.poll();
                 if (bug.position != maxIndex) {
                        if (bug.power > 0) {
                        bug.power--;
                    }
                    queue.add(bug);
                }
            }
        }

        return selectedPositions;
    }
}
extends Node3D


@onready var ap = $AuxScene/AnimationPlayer
@onready var raycast = $RayCast3D
@onready var eyes = $eyes
@onready var nav = $NavigationAgent3D

const speed = 5


enum {
	IDLE,
	ALERT,
	STUNND,
	CHASING
}

var target
const  T_S = 2
var state = IDLE

func _ready():
	pass # Replace with function body.

func _process(delta):
		
	match state:
		IDLE:
			ap.play("RifleIdle0")
		ALERT:
			ap.play("FiringRifle0")

			eyes.look_at(target.global_transform.origin, Vector3.UP)
			rotate_y(deg_to_rad(eyes.rotation.y * T_S))
			var direction = (target.global_transform.origin - global_transform.origin).normalized()
		CHASING:
			ap.play("RifleRun0")
			
func _on_area_3d_body_entered(body):
	if body.is_in_group("player"):
		state = ALERT
		target = body

func _on_area_3d_body_exited(body):
	if body.is_in_group("player"):
		state = CHASING



<?php
// Include WordPress bootstrap file
require_once('wp-load.php');

// Get global database object
global $wpdb;

// Function to generate SKU for variations
function generate_variation_sku($parent_sku, $attributes) {
    $sku = $parent_sku;
    foreach ($attributes as $attribute) {
        $sku .= '-' . strtoupper($attribute);
    }
    return $sku;
}

// Get all published parent products
$parent_products = $wpdb->get_results("
    SELECT ID, post_title
    FROM {$wpdb->posts}
    WHERE post_type = 'product'
    AND post_status = 'publish'
");

if ($parent_products) {
    $count = 1; // SKU counter
    foreach ($parent_products as $parent_product) {
        $parent_id = $parent_product->ID;

        // Get parent SKU
        $parent_sku = get_post_meta($parent_id, '_sku', true);

        // If parent SKU is empty or not set, assign a new SKU
        if (empty($parent_sku)) {
            $parent_sku = sprintf('%03d', $count); // Format SKU as 001, 002, etc.
            update_post_meta($parent_id, '_sku', $parent_sku);

            // Get variations for the parent product
            $variations = get_posts(array(
                'post_type' => 'product_variation',
                'post_status' => 'publish',
                'post_parent' => $parent_id,
                'fields' => 'ids'
            ));

            if ($variations) {
                foreach ($variations as $variation_id) {
                    // Get attributes for the variation
                    $variation_attributes = wc_get_product_variation_attributes($variation_id);

                    // Generate SKU for the variation
                    $variation_sku = generate_variation_sku($parent_sku, array_values($variation_attributes));

                    // Update SKU for the variation
                    update_post_meta($variation_id, '_sku', $variation_sku);
                }
            }

            $count++; // Increment SKU counter
        }
    }
    echo 'SKUs assigned successfully!';
} else {
    echo 'No parent products found.';
}
const url ='http://sample.example.file.doc'
const authHeader ="Bearer 6Q************" 

const options = {
  headers: {
    Authorization: authHeader
  }
};
 fetch(url, options)
  .then( res => res.blob() )
  .then( blob => {
    var file = window.URL.createObjectURL(blob);
    window.location.assign(file);
  });
 Software, that convert VDI files
The list contains a list of dedicated software for converting VDI and ISO files. The list may also include programs that support VDI files and allow you to save them with different file extensions.


VDI to ISO Converters
MagicISO
UltraIso
2 VDI to ISO converters
VDI and ISO conversions
From VDI
VDI to HDD
VDI to ASHDISC
VDI to OVA
VDI to RAW
VDI to VMDK
VDI to FLP
VDI to GI
VDI to ISO
VDI to PVM
VDI to PVM
VDI to VHD
VDI to BIN
VDI to HDS
To ISO
000 to ISO
ASHDISC to ISO
B5I to ISO
B5T to ISO
BIN to ISO
C2D to ISO
CCD to ISO
CDR to ISO
CUE to ISO
DAA to ISO
DAO to ISO
DMG to ISO
GCZ to ISO
IMG to ISO
ISZ to ISO
MDF to ISO
MDS to ISO
NRG to ISO
P01 to ISO
UIF to ISO
VCD to ISO
B6I to ISO
B6T to ISO
CDI to ISO
CSO to ISO
DEB to ISO
FCD to ISO
GBI to ISO
GCD to ISO
I00 to ISO
I01 to ISO
IMAGE to ISO
IMZ to ISO
WBFS to ISO
VHD to ISO
WIA to ISO
NCD to ISO
NDIF to ISO
PDI to ISO
SPARSEIMAGE to ISO
TAR to ISO
TAR.GZ to ISO
TOAST to ISO
UDF to ISO
UIBAK to ISO
B5L to ISO
CISO to ISO
ZIP to ISO
RAR to ISO
CIF to ISO
Full Name	Disc Image Format
Developer	N/A
Category	Disk Image Files

 Software, that convert VDI files
The list contains a list of dedicated software for converting VDI and ISO files. The list may also include programs that support VDI files and allow you to save them with different file extensions.


VDI to ISO Converters
MagicISO
UltraIso
2 VDI to ISO converters
VDI and ISO conversions
From VDI
VDI to HDD
VDI to ASHDISC
VDI to OVA
VDI to RAW
VDI to VMDK
VDI to FLP
VDI to GI
VDI to ISO
VDI to PVM
VDI to PVM
VDI to VHD
VDI to BIN
VDI to HDS
To ISO
000 to ISO
ASHDISC to ISO
B5I to ISO
B5T to ISO
BIN to ISO
C2D to ISO
CCD to ISO
CDR to ISO
CUE to ISO
DAA to ISO
DAO to ISO
DMG to ISO
GCZ to ISO
IMG to ISO
ISZ to ISO
MDF to ISO
<script src="https://cdn.tailwindcss.com"></script>

<span class="text-[color:var(--text-color)] text-[length:var(--text-size)] font-bold">
  Hello world!
</span>
A DeFi development business specializes in building decentralized financial systems with blockchain technology. These businesses have made a big impact on the banking industry by making things more accessible, making sure things are transparent, and encouraging creativity. Through these efforts, financial services have become more accessible to all, allowing easy international trade and creating new business and personal opportunities. The future of finance is being changed by this new strategy, which will make it more efficient and accessible for everybody.

Known more:- https://beleaftechnologies.com/defi-development-company

Contact details

Whatsapp: +91 7904323274

Skype: live:.cid.62ff8496d3390349

Telegram: @BeleafSoftTech

Mail to: business@beleaftechnologies.com
// 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 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();
    }
  }
  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 j = 0; j < fileIds.length; j++) {
        var downloadUrl = getDownloadUrl(fileIds[j]);
        htmlBody += '<p><a href="' + downloadUrl + '">File ' + (j + 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
    MailApp.sendEmail({
      to: recipientEmail,
      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();
}
/**
 * 
 * 
 * This Google Script will delete everything in your Gmail account.
 * It removes email messages, filters, labels and reset all your settings
 * 
 * Written by Amit Agarwal (amit@labnol.org)
 

         88                                                           
         88                                                           
         88                                                           
 ,adPPYb,88 ,adPPYYba, 8b,dPPYba,   ,adPPYb,d8  ,adPPYba, 8b,dPPYba,  
a8"    `Y88 ""     `Y8 88P'   `"8a a8"    `Y88 a8P_____88 88P'   "Y8  
8b       88 ,adPPPPP88 88       88 8b       88 8PP""""""" 88          
"8a,   ,d88 88,    ,88 88       88 "8a,   ,d88 "8b,   ,aa 88          
 `"8bbdP"Y8 `"8bbdP"Y8 88       88  `"YbbdP"Y8  `"Ybbd8"' 88          
                                    aa,    ,88                        
                                     "Y8bbdP"                         
 
 
 * Proceed with great caution since the process is irreversible
 * 
 * This software comes with ABSOLUTELY NO WARRANTY. 
 * This is free software, and you are welcome to modify and redistribute it 
 *
 * This permission notice shall be included in all copies of the Software.
 *
 *
 */


/**
 * Remove all labels in Gmail
 */
const deleteGmailLabels_ = ()  => {
  GmailApp.getUserLabels().forEach((label) => {
    label.deleteLabel();
  });
};

/**
 * Remove all Gmail Filters
 */
const deleteGmailFilters_ = ()  => {
  const { filter: gmailFilters } = Gmail.Users.Settings.Filters.list('me');
  gmailFilters.forEach(({ id }) => {
    Gmail.Users.Settings.Filters.remove('me', id);
  });
};

/**
 * Remove all Gmail Draft messages
 */
const deleteGmailDrafts_ = ()  => {
  GmailApp.getDrafts().forEach((draft) => {
    draft.deleteDraft();
  });
};

/**
 * Reset Gmail Settings
 */
const resetGmailSettings_ = ()  => {
  // Disable Out-of-office
  Gmail.Users.Settings.updateVacation({ enableAutoReply: false }, 'me');

  // Delete Gmail Signatures
  const { sendAs } = Gmail.Users.Settings.SendAs.list('me');
  sendAs.forEach(({ sendAsEmail }) => {
    Gmail.Users.Settings.SendAs.update({ signature: '' }, 'me', sendAsEmail);
  });

  // Disable IMAP
  Gmail.Users.Settings.updateImap({ enabled: false }, 'me');

  // Disable POP
  Gmail.Users.Settings.updatePop({ accessWindow: 'disabled' }, 'me');

  // Disable Auto Forwarding
  const { forwardingAddresses } = Gmail.Users.Settings.ForwardingAddresses.list('me');
  forwardingAddresses.forEach(({ forwardingEmail }) => {
    Gmail.Users.Settings.ForwardingAddresses.remove('me', forwardingEmail);
  });
};

const startTime = Date.now();
const isTimeLeft_ = ()  => {
  const ONE_SECOND = 1000;
  const MAX_EXECUTION_TIME = ONE_SECOND * 60 * 5;
  return MAX_EXECUTION_TIME > Date.now() - startTime;
};

/**
 * Move all Gmail threads to trash folder
 */
const deleteGmailThreads_ = ()  => {
  let threads = [];
  do {
    threads = GmailApp.search('in:all', 0, 100);
    if (threads.length > 0) {
      GmailApp.moveThreadsToTrash(threads);
      Utilities.sleep(1000);
    }
  } while (threads.length && isTimeLeft_());
};

/**
 * Move all Spam email messages to the Gmail Recyle bin
 */
const deleteSpamEmails_ = ()  => {
  let threads = [];
  do {
    threads = GmailApp.getSpamThreads(0, 10);
    if (threads.length > 0) {
      GmailApp.moveThreadsToTrash(threads);
      Utilities.sleep(1000);
    }
  } while (threads.length && isTimeLeft_());
};

/**
 * Permanetly empty the Trash folder
 */
const emptyGmailTrash_ = ()  => {
  let threads = [];
  do {
    threads = GmailApp.getTrashThreads(0, 100);
    threads.forEach((thread) => {
      Gmail.Users.Threads.remove('me', thread.getId());
    });
  } while (threads.length && isTimeLeft_());
};

/**
 * Factory Reset your Gmail Account
 * Replace NO with YES and run this function
 * */
const factoryResetGmail = ()  => {
  const FACTORY_RESET = 'NO';
  if (FACTORY_RESET === 'YES') {
    resetGmailSettings_();
    deleteGmailLabels_();
    deleteGmailFilters_();
    deleteGmailDrafts_();
    deleteGmailThreads_();
    deleteSpamEmails_();
    emptyGmailTrash_();
  }
};

https://ciusji.gitbook.io/jhinboard/getting-started/install-jhin-package
nstall Jhin Package
JhinDraw
JhinText
Copy
git clone git@github.com:JhinBoard/jhindraw.git
cd jhindraw
npm install
npm run start
theme:uninstall¶
Uninstall themes.

Arguments¶
[themes].... A comma delimited list of themes.
Global Options¶
-v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
-y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
-l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
To see all global options, run drush topic and pick the first choice.
Aliases¶
theme:un
thun
theme-uninstall
https://i.diawi.com/vfhSW1  
//css
@media (min-width:768px) and (max-width:992px) {
    .foo {
        display:none;
    }
}
//scss
//@media (min-width:768px) and (max-width:992px) {
  // display:none;
//}
void main()
{
  
  //odd r even
	var a= 4;
  if(a%2==0){
    print("even");
  }else{
    print("odd");
  }
  
  if(a>0){
    print("+ve");
  }else{
    print("-ve");
  }
    
  
  //sum of n natural num
  s(n){
    return (n*(n+1))/2;
  }
  s(a);
  print(s(a));
  
}
function calculate(options) {
  const num1 = options.num1;
  const operator = options.operator;
  const num2 = options.num2;

  let sum;

  // if the operator does not equal to plus minus multiply or subtract
  switch (operator) {
    case "+":
      sum = num1 + num2;
      break;

    case "-":
      sum += num1 - num2;
      break;

    case "*":
      sum += num1 * num2;
      break;

    case "/":
      sum += num1 / num2;
      break;

    default:
      sum = "Sorry no operator assigned";
      break;
  }

  return sum; // dont forget to return sum after the switch has executed
}

console.log(
  calculate({
    num1: 3,
    operator: "+",
    num2: 4,
  })
);
let fruit = "Apple";
let message;

switch (fruit) {
  case "Banana":
    message = "Bananas are yellow.";
    break;
  case "Apple":
    message = "Apples are red or green.";
    break;
  case "Orange":
    message = "Oranges are orange, obviously!";
    break;
  default:
    message = "I don't know that fruit.";
}

console.log(message);
import java.util.*;
public class BinarySearchTree3 
{
 class Node {
 int key;
 Node left, right;
 public Node(int item) {
 key = item;
 left = right = null;
 }
 }
 private Node root;
 public BinarySearchTree3() 
 {
root = null;
 }
 public void insert(int key) 
 { root = insertKey(root, key); }
 private Node insertKey(Node root, int key) 
 { if (root == null) 
 {
 root = new Node(key);
 return root;
 }
 if (key < root.key)
 root.left = insertKey(root.left, key);
 else if (key > root.key)
 root.right = insertKey(root.right, key);
 return root;
 }
 public void inorder() {
 inorderRec(root);
 }
 private void inorderRec(Node root) {
 if (root != null) {
 inorderRec(root.left);
 System.out.print(root.key + " ");
 inorderRec(root.right);
 }
 }
 public void deleteKey(int key) 
 { root = deleteRec(root, key); }
 private Node deleteRec(Node root, int key) 
 { if (root == null)
 return root;
 if (key < root.key)
 root.left = deleteRec(root.left, key);
 else if (key > root.key)
 root.right = deleteRec(root.right, key);
 else 
{ if (root.left == null)
 return root.right;
 else if (root.right == null)
 return root.left;
 
 root.key = minValue(root.right);
 root.right = deleteRec(root.right, root.key);
 }
 return root;
 }
 
 public int minValue(Node root) {
 int minv = root.key;
 while (root.left != null) {
 minv = root.left.key;
 root = root.left;
 }
 return minv;
 }
 
 public static void main(String[] args) 
 {
Scanner sc = new Scanner(System.in);
BinarySearchTree3 bst = new BinarySearchTree3();
String ch="";
do{
System.out.print("Enter the element to be inserted in the tree: ");
int n=sc.nextInt();
sc.nextLine();
bst.insert(n);
System.out.print("Do you want to insert another element? (Say 'yes'): ");
ch = sc.nextLine();
}while(ch.equals("yes"));
System.out.println();
System.out.print("Inorder Traversal : The elements in the tree are: ");
bst.inorder();
System.out.println();
System.out.print("Enter the element to be removed from the tree: ");
int r=sc.nextInt();
sc.nextLine();
System.out.println();
bst.deleteKey(r);
System.out.print("Inorder traversal after deletion of "+r);
bst.inorder();
System.out.println();
 }
}
	if Input.is_action_just_pressed("spell"):
		if animation_player.current_animation != "Armature|Shoot":
			animation_player.play("Armature|Shoot")
/*
A binary gap within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the binary representation of N.

For example, number 9 has binary representation 1001 and contains a binary gap of length 2. The number 529 has binary representation 1000010001 and contains two binary gaps: one of length 4 and one of length 3. The number 20 has binary representation 10100 and contains one binary gap of length 1. The number 15 has binary representation 1111 and has no binary gaps. The number 32 has binary representation 100000 and has no binary gaps.

Write a function:

function solution(N);

that, given a positive integer N, returns the length of its longest binary gap. The function should return 0 if N doesn't contain a binary gap.

For example, given N = 1041 the function should return 5, because N has binary representation 10000010001 and so its longest binary gap is of length 5. Given N = 32 the function should return 0, because N has binary representation '100000' and thus no binary gaps.

*/

function solution(num) {

    let arr = num.toString(2).split('1').slice(1, -1)
    return arr.length > 0 ? Math.max(...(arr.map(el => el.length))) : 0

}

console.log(solution(1041))
console.log(solution(15))
console.log(solution(32))
console.log(solution(529))
composer require robmorgan/phinx
composer require symfony/yaml
composer require fzaninotto/faker


migrations:
phinx create ClearTableData
vendor\bin\phinx rollback
vendor\bin\phinx migrate




vendor\bin\phinx seed:create AddUser
vendor\bin\phinx seed:run
vendor\bin\phinx seed:run -s ClienteSeed
#include <stdio.h>
#include <string.h>

int main() {
  char str1[] = "abcd", str2[] = "abCd", str3[] = "abcd";
  int result;

  // comparing strings str1 and str2
  result = strcmp(str1, str2);
  printf("strcmp(str1, str2) = %d\n", result);

  // comparing strings str1 and str3
  result = strcmp(str1, str3);
  printf("strcmp(str1, str3) = %d\n", result);

  return 0;
}
#include <stdio.h>
#include <string.h>

int main() {
  char str1[] = "abcd", str2[] = "abCd", str3[] = "abcd";
  int result;

  // comparing strings str1 and str2
  result = strcmp(str1, str2);
  printf("strcmp(str1, str2) = %d\n", result);

  // comparing strings str1 and str3
  result = strcmp(str1, str3);
  printf("strcmp(str1, str3) = %d\n", result);

  return 0;
}
Question 1.
#include <iostream>

using namespace std;

class course
{
	protected:
		int course_code;
		string course_name;
		course(int cc, string cn)
		{
			course_code = cc;
			course_name = cn;
			
		}
		void displayCourseInfo()
		{
			cout<<"Course code: "<<course_code<<endl;
			cout<<"Course name: "<<course_name<<endl;
		}
};
class studentCourse:public course
{
	public:
	int id;
	string grade;
	studentCourse(int cc, string cn, int ID, string Grade):course(cc, cn)
	{
		id = ID;
		grade = Grade;
		
	}
	void displayStudentInfo()
	{
		displayCourseInfo();
		cout<<"ID: "<<id<<endl;
		cout<<"Grade: "<<grade<<endl;
	}
};
int main()
{
	studentCourse s1(202,"OOP II", 20021212, "A");
	s1.displayStudentInfo();
	
	cout<<endl;
	studentCourse s2(201, "Software Design", 210209327, "A");
	s2.displayStudentInfo();
	return 0;
}
//OUTPUT:
Course code: 202
Course name: OOP II
ID: 20021212
Grade: A

Course code: 201
Course name: Software Design
ID: 210209327
Grade: A

Question 2.
#include <iostream>
#include <string>
using namespace std;

class Vehicle
{
	public: 
	int max_speed;
	int num_wheels;
	Vehicle(int speed, int wheels)
	{
		max_speed = speed;
		num_wheels = wheels;
	}
	void vehicle_info()
	{
		
		cout<<"Vehicle Max Speed: "<<max_speed<<endl;
		cout<<"Vehicle Wheels: "<<num_wheels<<endl;

	}
};
class Car:public Vehicle
{
	public: 
	string car_name;
	string car_model;
	Car(int speed, int wheels, string cname, string cmodel): Vehicle(speed, wheels)
	{
		car_name = cname;
		car_model = cmodel;
	}
	void car_info()
	{
		vehicle_info();
		cout<<"Car Name: "<<car_name<<endl;
		cout<<"Car Model: "<<car_model<<endl;
	}
};

class Motorcycle:public Vehicle
{
	public: 
	string mcar_name;
	string mcar_model;
	Motorcycle(int speed, int wheels, string mcname, string mcmodel): Vehicle(speed, wheels)
	{
		mcar_name = mcname;
		mcar_model = mcmodel;
	}
	void Motorcycle_info()
	{
		vehicle_info();
		cout<<"Motorcycle Name: "<<mcar_name<<endl;
		cout<<"Motorcycle Model: "<<mcar_model<<endl;
	}
};
class ConvertibleCar: public Car, public Motorcycle
{
	public: 

	ConvertibleCar(int speed, int wheels, string cname, string cmodel, string mcname, string mcmodel): 
	Car(speed, wheels, cname, cmodel), Motorcycle(speed, wheels, mcname, mcmodel)
	{}
	void ConvertibleCar_info()
	{
		car_info();
		cout<<endl;
		Motorcycle_info();
	}
}; 
int main()
{
	Car car(200, 4, "Honda", "Sedan");
    Motorcycle bike(180, 2, "Vespa", "Sport");
    ConvertibleCar convertible(220, 4, "Convertible Car", "Sport Car", "Convertible Motocycle", "Vespa");

    cout << "Car Information:" << endl;
    car.car_info();
    cout << endl;

    cout << "Motorcycle Information:" << endl;
    bike.Motorcycle_info();
    cout << endl;

    cout << "Convertible Car Information:" << endl;
    convertible.ConvertibleCar_info();


	return 0;
}
//OUTPUT:
Car Information:
Vehicle Max Speed: 200
Vehicle Wheels: 4
Car Name: Honda
Car Model: Sedan

Motorcycle Information:
Vehicle Max Speed: 180
Vehicle Wheels: 2
Motorcycle Name: Vespa
Motorcycle Model: Sport

Convertible Car Information:
Vehicle Max Speed: 220
Vehicle Wheels: 4
Car Name: Convertible Car
Car Model: Sport Car

Vehicle Max Speed: 220
Vehicle Wheels: 4
Motorcycle Name: Convertible Motocycle
Motorcycle Model: Vespa
<table class=”w100p” cellpadding="0" cellspacing="0" border="0" role="presentation" style="width: 600px;">
<tr>
     <td style="font-size:0;" align="center" valign="top">
          <!--[if (gte mso 9)|(IE)]>
          <table cellpadding="0" cellspacing="0" border="0" role="presentation" style="width: 100%;" width="540">
          <tr>
          <td valign="top" style="width: 270px;">
          <![endif]-->
               <div class=”w100p” style="display:inline-block;vertical-align:top;">
                     <table class=”w100p” cellpadding="0" cellspacing="0" border="0" role="presentation" style="width: 270px;">
                           <tr>
                                 <td align="left" valign="top" style="padding: 0px 0px 20px;">
                                      <a target="_blank" href="https://www.cat.com/en_US/articles/cat-mining-articles/csn-mining-uses-cat-repair-and-rebuild-options.html" title="Service Technician Performing Repair" alias="see_how_we_help__sum_thumb3" data-linkto="http://"><img data-assetid="90765" src="https://image.em.cat.com/lib/fe3b11717064047f741575/m/1/3a37f1a6-1f82-463e-97e9-850f1221ff9b.jpg" alt="Service Technician Performing Repair" width="260" style="display: block; padding: 0px; text-align: center; height: auto; width: 100%; border: 0px;"></a>
                                 </td>
                           </tr>
                     </table>
               </div>
          <!--[if (gte mso 9)|(IE)]>
          </td><td valign="top" style="width:270px;">
          <![endif]-->
               <div class=”w100p” style="display:inline-block;vertical-align:top;">
                     <table class=”w100p” cellpadding="0" cellspacing="0" border="0" role="presentation" style="width:270px;">
                           <tr>
                                 <td class="mobile-center" style="font-family: &quot;Arial Black&quot;, Arial, Helvetica, sans-serif; color: rgb(0, 0, 0); padding: 0px 0px 5px; font-weight: 700; font-size: 16px; line-height: 20px; text-align:left; text-transform: uppercase;">    REBUILT COMPONENTS KEEP MINING OPERATIONS MOVING</td>
                           </tr>
<tr>   <td class="mobile-center" style="font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0); padding: 0px 0px 10px; font-weight: 400; font-size: 14px; line-height: 18px;text-align:left;">    A single lifetime for a machine, a powertrain, a component or a part just isn’t enough when you’re moving 30 million tons of iron ore a year. That’s why Brazil’s second-largest mining company relies on Cat&nbsp;Repair and Rebuild options to keep their machines on the job in some of the toughest conditions imaginable.</td></tr>
                     </table>
               </div>
          <!--[if (gte mso 9)|(IE)]>
          </td>
          </tr>
          </table>
          <![endif]-->
     </td>
</tr>
</table>
<!------------------------------------- ONE ------------------------------------------->

<div class="fhCal1" style="display: none;">
    <script src="https://fareharbor.com/embeds/script/calendar-small/eatinitalyfoodtours/items/544121/?fallback=simple&full-items=yes&flow=1175720"></script>
</div>

<div class="fhCal2" style="display: none;">
    <script src="https://fareharbor.com/embeds/script/calendar-small/eatinitalyfoodtours/items/544127/?fallback=simple&full-items=yes&flow=1175720"></script>
</div>

<div class="fhCal3" style="display: none;">
    <script src="https://fareharbor.com/embeds/script/calendar-small/eatinitalyfoodtours/items/544137/?fallback=simple&full-items=yes&flow=1175723"></script>
</div>

<div class="fhCal4" style="display: none;">
    <script src="https://fareharbor.com/embeds/script/calendar-small/eatinitalyfoodtours/items/544134/?fallback=simple&full-items=yes&flow=1175723"></script>
</div>

<script>
jQuery(document).ready(function($){
    // Hide all calendar divs by default
    $(".fhCal1, .fhCal2, .fhCal3, .fhCal4").hide();
    
    // Show the corresponding calendar div based on the current page URL
    if (window.location.href == "https://eatinitalyfoodtours.com/homepizzeria_35") {
        $('.fhCal1').show();
    } else if (window.location.href == "https://eatinitalyfoodtours.com/chiaia-food-tour-naples_8") {
        $('.fhCal2').show();
    } else if (window.location.href == "https://eatinitalyfoodtours.com/cookinganacapri_33") {
        $('.fhCal3').show();
    } else if (window.location.href == "https://eatinitalyfoodtours.com/capripizza_34") {
        $('.fhCal4').show();
    }
});
</script>



<!------------------------------------- TWO ------------------------------------------->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function() {
    // Calendar script for the Chiaia Food Tour Naples page
    if (window.location.href.indexOf("chiaia-food-tour-naples_8") > -1) {
        var calendarScript = '<script src="https://fareharbor.com/embeds/script/calendar-small/eatinitalyfoodtours/items/544127/?fallback=simple&full-items=yes&flow=1175720"></script>';
        $("#sidebar > h4").after(calendarScript);
    }
    
    // Calendar script for the Cooking Anacapri page
    if (window.location.href.indexOf("cookinganacapri_33") > -1) {
        var calendarScript = '<script src="https://fareharbor.com/embeds/script/calendar/eatinitalyfoodtours/items/544137/?fallback=simple&full-items=yes&flow=1175723"></script>';
        $("#sidebar > h4").after(calendarScript);
    }
    
    // Calendar script for the Capri Pizza page
    if (window.location.href.indexOf("capripizza_34") > -1) {
        var calendarScript = '<script src="https://fareharbor.com/embeds/script/calendar-small/eatinitalyfoodtours/items/544134/?fallback=simple&full-items=yes&flow=1175723"></script>';
        $("#sidebar > h4").after(calendarScript);
    }
});
</script>
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'Lab Evaluation',
      debugShowCheckedModeBanner: false,
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        backgroundColor: Colors.white, //appbar
        body: Container(
          height: 150,
          width: 800,
          child: ClipRRect(
            borderRadius: BorderRadius.vertical(
              bottom: Radius.circular(40),
            ),
            child: Image.asset('images/image.png', fit: BoxFit.cover,),
          )
        ));
  }
}





#include <stdio.h>
 
struct Process {
    int process_id;
    int arrival_time;
    int burst_time;
};
 
void sjf_scheduling(struct Process processes[], int n) {
    int completion_time[n];
    int waiting_time[n];
    int turnaround_time[n];

    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            if (processes[i].arrival_time > processes[j].arrival_time) {
                struct Process temp = processes[i];
                processes[i] = processes[j];
                processes[j] = temp;
            }
        }
    }
 
    int current_time = 0;
    for (int i = 0; i < n; i++) {
        printf("Enter details for process %d:\n", i + 1);
        printf("Process ID: ");
        scanf("%d", &processes[i].process_id);
        printf("Arrival Time: ");
        scanf("%d", &processes[i].arrival_time);
        printf("Burst Time: ");
        scanf("%d", &processes[i].burst_time);
        if (current_time < processes[i].arrival_time) {
            current_time = processes[i].arrival_time;
        }
        completion_time[i] = current_time + processes[i].burst_time;
        waiting_time[i] = current_time - processes[i].arrival_time;
        turnaround_time[i] = waiting_time[i] + processes[i].burst_time;
        current_time += processes[i].burst_time;
    }
    printf("\nProcess\tCompletion Time\tWaiting Time\tTurnaround Time\n");
    for (int i = 0; i < n; i++) {
        printf("%d\t\t%d\t\t%d\t\t%d\n", processes[i].process_id, completion_time[i], waiting_time[i], turnaround_time[i]);
    }

    int total_waiting_time = 0;
    int total_turnaround_time = 0;
    for (int i = 0; i < n; i++) {
        total_waiting_time += waiting_time[i];
        total_turnaround_time += turnaround_time[i];
    }
    float avg_waiting_time = (float)total_waiting_time / n;
    float avg_turnaround_time = (float)total_turnaround_time / n;
    printf("\nAverage Waiting Time: %.2f\n", avg_waiting_time);
    printf("Average Turnaround Time: %.2f\n", avg_turnaround_time);
}
 
int main() {
    int n;
    printf("Enter the number of processes: ");
    scanf("%d", &n);
    struct Process processes[n];
    sjf_scheduling(processes, n);
    return 0;
}

output: 

 Enter the number of processes: 5
Enter details for process 1:
Process ID: 1
Arrival Time: 2
Burst Time: 2
Enter details for process 2:
Process ID: 2
Arrival Time: 4
Burst Time: 3
Enter details for process 3:
Process ID: 3
Arrival Time: 6
Burst Time: 4
Enter details for process 4:
Process ID: 4
Arrival Time: 8
Burst Time: 5
Enter details for process 5:
Process ID: 5
Arrival Time: 10
Burst Time: 6

Process	Completion Time	Waiting Time	Turnaround Time
1		4		0		2
2		7		0		3
3		11		1		5
4		16		3		8
5		22		6		12

Average Waiting Time: 2.00
Average Turnaround Time: 6.00

 
code:
#include<stdio.h>  
    #include<stdlib.h>  
     
    void main()  {  
        int i, NOP, sum=0,count=0, y, quant, wt=0, tat=0, at[10], bt[10], temp[10];  
        float avg_wt, avg_tat;  
        printf(" Total number of process in the system: ");  
        scanf("%d", &NOP);  
        y = NOP; 
    for(i=0; i<NOP; i++){  
    printf("\n Enter the Arrival and Burst time of the Process[%d]\n", i+1);  
    printf(" Arrival time is: \t");   
    scanf("%d", &at[i]);  
    printf(" \nBurst time is: \t"); 
    scanf("%d", &bt[i]);  
    temp[i] = bt[i]; 
    }  
    printf("Enter the Time Quantum for the process: \t");  
    scanf("%d", &quant);  
    printf("\n Process No \t\t Burst Time \t\t TAT \t\t Waiting Time ");  
    for(sum=0, i = 0; y!=0; )  
    {  
    if(temp[i] <= quant && temp[i] > 0){  
        sum = sum + temp[i];  
        temp[i] = 0;  
        count=1;  
        }    
        else if(temp[i] > 0){  
            temp[i] = temp[i] - quant;  
            sum = sum + quant;    
        }  
        if(temp[i]==0 && count==1){  
            y--;  
            printf("\nProcess No[%d] \t\t %d\t\t\t\t %d\t\t\t %d", i+1, bt[i], sum-at[i], sum-at[i]-bt[i]);  
            wt = wt+sum-at[i]-bt[i];  
            tat = tat+sum-at[i];  
            count =0;    
        }  
        if(i==NOP-1)  
        {i=0;}  
        else if(at[i+1]<=sum){  
            i++;  
        }  
        else { i=0; }  
    }  

    avg_wt = wt * 1.0/NOP;  
    avg_tat = tat * 1.0/NOP;  
    printf("\n Average Turn Around Time: \t%f", avg_tat);  
    printf("\n Average Waiting Time: \t%f",avg_wt);
    }
    
output:
Total number of process in the system: 4
 Enter the Arrival and Burst time of the Process[1]
 Arrival time is: 	2
Burst time is: 	6
 Enter the Arrival and Burst time of the Process[2]
 Arrival time is: 	4
Burst time is: 	7
 Enter the Arrival and Burst time of the Process[3]
 Arrival time is: 	4
Burst time is: 	8
 Enter the Arrival and Burst time of the Process[4]
 Arrival time is: 	8
Burst time is: 	2
Enter the Time Quantum for the process: 	3
 Process No 		 Burst Time 		 TAT 		 Waiting Time 
Process No[1] 		 6				 4			 -2
Process No[4] 		 2				 6			 4
Process No[2] 		 7				 17			 10
Process No[3] 		 8				 19			 11
 Average Turn Around Time: 	11.500000
 Average Waiting Time: 	5.750000
#include<stdio.h>
 
struct process {
    int pid;      
    int burst;   
    int waiting;  
    int turnaround;
};
 
void calculateTimes(struct process proc[], int n) {
    int total_waiting = 0, total_turnaround = 0;
   
    proc[0].waiting = 0;
    
    proc[0].turnaround = proc[0].burst;
 
    for (int i = 1; i < n; i++) {
        proc[i].waiting = proc[i - 1].waiting + proc[i - 1].burst;
        proc[i].turnaround = proc[i].waiting + proc[i].burst;
    }
}
 
void displayProcesses(struct process proc[], int n) {
    printf("Process ID\tBurst Time\tWaiting Time\tTurnaround Time\n");
    for (int i = 0; i < n; i++) {
        printf("%d\t\t%d\t\t%d\t\t%d\n", proc[i].pid, proc[i].burst, proc[i].waiting, proc[i].turnaround);
    }
}
 
void calculateAverages(struct process proc[], int n, float *avg_waiting, float *avg_turnaround) {
    int total_waiting = 0, total_turnaround = 0;
    for (int i = 0; i < n; i++) {
        total_waiting += proc[i].waiting;
        total_turnaround += proc[i].turnaround;
    }
    *avg_waiting = (float)total_waiting / n;
    *avg_turnaround = (float)total_turnaround / n;
}
 
int main() {
    int n; 
    printf("Enter the number of processes: ");
    scanf("%d", &n);
    struct process proc[n]; 
    printf("Enter the burst time for each process:\n");
    for (int i = 0; i < n; i++) {
        proc[i].pid = i + 1;
        printf("Process %d: ", i + 1);
        scanf("%d", &proc[i].burst);
    }
    calculateTimes(proc, n);
    displayProcesses(proc, n);
    float avg_waiting, avg_turnaround;
    calculateAverages(proc, n, &avg_waiting, &avg_turnaround);
    printf("\nAverage Waiting Time: %.2f\n", avg_waiting);
    printf("Average Turnaround Time: %.2f\n", avg_turnaround);
 
    return 0;
}




Output:

Enter the number of processes: 4
Enter the burst time for each process:
Process 1: 1
Process 2: 2
Process 3: 3
Process 4: 4
Process ID	Burst Time	Waiting Time	Turnaround Time
1		1		0		1
2		2		1		3
3		3		3		6
4		4		6		10

Average Waiting Time: 2.50
Average Turnaround Time: 5.00

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

int main()
{
    printf("Enter characters: ");
    int c;
    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') {
                putchar(toupper(c)); 
            } else {
                putchar(tolower(c)); 
            }
        }
    }
    return 0;
}
#include <stdio.h>

int byteBits(int bytes) {
    return bytes*8; 
}

int bitsByte(int bits) {
    return bits/8; 
}

int main() {
    int num, val, result;

    printf("Press 1 if Byte to Bits\nPress 2 if Bits to Byte\nPress 0 if Cancel\n\n");
    printf("Please enter a number [1, 2 or 0]: ");
    scanf("%d", &num);

    switch (num) {
        case 1:
            printf("Enter the number of bytes: ");
            scanf("%d", &val);
            result = byteBits(val);
            printf("%d bytes = %d bits\n", val, result);
            break;
        case 2:
            printf("Enter the number of bits: ");
            scanf("%d", &val);
            result = bitsByte(val);
            printf("%d bits = %d bytes\n", val, result);
            break;
        case 0:
            printf("Canceled\n");
            break;
        default:
            printf("Invalid. Please try again.\n");
    }

    return 0;
}
#include <stdio.h>

float circle(float radius) {
    float area;
    area = 3.14 * radius * radius; 
    return area;
}

int main() {
    float radius, area;

    printf("Enter the radius: ");
    scanf("%f", &radius);

    area = circle(radius);

    printf("The area of the circle is: %.2f\n", area);

    return 0;
}
#include <stdio.h>

float equal(float in) {
    float cm = in * 2.4; 
    return cm;
}

int main() {
    float in, cm;

    printf("Enter length in inches: ");
    scanf("%f", &in);

    cm = equal(in);

    printf("%.2f inches is equal to %.2f centimeters.\n", in, cm);

    return 0;
}
star

Sat May 04 2024 09:56:59 GMT+0000 (Coordinated Universal Time)

@signup

star

Sat May 04 2024 09:44:08 GMT+0000 (Coordinated Universal Time)

@signup

star

Sat May 04 2024 09:27:59 GMT+0000 (Coordinated Universal Time)

@signup

star

Sat May 04 2024 09:27:03 GMT+0000 (Coordinated Universal Time)

@signup

star

Sat May 04 2024 09:26:23 GMT+0000 (Coordinated Universal Time)

@signup

star

Sat May 04 2024 08:50:21 GMT+0000 (Coordinated Universal Time)

@signup

star

Sat May 04 2024 06:14:48 GMT+0000 (Coordinated Universal Time)

@cms

star

Sat May 04 2024 06:07:52 GMT+0000 (Coordinated Universal Time)

@cms

star

Sat May 04 2024 05:00:09 GMT+0000 (Coordinated Universal Time)

@cms

star

Sat May 04 2024 04:59:20 GMT+0000 (Coordinated Universal Time)

@cms

star

Sat May 04 2024 04:58:16 GMT+0000 (Coordinated Universal Time)

@cms

star

Sat May 04 2024 04:20:35 GMT+0000 (Coordinated Universal Time)

@signup

star

Fri May 03 2024 23:05:41 GMT+0000 (Coordinated Universal Time)

@azariel #glsl

star

Fri May 03 2024 18:15:39 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/32545632/how-can-i-download-a-file-using-window-fetch

@porobertdev #javascript #promise

star

Fri May 03 2024 17:04:01 GMT+0000 (Coordinated Universal Time) https://converter.tips/convert/vdi-to-iso

@j3d1n00b

star

Fri May 03 2024 17:03:18 GMT+0000 (Coordinated Universal Time) https://converter.tips/convert/vdi-to-iso

@j3d1n00b

star

Fri May 03 2024 09:53:33 GMT+0000 (Coordinated Universal Time)

@Sephjoe

star

Fri May 03 2024 09:21:45 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/64872861/how-to-use-css-variables-with-tailwind-css

@ziaurrehman #html

star

Fri May 03 2024 07:34:45 GMT+0000 (Coordinated Universal Time) https://beleaftechnologies.com/defi-development-company

@saxefog #defi #decentralizedfinance #defidevelopmentcompany

star

Fri May 03 2024 07:17:45 GMT+0000 (Coordinated Universal Time)

@ash1i

star

Fri May 03 2024 05:10:18 GMT+0000 (Coordinated Universal Time)

@al.thedigital #opensource #mirro #selfhost

star

Fri May 03 2024 05:04:53 GMT+0000 (Coordinated Universal Time) https://ciusji.gitbook.io/jhinboard

@al.thedigital #opensource #mirro #selfhost

star

Fri May 03 2024 03:50:30 GMT+0000 (Coordinated Universal Time) https://www.drush.org/12.x/commands/theme_uninstall/

@al.thedigital

star

Thu May 02 2024 17:08:30 GMT+0000 (Coordinated Universal Time) https://www.drupal.org/node/200774

@al.thedigital

star

Thu May 02 2024 11:22:09 GMT+0000 (Coordinated Universal Time)

@hey123 #dart #flutter

star

Thu May 02 2024 09:51:44 GMT+0000 (Coordinated Universal Time)

@divyasoni23 #css

star

Thu May 02 2024 06:58:49 GMT+0000 (Coordinated Universal Time)

@hey123 #dart #flutter

star

Thu May 02 2024 06:15:07 GMT+0000 (Coordinated Universal Time)

@davidmchale #switch #statement #function #object

star

Thu May 02 2024 05:56:18 GMT+0000 (Coordinated Universal Time)

@davidmchale #switch #statement

star

Thu May 02 2024 05:14:26 GMT+0000 (Coordinated Universal Time)

@signup

star

Thu May 02 2024 02:58:07 GMT+0000 (Coordinated Universal Time)

@azariel #glsl

star

Thu May 02 2024 00:22:16 GMT+0000 (Coordinated Universal Time)

@vkRostov

star

Wed May 01 2024 22:57:14 GMT+0000 (Coordinated Universal Time)

@jdeveloper #php

star

Wed May 01 2024 22:09:19 GMT+0000 (Coordinated Universal Time)

@meanaspotato #c

star

Wed May 01 2024 22:09:19 GMT+0000 (Coordinated Universal Time)

@meanaspotato #c

star

Wed May 01 2024 20:19:49 GMT+0000 (Coordinated Universal Time)

@Mohamedshariif #c++

star

Wed May 01 2024 19:36:09 GMT+0000 (Coordinated Universal Time)

@shirnunn

star

Wed May 01 2024 13:45:12 GMT+0000 (Coordinated Universal Time)

@Shira

star

Wed May 01 2024 10:21:29 GMT+0000 (Coordinated Universal Time)

@salauddin01

star

Wed May 01 2024 09:56:15 GMT+0000 (Coordinated Universal Time)

@signup

star

Wed May 01 2024 09:54:48 GMT+0000 (Coordinated Universal Time)

@signup

star

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

@signup

star

Wed May 01 2024 06:36:57 GMT+0000 (Coordinated Universal Time)

@JC

Save snippets that work with our extensions

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