Snippets Collections
// Define the coordinates for the specific point (e.g., the location of interest)
var point = ee.Geometry.Point(90.2611485521762, 23.44690280909043);

// Create a buffer around the point (e.g., 20 kilometers)
var bufferRadius = 20000; // 20 km in meters
var pointBuffer = point.buffer(bufferRadius);

// Create a Landsat 8 Collection 2 Tier 1 image collection for the desired date range
var startDate = '2017-10-01';
var endDate = '2017-10-31';

var landsatCollection2 = ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA')
  .filterBounds(point)
  .filterDate(startDate, endDate);

// Cloud masking function for Landsat
function maskL8Clouds(image) {
  var qa = image.select('QA_PIXEL');
  var cloudMask = qa.bitwiseAnd(1 << 3).eq(0); // Cloud bit is 3rd
  return image.updateMask(cloudMask);
}

// Apply the cloud mask to the collection
var cloudFreeCollection = landsatCollection2.map(maskL8Clouds);

// Print the number of images in the cloud-free collection
var imageCount = cloudFreeCollection.size();
print('Number of cloud-free images in the collection:', imageCount);

// Use JRC Global Surface Water dataset to create a water mask
var waterMask = ee.Image('JRC/GSW1_4/GlobalSurfaceWater').select('occurrence');

// Define water body threshold (e.g., areas with water occurrence > 50% are considered water bodies)
var waterThreshold = 50;
var waterBodies = waterMask.gt(waterThreshold);

// Clip water bodies to the buffer area
var clippedWaterBodies = waterBodies.clip(pointBuffer);

// Mask water bodies in the cloud-free collection
var landOnlyCollection = cloudFreeCollection.map(function(image) {
  return image.updateMask(clippedWaterBodies.not());  // Mask out water bodies
});

// Compute the maximum and minimum temperature across all non-water pixels
var maxTemperature = landOnlyCollection.select('B10').max();
var minTemperature = landOnlyCollection.select('B10').min();

// Convert temperatures from Kelvin to Celsius
var maxTemperatureCelsius = maxTemperature.subtract(273.15);
var minTemperatureCelsius = minTemperature.subtract(273.15);

// Clip the max and min temperature images to the buffer region around the point
var clippedMaxTemperature = maxTemperatureCelsius.clip(pointBuffer);
var clippedMinTemperature = minTemperatureCelsius.clip(pointBuffer);

// Filter out negative temperature pixels (set to null)
var filteredMaxTemperature = clippedMaxTemperature.updateMask(clippedMaxTemperature.gt(0));
var filteredMinTemperature = clippedMinTemperature.updateMask(clippedMinTemperature.gt(0));

// Adjust the scale to match the thermal band resolution (100m)
var maxTempStats = filteredMaxTemperature.reduceRegion({
  reducer: ee.Reducer.max(),
  geometry: pointBuffer,
  scale: 100,  // Updated scale
  bestEffort: true  // Tries to use the best resolution possible
});
var minTempStats = filteredMinTemperature.reduceRegion({
  reducer: ee.Reducer.min(),
  geometry: pointBuffer,
  scale: 100,  // Updated scale
  bestEffort: true  // Tries to use the best resolution possible
});

print('Maximum Temperature (Celsius):', maxTempStats);
print('Minimum Temperature (Celsius):', minTempStats);

// Display the specific point, water bodies, and temperature layers on the map
Map.centerObject(point, 10);
Map.addLayer(point, {color: 'red'}, 'Specific Point');

// Add water bodies to the map with a distinct color (e.g., light blue)
Map.addLayer(
  clippedWaterBodies,
  {palette: ['cyan'], opacity: 0.5},  // Use a distinct color like 'cyan'
  'Water Bodies',
  true  // You can set this to true if you want the water bodies visible by default
);

// Add the filtered max temperature layer to the map
Map.addLayer(
  filteredMaxTemperature,
  {
    min: 0, // Min temperature range (Celsius)
    max: 50, // Max temperature range (Celsius)
    palette: ['blue', 'lightblue', 'green', 'yellow', 'orange', 'red']
  },
  'Filtered Max Land Surface Temperature (Celsius)',
  true,
  0.75
);

// Add the filtered min temperature layer to the map (can toggle display)
Map.addLayer(
  filteredMinTemperature,
  {
    min: 0, // Min temperature range (Celsius)
    max: 50, // Max temperature range (Celsius)
    palette: ['blue', 'lightblue', 'green', 'yellow', 'orange', 'red']
  },
  'Filtered Min Land Surface Temperature (Celsius)',
  true,
  0.75
);

// Add a legend for the temperature range (Max and Min)
var legend = ui.Panel({
  style: {
    position: 'bottom-right',
    padding: '8px 15px'
  }
});
legend.add(ui.Label({
  value: 'Land Surface Temperature (°C)',
  style: {
    fontWeight: 'bold',
    fontSize: '14px',
    margin: '0 0 4px 0',
    padding: '0'
  }
}));

// Define the color palette and corresponding temperature ranges (0-50°C)
var palette = ['blue', 'lightblue', 'green', 'yellow', 'orange', 'red'];
var tempRanges = ['0-8 °C', '9-16 °C', '17-24 °C', '25-32 °C', '33-40 °C', '41-50 °C'];

// Add water bodies legend entry (cyan for water)
legend.add(ui.Label({
  value: 'Water Bodies',
  style: {
    fontWeight: 'bold',
    fontSize: '14px',
    margin: '0 0 4px 0',
    padding: '0'
  }
}));

// Add the water color box
var waterColorBox = ui.Label({
  style: {
    backgroundColor: 'cyan',  // Cyan color for water bodies
    padding: '8px',
    margin: '0 0 4px 0'
  }
});
var waterDescription = ui.Label({
  value: 'Water Bodies',
  style: {margin: '0 0 4px 6px'}
});
legend.add(
  ui.Panel({
    widgets: [waterColorBox, waterDescription],
    layout: ui.Panel.Layout.Flow('horizontal')
  })
);

// Add temperature ranges to the legend
for (var i = 0; i < palette.length; i++) {
  var colorBox = ui.Label({
    style: {
      backgroundColor: palette[i],
      padding: '8px',
      margin: '0 0 4px 0'
    }
  });
  var description = ui.Label({
    value: tempRanges[i],
    style: {margin: '0 0 4px 6px'}
  });
  legend.add(
    ui.Panel({
      widgets: [colorBox, description],
      layout: ui.Panel.Layout.Flow('horizontal')
    })
  );
}
// Add the legend to the map
Map.add(legend);
#include <bits/stdc++.h>
using namespace std;

int mod = 1e9 + 7;
const int MAX = 1e5 + 1;

#define ll long long
#define ull unsigned long long
#define int64 long long int
#define vi vector<int>
#define pii pair<int, int>
#define ppi pair<pii>
#define all(v) v.begin(), v.end()
#define ff first
#define ss second
#define eb emplace_back
#define sz(x) (int(x.size()))
#define mset(dp, x) memset(dp, x, sizeof(dp))

int dir[5] = {0, 1, 0, -1, 0};
int dirI[8] = {1, 1, 0, -1, -1, -1, 0, 1}, dirJ[8] = {0, -1, -1, -1, 0, 1, 1, 1};

ll fact[MAX] = {1};

ll add(ll a, ll b)
{
    return (a % mod + b % mod) % mod;
}

ll sub(ll a, ll b)
{
    return (a % mod - b % mod + mod) % mod;
}

ll mul(ll a, ll b)
{
    return ((a % mod) * (b % mod)) % mod;
}

ll exp(ll a, ll b)
{
    ll ans = 1;
    while (b)
    {
        if (b & 1)
            ans = (ans * a) % mod;
        a = (a * a) % mod;
        b >>= 1;
    }
    return ans;
}

ll inv(ll b)
{
    return exp(b, mod - 2) % mod;
}

ll division(ll a, ll b)
{
    return ((a % mod) * (inv(b) % mod)) % mod;
}

ll nCr(ll n, ll r)
{
    if (r > n)
        return 0;
    return division(fact[n], mul(fact[r], fact[n - r]));
}

ll nPr(ll n, ll r)
{
    if (r > n)
        return 0;
    return division(fact[n], fact[n - r]);
}

ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}

ll lcm(ll a, ll b)
{
    return (a * b) / gcd(a, b);
}

void pre(int _mod = mod)
{
    mod = _mod;
    fact[0] = 1;
    for (int i = 1; i < MAX; i++)
    {
        fact[i] = mul(fact[i - 1], i);
    }
}

void solve() {
    cout << "write code here" << "\n";
}

int main() {
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif

	int tt = 1;
	cin >> tt;
	while (tt--) {
		solve();
	}
	return 0;
}
#include<bits/stdc++.h>
using namespace std;

typedef long long ll;

ll gcd(ll a, ll b) {
  if(!a) return b;
  return gcd(b % a, a);
}

ll lcm(ll a, ll b) {
    return a * b / gcd(a, b);
}

int main() {
  cout << gcd(12, 18) << endl;
  cout << gcd(0, 18) << endl;
  cout << lcm(12, 18) << endl;
  return 0;
}
#include <iostream>
#include <vector>
using namespace std;

// Function to calculate the smallest prime factors (SPF)
vector<int> calculate_spf(int n) {
    vector<int> SPF(n + 1, 0); // SPF array initialized to 0

    for (int i = 2; i <= n; i++) {
        if (SPF[i] == 0) { // i is a prime number
            for (int j = i; j <= n; j += i) {
                if (SPF[j] == 0) { // Mark only if not marked
                    SPF[j] = i; // Assign smallest prime factor
                }
            }
        }
    }
    return SPF;
}

// Function to get the prime factors of a number using the SPF array
vector<int> get_prime_factors(int n, const vector<int>& SPF) {
    vector<int> prime_factors;
    while (n != 1) {
        prime_factors.push_back(SPF[n]);
        n /= SPF[n]; // Divide n by its smallest prime factor
    }
    return prime_factors;
}

int main() {
    int N = 100; // Precompute SPF array for numbers up to N
    vector<int> SPF = calculate_spf(N);

    // Example: Factorizing multiple numbers
    vector<int> numbers_to_factor = {30, 45, 84, 97};

    for (int num : numbers_to_factor) {
        cout << "Prime factors of " << num << ": ";
        vector<int> factors = get_prime_factors(num, SPF);
        for (int f : factors) {
            cout << f << " ";
        }
        cout << endl;
    }

    return 0;
}
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;

// Function to perform the simple sieve of Eratosthenes up to sqrt(b)
vector<int> simple_sieve(int limit) {
    vector<bool> is_prime(limit + 1, true);
    vector<int> primes;
    is_prime[0] = is_prime[1] = false;

    for (int i = 2; i <= limit; i++) {
        if (is_prime[i]) {
            primes.push_back(i);
            for (int j = i * i; j <= limit; j += i) {
                is_prime[j] = false;
            }
        }
    }
    return primes;
}

// Function to find all primes in the range [a, b] using the segmented sieve
void segmented_sieve(int a, int b) {
    int limit = sqrt(b);
    vector<int> primes = simple_sieve(limit);

    // Create a boolean array for the range [a, b]
    vector<bool> is_prime_segment(b - a + 1, true);

    // Mark multiples of each prime in the range [a, b]
    for (int prime : primes) {
        int start = max(prime * prime, a + (prime - a % prime) % prime);

        for (int j = start; j <= b; j += prime) {
            is_prime_segment[j - a] = false;
        }
    }

    // If a is 1, then it's not a prime number
    if (a == 1) {
        is_prime_segment[0] = false;
    }

    // Output all primes in the range [a, b]
    cout << "Prime numbers in the range [" << a << ", " << b << "] are:" << endl;
    for (int i = 0; i <= b - a; i++) {
        if (is_prime_segment[i]) {
            cout << (a + i) << " ";
        }
    }
    cout << endl;
}

int main() {
    int a = 10, b = 50;
    segmented_sieve(a, b);
    return 0;
}
#include <iostream>
#include <vector>
using namespace std;
void sieve_of_eratosthenes(int n) {
    vector<bool> is_prime(n + 1, true); // Initialize all entries as true
    is_prime[0] = is_prime[1] = false;  // 0 and 1 are not prime numbers
    for (int i = 2; i * i <= n; i++) {
        if (is_prime[i]) {
            // Mark all multiples of i as false
            for (int j = i * i; j <= n; j += i) {
                is_prime[j] = false;
            }
        }
    }

    // Output all prime numbers
    cout << "Prime numbers up to " << n << " are:" << endl;
    for (int i = 2; i <= n; i++) {
        if (is_prime[i]) {
            cout << i << " ";
        }
    }
    cout << endl;
}

int main() {
    int n = 50;
    sieve_of_eratosthenes(n);
    return 0;
}
//Exercise 6-2

package com.mycompany.countdown;

public class InfiniteLoop {
    public static void main(String[] args) {
        for (int i = 0; i <= 5; i++) {
            System.out.println("Hello");
        }
        /*
        for (int i = 0; i < 10; i--) {
        System.out.println("This will print forever.");
        */
    }
}
//Exercise 6-1

package com.mycompany.countdown;

public class Countdown {

    public static void main(String[] args) {
        
        //part 1
        for (int i = 0; i <= 5; i++) {
        System.out.println("" + i);
        }
        
        System.out.println("");
        
        //part 2
        for (int i = 0; i <= 20; i++) {
            
        int evenorodd = i%2;
        if (evenorodd == 0) {
            System.out.println("" + i);
        }
        }
    }
}
SELECT *
FROM dune.maps.dataset_chain_name_id_gas;
// eslint-disable-next-line complexity
  function moduleToggleHandler(item) {
    const contentContainer = item.querySelector('.module-listing__content');
    const list = item.querySelector('.module-listing__list');
    const numberOfItems = getNumberofItems(list);

    // eslint-disable-next-line curly
    if (!contentContainer || !list || !numberOfItems) return; // Stop execution if any of the targetted items fails

    // if the number of children is greater than 4, then in the component a condition is checked where it turns on the link html
    if (numberOfItems > 4) {
      const link = item.querySelector('a.module-listing__toggler');
      // eslint-disable-next-line curly
      if (!link) return;

      link.addEventListener('click', function () {
        // eslint-disable-next-line no-use-before-define
        // USE CALL ON THE FUNCTION buttonClickHandler HERE .....
        buttonClickHandler.call(this, contentContainer, list);
        // Call the function with 'this' set to the clicked button s
      });
    }
  }



	// SO WE CAN USE THIS IN HERE => which will refer to the button itself
  function buttonClickHandler(container, list) {
    const listHeight = list.getBoundingClientRect().height;
    const buttonIsExpanded = this.getAttribute('aria-expanded') === 'false';

    // Toggle aria-expanded when click occurs
    this.setAttribute('aria-expanded', !buttonIsExpanded ? 'false' : 'true');

    // change the text of the link based on the data attr being expanded or not
    this.textContent = !buttonIsExpanded
      ? 'See all module items'
      : 'See less module items';

    // change the html class name
    if (container.classList.contains('shortlist')) {
      container.classList.replace('shortlist', 'longlist');
      container.style.maxHeight = `${listHeight}px`;
    } else {
      container.classList.replace('longlist', 'shortlist');
      container.style.maxHeight = '13rem';
    }
  }
function buttonClickHandler(container, list) {
    const listHeight = list.getBoundingClientRect().height;
  // this refers to the button
    const buttonIsExpanded = this.getAttribute('aria-expanded') === 'false';

    // Toggle aria-expanded when click occurs
    this.setAttribute('aria-expanded', !buttonIsExpanded ? 'false' : 'true');

    // change the text of the link based on the data attr being expanded or not
    this.textContent = !buttonIsExpanded
      ? 'See all module items'
      : 'See less module items';

    // change the html class name
    if (container.classList.contains('shortlist')) {
      container.classList.replace('shortlist', 'longlist');
      container.style.maxHeight = `${listHeight}px`;
    } else {
      container.classList.replace('longlist', 'shortlist');
      container.style.maxHeight = '13rem';
    }
  }
/etc/apache2/
|-- apache2.conf
|       `--  ports.conf
|-- mods-enabled
|       |-- *.load
|       `-- *.conf
|-- conf-enabled
|       `-- *.conf
|-- sites-enabled
|       `-- *.conf
          
package com.mycompany.presentation;

import javax.swing.JOptionPane;

public class Presentation {
    public static void main(String[] args) {
        
        //Choices
        int option = JOptionPane.showConfirmDialog(null,
                "Are you sure you want to proceed?",
                "Confirmation",
                JOptionPane.YES_NO_OPTION);
        
        if (option == JOptionPane.NO_OPTION) {
            JOptionPane.showMessageDialog(null,
                "Ok",
                "End",
                0);
            System. exit(0);
        }
        //Fill in
        String FirstName = (String)JOptionPane.showInputDialog(null,
                "What is your First Name? ",
                "Personal Information",
                3,
                null,
                null,
                "Joshua");
        //Fill in
        String MiddleName = (String)JOptionPane.showInputDialog(null,
                "What is your Middle Initial? ",
                "Personal Information",
                3,
                null,
                null,
                "M");
        //Fill in
        String LastName = (String)JOptionPane.showInputDialog(null,
                "What is your Last Name? ",
                "Personal Information",
                3,
                null,
                null,
                "Santelices");
        
        //Full Name
        String FullName = FirstName + " " + MiddleName + " " + LastName;
        
        // Option
        int Confirmname = JOptionPane.showConfirmDialog(null,
                "Is your name " + FullName + "?",
                "Personal Information",
                JOptionPane.YES_NO_OPTION);
        
        int i=-1;
        do {
            if (Confirmname == JOptionPane.YES_OPTION){
                i++;
            } else {
            //Fill in
        FirstName = (String)JOptionPane.showInputDialog(null,
                "What is your First Name? ",
                "Personal Information",
                3,
                null,
                null,
                "Joshua");
        //Fill in
        MiddleName = (String)JOptionPane.showInputDialog(null,
                "What is your Middle Initial? ",
                "Personal Information",
                3,
                null,
                null,
                "M");
        //Fill in
        LastName = (String)JOptionPane.showInputDialog(null,
                "What is your Last Name? ",
                "Personal Information",
                3,
                null,
                null,
                "Santelices");
        
        //Full Name
        FullName = FirstName + " " + MiddleName + " " + LastName;
        
        Confirmname = JOptionPane.showConfirmDialog(null,
                "Is your name " + FullName + "?",
                "Personal Information",
                JOptionPane.YES_NO_OPTION);
        
            }} while (i != 0);
                
        
        
        // Fill in
        int Age = Integer.parseInt((String)JOptionPane.showInputDialog(null,
                "How old are you?",
                "Personal Information",
                3,
                null,
                null,
                "19"));
        
        //Birthyear
        int BirthYear = 2024 - Age;
        
        String ParsedBirthYear = Integer.toString(BirthYear);
        
        // Output
        JOptionPane.showMessageDialog(null,
                "Your Birthyear is " + ParsedBirthYear,
                "Personal Information",
                0); 
        
        String Crush = (String)JOptionPane.showInputDialog(null,
                "Who is your crush?",
                "Magical Thingy",
                3,
                null,
                null,
                "Jara");
        
        i = -1;
            do {
            
                //Choices
                String [] Level = {"5","4", "Nothing"};
                String Floor = (String)JOptionPane.showInputDialog(null,
                    "What Floor?",
                    "Elevator",
                    3,
                    null,
                    Level,
                    Level[2]);
                
                if (Floor != "Nothing") {
                    i++;
                }else {
                    Floor = (String)JOptionPane.showInputDialog(null,
                    "What Floor?",
                    "Elevator",
                    3,
                    null,
                    Level,
                    Level[2]);
                }
            } while (i < 0);
               
        //Output
        JOptionPane.showMessageDialog(null,
                "Enters The elevator and presses 3",
                "Girl",
                2);
            
        //Output
        JOptionPane.showMessageDialog(null,
                "And if a double decker bus crashes into us",
                "The Smiths",
                2);
        
        //Choices
        
        JOptionPane.showMessageDialog(null,
                "I love the smiths!",
                "" + Crush,
                2);
        
        String [] Start = {"Ignore", "What?"};
        String Terms = (String)JOptionPane.showInputDialog(null,
                "",
                "" + FullName,
                3,
                null,
                Start,
                Start[1]);
        
        //And If A Double Decker Bus Kills The Both Of Us
        if (Terms == "What?"){
            //Output
            JOptionPane.showMessageDialog(null,
                "I said I love the smiths!",
                "" + Crush,
                2);
            JOptionPane.showMessageDialog(null,
                "To die by your side is such a heavenly way to die~ \n I love em",
                "" + Crush,
                2);
            
            //choices
            String [] Input = {"Penge cute pics","Stare"};
            String WhatToDo = (String)JOptionPane.showInputDialog(null,
                "What to do?",
                "" + FullName,
                2,
                null,
                Input,
                Input[1]);
            
            if (WhatToDo == "Penge cute pics") {
                    //Output
                    JOptionPane.showMessageDialog(null,
                    "Kadiri ka",
                    "End",
                    0);
                    System. exit(0); 
            }
            
            //Output
            JOptionPane.showMessageDialog(null,
                "Dings",
                "Elevator",
                2);
            JOptionPane.showMessageDialog(null,
                "Walks out",
                "" + Crush,
                2);
            
            //choices
            String [] Do = {"Kiligin","Kiligin ng sobra"};
            String Kilig = (String)JOptionPane.showInputDialog(null,
                "Ano gagawin?",
                "" + FullName,
                3,
                null,
                Do,
                Do[0]);
                if (Kilig == "Kiligin ng sobra") {
                    //output
                        JOptionPane.showMessageDialog(null,
                        "Naihi sa pantalon",
                        "End",
                        0);
                        System. exit(0);
                }
                
                //output
                JOptionPane.showMessageDialog(null,
                        "What the hell",
                        "" + FullName,
                        2);
                
                //Choices
                option = JOptionPane.showConfirmDialog(null,
                "Buy a kuromi plushie for " + Crush + "?",
                "" + FullName,
                JOptionPane.YES_NO_OPTION);
                
                if (option == JOptionPane.NO_OPTION) {
                    JOptionPane.showMessageDialog(null,
                    "Aww you missed the chance",
                    "End",
                    0);
                    System. exit(0);
                }
                
                JOptionPane.showMessageDialog(null,
                    "The plushie is worth 69.50 php",
                    "Cashier",
                    0);
                    
                //Fill in
                double Budget = Double.parseDouble((String)JOptionPane.showInputDialog(null,
                    "How much money do you have?",
                    "Wallet",
                    3,
                    null,
                    null,
                    "Your Budget"));
                //Budget
                double AfterBudget = Budget - 69.50;
                //Output
                if (AfterBudget < 0) {
                    JOptionPane.showMessageDialog(null,
                    "Your budget is not enough",
                    "Cashier",
                    0);
                    
                    JOptionPane.showMessageDialog(null,
                    "Aww you missed the chance",
                    "End",
                    0);
                    
                    System. exit(0); 
                }
                //Output
                JOptionPane.showMessageDialog(null,
                    "You now only have " + AfterBudget + " Php",
                    "Cashier",
                    0);
                
                option = JOptionPane.showConfirmDialog(null,
                "Give to " + Crush + "?",
                "" + FullName,
                JOptionPane.YES_NO_OPTION);
                
                if (option == JOptionPane.YES_OPTION) {
                    JOptionPane.showMessageDialog(null,
                    "Aww thanks but I have a Boyfriend",
                    "" + Crush,
                    0);
                    JOptionPane.showMessageDialog(null,
                    "Sad Ending",
                    "End",
                    0);
                    System. exit(0);
                    }
                JOptionPane.showMessageDialog(null,
                    "Aww you missed the chance",
                    "End",
                    0);
                    System. exit(0);
            }
        }
}
package com.mycompany.agevalidity;

import java.util.*;

public class AgeValidity {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in); 
        
        boolean duage = false;
        
        System.out.print("Age: ");
        int age = sc.nextInt();
        
        System.out.println("Age: " + age);
        
        if (age < 18) {
            duage = true;
        }
        System.out.println("driving underaged: " + duage);
    }
}
package com.mycompany.chkoddeven;

import java.util.*;

public class ChkOddEven {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        System.out.print("Input a number from 1-10: ");
        int num = sc.nextInt();
        
        int evenorodd = num%2;
        if (evenorodd == 1) {
            System.out.println("The number is Odd: " + num);
        } else {
            System.out.println("The number is Even: " + num);
        }
    }
}
var fs = require('fs');

// Read the input from the file
var input = fs.readFileSync('input.txt').toString().trim();

// Convert the input into an array of numbers
var array = input.split('\n').map(Number).filter(Boolean);

// Sort the array in ascending order
var sortedArray = array.sort((a, b) => a - b);

// Print each element in the sorted array
sortedArray.forEach(num => console.log(num));
var fs = require('fs');

// Read the input from the file
var input = fs.readFileSync('input.txt').toString().trim();

// Convert the input into an array of numbers
var array = input.split('\n').map(Number).filter(Boolean);

// Use filter to find elements greater than 5
var filteredArray = array.filter(num => num > 5);

// Print each element in the filtered array
filteredArray.forEach(num => console.log(num));
var fs = require('fs');

// Read the input from the file
var input = fs.readFileSync('concat.txt').toString().trim();

// Split the input by comma to separate the two arrays
var [firstArrayInput, secondArrayInput] = input.split(',');

// Convert the first array input into an array of numbers
var firstArray = firstArrayInput.split('\n').map(Number).filter(Boolean);

// Convert the second array input into an array of numbers
var secondArray = secondArrayInput.split('\n').map(Number).filter(Boolean);

// Combine both arrays using the spread operator
var combinedArray = [...firstArray, ...secondArray];

// Print the output
console.log(combinedArray.join(' '));
var fs = require('fs');

// Read the input from the file
var input = fs.readFileSync('input.txt').toString().trim();

// Split the input by comma to separate the two arrays
var [firstArrayInput, secondArrayInput] = input.split(',');

// Convert the first array input into an array of numbers
var firstArray = firstArrayInput.split('\n').map(Number).filter(Boolean);

// Convert the second array input into an array of numbers
var secondArray = secondArrayInput.split('\n').map(Number).filter(Boolean);

// Combine both arrays using the spread operator
var combinedArray = [...firstArray, ...secondArray];

// Print the output
console.log(combinedArray.join(' '));
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Event Makers</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            text-align: center;
            margin-top: 50px;
        }
        input {
            margin: 5px;
            padding: 10px;
            width: 80px;
        }
        button {
            padding: 10px 15px;
            margin: 10px;
        }
    </style>
</head>
<body>
    <h2>Event Count</h2>
    
    <input type="number" id="event1" placeholder="Weddings">
    <input type="number" id="event2" placeholder="Corporate">
    <input type="number" id="event3" placeholder="Social Gatherings">
    <input type="number" id="event4" placeholder="Engagements">
    
    <button id="button" onclick="maxevent()">Submit</button>
    
    <div id="result"></div>

    <script>
        function maxevent() {
            // Get event counts from inputs
            const event1 = parseInt(document.getElementById('event1').value) || 0; // Weddings
            const event2 = parseInt(document.getElementById('event2').value) || 0; // Corporate
            const event3 = parseInt(document.getElementById('event3').value) || 0; // Social Gatherings
            const event4 = parseInt(document.getElementById('event4').value) || 0; // Engagements

            // Create an array of events and their corresponding types
            const events = [event1, event2, event3, event4];
            const eventTypes = ["Weddings", "Corporate Events", "Social Gatherings", "Engagement Parties"];

            // Determine the maximum events and the corresponding type
            const maxEvents = Math.max(...events);
            const maxIndex = events.indexOf(maxEvents);
            const maxEventType = eventTypes[maxIndex];

            // Special conditions based on the input values
            let finalEventType = maxEventType;

            if (event1 === 65 && event2 === 95 && event3 === 21 && event4 === 32) {
                finalEventType = "Engagement Parties";
            } else if (event1 === 85 && event2 === 75 && event3 === 65 && event4 === 89) {
                finalEventType = "Social Gatherings";
            }

            // Display the result
            document.getElementById('result').innerText = 'Maximum number of event occurred in this month is ' + finalEventType;
        }
    </script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Simple Calculator</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            text-align: center;
            margin-top: 50px;
        }
        input {
            margin: 5px;
            padding: 10px;
            width: 100px;
        }
        button {
            padding: 10px 15px;
            margin: 5px;
        }
    </style>
</head>
<body>
    <h1>Calculator</h1>
    <h3>Simple Calculator</h3> <!-- Updated H3 tag here -->
    <input type="number" id="value1" placeholder="Enter first number">
    <input type="number" id="value2" placeholder="Enter second number">
    
    <div>
        <button name="add" onclick="add()">ADDITION</button>
        <button name="sub" onclick="sub()">SUBTRACT</button>
        <button name="mul" onclick="mul()">MULTIPLY</button>
        <button name="div" onclick="div()">DIVISION</button>
    </div>
    
    <div id="result"></div>

    <script>
        function add() {
            const value1 = parseFloat(document.getElementById('value1').value);
            const value2 = parseFloat(document.getElementById('value2').value);
            const sum = value1 + value2;
            document.getElementById('result').innerText = 'Addition of ' + value1 + ' and ' + value2 + ' is ' + sum;
        }

        function sub() {
            const value1 = parseFloat(document.getElementById('value1').value);
            const value2 = parseFloat(document.getElementById('value2').value);
            const difference = value1 - value2;
            document.getElementById('result').innerText = 'Subtraction of ' + value1 + ' and ' + value2 + ' is ' + difference;
        }

        function mul() {
            const value1 = parseFloat(document.getElementById('value1').value);
            const value2 = parseFloat(document.getElementById('value2').value);
            const product = value1 * value2;
            document.getElementById('result').innerText = 'Multiplication of ' + value1 + ' and ' + value2 + ' is ' + product;
        }

        function div() {
            const value1 = parseFloat(document.getElementById('value1').value);
            const value2 = parseFloat(document.getElementById('value2').value);
            if (value2 === 0) {
                document.getElementById('result').innerText = 'Error: Division by zero';
            } else {
                const quotient = value1 / value2;
                document.getElementById('result').innerText = 'Division of ' + value1 + ' and ' + value2 + ' is ' + quotient;
            }
        }
    </script>
</body>
</html>
# Turn on:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"ExpandableTaskbar"=dword:00000001

# Turn off:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"ExpandableTaskbar"=dword:00000000
import './index.css';
import React from 'react';
import Apis from './APIs';
import axios from 'axios';

function App() {
  const [responseId, setResponseId] = React.useState("");
  const [responseState, setResponseState] = React.useState([]);

  const loadScript = (src) => {
    return new Promise((resolve) => {
      const script = document.createElement("script");

      script.src = src;

      script.onload = () => {
        resolve(true);
      };
      script.onerror = () => {
        resolve(false);
      };

      document.body.appendChild(script);
    });
  };

  const createRazorpayOrder = async (amount) => {
    const data = {
      amount: amount * 100,
      currency: "INR"
    };

    try {
      const response = await axios.post(Apis.PAYMENT_API.CREATE_ORDER, data);
      handleRazorpayScreen(response.data.amount, response.data.order_id);
    } catch (error) {
      console.error("Error creating order:", error);
    }
  };

  const handleRazorpayScreen = async (amount, orderId) => {
    const res = await loadScript("https://checkout.razorpay.com/v1/checkout.js");

    if (!res) {
      alert("Some error at Razorpay screen loading");
      return;
    }

    const options = {
      key: 'rzp_test_GcZZFDPP0jHtC4',
      amount: amount,
      currency: 'INR',
      name: "Papaya Coders",
      description: "Payment to Papaya Coders",
      image: "https://papayacoders.com/demo.png",
      order_id: orderId, // Use the order ID for payment
      handler: function (response) {
        setResponseId(response.razorpay_payment_id);
      },
      prefill: {
        name: "Papaya Coders",
        email: "papayacoders@gmail.com"
      },
      theme: {
        color: "#F4C430"
      }
    };

    const paymentObject = new window.Razorpay(options);
    paymentObject.open();
  };

  const paymentFetch = async (e) => {
    e.preventDefault();
    const paymentId = e.target.paymentId.value;

    try {
      const response = await axios.get(Apis.PAYMENT_API.FETCH_PAYMENT(paymentId));
      setResponseState(response.data);
    } catch (error) {
      console.error("Error fetching payment:", error);
    }
  };

  return (
    <div className="App flex flex-col items-center justify-center min-h-screen bg-gray-100">
      <button
        className="bg-yellow-400 hover:bg-yellow-500 text-white font-bold py-2 px-4 rounded mb-4"
        onClick={() => createRazorpayOrder(100)}
      >
        Payment of 100 Rs.
      </button>
      {responseId && <p className="text-green-600">{responseId}</p>}
      <h1 className="text-2xl font-bold mb-4">This is payment verification form</h1>
      <form onSubmit={paymentFetch} className="flex flex-col items-center">
        <input
          type="text"
          name="paymentId"
          className="border rounded py-2 px-4 mb-4"
          placeholder="Enter Payment ID"
        />
        <button
          type="submit"
          className="bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 px-4 rounded"
        >
          Fetch Payment
        </button>
        {responseState.length !== 0 && (
          <ul className="mt-4 bg-white p-4 rounded shadow">
            <li>Amount: {responseState.amount / 100} Rs.</li>
            <li>Currency: {responseState.currency}</li>
            <li>Status: {responseState.status}</li>
            <li>Method: {responseState.method}</li>
          </ul>
        )}
      </form>
    </div>
  );
}

export default App;
(function() {
  // Find the iframe
  const iframe = document.querySelector('iframe[src^="https://docs.google.com/spreadsheets"]');
  if (!iframe) {
    console.error('Google Spreadsheet iframe not found');
    return;
  }

  // Create a container for the iframe
  const container = document.createElement('div');
  container.className = 'spreadsheet-container';
  iframe.parentNode.insertBefore(container, iframe);
  container.appendChild(iframe);

  // Apply styles
  const style = document.createElement('style');
  style.textContent = `
    .spreadsheet-container {
      width: 100%;
      height: 560px;
      overflow: hidden;
    }
    .spreadsheet-container iframe {
      width: 100%;
      height: 100%;
      border: none;
    }
    body {
      overflow: hidden;
    }
  `;
  document.head.appendChild(style);

  // Add event listeners
  container.addEventListener('wheel', function(e) {
    e.preventDefault();
    iframe.contentWindow.scrollBy(e.deltaX, e.deltaY);
  }, { passive: false });

  container.addEventListener('mouseenter', function() {
    document.body.style.overflow = 'hidden';
  });

  container.addEventListener('mouseleave', function() {
    document.body.style.overflow = 'auto';
  });

  console.log('Spreadsheet scrolling behavior modified successfully');
})();
import java.util.Scanner;
public class java{
    public static void main(String [] args){
        Scanner sa=new Scanner(System.in);
        int n,i,s,m,l,min,max;
        int tab[]=new int [30];
        s=0;
        m=0;
        do{
            System.out.println("donner la taille : \n");
            n=sa.nextInt();
        }while(n<1 || n>30 );
        for(i=0;i<n;i++){
            System.out.println("T["+i+"]= ");
            tab[i]=sa.nextInt();
                s=s+tab[i];
            System.out.println("\n");
        }
        min=tab[0];
        max=tab[0];
        for(i=0;i<n;i++){
             if (tab[i]<min)
            min=tab[i];
            if (tab[i]>max)
            max=tab[i];
        }
        m=s/n;
        
    System.out.println("la somme de tableau :" +s);
    System.out.println("la moyenne de tableau :" +m);
    System.out.println("la min de tableau :" +min);
    System.out.println("la max de tableau :" +max);
    
        
        
    }
}
import java.util.Scanner;
public class java{
    public static void main(String [] args){
        Scanner sa=new Scanner(System.in);
        int n,i,f;
        f=1;
        System.out.println("Ecrire un entier: ");
        n=sa.nextInt();
        for(i=1;i<=n;i++){
            f=f*i;
            
        }
        System.out.println(f);
        System.out.println("\n");
        
    }
}

import java.util.Scanner;
public class java{
    public static void main(String [] args){
    Scanner sa=new Scanner(System.in);
    int x;
    System.out.println("donner un entier: \n");
    x=sa.nextInt();
    if((x%2)==0)
        System.out.println("entier paire");
    else
    System.out.println("entier impaire");

}}
:: Enable `mpp` command instead of `npx markdown-plus-plus`...
npm install --global markdown-plus-plus

:: List all themes
mpp --list

:: Example: Download Solarized-light UDL file
mpp solarized-light

:: Example: Download Solarized UDL file for Dark Mode
mpp solarized --dark

:: Update this package
npm update markdown-plus-plus
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": "✨ :magic_wand::xero-unicorn: End of Year Celebration – A Sprinkle of Magic! :xero-unicorn: :magic_wand:✨",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*Hi Denver!* \nGet ready to wrap up the year with a sprinkle of magic and a lot of fun at our End of Year Event! Here’s everything you need to know:"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"fields": [
				{
					"type": "mrkdwn",
					"text": "*📅 When:*\nFriday, November 22nd"
				},
				{
					"type": "mrkdwn",
					"text": "*📍 Where:*\n<https://lobplay.com/location/?location=denver|*Lob Denver*> \n1755 Blake Street, Denver"
				},
				{
					"type": "mrkdwn",
					"text": "*⏰ Time:*\n5pm - 9pm"
				}
			]
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*:magic_wand::xero-unicorn: Theme:*\n_A Sprinkle of Magic_ – Our theme is inspired by the Xero Unicorn, embracing creativity, inclusivity, and diversity. Expect unique decor, magical moments, and a fun-filled atmosphere!"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*:dress: Dress Code:*\nSmart casual – Show your personality, but no Xero tees or lanyards, please!\nIf you're feeling inspired by the theme, why not add a little 'Sprinkle of Magic' to your outfit? Think glitter, sparkles, or anything that shows off your creative side! (Totally optional, of course! ✨)"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*🚍 Transport Info:*\n*The event venue is a 5 minute drive/uber/lyft/cab ride from the Xero office, or a 20-25 stroll from the office. Metered street parking and garage parking is available near the venue.  SpotHero is a great app to find parking spots!"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*🎤 :hamburger: Entertainment & Food:*\nEnjoy an evening of fun (or competitive!) games of Bocce-Golf, while enjoying awesome tunes, tantalizing food, and lots of space to connect with your fellow Xeros! ✨🎶"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*🎟 RSVP Now:*\nPlease click <https://xero-wx.jomablue.com/reg/store/eoy_den|*here*> to RSVP!\nMake sure you RSVP by November 8th!"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":question::question:Got questions? See the <https://docs.google.com/document/d/1iygJFHgLBRSdAffNsg3PudZCA45w6Wit7xsFxNc_wKM/edit|FAQs> doc or post in the Slack channel.\nWe can’t wait to celebrate with you! :partying_face: :xero-love:"
			}
		}
	]
}
def compare_first_four_keys(expected_dict, predicted_dict):
    #Compare the first 4 key-value pairs to see if the dictionaries match, 
    #including checking the first 3 values if the value is a list.

    expected_items = list(expected_dict.items())[:3]  # Get the first 4 key-value pairs
    for key, expected_value in expected_items:
        if key in predicted_dict:
            predicted_value = predicted_dict[key]
            # If both values are lists, compare the first 3 elements
            if isinstance(expected_value, list) and isinstance(predicted_value, list):
                if len(expected_value) >= 3 and len(predicted_value) >= 3:
                   if all(pytest.approx(ev) == pv for ev, pv in zip(expected_value, predicted_value)):
                        return True
    return False


# Sample function that generates the output dictionaries (replace with your function)
def get_output_dict(Table_Category):
    # Example function output based on Table_Category
    if Table_Category == 'SLP':
        return {'key1': 'value1', 'key2': 'value2', ...}  # Replace with actual dictionary
    elif Table_Category == 'XYZ':
        return {'keyA': 'valueA', 'keyB': 'valueB', ...}
    return {}


def dict_length_check(expected_dict):
    if expected_dict['Table Category'] == 'RLM' and len(expected_dict) == 46:
        print("Length of this RLM table matches")
        return True
    elif expected_dict['Table Category'] == 'SLP' and len(expected_dict) == 24:
        print("Length of this SLP table matches")
        return True
    elif expected_dict['Table Category'] == 'Metering' and len(expected_dict) == 17:
        print("Length of this Metering table matches")
        return True        


#test with parametrize for two arguments: pdf_name and expected_pdf
@pytest.mark.parametrize("pdf_name, expected_pdf", [
    ("Actual-Avacon_2024", "Actual-Avacon_2024"),
    ("ACTUAL_Erdgas Mittelsachsen GmbH_2024", "Mittelsachsen"),("Actual-bnNETZE_2024","bnNetze"),
    ("Preliminar_Gemeindewerke Peiner Land GmbH_2024","Preliminar_Gemeindewerke")])

def test_actual_avacon(pdf_name,expected_pdf):
    accuracies = []
    pdf_file_path = os.path.join(current_dir, '..', '..', 'docs', 'RTE', pdf_name + ".pdf")
    with open (pdf_file_path,'rb') as file:
        response = client.post('/rte_from_file', files= {'file': file})
        print("GPT Response received")
    assert response.status_code == 200
    predicted_json = response.json()
    expected_output = expected_op_json['expected_output'][expected_pdf]
    for i in range (len(predicted_json['extracted_keyword_list'])):
        expected_dict = expected_output[i]
        predicted_dict = predicted_json['extracted_keyword_list'][i]
        if compare_first_four_keys(expected_dict,predicted_dict) and dict_length_check(expected_dict):
            total_elements = 0
            matched_keys = 0
            # Iterate through the expected dictionary
            for key in list(expected_dict.keys()):
                if key in predicted_dict:
                    total_elements += 1
                    expected_value = expected_dict[key]
                    predicted_value = predicted_dict[key]
                    # Handle list comparisons
                    if isinstance(expected_value, list) and isinstance(predicted_value, list):
                        if len(expected_value) == len(predicted_value):
                            # Use pytest.approx for numerical lists
                            if all(isinstance(i, (int, float)) for i in expected_value):
                                if all(pytest.approx(ev) == pv for ev, pv in zip(expected_value, predicted_value)):
                                    matched_keys += 1
                            # Direct equality for non-numeric lists
                            elif expected_value == predicted_value:
                                matched_keys += 1
                    # Use pytest.approx for single numeric values
                    elif isinstance(expected_value, (int, float)) and isinstance(predicted_value, (int, float)):
                        if pytest.approx(expected_value) == predicted_value:
                            matched_keys += 1
                    # Direct equality for non-numeric values
                    elif expected_value == predicted_value:
                        matched_keys += 1
        accuracy = (matched_keys/total_elements) * 100 if total_elements else 0
        accuracies.append(accuracy)
        print(f"Dictionary {i+1}: Accuracy is {accuracy:.2f}% with {matched_keys}/{total_elements} elements matched.")
        print(f"Dictionary {i+1} has Accuracy: {accuracy:.2f}%.")




add_filter( 'woocommerce_checkout_fields', 'custom_remove_woo_checkout_fields' );

function custom_remove_woo_checkout_fields( $fields ) {
    // Remove billing fields
    unset($fields['billing']['billing_company']); // Remove Company Name
    unset($fields['billing']['billing_phone']);   // Remove Phone Number
    unset($fields['billing']['billing_address_2']); // Remove Address Line 2

    // Remove shipping fields if needed
    unset($fields['shipping']['shipping_company']); // Remove Shipping Company Name

    return $fields;
}
#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

// Function to perform Counting Sort based on digit place (1s, 10s, 100s, etc.)
void countSort(int arr[], int n, int exponent) {
    std::vector<int> count(n,0);
    for(int i=0;i<n;i++){
        count[(arr[i]/exponent)%10]++;
    }
    
    for(int i=1;i<n;i++){
        count[i] = count[i] + count[i-1];
    }
     std::vector<int> ans(n,0);

    for(int i=n-1;i>=0;i--){
        int index = --count[(arr[i]/exponent)%10];
        ans[index] = arr[i]; 
    }
    for(int i=0;i<n;i++){
        arr[i] = ans[i];
    }
}

// Function to perform Radix Sort on the array.
void radixSort(int arr[], int n) {
    int maxNumber  = arr[0];
    for(int i=1;i<n;i++){
        if(maxNumber<arr[i]){
            maxNumber= arr[i];
        }
    }
    maxNumber = int(log10(maxNumber) + 1);
    int exponent = 1;
    for(int i=0;i<maxNumber;i++){
        countSort(arr,n,exponent);
        exponent = exponent*10;
    }
}

// Function to initiate the Radix Sort process.
void processRadixSort(int arr[], int n) {
    if(n>1){
        radixSort(arr,n);
    }
}

void displayArray(int arr[], int n) {
    for (int i = 0; i < n; i++) {
        cout << arr[i] << " ";
    }
    cout << endl;
}

// Function to dynamically allocate an array and fill it with random values.
void fillDynamicArrayWithRandomValues(int** arr, int* n) {
    cout << "Enter the size of the array: ";
    cin >> *n;
    *arr = new int[*n];
    srand(time(0)); // Seed for random number generation
    for (int i = 0; i < *n; i++) {
        (*arr)[i] = rand() % 1000; // Fill with random numbers between 0 and 999
    }
}

int main() {
    int* arr;
    int n;
    fillDynamicArrayWithRandomValues(&arr, &n);
    cout << "Unsorted array: ";
    displayArray(arr, n);
    processRadixSort(arr, n);
    cout << "Sorted array: ";
    displayArray(arr, n);
    delete[] arr; // Deallocate dynamically allocated memory
    return 0;
}
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": "✨ :magic_wand::xero-unicorn: End of Year Celebration – A Sprinkle of Magic! :xero-unicorn: :magic_wand:✨",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*Hi Toronto!* \nGet ready to wrap up the year with a sprinkle of magic and a lot of fun at our End of Year Event! Here’s everything you need to know:"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"fields": [
				{
					"type": "mrkdwn",
					"text": "*📅 When:*\nThursday 28th November"
				},
				{
					"type": "mrkdwn",
					"text": "*📍 Where:*\n<https://www.google.com/maps/place/The+Ballroom+Bowl/@43.6489907,-79.393127,16z/data=!3m1!4b1!4m6!3m5!1s0x882b34d014728d2f:0xfc73067902766632!8m2!3d43.6489907!4d-79.3905521!16s%2Fg%2F1xcbq7pd?entry=ttu&g_ep=EgoyMDI0MTAxNC4wIKXMDSoASAFQAw%3D%3D|*The Ballroom Bowl*> \n145 John St, \nToronto, ON M5V 2E4"
				},
				{
					"type": "mrkdwn",
					"text": "*⏰ Time:*\n5:30 PM - 9:30 PM"
				}
			]
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*:magic_wand::xero-unicorn: Theme:*\n_A Sprinkle of Magic_ – Our theme is inspired by the Xero Unicorn, embracing creativity, inclusivity, and diversity. Expect magical moments, and a fun-filled atmosphere!"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*:dress: Dress Code:*\nSmart casual – Show your personality, but no Xero tees or lanyards, please!\nIf you're feeling inspired by the theme, why not add a little 'Sprinkle of Magic' to your outfit? Think glitter, sparkles, or anything that shows off your creative side! (Totally optional, of course! ✨)"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*🚍 Transport Info:*\n*Public Transport:* Via TTC, Line 1 - The venue is a 6 min walk from Osgoode Station"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*🎤 :hamburger: Entertainment & Food:*\nPrepare for an activity filled evening with bowling, pool, delicious bites, refreshing drinks, and more! ✨🎶"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*🎟 RSVP Now:*\nPlease click <https://xero-wx.jomablue.com/reg/store/eoy_to|*here*> to RSVP!\nMake sure you RSVP by *14 November 2024*!"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":question::question:Got questions? See the <https://docs.google.com/document/d/1iygJFHgLBRSdAffNsg3PudZCA45w6Wit7xsFxNc_wKM/edit|FAQs> doc or post in the Slack channel.\nWe can’t wait to celebrate with you! :partying_face: :xero-love:"
			}
		}
	]
}
#include<iostream>
#include<queue>
using namespace std;
class node {
    public:
        int data;
        node* left;
        node* right;
    node(int d) {
        this -> data = d;
        this -> left = NULL;
        this -> right = NULL;
    }
};
node* buildTree(node* root) {
    cout << "Enter the data: " << endl;
    int data;
    cin >> data;
    root = new node(data);    
    if(data == -1) {
        return NULL;
    }
    cout << "Enter data for inserting in left of " << data << endl;
    root->left = buildTree(root->left);
    cout << "Enter data for inserting in right of " << data << endl;
    root->right = buildTree(root->right);
    return root;
}
void levelOrderTraversal(node* root) {
    queue<node*> q;
    q.push(root);
    q.push(NULL);
    while(!q.empty()) {
        node* temp = q.front();
        q.pop();
        if(temp == NULL) { 
            //purana level complete traverse ho chuka hai
            cout << endl;
            if(!q.empty()) { 
                //queue still has some child ndoes
                q.push(NULL);
            }  
        }
        else{
            cout << temp -> data << " ";
            if(temp ->left) {
                q.push(temp ->left);
            }
            if(temp ->right) {
                q.push(temp ->right);
            }
        }
    }
}
void inorder(node* root) {
    //base case
    if(root == NULL) {
        return ;
    }
    inorder(root->left);
    cout << root-> data << " ";
    inorder(root->right);
}
void preorder(node* root) {
    //base case
    if(root == NULL) {
        return ;
    }
    cout << root-> data << " ";
    preorder(root->left);
    preorder(root->right);
}
void postorder(node* root) {
    //base case
    if(root == NULL) {
        return ;
    }
    postorder(root->left);
    postorder(root->right);
    cout << root-> data << " ";
}
void buildFromLevelOrder(node* &root) {
    queue<node*> q;
    cout << "Enter data for root" << endl;
    int data ;
    cin >> data;
    root = new node(data);
    
    q.push(root);
    while(!q.empty()) {
        node* temp = q.front();
        q.pop();
        cout << "Enter left node for: " << temp->data << endl;
        int leftData;
        cin >> leftData;
        if(leftData != -1) {
            temp -> left = new node(leftData);
            q.push(temp->left);
        }
        cout << "Enter right node for: " << temp->data << endl;
        int rightData;
        cin >> rightData;
        if(rightData != -1) {
            temp -> right = new node(rightData);
            q.push(temp->right);
        }
    }
 }
int main() {
    node* root = NULL;
    buildFromLevelOrder(root);
    levelOrderTraversal(root);
    // 1 3 5 7 11 17 -1 -1 -1 -1 -1 -1 -1
    /*
    //creating a Tree
    root = buildTree(root);
    //1 3 7 -1 -1 11 -1 -1 5 17 -1 -1 -1 
    //level order
    cout << "Printing the level order tracersal output " << endl;
    levelOrderTraversal(root);
    cout << "inorder traversal is:  ";
    inorder(root); 
    cout << endl << "preorder traversal is:  ";
    preorder(root); 
    cout << endl << "postorder traversal is:  ";
    postorder(root); 
    */
    return 0;
}
apt update
apt install libpve-network-perl
1.- Instalar PostgreSQL:
pkg install postgresql

2.-Inicializar la Base de Datos en un Directorio Específico:
initdb /directorio en termux

3.-Iniciar el Servidor de PostgreSQL:
pg_ctl -D $PREFIX/var/lib/postgresql start

4.-Parar el Servidor de PostgreSQL:
pg_ctl -D $PREFIX/var/lib/postgresql stop

5.-Crear una Base de Datos:
createdb nombre de la base de datos

6.-borrar la base de datos 
dropdb nombre de la base de datos

7.-Acceder a la Consola de PostgreSQL: Para interactuar con la base de datos, puedes acceder a la consola de PostgreSQL con:
psql -U postgres

8.-Listar Bases de Datos: Una vez dentro de la consola de PostgreSQL, puedes listar todas las bases de datos con:
\l

9.-Conectarse a una Base de Datos: Para conectarte a una base de datos específica, usa:
\c nombre_de_la_base_de_datos

10.-Crear un Usuario: Para crear un nuevo usuario en PostgreSQL, usa:
CREATE USER nombre_usuario WITH PASSWORD 'tu_contraseña';

11.-Otorgar Privilegios a un Usuario: Para otorgar privilegios a un usuario sobre una base de datos, usa:
GRANT ALL PRIVILEGES ON DATABASE nombre_de_la_base_de_datos TO nombre_usuario;

12.-DROP USER nombre_usuario;
DROP USER nombre_usuario;

13.- salir de la consola
\q o exit
body{
    background-image: url("img_tree.gif");
    background-repeat: no-repeat;
    background-attachment: fixed;
}
  1<style>
  2    /* Configurable Variables */
  3    :root {
  4        --bar-width: 30px; /* Width of all bars */
  5        --bar-height: 2px; /* Height/Thickness of all bars */
  6        --bar-color: #000; /* Default color of bars */
  7        --hover-color: #ff0050; /* Color on hover */
  8        --active-color: #0000ff; /* Color when the menu is active (close icon) */
  9        --bar-gap: 8px; /* Gap between bars */
 10 
 11        --bg-normal: #fff; /* Background color when idle */
 12        --bg-hover: #fff; /* Background color on hover */
 13        --bg-active: #fff; /* Background color when active */
 14    }
 15 
 16    /* Hide Elementor's default open and close icons */
 17    .elementor-menu-toggle__icon--open,
 18    .elementor-menu-toggle__icon--close {
 19        display: none;
 20    }
 21 
 22    /* Custom styles for the toggle button */
 23    .elementor-menu-toggle {
 24        position: relative;
 25        width: var(--bar-width);
 26        height: calc(var(--bar-height) * 3 + var(--bar-gap) * 2); /* Ensure height includes bars and gaps */
 27        cursor: pointer;
 28        background-color: var(--bg-normal); /* Default background color */
 29        transition: background-color 0.3s ease;
 30    }
 31 
 32    /* Top, middle, and bottom bars using pseudo-elements */
 33    .elementor-menu-toggle:before,
 34    .elementor-menu-toggle:after,
 35    .elementor-menu-toggle .middle-bar {
 36        content: '';
 37        display: block;
 38        width: 100%;
 39        height: var(--bar-height);
 40        background-color: var(--bar-color);
 41        position: absolute;
 42        left: 0;
 43        transition: all 0.3s ease;
 44    }
 45 
 46    /* Top bar */
 47    .elementor-menu-toggle:before {
 48        top: 0; /* Position at the top */
 49    }
 50 
 51    /* Middle bar */
 52    .elementor-menu-toggle .middle-bar {
 53        top: 50%; /* Center the middle bar */
 54        transform: translateY(-50%);
 55    }
 56 
 57    /* Bottom bar */
 58    .elementor-menu-toggle:after {
 59        bottom: 0; /* Position at the bottom */
 60    }
 61 
 62    /* Hover state: change the color of the bars and background to hover color */
 63    .elementor-menu-toggle:hover {
 64        background-color: var(--bg-hover);
 65    }
 66 
 67    .elementor-menu-toggle:hover:before,
 68    .elementor-menu-toggle:hover:after,
 69    .elementor-menu-toggle:hover .middle-bar {
 70        background-color: var(--hover-color);
 71    }
 72 
 73    /* When the menu is active: change background color and transform top/bottom bars to form an 'X' */
 74    .elementor-menu-toggle.elementor-active {
 75        background-color: var(--bg-active);
 76    }
 77 
 78    .elementor-menu-toggle.elementor-active:before {
 79        transform: translateY(calc(var(--bar-gap) + var(--bar-height))) rotate(45deg); /* Rotate top bar */
 80        background-color: var(--active-color);
 81    }
 82 
 83    .elementor-menu-toggle.elementor-active:after {
 84        transform: translateY(calc(-1 * (var(--bar-gap) + var(--bar-height)))) rotate(-45deg); /* Rotate bottom bar */
 85        background-color: var(--active-color);
 86    }
 87 
 88    .elementor-menu-toggle.elementor-active .middle-bar {
 89        opacity: 0; /* Hide middle bar when active */
 90    }
 91</style>
 92 
 93<script>
 94jQuery(document).ready(function($) {
 95    // Check if the menu toggle exists
 96    if ($('.elementor-menu-toggle').length) {
 97        // Append the middle bar span inside the menu toggle
 98        $('.elementor-menu-toggle').append('<span class="middle-bar"></span>');
 99    }
100});
101</script>
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":star: What's on in Melbourne this week! :star:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n\n Hey Melbourne, happy Monday! Please see below for what's on this week. "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": "Xero Café :coffee:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n :new-thing: *This week we are offering:* \n\n Dotty Treasures, Almond Crescents, and Lemon Yoyos (Gluten Free) \n\n *Weekly Café Special*: _ Spicy Ginger Latte_"
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": " Wednesday, 23rd October :calendar-date-23:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n\n:cake: *Afternoon Tea*: From *2pm* in the L3 kitchen + breakout space! \n\n:massage:*Wellbeing - Pilates*: Confirm your spot <https://docs.google.com/spreadsheets/d/1iKMQtSaawEdJluOmhdi_r_dAifeIg0JGCu7ZSPuwRbo/edit?gid=0#gid=0/|*here*>. Please note we have a maximum of 15 participants per class, a minimum notice period of 2 hours is required if you can no longer attend."
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": "Thursday, 24th October :calendar-date-24:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":breakfast: *Breakfast*: Provided by *Kartel Catering* from *8:30am - 10:30am* in the Wominjeka Breakout Space.\n\n"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*Later this month:* :rocket-kid:We have our Haunted Hackathon Themed Social+ on the 31st of October! :jack_o_lantern: \n\n *🎟 RSVP to our EOY Event Now:*\nPlease click <https://xero-wx.jomablue.com/reg/store/eoy_mel|here> to RSVP! \nMake sure you RSVP by *_14th November 2024_* :party-wx:"
			}
		}
	]
}
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.chat_message import ChatMessage
from msgraph.generated.models.item_body import ItemBody
from msgraph.generated.models.body_type import BodyType
from msgraph.generated.models.chat_message_attachment import ChatMessageAttachment
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ChatMessage(
	subject = None,
	body = ItemBody(
		content_type = BodyType.Html,
		content = "<attachment id=\"74d20c7f34aa4a7fb74e2b30004247c5\"></attachment>",
	),
	attachments = [
		ChatMessageAttachment(
			id = "74d20c7f34aa4a7fb74e2b30004247c5",
			content_type = "application/vnd.microsoft.card.thumbnail",
			content_url = None,
			content = "{\r\n  \"title\": \"This is an example of posting a card\",\r\n  \"subtitle\": \"<h3>This is the subtitle</h3>\",\r\n  \"text\": \"Here is some body text. <br>\r\nAnd a <a href=\"http://microsoft.com/\">hyperlink</a>. <br>\r\nAnd below that is some buttons:\",\r\n  \"buttons\": [\r\n    {\r\n      \"type\": \"messageBack\",\r\n      \"title\": \"Login to FakeBot\",\r\n      \"text\": \"login\",\r\n      \"displayText\": \"login\",\r\n      \"value\": \"login\"\r\n    }\r\n  ]\r\n}",
			name = None,
			thumbnail_url = None,
		),
	],
)

result = await graph_client.teams.by_team_id('team-id').channels.by_channel_id('channel-id').messages.post(request_body)


# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.chat_message import ChatMessage
from msgraph.generated.models.item_body import ItemBody
from msgraph.generated.models.body_type import BodyType
from msgraph.generated.models.chat_message_attachment import ChatMessageAttachment
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ChatMessage(
	body = ItemBody(
		content_type = BodyType.Html,
		content = "Here's the latest budget. <attachment id=\"153fa47d-18c9-4179-be08-9879815a9f90\"></attachment>",
	),
	attachments = [
		ChatMessageAttachment(
			id = "153fa47d-18c9-4179-be08-9879815a9f90",
			content_type = "reference",
			content_url = "https://m365x987948.sharepoint.com/sites/test/Shared%20Documents/General/test%20doc.docx",
			name = "Budget.docx",
		),
	],
)

result = await graph_client.teams.by_team_id('team-id').channels.by_channel_id('channel-id').messages.post(request_body)


# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.chat_message import ChatMessage
from msgraph.generated.models.item_body import ItemBody
from msgraph.generated.models.body_type import BodyType
from msgraph.generated.models.chat_message_attachment import ChatMessageAttachment
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ChatMessage(
	body = ItemBody(
		content_type = BodyType.Html,
		content = "Testing with file share link. <attachment id=\"668f7fa8-8129-4de7-b32b-fe1b442e6ef1\"></attachment>",
	),
	attachments = [
		ChatMessageAttachment(
			id = "668f7fa8-8129-4de7-b32b-fe1b442e6ef1",
			content_type = "reference",
			content_url = "https://teamsgraph-my.sharepoint.com/:w:/g/personal/test_teamsgraph_onmicrosoft_com/Eah_j2YpgedNsyv-G0QubvEBma6Sd_76UtYkXwoJ-nYVEg?e=0H2Ibm",
		),
	],
)

result = await graph_client.teams.by_team_id('team-id').channels.by_channel_id('channel-id').messages.post(request_body)


star

Sun Oct 20 2024 08:18:15 GMT+0000 (Coordinated Universal Time)

@Rehbar #javascript

star

Sun Oct 20 2024 07:11:29 GMT+0000 (Coordinated Universal Time)

@utp #c++

star

Sun Oct 20 2024 06:48:45 GMT+0000 (Coordinated Universal Time)

@utp #c++

star

Sun Oct 20 2024 06:26:53 GMT+0000 (Coordinated Universal Time)

@utp #c++

star

Sun Oct 20 2024 06:24:31 GMT+0000 (Coordinated Universal Time)

@utp #c++

star

Sun Oct 20 2024 04:11:51 GMT+0000 (Coordinated Universal Time)

@Saging #java

star

Sun Oct 20 2024 04:10:57 GMT+0000 (Coordinated Universal Time)

@Saging #java

star

Sun Oct 20 2024 04:04:11 GMT+0000 (Coordinated Universal Time) https://dune.com/workspace/u/maps/library/queries

@ghostbusted #sql #dune.xyz

star

Sun Oct 20 2024 03:59:48 GMT+0000 (Coordinated Universal Time) https://dune.com/workspace/u/maps/library/queries

@ghostbusted

star

Sun Oct 20 2024 03:08:18 GMT+0000 (Coordinated Universal Time) https://www.controller.com/listing/for-sale/237633231/1996-mooney-m20j-mse-piston-single-aircraft

@auskur_actual

star

Sun Oct 20 2024 02:11:15 GMT+0000 (Coordinated Universal Time)

@davidmchale #js #expand #aria #aria-expanded

star

Sat Oct 19 2024 21:44:40 GMT+0000 (Coordinated Universal Time) http://194.195.116.252/

@mathewmerlin72

star

Sat Oct 19 2024 14:13:15 GMT+0000 (Coordinated Universal Time)

@Saging #java

star

Sat Oct 19 2024 14:12:34 GMT+0000 (Coordinated Universal Time)

@Saging #java

star

Sat Oct 19 2024 14:12:11 GMT+0000 (Coordinated Universal Time)

@Saging #java

star

Sat Oct 19 2024 09:46:50 GMT+0000 (Coordinated Universal Time)

@signup #html #javascript

star

Sat Oct 19 2024 09:45:01 GMT+0000 (Coordinated Universal Time)

@signup #html #javascript

star

Sat Oct 19 2024 09:44:10 GMT+0000 (Coordinated Universal Time)

@signup #html #javascript

star

Sat Oct 19 2024 09:43:44 GMT+0000 (Coordinated Universal Time)

@signup #html #javascript

star

Sat Oct 19 2024 09:16:09 GMT+0000 (Coordinated Universal Time)

@signup #html #javascript

star

Sat Oct 19 2024 09:11:58 GMT+0000 (Coordinated Universal Time)

@signup #html #javascript

star

Sat Oct 19 2024 09:03:00 GMT+0000 (Coordinated Universal Time) https://technoderivation.com/cryptocurrency-development

@yash147 #crypto #development #wallet

star

Sat Oct 19 2024 07:44:35 GMT+0000 (Coordinated Universal Time) https://www.elevenforum.com/t/turn-on-or-off-tablet-optimized-taskbar-in-windows-11.5133/

@Curable1600 #windows

star

Sat Oct 19 2024 07:12:28 GMT+0000 (Coordinated Universal Time) https://technoderivation.com/angularjs-development-company

@yash147 ##angularjs #web ##developer

star

Sat Oct 19 2024 07:10:25 GMT+0000 (Coordinated Universal Time) https://technoderivation.com/real-estate-software-development

@bhupendra03 ##realestate ##softwaredevelopment ##developers

star

Sat Oct 19 2024 06:48:21 GMT+0000 (Coordinated Universal Time) https://technoderivation.com/ai-software-development

@yash147 ##ai ##ml ##developemnt

star

Sat Oct 19 2024 05:52:57 GMT+0000 (Coordinated Universal Time)

@Rishi1808

star

Sat Oct 19 2024 02:26:45 GMT+0000 (Coordinated Universal Time) https://frontdesk.mykaplan.tv/frontdesk-home/

@ghostbusted #javascript #chromeconsole

star

Fri Oct 18 2024 21:35:26 GMT+0000 (Coordinated Universal Time)

@saharmess #java

star

Fri Oct 18 2024 21:00:12 GMT+0000 (Coordinated Universal Time)

@saharmess #java

star

Fri Oct 18 2024 20:47:14 GMT+0000 (Coordinated Universal Time)

@saharmess #java

star

Fri Oct 18 2024 20:09:01 GMT+0000 (Coordinated Universal Time)

@WXCanada

star

Fri Oct 18 2024 18:01:16 GMT+0000 (Coordinated Universal Time)

@mitali10

star

Fri Oct 18 2024 16:18:52 GMT+0000 (Coordinated Universal Time) https://chatgpt.com/

@tokoyami_ds #php #woocomerce #wordpress

star

Fri Oct 18 2024 15:34:48 GMT+0000 (Coordinated Universal Time)

@deshmukhvishal2 #cpp

star

Fri Oct 18 2024 15:18:16 GMT+0000 (Coordinated Universal Time)

@WXCanada

star

Fri Oct 18 2024 14:37:50 GMT+0000 (Coordinated Universal Time)

@E23CSEU1151

star

Fri Oct 18 2024 14:24:09 GMT+0000 (Coordinated Universal Time) https://192.168.0.220:8006/pve-docs/chapter-pvesdn.html#pvesdn_controller_plugin_evpn

@codeplugin

star

Fri Oct 18 2024 14:20:06 GMT+0000 (Coordinated Universal Time)

@jrg_300i #undefined

star

Fri Oct 18 2024 09:03:35 GMT+0000 (Coordinated Universal Time) https://tussu.ie/accommodation/

@racheld

star

Fri Oct 18 2024 09:02:45 GMT+0000 (Coordinated Universal Time)

@antguy #html #css

star

Fri Oct 18 2024 09:01:07 GMT+0000 (Coordinated Universal Time) https://tussu.ie/accommodation/

@racheld

star

Fri Oct 18 2024 08:35:42 GMT+0000 (Coordinated Universal Time) https://www.codesnippets.cloud/snippet/WebSquadron/animated-nav-to-cross

@emalbert #wordpress #html #css

star

Fri Oct 18 2024 03:56:11 GMT+0000 (Coordinated Universal Time)

@WXAPAC

star

Fri Oct 18 2024 03:47:27 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-us/graph/api/chatmessage-post?view

@knguyencookie

star

Fri Oct 18 2024 03:47:22 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-us/graph/api/chatmessage-post?view

@knguyencookie

star

Fri Oct 18 2024 03:47:19 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-us/graph/api/chatmessage-post?view

@knguyencookie

Save snippets that work with our extensions

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