Snippets Collections
class Solution{

public:
    int searchBST(Node* root, int target, int ans = -1){
        if(!root){
            return ans;
        }
        if(root->data <= target){
            ans = root->data;
            return searchBST(root->right,target, ans);
        }
        return searchBST(root->left, target, ans);
        
    }
    int floor(Node* root, int x) {
        // Code here
        if(!root )  return -1;
        return searchBST(root, x);
    }
};
function create_custom_post_type_and_taxonomy() {
    // Register Custom Post Type
    register_post_type( 'testmonial',
        array(
            'labels' => array(
                'name' => __( 'Testmonials' ),
                'singular_name' => __( 'Testmonial' )
            ),
            'public' => true,
            'has_archive' => true,
            'rewrite' => array('slug' => 'testmonials/%testmonials_cat%'),
            'supports' => array('title', 'editor', 'thumbnail', 'excerpt')
        )
    );

    // Register Custom Taxonomy
    register_taxonomy(
        'testmonials_cat', 
        'testmonial', 
        array(
            'label' => __( 'Testmonials Categories' ),
            'rewrite' => array( 'slug' => 'testmonials-cat' ),
            'hierarchical' => true,
        )
    );

    // Flush rewrite rules on activation
    flush_rewrite_rules();
}

add_action( 'init', 'create_custom_post_type_and_taxonomy' );

// Replace placeholder with actual category
function change_testmonials_permalink( $post_link, $post ) {
    if ( is_object( $post ) && $post->post_type == 'testmonial' ) {
        $terms = wp_get_object_terms( $post->ID, 'testmonials_cat' );
        if ( $terms ) {
            return str_replace( '%testmonials_cat%', $terms[0]->slug, $post_link );
        }
    }
    return $post_link;
}
add_filter( 'post_type_link', 'change_testmonials_permalink', 10, 2 );
function product_custom_loop($atts){
    ob_start();
    
    $atts = shortcode_atts(array(
        'posts_per_page' => 8,
        'category' => '',
    ), $atts);
    
    $args = array(
        'post_type' => 'product',
        'posts_per_page' => $atts['posts_per_page'],
    );

    if (!empty($atts['category'])) {
        $args['tax_query'] = array(
            array(
                'taxonomy' => 'product_cat',
                'field' => 'slug',
                'terms' => $atts['category'],
            ),
        );
    }
    
    $results = new WP_Query($args);
    // echo '<pre>';
    // var_dump($atts['category']);
    ?>
    <div class="row product_row <?php echo (! empty($atts['category'])) ? 'list_product': ''; ?>">
        <?php
        if($results->have_posts()):
            while($results->have_posts()):
                $results->the_post();
                global $product;
                $categories = get_the_terms(get_the_ID(), 'product_cat');
        ?>
        <div class="<?php echo (! empty($atts['category'])) ? 'col-md-12': 'col-md-3'; ?>">
            <div class="product_wrap">
                <div class="product_img_wrap">
                    <a href="<?php echo esc_url(get_permalink()); ?>">
                        <?php the_post_thumbnail('full'); ?>
                    </a>
                </div>
                <div class="product_content">
                    <?php
                        if(!$atts['category']){
                            if ($categories && !is_wp_error($categories)) {
                                $category_names = array();
                                foreach ($categories as $category) {
                                    $category_names[] = $category->name;
                                }
                                echo '<div class="pro_cat">' . implode(', ', $category_names) . '</div>';
                            }
                        }
                    ?>
                    <a class="proTitle" href="<?php echo esc_url(get_permalink()); ?>"><?php echo esc_html(get_the_title()); ?></a>
	                <div class="product_price-pack">
    	                <div class="product_price">
                			<?php 
                			  global $product;
                			  if ($product->is_type( 'simple' )) { ?>
                			<?php echo $product->get_price_html(); ?>
                			<?php } ?>
                			<?php 
                    		  if($product->get_type()=='variable') {
                    		      $available_variations = $product->get_available_variations();
                    		      $variation_id=$available_variations[0]['variation_id']; // Getting the variable id of just the 1st product. You can loop $available_variations to get info about each variation.
                    		      $variable_product1= new WC_Product_Variation( $variation_id );
                    		      $regular_price = $variable_product1 ->regular_price;
                    		      $sales_price = $variable_product1 -> sale_price;
                    		      if (empty($sales_price)) {
                    		      $sales_price = 0;
                    		        }
                    		      }
                			  ?>
            			</div>
            			<?php if(!$atts['category']){?>
                			<div class="product_btn">
                    			<a href="<?php echo esc_url( get_site_url() . '/cart/?add-to-cart=' . $product->get_id() ); ?>">
                        	        <span class="list-icon fas fa-plus"></span>
                        	    </a>
            			    </div>
        			    <?php } ?>
        			</div>
                </div>
            </div>
        </div>
        <?php
            endwhile;
        endif;
        ?>
    </div>
    <?php
    wp_reset_postdata();
    return ob_get_clean();
}
add_shortcode('wp-product','product_custom_loop');
[wp-product posts_per_page="4" category="best-selling"]
function product_cat_loop(){
    $product_cat = get_terms('product_cat' , array(
        'orderby'    => 'name',
        'order'      => 'ASC',
        'hide_empty' => true,
        // 'number' => 6,
        ));
        ?>
        <div class="row product_cat_row">
            <?php
            if(!empty($product_cat) && ! is_wp_error($product_cat)):
                foreach($product_cat as $category):
                    $thumbnail_id = get_woocommerce_term_meta($category->term_id, 'thumbnail_id', true);
                    $thumbnail_url = wp_get_attachment_url($thumbnail_id);
                    if($thumbnail_url){
            ?>
            <div class="col-md-2">
                <div class="product_cat">
                    <div class="product_cat_img">
                        <?php if ($thumbnail_url) : ?>
                            <img src="<?php echo $thumbnail_url; ?>" alt="<?php echo $category->name; ?>">
                        <?php endif; ?>
                    </div>
                    <div class="product_cat_info">
                        <a href="<?php echo get_term_link($category); ?>">
                            <p><?php echo $category->name; ?></p>
                            <p><?php echo $category->count; ?> products </p>
                        </a>
                    </div>
                </div>
            </div>
            <?php
                    }
                endforeach;
            endif;
            ?>
        </div>
<?php }
function remove_add_to_cart_button_from_specific_product()
{
    $product_id = 23396;
    if (is_singular('product') && get_the_ID() == $product_id) {
        remove_action('woocommerce_single_variation', 'woocommerce_single_variation_add_to_cart_button', 20);
    }
}
add_action('wp', 'remove_add_to_cart_button_from_specific_product');

function add_custom_button()
{
    $product_id = 23396;
    if (is_singular('product') && get_the_ID() == $product_id) {
        echo '<p>' . __('Prices available upon request') . '</p>';
        echo '<div class="header-right-icon-group singleBtnId open-modal">';
        echo '<a href="javascript:void(0)">' . __('Contact Now') . '</a>';
        echo '</div>';
        echo '<style>
            .single_variation_wrap{
                display:none !important;
            }
        </style>';
?>
        <div id="myModal" class="modal product_modal">
            <div class="modal-content">
                <span class="close">&times;</span>
                <?php echo do_shortcode('[gravityform id="1" title="false" ajax="true"]');  ?>
            </div>
        </div>
    <?php
    }
}
add_action('woocommerce_single_product_summary', 'add_custom_button', 31);

function product_modal()
{
    ?>
    <script>
        jQuery(document).ready(function() {
            jQuery(".open-modal").click(function() {
                jQuery("#myModal").css("display", "block");
            });

            jQuery(".close").click(function() {
                jQuery("#myModal").css("display", "none");
            });
        });
    </script>
<?php
}
add_action('wp_head', 'product_modal');

//Modal Css


.modal {
	display: none;
    position: fixed;
    z-index: 9;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0 0 0 / 87%);
    padding-top: 60px;
}

.modal-content {
    background-color: #fefefe;
    margin: 8% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 50%;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.close:hover,
.close:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}
.product_modal label {
    color: #000;
    text-transform: uppercase;
    font-size: 13px !important;
    letter-spacing: 3px;
}
class CountingAsterisk {
    public static void main(String[] args) {
        System.out.println(countAsterisks("iamprogrammer"));
    }

    public static int countAsterisks(String s) {
        int count = 0;
        int localCount = 0;
        for (int i = 0; i < s.length(); i++) {
            if (localCount % 2 == 0) {
                if (s.charAt(i) == '*') {
                    count++;
                }
            }
            if (s.charAt(i) == '|') {
                localCount++;
            }
        }
        return count;
    }
}
/*----------------------------*/
bool isPrime(int n){for(int i=2;i*i<=n;i++){if(n%i==0)return false;}return true;}
bool isvowel(char c){return (c=='a'||c=='e'||c=='i'||c=='o'||c=='u');}
bool isperfect(long long num){int count = 0;while (num & count<11) {count += num % 10;num /= 10;}return count == 10;}
/*----------------------------*/
#define ll long long
#define dd double
#define vi  vector<int> 
#define vvi vector<vector<int>>
#define mi map<int,int>
#define pr  pair<int,int>
#define unset unordered_set<int>
#define ff first
#define ss second
#define pb push_back
#define MAX INT_MAX
#define MIN INT_MIN
#define fr(i,n) for(int i=0; i<n; i++)
const int MOD=1e9+7;

#include<bits/stdc++.h>
using namespace std;
int main(){
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);

    return 0;
}
#include<bits/stdc++.h>
#include <iostream> 
#include <vector>
#include <utility> 
#include <iterator>
#include <algorithm> 
#include <deque> 
#include <cmath> 
#include <string>
using namespace std; 
//mmaxx=INT_MIN ; 
int main()
{      
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
      int N,M ; 
      cin>>N>>M ;  
      vector<int>C(N) ;
      int v[1000000]={0} ; 
      int arr[N]={0} ; 
      int count=0 ; 
       
      for(int i=0 ;i<N ;i++){ 
          cin>>C[i] ;
          v[C[i]]++ ; 
          if(v[C[i]]==2){
               arr[i]=1 ; 
          }
      } 
      
      
      
      
      
      while(M--){
          int x; 
          cin>>x ; 
          x-=1 ;
          count=N-x ;
          for(int i=x ;i<N ;i++){
              if(arr[i]==1){
                  count-=1;
              }
          }
      } 
      cout<<count<<endl;
      
        
        
        
    return 0;
}
...
@tf.function
def train(t_train, s_train, t_phys):
    # Data loss
    
    # predict displacement
    s_train_hat = net.predict(t_train)
    # MSE loss between training data and predictions
    data_loss = tf.math.reduce_mean(
        tf.math.square(s_train - s_train_hat)
    )
    # Physics loss
    
    # predict displacement
    s_phys_hat = net.predict(t_phys)
    # split into individual x and y components
    s_x = s_phys_hat[:, 0]
    s_y = s_phys_hat[:, 1]
    # take the gradients to get predicted velocity and acceleration
    v_x = tf.gradients(s_x, t_phys)[0]
    v_y = tf.gradients(s_y, t_phys)[0]
    a_x = tf.gradients(v_x, t_phys)[0]
    a_y = tf.gradients(v_y, t_phys)[0]
    # combine individual x and y components into velocity and
    # acceleration vectors
    v = tf.concat([v_x, v_y], axis=1)
    a = tf.concat([a_x, a_y], axis=1)
    # as acceleration is the known equation, this is what we want to
    # perform gradient descent on.
    # therefore, prevent any gradients flowing through the higher
    # order (velocity) terms
    v = tf.stop_gradient(v)
    # define speed (velocity norm, the ||v|| in the equation) and
    # gravity vector for physics equation
    speed = tf.norm(v, axis=1, keepdims=True)
    g = [[0.0, 9.81]]
    # MSE between known physics equation and network gradients
    phys_loss = tf.math.reduce_mean(
        tf.math.square(-mu * speed * v - g - a)
    )
    # Total loss
    
    loss = data_weight * data_loss + phys_weight * phys_loss
    
    # Gradient step
    
    # minimise the combined loss with respect to both the neural
    # network parameters and the unknown physics variable, mu
    gradients = tf.gradients(loss, net.train_vars + [mu])
    optimiser.apply_gradients(zip(gradients, net.train_vars + [mu]))
...
Follow me to join my server!

16M

Founder of IzakStudios
6.2M+ Donated on Pls Donate
<div id="PARENTID">
  <a id="HTMLELEMENTID" style="display: inline-block; padding: 10px 25px; background-color: #3A4BC8; color: #fff; font-family: Montserrat, sans-serif; font-size: 19px; line-height: 25px; border-radius: 5px; outline: none; cursor: pointer; text-decoration: none; box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);"
     data-cal-link="CALCOMLINK" data-cal-config='{"layout":"SETLAYOUT"}'>BUTTONTEXT</a>
</div>
<style>
    .parent>*{
    grid-area:1/1;
    }
</style>
<div class="parent grid max-w-[350px] rounded-md outline">
    <img class="aspect-square w-full object-contain" src="https://www.picsum.photos/id/233/1080/920" />
    <div class="h-full w-full bg-gradient-to-b from-transparent to-black/50"></div>
    <h1 class="mb-4 self-end text-center text-4xl text-white">Lorem, ipsum dolor</h1>
</div>
<style>
    .parent>*{
    grid-area:1/1;
    }
</style>
<div class="parent grid max-w-[350px] rounded-md outline">
    <img class="aspect-square w-full object-contain" src="https://www.picsum.photos/id/233/1080/920" />
    <div class="h-full w-full bg-gradient-to-b from-transparent to-black/50"></div>
    <h1 class="mb-4 self-end text-center text-4xl text-white">Lorem, ipsum dolor</h1>
</div>
#!/bin/bash
bold=$(tput bold)
normal=$(tput sgr0)

RED='\033[0;31m'
NC='\033[0m'

accept="Y"
multi_tenancy=false

is_arm=false

function validate_user() {
    egrep "^$1" /etc/passwd >/dev/null
    if [ $? -eq 0 ]; then
        echo "$1 exists! Please use a different user name"
        return 1
    else
        return 0
    fi
}

function deps_installation() {
Step - 1    # First install python, pip and redis
    sudo apt install git python3-dev python3-pip redis-server -y

Step - 2    # Install mariadb server and client
    sudo apt-get install mariadb-server -y
    sudo apt-get install mariadb-client -y

Step - 3    # Install nvm and then node 14
    if [ "$2" = true ]; then
        sudo -u $1 bash -c "cd /home/${1} && wget https://nodejs.org/download/release/v16.20.1/node-v16.20.1-linux-arm64.tar.xz && tar -xf node-v16.20.1-linux-arm64.tar.xz && sudo cp -r node-v16.20.1-linux-arm64/* /usr/local/"
    else
        sudo -u $1 bash -c "cd /home/${1} && wget https://nodejs.org/download/release/v16.20.1/node-v16.20.1-linux-x64.tar.xz && tar -xf node-v16.20.1-linux-x64.tar.xz && sudo cp -r node-v16.20.1-linux-x64/* /usr/local/"
    fi
    sudo -u $1 bash -c "sudo npm install -g yarn"

Step - 4    # sudo -u $1 bash -c "npm config set python python3"

Step - 5    # Install wkhtmltopdf
    sudo apt-get install xvfb libfontconfig wkhtmltopdf -y

Step - 6    #Install python virtualenv
    sudo apt install python3.10-venv -y
}

function mariadb_config() {
Step - 7    # Configure my.cnf
    echo -e "[mysqld]\ncharacter-set-client-handshake = FALSE\ncharacter-set-server = utf8mb4\ncollation-server = utf8mb4_unicode_ci\n\n[mysql]\ndefault-character-set = utf8mb4" | sudo tee -a /etc/mysql/my.cnf

Step - 8    # Restart the mysql server
    sudo service mysql restart
}

function frappe_installation() {
    echo "Installing Bench"
Step - 9    # Install Frappe bench
    sudo -u $1 bash -c "sudo pip3 install frappe-bench"
    
    python_version=$(python3 --version | cut -d " " -f 2)
Step - 10    # Edit bench util file so it can start supervisor with sudo
    sudo sed -i 's/{sudo}supervisorctl restart {group}/sudo supervisorctl restart all/g' /usr/local/lib/python3.10/dist-packages/bench/utils/bench.py
    
    echo "Initializing bench"
Step - 11    # Initialize a bench with a given erpnext version
    sudo -u $1 bash -c "cd /home/${1}; bench init --frappe-branch=${2} ${3}"
    
Step - 12    # Check if bench is installed properly
    # common_site_file="/home/${1}/${3}/sites/common_site_config.json"
    # if [ -e "$common_site_file" ]; then
    # 	echo "Bench installation successful"
    # else
    # 	echo "Bench not installed properly"
    # 	exit 1
    # fi
}

function erpnext_install() {
Step - 13    # create the site
    sudo -u $1 bash -c "cd /home/${1}/${6} && bench new-site ${2} --db-root-password ${3} --admin-password ${4}"
    
    # Check if the site is created properly
    # site_file="/home/${1}/${6}/sites/${2}/site_config.json"
    # if [ -e "$site_file" ]; then
    # 	echo "Site installation successful"
    # else
    # 	echo "Site not installed properly"
    # 	exit 1
    # fi
    
    if [ "$7" = false ]; then
        echo "Get the apps"
Step - 14        # get bench payment app
        sudo -u $1 bash -c "cd /home/${1}/${6} && bench get-app payments; bench get-app --branch ${5} erpnext; bench --site ${2} install-app erpnext"
    else
        sudo -u $1 bash -c "cd /home/${1}/${6} && bench --site ${2} install-app erpnext"
    fi
    # get the erpnext app
    # bench get-app --branch $5 erpnext
    
    # echo "Installing the apps on Site"
    # Install erpnext
    # bench --site $2 install-app erpnext
}

cat <<"EOF"
----------------------------------------------------------------
  _____   ____    ____    _   _                 _
 | ____| |  _ \  |  _ \  | \ | |   ___  __  __ | |_
 |  _|   | |_) | | |_) | |  \| |  / _ \ \ \/ / | __|
 | |___  |  _ <  |  __/  | |\  | |  __/  >  <  | |_
 |_____| |_| \_\ |_|     |_| \_|  \___| /_/\_\  \__|

  __  __
 |  \/  |   __ _   _ __     __ _    __ _    ___   _ __
 | |\/| |  / _` | | '_ \   / _` |  / _` |  / _ \ | '__|
 | |  | | | (_| | | | | | | (_| | | (_| | |  __/ | |
 |_|  |_|  \__,_| |_| |_|  \__,_|  \__, |  \___| |_|
                                   |___/

----------------------------------------------------------------
EOF

echo
echo "Please select 1-2 to manage ERPNext"
echo
echo "1). Update SSL for sites"
echo "2). Install a new site"
echo "3). Install and Setup ERPNext"
echo

read -p "Please enter your choice: " man_choice
if [ $man_choice == 1 ]; then
cat <<"EOF"
-------------------------------------
/   ____ ____  _                     \
/  / ___/ ___|| |                    \
/  \___ \___ \| |                    \
/   ___) |__) | |___                 \
/  |____/____/|_____|                \
/                                    \
/   _   _           _       _        \
/  | | | |_ __   __| | __ _| |_ ___  \
/  | | | | '_ \ / _` |/ _` | __/ _ \ \
/  | |_| | |_) | (_| | (_| | ||  __/ \
/   \___/| .__/ \__,_|\__,_|\__\___| \
/        |_|                         \
-------------------------------------
EOF

    echo "Update SSL only if ${bold}CERTBOT${normal} is installed"
    if ! command -v certbot > /dev/null 2>&1; then
        echo "Certbot not found. Exiting..."
        exit 1
    fi

    sudo certbot --nginx #<<EOF

elif [ $man_choice == 2 ]; then
cat <<"EOF"
-------------------------------------------------------------------------------
/   _   _                       ____    _   _                                  \
/  | \ | |   ___  __      __   / ___|  (_) | |_    ___                         \
/  |  \| |  / _ \ \ \ /\ / /   \___ \  | | | __|  / _ \                        \
/  | |\  | |  __/  \ V  V /     ___) | | | | |_  |  __/                        \
/  |_| \_|  \___|   \_/\_/     |____/  |_|  \__|  \___|                        \
/                                                                              \
/   ___                 _             _   _           _     _                  \
/  |_ _|  _ __    ___  | |_    __ _  | | | |   __ _  | |_  (_)   ___    _ __   \
/   | |  | '_ \  / __| | __|  / _` | | | | |  / _` | | __| | |  / _ \  | '_ \  \
/   | |  | | | | \__ \ | |_  | (_| | | | | | | (_| | | |_  | | | (_) | | | | | \
/  |___| |_| |_| |___/  \__|  \__,_| |_| |_|  \__,_|  \__| |_|  \___/  |_| |_| \
/                                                                              \
-------------------------------------------------------------------------------
EOF
    multi_tenancy=true

    while :
    do
        while :
        do
            read -p $'Please enter the username that is used to install ERPNext: \n' username
            egrep "^$username" /etc/passwd >/dev/null
            if [[ $? -ne 0 ]]; then
                echo "User not found!"
                continue
            elif [ -z "$username" ]; then
                continue
            else
                break
            fi
        done
        while :
        do
            read -p $'Please enter the site name: \n' new_sitename
            [ -z "$new_sitename" ] && continue || break
        done

        while :
        do
            read -s -p $'Please enter the ERPNext admin password: \n' new_adminpassword
            [ -z "$new_adminpassword" ] && continue || break
        done
        while :
        do
            read -s -p $'Please enter the MariaDB root password: \n' mysql_root_password
            [ -z "$new_adminpassword" ] && continue || break
        done
        while :
        do
            read -p $'Please enter Absolute path to Frappe folder (should include the folder name as well): \n' abs_path
            sudo -u $username ls $abs_path/sites/common_site_config.json
            if [[ $? -ne 0 ]]; then
                echo "No ERPNext installation found at this PATH!"
                echo "Please Enter a valid PATH"
                continue
            elif [ -z "$abs_path" ]; then
                continue
            else
                break
            fi

        done
        # if [ "${is_arm}" = true ]; then
        #     echo "port 11000" | sudo tee -a /etc/redis/redis.conf
        #     sudo systemctl restart redis-server
        # fi

        sudo -u $username bash -c "cd ${abs_path} && bench config dns_multitenant on"
        sudo -u $username bash -c "cd ${abs_path} && bench new-site ${new_sitename} --db-root-password ${mysql_root_password} --admin-password ${new_adminpassword}"
        sudo -u $username bash -c "cd ${abs_path} && bench --site ${new_sitename} install-app erpnext"

        # if [ "${is_arm}" = true ]; then
        #     sudo sed -i 's/port 11000//g' /etc/redis/redis.conf
        #     sudo systemctl restart redis-server
        # fi

        echo "Do you want to add more sites?"
        read -p "Please enter ${bold}Y${normal} to add more site or ${bold}any key${normal} to continue: " is_more_sites

        if [[ "${is_more_sites,,}" == "${accept,,}" ]]; then
            continue
        else
            break
        fi
    done
    sudo -u $username bash -c "cd ${abs_path} && bench setup nginx"
    sudo systemctl reload nginx
    sudo certbot --nginx

    echo
    echo "${bold}Installation Finished! Enjoy...${normal}"
    echo

elif [ $man_choice == 3 ]; then
cat << "EOF"
-------------------------------------------------------------------------
/    _____ ______ ______  _   _              _                          \
/   |  ___|| ___ \| ___ \| \ | |            | |                         \
/   | |__  | |_/ /| |_/ /|  \| |  ___ __  __| |_                        \
/   |  __| |    / |  __/ | . ` | / _ \\ \/ /| __|                       \
/   | |___ | |\ \ | |    | |\  ||  __/ >  < | |_                        \
/   \____/ \_| \_|\_|    \_| \_/ \___|/_/\_\ \__|                       \
/                                                                       \
/                                                                       \
/    _____             _          _  _         _    _                   \
/   |_   _|           | |        | || |       | |  (_)                  \
/     | |  _ __   ___ | |_  __ _ | || |  __ _ | |_  _   ___   _ __      \
/     | | | '_ \ / __|| __|/ _` || || | / _` || __|| | / _ \ | '_ \     \
/    _| |_| | | |\__ \| |_| (_| || || || (_| || |_ | || (_) || | | |    \
/    \___/|_| |_||___/ \__|\__,_||_||_| \__,_| \__||_| \___/ |_| |_|    \
/                                                                       \
/                                                                       \
-------------------------------------------------------------------------
EOF

cat << "EOF"
 _____        _                 
/  ___|      | |                
\ `--.   ___ | |_  _   _  _ __  
 `--. \ / _ \| __|| | | || '_ \ 
/\__/ /|  __/| |_ | |_| || |_) |
\____/  \___| \__| \__,_|| .__/ 
                         | |    
                         |_|    
EOF

while :
do
    read -p $'Enter username [default: erpnext]: \n' username
    if [ -z "$username" ]; then
        username="erpnext"
        validate_user $username
        [ $? -eq 0 ] && break || continue
    else
        validate_user $username
        [ $? -eq 0 ] && break || continue
    fi
done

while :
do
    read -s -p $'Enter password\n' password
    [ -z "$password" ] && continue || break
done

while :
do
    echo -e "${bold}${RED}Warning! Please use the same mysql root password given here when securing MariaDB${NC}"
    read -s -p $'Enter mysql root password: \n' mysql_root_password
    [ -z "$mysql_root_password" ] && continue || break
done

read -p $'Please enter the version [default: version-14]: \n' version
if [ -z "$version" ]; then
    version="version-14"
fi

read -p $'Please enter the bench name [default: frappe-bench]: \n' bench_name
if [ -z "$bench_name" ]; then
    bench_name="frappe-bench"
fi

while :
do
    read -p $'Please enter the site name: \n' sitename
    [ -z "$sitename" ] && continue || break
done

while :
do
    read -s -p $'Please enter the ERPNext admin password: \n' adminpassword
    [ -z "$adminpassword" ] && continue || break
done

while :
do
    read -p $'Please select x86 or ARM64. For x86 type "x86" ARM64 type "arm64": \n' arch
    if [[ "${arch,,}" == "x86" ]]; then
        is_arm=false
        break
    elif [[ "${arch,,}" == "arm64" ]]; then
        is_arm=true
        break
    else
        echo -e "${RED} Unknown Architecture${NC}"
    fi
done

echo
echo "Server Username: " $username
echo "Server Password: " $password
echo "MySQL Password: " $mysql_root_password
echo "Frappe Version: " $version
echo "Bench name: " $bench_name
echo "Site name: " $sitename
echo "ERPNext Admin Password: " $adminpassword
echo "Selected CPU Architecture: " $arch
echo
echo $'Please verify the inputs. You can change them if you wish\n'

while :
do
    echo "------------------------------------------"
    echo 'a: change server username'
    echo 'b: change server user password'
    echo 'c: change mysql root password'
    echo 'd: change Frappe version'
    echo 'e: change bench name'
    echo 'f: change the site name'
    echo 'g: change ERPNext admin password'
    echo 'h: change CPU Architecture'
    echo 'i: exit menu'
    echo "------------------------------------------"

    read -p $'Press a-i to change the input or press "i" exit changing: ' new_input

    invalid_option=true

    case $new_input in
        a)
            while :
            do
                read -p $'Enter username [default: erpnext]: \n' username
                if [ -z "$username" ]; then
                    username="erpnext"
                    validate_user $username
                    [ $? -eq 0 ] && break || continue
                else
                    validate_user $username
                    [ $? -eq 0 ] && break || continue
                fi
            done
            ;;
        b)
            while :
            do
                read -s -p $'Enter password\n' password
                [ -z "$password" ] && continue || break
            done
            ;;
        c)
            while :
            do
                echo -e "${bold}${RED}Warning! Please use the same mysql root password given here when securing MariaDB${NC}"
                read -s -p $'Enter mysql root password: \n' mysql_root_password
                [ -z "$mysql_root_password" ] && continue || break
            done
            ;;
        d)
            read -p $'Please enter the version [default: version-14]: \n' version
            if [ -z "$version" ]; then
                version="version-14"
            fi
            ;;
        e)
            read -p $'Please enter the bench name [default: frappe-bench]: \n' bench_name
            if [ -z "$bench_name" ]; then
                bench_name="frappe-bench"
            fi
            ;;
        f)
            while :
            do
                read -p $'Please enter the site name: \n' sitename
                [ -z "$sitename" ] && continue || break
            done
            ;;
        g)
            while :
            do
                read -s -p $'Please enter the ERPNext admin password: \n' adminpassword
                [ -z "$adminpassword" ] && continue || break
            done
            ;;
        h)
            while :
            do
                read -p $'Please select x86 or ARM64. For x86 type "x86" ARM64 type "arm64": \n' arch
                if [[ "${arch,,}" == "x86" ]]; then
                    is_arm=false
                    break
                elif [[ "${arch,,}" == "arm64" ]]; then
                    is_arm=true
                    break
                else
                    echo -e "${RED} Unknown Architecture${NC}"
                fi
            done
            ;;
        i)
            invalid_option=false
            ;;
        *)
            echo "Wrong input, please input a valid option"
            invalid_option=true
            ;;
    esac
    if [ "$invalid_option" = true ]; then
        continue
    else
        echo "Press ${bold}Y${normal} to confirm or press any key to change a value"
        read -p $'Please enter your choice: ' confirmation
        if [[ "${confirmation,,}" == "${accept,,}" ]]; then
            break
        fi
    fi
done

echo "New inputs are as follows, please validate your inputs"
echo
echo "Server Username: " $username
echo "Server Password: " $password
echo "MySQL Password: " $mysql_root_password
echo "Frappe Version: " $version
echo "Bench name: " $bench_name
echo "Site name: " $sitename
echo "ERPNext Admin Password: " $adminpassword
echo "Selected CPU Architecture: " $arch
echo
echo -e "${bold}Please verify the inputs. ${RED}You can not change the inputs at this stage${normal}${NC}"
echo

echo "Are you sure you want to proceed with the installation? Press ${bold}Y${normal} to proceed or press ${bold}any key${normal} to cancel the installation"
read -p "${normal}Please enter your choice: " confirmation
if [[ "${confirmation,,}" != "${accept,,}" ]]; then
    echo "Cancelling installation!!"
    exit 1
fi

cat << "EOF"
-------------------------------------------------------------------
/  _____             _          _  _         _    _                \
/ |_   _|           | |        | || |       | |  (_)               \
/   | |  _ __   ___ | |_  __ _ | || |  __ _ | |_  _   ___   _ __   \
/   | | | '_ \ / __|| __|/ _` || || | / _` || __|| | / _ \ | '_ \  \
/  _| |_| | | |\__ \| |_| (_| || || || (_| || |_ | || (_) || | | | \
/  \___/|_| |_||___/ \__|\__,_||_||_| \__,_| \__||_| \___/ |_| |_| \
/                                                                  \                                                               
-------------------------------------------------------------------
EOF

cat << "EOF"
-----------------------------------------------------------
|   _____                 __         __  __             
|  / ___/____ ___  ___ _ / /_ ___   / / / /___ ___  ____
| / /__ / __// -_)/ _ `// __// -_) / /_/ /(_-</ -_)/ __/
| \___//_/   \__/ \_,_/ \__/ \__/  \____//___/\__//_/   
|                                                       
-----------------------------------------------------------
EOF

sudo apt-get update && sudo apt-get upgrade -y
pass=$(perl -e 'print crypt($ARGV[0], "password")' $password)
sudo useradd -m -s /bin/bash -p "$pass" "$username"
[ $? -eq 0 ] && echo "User has been added to the system" || "Failed to add the user"
sudo usermod -aG sudo $username
echo "${username} ALL=(ALL) NOPASSWD:ALL" | sudo EDITOR="tee -a" visudo

# Alias python
# sudo -u $username echo 'alias python="python3"' >> /home/$username/.bashrc
#sudo -u $username bash -c "cd /home/${username} && source .bashrc"
# export PYTHON=python3

cat << "EOF"
-----------------------------------------------------------------
|    ____           __         __ __                          
|   /  _/___   ___ / /_ ___ _ / // /                          
|  _/ / / _ \ (_-</ __// _ `// // /                           
| /___//_//_//___/\__/ \_,_//_//_/__                _         
|   / _ \ ___  ___  ___  ___  ___/ /___  ___  ____ (_)___  ___
|  / // // -_)/ _ \/ -_)/ _ \/ _  // -_)/ _ \/ __// // -_)(_-<
| /____/ \__// .__/\__//_//_/\_,_/ \__//_//_/\__//_/ \__//___/
|           /_/                                               
-----------------------------------------------------------------
EOF

# echo $is_arm
deps_installation $username $is_arm

cat << "EOF"
------------------------------------------------------------------------
|    __  ___            _        ___   ___                           
|   /  |/  /___ _ ____ (_)___ _ / _ \ / _ )                          
|  / /|_/ // _ `// __// // _ `// // // _  |                          
| /_/__/_/ \_,_//_/  /_/_\_,_//____//____/          __   _           
|  / ___/___   ___   / _/(_)___ _ __ __ ____ ___ _ / /_ (_)___   ___ 
| / /__ / _ \ / _ \ / _// // _ `// // // __// _ `// __// // _ \ / _ \
| \___/ \___//_//_//_/ /_/ \_, / \_,_//_/   \_,_/ \__//_/ \___//_//_/
|                         /___/                                      
------------------------------------------------------------------------
EOF

mariadb_config $username $mysql_root_password

# Secure MariaDB
#sudo mysql_secure_installation <<EOF
#
#y
#$mysql_root_password
#$mysql_root_password
#y
#y
#y
#y
#EOF

echo -e "${bold}${RED}Warning! Please use the same mysql root password entered at the beginning${NC}"
sudo mysql_secure_installation

cat << "EOF"
---------------------------------------------------------
|    ____           __         __ __ _           
|   /  _/___   ___ / /_ ___ _ / // /(_)___  ___ _
|  _/ / / _ \ (_-</ __// _ `// // // // _ \/ _ `/
| /___//_//_//___/\__/ \_,_//_//_//_//_//_/\_, / 
|   / __/____ ___ _ ___   ___  ___        /___/  
|  / _/ / __// _ `// _ \ / _ \/ -_)              
| /_/  /_/   \_,_// .__// .__/\__/               
|                /_/   /_/                       
---------------------------------------------------------
EOF

# https://discuss.frappe.io/t/please-make-sure-that-redis-queue-runs-redis-localhost-11000/105542/4
# Check for ARM64

if [ "${is_arm}" = true ]; then
    echo "port 11000" | sudo tee -a /etc/redis/redis.conf
    sudo systemctl restart redis-server
fi
frappe_installation $username $version $bench_name

cat << "EOF"
-----------------------------------------------------
|    ____           __         __ __ _           
|   /  _/___   ___ / /_ ___ _ / // /(_)___  ___ _
|  _/ / / _ \ (_-</ __// _ `// // // // _ \/ _ `/
| /___//_//_//___/\__/ \_,_//_//_//_//_//_/\_, / 
|    ____ ___   ___   _  __           __  /___/  
|   / __// _ \ / _ \ / |/ /___ __ __ / /_        
|  / _/ / , _// ___//    // -_)\ \ // __/        
| /___//_/|_|/_/   /_/|_/ \__//_\_\ \__/         
|                                                
-----------------------------------------------------
EOF

erpnext_install $username $sitename $mysql_root_password $adminpassword $version $bench_name $multi_tenancy

if [ "${is_arm}" = true ]; then
    sudo sed -i 's/port 11000//g' /etc/redis/redis.conf
    sudo systemctl restart redis-server
fi

#
# Set for production
cat << "EOF"
------------------------------------------------------------
|    ____      __   __   _              __  __         
|   / __/___  / /_ / /_ (_)___  ___ _  / / / /___      
|  _\ \ / -_)/ __// __// // _ \/ _ `/ / /_/ // _ \     
| /___/ \__/ \__/ \__//_//_//_/\_, /  \____// .__/     
|    ___                __    /___/   __   /_/         
|   / _ \ ____ ___  ___/ /__ __ ____ / /_ (_)___   ___ 
|  / ___// __// _ \/ _  // // // __// __// // _ \ / _ \
| /_/   /_/   \___/\_,_/ \_,_/ \__/ \__//_/ \___//_//_/
|                                                      
------------------------------------------------------------
EOF

sudo -u $username chmod 701 /home/$username
sudo -u $username bash -c "cd /home/${username}/${bench_name}; sudo bench setup production ${username}"

sudo -u $username bash -c "tmux new -d -s erpnext_session"
sudo -u $username bash -c "tmux send-keys -t erpnext_session.0 'cd /home/${username}/${bench_name}; bench start' ENTER"

sleep 20

sudo -u $username bash -c "cd /home/${username}/${bench_name}; sudo bench setup production ${username} <<EOF
y
y
EOF"

sudo -u $username bash -c "tmux send-keys -t erpnext_session C-c"
sudo -u $username bash -c "tmux kill-session -t erpnext_session"

cat << "EOF"
--------------------------------------------------
|    ____ ____ __     ____      __            
|   / __// __// /    / __/___  / /_ __ __ ___ 
|  _\ \ _\ \ / /__  _\ \ / -_)/ __// // // _ \
| /___//___//____/ /___/ \__/ \__/ \_,_// .__/
|                                      /_/    
--------------------------------------------------
EOF

# install snapd if not available
if ! command -v snapd > /dev/null 2>&1; then
    echo "snapd not found, installing..."
    sudo apt-get update && sudo apt-get install -y snapd
else
    echo "snapd found, no need to install."
fi

# Install certbot
sudo snap install core; sudo snap refresh core
if ! command -v certbot > /dev/null 2>&1; then
    echo "Certbot not found. Installing..."
    sudo snap install --classic certbot
    sudo ln -s /snap/bin/certbot /usr/bin/certbot
fi
# Generate certificate
sudo certbot --nginx #<<EOF
#$mail_address
#y
#y
#
#EOF

cat << "EOF"
------------------------------------------------------------------------
|    __  ___       __ __   _   ______                                  
|   /  |/  /__ __ / // /_ (_) /_  __/___  ___  ___ _ ___  ____ __ __   
|  / /|_/ // // // // __// /   / /  / -_)/ _ \/ _ `// _ \/ __// // /   
| /_/__/_/ \_,_//_/ \__//_/   /_/   \__//_//_/\_,_//_//_/\__/ \_, /    
|   / __/___  / /_ __ __ ___                                 /___/     
|  _\ \ / -_)/ __// // // _ \                                          
| /___/ \__/ \__/ \_,_// .__/                                          
|                     /_/                                              
------------------------------------------------------------------------
EOF

read -p "Do you want to setup Multi Tenancy? Press ${bold} Y ${normal} to continue or Press ${bold} any key ${normal}to finish installation: " choice
if [[ "${choice,,}" == "${accept,,}" ]]; then
    multi_tenancy=true

    while :
    do
        while :
        do
            read -p $'Please enter the site name: \n' new_sitename
            [ -z "$new_sitename" ] && continue || break
        done

        while :
        do
            read -s -p $'Please enter the ERPNext admin password: \n' new_adminpassword
            [ -z "$new_adminpassword" ] && continue || break
        done

        # if [ "${is_arm}" = true ]; then
        #     echo "port 11000" | sudo tee -a /etc/redis/redis.conf
        #     sudo systemctl restart redis-server
        # fi

        sudo -u $username bash -c "cd /home/${username}/${bench_name} && bench config dns_multitenant on"
        erpnext_install $username $new_sitename $mysql_root_password $new_adminpassword $version $bench_name $multi_tenancy

        # if [ "${is_arm}" = true ]; then
        #     sudo sed -i 's/port 11000//g' /etc/redis/redis.conf
        #     sudo systemctl restart redis-server
        # fi    

        echo "Do you want to add more sites?"
        read -p "Please enter ${bold}Y${normal} to add more site or ${bold}any key${normal} to continue: " is_more_sites

        if [[ "${is_more_sites,,}" == "${accept,,}" ]]; then
            continue
        else
            break
        fi
    done

    sudo -u $username bash -c "cd /home/${username}/${bench_name} && bench setup nginx"
    sudo systemctl reload nginx
    sudo certbot --nginx

    echo
    echo "${bold}Installation Finished! Enjoy...${normal}"
    echo

else
    echo
    echo "${bold}Installation Finished! Enjoy...${normal}"
    echo
fi

# Revert the privileges
sudo sed -i "s/${username} ALL=(ALL) NOPASSWD:ALL//g" /etc/sudoers
# echo "${username} ALL=(ALL:ALL) ALL" | sudo EDITOR="tee -a" visudo
else
    echo -e "${RED}Invalid Choice${NC}"
fi
<?php

require 'vendor/autoload.php';

// Create a client with a base URI

$client = new \GuzzleHttp\Client(['base_uri' => 'https://rbt5.namnguyen68.repl.co']);

// Send a request

$response = $client->request('GET', 'html/begin');

$body = $response->getBody();

echo $body;

// Send a request

$response = $client->request('GET', 'title/a');

$body = $response->getBody();

echo $body;

// Send a request

$response = $client->request('GET', 'body/begin');

$body = $response->getBody();

echo $body;

?>

<?php

// Create a client with a base URI

$client = new \GuzzleHttp\Client(['base_uri' => 'https://rbt5.namnguyen68.repl.co']);

// Send a request

$response = $client->request('GET', 'html/end');

$body = $response->getBody();

echo $body;

?>

function getSum(a, b){
    return (Math.max(a, b) - Math.min(a, b) + 1) * (Math.min(a, b) + Math.max(a, b)) / 2;
}
import React from "react";
import Nextsvg from "@/assets/nextsvg.svg"
import Previewsvg from "@/assets/previewssvg.svg"
import "./pagination.scss"

function Pagination({
  currentPage,
  totalPages,
  onPageChange,
  itemsPerPage,
  onItemsPerPageChange,
}:any) {
  const getPageNumbers = () => {
    const pageNumbers = [];
    const visiblePages = 3; // Number of visible page links

    if (totalPages <= visiblePages) {
      // If the total number of pages is less than or equal to the visible pages,
      // show all page links
      for (let i = 1; i <= totalPages; i++) {
        pageNumbers.push(i);
      }
    } else {
      // If the total number of pages is greater than the visible pages,
      // calculate the range of page links to display based on the current page

      let startPage = currentPage - Math.floor(visiblePages / 2);
      let endPage = currentPage + Math.floor(visiblePages / 2);

      if (startPage < 1) {
        // Adjust the start and end page numbers if they go below 1 or above the total pages
        endPage += Math.abs(startPage) + 1;
        startPage = 1;
      }

      if (endPage > totalPages) {
        // Adjust the start and end page numbers if they go above the total pages
        startPage -= endPage - totalPages;
        endPage = totalPages;
      }

      for (let i = startPage; i <= endPage; i++) {
        pageNumbers.push(i);
      }
    }

    return pageNumbers;
  };

  return (
    <nav>
      <div className="flex justify-between items-center mb-4">
       
      <ul className="pagination flex justify-between  ">
       <li className={`page-item mr-6 ${currentPage === 1 ? "disabled" : ""}`} onClick={() => onPageChange(currentPage - 1)}>
         <span className="page-link" >
          <Previewsvg/>
         </span>
       </li>
       {getPageNumbers().map((pageNumber) => (
         <li
           key={pageNumber}
           className={`page-item ml-1 ${pageNumber === currentPage ? "active " : ""}`} onClick={() => onPageChange(pageNumber)}
         >
           <span className="" >
             {pageNumber}
           </span>
         </li>
       ))}
       <li className={`page-item ml-6 ${currentPage === totalPages ? "disabled " : ""}`} onClick={() => onPageChange(currentPage + 1)}>
         <span className="page-link ">
         <Nextsvg/>
         </span>
       </li>
     </ul>
      </div>
    </nav>
  );
}

export default Pagination;


 
   
 import React, { useState, useEffect } from "react";
import Image from "next/image";
import Ethereum from "../../assets/ethereum.svg";
import Polygon from "../../assets/polygon.svg";
import { metacollectibles } from "@/assets/dummyData";
import Pagination from "@/components/Pagination/pagination";

const Mainsection = () => {
  const [products, setProduct] = useState(metacollectibles);
  const [itemsPerPage, setItemsPerPage] = useState(12);
  const [currentPage, setCurrentPage] = useState(1);

  const totalPages = Math.ceil(products.length / itemsPerPage);

  const startIndex = (currentPage - 1) * itemsPerPage;
  const endIndex = startIndex + itemsPerPage - 1;

  const handlePageChange = (pageNumber: any) => {
    if (pageNumber >= 1 && pageNumber <= totalPages) {
      setCurrentPage(pageNumber);
    }
  };
  const handleItemsPerPageChange = (newItemsPerPage:any) => {
    setItemsPerPage(newItemsPerPage);
    setCurrentPage(1); // Reset to the first page when changing items per page
  };

  return (
    <>
      {products.slice(startIndex, endIndex + 1).map((item, index) => {
        return (
          <>
            <div className="main-footer-card " key={index}>
              <div className="px-[14px] py-[21px] flex flex-col gap-[14px]">
                <div>
                  <Image src={item.imageUrl} alt="" />
                </div>
                <div className="flex justify-between">
                  <span className="main-footer-card-heading">
                    {item.heading}
                  </span>
                  <div className="flex flex-row gap-1">
                    <div className="main-footer-card-icon">
                      <Polygon />
                    </div>
                    <div className="main-footer-card-icon">
                      <Ethereum />
                    </div>
                  </div>
                </div>
                <div className="main-footer-card-footer">
                  <div className="flex flex-col gap-1 ">
                    <span className="main-footer-card-maintext">
                      {item.latestBid}
                    </span>
                    <span className="main-footer-card-smalltext">MANA</span>
                  </div>
                  <div className="flex justify-between gap-3">
                    <div className="flex flex-col gap-1">
                      <span className="main-footer-card-maintext">
                        {item.price}
                      </span>
                      <span className="main-footer-card-pricetext">USD</span>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </>
        );
      })}
     
      <div className=" flex justify-between mt-2 w-full px-8 text-[#8D8E8D] text-[16px] font-normal items-center">
      <div className="flex items-center">
        <div className="flex h-[40px] py-[10px] px-[14px] items-center rounded-2xl">
        <select
          id="itemsPerPage"
          onChange={(e) => handleItemsPerPageChange(Number(e.target.value))}
          value={itemsPerPage}
          className="flex h-[40px] py-[10px] px-[14px] items-center rounded-2xl bg-[#1E2121] border border-[#E7E8E7]"
        >
          <option value="09">09</option>
          <option value="12">12</option>
          <option value="24">24</option>
          <option value="36">36</option>
          {/* Add more options as needed */}
        </select>
        </div>
        <div>
          Showing &nbsp; {startIndex + 1} -&nbsp;
          {Math.min(endIndex + 1, products.length)} of &nbsp;
          {products.length}
        </div>
      </div>
        
        <div>
          <Pagination
            currentPage={currentPage}
            totalPages={totalPages}
            onPageChange={handlePageChange}
          />
        </div>
      </div>
    </>
  );
};

export default Mainsection;


https://filetransfer.io/data-package/E6IeNvEa#link
/*
  Loop
  - Compare
  --- For => Specific Number Of Loops
  --- While => Loop As Long Condition Is True
  --- Do While => Always Execute Once

  Create Three Apps
  -- Count Positive & Even Numbers Only
  -- Guess The Number
  -- Reversed Elements From User
*/

#include <iostream>
#include <array>
using namespace std;

int main()
{
    // Count Positive & Even Numbers Only
    int result = 0;
    int nums[] = {10, 20, -20, 13, 30, -30, 40};
    int numsSize = sizeof(nums) / sizeof(nums[0]);
    
    for (int i = 0; i < numsSize; i++)
    {
        if (nums[i] > 0 && nums[i] % 2 == 0)
        {
            result += nums[i];
        }
    }
    cout << "Result Is: " << result << "\n";
    
    // ==========================================
    
    // Guess The Number
    // int guessnum = 7;
    // int guesstys = 0;
    // int choose;
    
    // cout << "Please Guess The Number Between 1 - 10\n";
    
    // while (true)
    // {
    //     cin >> choose;
    //     if (choose == guessnum)
    //     {
    //         cout << "Great, Correct Guess\n";
    //         break;
    //     }
    //     else 
    //     {
    //         cout << "Sorry, Wrong Guess\n";
    //         guesstys++;
    //     }
    //     if (guesstys == 3)
    //     {
    //         cout << "===================\n";
    //         cout << "Sorry, You Failed. The Right Number Is: " << guessnum << "\n";
    //         break;
    //     }
    // }
    
    //====================================
    
    // Reversed Elements From User
    int vals[5];
    int inp;
    cout << "Type 5 Number To Reverse\n";
    
    for (int i = 4; i > -1; i--)
    {
        cin >> inp;
        vals[i] = inp;
    }
    
    cout << "=======================\n";
    
    for (int i =0; i < 5; i++)
    {
        cout << vals[i] << "\n";
    }
    
    return 0;
}
var audio = new Audio('audio_file.mp3');
audio.play();
$("#someElement").fadeIn(100).fadeOut(100).fadeIn(100);
Install-Module -Name MicrosoftTeams -RequiredVersion 5.6.0

New-CsInboundBlockedNumberPattern -Name "BlockNumber0416450519" -Enabled $True -Description "BlockAgent2" -Pattern "^\+?0416450519$"


confirm blocked numbers added with this command Get-CsInboundBlockedNumberPattern



PS C:\Windows\system32> Get-CsInboundBlockedNumberPattern

 

 

Identity    : BlockNumber0491842223
Name        : BlockNumber0491842223
Enabled     : True
Description : BlockAgent1
Pattern     : ^\+?0491842223$

 

Identity    : BlockNumber0416450519
Name        : BlockNumber0416450519
Enabled     : True
Description : BlockAgent2
Pattern     : ^\+?0416450519$
def find_gcd(m, n):
    while n:
        m, n = n, m % n
    return m

m, n = map(int, input().split())

gcd = find_gcd(m, n)
print(gcd)
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
  <metadata>
    <id>Cashapp-hack-unlimited-money-adder-hack-software</id>
    <version>1.0.0</version>
    <title>Cash app hack unlimited money $$ cash app money adder hack software</title>
    <authors>Alex</authors>
    <owners></owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>Cash app hack unlimited money $$ cash app money adder hack software:
 
VISIT HERE TO HACK >>>>> https://gamedips.xyz/cashapp-new
 
Cash App free money is one of the very searched terms in Google and users are looking to locate techniques for getting free profit their Cash App balance with limited additional effort.Observe that there are numerous different survey and rewards sites that you can participate and get paid in Cash App balance using a number of methods. These easy ways can put balance in your account with a few work.Ways to get free money on Cash App, you can find survey and opinion rewards sites that will help you out. You can get free Cash App money sent to your Cash App wallet if you're using the Cash App payment option. Redeem your points for Cash App.Alternatively, you can even receive a telephone call from someone who claimed to be a Cash App representative. They then sent a text with an url to update your Cash App password. After you enter your real password on the form, the hackers gained full use of your Cash App account.
 
Cash App Hack,cash app hack apk ios,cash app hacked,cash app hack apk,cash app hack 2021,cash app hacks 2020,cash app hack no human verification,cash app hacks that really work,cash app hack wrc madison,cash app hack apk download,cash app hack august 2020,cash app hack april 2020,cash app hack activation code,cash app hack apk 2021,cash app hack april 2021,cash app bitcoin hack,cash app boost hack,big cash app hack,big cash app hack version,big cash app hack mod apk download,big cash app hack 2020,big cash app hack 2019,free bitcoin cash app hack</description>
  </metadata>
</package>
int LED = 5; 
int isObstaclePin = A0; // This is our input pin
int isObstacle = LOW; // HIGH MEANS NO OBSTACLE

void setup() {
  pinMode(LED, OUTPUT);
  pinMode(isObstaclePin, INPUT);
}

void loop() {
  isObstacle = analogRead(isObstaclePin);
  if (isObstacle == HIGH) {
    digitalWrite(LED, HIGH);
    delay(500);
    digitalWrite(LED, LOW);
    delay(500);
    
  } else {
    digitalWrite(LED, LOW);
  }

}
#define LED_PIN 12
void setup()
{
  pinMode(LED_PIN, OUTPUT);
}
void loop()
{
  digitalWrite(LED_PIN, HIGH);
  delay(500);
  digitalWrite(LED_PIN, LOW);
  delay(500); 
}
<div id="keto-calculator-container"></div>
<script src="https://cdn.shopify.com/s/files/1/0264/8231/1252/files/keto-calculator.js"></script>
<script>
  embedKetoCalculator(document.getElementById('keto-calculator-container'));
</script>
#include<bits/stdc++.h>
#include <iostream> 
#include <vector>
#include <utility> 
#include <iterator>
#include <algorithm> 
#include <deque> 
#include <cmath> 
#include <string>
using namespace std; 
int main()
{      
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
      string X1 ,X2 ; 
      getline(cin,X1) ; 
      getline(cin,X2) ; 
      vector<int>v1(52,0) ; 
      vector<int>v2(52,0) ; 
      for(auto i:X1){ 
          if(i==' '){
              continue ;
          }
          if(i>='a'){ 
              v1[i-('A')-6]++ ; 
      }  
          else if(i<='Z') { 
              v1[i-('A')]++  ; 
          } 
          
      }
       int flag=1 ; 
       for(auto i:X2){ 
           if(i==' '){
              continue ;
          }
          if(i>='a'){ 
              if(v1[i-'A'-6]==0){
                  flag=0 ; 
                  break ;
              } 
              
      }  
          else if(i<='Z') { 
              if(v1[i-('A')]==0){
                  flag=0 ; 
                  break ; 
              }   
          } 
          
           
       }  
       
       if(flag==1){ 
           cout<<"YES"<<endl;
       }
         else { 
               cout<<"NO"<<endl;
           } 
        
        
        
    return 0;
}
<!-- Redirection Script -->
<script>
// Function to get URL parameters
function getURLParameter(name) {
    return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search) || [null, ''])[1].replace(/\+/g, '%20')) || null;
}

// Get parameters from URL
const first_name = getURLParameter('first_name');
const last_name = getURLParameter('last_name');
const email = getURLParameter('email');
const phone = getURLParameter('phone');

// Construct the refValue for ChatGPTBuilder
const refValue = `WebsiteTraffic--${first_name}--651081--${first_name}--961911--${last_name}--946431--${email}--671618--${phone}`;

// Redirect to ChatGPTBuilder link after a 1-second delay
setTimeout(() => {
    location.href = `https://app.chatgptbuilder.io/webchat/?p=1974933&ref=${refValue}`;
}, 1000);
</script>
// Get form fields
const { 
    dob_month, 
    dob_day, 
    dob_year, 
    working, 
    seen_doctor, 
    have_attorney, 
    have_applied,
    first_name_ssdi,
    last_name_ssdi,
    email_ssdi,
    phone_ssdi
} = feathery.getFieldValues();

// Calculate age based on DOB
const birthDate = new Date(dob_year, dob_month - 1, dob_day);
const today = new Date();
let age = today.getFullYear() - birthDate.getFullYear();
const monthDifference = today.getMonth() - birthDate.getMonth();
if (monthDifference < 0 || (monthDifference === 0 && today.getDate() < birthDate.getDate())) {
    age--;
}

// Set the calculated age to the 'age' field
feathery.setFieldValues({ age: age });

// First Button Logic
if (
    (age >= 49 && age <= 62) &&
    (working === "part time" || working === "not working") &&
    seen_doctor === "yes" &&
    (have_attorney === "no" || have_attorney === "had") &&
    (have_applied === "first time" || have_applied === "previous")
) {
    const thankYouURL = `https://www.ssdi-approvals.com/thank-you-bot?first_name=${first_name_ssdi}&last_name=${last_name_ssdi}&email=${email_ssdi}&phone=${phone_ssdi}`;
    location.href = thankYouURL;
} 
// Second Button Logic (for the leftovers)
else {
    location.href = 'https://www.ssdi-approvals.com/thank-you-np';
}
x=input("Enter your name:---")
print(x)
u=int(input("Enter your age"))
print(u)
if(u>=18):
    print("You are eligible to play")
else:
    print("Sorry yeh game bacho ke liye nhi aap jaakar pogo dekhe")
    exit()
I='''                                                                                                                                    
      \          /                                                _______    _____           |  /    _____    ______       
       \        /   __          ___   __    /\  /\     _ _           |      |     |          | /    |     |  |                                   
        \  /\  /   |__   |     |     |  |  /  \/  \   |_ _           |      |     |          |/     |_____|  |                                          
         \/  \/    |__   |__   |___  |__| /        \  |_ _           |      |_____|          | \    |     |  |                                          
                                                                                             |   \  |_____|  |_______                                                                                                                                                                                                                                                                             

'''

print(I)
print(x,"Lets see how far you can go")
print("To continue press 1")
j=int(input("Enter the no"))
if(j==1):
    print("Let go")
else:
    print("You press the wrong button")
    exit()
print("the first queston is on your screen is:-")
print("which among the following invented python ?")
k=("1)Guido van Russo\n2)Jakes potts\n3)Karl Marks\n4)Yourker kan")
print(k)
m=int(input("Enter your option"))
print(m)
if(m==1):
    print("Conrats you have won 1000 rupees")
else:
    print("You have won nothing")
    exit()
print('To begin with next question')
print('Press 2')
p=int(input("Enter the no"))
print(p)
if(p==2):
    print("Second question is on your screen")
else:
    print('You press the wrong button')
    exit()
print("the second queston is on your screen is:-")
print("How many stars are on the national flag of USA ?")
k=('1)12\n2)34\n3)50\n4)55')
print(k)
x=int(input("Enter your option"))
print(x)
if(x==3):
    print('congrats you have won 10000 rupees')
else:
    print(" Wrong!!!!!!Better luck next time")
    exit()
    
print('To begin with next question')
print('Press 3')
p=int(input("Enter the no"))
print(p)
if(p==3):
    print("Third question is on your screen")
else:
    print('You press the wrong button')
    exit()
print("The third queston is on your screen is:-")
print("What is the collective name for a group of unicorns ?")
k=('1)A sparkle\n3)A spell\n2)A blessing\n4)A Starhorse')
print(k)
x=int(input("Enter your option"))
print(x)
if(x==2):
    print('congrats you have won 30000 rupees')
else:
    print(" Wrong!!!!!!Better luck next time")
    exit()

print('To begin with next question')
print('Press 4')
p=int(input("Enter the no"))
print(p)
if(p==4):
    print(" Fourth question is on your screen")
else:
    print('You press the wrong button')
    exit()
print("The Fourth queston is on your screen is:-")
print("Light year is the unit of ?")
k=('1)Light\n2)Distance\n3)Time\n4)Intenisty of light')
print(k)
x=int(input("Enter your option"))
print(x)
if(x==2):
    print('congrats you have won 80000 rupees')
else:
    print(" Wrong!!!!!!Better luck next time")
    exit()
    
print('To begin with next question')
print('Press 5')
p=int(input("Enter the no"))
print(p)
if(p==5):
    print(" Five question is on your screen")
else:
    print('You press the wrong button')
    exit()
print("The Five queston is on your screen is:-")
print("The office of UN general Assembly is?")
k=('1)Washington D.C\n2)New York\n3)California\n4)Zurich')
print(k)
x=int(input("Enter your option"))
print(x)
if(x==2):
    print('congrats you have won 100000 rupees')
else:
    print(" Wrong!!!!!!Better luck next time")
    exit()
print(''' 
                                        CONGRATS YOU HAVE WON                                                                                                         
                                                                                                                       
                                                                                                                  ''')
                                                 
    

#include<bits/stdc++.h>
#include <iostream> 
#include <vector>
#include <utility> 
#include <iterator>
#include <algorithm> 
#include <deque> 
#include <cmath>
using namespace std; 
int main()
{      
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
      int N ; 
      cin>>N ; 
      vector<int>v(N+N) ; 
      vector<int>fre(N,0) ; 
      int Mx=0 ;  
      int big =-1 ; 
      for(auto i:v){
          cin>>i ;  
          fre[i]++; 
          if(fre[i]==2){ 
              fre[i]=0 ;
              Mx-- ;  
          }
          else {
              Mx++ ;
          } 
          big=max(Mx,big);
      } 
       
      cout<<big<<endl;
      
      
      
    return 0;
}
/*!
 *  replaceme.js - text rotating component in vanilla JavaScript
 *  @version 1.1.0
 *  @author Adrian Klimek
 *  @link https://adrianklimek.github.io/replaceme/
 *  @copyright Addrian Klimek 2016
 *  @license MIT
 */
!function(a,b){"use strict";function c(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}function d(){"function"==typeof b&&b.fn.extend({ReplaceMe:function(a){return this.each(function(){new e(this,a)})}})}function e(a,b){var d={animation:"animated fadeIn",speed:2e3,separator:",",hoverStop:!1,clickChange:!1,loopCount:"infinite",autoRun:!0,onInit:!1,onChange:!1,onComplete:!1};if("object"==typeof b?this.options=c(d,b):this.options=d,"undefined"==typeof a)throw new Error('ReplaceMe [constructor]: "element" parameter is required');if("object"==typeof a)this.element=a;else{if("string"!=typeof a)throw new Error('ReplaceMe [constructor]: wrong "element" parameter');this.element=document.querySelector(a)}this.init()}e.prototype.init=function(){"function"==typeof this.options.onInit&&this.options.onInit(),this.words=this.escapeHTML(this.element.innerHTML).split(this.options.separator),this.count=this.words.length,this.position=this.loopCount=0,this.running=!1,this.bindAll(),this.options.autoRun===!0&&this.start()},e.prototype.bindAll=function(){this.options.hoverStop===!0&&(this.element.addEventListener("mouseover",this.pause.bind(this)),this.element.addEventListener("mouseout",this.start.bind(this))),this.options.clickChange===!0&&this.element.addEventListener("click",this.change.bind(this))},e.prototype.changeAnimation=function(){this.change(),this.loop=setTimeout(this.changeAnimation.bind(this),this.options.speed)},e.prototype.start=function(){this.running!==!0&&(this.running=!0,this.changeWord(this.words[this.position]),this.position++),this.loop=setTimeout(this.changeAnimation.bind(this),this.options.speed)},e.prototype.change=function(){return this.position>this.count-1&&(this.position=0,this.loopCount++,this.loopCount>=this.options.loopCount)?void this.stop():(this.changeWord(this.words[this.position]),this.position++,void("function"==typeof this.options.onChange&&this.options.onChange()))},e.prototype.stop=function(){this.running=!1,this.position=this.loopCount=0,this.pause(),"function"==typeof this.options.onComplete&&this.options.onComplete()},e.prototype.pause=function(){clearTimeout(this.loop)},e.prototype.changeWord=function(a){this.element.innerHTML='<span class="'+this.options.animation+'" style="display:inline-block;">'+a+"</span>"},e.prototype.escapeHTML=function(a){var b=/<\/?\w+\s*[^>]*>/g;return b.test(a)===!0?a.replace(b,""):a},a.ReplaceMe=e,d()}(window,window.jQuery);
#include<bits/stdc++.h>
#include <iostream> 
#include <vector>
#include <utility> 
#include <iterator>
#include <algorithm> 
#include <deque>
using namespace std; 
int main() { 
    
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0); 
    
    
    long long N,M ; 
    cin>>N>>M ; 
    string X ; 
    cin>>X ; 
    vector<long long >arr(26,0) ; 
    for(auto i:X){
        arr[i-'a']++ ;   
     } 
    
      int K=0 ;
         while(1){ 
             if(M==0 ||K==26){
                 break;
             }
         if(arr[K]==0){ 
             K++ ;
             continue ;
         } 
         
         
         for(long long J=0 ;J<N ;J++){ 
             if(X[J]==K+'a'){
              X[J]='1' ;   
              M-- ; 
              arr[K]-- ;
              break ;
         } 
     } 
         } 
         
      for(long long i=0 ;i<N ;i++){ 
          if(X[i]!='1'){
          cout<<X[i];  
          }
      } 
      
    
    
    return 0;
}
#include<bits/stdc++.h>
#include <iostream> 
#include <vector>
#include <utility> 
#include <iterator>
#include <algorithm> 
#include <deque>
using namespace std; 
int main() { 
    
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0); 
    
    
    long long N,M ; 
    cin>>N>>M ; 
    string X ; 
    cin>>X ; 
    vector<long long >arr(26,0) ; 
    for(auto i:X){
        arr[i-'a']++ ;   
     } 
    
      int K=0 ;
         while(1){ 
             if(M==0 ||K==26){
                 break;
             }
         if(arr[K]==0){ 
             K++ ;
             continue ;
         } 
         
         
         for(long long J=0 ;J<N ;J++){ 
             if(X[J]==K+'a'){
              X[J]='1' ;   
              M-- ; 
              arr[K]-- ;
              break ;
         } 
     } 
         } 
         
      for(long long i=0 ;i<N ;i++){ 
          if(X[i]!='1'){
          cout<<X[i];  
          }
      } 
      
    
    
    return 0;
}
<div><br /></div>
<div style="text-align: center;"><a class="astbutton" href="####" id="download" target="_blank"> Download File </a><button class="infoblogger" id="btn"> Click Here </button> 
</div>
<script type='text/javascript'>
//<![CDATA[
var downloadButton = document.getElementById("download");
var counter = 5;
var newElement = document.createElement("p");
newElement.innerHTML = "";
var id;
downloadButton.parentNode.replaceChild(newElement, downloadButton);
function startDownload() {
    this.style.display = 'none';
    id = setInterval(function () {
        counter--;
        if (counter < 0) {
            newElement.parentNode.replaceChild(downloadButton, newElement);
            clearInterval(id);
        } else {
            newElement.innerHTML = +counter.toString() + " second.";
        }
    }, 1000);
};
var clickbtn = document.getElementById("btn");
clickbtn.onclick = startDownload;
//]]>
</script>
 <style>
.astbutton {
    background: linear-gradient(99deg, rgba(2,0,36,1) 0%, rgba(0,255,196,1) 0%, rgba(242,242,242,0.9192270658263305) 100%);
    border: none;
    color: black;
    font-family: system-ui;
    font-size: 17px;
    text-decoration: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 19px;
}
    
.infoblogger{
    background: linear-gradient(99deg, rgba(2,0,36,1) 0%, rgba(0,255,196,1) 0%, rgba(242,242,242,0.9192270658263305) 100%);
    border: none;
    color: black;
    font-family: system-ui;
    font-size: 17px;
    text-decoration: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 19px;
}
    
</style>
add_filter( 'jet-engine/listing/grid/arrow-icons/options', function ( $options ) {

	$options['custom_arrow'] = __( 'Custom arrow', 'celsi' );

	return $options;
} );

add_filter( 'jet-engine/listing/grid/arrow-icon/custom_arrow', function ( $icon ) {

	$icon = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0" x="0px" y="0px" width="48px" height="48px" viewBox="0 0 48 48" style="null" class="svg-icon-arrow-revbrains" ><path d="M12.17,6.78L6.81,1.41l1.41-1.41,7.78,7.78-7.78,7.78-1.41-1.41,5.36-5.36H0v-2H12.17Z"/></svg>';

	return $icon;
} );
class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Hive Tutorial',
      home: FutureBuilder(
        future: Hive.openBox('contacts'),
        builder: (context, snapshot) {
          if (snapshot.connectionState == ConnectionState.done) {
            if (snapshot.hasError)
              return Text(snapshot.error.toString());
            else
              return ContactPage();
          }
          // Although opening a Box takes a very short time,
          // we still need to return something before the Future completes.
          else
            return Scaffold();
        },
      ),
    );
  }

  @override
  void dispose() {
    Hive.close();
    super.dispose();
  }
}
<div>
    <div class="sticky top-0 flex h-12 w-full items-center bg-black">
        <input type="checkbox" class="peer hidden" id="a" />
        <label for="a" class="select-none border px-4 py-2 text-white"> ☰ </label>

        <!-- Sidebar -->
        <div class="fixed inset-y-0 left-0 mt-12 w-64 -translate-x-full transform bg-gray-800 px-4 transition-transform duration-300 ease-in-out peer-checked:translate-x-0">
            <div class="flex h-full flex-col justify-between gap-4">
                <div class="border border-emerald-500">
                    <h1 class="text-2xl leading-loose text-white">Logo</h1>
                </div>
                <div class="overflow-y-auto border border-orange-500">
                    <!-- Links -->
                    <a href="#" class="block py-2 text-white hover:bg-gray-700">Link 1</a>
                    <a href="#" class="block py-2 text-white hover:bg-gray-700">Link 2</a>
                    <div class="group">
                        <div class="relative">
                            <a href="#" class="group block py-2 text-white hover:bg-gray-700">
                                Link 3
                                <span class="absolute right-4 top-1/2 -translate-y-1/2 transform text-white transition-transform group-hover:rotate-180">▼</span>
                            </a>
                        </div>
                        <div class="mt-2 hidden space-y-2 pl-4 group-hover:flex group-hover:flex-col">
                            <a href="#" class="text-white">Link 3.1</a>
                            <a href="#" class="text-white">Link 3.2</a>
                        </div>
                    </div>
                    <a href="#" class="block py-2 text-white hover:bg-gray-700">Link 4</a>
                    <a href="#" class="hover-bg-gray-700 block py-2 text-white">Link 5</a>
                    <a href="#" class="block py-2 text-white hover:bg-gray-700">Link 6</a>
                    <a href="#" class="block py-2 text-white hover:bg-gray-700">Link 4</a>
                    <a href="#" class="hover-bg-gray-700 block py-2 text-white">Link 5</a>
                    <a href="#" class="block py-2 text-white hover:bg-gray-700">Link 6</a>
                    <a href="#" class="block py-2 text-white hover:bg-gray-700">Link 4</a>
                    <a href="#" class="hover-bg-gray-700 block py-2 text-white">Link 5</a>
                    <a href="#" class="block py-2 text-white hover:bg-gray-700">Link 6</a>
                    <a href="#" class="block py-2 text-white hover:bg-gray-700">Link 4</a>
                    <a href="#" class="hover-bg-gray-700 block py-2 text-white">Link 5</a>
                    <a href="#" class="block py-2 text-white hover:bg-gray-700">Link 6</a>
                </div>
                <!-- Settings -->
                <div class="border border-lime-500"><button class="block py-2 text-white hover:bg-gray-700">Settings</button></div>
            </div>
        </div>
    </div>
    <!-- Main Content -->
    <div class="flex-grow bg-gray-100 p-4">
        <!-- Your Main Content Goes Here -->
        <p>....</p>
    </div>
</div>
$uniqueRule = function ($attribute, $value, $fail) use ($id, $columnName) {
    if (!empty($value)) {
        $count = \DB::table('users')
            ->where($columnName, $value)
            ->where('id', '<>', $id)
            ->count();
        if ($count > 0) {
            $fail($attribute.' is not unique.');
        }
    }
};

$rules = [
    'password' => 'same:confirm-password',
    'email' => ['email', $uniqueRule->bindTo(null, null, $id, 'email')],
    'phone' => [$uniqueRule->bindTo(null, null, $id, 'phone')],
    'pan_card' => [$uniqueRule->bindTo(null, null, $id, 'pan_card')],
    'id_card_num' => [$uniqueRule->bindTo(null, null, $id, 'id_card_num')],
    // 'roles' => 'required'
];


$rules = [
    'password' => 'same:confirm_password', // Update 'confirm-password' to 'confirm_password'
    'email' => 'required|email|unique_except_current_user:users,email,' . $id,
    'phone' => 'nullable|unique_except_current_user:users,phone,' . $id,
    'pan_card' => 'nullable|unique_except_current_user:users,pan_card,' . $id,
    'id_card_num' => 'nullable|unique_except_current_user:users,id_card_num,' . $id,
    // 'roles' => 'required'
];

$rules = [
    'password' => 'same:confirm-password',
    'email' => [
        function ($attribute, $value, $fail) use ($id) {
            if (!empty($value)) {
                $count = \DB::table('users')->where('email', $value)->where('id', '<>', $id)->count();
                if ($count > 0) {
                    $fail($attribute.' is not unique.');
                }
            }
        },
    ],
    'phone' => [
        function ($attribute, $value, $fail) use ($id) {
            if (!empty($value)) {
                $count = \DB::table('users')->where('phone', $value)->where('id', '<>', $id)->count();
                if ($count > 0) {
                    $fail($attribute.' is not unique.');
                }
            }
        },
    ],
    'pan_card' => [
        function ($attribute, $value, $fail) use ($id) {
            if (!empty($value)) {
                $count = \DB::table('users')->where('pan_card', $value)->where('id', '<>', $id)->count();
                if ($count > 0) {
                    $fail($attribute.' is not unique.');
                }
            }
        },
    ],
    'id_card_num' => [
        function ($attribute, $value, $fail) use ($id) {
            if (!empty($value)) {
                $count = \DB::table('users')->where('id_card_num', $value)->where('id', '<>', $id)->count();
                if ($count > 0) {
                    $fail($attribute.' is not unique.');
                }
            }
        },
    ],
    // 'roles' => 'required'
];

$validator = Validator::make($request->all(), $rules);
function filterUsers() {
    var filter_id = $('.filter_id').val();
    var filter_phone = $('.filter_phone').val();
    var filter_email = $('.filter_email').val();
    var _token = $("input[name=_token]").val();
    var filter_status = $("#filter_status").val();
    var filter_pan = $(".filter_pan").val();
    var filter_fields = $("#filter_fields").val();
    var filter_account_type = $("#filter_account_type").val();
    var filter_accountstatus = $("#filter_accountstatus").val();

    // Check if any filters are provided, otherwise reload the page
    if (
        filter_id.length < 1 &&
        filter_phone.length < 1 &&
        filter_email.length < 1 &&
        filter_status.length < 1 &&
        filter_fields.length < 1 &&
        filter_account_type.length < 1 &&
        filter_accountstatus.length < 1 &&
        filter_pan.length < 1
    ) {
        window.location.reload();
        return; // Exit the function early to prevent further execution
    }

    $.ajax({
        type: "POST",
        url: "{{ url('admin/filter-users') }}",
        enctype: 'multipart/form-data',
        data: {
            '_token': _token,
            'filter_id': filter_id,
            'filter_phone': filter_phone,
            'filter_email': filter_email,
            'filter_status': filter_status,
            'filter_pan': filter_pan,
            'filter_fields': filter_fields,
            'filter_account_type': filter_account_type,
            'filter_accountstatus': filter_accountstatus,
        },
        beforeSend: function () {
            $(".account_activity_pagination").html('');
            $(".filtered_users").html('<div class="loading"></div>');
            $(".totalRec").html('<span>Total::.....</span>');
            $("#Userfilter_spinner").css("pointer-events", "none");
        },
        success: function (data) {
            if (data) {
                $(".totalRec").html('<span>Total::' + data.totalRec + '</span>');
                $(".filtered_users").html('');
                var paginate = data.records.per_page;
                const possibleBlocks = Math.ceil(data.records.total / paginate);

                var sr_num = 1;
                function appendUserTableRow(index, id, first_name, phone, email, digistatus, roles) {
                    var baseUrl = window.location.protocol + '//' + window.location.host + window.location.pathname;
                    var editLink = '<a class="btn-yellow btn-sm text-decoration-none" href="'+ baseUrl + '/' + id + '/edit">Edit</a>';
                    var tableRow = '<tr><td>' + index + '</td><td>' + id + '</td><td>' + first_name + '</td><td>' + phone + '</td><td>' + email + '</td><td class="digistatus">' + digistatus + '</td><td>' + roles[0] + '</td><td>' + editLink + '</td></tr>';
                    $(".filtered_users").append(tableRow);
                }
                $.each(data.records.data, function (index, value) {
                    sr_num++;
                    // var segUrl = @json(Request::segment(count(Request::segments())));
                    $.ajax({
                        type: "GET",
                        url: '{{ url('admin/user-role/').'/'}}' + value.id,
                        data: {},
                        success: function (userRoles) {
                            var roles = userRoles.length === 0 ? '-' : userRoles;
                            var digistatus = '';

                            if (value.digilocker_verification_responce == 2) {
                                var userID = value.id;
                                $.ajax({
                                    type: "GET",
                                    url: '{{ url(app()->getLocale()).'/user/failed-digilocker-details/'}}',
                                    data: {
                                        'userID': userID
                                    },
                                    success: function (failedData) {
                                        digistatus = '<span class="text-red">Failed</span><div class="failDetail"><p class="Unmatched">(Unmatched Details)</p>';
                                        $.each(failedData.failedDetail, function (key, val) {
                                            if (val.digilocker_verification_responce != null) {
                                                var result = JSON.parse(val.digilocker_verification_responce).result;
                                                var name = result.name;
                                                var uid = result.uid;
                                                var dob = result.dob;
                                                var gender = result.gender;

                                                digistatus += '<p>' + name + ' -- ' + gender + '</p>';
                                                digistatus += '<p>' + uid + ' -- ' + dob + '</p>';
                                                digistatus += '<hr>';
                                            }
                                        });
                                        digistatus += '</div>';
                                        appendUserTableRow(sr_num, value.id, value.first_name, value.phone, value.email, digistatus, roles[0]);
                                    }
                                });
                            } else if (value.digilocker_verification_responce == null) {
                                digistatus = 'N/A';
                                appendUserTableRow(sr_num, value.id, value.first_name, value.phone, value.email, digistatus, roles[0]);
                            } else {
                                digistatus = '<span class="text-green">Completed</span>';
                                appendUserTableRow(sr_num, value.id, value.first_name, value.phone, value.email, digistatus, roles[0]);
                            }
                        }
                    });
                });

                $(".account_activity_pagination").html('');
                var bloc = '<nav class="d-flex justify-items-center justify-content-between"><ul class="pagination"><li class="page-item disabled" aria-disabled="true" aria-label="« Previous" style="display:none"><span class="page-link" aria-hidden="true">‹</span></li>';
                var from = 0;
                var to = paginate;

                for (i = 1; i <= possibleBlocks; i++) {
                    var bloc = bloc + '<li class="page-item" aria-current="page" onclick="getFilteredUsersData_withLimit(' + from + ',' + to + ')"><span class="page-link" style="border:1px solid #e2d8d8">' + i + '</span></li>';
                    from = from + paginate;
                    to = to + paginate;
                }

                var bloc = bloc + '<li class="page-item" style="display:none"><a class="page-link" href="#" rel="next" aria-label="Next »">›</a></li></ul></nav>';
                $(".account_activity_pagination").html(bloc);
            } else {
                triggerAlert('Record not found', 'error');
            }
        },
        complete: function (data) {
            $("#Userfilter_spinner").text("");
            $("#Userfilter_spinner").css("pointer-events", "none");
        },
        error: function (xhr, status, error) {
            var erroJson = JSON.parse(xhr.responseText);
            // alert(erroJson.error);
        }
    });
}
findPivotRow = function(n, mat, pivotRow, variables, k){
  for (i in 1:n){
    #finding the pivot row
    if(is.na(pivotRow)){
      print("PIVOT ROW IS NULL")
      pivotRow = i
    }else{
      if(mat[pivotRow, k] == 0){
        cat("Pivot element is zero! Trying to swap column with non-zero element...\n")
        nearestNonZeroColumn = findNearestNonZeroColumn(mat, pivotRow)
        cat("nonZeroCol")
        print(nearestNonZeroColumn)
        cat("BEFORE SWAP: \n")
        print(mat)
        cat("AFTER SWAP: \n")
        #Swapping the columns
        temp = mat[, k]
        mat[, k] = mat[, nearestNonZeroColumn]
        mat[, nearestNonZeroColumn] = temp
        #Swapping indexes of concerned variables in swapping
        temp = variables[k]
        variables[k] = variables[nearestNonZeroColumn]
        variables[nearestNonZeroColumn] = temp
        print(variables)
        print(mat)
      }
      if(mat[pivotRow, k] < mat[i, k]){
        pivotRow = i
      }
    }
    print(paste("Iteration: ", i))
    print(mat)
    print("Pivot row:")
    print(mat[pivotRow,])
    cat("\n")
  }
  return(pivotRow)
}
star

Fri Oct 13 2023 03:51:39 GMT+0000 (Coordinated Universal Time) https://practice.geeksforgeeks.org/problems/floor-in-bst/1

@DxBros #bst #binarysearchtree #floor

star

Thu Oct 12 2023 20:02:51 GMT+0000 (Coordinated Universal Time) https://stage.projects-delivery.com/wp/dean

@naveedrashid

star

Thu Oct 12 2023 20:00:59 GMT+0000 (Coordinated Universal Time)

@naveedrashid

star

Thu Oct 12 2023 19:58:26 GMT+0000 (Coordinated Universal Time)

@naveedrashid

star

Thu Oct 12 2023 19:55:02 GMT+0000 (Coordinated Universal Time) https://trumuse.com/product/bundles-and-hair-clips/

@naveedrashid

star

Thu Oct 12 2023 19:52:28 GMT+0000 (Coordinated Universal Time)

@Zenith

star

Thu Oct 12 2023 17:04:06 GMT+0000 (Coordinated Universal Time)

@morejacchi

star

Thu Oct 12 2023 16:42:58 GMT+0000 (Coordinated Universal Time) https://www.programiz.com/cpp-programming/online-compiler/

@70da_vic2002

star

Thu Oct 12 2023 16:28:16 GMT+0000 (Coordinated Universal Time) https://towardsdatascience.com/physics-informed-neural-networks-pinns-an-intuitive-guide-fff138069563

@nurdlalila306

star

Thu Oct 12 2023 16:26:06 GMT+0000 (Coordinated Universal Time) https://www.roblox.com/users/3430996158/profile?friendshipSourceType

@Serkirill

star

Thu Oct 12 2023 16:01:26 GMT+0000 (Coordinated Universal Time)

@niavimi

star

Thu Oct 12 2023 15:29:47 GMT+0000 (Coordinated Universal Time) https://play.tailwindcss.com/cSpMlF5BQj

@sadik #css #react.js #frontend #styling #tailwindcss

star

Thu Oct 12 2023 15:29:39 GMT+0000 (Coordinated Universal Time) https://play.tailwindcss.com/cSpMlF5BQj

@sadik #css #react.js #frontend #styling #tailwindcss

star

Thu Oct 12 2023 15:16:03 GMT+0000 (Coordinated Universal Time)

@Taimoor

star

Thu Oct 12 2023 15:09:02 GMT+0000 (Coordinated Universal Time)

@onlinecesaref #php

star

Thu Oct 12 2023 14:23:02 GMT+0000 (Coordinated Universal Time) https://www.codewars.com/kata/55f2b110f61eb01779000053/javascript

@Paloma

star

Thu Oct 12 2023 11:51:30 GMT+0000 (Coordinated Universal Time)

@Ajay1212

star

Thu Oct 12 2023 10:28:01 GMT+0000 (Coordinated Universal Time) https://www.addustechnologies.com/axie-infinity-clone-script

@irislee

star

Thu Oct 12 2023 09:49:20 GMT+0000 (Coordinated Universal Time) https://maticz.com/rpg-game-development

@Floralucy ##rpggamedevelopment ##roleplaygamedevelopment ##rpggame

star

Thu Oct 12 2023 09:49:20 GMT+0000 (Coordinated Universal Time) https://maticz.com/rpg-game-development

@Floralucy ##rpggamedevelopment ##roleplaygamedevelopment ##rpggame

star

Thu Oct 12 2023 09:16:41 GMT+0000 (Coordinated Universal Time)

@akaeyad

star

Thu Oct 12 2023 06:54:49 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/9419263/how-to-play-audio

@manami_13 #javascript

star

Thu Oct 12 2023 06:52:23 GMT+0000 (Coordinated Universal Time) https://iqcode.com/code/javascript/jquery-to-animate-a-flash-to-the-button-selected

@manami_13

star

Thu Oct 12 2023 06:27:05 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-us/microsoftteams/block-inbound-calls

@JasonB

star

Thu Oct 12 2023 04:04:53 GMT+0000 (Coordinated Universal Time)

@prachi

star

Thu Oct 12 2023 03:13:58 GMT+0000 (Coordinated Universal Time) https://www.thiscodeworks.com/cashapphack/65276451e785c200134567f4

@gina0993

star

Thu Oct 12 2023 03:13:21 GMT+0000 (Coordinated Universal Time)

@gina0993

star

Thu Oct 12 2023 02:01:51 GMT+0000 (Coordinated Universal Time)

@iliavial

star

Thu Oct 12 2023 01:50:38 GMT+0000 (Coordinated Universal Time)

@iliavial

star

Wed Oct 11 2023 22:25:15 GMT+0000 (Coordinated Universal Time) ketoverified.org

@theketoproject

star

Wed Oct 11 2023 20:44:08 GMT+0000 (Coordinated Universal Time) https://www.programiz.com/cpp-programming/online-compiler/

@70da_vic2002

star

Wed Oct 11 2023 16:02:16 GMT+0000 (Coordinated Universal Time)

@nikanika4425

star

Wed Oct 11 2023 15:50:57 GMT+0000 (Coordinated Universal Time)

@nikanika4425

star

Wed Oct 11 2023 14:35:58 GMT+0000 (Coordinated Universal Time)

@Yuvraj_Singh021

star

Wed Oct 11 2023 14:26:55 GMT+0000 (Coordinated Universal Time) https://www.programiz.com/cpp-programming/online-compiler/

@70da_vic2002

star

Wed Oct 11 2023 13:20:11 GMT+0000 (Coordinated Universal Time)

@destinyChuck #html #css #javascript

star

Wed Oct 11 2023 12:57:12 GMT+0000 (Coordinated Universal Time) https://www.programiz.com/cpp-programming/online-compiler/

@70da_vic2002

star

Wed Oct 11 2023 12:56:31 GMT+0000 (Coordinated Universal Time) https://www.programiz.com/cpp-programming/online-compiler/

@70da_vic2002

star

Wed Oct 11 2023 10:55:38 GMT+0000 (Coordinated Universal Time)

@rajbargoti

star

Wed Oct 11 2023 10:55:03 GMT+0000 (Coordinated Universal Time)

@rajbargoti

star

Wed Oct 11 2023 10:53:37 GMT+0000 (Coordinated Universal Time)

@rajbargoti

star

Wed Oct 11 2023 09:49:18 GMT+0000 (Coordinated Universal Time)

@banch3v

star

Wed Oct 11 2023 09:25:44 GMT+0000 (Coordinated Universal Time) https://technoderivation.com/sports-betting-website-development

@tdchainsingh

star

Wed Oct 11 2023 09:21:13 GMT+0000 (Coordinated Universal Time) https://technoderivation.com/grocery-app-development

@tdchainsingh

star

Wed Oct 11 2023 09:10:31 GMT+0000 (Coordinated Universal Time) https://technoderivation.com/food-delivery-app-development

@tdchainsingh

star

Wed Oct 11 2023 08:13:18 GMT+0000 (Coordinated Universal Time) https://resocoder.com/2019/09/30/hive-flutter-tutorial-lightweight-fast-database/

@Frankocitello #flutter

star

Wed Oct 11 2023 06:40:11 GMT+0000 (Coordinated Universal Time) https://play.tailwindcss.com/x7vMjleR9z

@sadik #css #react.js #frontend #styling #tailwindcss

star

Wed Oct 11 2023 06:22:26 GMT+0000 (Coordinated Universal Time)

@mradul

star

Wed Oct 11 2023 06:20:01 GMT+0000 (Coordinated Universal Time)

@mradul

star

Wed Oct 11 2023 06:12:22 GMT+0000 (Coordinated Universal Time)

@lawlaw #r

Save snippets that work with our extensions

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