Snippets Collections
from flask import Flask, request, jsonify, send_file
import os
import uuid
import PyPDF2
import json
import matplotlib.pyplot as plt
import tempfile

app = Flask(__name__)

# In-memory storage for simplicity
transactions_db = {}

# Helper function to parse PDF and extract transactions
def extract_transactions_from_pdf(pdf_path):
    transactions = []
    try:
        with open(pdf_path, 'rb') as file:
            reader = PyPDF2.PdfReader(file)
            for page in reader.pages:
                text = page.extract_text()
                # Assuming the transactions are in a simple format for demonstration purposes
                for line in text.split('\n'):
                    if 'Transaction' in line:
                        # Extracting transaction details (this is a simplified example)
                        details = line.split(',')
                        transactions.append({
                            "date": details[0],
                            "description": details[1],
                            "amount": float(details[2])
                        })
    except Exception as e:
        print(f"Error extracting transactions: {e}")
    return transactions

# 1. Upload PDF Statement
@app.route('/upload_statement', methods=['POST'])
def upload_statement():
    if 'file' not in request.files:
        return jsonify({"error": "No file part"}), 400

    file = request.files['file']
    if file.filename == '':
        return jsonify({"error": "No selected file"}), 400

    if file:
        # Save the file temporarily
        temp_file_path = os.path.join(tempfile.gettempdir(), str(uuid.uuid4()) + ".pdf")
        file.save(temp_file_path)
        
        # Extract transactions from the PDF
        transactions = extract_transactions_from_pdf(temp_file_path)
        os.remove(temp_file_path)
        
        # Store transactions in a mock database
        user_id = request.form.get('user_id', 'default_user')
        if user_id not in transactions_db:
            transactions_db[user_id] = []
        transactions_db[user_id].extend(transactions)
        
        return jsonify({"message": "Transactions uploaded successfully.", "transactions": transactions}), 200

# 2. Get Transactions
@app.route('/get_transactions', methods=['GET'])
def get_transactions():
    user_id = request.args.get('user_id', 'default_user')
    transactions = transactions_db.get(user_id, [])
    return jsonify({"transactions": transactions}), 200

# 3. Generate Graph Data (category-wise spending in this example)
def generate_category_wise_data(transactions):
    category_data = {}
    for txn in transactions:
        category = txn.get("description", "Others")
        amount = txn.get("amount", 0)
        if category in category_data:
            category_data[category] += amount
        else:
            category_data[category] = amount
    return category_data

# 4. Get Graphs
@app.route('/get_graph', methods=['GET'])
def get_graph():
    user_id = request.args.get('user_id', 'default_user')
    transactions = transactions_db.get(user_id, [])
    if not transactions:
        return jsonify({"error": "No transactions found for the user."}), 404

    # Generate category-wise spending data
    category_data = generate_category_wise_data(transactions)

    # Plotting the data
    labels = list(category_data.keys())
    sizes = list(category_data.values())

    fig, ax = plt.subplots()
    ax.pie(sizes, labels=labels, autopct='%1.1f%%', startangle=90)
    ax.axis('equal')  # Equal aspect ratio ensures that pie is drawn as a circle.

    # Save the graph to a temporary file
    graph_path = os.path.join(tempfile.gettempdir(), str(uuid.uuid4()) + ".png")
    plt.savefig(graph_path)
    plt.close(fig)

    return send_file(graph_path, mimetype='image/png')

if __name__ == '__main__':
    app.run(debug=True, port=5000)
#include <iostream>
using namespace std;
double input(double& x)
{
    cout << "Введите число: " << endl;
    cin >> x;
    return x;
}

int main()
{
    setlocale(LC_ALL, "");
    double a = input(a);
    double b = input(b);
    if (a > b)
    {
        cout << "Наибольшее число: " << a << endl;
    }
    else
    {
        cout << "Наибольшее число: " << b << endl;
    }
}
#include <iostream>
using namespace std;

int main()
{
    int a[10][10], b[10][10], mult[10][10], r1, c1, r2, c2, i, j, k;

    cout << "Enter rows and columns for first matrix: ";
    cin >> r1 >> c1;
    cout << "Enter rows and columns for second matrix: ";
    cin >> r2 >> c2;

    // If column of first matrix in not equal to row of second matrix,
    // ask the user to enter the size of matrix again.
    while (c1!=r2)
    {
        cout << "Error! column of first matrix not equal to row of second.";

        cout << "Enter rows and columns for first matrix: ";
        cin >> r1 >> c1;

        cout << "Enter rows and columns for second matrix: ";
        cin >> r2 >> c2;
    }

    // Storing elements of first matrix.
    cout << endl << "Enter elements of matrix 1:" << endl;
    for(i = 0; i < r1; ++i)
        for(j = 0; j < c1; ++j)
        {
            cout << "Enter element a" << i + 1 << j + 1 << " : ";
            cin >> a[i][j];
        }

    // Storing elements of second matrix.
    cout << endl << "Enter elements of matrix 2:" << endl;
    for(i = 0; i < r2; ++i)
        for(j = 0; j < c2; ++j)
        {
            cout << "Enter element b" << i + 1 << j + 1 << " : ";
            cin >> b[i][j];
        }

    // Initializing elements of matrix mult to 0.
    for(i = 0; i < r1; ++i)
        for(j = 0; j < c2; ++j)
        {
            mult[i][j]=0;
        }

    // Multiplying matrix a and b and storing in array mult.
    for(i = 0; i < r1; ++i)
        for(j = 0; j < c2; ++j)
            for(k = 0; k < c1; ++k)
            {
                mult[i][j] += a[i][k] * b[k][j];
            }

    // Displaying the multiplication of two matrix.
    cout << endl << "Output Matrix: " << endl;
    for(i = 0; i < r1; ++i)
    for(j = 0; j < c2; ++j)
    {
        cout << " " << mult[i][j];
        if(j == c2-1)
            cout << endl;
    }

    return 0;
}
query_map = Map();
query_map.put("estimate_number", books_quote_number);
info query_map;
fetch_quote = invokeUrl
[
  url: "https://www.zohoapis.com/books/v3/estimates?organization_id="+organization_id
  type: GET
  parameters:query_map
  connection: "zoho_apps_connection"
];
info fetch_quote;
0x608060405234801561000f575f5ffd5b5060043610610091575f3560e01c8063313ce56711610064578063313ce5671461013157806370a082311461014f57806395d89b411461017f578063a9059cbb1461019d578063dd62ed3e146101cd57610091565b806306fdde0314610095578063095ea7b3146100b357806318160ddd146100e357806323b872dd14610101575b5f5ffd5b61009d6101fd565b6040516100aa9190610a5a565b60405180910390f35b6100cd60048036038101906100c89190610b0b565b61028d565b6040516100da9190610b63565b60405180910390f35b6100eb6102af565b6040516100f89190610b8b565b60405180910390f35b61011b60048036038101906101169190610ba4565b6102b8565b6040516101289190610b63565b60405180910390f35b6101396102e6565b6040516101469190610c0f565b60405180910390f35b61016960048036038101906101649190610c28565b6102ee565b6040516101769190610b8b565b60405180910390f35b610187610333565b6040516101949190610a5a565b60405180910390f35b6101b760048036038101906101b29190610b0b565b6103c3565b6040516101c49190610b63565b60405180910390f35b6101e760048036038101906101e29190610c53565b6103e5565b6040516101f49190610b8b565b60405180910390f35b60606003805461020c90610cbe565b80601f016020809104026020016040519081016040528092919081815260200182805461023890610cbe565b80156102835780601f1061025a57610100808354040283529160200191610283565b820191905f5260205f20905b81548152906001019060200180831161026657829003601f168201915b5050505050905090565b5f5f610297610467565b90506102a481858561046e565b600191505092915050565b5f600254905090565b5f5f6102c2610467565b90506102cf858285610480565b6102da858585610512565b60019150509392505050565b5f6012905090565b5f5f5f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b60606004805461034290610cbe565b80601f016020809104026020016040519081016040528092919081815260200182805461036e90610cbe565b80156103b95780601f10610390576101008083540402835291602001916103b9565b820191905f5260205f20905b81548152906001019060200180831161039c57829003601f168201915b5050505050905090565b5f5f6103cd610467565b90506103da818585610512565b600191505092915050565b5f60015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905092915050565b5f33905090565b61047b8383836001610602565b505050565b5f61048b84846103e5565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461050c57818110156104fd578281836040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526004016104f493929190610cfd565b60405180910390fd5b61050b84848484035f610602565b5b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610582575f6040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081526004016105799190610d32565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036105f2575f6040517fec442f050000000000000000000000000000000000000000000000000000000081526004016105e99190610d32565b60405180910390fd5b6105fd8383836107d1565b505050565b5f73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603610672575f6040517fe602df050000000000000000000000000000000000000000000000000000000081526004016106699190610d32565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036106e2575f6040517f94280d620000000000000000000000000000000000000000000000000000000081526004016106d99190610d32565b60405180910390fd5b8160015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f208190555080156107cb578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516107c29190610b8b565b60405180910390a35b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610821578060025f8282546108159190610d78565b925050819055506108ef565b5f5f5f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050818110156108aa578381836040517fe450d38c0000000000000000000000000000000000000000000000000000000081526004016108a193929190610cfd565b60405180910390fd5b8181035f5f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550505b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610936578060025f8282540392505081905550610980565b805f5f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516109dd9190610b8b565b60405180910390a3505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f610a2c826109ea565b610a3681856109f4565b9350610a46818560208601610a04565b610a4f81610a12565b840191505092915050565b5f6020820190508181035f830152610a728184610a22565b905092915050565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610aa782610a7e565b9050919050565b610ab781610a9d565b8114610ac1575f5ffd5b50565b5f81359050610ad281610aae565b92915050565b5f819050919050565b610aea81610ad8565b8114610af4575f5ffd5b50565b5f81359050610b0581610ae1565b92915050565b5f5f60408385031215610b2157610b20610a7a565b5b5f610b2e85828601610ac4565b9250506020610b3f85828601610af7565b9150509250929050565b5f8115159050919050565b610b5d81610b49565b82525050565b5f602082019050610b765f830184610b54565b92915050565b610b8581610ad8565b82525050565b5f602082019050610b9e5f830184610b7c565b92915050565b5f5f5f60608486031215610bbb57610bba610a7a565b5b5f610bc886828701610ac4565b9350506020610bd986828701610ac4565b9250506040610bea86828701610af7565b9150509250925092565b5f60ff82169050919050565b610c0981610bf4565b82525050565b5f602082019050610c225f830184610c00565b92915050565b5f60208284031215610c3d57610c3c610a7a565b5b5f610c4a84828501610ac4565b91505092915050565b5f5f60408385031215610c6957610c68610a7a565b5b5f610c7685828601610ac4565b9250506020610c8785828601610ac4565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f6002820490506001821680610cd557607f821691505b602082108103610ce857610ce7610c91565b5b50919050565b610cf781610a9d565b82525050565b5f606082019050610d105f830186610cee565b610d1d6020830185610b7c565b610d2a6040830184610b7c565b949350505050565b5f602082019050610d455f830184610cee565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f610d8282610ad8565b9150610d8d83610ad8565b9250828201905080821115610da557610da4610d4b565b5b9291505056fea26469706673582212206d60701d5bb79bcaf1c6919ec949bc991833d68f6ba003c05e344c7c971d6c6464736f6c634300081c0033
$GLOBALS['TYPO3_CONF_VARS'] = array_replace_recursive(
    $GLOBALS['TYPO3_CONF_VARS'],
    [
            'SYS' => [
                'caching' => [
                    'cacheConfigurations' => [
                        'pages' => [
                            'backend' => 'TYPO3\\CMS\\Core\\Cache\\Backend\\NullBackend',
                            'frontend' => 'TYPO3\\CMS\\Core\\Cache\\Frontend\\NullFrontend',
                        ],
                        'rootline' => [
                            'backend' => 'TYPO3\\CMS\\Core\\Cache\\Backend\\NullBackend',
                            'frontend' => 'TYPO3\\CMS\\Core\\Cache\\Frontend\\NullFrontend',
                        ],
                        'l10n' => [
                            'backend' => 'TYPO3\\CMS\\Core\\Cache\\Backend\\NullBackend',
                            'frontend' => 'TYPO3\\CMS\\Core\\Cache\\Frontend\\NullFrontend',
                        ],
                    ],
                ],
            ],
        ]
);
https://underscores.me/
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
    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-10-01';
var endDate = '2017-10-31';

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

ll fact[MAX] = {1};

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

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

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

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

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

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

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

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

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

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

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

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

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

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

typedef long long ll;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

package com.mycompany.countdown;

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

package com.mycompany.countdown;

public class Countdown {

    public static void main(String[] args) {
        
        //part 1
        for (int i = 0; i <= 5; i++) {
        System.out.println("" + i);
        }
        
        System.out.println("");
        
        //part 2
        for (int i = 0; i <= 20; i++) {
            
        int evenorodd = i%2;
        if (evenorodd == 0) {
            System.out.println("" + i);
        }
        }
    }
}
star

Tue Oct 22 2024 23:32:06 GMT+0000 (Coordinated Universal Time)

@abhinavchopra22

star

Tue Oct 22 2024 19:27:15 GMT+0000 (Coordinated Universal Time)

@Yakostoch

star

Tue Oct 22 2024 17:06:44 GMT+0000 (Coordinated Universal Time) https://www.programiz.com/cpp-programming/examples/matrix-multiplication

@theshruvie

star

Tue Oct 22 2024 14:48:49 GMT+0000 (Coordinated Universal Time)

@RehmatAli2024 #deluge

star

Tue Oct 22 2024 14:26:44 GMT+0000 (Coordinated Universal Time) https://etherscan.io/address/0xc9ffd90a99d99734e21d80363e73b314eab7b2d7

@mathewmerlin72

star

Tue Oct 22 2024 11:48:25 GMT+0000 (Coordinated Universal Time)

@dphillips #php #cache

star

Tue Oct 22 2024 11:37:00 GMT+0000 (Coordinated Universal Time)

@Huzaifa

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 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 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

Save snippets that work with our extensions

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