Snippets Collections
function enqueue_swiper_assets() {
    wp_enqueue_style( 'swiper-css', 'https://unpkg.com/swiper/swiper-bundle.min.css', array(), '8.0.7' );
    wp_enqueue_script( 'swiper-js', 'https://unpkg.com/swiper/swiper-bundle.min.js', array('jquery'), '8.0.7', true );
}
add_action( 'wp_enqueue_scripts', 'enqueue_swiper_assets' );
document.getElementById('your-phone-number').addEventListener('input', (e) => { e.target.value = e.target.value.replace(/[^0-9+-]/g, ''); });
document.getElementById('your-first-name').addEventListener('input', (e) => { e.target.value = e.target.value.replace(/[^A-Za-z]/g, ''); });
add_filter('use_block_editor_for_post', '__return_false', 10);
add_filter('use_widgets_block_editor', '__return_false');
require_once get_template_directory() . '/template-parts/all-posttype.php';
require_once get_template_directory() . '/template-parts/all-shotcode.php';
<?php
function testi_loop()
{
    $arg = array(
        'post_type' => 'testimonial',
        'posts_per_page' => -1,
    );
    $testiPost = new WP_Query($arg); ?>
    <div class="testimonials-slider">
        <?php if ($testiPost->have_posts()): ?>
            <?php while ($testiPost->have_posts()): ?>
                <?php $testiPost->the_post();
                $url = wp_get_attachment_url(get_post_thumbnail_id($testiPost->ID)); ?>
                <div class="testi-inn">
                    <img src="<?php the_field('company_logo'); ?>" alt="">
                    <div class="testi-cont">
                        <?php the_content(); ?>
                    </div>
                    <div class="client-picture">
                        <img src="<?php echo $url; ?>" alt="testiProfile">
                        <h2>
                            <?php the_title(); ?>
                        </h2>
                    </div>
                </div>
            <?php endwhile; ?>
        <?php endif; ?>
    </div>
    <?php
    wp_reset_postdata();
}
add_shortcode('testi', 'testi_loop');
?>
<?php
function create_testimonial()
{
    $labels = array(
        'name' => _x('Testimonials', 'Post Type General Name', 'textdomain'),
        'singular_name' => _x('Testimonial ', 'Post Type Singular Name', 'textdomain'),
        'menu_name' => _x('Testimonials', 'Admin Menu text', 'textdomain'),
        'name_admin_bar' => _x('Testimonials ', 'Add New on Toolbar', 'textdomain'),
        'archives' => __('Testimonials  Archives', 'textdomain'),
        'attributes' => __('Testimonials  Attributes', 'textdomain'),
        'parent_item_colon' => __('Parent Testimonials :', 'textdomain'),
        'all_items' => __('All Testimonials', 'textdomain'),
        'add_new_item' => __('Add New Testimonials ', 'textdomain'),
        'add_new' => __('Add New', 'textdomain'),
        'new_item' => __('New Testimonials ', 'textdomain'),
        'edit_item' => __('Edit Testimonials ', 'textdomain'),
        'update_item' => __('Update Testimonials ', 'textdomain'),
        'view_item' => __('View Testimonials ', 'textdomain'),
        'view_items' => __('View Testimonials', 'textdomain'),
        'search_items' => __('Search Testimonials ', 'textdomain'),
        'not_found' => __('Not found', 'textdomain'),
        'not_found_in_trash' => __('Not found in Trash', 'textdomain'),
        'featured_image' => __('Featured Image', 'textdomain'),
        'set_featured_image' => __('Set featured image', 'textdomain'),
        'remove_featured_image' => __('Remove featured image', 'textdomain'),
        'use_featured_image' => __('Use as featured image', 'textdomain'),
        'insert_into_item' => __('Insert into Testimonials ', 'textdomain'),
        'uploaded_to_this_item' => __('Uploaded to this Testimonials ', 'textdomain'),
        'items_list' => __('Testimonials list', 'textdomain'),
        'items_list_navigation' => __('Testimonials list navigation', 'textdomain'),
        'filter_items_list' => __('Filter Testimonials list', 'textdomain'),
    );
    $rewrite = array(
        'slug' => 'testimonial',
        'with_front' => true,
        'pages' => true,
        'feeds' => true,
    );
    $args = array(
        'label' => __('Testimonial ', 'textdomain'),
        'description' => __('', 'textdomain'),
        'labels' => $labels,
        'menu_icon' => 'dashicons-format-chat',
        'supports' => array('title', 'editor', 'excerpt', 'thumbnail', 'page-attributes', 'post-formats', 'custom-fields'),
        'taxonomies' => array(),
        'public' => true,
        'show_ui' => true,
        'show_in_menu' => true,
        'menu_position' => 5,
        'show_in_admin_bar' => true,
        'show_in_nav_menus' => true,
        'can_export' => true,
        'has_archive' => true,
        'hierarchical' => true,
        'exclude_from_search' => true,
        'show_in_rest' => true,
        'publicly_queryable' => true,
        'capability_type' => 'post',
        'rewrite' => $rewrite,
    );
    register_post_type('testimonial', $args);
    register_taxonomy('testimonial_category', 'testimonial', array('hierarchical' => true, 'label' => 'Category', 'query_var' => true, 'rewrite' => array('slug' => 'testimonial-category')));
}
add_action('init', 'create_testimonial', 0);

?>

get_header();
if( get_field('page_builder') ){
    $page_builder = get_field('page_builder');
    //echo print_r( $page_builder);
    foreach ($page_builder as $key => $section) {
        include('builder-section/inc-'.$section['acf_fc_layout'].'.php');
    }
} else{?>
    <main id="primary" class="site-main">
    <?php
    if ( have_posts() ) while ( have_posts() ) : the_post();
            get_template_part( 'template-parts/content', 'page' );
            // If comments are open or we have at least one comment, load up the comment template.
            if ( comments_open() || get_comments_number() ) :
                comments_template();
            endif;
        endwhile; // End of the loop.
        ?>
    </main><!-- #main -->
<?php
get_sidebar();
}
n = int(input())
k = int(input())
print((n >> k) << k)
a = int(input())
k = int(input())
print(a | (1 << k))
n = int(input())
value = 1
b = False
while value < n:
    value *= 2
if value == n:
    b = True
if b:
    print("YES")
else:
    print("NO")
k = 6
n = 5
res = (1 << k) + (1 << n)
print(res)
// printf style
RCLCPP_WARN_SKIPFIRST(node->get_logger(), "My log message %d", 4);

// C++ stream style
RCLCPP_WARN_STREAM_SKIPFIRST(node->get_logger(), "My log message " << 4);
import 'package:flutter/material.dart';
import 'package:pets_home/utils.dart';

class CustomSignInButton extends StatelessWidget {
  final String imagePath;
  final String text;
  final VoidCallback onTap;

  const CustomSignInButton({
    Key? key,
    required this.imagePath,
    required this.text,
    required this.onTap,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onTap,
      child: Container(
        width: double.infinity,
        margin: EdgeInsets.symmetric(horizontal: calculateWidth(31)),
        padding: EdgeInsets.symmetric(horizontal: 0, vertical: calculateHeight(8)),
        decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(32), // Rounded corners
          border: Border.all(
            color: primaryColor, // Border color
            width: 2, // Border width
          ),
        ),
        child: Padding(
          padding: EdgeInsets.only(left: calculateWidth(54)),
          child: Row(
            mainAxisSize: MainAxisSize.min, // Adjusts based on content
            mainAxisAlignment: MainAxisAlignment.start,
            children: [
              Image.asset(
                imagePath,
                height: calculateHeight(50), // Size of the image
                width: calculateHeight(50),
              ),
              const SizedBox(width: 12), // Spacing between image and text
              Text(
                text,
                style: const TextStyle(
                  color: Colors.brown, // Text color
                  fontSize: 16, // Font size
                  fontWeight: FontWeight.bold,
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}



//call

     Column(
            children: [
              SizedBox(height: calculateHeight(29)),
              CustomSignInButton(
                imagePath: 'assets/google_icon.png', // Google logo path
                text: 'Sign in using Google',
                onTap: () {
                  print('Google Sign-in button tapped');
                  // Google login logic here
                },
              ),
              const SizedBox(height: 16), // Space between buttons
              CustomSignInButton(
                imagePath: 'assets/facebook_icon.png', // Facebook logo path
                text: 'Sign in using Facebook',
                onTap: () {
                  print('Facebook Sign-in button tapped');
                  // Facebook login logic here
                },
              ),
              const SizedBox(height: 16), // Space between buttons
              CustomSignInButton(
                imagePath: 'assets/apple_icon.png', // Apple logo path
                text: 'Sign in using Apple',
                onTap: () {
                  print('Apple Sign-in button tapped');
                  // Apple login logic here
                },
              ),
            ],
          ) 
const mem = [];

function read(n, k) {
    return mem[n] === undefined
           ? undefined
           : mem[n][k];
}

function write(n, k, value) {
    if (mem[n] === undefined) {
        mem[n] = [];
    }
    mem[n][k] = value;
}

function first_denomination(kinds_of_coins) {
    return kinds_of_coins === 1 ?   5 :
           kinds_of_coins === 2 ?  10 :
           kinds_of_coins === 3 ?  20 :
           kinds_of_coins === 4 ?  50 :
           kinds_of_coins === 5 ? 100 : 0;
}

// The non-memoized version.
function cc(amount, kinds_of_coins) {
    return amount === 0
           ? 1
           : amount < 0 || kinds_of_coins === 0
           ? 0
           : cc(amount, kinds_of_coins - 1)
             +
             cc(amount - first_denomination(kinds_of_coins),
                kinds_of_coins);
}

// The memoized version.
// n is the amount in cents, and k is the number of denominations.
function mcc(n, k) {
    if (n >= 0 && read(n, k) !== undefined) {
        return read(n, k);
    } else {
        const result = n === 0
                       ? 1
                       : n < 0 || k === 0
                       ? 0
                       : mcc(n, k-1) + mcc(n - first_denomination(k) , k);
      if ( n >= 0 &&  k >= 0){
         write(n, k, result);  
      } 
    return result;
    }
}

mcc(365, 5);  // Expected result: 1730
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button onclick="addElement()">Add new Element</button>
    <div id="container"></div>
    <script src="4_four_dom.js"></script>
</body>
</html>


function addElement(){
    let targetDiv = document.getElementById("container");
    function createElement(tag,className,id,content){
        let element = document.createElement(tag);
        if (className) element.className = className;
        if (id) element.id = id;
        if(content) element.content = content
        return element;
    }
    let main = createElement("section","section","section","this is new section");
    targetDiv.appendChild(main);
}
<!-- Start of Card Group - With top image and footnote -->
<div class="card-deck">
    <!-- Start of first card -->
    <div class="card"><img src="https://learning.aib.edu.au/draftfile.php/141150/user/draft/262622820/production%20line%20in%20a%20factory%20resized.png" class="card-img-top" alt="">
        <div class="card-body">
            <h5 class="card-title">Card header</h5>
            <p class="card-text"></p>
            <p>Card body text</p>
            <!-- Start of Show/Hide interface -->
            <p><a class="btn btn-primary btn-block collapsed" data-toggle="collapse" href="#CardHiddenContent1" role="button" aria-expanded="false" aria-controls="CardHiddenContent1"> More… </a></p>
            <div class="collapse" id="CardHiddenContent1" style="">
                <div class="card card-body">&nbsp;<span><span style="font-weight: bold;">
                            <p>Card body text</p><a class="btn-block btn btn-sm btn-light collapsed" data-toggle="collapse" href="#CardHiddenContent1" role="button" aria-expanded="false" aria-controls="CardHiddenContent1">Hide</a>
                        </span></span></div>
            </div>
            <!-- End of Show/Hide interface -->
        </div>
    </div>
    <!-- End of first card -->
    <!-- Start of second card -->
    <div class="card"><img src="https://learning.aib.edu.au/draftfile.php/141150/user/draft/262622820/three%20business%20women%20around%20a%20table%20resized.png" class="card-img-top" alt="">
        <div class="card-body">
            <h5 class="card-title">Card header</h5>
            <p class="card-text"></p>
            <p>Card body text</p>
            <!-- Start of Show/Hide interface -->
            <p><a class="btn btn-primary btn-block collapsed" data-toggle="collapse" href="#CardHiddenContent2" role="button" aria-expanded="false" aria-controls="CardHiddenContent2"> More… </a></p>
            <div class="collapse" id="CardHiddenContent2" style="">
                <div class="card card-body">
                    <p>Card body text</p><a class="btn-block btn btn-sm btn-light collapsed" data-toggle="collapse" href="#CardHiddenContent2" role="button" aria-expanded="false" aria-controls="CardHiddenContent2">Hide</a>
                </div>
            </div>
            <!-- End of Show/Hide interface -->
        </div>
    </div>
    <!-- End of second card -->
    <!-- Start of third card.  Delete if not required. -->
    <div class="card"><img src="https://learning.aib.edu.au/draftfile.php/141150/user/draft/262622820/Dress%20fitting%20resized.png" class="card-img-top" alt="">
        <div class="card-body">
            <h5 class="card-title">Card header</h5>
            <p class="card-text">Card body text</p>
            <!-- Start of Show/Hide interface -->
            <p><a class="btn btn-primary btn-block collapsed" data-toggle="collapse" href="#CardHiddenContent3" role="button" aria-expanded="false" aria-controls="CardHiddenContent3"> More… </a></p>
            <div class="collapse" id="CardHiddenContent3" style="">
                <div class="card card-body">
                    <p>Card body text</p><a class="btn-block btn btn-sm btn-light collapsed" data-toggle="collapse" href="#CardHiddenContent3" role="button" aria-expanded="false" aria-controls="CardHiddenContent3">Hide</a>
                </div>
            </div>
            <!-- End of Show/Hide interface -->
        </div>
    </div>
    <!-- End of third card -->
</div>
<!-- End of Card Group.-->
#include <iostream>
using namespace std;
  
double mx_num(double a, double b);
  
int main()
{
    double a,b;
    cout << "Введите число а" << endl;
    cin >> a;
    cout << "Введите число b" << endl;
    cin >> b;
    double mx = mx_num(a,b);
    cout << "Максимум из двух чисел: " << mx;
}
double mx_num(double a, double b)
{
    if(a > b)
    {
        return a;
    }
    else
    {
        return b;
    }

}
ffmpeg -i input_video.mp4 -i input_audio.m4a -c:v copy -c:a aac output.mp4
Do you want to create a centralized crypto exchange like Binance, Coinbase, KuCoin, Bybit, OKX, Kraken, HTX, Upbit, or MEXC? With Plurance's Market-Hit Crypto Exchange Clone Script, you can launch your platform in just 7 days, packed with advanced features that rival the biggest names in the industry.

🌟 Why Choose Plurance’s Crypto Exchange Clone Script?
⦁	Lightning-Fast Deployment
⦁	Advanced Trading Engine
⦁	Multi-Currency Support
⦁	Robust Security Protocols
⦁	Mobile & Web-Friendly Experience
⦁	Staking & Yield Farming
⦁	KYC/AML Integration
⦁	AI-powered Trading Bot

Your Crypto Exchange Dream is Closer Than You Think! With Plurance’s top-rated clone script, you can build the next big exchange and enter the market fully equipped for success.

Ready to lead the crypto revolution? Get started today and create a crypto exchange that stands out in 7 days or less!

Contact us now Or Book A Free Demo
npm create vite@latest

cd nume-proiect
npm install

git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin https://github.com/utilizator/nume-proiect.git
git push -u origin main

"scripts": {
  "build": "vite build",
  "deploy": "gh-pages -d dist"
}

npm install gh-pages --save-dev
npm run build
npm run deploy
$acf_gallery = get_field("gallery");

if (!empty($acf_gallery)){
    return[
        'post_type' => 'attachment',
        'post_mime_type' => 'image',
        'post_status' => 'inherit',
        'orderby' => 'post__in',
        'order' => 'ASC',
        'post__in' => '$acf_gallery',
        'posts_per_page' => -1,
    ];
}else{
    return[];
}
    select workflowtrackingstatustable where workflowtrackingstatustable.ContextRecId ==PurchTable.RecId
            && workflowtrackingstatustable.ContextTableId==PurchTable.TableId
            && (workflowtrackingstatustable.TrackingStatus==WorkflowTrackingStatus::Pending);

    select workflowtrackingtable order by workflowtrackingtable.createddatetime desc
        where workflowtrackingtable.WorkflowTrackingStatusTable ==workflowtrackingstatustable.RecId
        &&  workflowtrackingtable.TrackingType==WorkflowTrackingType::Creation
        &&  workflowtrackingtable.TrackingContext==WorkflowTrackingContext::Step
        join WorkflowStepTable where WorkflowStepTable.RecId==workflowtrackingtable.WorkflowStepTable && WorkflowStepTable.Name==PurchParameters::find().COOApprovalStep;
      
    if(workflowtrackingtable)
    {
        select workflowtrackingtableWorkItem order by workflowtrackingtableWorkItem.createddatetime desc
            where workflowtrackingtableWorkItem.WorkflowTrackingStatusTable ==workflowtrackingstatustable.RecId
            &&  (workflowtrackingtableWorkItem.TrackingType==WorkflowTrackingType::Creation ||  workflowtrackingtableWorkItem.TrackingType==WorkflowTrackingType::Delegation)
            &&  workflowtrackingtableWorkItem.TrackingContext==WorkflowTrackingContext::WorkItem;
    
        _user=workflowtrackingtableWorkItem.User;

        if( workflowtrackingtableWorkItem.TrackingType==WorkflowTrackingType:: Delegation)
        {
            _user= WorkflowTrackingWorkItem::findTrackingId(workflowtrackingtableWorkItem.TrackingId).ToUser;
        }

       
        if(_user==curUserId())
            NW_COODCOApprovalRequest.enabled(true);

    }
class DisjointSet {
    vector<int> rank, parent, size;
    
public:
    DisjointSet(int n) {
        rank.resize(n + 1, 0);
        parent.resize(n + 1);
        size.resize(n + 1, 1);
        for (int i = 0; i <= n; i++) {
            parent[i] = i;
        }
    }

    int findUPar(int node) {
        if (node == parent[node])
            return node;
        return parent[node] = findUPar(parent[node]); // Path compression
    }

    void unionByRank(int u, int v) {
        int pu = findUPar(u);
        int pv = findUPar(v);
        if (pu == pv) return;

        if (rank[pu] < rank[pv]) {
            parent[pu] = pv;
        } else if (rank[pv] < rank[pu]) {
            parent[pv] = pu;
        } else {
            parent[pv] = pu;
            rank[pu]++;
        }
    }

    void unionBySize(int u, int v) {
        int pu = findUPar(u);
        int pv = findUPar(v);
        if (pu == pv) return;

        if (size[pu] < size[pv]) {
            parent[pu] = pv;
            size[pv] += size[pu];
        } else {
            parent[pv] = pu;
            size[pu] += size[pv];
        }
    }
};

class Solution {
public:
    vector<int> sp(int n) {
        vector<int> spf(n + 1);
        for (int i = 0; i <= n; ++i) spf[i] = i;
        for (int i = 2; i * i <= n; ++i) {
            if (spf[i] == i) {
                for (int j = i * i; j <= n; j += i) {
                    if (spf[j] == j) spf[j] = i;
                }
            }
        }
        return spf;
    }

    vector<int> fac(int x, vector<int>& spf) {
        vector<int> f;
        while (x > 1) {
            int p = spf[x];
            f.push_back(p);
            while (x % p == 0) x /= p;
        }
        return f;
    }

    int largestComponentSize(vector<int>& nums) {
        int n = nums.size();
        int maxNum = *max_element(nums.begin(), nums.end());

        vector<int> spf = sp(maxNum);
        DisjointSet ds(maxNum + 1);

        for (int num : nums) {
            vector<int> primes = fac(num, spf);
            for (int prime : primes) {
                ds.unionBySize(num, prime); // Union by size
            }
        }

        unordered_map<int, int> cnt;
        int maxSize = 0;
        for (int num : nums) {
            int root = ds.findUPar(num);
            cnt[root]++;
            maxSize = max(maxSize, cnt[root]);
        }

        return maxSize;
    }
};
integers = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}

evens = {0, 2, 4, 6, 8}
odds = {1, 3, 5, 7, 9}

#check for subsets
print(integers.issubset(integers)) #it is a subset of itself
print(evens.issubset(integers)) #True
print(odds.issubset(integers)) #True
const aboutMe = {
  'workingOn': 'nothing',
  'learning': 'Python',
  'contactMe': 'hoangtam@duck.com',
  'pronouns': ['he', 'him']
}
import React, { Component } from 'react';
import Searchbar from '../components/Searchbar/Searchbar';
import ImageGallery from '../components/ImageGallery/ImageGallery';
import { getImages } from '../services/imgService';
import { Loader } from './Loader/Loader';
import styles from './App.module.css';
class App extends Component {
  state = {
    searchQuery: '',
    isLoading: false,
    images: [],
    error: '',
  };

  handleSearchSubmit = async searchQuery => {
    try {
      this.setState({ searchQuery, isLoading: true, error: '' });
      const images = await getImages(searchQuery);
      this.setState({ images });
    } catch (error) {
      if (error.code) {
        this.setState({ error: 'N-a fost gasit niciun rezultat.' });
      }
    } finally {
      this.setState({ isLoading: false });
    }
  };

  render() {
    const { images, error, isLoading } = this.state;

    return (
      <div className={styles.App}>
        {error && <div className={styles.error}>{error}</div>}
        <Searchbar onSubmit={this.handleSearchSubmit} />
        <div>{isLoading ? <Loader /> : <ImageGallery images={images} />}</div>
      </div>
    );
  }
}

export default App;
import React from 'react';
import { InfinitySpin } from 'react-loader-spinner'; 
import styles from '../Loader/Loader.module.css';

export const Loader = () => {
  return (
    <div className={styles.loader}>
      <InfinitySpin
        visible={true}
        width="200"
        color="#4fa94d"
        ariaLabel="infinity-spin-loading"
      />
    </div>
  );
};
curl https://get.telebit.io/ | bash
// Define the coordinates for the specific point (e.g., the location of interest)
var point = ee.Geometry.Point(90.2611485521762, 23.44690280909043);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// Add water bodies to the map
Map.addLayer(
  clippedWaterBodies,
  {palette: ['blue'], opacity: 0.5},
  'Water Bodies',
  false
);

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

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

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

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

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

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

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

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

ll fact[MAX] = {1};

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

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

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

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

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

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

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

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

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

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

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

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

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

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

typedef long long ll;

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

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

int main() {
  cout << gcd(12, 18) << endl;
  cout << gcd(0, 18) << endl;
  cout << lcm(12, 18) << endl;
  return 0;
}
>>> def factorial(number):
...     # Validate input
...     if not isinstance(number, int):
...         raise TypeError("Sorry. 'number' must be an integer.")
...     if number < 0:
...         raise ValueError("Sorry. 'number' must be zero or positive.")
...     # Calculate the factorial of number
...     def inner_factorial(number):
...         if number <= 1:
...             return 1
...         return number * inner_factorial(number - 1)
...     return inner_factorial(number)
...

>>> factorial(4)
24
#include <iostream>
#include <vector>
using namespace std;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

package com.mycompany.countdown;

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

package com.mycompany.countdown;

public class Countdown {

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

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

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

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



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

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

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

    // change the html class name
    if (container.classList.contains('shortlist')) {
      container.classList.replace('shortlist', 'longlist');
      container.style.maxHeight = `${listHeight}px`;
    } else {
      container.classList.replace('longlist', 'shortlist');
      container.style.maxHeight = '13rem';
    }
  }
star

Tue Oct 22 2024 10:41:11 GMT+0000 (Coordinated Universal Time)

@Huzaifa

star

Tue Oct 22 2024 10:39:51 GMT+0000 (Coordinated Universal Time)

@Huzaifa

star

Tue Oct 22 2024 10:39:28 GMT+0000 (Coordinated Universal Time)

@Huzaifa

star

Tue Oct 22 2024 10:35:50 GMT+0000 (Coordinated Universal Time)

@Huzaifa

star

Tue Oct 22 2024 10:35:07 GMT+0000 (Coordinated Universal Time)

@Huzaifa

star

Tue Oct 22 2024 10:33:12 GMT+0000 (Coordinated Universal Time)

@Huzaifa

star

Tue Oct 22 2024 10:19:14 GMT+0000 (Coordinated Universal Time)

@Huzaifa

star

Tue Oct 22 2024 10:18:05 GMT+0000 (Coordinated Universal Time)

@BilalRaza12

star

Tue Oct 22 2024 08:49:22 GMT+0000 (Coordinated Universal Time) https://www.rginfotech.com/human-resource-management-software/

@kishanrg #hrms #humanresource management software #besthrsoftware #rginfotech #workforcemanagement

star

Tue Oct 22 2024 08:43:44 GMT+0000 (Coordinated Universal Time)

@Yakostoch #python

star

Tue Oct 22 2024 08:43:10 GMT+0000 (Coordinated Universal Time)

@Yakostoch #python

star

Tue Oct 22 2024 08:42:19 GMT+0000 (Coordinated Universal Time)

@Yakostoch #python

star

Tue Oct 22 2024 08:40:50 GMT+0000 (Coordinated Universal Time)

@Yakostoch #python

star

Tue Oct 22 2024 07:18:20 GMT+0000 (Coordinated Universal Time) https://docs.ros.org/en/foxy/Tutorials/Demos/Logging-and-logger-configuration.html

@ahanie

star

Tue Oct 22 2024 07:13:41 GMT+0000 (Coordinated Universal Time)

@hasnat #dart #flutter #custom #signin

star

Tue Oct 22 2024 05:51:50 GMT+0000 (Coordinated Universal Time) https://share.sourceacademy.nus.edu.sg/studio10quiz

@hkrishn4a

star

Mon Oct 21 2024 23:42:29 GMT+0000 (Coordinated Universal Time) https://chatgpt.com/share/6716e5b0-d970-8008-a2ad-cab19af2692f

@humdanaliiii

star

Mon Oct 21 2024 23:29:25 GMT+0000 (Coordinated Universal Time)

@humdanaliiii

star

Mon Oct 21 2024 23:11:48 GMT+0000 (Coordinated Universal Time) https://learning.aib.edu.au/mod/book/edit.php?cmid

@ediegeue

star

Mon Oct 21 2024 21:37:12 GMT+0000 (Coordinated Universal Time)

@Yakostoch

star

Mon Oct 21 2024 20:21:23 GMT+0000 (Coordinated Universal Time)

@2late

star

Mon Oct 21 2024 16:07:09 GMT+0000 (Coordinated Universal Time) undefined

@uijkoijkm

star

Mon Oct 21 2024 11:51:48 GMT+0000 (Coordinated Universal Time) https://www.plurance.com/market-hit-centralized-crypto-exchange-clone-script

@valentinaruth

star

Mon Oct 21 2024 11:21:08 GMT+0000 (Coordinated Universal Time) https://nounq.com/digital-marketing-for-law-firms

@deepika

star

Mon Oct 21 2024 11:10:02 GMT+0000 (Coordinated Universal Time) https://www.coinsclone.com/blockchain-in-finance/

@AaronMG

star

Mon Oct 21 2024 11:09:25 GMT+0000 (Coordinated Universal Time)

@RAGNA

star

Mon Oct 21 2024 09:12:15 GMT+0000 (Coordinated Universal Time)

@riyadhbin

star

Mon Oct 21 2024 08:32:34 GMT+0000 (Coordinated Universal Time)

@MinaTimo

star

Mon Oct 21 2024 07:38:51 GMT+0000 (Coordinated Universal Time)

@utp #c++

star

Sun Oct 20 2024 22:33:19 GMT+0000 (Coordinated Universal Time) https://tpwebvs.xyz/ludomatch.php

@trthunder

star

Sun Oct 20 2024 21:17:46 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/set-issubset-method-in-python/

@pynerds #python

star

Sun Oct 20 2024 19:27:19 GMT+0000 (Coordinated Universal Time) https://app.grapesjs.com/studio

@Wanets☕ ##html ##js

star

Sun Oct 20 2024 18:56:45 GMT+0000 (Coordinated Universal Time)

@hctdev

star

Sun Oct 20 2024 14:46:55 GMT+0000 (Coordinated Universal Time)

@RAGNA

star

Sun Oct 20 2024 14:46:36 GMT+0000 (Coordinated Universal Time)

@RAGNA

star

Sun Oct 20 2024 11:46:28 GMT+0000 (Coordinated Universal Time) https://telebit.cloud/

@noteclipse

star

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

@Rehbar #javascript

star

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

@utp #c++

star

Sun Oct 20 2024 07:01:47 GMT+0000 (Coordinated Universal Time) https://realpython.com/inner-functions-what-are-they-good-for/#creating-python-inner-functions

@CallTheCops

star

Sun Oct 20 2024 07:01:12 GMT+0000 (Coordinated Universal Time) undefined

@CallTheCops

star

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

@utp #c++

star

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

@utp #c++

star

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

@utp #c++

star

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

@Saging #java

star

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

@Saging #java

star

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

@ghostbusted #sql #dune.xyz

star

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

@ghostbusted

star

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

@auskur_actual

Save snippets that work with our extensions

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