Snippets Collections
Earliest Date

= #date(Date.Year(List.Min(Source[OrderDate])),1,1)

Latest Date

= #date(Date.Year(List.Max(Source[RequiredDate])),12,31)

(Dynamic) Calendar
let
    Source = {Number.From(pmEarliestDate)..Number.From(pmLatestDate)},
    #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Renamed Columns" = Table.RenameColumns(#"Converted to Table",{{"Column1", "Date"}}),
    #"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns",{{"Date", type date}})
in
    #"Changed Type"
/----If we want to start slider in post type insert this code for cdn files--------/
 
function slick_cdn_enqueue_scripts(){
	wp_enqueue_style( 'slick-style', '//cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.css' );
	wp_enqueue_script( 'slick-script', '//cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.min.js', array(), null, true );
}
add_action( 'wp_enqueue_scripts', 'slick_cdn_enqueue_scripts' );
 
 
 
/----------------------- Custom Post type Services ------------------------------------/
//Services Post Type
add_action('init', 'services_post_type_init');
function services_post_type_init()
{
 
    $labels = array(
 
        'name' => __('Services', 'post type general name', ''),
        'singular_name' => __('Services', 'post type singular name', ''),
        'add_new' => __('Add New', 'Services', ''),
        'add_new_item' => __('Add New Services', ''),
        'edit_item' => __('Edit Services', ''),
        'new_item' => __('New Services', ''),
        'view_item' => __('View Services', ''),
        'search_items' => __('Search Services', ''),
        'not_found' =>  __('No Services found', ''),
        'not_found_in_trash' => __('No Services found in Trash', ''),
        'parent_item_colon' => ''
    );
    $args = array(
        'labels' => $labels,
        'public' => true,
        'publicly_queryable' => true,
        'show_ui' => true,
        'rewrite' => true,
        'query_var' => true,
        'menu_icon' => get_stylesheet_directory_uri() . '/images/testimonials.png',
        'capability_type' => 'post',
        'hierarchical' => true,
        'public' => true,
        'has_archive' => true,
        'show_in_nav_menus' => true,
        'menu_position' => null,
        'rewrite' => array(
            'slug' => 'services',
            'with_front' => true
        ),
        'supports' => array(
            'title',
            'editor',
            'thumbnail'
        )
    );
 
    register_post_type('services', $args);
}
 
 
=============================
SHORTCODE
=============================
 
// Add Shortcode [our_services];
add_shortcode('our_services', 'codex_our_services');
function codex_our_services()
{
    ob_start();
    wp_reset_postdata();
?>
 
    <div class="row ">
        <div id="owl-demo" class="owl-carousel ser-content">
            <?php
            $arg = array(
                'post_type' => 'services',
                'posts_per_page' => -1,
            );
            $po = new WP_Query($arg);
            ?>
            <?php if ($po->have_posts()) : ?>
 
                <?php while ($po->have_posts()) : ?>
                    <?php $po->the_post(); ?>
                    <div class="item">
                        <div class="ser-body">
                            <a href="#">
                                <div class="thumbnail-blog">
                                    <?php echo get_the_post_thumbnail(get_the_ID(), 'full'); ?>
                                </div>
                                <div class="content">
                                    <h3 class="title"><?php the_title(); ?></h3>
<!--                                     <p><?php //echo wp_trim_words(get_the_content(), 25, '...'); ?></p> -->
                                </div>
                            </a>
                            <div class="readmore">
                                <a href="<?php echo get_permalink() ?>">Read More</a>
                            </div>
                        </div>
                    </div>
                <?php endwhile; ?>
 
            <?php endif; ?>
        </div>
    </div>
 
 
<?php
    wp_reset_postdata();
    return '' . ob_get_clean();
}
add_filter('use_block_editor_for_post', '__return_false', 10);
add_filter( 'use_widgets_block_editor', '__return_false' )
   var _email = new MimeMessage();
            _email.From.Add(MailboxAddress.Parse(_config.GetSection("EmailConfiguration:Username").Value));
            _email.To.AddRange(to.Select(x => MailboxAddress.Parse(x)).ToList());
            _email.Subject = request.Subject;

            if (parameters != null)
            {
                foreach (var parameter in parameters)
                {
                    request.Body = request.Body.Replace(parameter.Key, parameter.Value);
                }
            }

            _email.Body = new TextPart(TextFormat.Html) { Text = request.Body };

            using var smtp = new SmtpClient();
            await smtp.ConnectAsync(_config.GetSection("EmailConfiguration:Host").Value, 587, SecureSocketOptions.StartTls);
            await smtp.AuthenticateAsync(_config.GetSection("EmailConfiguration:Username").Value, _config.GetSection("EmailConfiguration:Password").Value);
            await smtp.SendAsync(_email);
            await smtp.DisconnectAsync(true);
services.AddHangfire(x => x.UseStorage(
             new OracleStorage(
             Configuration.GetConnectionString("ConnectionString"),
             new OracleStorageOptions
             {
                 TransactionIsolationLevel = System.Data.IsolationLevel.ReadCommitted,
                 QueuePollInterval = TimeSpan.FromSeconds(15),
                 JobExpirationCheckInterval = TimeSpan.FromHours(1),
                 CountersAggregateInterval = TimeSpan.FromMinutes(5),
                 PrepareSchemaIfNecessary = true,
                 DashboardJobListLimit = 50000,
                 TransactionTimeout = TimeSpan.FromMinutes(1),
                 SchemaName = appSettings.DatabaseSchema
             })
            ));
            services.AddHangfireServer();
----------------------------------------------------------
  app.UseHangfireDashboard("/hangfiredash", new DashboardOptions
            {
                DashboardTitle = "Sample Jobs",
                Authorization = new[]
            {
                new  HangfireAuthorizationFilter("admin")
            }
            });
--------------------------------Cron Expression--------------------------
https://crontab.guru/#00_01_*/01_*_*
<!DOCTYPE html>

<html>

<head>

<meta name="_token" content="{{ csrf_token() }}">



<title>Live Search</title>

<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>

</head>

<body>

<div class="container">

<div class="row">

<div class="panel panel-default">

<div class="panel-heading">

<h3>Products info </h3>

</div>

<div class="panel-body">

<div class="form-group">

<input type="text" class="form-controller" id="search" name="search"></input>

</div>

<table class="table table-bordered table-hover">

<thead>

<tr>

<th>ID</th>

<th>Product Name</th>

<th>Description</th>

<th>Price</th>

</tr>

</thead>

<tbody>

</tbody>

</table>

</div>

</div>

</div>

</div>

<script type="text/javascript">

$('#search').on('keyup',function(){

$value=$(this).val();

$.ajax({

type : 'get',

url : '{{URL::to('search')}}',

data:{'search':$value},

success:function(data){

$('tbody').html(data);

}

});



})

</script>

<script type="text/javascript">

$.ajaxSetup({ headers: { 'csrftoken' : '{{ csrf_token() }}' } });

</script>

</body>

</html>

1. Create File "Dockerfile" in same directory as "docker-compose.yaml"
2. Write 
FROM apache/airflow:2.0.2
RUN pip install --no-cache-dir geopandas another-package
3. Build new image:
docker build . --tag projectname-airflow:2.0.2
4. In "docker-compose.yaml" replace
image: ${AIRFLOW_IMAGE_NAME:-apache/airflow:2.0.2}
with 
image: ${AIRFLOW_IMAGE_NAME:-projectname-airflow:2.0.2}
5. In Shell move to directory an run
docker build . --tag projectname-airflow:2.0.2
6. Epic win
Sub RemoveDuplicatesAndKeepLatest()
    Dim ws As Worksheet
    Set ws = [thisworkbook](/activeworkbook-thisworkbook/).Sheets("YourSheetName") ' Assign [Worksheet](/vba/sheets-worksheets) object to "ws". Replace "YourSheetName" with the actual sheet name

    ' Assuming Column D contains the timestamp
    Dim lastRow As Long
    lastRow = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row  ' Find the last row in the worksheet

    ' Perform sort operation based on columns 1,3 and timestamp in Column D (adjust accordingly)
    With ws.Sort
        .SortFields.Clear  
        .SortFields.Add Key:=ws.Range("A2:A" & lastRow), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal   ' Sort on column A ascendingly
        .SortFields.Add Key:=ws.Range("C2:C" & lastRow), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal   ' Sort on column C ascendingly
        .SortFields.Add Key:=ws.Range("D2:D" & lastRow), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal  ' Sort on column D descendingly (to keep the latest)
        .SetRange ws.Range("A1:AD" & lastRow) 
        .Header = xlYes  
        .MatchCase = False  
        .Orientation = xlTopToBottom  
        .SortMethod = xlPinYin  
        .Apply  ' Apply the sorting to the range
    End With

    ' Loop through the sorted range and remove duplicates, keeping the latest occurrence
    Dim currentRow As Long
    For currentRow = lastRow To 3 Step -1 ' Loop from the bottom of sheet to the top
        If ws.Cells(currentRow, 1).Value = ws.Cells(currentRow - 1, 1).Value And _
           ws.Cells(currentRow, 3).Value = ws.Cells(currentRow - 1, 3).Value Then
            ' If corresponding cells in Column A and Column C are identical, delete the current row
            ws.Rows(currentRow).Delete  ' Delete the row
        End If
    Next currentRow
End Sub
	&::-webkit-scrollbar {
		height: 10px;
	}

	&::-webkit-scrollbar-track {
		box-shadow: inset 0 0 5px grey;
		border-radius: 10px;
	}

	&::-webkit-scrollbar-thumb {
		border-radius: 10px;
		-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
		background: #2c3e50;
		border: solid 3px #1c2731;
	}
fxcsa8je5ypxmxl4x5aplh7364a02hkzmcnoe4rb
import java.net.*;
import java.io.*;
import java.util.*;
import java.util.stream.Collectors;

public class Main {

    public static void main(String[] args) {
        try {
            // Step 1: Open a connection to the URL and create a BufferedReader to read from it
            URL url = new URL("http://wiki.puzzlers.org/pub/wordlists/unixdict.txt");
            BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));

            // Step 2: Group words by sorted characters (anagrams)
            Map<String, List<String>> anagrams = reader.lines()
                    .collect(Collectors.groupingBy(Main::sortedString));

            // Step 3: Find the maximum number of anagrams in a single group
            int maxAnagrams = anagrams.values().stream()
                    .mapToInt(List::size)
                    .max()
                    .orElse(0);
          
			// Step 4: Print the group(s) with the maximum number of anagrams, sorted lexicographically

		// Stream through the values of the 'anagrams' map, which represent groups of anagrams
anagrams.values().stream()
        // Filter to include only groups with the maximum number of anagrams
        .filter(group -> group.size() == maxAnagrams)
        
        // For each qualifying group, sort its elements lexicographically
        .peek(Collections::sort)
        
        // Sort the groups based on the lexicographically first element of each group
        .sorted(Comparator.comparing(list -> list.get(0)))
        
        // For each sorted group, print it as a space-separated string
        .forEach(group -> System.out.println(String.join(" ", group)));
          
          
                // Step 5: Close the BufferedReader
            reader.close();
        } catch (IOException e) {
            // Handle IOException if it occurs
            e.printStackTrace();
        }
    }

private static String sortedString(String word) {
    // Step 1: Convert the word to a character array
    char[] letters = word.toCharArray();
    
    // Step 2: Sort the characters in lexicographic order
    Arrays.sort(letters);
    
    // Step 3: Create a new string from the sorted character array
    return new String(letters);
}
Create Custom Post Type:
Open your theme's functions.php file and add the following code:


Copy code
function create_carousel_post_type() {
    register_post_type('carousel',
        array(
            'labels' => array(
                'name' => __('Carousel Items'),
                'singular_name' => __('Carousel Item'),
            ),
            'public' => true,
            'has_archive' => true,
            'supports' => array('title', 'thumbnail', 'custom-fields'),
        )
    );
}
add_action('init', 'create_carousel_post_type');
  
  
  
  
  
  
  
  Create a Shortcode for Carousel:
Add the following code to create a shortcode that generates a Swiper-based carousel using the custom post type:


Copy code
function carousel_shortcode() {
    ob_start();

    $carousel_items = new WP_Query(array('post_type' => 'carousel', 'posts_per_page' => -1));

    ?>
    <div class="myswiper">
        <div class="swiper">
            <div class="swiper-wrapper">
                <?php
                while ($carousel_items->have_posts()) : $carousel_items->the_post();
                    ?>
                    <div class="swiper-slide">
                        <div class="card">
                            <div class="card__image"><?php the_post_thumbnail('full', array('alt' => get_the_title())); ?>
                                <h2 class="card__title"><?php the_title(); ?></h2>
                            </div>
                        </div>
                    </div>
                    <?php
                endwhile;
                wp_reset_postdata();
                ?>
            </div>
            <div class="swiper-button-prev"></div>
            <div class="swiper-button-next"></div>
        </div>
        <div class="swiper-pagination"></div>
    </div>
    <?php

    return ob_get_clean();
}
add_shortcode('carousel', 'carousel_shortcode');
  
  
  
  
  
  
  <!-- Swiper CSS -->
<link rel="stylesheet" href="https://unpkg.com/swiper/swiper-bundle.min.css" />

<!-- Swiper JS -->
<script src="https://unpkg.com/swiper/swiper-bundle.min.js"></script>
  
  
  
  
  document.addEventListener('DOMContentLoaded', function () {
    const swiper = new Swiper('.swiper', {
        loop: true,
        slidesPerView: 4,
        centeredSlides: true,
        autoplay: {
            enabled: true,
            delay: 5000
        },
        navigation: {
            nextEl: '.swiper-button-next',
            prevEl: '.swiper-button-prev',
        },
        pagination: {
            el: '.swiper-pagination',
            clickable: true,
        },
    });
});
  
  
  
  function enqueue_portfolio_scripts() {
    wp_enqueue_style('swiper-style', 'https://cdnjs.cloudflare.com/ajax/libs/Swiper/3.3.1/css/swiper.min.css');
    wp_enqueue_script('swiper-script', 'https://cdnjs.cloudflare.com/ajax/libs/Swiper/3.3.1/js/swiper.min.js', array('jquery'), null, true);
    wp_enqueue_script('portfolio-script', get_template_directory_uri() . '/path/to/your-portfolio-script.js', array('swiper-script'), null, true);
    wp_enqueue_style('portfolio-style', get_template_directory_uri() . '/path/to/your-portfolio-style.css');
}
add_action('wp_enqueue_scripts', 'enqueue_portfolio_scripts');
  
// in UE script, make sure you resolve properly the suitlet external URL:
var suitletURL = url.resolveScript({
        scriptId: 'customscript_your_suitlet_scriptid',
        deploymentId: 'customdeploy_your_suitlet_deploymentid',
        returnExternalUrl: true
});

var response = https.post({
        url : suitletURL,
        headers : myHeaders,
        body : myBody
});
dir "C:\path\to\files" -include *.txt -rec | gc | out-file "C:\path\to\output\file\joined.txt"
JupyterHub.ensureService({waitForReady:true})
for /R %f in (*.txt) do type “%f” >> c:\Test\output.txt
$files = (dir *.txt)
$outfile = "out.txt"

$files | %{
    $_.FullName | Add-Content $outfile
    Get-Content $_.FullName | Add-Content $outfile
}
 if you only want the filename, but not the path, switch the line which is $_.FullName | Add-Content $outfile to read $_.Name | Add-Content $outfile
Get-ChildItem d:\scripts -include *.txt -rec | ForEach-Object {gc $_; ""} | out-file d:\scripts\test.txt
$yourdir="c:\temp\"
$destfile= ([Environment]::GetFolderPath("Desktop") + "\totalresult.txt")
Get-ChildItem $yourdir -File -Filter *.txt | %{"________________________" |out-file  $destfile -Append; $_.Name  | Out-File  $destfile -Append; gc $_.FullName | Out-File  $destfile -Append}
<p><embed src="https://www.instagram.com/leecosheriffal/embed/?cr=1&amp;v=14&amp;wp=1080&amp;rd=https%3A%2F%2Fcdpn.io&amp;rp=%2Fcpe%2Fboomboom%2Findex.html%3Fkey%3Dindex.html-fcf10232-f752-7989-78a4-2f978a8ff956#%7B%22ci%22%3A0%2C%22os%22%3A228.39999999850988%2C%22ls%22%3A109.09999999962747%2C%22le%22%3A225.19999999925494%7D" /></p>
<p><embed src="https://www.facebook.com/plugins/page.php?href=https%3A%2F%2Ffacebook.com%2FleeCoSheriffAL&amp;tabs=timeline&amp;width=500&amp;height=500&amp;small_header=false&amp;adapt_container_width=true&amp;hide_cover=false&amp;show_facepile=false&amp;appId" width="500" height="500" /></p>
# Turn on cluster nodes
clusterctrl on
# update master
sudo apt update && sudo apt dist-upgrade -y

# Add nodes to hosts file
sudo vi /etc/hosts
172.19.181.1	p1
172.19.181.2	p2
172.19.181.3	p3
172.19.181.4	p4

# Upgrade nodes
ssh p1 'sudo apt update && sudo apt dist-upgrade -y'
ssh p2 'sudo apt update && sudo apt dist-upgrade -y'
ssh p3 'sudo apt update && sudo apt dist-upgrade -y'
ssh p4 'sudo apt update && sudo apt dist-upgrade -y'

# enable memory cgroup on all raspberries
sudo vi /boot/cmdline.txt
cgroup_memory=1 cgroup_enable=memory

# Download k3sup
sudo curl -sLS https://get.k3sup.dev | sh
sudo cp k3sup-arm64 /usr/local/bin/k3sup

# Install k3sup without servicelb so we can use metalLB later
k3sup install --ip 172.19.181.254 --user $(whoami) --ssh-key ~/.ssh/kubemaster --k3s-extra-args '--disable servicelb'

# Copy config file to user
sudo cp /etc/k3s/kubeconfig ~/.kube/

# Export the file
export KUBECONFIG=~/.kube/kubeconfig
# Install on nodes
k3sup join --ip 172.19.181.1 --server-ip 172.19.181.254 --user $(whoami) --ssh-key ~/.ssh/kubemaster
k3sup join --ip 172.19.181.2 --server-ip 172.19.181.254 --user $(whoami) --ssh-key ~/.ssh/kubemaster
k3sup join --ip 172.19.181.3 --server-ip 172.19.181.254 --user $(whoami) --ssh-key ~/.ssh/kubemaster
k3sup join --ip 172.19.181.4 --server-ip 172.19.181.254 --user $(whoami) --ssh-key ~/.ssh/kubemaster
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 119.5G 0 disk
└─sda1 8:1 1 119.5G 0 part
  
sudo umount /dev/sda1
sudo mkfs.ext4 /dev/sda1
sudo mkdir /media/nfstorage
sudo chown nobody.nogroup -R /media/nfstorage
sudo chmod -R 777 /media/nfstorage

blkid 
# Copy UUID=”a13c2fad-7d3d-44ca-b704-ebdc0369260e”
sudo vi /etc/fstab
# Add the following line to the bottom of the fstab file:
UUID=a13c2fad-7d3d-44ca-b704-ebdc0369260e /media/nfstorage ext4 defaults 0 2

# NFS server is installed
sudo apt-get install -y nfs-kernel-server

sudo vi /etc/exports
# add the following line at the bottom
/media/nfstorage 172.19.181.0/24(rw,sync,no_root_squash,no_subtree_check)

sudo exportfs -a

# On each node p1,p2,p3,pN
sudo apt-get install -y nfs-common
sudo mkdir /media/nfstorage
sudo chown nobody.nogroup /media/nfstorage
sudo chmod -R 777 /media/nfstorage
# Set up automatic mounting by editing your /etc/fstab:
sudo vi /etc/fstab
# Add this line to the bottom:
172.19.181.254:/media/nfstorage /media/nfstorage nfs defaults 0 0

sudo mount -a
# Setup SSH On Desktop
ssh-keygen -t Ed25519
cat ~/.ssh/id_rsa.pub

# Setup SSH For Raspberry Master
ssh-keygen -t ed25519 -f ~/.ssh/kubemaster

# Copy keyset to raspbery master
scp kubemaster kubemaster.pub <user>@<IP>:~/.ssh/

# Use Raspberry pi imager to flash with user,wifi,hostname and keyset configured.
# Remember to add ssh file in boot

# Setup SSH Config File
$ vi ~/.ssh/config
Host p1
    Hostname 172.19.181.1
    User <user>
    IdentityFile ~/.ssh/kubemaster
Host p2
    Hostname 172.19.181.2
    User <user>
    IdentityFile ~/.ssh/kubemaster
Host p3
    Hostname 172.19.181.3
    User <user>
    IdentityFile ~/.ssh/kubemaster
Host p4
    Hostname 172.19.181.4
    User <user>
    IdentityFile ~/.ssh/kubemaster

# Enable nodes
$ sudo clusterhat on

# ensure systime is synced
sudo apt-get install -y ntpdate
# include <stdio.h>
# define MAX 6
int CQ[MAX];
int front = 0;
int rear = 0;
int count = 0;
void insertCQ(){
int data;
if(count == MAX) {
printf("\n Circular Queue is Full");
}
else {
printf("\n Enter data: ");
scanf("%d", &data);
CQ[rear] = data;
rear = (rear + 1) % MAX;
count ++;
printf("\n Data Inserted in the Circular Queue ");
    }
}
void deleteCQ()
{
    if(count == 0) {
        printf("\n\nCircular Queue is Empty..");
        
    }
        else {
            printf("\n Deleted element from Circular Queue is %d ", CQ[front]);
            front = (front + 1) % MAX;
            count --; 
        }
}
void displayCQ()
{
    int i, j;
    if(count == 0) {
        printf("\n\n\t Circular Queue is Empty "); }
        else {
            printf("\n Elements in Circular Queue are: ");
            j = count;
            for(i = front; j != 0; j--) {
                printf("%d\t", CQ[i]);
                i = (i + 1) % MAX; 
            }
        } 
}
int menu() {
    int ch;
    printf("\n \t Circular Queue Operations using ARRAY..");
    printf("\n -----------**********-------------\n");
    printf("\n 1. Insert ");
    printf("\n 2. Delete ");
    printf("\n 3. Display");
    printf("\n 4. Quit ");
    printf("\n Enter Your Choice: ");
    scanf("%d", &ch);
    return ch;
    
}
void main(){
    int ch;
    do {
        ch = menu();
        switch(ch) {
            case 1: insertCQ(); break;
            case 2: deleteCQ(); break;
            case 3: displayCQ(); break;
            case 4:
            return;
            default:
            printf("\n Invalid Choice ");
            
        }
        } while(1);
}
plt + ggplot2::theme(legend.position = "bottom")
   private enum TimeSpanElement
    {
        Millisecond,
        Second,
        Minute,
        Hour,
        Day
    }   
public static string ToFriendlyDisplay(this TimeSpan timeSpan, int maxNrOfElements = 3)
    {
        maxNrOfElements = Math.Max(Math.Min(maxNrOfElements, 5), 1);
        var parts = new[]
                        {
                            Tuple.Create(TimeSpanElement.Day, timeSpan.Days),
                            Tuple.Create(TimeSpanElement.Hour, timeSpan.Hours),
                            Tuple.Create(TimeSpanElement.Minute, timeSpan.Minutes),
                            Tuple.Create(TimeSpanElement.Second, timeSpan.Seconds),
                            Tuple.Create(TimeSpanElement.Millisecond, timeSpan.Milliseconds)
                        }
                                    .SkipWhile(i => i.Item2 <= 0)
                                    .Take(maxNrOfElements);

        return string.Join(", ", parts.Select(p => string.Format("{0} {1}{2}", p.Item2, p.Item1, p.Item2 > 1 ? "s" : string.Empty)));
    }
const beneficiaryArray = updatedBen.filter(
      (el: any) => el.parentProfileGUID === '',
    );
    console.log('beneficiaryArray', beneficiaryArray);

    // Substitute validation for all other willtypes (PW,FAW)
    // Get Array of all substitutes in the payload
    const substitutesArray = updatedBen.filter(
      (el: any) => el.parentProfileGUID !== '',
    ); // Filter out substitutes from payload
    console.log('substitutesArray', substitutesArray);
    // Check if the list of substitutes is updated for each iteration
    const substituteListForTest = checkSubstitutePresent(
      substitutesArray,
      beneficiaryList,
    );
    console.log('substituteListForTest', substituteListForTest);

    // New Method testing

    function filterPayloadByProperty(data:any) {
      const groups = data.reduce((result:any, item:any) => {
        const key = item.propertyGUID;
        if (!result[key]) {
          result[key] = [];
        }
        result[key].push(item);
        return result;
      }, {});

      return Object.values(groups);
    }

    function getSharesSum(arr:any) {
      return arr.map((subArray:any) => subArray.reduce((sum:any, num:any) => sum + num, 0));
    }

    const filteredData = filterPayloadByProperty(beneficiaryArray); // filter by propertyGUID
    console.log('filteredData', filteredData);

    const sharePercentages = filteredData.map((subArray:any) => subArray.map((obj:any) => obj.sharePercentage));

    console.log('sharePercentages', sharePercentages);

    const sums = getSharesSum(sharePercentages); // Sum of shares
    console.log('sums', sums);

    const validationTrue = sums.every((value:any) => value === 100); // Check if shares === 100
    console.log('valid', validationTrue);

    // if (validationTrue) {
    // dispatch<any>(submitshareDetails(isSpouseSelected ? spouseShares : husbandShares));
    // dispatch(setBySharesSubmitted(false));
    // handleNext(6, 'by-specific', isCompleted);
    // }

    // New Method testing end

    // Filter substitutes by property/account/company
    const filteredSubArrays = filterDataByPropertyGUID(substituteListForTest);
    console.log('filteredSubArrays', filteredSubArrays);
    // Calculate total sum of shares of the substitutes
    const substituteSharesTotalSum = calculateShareSum(filteredSubArrays);
    console.log('substituteSharesTotalSum', substituteSharesTotalSum);
    const substringsToRemove: string[] = ['undefined', 'null'];

    // Remove undefined and null values from the list
    const filteredObject = removeUndefinedAndNull(
      substituteSharesTotalSum,
      substringsToRemove,
    );
    console.log('filteredSubObject', filteredObject);

    // Remove Zeros from the list
    const removedZeros = removeZeroValues(filteredObject);
    console.log('removedZeros', removedZeros);

    // Condition to check substitute validation
    const subShareValidation = Object.values(removedZeros).every(
      (value) => value === 100,
    );

    // Substitute validation ends for all other WillTypes

    // Case 8 test ---
    // Normal Working case
    // const benCountList: any[] = updatedBenList1.filter(
    //   (ben: any) => ben.subBeneficiaryList.length !== 0 && ben.sharePercentage !== 0,
    // );
    const hus = updatedBenList1.filter(
      (ben: any) => ben.bookedForProfileGUID === profileGuid,
    );
    const spouse = updatedBenList1.filter(
      (ben: any) => ben.bookedForProfileGUID === spouseGuid,
    );
    const benCountList: any[] = (isSpouseSelected ? spouse : hus).filter(
      (ben: any) => ben.subBeneficiaryList?.length !== 0 && ben?.sharePercentage !== 0,
    );
    console.log('benCountList', benCountList);

    // Buisness Owners Will Substitute Validation

    // Check substitute validation in Buisness Owners Will
    // const substituteValidationBOW = checkSubstituteValidationBOW(
    //   subSharesBow,
    //   // benCountList,
    //   removedZeros,
    // );
    // console.log('substituteValidationBOW', substituteValidationBOW);

    // New test case --> Working but needs thorough testing
    // Add combined guids of propertyGUID and profileGUID
    const combinedArray = benCountList.map((obj: any) => ({
      ...obj,
      combinedGUID: `${obj.propertyGUID}-${obj.profileGUID}`,
    }));
    console.log('combinedArray', combinedArray);
    // Returns a list of shares and their corresponding combinedGUID's (propertyGUID + profileGUID)
    const subSharesList = getSharePercentages(combinedArray, removedZeros);
    console.log('subSharesArray', subSharesList);
    // Validate the substitute shares with the beneficiary shares
    const isSubstituteSharesValidBOW = validateShares(
      subSharesList,
      removedZeros,
    );
    console.log('isValid', isSubstituteSharesValidBOW);
    // Check if combinedGUID === key of substituteArray
    // const hasMatchingSharePercentage = checkSharePercentage(combinedArray, removedZeros);
    // console.log('hasMatchingSharePercentage', hasMatchingSharePercentage);

    // Check if substitute is present
    const isSubPresent = beneficiaryList.some(
      (el: any) => el.subBeneficiaryList.length !== 0,
    );

    const latestBenArray = updatedBen.filter((item1: any) => updatedBen.some(
      (item2: any) => item1.profileGUID === item2.parentProfileGUID,
    ));
    // console.log('latestBenArray', latestBenArray);
    const filteredLatestBenList = latestBenArray.filter(
      (e: any) => e.propertyGUID !== null,
    );
    console.log('filteredLatestBenList', filteredLatestBenList);
    const removeZeroFromBen = filteredLatestBenList.filter(
      (e: any) => e.sharePercentage !== 0,
    );
    console.log('removeZeroFromBen', removeZeroFromBen);

    // Substitute validation ends ---------------------------------------------------------------

    // Beneficiary Validation 2.0 (current version)
    // Get the total count of beneficiaries with substitutes
    // Check if the list of beneficiaries is updated for each iteration
    const beneficiaryListForTest = checkBeneficiaryPresent(
      beneficiaryArray,
      beneficiaryList,
    );
    console.log('beneficiaryListForTest', beneficiaryListForTest);

    // Filter beneficiaries by Property/Account/Company
    const filteredBenArrays = filterDataByPropertyGUID(beneficiaryListForTest);
    console.log('filteredBenArrays', filteredBenArrays);

    // Calculate total sum of shares of the beneficiaries of each property/account/company
    const benSharesTotalSum = calculateShareSum(filteredBenArrays);
    console.log('benSharesTotalSum', benSharesTotalSum);

    // Filter each beneficiary by property/account/company (Remove undefined and null values)
    const filteredObj = removeUndefinedAndNullForBen(benSharesTotalSum);
    console.log('filteredBenObj', filteredObj);

    // Condition to check beneficiary validation (Total shares === 100)
    const benShareValidation = Object.values(filteredObj).every(
      (value) => value === 100,
    );
    console.log('benShareValidation', benShareValidation);

    // Buisness Owners Will Beneficiary Validation
    const sharesForbow = getSharesForBOW(filteredObj);
    const sharesIterator = sharesForbow[Symbol.iterator]();
    console.log('sharesIterator', sharesIterator);

    // Beneficiary Validation for BOW
    const benShareValidationBOW = Object.values(filteredObj).every(
      (value) => value === sharesIterator.next().value,
    );
    console.log('benShareValidationBOW', benShareValidationBOW);

    const getListType = () => {
      if (willTypeID === 3) return propertyList;
      if (willTypeID === 5) return accountList;
      if (willTypeID === 4) return companyShareInformationList;
      return null;
    };

    const list = getListType();
    console.log('listType', list);

    // Check property/account/company list length
    const propertySharesObject = filterByPropertyList(
      filteredObj,
      list,
      willTypeID,
    );
    console.log('propertySharesObject', propertySharesObject);
    // propertyList || accountList || companyShareInformationList

    // Check if all properties/accounts/companies are allocated shares
    let checkLength: boolean;
    if (
      (accountList.length
        || propertyList.length
        || companyShareInformationList.length)
      === Object.keys(propertySharesObject).length
    ) {
      // Add Company List when working on BOW
      checkLength = true;
    }

    // Allow submission only if the shares have been allocated
    if (updatedBen.length !== 0 && checkLength) {
      // Property Will && Financial Assets Will
      if (willTypeID === 5 || willTypeID === 3) {
        // Financial Assets Will && Property Will
        if (isSubPresent) {
          // IF  substitute is present check validation for beneficiaries & substitutes
          const checkSubLength = benCountList.length === Object.keys(removedZeros).length;
          // const checkSubLength = benCountList.length === subCount * accountList.length;
          console.log('checkSubLength', checkSubLength);

          // if (substituteSharesList.length !== 0) {
          // Check beneficiary && substitute validation here
          if (
            benShareValidation
            && subShareValidation
            && checkSubLength
            // && filteredLatestBenList.length !== 0
          ) {
            // dispatch<any>(submitshareDetails(updatedBen));
            dispatch<any>(
              submitshareDetails(
                isSpouseSelected ? spouseShares : husbandShares,
              ),
            );
            dispatch(setBySharesSubmitted(false));
            handleNext(6, 'by-specific', isCompleted);
          } else {
            await dispatch(resetErrorState());
            await dispatch(
              setErrorInfo('Please enter shares for all substitutes'),
            );
          }
          // }
        } else if (!isSubPresent) {
          // Working smoothly -- Beneficiary Validation working with single & multiple accounts/properties
          // Beneficiary validation only
          if (benShareValidation) {
            dispatch<any>(
              submitshareDetails(
                isSpouseSelected ? spouseShares : husbandShares,
              ),
            );
            dispatch(clearUpdatedBenList());
            dispatch(setBySharesSubmitted(false));
            handleNext(6, 'by-specific', isCompleted);
          } else {
            await dispatch(resetErrorState());
            await dispatch(
              setErrorInfo('Please enter shares for all beneficiaries'),
            );
          }
        }
      } else {
        // Buisness Owners Will
        if (!isSubPresent) {
          if (benShareValidationBOW) {
            dispatch<any>(
              submitshareDetails(
                isSpouseSelected ? spouseShares : husbandShares,
              ),
            );
            dispatch(setBySharesSubmitted(false));
            handleNext(6, 'by-specific', isCompleted);
          } else {
            await dispatch(resetErrorState());
            await dispatch(
              setErrorInfo('Please enter shares for all beneficiaries'),
            );
          }
        } else if (isSubPresent) {
          // Substitute is present
          console.log('Substitute Present');
          const checkSubLength = benCountList.length === Object.keys(removedZeros).length;
          if (
            benShareValidationBOW
            // && substituteValidationBOW
            && isSubstituteSharesValidBOW
            && checkSubLength
            // && filteredLatestBenList.length !== 0
          ) {
            dispatch<any>(
              submitshareDetails(
                isSpouseSelected ? spouseShares : husbandShares,
              ),
            );
            dispatch(setBySharesSubmitted(false));
            handleNext(6, 'by-specific', isCompleted);
          } else {
            await dispatch(resetErrorState());
            await dispatch(
              setErrorInfo('Please enter shares for all substitutes'),
            );
          }
        }
      }
    } else {
      await dispatch(resetErrorState());
      await dispatch(setErrorInfo('Please assign the shares'));
    }
    // -----
const beneficiaryArray = updatedBen.filter(
      (el: any) => el.parentProfileGUID === '',
    );
    console.log('beneficiaryArray', beneficiaryArray);

    // Substitute validation for all other willtypes (PW,FAW)
    // Get Array of all substitutes in the payload
    const substitutesArray = updatedBen.filter(
      (el: any) => el.parentProfileGUID !== '',
    ); // Filter out substitutes from payload
    console.log('substitutesArray', substitutesArray);
    // Check if the list of substitutes is updated for each iteration
    const substituteListForTest = checkSubstitutePresent(
      substitutesArray,
      beneficiaryList,
    );
    console.log('substituteListForTest', substituteListForTest);

    // New Method testing

    function filterPayloadByProperty(data:any) {
      const groups = data.reduce((result:any, item:any) => {
        const key = item.propertyGUID;
        if (!result[key]) {
          result[key] = [];
        }
        result[key].push(item);
        return result;
      }, {});

      return Object.values(groups);
    }

    function getSharesSum(arr:any) {
      return arr.map((subArray:any) => subArray.reduce((sum:any, num:any) => sum + num, 0));
    }

    const filteredData = filterPayloadByProperty(beneficiaryArray); // filter by propertyGUID
    console.log('filteredData', filteredData);

    const sharePercentages = filteredData.map((subArray:any) => subArray.map((obj:any) => obj.sharePercentage));

    console.log('sharePercentages', sharePercentages);

    const sums = getSharesSum(sharePercentages); // Sum of shares
    console.log('sums', sums);

    const validationTrue = sums.every((value:any) => value === 100); // Check if shares === 100
    console.log('valid', validationTrue);

    // if (validationTrue) {
    // dispatch<any>(submitshareDetails(isSpouseSelected ? spouseShares : husbandShares));
    // dispatch(setBySharesSubmitted(false));
    // handleNext(6, 'by-specific', isCompleted);
    // }

    // New Method testing end

    // Filter substitutes by property/account/company
    const filteredSubArrays = filterDataByPropertyGUID(substituteListForTest);
    console.log('filteredSubArrays', filteredSubArrays);
    // Calculate total sum of shares of the substitutes
    const substituteSharesTotalSum = calculateShareSum(filteredSubArrays);
    console.log('substituteSharesTotalSum', substituteSharesTotalSum);
    const substringsToRemove: string[] = ['undefined', 'null'];

    // Remove undefined and null values from the list
    const filteredObject = removeUndefinedAndNull(
      substituteSharesTotalSum,
      substringsToRemove,
    );
    console.log('filteredSubObject', filteredObject);

    // Remove Zeros from the list
    const removedZeros = removeZeroValues(filteredObject);
    console.log('removedZeros', removedZeros);

    // Condition to check substitute validation
    const subShareValidation = Object.values(removedZeros).every(
      (value) => value === 100,
    );

    // Substitute validation ends for all other WillTypes

    // Case 8 test ---
    // Normal Working case
    // const benCountList: any[] = updatedBenList1.filter(
    //   (ben: any) => ben.subBeneficiaryList.length !== 0 && ben.sharePercentage !== 0,
    // );
    const hus = updatedBenList1.filter(
      (ben: any) => ben.bookedForProfileGUID === profileGuid,
    );
    const spouse = updatedBenList1.filter(
      (ben: any) => ben.bookedForProfileGUID === spouseGuid,
    );
    const benCountList: any[] = (isSpouseSelected ? spouse : hus).filter(
      (ben: any) => ben.subBeneficiaryList?.length !== 0 && ben?.sharePercentage !== 0,
    );
    console.log('benCountList', benCountList);

    // Buisness Owners Will Substitute Validation

    // Check substitute validation in Buisness Owners Will
    // const substituteValidationBOW = checkSubstituteValidationBOW(
    //   subSharesBow,
    //   // benCountList,
    //   removedZeros,
    // );
    // console.log('substituteValidationBOW', substituteValidationBOW);

    // New test case --> Working but needs thorough testing
    // Add combined guids of propertyGUID and profileGUID
    const combinedArray = benCountList.map((obj: any) => ({
      ...obj,
      combinedGUID: `${obj.propertyGUID}-${obj.profileGUID}`,
    }));
    console.log('combinedArray', combinedArray);
    // Returns a list of shares and their corresponding combinedGUID's (propertyGUID + profileGUID)
    const subSharesList = getSharePercentages(combinedArray, removedZeros);
    console.log('subSharesArray', subSharesList);
    // Validate the substitute shares with the beneficiary shares
    const isSubstituteSharesValidBOW = validateShares(
      subSharesList,
      removedZeros,
    );
    console.log('isValid', isSubstituteSharesValidBOW);
    // Check if combinedGUID === key of substituteArray
    // const hasMatchingSharePercentage = checkSharePercentage(combinedArray, removedZeros);
    // console.log('hasMatchingSharePercentage', hasMatchingSharePercentage);

    // Check if substitute is present
    const isSubPresent = beneficiaryList.some(
      (el: any) => el.subBeneficiaryList.length !== 0,
    );

    const latestBenArray = updatedBen.filter((item1: any) => updatedBen.some(
      (item2: any) => item1.profileGUID === item2.parentProfileGUID,
    ));
    // console.log('latestBenArray', latestBenArray);
    const filteredLatestBenList = latestBenArray.filter(
      (e: any) => e.propertyGUID !== null,
    );
    console.log('filteredLatestBenList', filteredLatestBenList);
    const removeZeroFromBen = filteredLatestBenList.filter(
      (e: any) => e.sharePercentage !== 0,
    );
    console.log('removeZeroFromBen', removeZeroFromBen);

    // Substitute validation ends ---------------------------------------------------------------

    // Beneficiary Validation 2.0 (current version)
    // Get the total count of beneficiaries with substitutes
    // Check if the list of beneficiaries is updated for each iteration
    const beneficiaryListForTest = checkBeneficiaryPresent(
      beneficiaryArray,
      beneficiaryList,
    );
    console.log('beneficiaryListForTest', beneficiaryListForTest);

    // Filter beneficiaries by Property/Account/Company
    const filteredBenArrays = filterDataByPropertyGUID(beneficiaryListForTest);
    console.log('filteredBenArrays', filteredBenArrays);

    // Calculate total sum of shares of the beneficiaries of each property/account/company
    const benSharesTotalSum = calculateShareSum(filteredBenArrays);
    console.log('benSharesTotalSum', benSharesTotalSum);

    // Filter each beneficiary by property/account/company (Remove undefined and null values)
    const filteredObj = removeUndefinedAndNullForBen(benSharesTotalSum);
    console.log('filteredBenObj', filteredObj);

    // Condition to check beneficiary validation (Total shares === 100)
    const benShareValidation = Object.values(filteredObj).every(
      (value) => value === 100,
    );
    console.log('benShareValidation', benShareValidation);

    // Buisness Owners Will Beneficiary Validation
    const sharesForbow = getSharesForBOW(filteredObj);
    const sharesIterator = sharesForbow[Symbol.iterator]();
    console.log('sharesIterator', sharesIterator);

    // Beneficiary Validation for BOW
    const benShareValidationBOW = Object.values(filteredObj).every(
      (value) => value === sharesIterator.next().value,
    );
    console.log('benShareValidationBOW', benShareValidationBOW);

    const getListType = () => {
      if (willTypeID === 3) return propertyList;
      if (willTypeID === 5) return accountList;
      if (willTypeID === 4) return companyShareInformationList;
      return null;
    };

    const list = getListType();
    console.log('listType', list);

    // Check property/account/company list length
    const propertySharesObject = filterByPropertyList(
      filteredObj,
      list,
      willTypeID,
    );
    console.log('propertySharesObject', propertySharesObject);
    // propertyList || accountList || companyShareInformationList

    // Check if all properties/accounts/companies are allocated shares
    let checkLength: boolean;
    if (
      (accountList.length
        || propertyList.length
        || companyShareInformationList.length)
      === Object.keys(propertySharesObject).length
    ) {
      // Add Company List when working on BOW
      checkLength = true;
    }

    // Allow submission only if the shares have been allocated
    if (updatedBen.length !== 0 && checkLength) {
      // Property Will && Financial Assets Will
      if (willTypeID === 5 || willTypeID === 3) {
        // Financial Assets Will && Property Will
        if (isSubPresent) {
          // IF  substitute is present check validation for beneficiaries & substitutes
          const checkSubLength = benCountList.length === Object.keys(removedZeros).length;
          // const checkSubLength = benCountList.length === subCount * accountList.length;
          console.log('checkSubLength', checkSubLength);

          // if (substituteSharesList.length !== 0) {
          // Check beneficiary && substitute validation here
          if (
            benShareValidation
            && subShareValidation
            && checkSubLength
            // && filteredLatestBenList.length !== 0
          ) {
            // dispatch<any>(submitshareDetails(updatedBen));
            dispatch<any>(
              submitshareDetails(
                isSpouseSelected ? spouseShares : husbandShares,
              ),
            );
            dispatch(setBySharesSubmitted(false));
            handleNext(6, 'by-specific', isCompleted);
          } else {
            await dispatch(resetErrorState());
            await dispatch(
              setErrorInfo('Please enter shares for all substitutes'),
            );
          }
          // }
        } else if (!isSubPresent) {
          // Working smoothly -- Beneficiary Validation working with single & multiple accounts/properties
          // Beneficiary validation only
          if (benShareValidation) {
            dispatch<any>(
              submitshareDetails(
                isSpouseSelected ? spouseShares : husbandShares,
              ),
            );
            dispatch(clearUpdatedBenList());
            dispatch(setBySharesSubmitted(false));
            handleNext(6, 'by-specific', isCompleted);
          } else {
            await dispatch(resetErrorState());
            await dispatch(
              setErrorInfo('Please enter shares for all beneficiaries'),
            );
          }
        }
      } else {
        // Buisness Owners Will
        if (!isSubPresent) {
          if (benShareValidationBOW) {
            dispatch<any>(
              submitshareDetails(
                isSpouseSelected ? spouseShares : husbandShares,
              ),
            );
            dispatch(setBySharesSubmitted(false));
            handleNext(6, 'by-specific', isCompleted);
          } else {
            await dispatch(resetErrorState());
            await dispatch(
              setErrorInfo('Please enter shares for all beneficiaries'),
            );
          }
        } else if (isSubPresent) {
          // Substitute is present
          console.log('Substitute Present');
          const checkSubLength = benCountList.length === Object.keys(removedZeros).length;
          if (
            benShareValidationBOW
            // && substituteValidationBOW
            && isSubstituteSharesValidBOW
            && checkSubLength
            // && filteredLatestBenList.length !== 0
          ) {
            dispatch<any>(
              submitshareDetails(
                isSpouseSelected ? spouseShares : husbandShares,
              ),
            );
            dispatch(setBySharesSubmitted(false));
            handleNext(6, 'by-specific', isCompleted);
          } else {
            await dispatch(resetErrorState());
            await dispatch(
              setErrorInfo('Please enter shares for all substitutes'),
            );
          }
        }
      }
    } else {
      await dispatch(resetErrorState());
      await dispatch(setErrorInfo('Please assign the shares'));
    }
    // -----
//Automatic Cart Update with AJAX on Header
add_filter( 'woocommerce_add_to_cart_fragments', 'iconic_cart_count_fragments', 10, 1 );
function iconic_cart_count_fragments( $fragments ) {    
    $fragments['div.header-cart-count'] = '<div class="header-cart-count">' . WC()->cart->get_cart_contents_count() . '</div>';
    return $fragments;
}
// ADD A SIZE CHART FOR SINGLE PRODUCT PAGE;
add_action( 'woocommerce_product_meta_start', 'custom_action_after_woocommerce_product_meta_start', 6 );
function custom_action_after_woocommerce_product_meta_start() { 
    
    echo '<div class="CustomOrders">';
        echo '<ul>';
            echo '<li>';
                echo '<div class="headingOrders">"Request a Quote for Bulk Quantity"</div>';
            echo '</li>';
            echo '<li>';
                echo '<a class="custom_popup" href="javascript:void(0)">Request a Qoute Form</a>';
            echo '</li>';
        echo '</ul>';
     echo '</div>';
} 
// ADD SWATCHES PRICE AFTER TITLE OF SINGLE PRODUCT;
function shuffle_variable_product_elements(){
    if ( is_product() ) {
        global $post;
        $product = wc_get_product( $post->ID );
        if ( $product->is_type( 'variable' ) ) {
            remove_action( 'woocommerce_single_variation', 'woocommerce_single_variation', 10 );
            add_action( 'woocommerce_before_variations_form', 'woocommerce_single_variation', 20 );

            // remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );
            // add_action( 'woocommerce_before_variations_form', 'woocommerce_template_single_title', 10 );

            remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );
            add_action( 'woocommerce_before_variations_form', 'woocommerce_template_single_excerpt', 30 );
        }
    }
}
add_action( 'woocommerce_before_single_product', 'shuffle_variable_product_elements' );
if(empty(prop("Date")), "0 - Pending", if(formatDate(now(), "L") == formatDate(prop("Date"), "L"), "3 - High Priority", if(now() > prop("Date"), "4 - ASAP", if(dateBetween(prop("Date"), now(), "days") > 7, "1 - Low Priority", "2 - Medium Priority"))))
https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_160833600356.html#Debugging-Deployed-SuiteScript-2.1-User-Event-Scripts
CREATE TEMPORARY TABLE temp_table AS (
  SELECT wp_postmeta.post_id, 
  	wp_postmeta.meta_value AS sale_price, 
  	pm1.meta_value AS regular_price,
  	pm2.meta_value AS price
  FROM wp_postmeta
  LEFT JOIN wp_postmeta pm1 ON pm1.post_id = wp_postmeta.post_id AND pm1.meta_key = '_regular_price'
  LEFT JOIN wp_postmeta pm2 ON pm2.post_id = wp_postmeta.post_id AND pm2.meta_key = '_price'
  WHERE wp_postmeta.meta_key = '_sale_price' AND wp_postmeta.meta_value IS NOT NULL AND wp_postmeta.meta_value <> '' 
);

UPDATE wp_postmeta pm1
INNER JOIN temp_table pm2 ON pm1.post_id = pm2.post_id
SET pm1.meta_value = pm2.sale_price
WHERE pm1.meta_key = '_price' 
AND pm2.price <> pm2.sale_price
-- AND pm1.post_id IN (5610)
;

DROP TEMPORARY TABLE temp_table;

-- select * from temp_table where price <> sale_price;
from pdf2image import convert_from_path
from PIL import Image
import os

def pdf_to_html_with_images(pdf_path):
    output_folder = os.path.dirname(pdf_path)
    images = convert_from_path(pdf_path)

    html_path = os.path.join(output_folder, 'output.html')
    
    with open(html_path, 'w', encoding='utf-8') as html_file:
        html_file.write('<!DOCTYPE html>\n<html>\n<body>\n')

        for i, image in enumerate(images):
            image_path = os.path.join(output_folder, f'image_{i}.png')
            image.save(image_path, 'PNG')
            html_file.write(f'<img src="{os.path.basename(image_path)}" alt="Image {i+1}"><br>\n')

        html_file.write('</body>\n</html>')

    return html_path

pdf_path = 'image-based-pdf-sample.pdf'  # Замените на путь к вашему PDF-файлу
generated_html = pdf_to_html_with_images(pdf_path)
print(f'HTML файл сохранен по пути: {generated_html}')
Q>4 w3 resourse
 

class Employee {
    private int salary;

    public Employee(int salary) {
        this.salary = salary;
    }

    public void work() {
        System.out.println("Employee is working");
    }

    public int getSalary() {
        return salary;
    }
}

class HRManager extends Employee {
    public HRManager(int salary) {
        super(salary);
    }

    @Override
    public void work() {
        System.out.println("HR Manager is managing employees");
    }

    public void addEmployee() {
        System.out.println("HR Manager is adding a new employee");
    }
}

// Main class
 public class Main{
    public static void main(String[] args) {
        Employee emp = new Employee(40000);
        HRManager mgr = new HRManager(70000);

        emp.work();
        System.out.println("Employee salary: " + emp.getSalary());

        mgr.work();
        System.out.println("Manager salary: " + mgr.getSalary());
        mgr.addEmployee();
    }
}
---------------------------------------------------------------------------------------------------------------------------------------
Q>6
 class Animal{
  //method
  public void move(){
    System.out.println("Animal moves");
  }
}
 class cheetah extends Animal{
  public void move(){
    System.out.println("Cheetaj moves fater");
  }
}
public class Main{
  public static void main(String args[]){
    Animal a=new Animal();
    cheetah b= new cheetah();
    a.move();
    b.move();
  }
}
---------------------------------------------------------------------------------------------------------------------------------------
Q>7

class Person {
    private String firstname;
    private String lastname;

    //constructor
    public Person(String firstname, String lastname) {
        this.firstname = firstname;
        this.lastname = lastname;
    }

    //methods
    public String getFirstName() {
        return firstname;
    }

    public String getLastName() {
        return lastname;
    }
}

class Employee extends Person {
    private int empid;
    private String jobtitle;

    public Employee(String firstname, String lastname, int empid, String jobtitle) {
        super(firstname, lastname);
        this.empid = empid;
        this.jobtitle = jobtitle;
    }

    public int getEmpid() {
        return empid;
    }

    public String getLastName() {
        return super.getLastName() + ", " + jobtitle;
    }
}

public class Main {
    public static void main(String args[]) {
        Employee employee1 = new Employee("Kortney", "Rosalee", 4451, "HR Manager");
        System.out.println(employee1.getFirstName() + " " + employee1.getLastName() + " (" + employee1.getEmpid() + ")");
        Employee employee2 = new Employee("Junior", "Philipa", 4452, "Software Manager");
        System.out.println(employee2.getFirstName() + " " + employee2.getLastName() + " (" + employee2.getEmpid() + ")");
    }
}
-----------------------------------------------------------------------------------------------------------------------------
Q>8

class Shape{
 
  public double getPerimeter(){
    return 0.0;
  }
  public double getArea(){
    return 0.0;
  }
}
class Circle extends Shape{
     private double radius;
  public Circle(double radius){
    this.radius=radius;
  }
    public double getPerimeter(){
    return Math.PI*radius*2;
  }
  public double getArea(){
    return Math.PI*radius*radius;
  }
  }
  public class Main{
    public static void main(String args[]){
      double r=8.0;
      Circle c =new Circle(r);
      System.out.println("radius of the circle"+r);
      System.out.println("area of the circle" +c.getArea());
      double r1=3.3;
      Circle c1 =new Circle(r1);
      System.out.println("radius of the circle"+r1);
       System.out.println("area of the circle"+c1.getPerimeter());
    }
  }


---------------------------------------------------------------------------------------------------------------------------------

abstract

abstract class Shape3D{
  public abstract double calculatevol();
  public abstract double calsurfacearea();
}
class Sphere extends Shape3D{
  private double radius;
  public Sphere(double radius){
    this.radius=radius;
  }
  public double calculatevol(){
    return (4.0/3.0)*Math.PI*Math.pow(radius,3);
    
  }
   public  double calsurfacearea(){
    return 4.0*Math.PI*Math.pow(radius,2);
    
  }
  
}
 class Cube extends Shape3D{
   private double sidelength;
    public Cube(double sidelength) {
    this.sidelength = sidelength;
  }
   
 public double calculatevol(){
   return Math.pow(sidelength,3);
 }
 public  double calsurfacearea(){
   return 6*Math.pow(sidelength,2);
 }
 }
 public class Main{
   public static void main(String args[]){
     Shape3D sphere=new Sphere(5.0);
     Shape3D cube=new Cube(5.0);
     System.out.println("sphere volume" + sphere.calculatevol());
     System.out.println("Sphrer surface area" +sphere.calsurfacearea());
     System.out.println("cube volume" + cube.calculatevol());
     System.out.println("cube surface area" +cube.calsurfacearea());
     
   }
 }

---------------------------------------------------------------------------------------------
Q7>
abstract class Vehicle{
  public abstract void StartEngine();
  public abstract void StopEngine();
  
}
class Car extends Vehicle{
  public void StartEngine(){
    System.out.println("Start Engine of the car");
  }
  public void StopEngine(){
    System.out.println("Stop");
  }
}

class Bike extends Vehicle{
  public void StartEngine(){
    System.out.println("Start the BIke engine");
    
  }
  public void StopEngine(){
    System.out.println("Stop");
  }
}

public class Main{
  public static void main(String args[]){
    Vehicle car=new Car();
    Vehicle bike=new Bike();
    car.StartEngine();
    bike.StartEngine();
    car.StopEngine();
    bike.StopEngine();
  }
}
------------------------------------------------------------------------------------------------
Q>10

abstract class Shape2D{
  public abstract void draw();
  public abstract void resize();
}
class Rectangle extends Shape2D{
   public void draw(){
     System.out.println("Rectangle: Drawing a rectangle.");
   }
   public void resize(){
     System.out.println("Rectangle: resize a rectangle.");
   }
}
class Circle extends Shape2D{
   public void draw(){
     System.out.println("Circle: Drawing a Circle.");
   }
   public void resize(){
     System.out.println("Circle: Drawing a Circle.");
   }
}
  public class Main{
  public static void main(String args[]){
    Shape2D rectangle= new Rectangle();
    Shape2D circle =new Circle();
    rectangle.draw();
    rectangle.resize();
    circle.draw();
    circle.resize();
  }
}



Q----------------LAB---------------------------------------------------------------------Q

abstract class Shape {
    abstract double calculateArea();
    abstract double calculatePerimeter();
}

class Rectangle extends Shape {
    private double length;
    private double breadth;

    public Rectangle(double length, double breadth) {
        this.length = length;
        this.breadth = breadth;
    }

    @Override
    public double calculateArea() {
        return length * breadth;
    }

    @Override
    public double calculatePerimeter() {
        return 2 * (length + breadth);
    }
}

class Triangle extends Shape {
    private double side1;
    private double side2;
    private double side3;

    public Triangle(double side1, double side2, double side3) {
        this.side1 = side1;
        this.side2 = side2;
        this.side3 = side3;
    }

    @Override
    public double calculateArea() {
        double s = (side1 + side2 + side3) / 2;
        return Math.sqrt(s * (s - side1) * (s - side2) * (s - side3));
    }

    @Override
    public double calculatePerimeter() {
        return side1 + side2 + side3;
    }
}

public class Main {
    public static void main(String[] args) {
        double length = 4.0;
        double breadth = 3.0;
        Rectangle rectangle = new Rectangle(length, breadth);

        double ts1 = 3.0, ts2 = 4.0, ts3 = 5.0;
        Triangle triangle = new Triangle(ts1, ts2, ts3);

        System.out.println("Length of the Rectangle: " + length);
        System.out.println("Breadth of the Rectangle: " + breadth);
        System.out.println("Area of the Rectangle: " + rectangle.calculateArea());
        System.out.println("Perimeter of the Rectangle: " + rectangle.calculatePerimeter());

        System.out.println("\nSides of the Triangle are: " + ts1 + ',' + ts2 + ',' + ts3);
        System.out.println("Area of the Triangle: " + triangle.calculateArea());
        System.out.println("Perimeter of the Triangle: " + triangle.calculatePerimeter());
    }
}


-----------LAB------------------------------------------------------------------------

class Num {
    protected int number;

    public Num(int number) {
        this.number = number;
    }

    public void shownum() {
        System.out.println("Number: " + number);
    }
}

class HexNum extends Num {
    public HexNum(int number) {
        super(number);
    }

    @Override
    public void shownum() {
        System.out.println("Hexadecimal Value: " + Integer.toHexString(number));
    }
}

public class Main {
    public static void main(String[] args) {
        Num baseNum = new Num(42);
        baseNum.shownum();

        HexNum hexNum = new HexNum(42);
        hexNum.shownum();
    }
}
-

------------------------------------------------------------------------------------------------
import java.util.Scanner;

abstract class BankAccount {
    
     abstract void deposit(double amount);
    abstract void withdraw(double amount);
    
    private double balance;

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

   
}

class SavingsAccount extends BankAccount {
    private double interestRate;

    public SavingsAccount(double balance, double interestRate) {
        setBalance(balance);
        this.interestRate = interestRate;
    }

    @Override
    void deposit(double amount) {
        setBalance(getBalance() + amount);
    }

    @Override
    void withdraw(double amount) {
        setBalance(getBalance() - amount);
    }
}

class CurrentAccount extends BankAccount {
    public CurrentAccount(double balance) {
        setBalance(balance);
    }

    @Override
    void deposit(double amount) {
        setBalance(getBalance() + amount);
    }

    @Override
    void withdraw(double amount) {
        setBalance(getBalance() - amount);
    }
}

public class Main {
    public static void main(String[] args) {
        SavingsAccount savingsAccount = new SavingsAccount(5000, 0.05);
        savingsAccount.deposit(1000);
        savingsAccount.withdraw(500);
        System.out.println("Savings Account Balance: " + savingsAccount.getBalance());

        CurrentAccount currentAccount = new CurrentAccount(10000);
        currentAccount.deposit(2000);
        currentAccount.withdraw(1000);
        System.out.println("Current Account Balance: " + currentAccount.getBalance());
    }
}
_______________________________________________________________________________________________

class Main{
    public static void main(String args[]){
        int vcount=0,ccount=0;
        String str="manner            dfg";
        str=str.toLowerCase();
        for(int i=0;i<str.length();i++){
            if(str.charAt(i)=='a'||str.charAt(i)=='e'||str.charAt(i)=='i'||str.charAt(i)=='o'||str.charAt(i)=='u'){
                vcount++;
            }
           //
 else if(str.charAt(i)>='a'&& str.charAt(i)<='z'){
                ccount++;
            }
        }
       System.out.println("number of vowels"+vcount);
       System.out.println("mumber of consonant"+ccount);
    }
}







public class Main{
    public static void main(String args[]){
        String str="Dream big";
        String reversedstr=" ";
        for(int i=str.length()-1;i>=0;i--){
            reversedstr=reversedstr+str.charAt(i);
            
        }
        System.out.println("original string"+str);
        System.out.println("Reversed String"+reversedstr);
    }
}
{"id":16,"scId":48000018,"name":"Super City Rampage","hash":"Super-City-Rampage","scHash":"superCityRampage","disabled":true,"color":"#ff6847","bgColor":"#dc2423","version":1,"title":"Three players vs the MEGA MONSTER","tutorial":"Can you beat the Mega Monster and save the City? Join forces with two teammates to take down the Mega Monster. You can get back in the fight as long as at least one of your teammates is standing. If everyone falls OR all buildings get destroyed, the match is over!  Rampages increase in Challenge, from Normal all the way to Insane, every time you manage to beat the Mega Monster.","description":"Can you beat the Mega Monster and save the City? Join forces with two teammates to take down the Mega Monster. You can get back in the fight as long as at least one of your teammates is standing. If everyone falls OR all buildings get destroyed, the match is over!  Rampages increase in Challenge, from Normal all the way to Insane, every time you manage to beat the Mega Monster.","shortDescription":"Defeat the Boss","sort1":15,"sort2":15,"link":"https://brawlify.com/gamemodes/detail/Super-City-Rampage","imageUrl":"https://cdn-old.brawlify.com/gamemode/Super-City-Rampage.png","imageUrl2":"https://cdn-old.brawlify.com/gamemode/header/Super-City-Rampage.png","lastActive":1645430400}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<alert
    xmlns="urn:oasis:names:tc:emergency:cap:1.2">
    <identifier>8a78b202447e4fdb84be3917b4d97a55_120170</identifier>
    <sender>ocv_ipaws@120170</sender>
    <sent>2023-12-04T17:04:09-00:00</sent>
    <status>Actual</status>
    <msgType>Alert</msgType>
    <scope>Public</scope>
    <code>IPAWSv1.0</code>
    <info>
        <language>en-US</language>
        <category>Security</category>
        <event>Test</event>
        <urgency>Immediate</urgency>
        <severity>Extreme</severity>
        <certainty>Observed</certainty>
        <eventCode>
            <valueName>SAME</valueName>
            <value>SPW</value>
        </eventCode>
        <expires>2023-12-04T19:04:09-00:00</expires>
        <senderName>OCV</senderName>
        <headline>Test</headline>
        <description>Testing with polygon</description>
        <parameter>
            <valueName>EAS-ORG</valueName>
            <value>CIV</value>
        </parameter>
        <parameter>
            <valueName>timezone</valueName>
            <value>UTC</value>
        </parameter>
        <parameter>
            <valueName>BLOCKCHANNEL</valueName>
            <value>EAS</value>
        </parameter>
        <parameter>
            <valueName>BLOCKCHANNEL</valueName>
            <value>NWEM</value>
        </parameter>
        <parameter>
            <valueName>WEAHandling</valueName>
            <value>Imminent Threat</value>
        </parameter>
        <parameter>
            <valueName>CMAMtext</valueName>
            <value>Test</value>
        </parameter>
        <parameter>
            <valueName>CMAMlongtext</valueName>
            <value></value>
        </parameter>
        <area>
            <areaDesc>Lee County Alabama</areaDesc>
            <polygon>32.635521121840846,-85.47122246840102 32.62295827375514,-85.46861804344758 32.63268636190215,-85.48836848952871 32.635521121840846,-85.47122246840102</polygon>
            <geocode>
                <valueName>SAME</valueName>
                <value>001081</value>
            </geocode>
        </area>
    </info>
    <capsig:Signature
        xmlns:capsig="http://www.w3.org/2000/09/xmldsig#">
        <capsig:SignedInfo>
            <capsig:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
            <capsig:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
            <capsig:Reference URI="">
                <capsig:Transforms>
                    <capsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
                </capsig:Transforms>
                <capsig:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
                <capsig:DigestValue>HPUxsg+gTfYuvAV3rpYJHJrJW+1RSnDtyeK3IIM9/2E=</capsig:DigestValue>
            </capsig:Reference>
        </capsig:SignedInfo>
        <capsig:SignatureValue>bW2/NitHRMdaABZTLRHSyQjSzT05fyGDJsXTZ1v4r1HwGlAZM0PhRbd70QnTZ4FiKUg28m1EY3Xbuh/ULqyQjShoafLezlRLxroPpLC9EGziqzdwlHHirc+a6cRdxCM97swKTiomQDRBq9BE7QmGLgPWTRuL28mY1vWaaOnVrZHCfuiSZF6p24uwvqbNNQWRVQT9b8j65YYWkXIiuk7XFrkNt11OSFW11GIhprE43VUfuModNJxMEc7KRWsbgNV7X1BjSmmo2BG2jb+jlXavoPLLBakv1SWSh5byvWkhU5sttdXKf/YN8zhdMvoOlGdlxP+4UWzYDiuzy2Ylspn4cw==</capsig:SignatureValue>
        <capsig:KeyInfo>
            <capsig:X509Data>
                <capsig:X509SubjectName>CN=IPAWSOPEN120170,OU=A01413300000177FF30EA1D00000F72,OU=Devices IPAWS,OU=National Continuity Programs,O=FEMA IPAWS,C=US</capsig:X509SubjectName>
                <capsig:X509Certificate>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</capsig:X509Certificate>
            </capsig:X509Data>
        </capsig:KeyInfo>
    </capsig:Signature>
</alert>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<alert
    xmlns="urn:oasis:names:tc:emergency:cap:1.2">
    <identifier>9af7517bd0a64adf88c06945fdce7206_120170</identifier>
    <sender>ocv_ipaws@120170</sender>
    <sent>2023-12-04T16:52:12-00:00</sent>
    <status>Actual</status>
    <msgType>Alert</msgType>
    <scope>Public</scope>
    <code>IPAWSv1.0</code>
    <info>
        <language>en-US</language>
        <category>Security</category>
        <event>Test</event>
        <urgency>Immediate</urgency>
        <severity>Extreme</severity>
        <certainty>Observed</certainty>
        <eventCode>
            <valueName>SAME</valueName>
            <value>SPW</value>
        </eventCode>
        <expires>2023-12-04T18:52:12-00:00</expires>
        <senderName>OCV</senderName>
        <headline>Test</headline>
        <description>Testing of no polygon</description>
        <parameter>
            <valueName>EAS-ORG</valueName>
            <value>CIV</value>
        </parameter>
        <parameter>
            <valueName>timezone</valueName>
            <value>UTC</value>
        </parameter>
        <parameter>
            <valueName>BLOCKCHANNEL</valueName>
            <value>EAS</value>
        </parameter>
        <parameter>
            <valueName>BLOCKCHANNEL</valueName>
            <value>NWEM</value>
        </parameter>
        <parameter>
            <valueName>WEAHandling</valueName>
            <value>Imminent Threat</value>
        </parameter>
        <parameter>
            <valueName>CMAMtext</valueName>
            <value>Test</value>
        </parameter>
        <parameter>
            <valueName>CMAMlongtext</valueName>
            <value></value>
        </parameter>
        <area>
            <areaDesc>Lee County Alabama</areaDesc>
            <geocode>
                <valueName>SAME</valueName>
                <value>001081</value>
            </geocode>
        </area>
    </info>
    <capsig:Signature
        xmlns:capsig="http://www.w3.org/2000/09/xmldsig#">
        <capsig:SignedInfo>
            <capsig:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
            <capsig:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
            <capsig:Reference URI="">
                <capsig:Transforms>
                    <capsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
                </capsig:Transforms>
                <capsig:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
                <capsig:DigestValue>JOLKhVgTuGbk2tzbvfY4WSu3/tRkyVlbZw9NewqYc7A=</capsig:DigestValue>
            </capsig:Reference>
        </capsig:SignedInfo>
        <capsig:SignatureValue>p2aNcvd5khGq4U9+ty1SoxW29bSQf48oWOCAhjRYQ05di9aOifY8cxm3BKs/dinPINfy9uLEn311ve/Z7vAPl3rsJM68ruWiU5rWCaDbY8gqn/B+Rzc6AOEYR3sUDyFqZfHk+D2CuZXjusnNbxHjW4EIqhezqboBOrwVIFaQOkPhDY3WptQkDvK/uCAg9eV9mwJ4PX3ANttn3wiMHB+9EROmlTPm4eronhJQcDE5U0sdg4XT+gW45TAocw4DeeUbYihhm44n7jnilmVIXgpPIvPQ8SbYa7hr5U2bTp0H4b3Wl2TXXDheRIZ5s89QbYjS6gqoaYO94+ZaQqaaAg9pog==</capsig:SignatureValue>
        <capsig:KeyInfo>
            <capsig:X509Data>
                <capsig:X509SubjectName>CN=IPAWSOPEN120170,OU=A01413300000177FF30EA1D00000F72,OU=Devices IPAWS,OU=National Continuity Programs,O=FEMA IPAWS,C=US</capsig:X509SubjectName>
                <capsig:X509Certificate>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</capsig:X509Certificate>
            </capsig:X509Data>
        </capsig:KeyInfo>
    </capsig:Signature>
</alert>
package com.rte_france.decofer.datapublication;

import javax.crypto.*;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.*;

public class DBeaver {

    // from the DBeaver source 8/23/19 https://github.com/dbeaver/dbeaver/blob/57cec8ddfdbbf311261ebd0c7f957fdcd80a085f/plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/app/DefaultSecureStorage.java#L31
    private static final byte[] LOCAL_KEY_CACHE = new byte[] { -70, -69, 74, -97, 119, 74, -72, 83, -55, 108, 45, 101, 61, -2, 84, 74 };

    static String decrypt(byte[] contents) throws InvalidAlgorithmParameterException, InvalidKeyException, IOException, NoSuchPaddingException, NoSuchAlgorithmException {
        try (InputStream byteStream = new ByteArrayInputStream(contents)) {
            byte[] fileIv = new byte[16];
            byteStream.read(fileIv);
            Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
            SecretKey aes = new SecretKeySpec(LOCAL_KEY_CACHE, "AES");
            cipher.init(Cipher.DECRYPT_MODE, aes, new IvParameterSpec(fileIv));
            try (CipherInputStream cipherIn = new CipherInputStream(byteStream, cipher)) {
                return inputStreamToString(cipherIn);
            }
        }
    }

    static String inputStreamToString(java.io.InputStream is) {
        java.util.Scanner s = new java.util.Scanner(is).useDelimiter("\\A");
        return s.hasNext() ? s.next() : "";
    }

    public static void main(String[] args) throws Exception {
        System.out.println(decrypt(Files.readAllBytes(Paths.get("C:\\Users\\banass\\AppData\\Roaming\\DBeaverData\\workspace6\\DECOFER\\.dbeaver\\credentials-config.json"))));
    }

}
class SegmentTreeLazyPropagation:
    def __init__(self, A):
        self.A = A
        self.tree = [0] * (4 * len(A))  # Adjust the size as needed
        self.lazy = [0] * (4 * len(A))
        self.build(0, 0, len(A) - 1)

    def build(self, node, start, end):
        if start == end:
            self.tree[node] = self.A[start]
        else:
            mid = (start + end) // 2
            self.build(2 * node + 1, start, mid)
            self.build(2 * node + 2, mid + 1, end)
            self.tree[node] = self.tree[2 * node + 1] + self.tree[2 * node + 2]

    def update_range(self, l, r, val):
        self._update_range(0, 0, len(self.A) - 1, l, r, val)

    def _update_range(self, node, start, end, l, r, val):
        if self.lazy[node] != 0:
            self.tree[node] += (end - start + 1) * self.lazy[node]
            if start != end:
                self.lazy[2 * node + 1] += self.lazy[node]
                self.lazy[2 * node + 2] += self.lazy[node]
            self.lazy[node] = 0

        if r < start or end < l:
            return

        if l <= start <= end <= r:
            self.tree[node] += (end - start + 1) * val
            if start != end:
                self.lazy[2 * node + 1] += val
                self.lazy[2 * node + 2] += val
            return

        mid = (start + end) // 2
        self._update_range(2 * node + 1, start, mid, l, r, val)
        self._update_range(2 * node + 2, mid + 1, end, l, r, val)
        self.tree[node] = self.tree[2 * node + 1] + self.tree[2 * node + 2]

    def query(self, l, r):
        return self._query(0, 0, len(self.A) - 1, l, r)

    def _query(self, node, start, end, l, r):
        if self.lazy[node] != 0:
            self.tree[node] += (end - start + 1) * self.lazy[node]
            if start != end:
                self.lazy[2 * node + 1] += self.lazy[node]
                self.lazy[2 * node + 2] += self.lazy[node]
            self.lazy[node] = 0

        if r < start or end < l:
            return 0

        if l <= start <= end <= r:
            return self.tree[node]

        mid = (start + end) // 2
        p1 = self._query(2 * node + 1, start, mid, l, r)
        p2 = self._query(2 * node + 2, mid + 1, end, l, r)
        return p1 + p2

# Example Usage
A = [1, 2, 3, 4, 5]
seg_tree_lazy = SegmentTreeLazyPropagation(A)

# Range Update example
seg_tree_lazy.update_range(1, 3, 2)
result = seg_tree_lazy.query(1, 3)
print("Sum in range [1, 3] after update:", result)

# Query example
result = seg_tree_lazy.query(2, 4)
print("Sum in range [2, 4]:", result)
class FenwickTree:
    def __init__(self, arr):
        self.n = len(arr)
        self.BITTree = [0] * (self.n + 1)

        for i in range(self.n):
            self.update(i, arr[i])

    def get_sum(self, i):
        s = 0
        i = i + 1

        while i > 0:
            s += self.BITTree[i]
            i -= i & (-i)

        return s

    def update(self, i, v):
        i += 1

        while i <= self.n:
            self.BITTree[i] += v
            i += i & (-i)


# Driver code to test the FenwickTree class
freq = [2, 1, 1, 3, 2, 3, 4, 5, 6, 7, 8, 9]
fenwick_tree = FenwickTree(freq)

print("Sum of elements in arr[0..5] is " + str(fenwick_tree.get_sum(5)))

freq[3] += 6
fenwick_tree.update(3, 6)
print("Sum of elements in arr[0..5] after update is " + str(fenwick_tree.get_sum(5)))
/*slider sipky viditelne*/
.et-pb-arrow-next {
       opacity: 1;
       right: 22px;
}
.et-pb-arrow-prev{
       opacity: 1;
       left: 22px;
}
star

Thu Dec 07 2023 09:25:10 GMT+0000 (Coordinated Universal Time) https://www.ehansalytics.com/blog/2019/3/17/create-a-dynamic-date-table-in-power-query

@nikahafiz #ms.pbi #power.query #date #earliest.date #ms.excel

star

Thu Dec 07 2023 09:06:41 GMT+0000 (Coordinated Universal Time)

@irfanelahi

star

Thu Dec 07 2023 09:05:06 GMT+0000 (Coordinated Universal Time)

@irfanelahi

star

Thu Dec 07 2023 07:40:54 GMT+0000 (Coordinated Universal Time)

@Samarmhamed78

star

Thu Dec 07 2023 07:33:33 GMT+0000 (Coordinated Universal Time)

@Samarmhamed78

star

Thu Dec 07 2023 06:21:58 GMT+0000 (Coordinated Universal Time) https://www.cloudways.com/blog/live-search-laravel-ajax/

@zaryabmalik

star

Thu Dec 07 2023 02:18:47 GMT+0000 (Coordinated Universal Time) https://web.whatsapp.com/

@marcos

star

Wed Dec 06 2023 14:37:41 GMT+0000 (Coordinated Universal Time)

@ClemensBerteld #python #airflow

star

Wed Dec 06 2023 13:06:32 GMT+0000 (Coordinated Universal Time)

@shabih #vba

star

Wed Dec 06 2023 11:27:45 GMT+0000 (Coordinated Universal Time) https://joshcollinsworth.com/blog/never-use-px-for-font-size

@linabalciunaite

star

Wed Dec 06 2023 11:24:05 GMT+0000 (Coordinated Universal Time)

@Jeremicah

star

Wed Dec 06 2023 09:11:41 GMT+0000 (Coordinated Universal Time) https://proxy2.webshare.io/proxy/list?modals

@gainz_village

star

Wed Dec 06 2023 08:54:26 GMT+0000 (Coordinated Universal Time)

@KutasKozla #java

star

Wed Dec 06 2023 07:41:31 GMT+0000 (Coordinated Universal Time) https://analytics.google.com/analytics/web/

@santosbruna

star

Wed Dec 06 2023 07:35:14 GMT+0000 (Coordinated Universal Time) https://codepen.io/thinkdave/pen/rMzxBx

@irfanelahi

star

Wed Dec 06 2023 07:33:54 GMT+0000 (Coordinated Universal Time)

@irfanelahi ##custom

star

Wed Dec 06 2023 07:02:04 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/45033660/call-suitelet-from-user-event-ss-2

@mdfaizi #javascript

star

Tue Dec 05 2023 23:59:18 GMT+0000 (Coordinated Universal Time) https://community.spiceworks.com/topic/900079-how-to-merge-all-txt-files-into-one-using-type-and-insert-new-line-after-each

@baamn

star

Tue Dec 05 2023 23:07:59 GMT+0000 (Coordinated Universal Time)

@akshaypunhani #python

star

Tue Dec 05 2023 22:21:41 GMT+0000 (Coordinated Universal Time) https://www.online-tech-tips.com/free-software-downloads/combine-text-files/

@baamn #commandline

star

Tue Dec 05 2023 22:13:30 GMT+0000 (Coordinated Universal Time) https://superuser.com/questions/682001/combine-multiple-text-files-filenames-into-a-single-text-file

@baamn

star

Tue Dec 05 2023 22:10:11 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/40286458/combine-multiple-text-files-and-produce-a-new-single-text-file-using-powershell

@baamn

star

Tue Dec 05 2023 22:08:08 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/40286458/combine-multiple-text-files-and-produce-a-new-single-text-file-using-powershell

@baamn

star

Tue Dec 05 2023 22:07:28 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/40286458/combine-multiple-text-files-and-produce-a-new-single-text-file-using-powershell

@baamn

star

Tue Dec 05 2023 20:38:19 GMT+0000 (Coordinated Universal Time)

@bfpulliam #react.js

star

Tue Dec 05 2023 20:16:51 GMT+0000 (Coordinated Universal Time)

@Shuhab #bash

star

Tue Dec 05 2023 19:44:08 GMT+0000 (Coordinated Universal Time)

@Shuhab #bash

star

Tue Dec 05 2023 19:37:38 GMT+0000 (Coordinated Universal Time)

@Shuhab #bash

star

Tue Dec 05 2023 19:26:30 GMT+0000 (Coordinated Universal Time)

@Mohamedshariif #java

star

Tue Dec 05 2023 18:44:24 GMT+0000 (Coordinated Universal Time)

@vs #r

star

Tue Dec 05 2023 17:45:41 GMT+0000 (Coordinated Universal Time)

@rick_m #c#

star

Tue Dec 05 2023 15:06:28 GMT+0000 (Coordinated Universal Time)

@wasim_mm1

star

Tue Dec 05 2023 15:04:02 GMT+0000 (Coordinated Universal Time)

@wasim_mm1

star

Tue Dec 05 2023 15:03:36 GMT+0000 (Coordinated Universal Time)

@wasim_mm1

star

Tue Dec 05 2023 13:57:53 GMT+0000 (Coordinated Universal Time) https://www.reddit.com/r/Notion/comments/rwpiki/changing_priority_level_based_on_date_formula/

@Hack3rmAn

star

Tue Dec 05 2023 13:46:29 GMT+0000 (Coordinated Universal Time)

@mdfaizi

star

Tue Dec 05 2023 12:57:29 GMT+0000 (Coordinated Universal Time)

@AlexP ##mysql ##woocommerce

star

Tue Dec 05 2023 11:20:42 GMT+0000 (Coordinated Universal Time)

@maltaellll

star

Tue Dec 05 2023 07:39:43 GMT+0000 (Coordinated Universal Time) https://codepen.io/jh3y/pen/XWOodoP

@passoul #css #scroll #animation

star

Tue Dec 05 2023 02:24:12 GMT+0000 (Coordinated Universal Time)

@arshadalam007 #undefined

star

Tue Dec 05 2023 01:53:16 GMT+0000 (Coordinated Universal Time) https://api.brawlapi.com/v1/gamemodes/15

@nickle #json

star

Mon Dec 04 2023 17:07:47 GMT+0000 (Coordinated Universal Time)

@bfpulliam #react.js

star

Mon Dec 04 2023 17:06:43 GMT+0000 (Coordinated Universal Time)

@bfpulliam #react.js

star

Mon Dec 04 2023 15:16:39 GMT+0000 (Coordinated Universal Time)

@ambre

star

Mon Dec 04 2023 14:33:08 GMT+0000 (Coordinated Universal Time)

@utp

star

Mon Dec 04 2023 13:38:42 GMT+0000 (Coordinated Universal Time)

@utp

star

Mon Dec 04 2023 13:25:24 GMT+0000 (Coordinated Universal Time) https://i.stack.imgur.com/xVscR.jpg

@mdfaizi

star

Mon Dec 04 2023 13:24:12 GMT+0000 (Coordinated Universal Time)

@hedviga

Save snippets that work with our extensions

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